summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJohn Kirkham <kirkhamj@janelia.hhmi.org>2016-06-02 00:16:28 -0400
committerJohn Kirkham <kirkhamj@janelia.hhmi.org>2017-02-22 00:00:03 -0500
commit300bd3f89e7ee0b581b5df2550486126abc47baf (patch)
treebc162ca669bfab108624a5234dfdedf6375b2df9 /CMakeLists.txt
parentc9878e19bdd9e6a0af55c1b420d4e941b28ed6c6 (diff)
downloadlibyaml-git-300bd3f89e7ee0b581b5df2550486126abc47baf.tar.gz
cmake: Provide support for building dynamic and static libraries.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 40db882..e47f5ef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,8 +11,11 @@ set (YAML_VERSION_STRING "${YAML_VERSION_MAJOR}.${YAML_VERSION_MINOR}.${YAML_VER
file (GLOB SRC src/*.c)
include_directories (include win32)
-add_definitions (-DHAVE_CONFIG_H -DYAML_DECLARE_STATIC)
-add_library (yaml STATIC ${SRC})
+add_library (yaml SHARED ${SRC})
+set_target_properties(yaml PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_EXPORT -DHAVE_CONFIG_H")
+
+add_library (yaml_static STATIC ${SRC})
+set_target_properties(yaml_static PROPERTIES COMPILE_FLAGS "-DYAML_DECLARE_STATIC -DHAVE_CONFIG_H")
add_executable (test-version tests/test-version.c)
target_link_libraries(test-version yaml)