2017-10-18 23:07:17 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
# metadata
|
2017-10-25 17:41:19 +02:00
|
|
|
set(META_PROJECT_NAME reflective_rapidjson_generator)
|
2017-10-18 23:07:17 +02:00
|
|
|
set(META_PROJECT_TYPE application)
|
|
|
|
set(LINK_TESTS_AGAINST_APP_TARGET ON)
|
|
|
|
|
|
|
|
# add project files
|
|
|
|
set(HEADER_FILES
|
2017-10-25 15:38:45 +02:00
|
|
|
codegenerator.h
|
2017-10-28 16:31:07 +02:00
|
|
|
jsonserializationcodegenerator.h
|
2017-10-25 15:38:45 +02:00
|
|
|
codefactory.h
|
2017-10-21 00:32:42 +02:00
|
|
|
frontendaction.h
|
|
|
|
consumer.h
|
|
|
|
visitor.h
|
|
|
|
clangversionabstraction.h
|
2017-10-18 23:07:17 +02:00
|
|
|
)
|
|
|
|
set(SRC_FILES
|
2017-10-25 15:38:45 +02:00
|
|
|
codegenerator.cpp
|
2017-10-28 16:31:07 +02:00
|
|
|
jsonserializationcodegenerator.cpp
|
2017-10-25 15:38:45 +02:00
|
|
|
codefactory.cpp
|
2017-10-21 00:32:42 +02:00
|
|
|
frontendaction.cpp
|
|
|
|
consumer.cpp
|
|
|
|
clangversionabstraction.cpp
|
|
|
|
visitor.cpp
|
2017-10-18 23:07:17 +02:00
|
|
|
main.cpp
|
|
|
|
)
|
|
|
|
set(TEST_HEADER_FILES
|
2017-10-25 18:25:34 +02:00
|
|
|
tests/structs.h
|
|
|
|
tests/helper.h
|
2017-10-18 23:07:17 +02:00
|
|
|
)
|
|
|
|
set(TEST_SRC_FILES
|
|
|
|
tests/cppunit.cpp
|
2017-10-25 18:25:34 +02:00
|
|
|
tests/jsongenerator.cpp
|
2017-10-18 23:07:17 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# find c++utilities
|
|
|
|
find_package(c++utilities 4.11.0 REQUIRED)
|
|
|
|
use_cpp_utilities()
|
|
|
|
|
|
|
|
# find libclang
|
|
|
|
find_package(Clang REQUIRED)
|
2017-10-21 00:32:42 +02:00
|
|
|
list(APPEND PRIVATE_LIBRARIES clangTooling)
|
|
|
|
|
|
|
|
# also add reflective_rapidjson
|
2017-10-18 23:07:17 +02:00
|
|
|
list(APPEND PRIVATE_LIBRARIES reflective_rapidjson)
|
|
|
|
|
2017-10-24 01:00:40 +02:00
|
|
|
# trigger code generator for tests
|
|
|
|
include(ReflectionGenerator)
|
|
|
|
add_reflection_generator_invocation(
|
2017-10-25 18:25:34 +02:00
|
|
|
INPUT_FILES tests/structs.h tests/cppunit.cpp
|
2017-10-24 01:00:40 +02:00
|
|
|
GENERATORS json
|
2017-10-25 17:32:03 +02:00
|
|
|
OUTPUT_LISTS TEST_HEADER_FILES
|
2017-10-24 01:00:40 +02:00
|
|
|
)
|
|
|
|
|
2017-10-18 23:07:17 +02:00
|
|
|
# include modules to apply configuration
|
|
|
|
include(BasicConfig)
|
|
|
|
include(WindowsResources)
|
|
|
|
include(AppTarget)
|
|
|
|
include(TestTarget)
|
|
|
|
include(ShellCompletion)
|
2017-10-23 00:41:10 +02:00
|
|
|
include(Doxygen)
|
2017-10-18 23:07:17 +02:00
|
|
|
include(ConfigHeader)
|