2017-10-18 23:07:17 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
# metadata
|
|
|
|
set(META_PROJECT_TYPE library)
|
2018-01-20 18:10:58 +01:00
|
|
|
set(META_HEADER_ONLY_LIB ON)
|
2017-10-18 23:07:17 +02:00
|
|
|
|
|
|
|
# add project files
|
2019-02-09 21:25:11 +01:00
|
|
|
set(HEADER_FILES traits.h)
|
|
|
|
set(SRC_FILES)
|
|
|
|
set(TEST_HEADER_FILES)
|
|
|
|
set(TEST_SRC_FILES)
|
|
|
|
set(CMAKE_MODULE_FILES cmake/modules/ReflectionGenerator.cmake)
|
|
|
|
set(DOC_FILES README.md)
|
2017-10-18 23:07:17 +02:00
|
|
|
|
2017-11-17 22:04:01 +01:00
|
|
|
# add JSON-specific sources
|
2019-02-09 21:25:11 +01:00
|
|
|
if (RapidJSON_FOUND)
|
2020-01-26 20:42:03 +01:00
|
|
|
list(
|
|
|
|
APPEND
|
|
|
|
HEADER_FILES
|
|
|
|
json/reflector.h
|
|
|
|
json/reflector-boosthana.h
|
|
|
|
json/reflector-chronoutilities.h
|
|
|
|
json/serializable.h
|
|
|
|
json/errorhandling.h)
|
2019-12-06 16:51:47 +01:00
|
|
|
list(APPEND TEST_SRC_FILES tests/jsonreflector.cpp tests/jsonreflector-boosthana.cpp
|
2020-01-26 20:42:03 +01:00
|
|
|
tests/jsonreflector-chronoutilities.cpp)
|
2019-02-09 21:25:11 +01:00
|
|
|
endif ()
|
2017-11-17 22:04:01 +01:00
|
|
|
|
2018-06-23 14:35:43 +02:00
|
|
|
# add binary (de)serialization specific sources
|
2019-12-06 16:51:47 +01:00
|
|
|
list(APPEND HEADER_FILES binary/reflector.h binary/reflector-boosthana.h binary/reflector-chronoutilities.h
|
2020-01-26 20:42:03 +01:00
|
|
|
binary/serializable.h)
|
2019-12-06 16:51:47 +01:00
|
|
|
list(APPEND TEST_SRC_FILES tests/traits.cpp tests/binaryreflector.cpp tests/binaryreflector-boosthana.cpp)
|
2018-06-23 14:35:43 +02:00
|
|
|
|
2018-01-12 15:55:10 +01:00
|
|
|
# add (only) the CMake module and include dirs for c++utilities because we're not depending on the actual library
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
|
2018-06-23 14:35:43 +02:00
|
|
|
if (CPP_UTILITIES_SOURCE_DIR)
|
2019-06-20 22:53:03 +02:00
|
|
|
list(APPEND PUBLIC_INCLUDE_DIRS $<BUILD_INTERFACE:${CPP_UTILITIES_SOURCE_DIR}/..>
|
2020-01-26 20:42:03 +01:00
|
|
|
$<INSTALL_INTERFACE:${CPP_UTILITIES_INCLUDE_DIRS}>)
|
2019-02-09 21:25:11 +01:00
|
|
|
else ()
|
2019-06-20 22:53:03 +02:00
|
|
|
list(APPEND PUBLIC_INCLUDE_DIRS "${CPP_UTILITIES_INCLUDE_DIRS}")
|
2019-02-09 21:25:11 +01:00
|
|
|
endif ()
|
2017-10-28 18:24:12 +02:00
|
|
|
|
|
|
|
# find RapidJSON, also add only the include dirs because RapidJSON is a header-only library
|
2019-02-09 21:25:11 +01:00
|
|
|
if (RapidJSON_FOUND)
|
2019-06-20 22:53:03 +02:00
|
|
|
list(APPEND PUBLIC_INCLUDE_DIRS ${RAPIDJSON_INCLUDE_DIRS})
|
2019-02-09 21:25:11 +01:00
|
|
|
endif ()
|
2017-10-18 23:07:17 +02:00
|
|
|
|
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(LibraryTarget)
|
|
|
|
include(TestTarget)
|
|
|
|
include(Doxygen)
|
|
|
|
include(ConfigHeader)
|