mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 04:34:46 +02:00
Disable installation step when Catch is used as a subproject
This is because otherwise the installations paths provided via GNUInstallDirs become messed up and parts of the installation package will end up in the wrong place. Also it doesn't make much sense to force dependees to also install our header alongside them. Closes #1373
This commit is contained in:
@@ -91,9 +91,12 @@ target_include_directories(Catch2
|
||||
# provide a namespaced alias for clients to 'link' against if catch is included as a sub-project
|
||||
add_library(Catch2::Catch2 ALIAS Catch2)
|
||||
|
||||
# Only perform the installation steps when Catch is not being used as
|
||||
# a subproject via `add_subdirectory`, or the destinations will break,
|
||||
# see https://github.com/catchorg/Catch2/issues/1373
|
||||
if (NOT_SUBPROJECT)
|
||||
set(CATCH_CMAKE_CONFIG_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Catch2")
|
||||
|
||||
include(CMakePackageConfigHelpers)
|
||||
configure_package_config_file(
|
||||
${CMAKE_CURRENT_LIST_DIR}/CMake/Catch2Config.cmake.in
|
||||
${CMAKE_CURRENT_BINARY_DIR}/Catch2Config.cmake
|
||||
@@ -190,3 +193,5 @@ install(
|
||||
DESTINATION
|
||||
${PKGCONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
endif(NOT_SUBPROJECT)
|
||||
|
Reference in New Issue
Block a user