[Cmake-commits] CMake branch, next, updated. v2.8.11.2-3750-g9255e64

Brad King brad.king at kitware.com
Wed Aug 7 10:04:40 EDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  9255e64504ca93566af2ed1f02808877619db94c (commit)
       via  8120e13f40fe5fed54cb47a8606d72d3269263ad (commit)
      from  d971624926ede6e1c4122d5dff9519ad4d760dba (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9255e64504ca93566af2ed1f02808877619db94c
commit 9255e64504ca93566af2ed1f02808877619db94c
Merge: d971624 8120e13
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 7 10:04:38 2013 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Aug 7 10:04:38 2013 -0400

    Merge topic 'cmake-gui-qt5-win' into next
    
    8120e13 cmake-gui: Fix build rules for Qt5 on Windows


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8120e13f40fe5fed54cb47a8606d72d3269263ad
commit 8120e13f40fe5fed54cb47a8606d72d3269263ad
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Aug 7 09:59:33 2013 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Aug 7 09:59:33 2013 -0400

    cmake-gui: Fix build rules for Qt5 on Windows
    
    Set policy CMP0020 to NEW to get WinMain from Qt.  Fix the documentation
    custom command PATH for cmake-gui to find the Qt5 DLLs.

diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index 1684fb2..ef25294 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -11,6 +11,9 @@
 #=============================================================================
 
 project(QtDialog)
+if(POLICY CMP0020)
+  cmake_policy(SET CMP0020 NEW) # Drop when CMake >= 2.8.11 required
+endif()
 find_package(Qt5Widgets QUIET)
 if (Qt5Widgets_FOUND)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
@@ -29,6 +32,11 @@ if (Qt5Widgets_FOUND)
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
 
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
+
+  if(WIN32 AND TARGET Qt5::Core)
+    get_property(_Qt5_Core_LOCATION TARGET Qt5::Core PROPERTY LOCATION)
+    get_filename_component(Qt_BIN_DIR "${_Qt5_Core_LOCATION}" PATH)
+  endif()
 else()
   set(QT_MIN_VERSION "4.4.0")
   find_package(Qt4 REQUIRED)
@@ -38,6 +46,13 @@ else()
   endif()
 
   include(${QT_USE_FILE})
+
+  if(WIN32 AND EXISTS "${QT_QMAKE_EXECUTABLE}")
+    get_filename_component(_Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
+    if(EXISTS "${_Qt_BIN_DIR}/QtCore4.dll")
+      set(Qt_BIN_DIR ${_Qt_BIN_DIR})
+    endif()
+  endif()
 endif()
 
 set(SRCS
@@ -91,6 +106,9 @@ 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})
+if(Qt_BIN_DIR)
+  set_property(TARGET cmake-gui PROPERTY Qt_BIN_DIR ${Qt_BIN_DIR})
+endif()
 
 if(APPLE)
   set_target_properties(cmake-gui PROPERTIES
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index b8f6b3c..91965e9 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -72,11 +72,11 @@ macro(ADD_DOCS target dependency)
 endmacro()
 
 # Help cmake-gui find the Qt DLLs on Windows.
-set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
-if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
-    AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
-  get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
-  if(EXISTS "${Qt_BIN_DIR}/QtCore4.dll")
+if(TARGET cmake-gui)
+  get_property(Qt_BIN_DIR TARGET cmake-gui PROPERTY Qt_BIN_DIR)
+  set(WIN_SHELL_GENS "Visual Studio|NMake|MinGW|Watcom|Borland")
+  if(Qt_BIN_DIR AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
+      AND NOT CMAKE_NO_AUTO_QT_ENV)
     # Tell the macro to set the path before running cmake-gui.
     string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
     set(cmake-gui-PATH COMMAND set "${_PATH}")

-----------------------------------------------------------------------

Summary of changes:
 Source/QtDialog/CMakeLists.txt |   18 ++++++++++++++++++
 Utilities/CMakeLists.txt       |   10 +++++-----
 2 files changed, 23 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list