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) 8set (YAML_VERSION_PATCH 7) 9set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VERSION_PATCH}") 10 11file (GLOB SRC src/*.c) 12 13include_directories (include win32) 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") 19 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() 29