1 From 4e6a75eed3602f10aff516f49c8088c6da8db9df Mon Sep 17 00:00:00 2001
2 From: Samuel Martin <s.martin49@gmail.com>
3 Date: Sun, 31 Aug 2014 12:11:57 +0200
4 Subject: [PATCH 1/1] cmake: use the standard CMake flag to drive the shared
7 If BUILD_SHARED_LIBS is set and ENABLE_STATIC undefined, then drive
8 ENABLE_STATIC with the BUILD_SHARED_LIBS value.
10 Signed-off-by: Samuel Martin <s.martin49@gmail.com>
12 CMakeLists.txt | 12 +++++++++++-
13 1 file changed, 11 insertions(+), 1 deletion(-)
15 diff --git a/CMakeLists.txt b/CMakeLists.txt
16 index 317ffa1..9931957 100644
19 @@ -2,7 +2,17 @@ project(taglib)
21 cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
23 -option(ENABLE_STATIC "Make static version of libtag" OFF)
24 +# Use the standard CMake flag to drive the shared object build.
25 +if(DEFINED BUILD_SHARED_LIBS AND NOT DEFINED ENABLE_STATIC)
26 + if(BUILD_SHARED_LIBS)
27 + set(ENABLE_STATIC OFF)
29 + set(ENABLE_STATIC ON)
32 + option(ENABLE_STATIC "Make static version of libtag" OFF)
36 add_definitions(-DTAGLIB_STATIC)
37 set(BUILD_SHARED_LIBS OFF)