Skip to content

Commit d00dd1f

Browse files
authored
add CMake option tomlplusplus_INSTALL (#240)
1 parent c4369ae commit d00dd1f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ target_include_directories(
3131
target_compile_features(tomlplusplus_tomlplusplus INTERFACE cxx_std_17)
3232

3333
# ---- Install rules, examples, and fuzzing ----
34-
if(PROJECT_IS_TOP_LEVEL)
34+
if (tomlplusplus_INSTALL)
3535
include(cmake/install-rules.cmake)
36+
endif()
37+
38+
if(PROJECT_IS_TOP_LEVEL)
3639
option(BUILD_EXAMPLES "Build examples tree." OFF)
3740
option(BUILD_FUZZER "Build fuzzer." OFF)
3841
if(BUILD_EXAMPLES)

cmake/variables.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# This is to provide a user experience similar to find_package when
66
# add_subdirectory or FetchContent is used to consume this project
77
set(tomlplusplus_warning_guard "")
8+
option(tomlplusplus_INSTALL "Enable generation of tomlplusplus install targets" ${PROJECT_IS_TOP_LEVEL})
89
if(NOT PROJECT_IS_TOP_LEVEL)
910
option(
1011
tomlplusplus_INCLUDES_WITH_SYSTEM

0 commit comments

Comments
 (0)