File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.23 )
22
33option (REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS } )
4+ option (REFLECTCPP_INSTALL "Install reflect cpp" OFF )
45
56option (REFLECTCPP_JSON "Enable JSON support" ON ) # enabled by default
67option (REFLECTCPP_AVRO "Enable AVRO support" OFF )
@@ -122,6 +123,10 @@ endif ()
122123
123124project (reflectcpp VERSION 0.19.0 LANGUAGES CXX )
124125
126+ if (PROJECT_IS_TOP_LEVEL)
127+ set (REFLECTCPP_INSTALL ON )
128+ endif ()
129+
125130if (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 )
309314endif ()
310315
311- if (PROJECT_IS_TOP_LEVEL )
316+ if (REFLECTCPP_INSTALL )
312317 include (GNUInstallDirs )
313318 include (CMakePackageConfigHelpers )
314319
You can’t perform that action at this time.
0 commit comments