Debian Codegraph @

yaml-filter/CMakeLists.txt

raw
1 cmake_minimum_required(VERSION 2.8)
2 project(yaml-path C)
3
4 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
5
6 include(FindPkgConfig)
7 pkg_check_modules(YAML yaml-0.1)
8 find_package(codecov)
9
10 include_directories(${YAML_INCLUDE_DIRS} src)
11
12 add_library(yaml-path src/yaml-path.c)
13 target_link_libraries(yaml-path ${YAML_LIBRARIES})
14 add_coverage(yaml-path)
15
16 add_executable(yamlp src/yamlp.c)
17 target_link_libraries(yamlp yaml-path)
18 add_coverage(yamlp)
19
20 install(TARGETS yamlp RUNTIME DESTINATION bin)
21
22 if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU" OR ${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
23 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe -std=c99 -W -Wall -Wnonnull -Wshadow -Wformat -Wundef -Wno-unused-parameter -Wmissing-prototypes -Wno-unknown-pragmas -D_GNU_SOURCE -D_POSIX_C_SOURCE=200112L")
24 endif()
25 if(${CMAKE_SYSTEM_NAME} EQUAL "Solaris")
26 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D__EXTENSIONS__")
27 endif()
28 if(WIN32)
29 # Expose new WinAPI function appearing on Windows 7 (e.g. inet_pton)
30 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_WIN32_WINNT=0x0600")
31 endif()
32 if(APPLE)
33 # Full Single Unix Standard v3 (SUSv3) conformance (the Unix API)
34 add_definitions(-D_DARWIN_C_SOURCE)
35 endif()
36
37 enable_testing()
38 add_subdirectory("tests")
39
40 coverage_evaluate()
41