Skip to content

Commit 2a0fdea

Browse files
BestITUserEUWPhilemon Benner
andauthored
added REFLECTCPP_INSTALL to allow user to control if required (#453)
Co-authored-by: Philemon Benner <philemon.benner@arrowtec.de>
1 parent 907c815 commit 2a0fdea

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
cmake_minimum_required(VERSION 3.23)
22

33
option(REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS})
4+
option(REFLECTCPP_INSTALL "Install reflect cpp" OFF)
45

56
option(REFLECTCPP_JSON "Enable JSON support" ON) # enabled by default
67
option(REFLECTCPP_AVRO "Enable AVRO support" OFF)
@@ -122,6 +123,10 @@ endif ()
122123

123124
project(reflectcpp VERSION 0.19.0 LANGUAGES CXX)
124125

126+
if (PROJECT_IS_TOP_LEVEL)
127+
set(REFLECTCPP_INSTALL ON)
128+
endif()
129+
125130
if (REFLECTCPP_BUILD_SHARED)
126131
add_library(reflectcpp SHARED)
127132
set_target_properties(reflectcpp PROPERTIES SOVERSION ${PROJECT_VERSION})
@@ -308,7 +313,7 @@ if (REFLECTCPP_BUILD_BENCHMARKS)
308313
add_subdirectory(benchmarks)
309314
endif ()
310315

311-
if (PROJECT_IS_TOP_LEVEL)
316+
if (REFLECTCPP_INSTALL)
312317
include(GNUInstallDirs)
313318
include(CMakePackageConfigHelpers)
314319

0 commit comments

Comments
 (0)