3 Make sure to build the shared library only if BUILD_SHARED_LIBS is
4 ON. Normally, CMake takes care of this automatically, but libcuefile
5 wants to build both the shared and static variants, so the normal
6 logic of CMake doesn't apply.
8 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 Index: b/src/CMakeLists.txt
11 ===================================================================
12 --- a/src/CMakeLists.txt
13 +++ b/src/CMakeLists.txt
15 add_library(cuefile-static STATIC cd cdtext cue_parse cue_print cue_scan cuefile time toc toc_parse toc_print toc_scan)
16 set_target_properties(cuefile-static PROPERTIES OUTPUT_NAME cuefile CLEAN_DIRECT_OUTPUT 1)
18 +if (BUILD_SHARED_LIBS)
19 add_library(cuefile-shared SHARED cd cdtext cue_parse cue_print cue_scan cuefile time toc toc_parse toc_print toc_scan)
20 set_target_properties(cuefile-shared PROPERTIES OUTPUT_NAME cuefile CLEAN_DIRECT_OUTPUT 1 VERSION 0.0.0 SOVERSION 0)
22 install(TARGETS cuefile-static cuefile-shared LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}")
23 +else (BUILD_SHARED_LIBS)
24 +install(TARGETS cuefile-static LIBRARY DESTINATION "lib${LIB_SUFFIX}" ARCHIVE DESTINATION "lib${LIB_SUFFIX}")
25 +endif (BUILD_SHARED_LIBS)