rapidjson/example/CMakeLists.txt

47 lines
982 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 2.8)
2016-04-21 23:12:31 +08:00
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
set(EXAMPLES
capitalize
condense
filterkey
filterkeydom
2016-02-09 00:09:39 +08:00
jsonx
2017-03-08 01:08:41 -08:00
lookaheadparser
messagereader
2016-02-21 17:23:23 +08:00
parsebyparts
pretty
prettyauto
2016-01-29 15:24:23 +08:00
schemavalidator
serialize
simpledom
simplereader
2017-02-04 00:47:43 -08:00
simplepullreader
simplewriter
2018-12-04 22:40:40 +01:00
sortkeys
tutorial)
include_directories("../include/")
2016-02-09 00:53:49 +08:00
add_definitions(-D__STDC_FORMAT_MACROS)
set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
2016-02-09 00:53:49 +08:00
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif()
add_executable(archivertest archiver/archiver.cpp archiver/archivertest.cpp)
foreach (example ${EXAMPLES})
add_executable(${example} ${example}/${example}.cpp)
endforeach()
2016-03-04 16:37:04 +08:00
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_link_libraries(parsebyparts pthread)
endif()
add_custom_target(examples ALL DEPENDS ${EXAMPLES})