diff --git a/plugins/feature/antennatools/CMakeLists.txt b/plugins/feature/antennatools/CMakeLists.txt index 69cc6dd9d..117ad444f 100644 --- a/plugins/feature/antennatools/CMakeLists.txt +++ b/plugins/feature/antennatools/CMakeLists.txt @@ -41,11 +41,17 @@ else() set(INSTALL_FOLDER ${INSTALL_PLUGINSSRV_DIR}) endif() -add_library(${TARGET_NAME} SHARED - ${antennatools_SOURCES} -) +if(NOT Qt6_FOUND) + add_library(${TARGET_NAME} ${antennatools_SOURCES}) +else() + qt_add_plugin(${TARGET_NAME} CLASS_NAME AntennaToolsPlugin ${antennatools_SOURCES}) +endif() -target_link_libraries(${TARGET_NAME} +if(NOT BUILD_SHARED_LIBS) + set_property(GLOBAL APPEND PROPERTY STATIC_PLUGINS_PROPERTY ${TARGET_NAME}) +endif() + +target_link_libraries(${TARGET_NAME} PRIVATE Qt::Core ${TARGET_LIB} sdrbase diff --git a/sdrbase/plugin/pluginmanager.cpp b/sdrbase/plugin/pluginmanager.cpp index 4f59fa07c..de5109e49 100644 --- a/sdrbase/plugin/pluginmanager.cpp +++ b/sdrbase/plugin/pluginmanager.cpp @@ -81,7 +81,10 @@ void PluginManager::loadPluginsPart(const QString& pluginsSubDir) // on make install [PREFIX]/bin and [PREFIX]/lib/sdrangel #if defined(ANDROID) PluginsPath = QStringList({applicationDirPath}); - filter = QStringList({"libsdrangel_" + pluginsSubDir + "_*.so"}); + // Qt5 add_library gives libsdrangel_plugins_antennatools.so + // Qt6 qt_add_plugin gives libplugins__sdrangel_plugins_antennatools.so + // Assuming PLUGINS_PREFIX=sdrangel_plugins_ + filter = QStringList({"lib*sdrangel_" + pluginsSubDir + "_*.so"}); #else filter = QStringList({"*"}); PluginsPath << applicationDirPath + "/../" + LIB + "/sdrangel/" + pluginsSubDir;