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