CMakeLists.txt 891 Bytes
Newer Older
1
cmake_minimum_required(VERSION 2.8)
2

3 4 5 6
if(POLICY CMP0054)
  cmake_policy(SET CMP0054 NEW)
endif()

7 8 9
set(EXAMPLES
    capitalize
    condense
10 11
    filterkey
    filterkeydom
Milo Yip's avatar
Milo Yip committed
12
    jsonx
13
    lookaheadparser
14
    messagereader
Milo Yip's avatar
Milo Yip committed
15
    parsebyparts
16 17
    pretty
    prettyauto
18
    schemavalidator
19 20 21
    serialize
    simpledom
    simplereader
StilesCrisis's avatar
StilesCrisis committed
22
    simplepullreader
23 24
    simplewriter
    tutorial)
25 26
    
include_directories("../include/")
27

28
add_definitions(-D__STDC_FORMAT_MACROS)
29
set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
30

31
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
32
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
33 34
endif()

35
foreach (example ${EXAMPLES})
36
    add_executable(${example} ${example}/${example}.cpp)
37
endforeach()
38

Milo Yip's avatar
Milo Yip committed
39 40 41 42
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    target_link_libraries(parsebyparts pthread)
endif()

43
add_custom_target(examples ALL DEPENDS ${EXAMPLES})