Skip to content

Commit

Permalink
Add option for enabling install targets
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal authored and krzysztof-jusiak committed Jun 19, 2024
1 parent c048f62 commit 5ae8ab4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 5ae8ab4

Please sign in to comment.