]> granicus.if.org Git - taglib/commitdiff
Simplify static builds
authorLukáš Lalinský <lalinsky@gmail.com>
Sun, 8 May 2011 13:57:34 +0000 (15:57 +0200)
committerLukáš Lalinský <lalinsky@gmail.com>
Sun, 8 May 2011 13:57:34 +0000 (15:57 +0200)
CMakeLists.txt
bindings/c/CMakeLists.txt
taglib/CMakeLists.txt

index 928a3f5eca33ec9f1d88ca621be0af5e9cd88478..fb7c2892641d7495f862fa07a12633b64601c1fa 100644 (file)
@@ -3,6 +3,12 @@ project(taglib)
 cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
 
 option(ENABLE_STATIC "Make static version of libtag"  OFF)
+if(ENABLE_STATIC)
+  add_definitions(-DTAGLIB_STATIC)
+  set(BUILD_SHARED_LIBS OFF)
+else()
+  set(BUILD_SHARED_LIBS ON)
+endif()
 
 option(BUILD_TESTS "Build the test suite"  OFF)
 option(BUILD_EXAMPLES "Build the examples"  OFF)
index 63dc84b8b1d75404f5e55ea12468654b9ed82ed5..2d9dafc496e6fb096e58d3819347195eb75819e3 100644 (file)
@@ -18,12 +18,7 @@ include_directories(
 
 set(tag_c_HDRS tag_c.h)
 
-if(ENABLE_STATIC)
-  add_library(tag_c STATIC tag_c.cpp ${tag_c_HDRS})
-  set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
-else()
-  add_library(tag_c SHARED tag_c.cpp ${tag_c_HDRS})
-endif()
+add_library(tag_c tag_c.cpp ${tag_c_HDRS})
 
 target_link_libraries(tag_c tag)
 set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}")
index 8e7a3b64a5cac5516de77f091dda6896dada3336..d7274a893d68347fd92acad9ba0fff5b1ed30b18 100644 (file)
@@ -260,12 +260,7 @@ if(WITH_MP4)
   set(tag_LIB_SRCS ${tag_LIB_SRCS} ${mp4_SRCS})
 endif()
 
-if(ENABLE_STATIC)
-  add_library(tag STATIC ${tag_LIB_SRCS} ${tag_HDRS})
-  set_target_properties(tag PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
-else()
-  add_library(tag SHARED ${tag_LIB_SRCS} ${tag_HDRS})
-endif()
+add_library(tag ${tag_LIB_SRCS} ${tag_HDRS})
 
 if(ZLIB_FOUND)
        target_link_libraries(tag ${ZLIB_LIBRARIES})