reflective-rapidjson/lib/CMakeLists.txt

57 lines
1.4 KiB
CMake
Raw Normal View History

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)
# add project files
set(HEADER_FILES
)
set(SRC_FILES
)
set(TEST_HEADER_FILES
)
set(TEST_SRC_FILES
tests/cppunit.cpp
)
set(CMAKE_MODULE_FILES
cmake/modules/ReflectionGenerator.cmake
)
set(DOC_FILES
README.md
)
# add JSON-specific sources
if(RapidJSON_FOUND)
list(APPEND HEADER_FILES
json/reflector.h
json/reflector-boosthana.h
json/reflector-chronoutilities.h
json/serializable.h
json/errorhandling.h
)
list(APPEND TEST_SRC_FILES
tests/jsonreflector.cpp
tests/jsonreflector-boosthana.cpp
tests/jsonreflector-chronoutilities.cpp
)
endif()
# 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})
list(APPEND PUBLIC_SHARED_INCLUDE_DIRS "${CPP_UTILITIES_INCLUDE_DIRS}")
list(APPEND PUBLIC_STATIC_INCLUDE_DIRS "${CPP_UTILITIES_INCLUDE_DIRS}")
2017-10-28 18:24:12 +02:00
# find RapidJSON, also add only the include dirs because RapidJSON is a header-only library
if(RapidJSON_FOUND)
list(APPEND PUBLIC_SHARED_INCLUDE_DIRS ${RAPIDJSON_INCLUDE_DIRS})
list(APPEND PUBLIC_STATIC_INCLUDE_DIRS ${RAPIDJSON_INCLUDE_DIRS})
endif()
# include modules to apply configuration
include(BasicConfig)
include(LibraryTarget)
include(TestTarget)
include(Doxygen)
include(ConfigHeader)