2014-04-17 02:58:51 +02:00
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
project (valijson)
|
|
|
|
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
set(Boost_USE_MULTITHREADED ON)
|
|
|
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
|
|
|
|
2014-04-17 23:31:18 +02:00
|
|
|
find_package(Boost 1.55.0 COMPONENTS regex REQUIRED)
|
2014-04-17 02:58:51 +02:00
|
|
|
|
|
|
|
# jsoncpp library
|
|
|
|
add_library(jsoncpp
|
2015-03-15 02:24:34 +01:00
|
|
|
thirdparty/jsoncpp-0.9.4/src/lib_json/json_reader.cpp
|
|
|
|
thirdparty/jsoncpp-0.9.4/src/lib_json/json_value.cpp
|
|
|
|
thirdparty/jsoncpp-0.9.4/src/lib_json/json_writer.cpp
|
2014-04-17 02:58:51 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Build local gtest
|
|
|
|
add_subdirectory(thirdparty/gtest-1.7.0)
|
|
|
|
|
|
|
|
# Include path
|
2015-02-04 13:59:48 +01:00
|
|
|
include_directories(
|
|
|
|
include
|
|
|
|
thirdparty/gtest-1.7.0/include
|
2015-03-15 02:24:34 +01:00
|
|
|
thirdparty/jsoncpp-0.9.4/include
|
2015-02-04 13:59:48 +01:00
|
|
|
thirdparty/rapidjson-0.1/include
|
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
)
|
2014-04-17 02:58:51 +02:00
|
|
|
|
2015-03-15 05:38:40 +01:00
|
|
|
# Custom schema validation example
|
|
|
|
add_executable(custom_schema
|
|
|
|
examples/custom_schema.cpp
|
|
|
|
)
|
|
|
|
|
2014-06-15 07:24:26 +02:00
|
|
|
# External schema validation example
|
|
|
|
add_executable(external_schema
|
|
|
|
examples/external_schema.cpp
|
|
|
|
)
|
|
|
|
|
2014-04-17 02:58:51 +02:00
|
|
|
# Unit tests executable
|
|
|
|
add_executable(test_suite
|
|
|
|
tests/test_adapter_comparison.cpp
|
2015-05-04 03:03:59 +02:00
|
|
|
tests/test_fetch_document_callback.cpp
|
2014-04-17 02:58:51 +02:00
|
|
|
tests/test_jsoncpp_adapter.cpp
|
|
|
|
tests/test_property_tree_adapter.cpp
|
|
|
|
tests/test_rapidjson_adapter.cpp
|
|
|
|
tests/test_uri_resolution.cpp
|
|
|
|
tests/test_validation_errors.cpp
|
|
|
|
tests/test_validator.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
set(TEST_LIBS gtest gtest_main jsoncpp)
|
|
|
|
|
|
|
|
target_link_libraries(test_suite ${TEST_LIBS} ${Boost_LIBRARIES})
|
2015-03-15 05:38:40 +01:00
|
|
|
target_link_libraries(custom_schema ${Boost_LIBRARIES})
|
2014-06-15 07:24:26 +02:00
|
|
|
target_link_libraries(external_schema ${Boost_LIBRARIES})
|
2015-03-15 05:38:40 +01:00
|
|
|
|