Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/onqtam/doctest.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeverMine17 <dannevergame@gmail.com>2017-10-28 16:06:43 +0300
committeronqtam <vik.kirilov@gmail.com>2017-10-29 17:08:35 +0300
commitb63bf85ca872c5fd7f53c2e6d97f61813298936d (patch)
treeadd1a1c93c7c36d3f31b9944201c706d56e81b8e /CMakeLists.txt
parentffb753069a2c56569c539708505784847462c559 (diff)
Added an option to not install Doctest in CMake (#96)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt45
1 files changed, 24 insertions, 21 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54416bf3..c0a7ed5b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,7 @@ project(doctest VERSION ${ver})
option(DOCTEST_WITH_TESTS "Build tests/examples" ON)
option(DOCTEST_WITH_MAIN_IN_STATIC_LIB "Build a static lib (cmake target) with a main entry point" ON)
+option(DOCTEST_NO_INSTALL "Skip the installation process" OFF)
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(${PROJECT_NAME} INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/doctest/>)
@@ -56,24 +57,26 @@ write_basic_package_version_file(
configure_file("scripts/cmake/Config.cmake.in" "${project_config}" @ONLY)
-install(
- TARGETS ${PROJECT_NAME}
- EXPORT "${targets_export_name}"
- INCLUDES DESTINATION "${include_install_dir}"
-)
-
-install(
- FILES "doctest/doctest.h"
- DESTINATION "${include_install_dir}"
-)
-
-install(
- FILES "${project_config}" "${version_config}"
- DESTINATION "${config_install_dir}"
-)
-
-install(
- EXPORT "${targets_export_name}"
- NAMESPACE "${namespace}"
- DESTINATION "${config_install_dir}"
-)
+if (${DOCTEST_NO_INSTALL})
+ install(
+ TARGETS ${PROJECT_NAME}
+ EXPORT "${targets_export_name}"
+ INCLUDES DESTINATION "${include_install_dir}"
+ )
+
+ install(
+ FILES "doctest/doctest.h"
+ DESTINATION "${include_install_dir}"
+ )
+
+ install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}"
+ )
+
+ install(
+ EXPORT "${targets_export_name}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}"
+ )
+endif()