SDRPlusPlus/source_modules/sddc_source/CMakeLists.txt

37 lines
1.8 KiB
CMake
Raw Normal View History

2021-05-13 17:31:40 +02:00
cmake_minimum_required(VERSION 3.13)
project(sddc_source)
if (MSVC)
# What the fuck?
file(GLOB SRC "src/*.cpp" "src/*.c" "src/libsddc/libsddc/*.c" "src/libsddc/libsddc/*.cpp" "src/libsddc/Core/*.c" "src/libsddc/Core/*.cpp" "src/libsddc/Core/radio/*.cpp" "src/libsddc/Core/pffft/*.c" "src/libsddc/Core/pffft/*.cpp" "src/libsddc/Core/arch/win32/*.c" "src/libsddc/Core/arch/win32/*.cpp" "src/libsddc/Core/arch/win32/CyAPI/*.cpp")
else (MSVC)
file(GLOB SRC "src/*.cpp" "src/*.c" "src/libsddc/libsddc/*.c" "src/libsddc/libsddc/*.cpp" "src/libsddc/Core/*.c" "src/libsddc/Core/*.cpp" "src/libsddc/Core/radio/*.cpp" "src/libsddc/Core/pffft/*.c" "src/libsddc/Core/pffft/*.cpp" "src/libsddc/Core/arch/linux/*.c" "src/libsddc/Core/arch/linux/*.cpp")
endif ()
add_library(sddc_source SHARED ${SRC})
target_link_libraries(sddc_source PRIVATE sdrpp_core)
set_target_properties(sddc_source PROPERTIES PREFIX "")
2021-10-04 03:31:13 +02:00
target_include_directories(sddc_source PRIVATE "src/" "src/libsddc/" "src/libsddc/Core/" "src/libsddc/Core/pffft/" "src/libsddc/libsddc/")
2021-05-13 17:31:40 +02:00
if (MSVC)
# Lib path
2021-10-04 03:31:13 +02:00
target_link_directories(sddc_source PRIVATE "C:/Program Files/PothosSDR/lib/")
2021-05-13 17:31:40 +02:00
# Misc headers
2021-10-04 03:31:13 +02:00
target_include_directories(sddc_source PRIVATE "C:/Program Files/PothosSDR/include/libusb-1.0/")
2021-05-13 17:31:40 +02:00
2021-10-04 03:31:13 +02:00
target_link_libraries(sddc_source PRIVATE libusb-1.0)
target_link_libraries(sddc_source PRIVATE Setupapi.lib)
2021-05-13 17:31:40 +02:00
else (MSVC)
find_package(PkgConfig)
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
2021-10-04 03:31:13 +02:00
target_include_directories(sddc_source PRIVATE ${LIBUSB_INCLUDE_DIRS})
target_link_directories(sddc_source PRIVATE ${LIBUSB_LIBRARY_DIRS})
target_link_libraries(sddc_source PRIVATE ${LIBUSB_LIBRARIES})
2021-05-13 17:31:40 +02:00
endif ()
# Install directives
install(TARGETS sddc_source DESTINATION lib/sdrpp/plugins)