mirror of
https://github.com/taglib/taglib.git
synced 2025-06-04 01:28:21 -04:00
Add option for building a static version of taglib
git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1021124 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
f644bafa44
commit
9b17ca219c
@ -2,6 +2,8 @@ project(taglib)
|
||||
|
||||
cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
|
||||
|
||||
OPTION(ENABLE_STATIC "Make static version of libtag" OFF)
|
||||
|
||||
OPTION(BUILD_TESTS "Build the test suite" OFF)
|
||||
OPTION(BUILD_EXAMPLES "Build the examples" OFF)
|
||||
|
||||
|
@ -19,6 +19,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BIN
|
||||
########### next target ###############
|
||||
|
||||
ADD_LIBRARY(tag_c SHARED tag_c.cpp)
|
||||
if(ENABLE_STATIC)
|
||||
set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
|
||||
endif(ENABLE_STATIC)
|
||||
|
||||
TARGET_LINK_LIBRARIES(tag_c tag )
|
||||
|
||||
|
@ -184,7 +184,12 @@ SET(tag_LIB_SRCS ${mpeg_SRCS} ${id3v1_SRCS} ${id3v2_SRCS} ${frames_SRCS} ${ogg_S
|
||||
)
|
||||
|
||||
|
||||
ADD_LIBRARY(tag SHARED ${tag_LIB_SRCS})
|
||||
if(ENABLE_STATIC)
|
||||
add_library(tag STATIC ${tag_LIB_SRCS})
|
||||
set_target_properties(tag PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
|
||||
else(ENABLE_STATIC)
|
||||
add_library(tag SHARED ${tag_LIB_SRCS})
|
||||
endif(ENABLE_STATIC)
|
||||
|
||||
TARGET_LINK_LIBRARIES(tag )
|
||||
if(ZLIB_FOUND)
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef TAGLIB_EXPORT_H
|
||||
#define TAGLIB_EXPORT_H
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#if !defined(TAGLIB_STATIC) && (defined(_WIN32) || defined(_WIN64))
|
||||
#ifdef MAKE_TAGLIB_LIB
|
||||
#define TAGLIB_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user