]> andersk Git - libyaml.git/blob - CMakeLists.txt
cmake: Provide support for building dynamic and static libraries.
[libyaml.git] / CMakeLists.txt
1 # Minimal CMake project for building a static library under Windows.
2
3 cmake_minimum_required (VERSION 2.8)
4 project (yaml C)
5
6 set (YAML_VERSION_MAJOR 0)
7 set (YAML_VERSION_MINOR 1)
8 set (YAML_VERSION_PATCH 7)
9 set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}")
10
11 file (GLOB SRC src/*.c)
12
13 include_directories (include win32)
14 add_library (yaml SHARED ${SRC})
15 set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_EXPORT -DHAVE_CONFIG_H")
16
17 add_library (yaml_static STATIC ${SRC})
18 set_target_properties(yaml_static PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_STATIC -DHAVE_CONFIG_H")
19
20 add_executable (test-version tests/test-version.c)
21 target_link_libraries(test-version yaml)
22 add_test(NAME version COMMAND test-version)
23
24 add_executable (test-reader tests/test-reader.c)
25 target_link_libraries(test-reader yaml)
26 add_test(NAME reader COMMAND test-reader)
27
28 enable_testing()
This page took 0.271743 seconds and 5 git commands to generate.