aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt62
-rw-r--r--src/rtlsdr.rc.in34
2 files changed, 70 insertions, 26 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 77e1dc4..07d64ab 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -17,10 +17,11 @@
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
-########################################################################
-# Setup library
-########################################################################
-add_library(rtlsdr_shared SHARED
+MACRO(RTLSDR_APPEND_SRCS)
+ LIST(APPEND rtlsdr_srcs ${ARGV})
+ENDMACRO(RTLSDR_APPEND_SRCS)
+
+RTLSDR_APPEND_SRCS(
librtlsdr.c
tuner_e4k.c
tuner_fc0012.c
@@ -29,24 +30,44 @@ add_library(rtlsdr_shared SHARED
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 OUTPUT_NAME rtlsdr)
set_target_properties(rtlsdr_shared PROPERTIES SOVERSION ${MAJOR_VERSION})
set_target_properties(rtlsdr_shared PROPERTIES VERSION ${LIBVER})
-add_library(rtlsdr_static STATIC
- librtlsdr.c
- tuner_e4k.c
- tuner_fc0012.c
- tuner_fc0013.c
- tuner_fc2580.c
- tuner_r82xx.c
-)
+########################################################################
+# Setup static library variant
+########################################################################
+add_library(rtlsdr_static STATIC ${rtlsdr_srcs})
+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()
+########################################################################
+# Setup libraries used in executables
+########################################################################
add_library(convenience_static STATIC
convenience/convenience.c
)
@@ -60,17 +81,6 @@ target_link_libraries(convenience_static
)
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
########################################################################
diff --git a/src/rtlsdr.rc.in b/src/rtlsdr.rc.in
new file mode 100644
index 0000000..bf603c3
--- /dev/null
+++ b/src/rtlsdr.rc.in
@@ -0,0 +1,34 @@
+
+#include <afxres.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,0,0,0
+ PRODUCTVERSION 0,0,0,0
+ FILEFLAGSMASK 0x3fL
+#ifndef NDEBUG
+ FILEFLAGS 0x0L
+#else
+ FILEFLAGS 0x1L
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_DRV_INSTALLABLE
+ BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "FileDescription", "osmocom rtl-sdr"
+ VALUE "FileVersion", "@VERSION@"
+ VALUE "InternalName", "rtl-sdr.dll"
+ VALUE "LegalCopyright", "Licensed under GPLv2"
+ VALUE "OriginalFilename", "rtl-sdr.dll"
+ VALUE "ProductName", "osmocom rtl-sdr"
+ VALUE "ProductVersion", "@VERSION@"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+ END