From 9a4f4991a0b3dfef5c901d3538dbbd4a4b687f2a Mon Sep 17 00:00:00 2001 From: Dimitri Stolnikov Date: Tue, 3 Apr 2012 00:51:15 +0200 Subject: [PATCH] force same library filename for static and shared variants of the library on !WIN32 platforms --- src/CMakeLists.txt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 775d481..2abbb90 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,7 +20,7 @@ ######################################################################## # Setup library ######################################################################## -add_library(rtlsdr SHARED +add_library(rtlsdr_shared SHARED rtl-sdr.c tuner_e4000.c tuner_fc0012.c @@ -28,11 +28,12 @@ add_library(rtlsdr SHARED tuner_fc2580.c ) -target_link_libraries(rtlsdr +target_link_libraries(rtlsdr_shared ${LIBUSB_LIBRARIES} ) -set_target_properties(rtlsdr PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS") +set_target_properties(rtlsdr_shared PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS") +set_target_properties(rtlsdr_shared PROPERTIES OUTPUT_NAME rtlsdr) add_library(rtlsdr_static STATIC rtl-sdr.c @@ -47,12 +48,15 @@ target_link_libraries(rtlsdr_static ) set_target_properties(rtlsdr_static PROPERTIES DEFINE_SYMBOL "rtlsdr_STATIC") + +if(NOT WIN32) # Force same library filename for static and shared variants of the library -#set_target_properties(rtlsdr_static PROPERTIES OUTPUT_NAME rtlsdr) +set_target_properties(rtlsdr_static PROPERTIES OUTPUT_NAME rtlsdr) +endif() ######################################################################## # Install built library files ######################################################################## -install(TARGETS rtlsdr rtlsdr_static +install(TARGETS rtlsdr_shared rtlsdr_static LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file RUNTIME DESTINATION bin # .dll file