mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2025-01-11 18:57:19 +01:00
cmake & autotools fixes from previous commit
This commit is contained in:
parent
229ebd2ff2
commit
030c787cfa
@ -53,7 +53,7 @@ if(NOT LIBUSB_FOUND)
|
|||||||
message(FATAL_ERROR "LibUSB 1.0 required to compile rtl-sdr")
|
message(FATAL_ERROR "LibUSB 1.0 required to compile rtl-sdr")
|
||||||
endif()
|
endif()
|
||||||
if(NOT THREADS_FOUND)
|
if(NOT THREADS_FOUND)
|
||||||
message(FATAL_ERROR "pthreads(-win32) required to compile osmosdrtlnw")
|
message(FATAL_ERROR "pthreads(-win32) required to compile rtl-sdr")
|
||||||
endif()
|
endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
# Setup the include and linker paths
|
# Setup the include and linker paths
|
||||||
|
@ -22,6 +22,6 @@
|
|||||||
########################################################################
|
########################################################################
|
||||||
install(FILES
|
install(FILES
|
||||||
rtl-sdr.h
|
rtl-sdr.h
|
||||||
rtl-sdr_export.h
|
rtl-sdr_export.h
|
||||||
DESTINATION include
|
DESTINATION include
|
||||||
)
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
rtlsdr_HEADERS = rtl-sdr.h
|
rtlsdr_HEADERS = rtl-sdr.h rtl-sdr_export.h
|
||||||
|
|
||||||
noinst_HEADERS = rtlsdr_i2c.h tuner_e4000.h tuner_fc0012.h tuner_fc0013.h tuner_fc2580.h
|
noinst_HEADERS = rtlsdr_i2c.h tuner_e4000.h tuner_fc0012.h tuner_fc0013.h tuner_fc2580.h
|
||||||
|
|
||||||
|
@ -24,42 +24,42 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "rtl-sdr_export.h"
|
#include <rtl-sdr_export.h>
|
||||||
|
|
||||||
typedef struct rtlsdr_dev rtlsdr_dev_t;
|
typedef struct rtlsdr_dev rtlsdr_dev_t;
|
||||||
|
|
||||||
uint32_t RTLSDR_API rtlsdr_get_device_count(void);
|
RTLSDR_API uint32_t rtlsdr_get_device_count(void);
|
||||||
|
|
||||||
RTLSDR_API const char* rtlsdr_get_device_name(uint32_t index);
|
RTLSDR_API const char* rtlsdr_get_device_name(uint32_t index);
|
||||||
|
|
||||||
RTLSDR_API rtlsdr_dev_t* rtlsdr_open(uint32_t index);
|
RTLSDR_API rtlsdr_dev_t* rtlsdr_open(uint32_t index);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_close(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_close(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
/* configuration functions */
|
/* configuration functions */
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
|
RTLSDR_API int rtlsdr_set_center_freq(rtlsdr_dev_t *dev, uint32_t freq);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_get_center_freq(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_get_center_freq(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_set_freq_correction(rtlsdr_dev_t *dev, int ppm);
|
RTLSDR_API int rtlsdr_set_freq_correction(rtlsdr_dev_t *dev, int ppm);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_get_freq_correction(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_get_freq_correction(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_set_tuner_gain(rtlsdr_dev_t *dev, int gain);
|
RTLSDR_API int rtlsdr_set_tuner_gain(rtlsdr_dev_t *dev, int gain);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_get_tuner_gain(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_get_tuner_gain(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
/* this will select the baseband filters according to the requested sample rate */
|
/* this will select the baseband filters according to the requested sample rate */
|
||||||
int RTLSDR_API rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t rate);
|
RTLSDR_API int rtlsdr_set_sample_rate(rtlsdr_dev_t *dev, uint32_t rate);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_get_sample_rate(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_get_sample_rate(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
/* streaming functions */
|
/* streaming functions */
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_reset_buffer(rtlsdr_dev_t *dev);
|
RTLSDR_API int rtlsdr_reset_buffer(rtlsdr_dev_t *dev);
|
||||||
|
|
||||||
int RTLSDR_API rtlsdr_read_sync(rtlsdr_dev_t *dev, void *buf, int len, int *n_read);
|
RTLSDR_API int rtlsdr_read_sync(rtlsdr_dev_t *dev, void *buf, int len, int *n_read);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -30,26 +30,28 @@ add_library(rtlsdr SHARED
|
|||||||
|
|
||||||
target_link_libraries(rtlsdr
|
target_link_libraries(rtlsdr
|
||||||
${LIBUSB_LIBRARIES}
|
${LIBUSB_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(rtlsdr PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS")
|
set_target_properties(rtlsdr PROPERTIES DEFINE_SYMBOL "rtlsdr_EXPORTS")
|
||||||
|
|
||||||
add_library(rtlsdrs STATIC
|
add_library(rtlsdr_static STATIC
|
||||||
rtl-sdr.c
|
rtl-sdr.c
|
||||||
tuner_e4000.c
|
tuner_e4000.c
|
||||||
tuner_fc0012.c
|
tuner_fc0012.c
|
||||||
tuner_fc0013.c
|
tuner_fc0013.c
|
||||||
|
tuner_fc2580.c
|
||||||
)
|
)
|
||||||
target_link_libraries(rtlsdrs
|
|
||||||
|
target_link_libraries(rtlsdr_static
|
||||||
${LIBUSB_LIBRARIES}
|
${LIBUSB_LIBRARIES}
|
||||||
${CMAKE_THREAD_LIBS_INIT}
|
|
||||||
)
|
)
|
||||||
set_target_properties(rtlsdrs PROPERTIES DEFINE_SYMBOL "rtlsdr_STATIC")
|
|
||||||
|
set_target_properties(rtlsdr_static PROPERTIES DEFINE_SYMBOL "rtlsdr_STATIC")
|
||||||
|
set_target_properties(rtlsdr_static PROPERTIES OUTPUT_NAME rtlsdr)
|
||||||
########################################################################
|
########################################################################
|
||||||
# Install built library files
|
# Install built library files
|
||||||
########################################################################
|
########################################################################
|
||||||
install(TARGETS rtlsdr
|
install(TARGETS rtlsdr rtlsdr_static
|
||||||
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
|
LIBRARY DESTINATION lib${LIB_SUFFIX} # .so/.dylib file
|
||||||
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
|
ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file
|
||||||
RUNTIME DESTINATION bin # .dll file
|
RUNTIME DESTINATION bin # .dll file
|
||||||
@ -59,4 +61,7 @@ install(TARGETS rtlsdr
|
|||||||
# Build utility
|
# Build utility
|
||||||
########################################################################
|
########################################################################
|
||||||
add_executable(rtl_sdr main.c)
|
add_executable(rtl_sdr main.c)
|
||||||
target_link_libraries(rtl_sdr rtlsdr ${LIBUSB_LIBRARIES})
|
target_link_libraries(rtl_sdr rtlsdr_static
|
||||||
|
${LIBUSB_LIBRARIES}
|
||||||
|
${CMAKE_THREAD_LIBS_INIT}
|
||||||
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user