summaryrefslogtreecommitdiffstats
path: root/Source/QtDialog
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-03-17 13:49:52 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-03-17 13:49:52 (GMT)
commit223b05a80c3a1b237edea8d7a404fead5f6c6c61 (patch)
tree566574bf044cc452f068021b4250f485fbf51e90 /Source/QtDialog
parent4807c639481baf86ee229902236dd2cbe998184c (diff)
parent61c60b239c0ddc5eb975bb9cc3721b792a2aa18f (diff)
downloadCMake-223b05a80c3a1b237edea8d7a404fead5f6c6c61.zip
CMake-223b05a80c3a1b237edea8d7a404fead5f6c6c61.tar.gz
CMake-223b05a80c3a1b237edea8d7a404fead5f6c6c61.tar.bz2
Merge topic 'fix-Qt5-windows-build'
61c60b23 QtDialog: Avoid linking to Qt4 WinMain when using Qt 5.
Diffstat (limited to 'Source/QtDialog')
-rw-r--r--Source/QtDialog/CMakeLists.txt8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 0dd01d8..4e0bb50 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -27,7 +27,9 @@ if (Qt5Widgets_FOUND)
macro(qt4_add_resources)
qt5_add_resources(${ARGN})
endmacro()
- set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ set(CMake_QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ set(QT_QTMAIN_LIBRARY Qt5::WinMain)
+
# Remove this when the minimum version of Qt is 4.6.
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
@@ -47,6 +49,8 @@ else()
include(${QT_USE_FILE})
+ set(CMake_QT_LIBRARIES ${QT_LIBRARIES})
+
if(WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}")
get_filename_component(_Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
if(EXISTS "${_Qt_BIN_DIR}/QtCore4.dll")
@@ -117,7 +121,7 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS})
-target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${QT_LIBRARIES})
+target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
if(Qt_BIN_DIR)
set_property(TARGET cmake-gui PROPERTY Qt_BIN_DIR ${Qt_BIN_DIR})
endif()