| 1 |
cmake_minimum_required(VERSION 2.8) |
| 2 |
|
| 3 |
if(POLICY CMP0054) |
| 4 |
cmake_policy(SET CMP0054 NEW) |
| 5 |
endif() |
| 6 |
|
| 7 |
set(EXAMPLES |
| 8 |
capitalize |
| 9 |
condense |
| 10 |
filterkey |
| 11 |
filterkeydom |
| 12 |
jsonx |
| 13 |
lookaheadparser |
| 14 |
messagereader |
| 15 |
parsebyparts |
| 16 |
pretty |
| 17 |
prettyauto |
| 18 |
schemavalidator |
| 19 |
serialize |
| 20 |
simpledom |
| 21 |
simplereader |
| 22 |
simplepullreader |
| 23 |
simplewriter |
| 24 |
sortkeys |
| 25 |
tutorial) |
| 26 |
|
| 27 |
include_directories("../include/") |
| 28 |
|
| 29 |
add_definitions(-D__STDC_FORMAT_MACROS) |
| 30 |
set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS}) |
| 31 |
|
| 32 |
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") |
| 33 |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") |
| 34 |
endif() |
| 35 |
|
| 36 |
add_executable(archivertest archiver/archiver.cpp archiver/archivertest.cpp) |
| 37 |
|
| 38 |
foreach (example ${EXAMPLES}) |
| 39 |
add_executable(${example} ${example}/${example}.cpp) |
| 40 |
endforeach() |
| 41 |
|
| 42 |
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
| 43 |
target_link_libraries(parsebyparts pthread) |
| 44 |
endif() |
| 45 |
|
| 46 |
add_custom_target(examples ALL DEPENDS ${EXAMPLES}) |