CMake error: could not find TARGET Qt5::RELEASE
-
Hi,
I'm trying to build a project that uses qt5-feedback, but cmake is failing to use that library with this error:
CMake Error at /usr/lib64/cmake/Qt5Feedback/Qt5FeedbackConfig.cmake:234 (set_property): set_property could not find TARGET Qt5::RELEASE. Perhaps it has not yet been created. Call Stack (most recent call first): /usr/lib64/cmake/Qt5Feedback/Qt5Feedback_.cmake:5 (_populate_Feedback_plugin_properties) /usr/lib64/cmake/Qt5Feedback/Qt5FeedbackConfig.cmake:246 (include) /usr/lib64/cmake/Qt5/Qt5Config.cmake:28 (find_package) kde-telephony-daemon/src/CMakeLists.txt:22 (find_package)
Looking at line 234 of
Qt5FeedbackConfig.cmake
where it fails, I see this line:set_property(TARGET Qt5::${Plugin} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
Looking at other Qt5 files in my system, I find similar
Qt5::${Plugin}
statements that get resolved to the module name (i.e.,Qt5::Feedback
in this case), but somehow, it gets resolved to Qt5::RELEASE in this case.Do you know why this is happening and how I can troubleshoot it?
This is the generated
Qt5FeedbackConfig.cmake
that is causing the issue: https://dpaste.com/BW3H6YLEZ#line-234 -
I found another file
Qt5Feedback_.cmake
in the same directory:add_library(Qt5:: MODULE IMPORTED) _populate_Feedback_plugin_properties( RELEASE "feedback/libqtfeedback_mmk.so" FALSE) list(APPEND Qt5Feedback_PLUGINS Qt5::) set_property(TARGET Qt5::Feedback APPEND PROPERTY QT_ALL_PLUGINS_feedback Qt5::) set_property(TARGET Qt5:: PROPERTY QT_PLUGIN_TYPE "feedback") set_property(TARGET Qt5:: PROPERTY QT_PLUGIN_EXTENDS "") set_property(TARGET Qt5:: PROPERTY QT_PLUGIN_CLASS_NAME "")
It seems it's that second line which is causing the issue:
_populate_Feedback_plugin_properties( RELEASE "feedback/libqtfeedback_mmk.so" FALSE)
That's missing the plugin name, it should be like this:
_populate_Feedback_plugin_properties(Feedback RELEASE "feedback/libqtfeedback_mmk.so" FALSE)
I still don't know why the plugin name is missing there.
-
OK, I found the issue and developed a patch:
diff --git a/src/plugins/feedback/immersion/immersion.pro b/src/plugins/feedback/immersion/immersion.pro index eac187e..147b3d1 100644 --- a/src/plugins/feedback/immersion/immersion.pro +++ b/src/plugins/feedback/immersion/immersion.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_immersion QT = core feedback PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackImmersion load(qt_plugin) HEADERS += qfeedback.h diff --git a/src/plugins/feedback/meegotouch/meegotouch.pro b/src/plugins/feedback/meegotouch/meegotouch.pro index 4e9ce25..54ef1c0 100644 --- a/src/plugins/feedback/meegotouch/meegotouch.pro +++ b/src/plugins/feedback/meegotouch/meegotouch.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_meegotouch QT = core feedback PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackMeegoTouch load(qt_plugin) HEADERS += qfeedback.h diff --git a/src/plugins/feedback/mmk/mmk.pro b/src/plugins/feedback/mmk/mmk.pro index ed08b40..9b3fc25 100644 --- a/src/plugins/feedback/mmk/mmk.pro +++ b/src/plugins/feedback/mmk/mmk.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_mmk QT = core feedback multimedia PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackMMK load(qt_plugin) HEADERS += qfeedback.h
-
OK, I found the issue and developed a patch:
diff --git a/src/plugins/feedback/immersion/immersion.pro b/src/plugins/feedback/immersion/immersion.pro index eac187e..147b3d1 100644 --- a/src/plugins/feedback/immersion/immersion.pro +++ b/src/plugins/feedback/immersion/immersion.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_immersion QT = core feedback PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackImmersion load(qt_plugin) HEADERS += qfeedback.h diff --git a/src/plugins/feedback/meegotouch/meegotouch.pro b/src/plugins/feedback/meegotouch/meegotouch.pro index 4e9ce25..54ef1c0 100644 --- a/src/plugins/feedback/meegotouch/meegotouch.pro +++ b/src/plugins/feedback/meegotouch/meegotouch.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_meegotouch QT = core feedback PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackMeegoTouch load(qt_plugin) HEADERS += qfeedback.h diff --git a/src/plugins/feedback/mmk/mmk.pro b/src/plugins/feedback/mmk/mmk.pro index ed08b40..9b3fc25 100644 --- a/src/plugins/feedback/mmk/mmk.pro +++ b/src/plugins/feedback/mmk/mmk.pro @@ -2,6 +2,7 @@ TARGET = qtfeedback_mmk QT = core feedback multimedia PLUGIN_TYPE = feedback +PLUGIN_CLASS_NAME = QFeedbackMMK load(qt_plugin) HEADERS += qfeedback.h