[PATCH] CMake: Replace deprecated qt5_use_modules macro

Martin Hauke mardnh at gmx.de
Thu Jun 28 21:08:56 UTC 2018


qt5_use_modules has been marked as deprecated since a while and is
finally removed in Qt 5.11

Change-Id: I5ac81b654d248028bccf48ba0cfd0c11ff9409e1
---
 CMakeLists.txt                               | 14 ++++++++------
 plugins/channel/nfm/CMakeLists.txt           |  6 ++++--
 plugins/channel/tcpsrc/CMakeLists.txt        |  6 ++++--
 plugins/channel/tetra/CMakeLists.txt         |  6 ++++--
 plugins/samplesource/gnuradio/CMakeLists.txt |  6 ++++--
 plugins/samplesource/osmosdr/CMakeLists.txt  |  6 ++++--
 plugins/samplesource/rtlsdr/CMakeLists.txt   |  6 ++++--
 7 files changed, 32 insertions(+), 18 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72ce30e..b5a264b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.9)
+cmake_minimum_required(VERSION 2.8.11)
 list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
 
 project(sdrangelove)
@@ -14,7 +14,7 @@ set(CMAKE_AUTOMOC ON)
 find_package(Qt5Core 5.0 REQUIRED)
 find_package(Qt5Widgets 5.0 REQUIRED)
 find_package(Qt5Multimedia 5.0 REQUIRED)
-#find_package(QT5OpenGL 5.0 REQUIRED)
+find_package(Qt5OpenGL 5.0 REQUIRED)
 find_package(OpenGL REQUIRED)
 find_package(PkgConfig)
 
@@ -245,6 +245,10 @@ add_library(sdrbase SHARED
 )
 
 target_link_libraries(sdrbase
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Multimedia
 	${QT_LIBRARIES}
 	${OPENGL_LIBRARIES}
 	${LIBUSB_LIBRARIES}
@@ -260,8 +264,6 @@ endif(LIBFFTS_FOUND)
 
 set_target_properties(sdrbase PROPERTIES DEFINE_SYMBOL "sdrangelove_EXPORTS")
 
-qt5_use_modules(sdrbase Core Widgets OpenGL Multimedia)
-
 include_directories(
 	${CMAKE_CURRENT_BINARY_DIR}
 	${CMAKE_SOURCE_DIR}/include
@@ -304,6 +306,8 @@ add_executable(sdrangelove
 
 target_link_libraries(sdrangelove
 	sdrbase
+	Qt5::Widgets
+	Qt5::Multimedia
 	${QT_LIBRARIES}
 	${OPENGL_LIBRARIES}
 )
@@ -317,8 +321,6 @@ if(WIN32)
 	set_target_properties(sdrangelove PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
 endif(WIN32)
 
-qt5_use_modules(sdrangelove Widgets Multimedia)
-
 ##############################################################################
 
 add_subdirectory(plugins)
diff --git a/plugins/channel/nfm/CMakeLists.txt b/plugins/channel/nfm/CMakeLists.txt
index feeb891..a39931e 100644
--- a/plugins/channel/nfm/CMakeLists.txt
+++ b/plugins/channel/nfm/CMakeLists.txt
@@ -39,9 +39,11 @@ add_library(demodnfm SHARED
 )
 
 target_link_libraries(demodnfm
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${OPENGL_LIBRARIES}
 	sdrbase
 )
-
-qt5_use_modules(demodnfm Core Widgets OpenGL Multimedia)
\ No newline at end of file
diff --git a/plugins/channel/tcpsrc/CMakeLists.txt b/plugins/channel/tcpsrc/CMakeLists.txt
index df7c4d4..86d8426 100644
--- a/plugins/channel/tcpsrc/CMakeLists.txt
+++ b/plugins/channel/tcpsrc/CMakeLists.txt
@@ -39,9 +39,11 @@ add_library(demodtcpsrc SHARED
 )
 
 target_link_libraries(demodtcpsrc
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${OPENGL_LIBRARIES}
 	sdrbase
 )
-
-qt5_use_modules(demodtcpsrc Core Widgets OpenGL Network)
diff --git a/plugins/channel/tetra/CMakeLists.txt b/plugins/channel/tetra/CMakeLists.txt
index f46c2bb..9da7aa4 100644
--- a/plugins/channel/tetra/CMakeLists.txt
+++ b/plugins/channel/tetra/CMakeLists.txt
@@ -39,9 +39,11 @@ add_library(demodtetra SHARED
 )
 
 target_link_libraries(demodtetra
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${OPENGL_LIBRARIES}
 	sdrbase
 )
-
-qt5_use_modules(demodtetra Core Widgets OpenGL Multimedia)
diff --git a/plugins/samplesource/gnuradio/CMakeLists.txt b/plugins/samplesource/gnuradio/CMakeLists.txt
index 0e08608..c5c3300 100644
--- a/plugins/samplesource/gnuradio/CMakeLists.txt
+++ b/plugins/samplesource/gnuradio/CMakeLists.txt
@@ -75,6 +75,10 @@ add_library(inputgnuradio SHARED
 )
 
 target_link_libraries(inputgnuradio
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${Boost_LIBRARIES}
 	${GNURADIO_RUNTIME_LIBRARIES}
@@ -82,6 +86,4 @@ target_link_libraries(inputgnuradio
 	sdrbase
 )
 
-qt5_use_modules(inputgnuradio Core Widgets OpenGL Multimedia)
-
 endif(Boost_FOUND AND GNURADIO_RUNTIME_FOUND AND GNURADIO_OSMOSDR_FOUND)
diff --git a/plugins/samplesource/osmosdr/CMakeLists.txt b/plugins/samplesource/osmosdr/CMakeLists.txt
index 9dc9705..10f3cc9 100644
--- a/plugins/samplesource/osmosdr/CMakeLists.txt
+++ b/plugins/samplesource/osmosdr/CMakeLists.txt
@@ -45,10 +45,12 @@ add_library(inputosmosdr SHARED
 )
 
 target_link_libraries(inputosmosdr
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${LIBOSMOSDR_LIBRARIES}
 	${LIBUSB_LIBRARIES}
 	sdrbase
 )
-
-qt5_use_modules(inputosmosdr Core Widgets OpenGL Multimedia)
diff --git a/plugins/samplesource/rtlsdr/CMakeLists.txt b/plugins/samplesource/rtlsdr/CMakeLists.txt
index 35c4081..fa9a53a 100644
--- a/plugins/samplesource/rtlsdr/CMakeLists.txt
+++ b/plugins/samplesource/rtlsdr/CMakeLists.txt
@@ -41,10 +41,12 @@ add_library(inputrtlsdr SHARED
 )
 
 target_link_libraries(inputrtlsdr
+	Qt5::Core
+	Qt5::Widgets
+	Qt5::OpenGL
+	Qt5::Network
 	${QT_LIBRARIES}
 	${LIBRTLSDR_LIBRARIES}
 	${LIBUSB_LIBRARIES}
 	sdrbase
 )
-
-qt5_use_modules(inputrtlsdr Core Widgets OpenGL Multimedia)
-- 
2.13.7



More information about the osmocom-sdr mailing list