|
|
@ -17,10 +17,11 @@ |
|
|
|
# the Free Software Foundation, Inc., 51 Franklin Street, |
|
|
|
# the Free Software Foundation, Inc., 51 Franklin Street, |
|
|
|
# Boston, MA 02110-1301, USA. |
|
|
|
# Boston, MA 02110-1301, USA. |
|
|
|
|
|
|
|
|
|
|
|
######################################################################## |
|
|
|
MACRO(RTLSDR_APPEND_SRCS) |
|
|
|
# Setup library |
|
|
|
LIST(APPEND rtlsdr_srcs ${ARGV}) |
|
|
|
######################################################################## |
|
|
|
ENDMACRO(RTLSDR_APPEND_SRCS) |
|
|
|
add_library(rtlsdr_shared SHARED |
|
|
|
|
|
|
|
|
|
|
|
RTLSDR_APPEND_SRCS( |
|
|
|
librtlsdr.c |
|
|
|
librtlsdr.c |
|
|
|
tuner_e4k.c |
|
|
|
tuner_e4k.c |
|
|
|
tuner_fc0012.c |
|
|
|
tuner_fc0012.c |
|
|
@ -29,24 +30,44 @@ add_library(rtlsdr_shared SHARED |
|
|
|
tuner_r82xx.c |
|
|
|
tuner_r82xx.c |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
target_link_libraries(rtlsdr_shared |
|
|
|
######################################################################## |
|
|
|
${LIBUSB_LIBRARIES} |
|
|
|
# Set up Windows DLL resource files |
|
|
|
) |
|
|
|
######################################################################## |
|
|
|
|
|
|
|
IF(MSVC) |
|
|
|
|
|
|
|
include(${CMAKE_SOURCE_DIR}/cmake/Modules/Version.cmake) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
configure_file( |
|
|
|
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/rtlsdr.rc.in |
|
|
|
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc |
|
|
|
|
|
|
|
@ONLY) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RTLSDR_APPEND_SRCS(${CMAKE_CURRENT_BINARY_DIR}/rtlsdr.rc) |
|
|
|
|
|
|
|
ENDIF(MSVC) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################## |
|
|
|
|
|
|
|
# Setup shared library variant |
|
|
|
|
|
|
|
######################################################################## |
|
|
|
|
|
|
|
add_library(rtlsdr_shared SHARED ${rtlsdr_srcs}) |
|
|
|
|
|
|
|
target_link_libraries(rtlsdr_shared ${LIBUSB_LIBRARIES}) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS") |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS") |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES OUTPUT_NAME rtlsdr) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES OUTPUT_NAME rtlsdr) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES SOVERSION ${MAJOR_VERSION}) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES SOVERSION ${MAJOR_VERSION}) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES VERSION ${LIBVER}) |
|
|
|
set_target_properties(rtlsdr_shared PROPERTIES VERSION ${LIBVER}) |
|
|
|
|
|
|
|
|
|
|
|
add_library(rtlsdr_static STATIC |
|
|
|
######################################################################## |
|
|
|
librtlsdr.c |
|
|
|
# Setup static library variant |
|
|
|
tuner_e4k.c |
|
|
|
######################################################################## |
|
|
|
tuner_fc0012.c |
|
|
|
add_library(rtlsdr_static STATIC ${rtlsdr_srcs}) |
|
|
|
tuner_fc0013.c |
|
|
|
target_link_libraries(rtlsdr_static ${LIBUSB_LIBRARIES}) |
|
|
|
tuner_fc2580.c |
|
|
|
set_property(TARGET rtlsdr_static APPEND PROPERTY COMPILE_DEFINITIONS "rtlsdr_STATIC" ) |
|
|
|
tuner_r82xx.c |
|
|
|
if(NOT WIN32) |
|
|
|
) |
|
|
|
# Force same library filename for static and shared variants of the library |
|
|
|
|
|
|
|
set_target_properties(rtlsdr_static PROPERTIES OUTPUT_NAME rtlsdr) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################## |
|
|
|
|
|
|
|
# Setup libraries used in executables |
|
|
|
|
|
|
|
######################################################################## |
|
|
|
add_library(convenience_static STATIC |
|
|
|
add_library(convenience_static STATIC |
|
|
|
convenience/convenience.c |
|
|
|
convenience/convenience.c |
|
|
|
) |
|
|
|
) |
|
|
@ -60,17 +81,6 @@ target_link_libraries(convenience_static |
|
|
|
) |
|
|
|
) |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
target_link_libraries(rtlsdr_static |
|
|
|
|
|
|
|
${LIBUSB_LIBRARIES} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_property(TARGET rtlsdr_static APPEND PROPERTY COMPILE_DEFINITIONS "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) |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
######################################################################## |
|
|
|
######################################################################## |
|
|
|
# Build utility |
|
|
|
# Build utility |
|
|
|
######################################################################## |
|
|
|
######################################################################## |
|
|
|