From e8c5d86a463b4ed6af0dbde76ffbcb20b5a534a9 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> Date: Sat, 21 Oct 2017 03:21:35 -0400 Subject: [PATCH] COMP: Fix configure error when build against Qt4 This commit fixes the following error: ``` [...] -- Found Qt4: /home/jcfr/Support/qt-everywhere-opensource-build-4.8.7/bin/qmake (found version "4.8.7") CMake Error at src/Cxx/Qt/CMakeLists.txt:64 (TARGET_LINK_LIBRARIES): Cannot specify link libraries for target "BorderWidgetQt" which is not built by this project. [...] --- src/Cxx/Qt/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Cxx/Qt/CMakeLists.txt b/src/Cxx/Qt/CMakeLists.txt index 0e695c22c1d..47e938d4ab3 100644 --- a/src/Cxx/Qt/CMakeLists.txt +++ b/src/Cxx/Qt/CMakeLists.txt @@ -60,6 +60,8 @@ foreach(EXAMPLE_FILE ${ALL_UI_FILES}) # CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped. add_executable(${WIKI}${EXAMPLE} ${EXECUTABLE_FLAG} ${EXAMPLE}Driver.cxx ${EXAMPLE}.cxx ${UISrcs} ${EXAMPLE}.h) qt5_use_modules(${WIKI}${EXAMPLE} Core Gui Widgets) + else() + add_executable(${WIKI}${EXAMPLE} ${EXECUTABLE_FLAG} ${EXAMPLE}.cxx) endif() TARGET_LINK_LIBRARIES(${WIKI}${EXAMPLE} ${KIT_LIBS}) list(REMOVE_ITEM ALL_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}Driver.cxx ${CMAKE_CURRENT_SOURCE_DIR}/${EXAMPLE}.cxx) -- GitLab