From 5ae8ab42fc8fde67a2afbc033bef7c469e40d95c Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 19 Jun 2024 21:35:38 +0700 Subject: [PATCH] Add option for enabling install targets --- CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b8f8271..6cf3c3f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,11 +26,12 @@ option(BOOST_UT_ENABLE_SANITIZERS "Run static analysis" OFF) option(BOOST_UT_BUILD_BENCHMARKS "Build the benchmarks" OFF) option(BOOST_UT_BUILD_EXAMPLES "Build the examples" ${PROJECT_IS_TOP_LEVEL}) option(BOOST_UT_BUILD_TESTS "Build the tests" ${PROJECT_IS_TOP_LEVEL}) +option(BOOST_UT_ENABLE_INSTALL "Enable install targets" ${PROJECT_IS_TOP_LEVEL}) option(BOOST_UT_USE_WARNINGS_AS_ERORS "Build the tests" ${PROJECT_IS_TOP_LEVEL}) option(BOOST_UT_DISABLE_MODULE "Disable ut module" OFF) option(BOOST_UT_ALLOW_CPM_USE "Do not reach out across network for CPM" ON) -if(NOT CMAKE_SKIP_INSTALL_RULES) +if(BOOST_UT_ENABLE_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES) if(BOOST_UT_ALLOW_CPM_USE) # ---- Add dependencies via CPM ---- # see https://github.com/cpm-cmake/CPM.cmake for more info @@ -83,7 +84,7 @@ if(BOOST_UT_DISABLE_MODULE) target_compile_definitions(ut INTERFACE BOOST_UT_DISABLE_MODULE) endif() -if(NOT CMAKE_SKIP_INSTALL_RULES) +if(BOOST_UT_ENABLE_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES) # Create target Boost::ut and install target packageProject( NAME ${PROJECT_NAME}