mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-29 22:36:19 +08:00
added REFLECTCPP_INSTALL to allow user to control if required (#453)
Co-authored-by: Philemon Benner <philemon.benner@arrowtec.de>
This commit is contained in:
co-authored by
Philemon Benner
parent
907c815939
commit
2a0fdeabe3
+6
-1
@@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
|
||||
option(REFLECTCPP_BUILD_SHARED "Build shared library" ${BUILD_SHARED_LIBS})
|
||||
option(REFLECTCPP_INSTALL "Install reflect cpp" OFF)
|
||||
|
||||
option(REFLECTCPP_JSON "Enable JSON support" ON) # enabled by default
|
||||
option(REFLECTCPP_AVRO "Enable AVRO support" OFF)
|
||||
@@ -122,6 +123,10 @@ endif ()
|
||||
|
||||
project(reflectcpp VERSION 0.19.0 LANGUAGES CXX)
|
||||
|
||||
if (PROJECT_IS_TOP_LEVEL)
|
||||
set(REFLECTCPP_INSTALL ON)
|
||||
endif()
|
||||
|
||||
if (REFLECTCPP_BUILD_SHARED)
|
||||
add_library(reflectcpp SHARED)
|
||||
set_target_properties(reflectcpp PROPERTIES SOVERSION ${PROJECT_VERSION})
|
||||
@@ -308,7 +313,7 @@ if (REFLECTCPP_BUILD_BENCHMARKS)
|
||||
add_subdirectory(benchmarks)
|
||||
endif ()
|
||||
|
||||
if (PROJECT_IS_TOP_LEVEL)
|
||||
if (REFLECTCPP_INSTALL)
|
||||
include(GNUInstallDirs)
|
||||
include(CMakePackageConfigHelpers)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user