From dfae984458ad274bd6f1f0a13f5566b4d084a422 Mon Sep 17 00:00:00 2001 From: John Kirkham Date: Thu, 2 Jun 2016 00:16:28 -0400 Subject: [PATCH] cmake: Provide support for building dynamic and static libraries. --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e84c28cd..3c5e1255 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ 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") \ No newline at end of file