Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated QT5_USE_MODULES in CMakeLists.txt #5

Closed
Fincer opened this issue Jun 10, 2018 · 2 comments
Closed

Deprecated QT5_USE_MODULES in CMakeLists.txt #5

Fincer opened this issue Jun 10, 2018 · 2 comments

Comments

@Fincer
Copy link

Fincer commented Jun 10, 2018

In Qt 5.11, QT5_USE_MODULES macro is deprecated. This makes compilation to fail.

Not really making a pull request, but just a simple patch code to fix the issue. Feel free to merge.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,7 +74,7 @@
 
 ADD_LIBRARY(qtspell SHARED ${qtspell_SRCS} ${qtspell_MOC} ${qtspell_HDRS} ${qtspell_MOC_HDRS} ${qtspell_QM})
 IF(USE_QT5)
-    QT5_USE_MODULES(qtspell Widgets)
+    TARGET_LINK_LIBRARIES(qtspell Qt5::Core Qt5::Widgets)
 ELSE(USE_QT5)
     QT4_USE_MODULES(qtspell Core Gui)
 ENDIF(USE_QT5)
@@ -92,7 +92,7 @@
 IF(${BUILD_STATIC_LIBS})
     ADD_LIBRARY(qtspell-static STATIC ${qtspell_SRCS} ${qtspell_MOC} ${qtspell_HDRS} ${qtspell_MOC_HDRS} ${qtspell_QM})
     IF(USE_QT5)
-        QT5_USE_MODULES(qtspell-static Widgets)
+        TARGET_LINK_LIBRARIES(qtspell-static Qt5::Core Qt5::Widgets)
     ELSE(USE_QT5)
         QT4_USE_MODULES(qtspell-static Core Gui)
     ENDIF(USE_QT5)
@@ -124,7 +124,7 @@
 ENDIF(USE_QT5)
 ADD_EXECUTABLE(example examples/example.cpp ${example_MOC})
 IF(USE_QT5)
-    QT5_USE_MODULES(example Widgets)
+    TARGET_LINK_LIBRARIES(example Qt5::Core Qt5::Widgets)
 ELSE(USE_QT5)
     QT4_USE_MODULES(example Core Gui)
 ENDIF(USE_QT5)

@manisandro
Copy link
Owner

Applied, thanks!

@Fincer
Copy link
Author

Fincer commented Jun 10, 2018

np 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants