You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.5 KiB
84 lines
2.5 KiB
project(modchirpmodem) |
|
|
|
# libchirpmodem: found through its CMake package. A local install (for example |
|
# cmake --install build --prefix ~/.local) is found through CHIRPMODEM_DIR, |
|
# the CMake prefix path, or the default hint below. |
|
set(CHIRPMODEM_DIR "" CACHE PATH "Install prefix of libchirpmodem") |
|
find_package(chirpmodem 0.1 REQUIRED |
|
HINTS ${CHIRPMODEM_DIR} $ENV{HOME}/.local |
|
) |
|
|
|
set(modchirpmodem_SOURCES |
|
chirpmodemmod.cpp |
|
chirpmodemmodsettings.cpp |
|
chirpmodemmodbaseband.cpp |
|
chirpmodemmodsource.cpp |
|
chirpmodemmodmessages.cpp |
|
chirpmodemmodplugin.cpp |
|
chirpmodemmodwebapiadapter.cpp |
|
) |
|
|
|
set(modchirpmodem_HEADERS |
|
chirpmodemmod.h |
|
chirpmodemmodsettings.h |
|
chirpmodemmodbaseband.h |
|
chirpmodemmodsource.h |
|
chirpmodemmodmessages.h |
|
chirpmodemmodplugin.h |
|
chirpmodemmodwebapiadapter.h |
|
) |
|
|
|
include_directories( |
|
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client |
|
) |
|
|
|
if(NOT SERVER_MODE) |
|
set(modchirpmodem_SOURCES |
|
${modchirpmodem_SOURCES} |
|
chirpmodemmodgui.cpp |
|
chirpmodemmodgui.ui |
|
) |
|
set(modchirpmodem_HEADERS |
|
${modchirpmodem_HEADERS} |
|
chirpmodemmodgui.h |
|
) |
|
|
|
set(TARGET_NAME ${PLUGINS_PREFIX}modchirpmodem) |
|
set(TARGET_LIB "Qt::Widgets") |
|
set(TARGET_LIB_GUI "sdrgui") |
|
set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) |
|
else() |
|
set(TARGET_NAME ${PLUGINSSRV_PREFIX}modchirpmodemsrv) |
|
set(TARGET_LIB "") |
|
set(TARGET_LIB_GUI "") |
|
set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) |
|
endif() |
|
|
|
if(NOT Qt6_FOUND) |
|
add_library(${TARGET_NAME} ${modchirpmodem_SOURCES}) |
|
else() |
|
qt_add_plugin(${TARGET_NAME} CLASS_NAME ChirpModemModPlugin) |
|
target_sources(${TARGET_NAME} PRIVATE ${modchirpmodem_SOURCES}) |
|
endif() |
|
|
|
if(NOT BUILD_SHARED_LIBS) |
|
set_property(GLOBAL APPEND PROPERTY STATIC_PLUGINS_PROPERTY ${TARGET_NAME}) |
|
endif() |
|
|
|
# The static library is position independent, so the plugin carries the modem |
|
# and needs no library path at run time. |
|
target_link_libraries(${TARGET_NAME} PRIVATE |
|
Qt::Core |
|
${TARGET_LIB} |
|
sdrbase |
|
${TARGET_LIB_GUI} |
|
chirpmodem::chirpmodem_static |
|
) |
|
|
|
install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) |
|
|
|
# Install debug symbols |
|
if (WIN32) |
|
install(FILES $<TARGET_PROPERTY:${TARGET_NAME},RUNTIME_OUTPUT_DIRECTORY>/${TARGET_NAME}stripped.pdb CONFIGURATIONS Release DESTINATION ${INSTALL_FOLDER} RENAME ${TARGET_NAME}.pdb ) |
|
install(FILES $<TARGET_PDB_FILE:${TARGET_NAME}> CONFIGURATIONS Debug RelWithDebInfo DESTINATION ${INSTALL_FOLDER} ) |
|
endif()
|
|
|