From 0602879b2e6db9503634527432b0b983890bbacf Mon Sep 17 00:00:00 2001 From: Davide Gerhard Date: Tue, 7 May 2019 10:42:18 +0200 Subject: [PATCH] import freqtracker to new cmake config --- plugins/channelrx/CMakeLists.txt | 1 - plugins/channelrx/freqtracker/CMakeLists.txt | 53 ++++++++++--------- plugins/channelrx/freqtracker/freqtracker.pro | 49 ----------------- .../channelrx/freqtracker/freqtrackerplugin.h | 2 +- 4 files changed, 29 insertions(+), 76 deletions(-) delete mode 100644 plugins/channelrx/freqtracker/freqtracker.pro diff --git a/plugins/channelrx/CMakeLists.txt b/plugins/channelrx/CMakeLists.txt index 67e0ed236..c82f7d10f 100644 --- a/plugins/channelrx/CMakeLists.txt +++ b/plugins/channelrx/CMakeLists.txt @@ -1,6 +1,5 @@ project(demod) - add_subdirectory(demodam) add_subdirectory(demodbfm) add_subdirectory(demodnfm) diff --git a/plugins/channelrx/freqtracker/CMakeLists.txt b/plugins/channelrx/freqtracker/CMakeLists.txt index 107c4d2b5..be7daf7e3 100644 --- a/plugins/channelrx/freqtracker/CMakeLists.txt +++ b/plugins/channelrx/freqtracker/CMakeLists.txt @@ -1,51 +1,54 @@ project(freqtracker) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - set(freqtracker_SOURCES freqtracker.cpp - freqtrackergui.cpp freqtrackersettings.cpp freqtrackerplugin.cpp ) set(freqtracker_HEADERS freqtracker.h - freqtrackergui.h freqtrackersettings.h freqtrackerplugin.h ) -set(freqtracker_FORMS - freqtrackergui.ui -) - include_directories( - . ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client + ${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client ) -#include(${QT_USE_FILE}) -add_definitions(${QT_DEFINITIONS}) -add_definitions(-DQT_PLUGIN) -add_definitions(-DQT_SHARED) +if(NOT SERVER_MODE) + set(freqtracker_SOURCES + ${freqtracker_SOURCES} + freqtrackergui.cpp -#qt5_wrap_cpp(nfm_HEADERS_MOC ${nfm_HEADERS}) -qt5_wrap_ui(freqtracker_FORMS_HEADERS ${freqtracker_FORMS}) + freqtrackergui.ui + ) + set(freqtracker_HEADERS + ${freqtracker_HEADERS} + freqtrackergui.h + ) -add_library(freqtracker SHARED + set(TARGET_NAME freqtracker) + set(TARGET_LIB "Qt5::Widgets") + set(TARGET_LIB_GUI "sdrgui") + set(INSTALL_FOLDER ${INSTALL_PLUGINS_DIR}) +else() + set(TARGET_NAME freqtrackersrv) + set(TARGET_LIB "") + set(TARGET_LIB_GUI "") + set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) +endif() + +add_library(${TARGET_NAME} SHARED ${freqtracker_SOURCES} - ${freqtracker_HEADERS_MOC} - ${freqtracker_FORMS_HEADERS} ) -target_link_libraries(freqtracker - ${QT_LIBRARIES} +target_link_libraries(${TARGET_NAME} + Qt5::Core + ${TARGET_LIB} sdrbase - sdrgui + ${TARGET_LIB_GUI} ) -target_link_libraries(freqtracker Qt5::Core Qt5::Widgets) - -install(TARGETS freqtracker DESTINATION lib/plugins/channelrx) +install(TARGETS ${TARGET_NAME} DESTINATION ${INSTALL_FOLDER}) diff --git a/plugins/channelrx/freqtracker/freqtracker.pro b/plugins/channelrx/freqtracker/freqtracker.pro deleted file mode 100644 index 30d43f8ed..000000000 --- a/plugins/channelrx/freqtracker/freqtracker.pro +++ /dev/null @@ -1,49 +0,0 @@ -#-------------------------------------------------------- -# -# Pro file for Android and Windows builds with Qt Creator -# -#-------------------------------------------------------- - -TEMPLATE = lib -CONFIG += plugin - -QT += core gui widgets multimedia - -TARGET = freqtracker - -DEFINES += USE_SSE2=1 -QMAKE_CXXFLAGS += -msse2 -DEFINES += USE_SSE4_1=1 -QMAKE_CXXFLAGS += -msse4.1 -QMAKE_CXXFLAGS += -std=c++11 - -INCLUDEPATH += $$PWD -INCLUDEPATH += ../../../exports -INCLUDEPATH += ../../../sdrbase -INCLUDEPATH += ../../../sdrgui -INCLUDEPATH += ../../../swagger/sdrangel/code/qt5/client - -CONFIG(Release):build_subdir = release -CONFIG(Debug):build_subdir = debug - -SOURCES += freqtracker.cpp\ - freqtrackergui.cpp\ - freqtrackerplugin.cpp\ - freqtrackersettings.cpp - -HEADERS += freqtracker.h\ - freqtrackergui.h\ - freqtrackerplugin.h\ - freqtrackersettings.h - -FORMS += freqtrackergui.ui - -LIBS += -L../../../sdrbase/$${build_subdir} -lsdrbase -LIBS += -L../../../sdrgui/$${build_subdir} -lsdrgui -LIBS += -L../../../swagger/$${build_subdir} -lswagger - -macx { - QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/ -} - -RESOURCES = ../../../sdrgui/resources/res.qrc diff --git a/plugins/channelrx/freqtracker/freqtrackerplugin.h b/plugins/channelrx/freqtracker/freqtrackerplugin.h index e738b5c4f..da6e1ec1a 100644 --- a/plugins/channelrx/freqtracker/freqtrackerplugin.h +++ b/plugins/channelrx/freqtracker/freqtrackerplugin.h @@ -30,7 +30,7 @@ class FreqTrackerPlugin : public QObject, PluginInterface { Q_PLUGIN_METADATA(IID "sdrangel.channel.freqtracker") public: - explicit FreqTrackerPlugin(QObject* parent = NULL); + explicit FreqTrackerPlugin(QObject* parent = nullptr); const PluginDescriptor& getPluginDescriptor() const; void initPlugin(PluginAPI* pluginAPI);