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