mirror of
https://github.com/catchorg/Catch2.git
synced 2025-02-22 14:13:30 +01:00
Install Catch only when run as standalone project
This commit is contained in:
parent
c778848b09
commit
27dca5d9c9
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.0)
|
|||||||
# detect if Catch is being bundled,
|
# detect if Catch is being bundled,
|
||||||
# disable testsuite in that case
|
# disable testsuite in that case
|
||||||
if(NOT DEFINED PROJECT_NAME)
|
if(NOT DEFINED PROJECT_NAME)
|
||||||
set(NOT_SUBPROJECT ON)
|
set(CATCH_NOT_SUBPROJECT ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(Catch2 LANGUAGES CXX VERSION 2.1.1)
|
project(Catch2 LANGUAGES CXX VERSION 2.1.1)
|
||||||
@ -304,7 +304,7 @@ endif()
|
|||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
if (BUILD_TESTING AND NOT_SUBPROJECT)
|
if (BUILD_TESTING AND CATCH_NOT_SUBPROJECT)
|
||||||
add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${REPORTER_SOURCES} ${SURROGATE_SOURCES} ${HEADERS})
|
add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${REPORTER_SOURCES} ${SURROGATE_SOURCES} ${HEADERS})
|
||||||
target_include_directories(SelfTest PRIVATE ${HEADER_DIR})
|
target_include_directories(SelfTest PRIVATE ${HEADER_DIR})
|
||||||
|
|
||||||
@ -386,20 +386,19 @@ if(CATCH_BUILD_EXAMPLES)
|
|||||||
add_subdirectory(examples)
|
add_subdirectory(examples)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(DIRECTORY "single_include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/catch")
|
if(DEFINED CATCH_NOT_SUBPROJECT)
|
||||||
|
install(DIRECTORY "single_include/" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/catch")
|
||||||
|
install(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}")
|
||||||
|
|
||||||
install(DIRECTORY docs/ DESTINATION "${CMAKE_INSTALL_DOCDIR}")
|
## Provide some pkg-config integration
|
||||||
|
# Don't bother on Windows
|
||||||
## Provide some pkg-config integration
|
if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
||||||
# Don't bother on Windows
|
set(PKGCONFIG_INSTALL_DIR
|
||||||
if(NOT WIN32 OR NOT CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
|
"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
|
||||||
|
CACHE PATH "Path where catch.pc is installed"
|
||||||
set(PKGCONFIG_INSTALL_DIR
|
)
|
||||||
"${CMAKE_INSTALL_DATAROOTDIR}/pkgconfig"
|
|
||||||
CACHE PATH "Path where catch.pc is installed"
|
|
||||||
)
|
|
||||||
|
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/catch.pc.in ${CMAKE_CURRENT_BINARY_DIR}/catch.pc @ONLY)
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catch.pc DESTINATION ${PKGCONFIG_INSTALL_DIR})
|
|
||||||
|
|
||||||
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/catch.pc.in ${CMAKE_CURRENT_BINARY_DIR}/catch.pc @ONLY)
|
||||||
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/catch.pc DESTINATION ${PKGCONFIG_INSTALL_DIR})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user