Adjust indentation

This commit is contained in:
Jeremy 2023-11-15 00:36:02 -05:00
parent bb487d3e56
commit 37a3ea7978
No known key found for this signature in database
GPG Key ID: BE03111EB7ED6E2E
4 changed files with 51 additions and 51 deletions

View File

@ -3,67 +3,67 @@ include(CMakePackageConfigHelpers)
# copy header files to CMAKE_INSTALL_INCLUDEDIR # copy header files to CMAKE_INSTALL_INCLUDEDIR
# don't include third party header files # don't include third party header files
install( install(
DIRECTORY DIRECTORY
"${PROJECT_SOURCE_DIR}/include/" # our header files "${PROJECT_SOURCE_DIR}/include/" # our header files
"${PROJECT_BINARY_DIR}/include/" # generated header files "${PROJECT_BINARY_DIR}/include/" # generated header files
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT ${package_name}-development COMPONENT ${package_name}-development
# PATTERN "**/third_party" EXCLUDE # skip third party directory # PATTERN "**/third_party" EXCLUDE # skip third party directory
# PATTERN "**/third_party/**" EXCLUDE # skip third party files # PATTERN "**/third_party/**" EXCLUDE # skip third party files
) )
# copy target build output artifacts to OS dependent locations # copy target build output artifacts to OS dependent locations
# (Except includes, that just sets a compiler flag with the path) # (Except includes, that just sets a compiler flag with the path)
install( install(
TARGETS ${target_name} TARGETS ${target_name}
EXPORT ${package_name}-targets EXPORT ${package_name}-targets
RUNTIME # RUNTIME #
COMPONENT ${package_name}-runtime COMPONENT ${package_name}-runtime
LIBRARY # LIBRARY #
COMPONENT ${package_name}-runtime COMPONENT ${package_name}-runtime
NAMELINK_COMPONENT ${package_name}-development NAMELINK_COMPONENT ${package_name}-development
ARCHIVE # ARCHIVE #
COMPONENT ${package_name}-development COMPONENT ${package_name}-development
INCLUDES # INCLUDES #
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
) )
# create config file that points to targets file # create config file that points to targets file
configure_file( configure_file(
"${PROJECT_SOURCE_DIR}/cmake/in/cpptrace-config-cmake.in" "${PROJECT_SOURCE_DIR}/cmake/in/cpptrace-config-cmake.in"
"${PROJECT_BINARY_DIR}/cmake/${package_name}-config.cmake" "${PROJECT_BINARY_DIR}/cmake/${package_name}-config.cmake"
@ONLY @ONLY
) )
# copy config file for find_package to find # copy config file for find_package to find
install( install(
FILES "${PROJECT_BINARY_DIR}/cmake/${package_name}-config.cmake" FILES "${PROJECT_BINARY_DIR}/cmake/${package_name}-config.cmake"
DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}" DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}"
COMPONENT ${package_name}-development COMPONENT ${package_name}-development
) )
# create version file for consumer to check version in CMake # create version file for consumer to check version in CMake
write_basic_package_version_file( write_basic_package_version_file(
"${package_name}-config-version.cmake" "${package_name}-config-version.cmake"
COMPATIBILITY SameMajorVersion # a.k.a SemVer COMPATIBILITY SameMajorVersion # a.k.a SemVer
) )
# copy version file for find_package to find for version check # copy version file for find_package to find for version check
install( install(
FILES "${PROJECT_BINARY_DIR}/${package_name}-config-version.cmake" FILES "${PROJECT_BINARY_DIR}/${package_name}-config-version.cmake"
DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}" DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}"
COMPONENT ${package_name}-development COMPONENT ${package_name}-development
) )
# create targets file included by config file with targets for consumers # create targets file included by config file with targets for consumers
install( install(
EXPORT ${package_name}-targets EXPORT ${package_name}-targets
NAMESPACE cpptrace:: NAMESPACE cpptrace::
DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}" DESTINATION "${CPPTRACE_INSTALL_CMAKEDIR}"
COMPONENT ${package_name}-development COMPONENT ${package_name}-development
) )
# support packaging library # support packaging library
if(PROJECT_IS_TOP_LEVEL) if(PROJECT_IS_TOP_LEVEL)
include(CPack) include(CPack)
endif() endif()

View File

@ -44,15 +44,15 @@ endif()
# add_subdirectory or FetchContent is used to consume this project. # add_subdirectory or FetchContent is used to consume this project.
set(warning_guard ) set(warning_guard )
if(NOT PROJECT_IS_TOP_LEVEL) if(NOT PROJECT_IS_TOP_LEVEL)
option( option(
CPPTRACE_INCLUDES_WITH_SYSTEM CPPTRACE_INCLUDES_WITH_SYSTEM
"Use SYSTEM modifier for ${package_name}'s includes, disabling warnings" "Use SYSTEM modifier for ${package_name}'s includes, disabling warnings"
ON ON
) )
mark_as_advanced(CPPTRACE_INCLUDES_WITH_SYSTEM) mark_as_advanced(CPPTRACE_INCLUDES_WITH_SYSTEM)
if(CPPTRACE_INCLUDES_WITH_SYSTEM) if(CPPTRACE_INCLUDES_WITH_SYSTEM)
set(warning_guard SYSTEM) set(warning_guard SYSTEM)
endif() endif()
endif() endif()
# ---- Enable Testing ---- # ---- Enable Testing ----
@ -89,8 +89,8 @@ mark_as_advanced(CPPTRACE_BUILD_TESTING)
# unexpected errors. # unexpected errors.
if(PROJECT_IS_TOP_LEVEL) if(PROJECT_IS_TOP_LEVEL)
set( set(
CMAKE_INSTALL_INCLUDEDIR "include/${package_name}-${PROJECT_VERSION}" CMAKE_INSTALL_INCLUDEDIR "include/${package_name}-${PROJECT_VERSION}"
CACHE STRING "" CACHE STRING ""
) )
# marked as advanced in GNUInstallDirs version, so we follow their lead # marked as advanced in GNUInstallDirs version, so we follow their lead
mark_as_advanced(CMAKE_INSTALL_INCLUDEDIR) mark_as_advanced(CMAKE_INSTALL_INCLUDEDIR)

View File

@ -1,8 +1,8 @@
# In-source build guard # In-source build guard
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message( message(
FATAL_ERROR FATAL_ERROR
"In-source builds are not supported. " "In-source builds are not supported. "
"You may need to delete 'CMakeCache.txt' and 'CMakeFiles/' before rebuilding this project." "You may need to delete 'CMakeCache.txt' and 'CMakeFiles/' before rebuilding this project."
) )
endif() endif()

View File

@ -1,6 +1,6 @@
# This variable is set by project() in CMake 3.21+ # This variable is set by project() in CMake 3.21+
string( string(
COMPARE EQUAL COMPARE EQUAL
"${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}"
PROJECT_IS_TOP_LEVEL PROJECT_IS_TOP_LEVEL
) )