[Cmake-commits] [cmake-commits] clinton committed FindQt4.cmake 1.152 1.153

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Feb 19 16:04:59 EST 2009


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv27833

Modified Files:
	FindQt4.cmake 
Log Message:

ENH:  Support COMPONENTS argument to find_package().
      See bug #8542.



Index: FindQt4.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindQt4.cmake,v
retrieving revision 1.152
retrieving revision 1.153
diff -C 2 -d -r1.152 -r1.153
*** FindQt4.cmake	19 Feb 2009 20:51:43 -0000	1.152
--- FindQt4.cmake	19 Feb 2009 21:04:57 -0000	1.153
***************
*** 4,11 ****
  # This qmake is then used to detect basically everything else.
  # This module defines a number of key variables and macros. 
! # First is QT_USE_FILE which is the path to a CMake file that can be included 
! # to compile Qt 4 applications and libraries.  By default, the QtCore and QtGui 
! # libraries are loaded. This behavior can be changed by setting one or more 
! # of the following variables to true before doing INCLUDE(${QT_USE_FILE}):
  #                    QT_DONT_USE_QTCORE
  #                    QT_DONT_USE_QTGUI
--- 4,21 ----
  # This qmake is then used to detect basically everything else.
  # This module defines a number of key variables and macros. 
! # The variable QT_USE_FILE is set which is the path to a CMake file that can be included 
! # to compile Qt 4 applications and libraries.  It sets up the compilation
! # environment for include directories, preprocessor defines and populates a
! # QT_LIBRARIES variable.
! #
! # Typical usage could be something like:
! #   find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
! #   include(${QT_USE_FILE})
! #   add_executable(myexe main.cpp)
! #   target_link_libraries(myexe ${QT_LIBRARIES})
! #
! # When using the components argument, QT_USE_QT* variables are automatically set
! # for the QT_USE_FILE to pick up.  If one wishes to manually set them, the
! # available ones to set include:
  #                    QT_DONT_USE_QTCORE
  #                    QT_DONT_USE_QTGUI
***************
*** 33,49 ****
  #                    QT_USE_PHONON
  #
- # The file pointed to by QT_USE_FILE will set up your compile environment
- # by adding include directories, preprocessor defines, and populate a
- # QT_LIBRARIES variable containing all the Qt libraries and their dependencies.
- # Add the QT_LIBRARIES variable to your TARGET_LINK_LIBRARIES.
- #
- # Typical usage could be something like:
- #   FIND_PACKAGE(Qt4)
- #   SET(QT_USE_QTXML 1)
- #   INCLUDE(${QT_USE_FILE})
- #   ADD_EXECUTABLE(myexe main.cpp)
- #   TARGET_LINK_LIBRARIES(myexe ${QT_LIBRARIES})
- #
- #
  # There are also some files that need processing by some Qt tools such as moc
  # and uic.  Listed below are macros that may be used to process those files.
--- 43,46 ----
***************
*** 129,132 ****
--- 126,130 ----
  #
  #
+ #  Below is a detailed list of variables that FindQt4.cmake sets.
  #  QT_FOUND         If false, don't try to use Qt.
  #  QT4_FOUND        If false, don't try to use Qt 4.
***************
*** 268,271 ****
--- 266,288 ----
  #  QT_QT_LIBRARY        Qt-Library is now split
  
+ 
+ # Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
+ IF( Qt4_FIND_COMPONENTS )
+   FOREACH( component ${Qt4_FIND_COMPONENTS} )
+     STRING( TOUPPER ${component} _COMPONENT )
+     SET( QT_USE_${_COMPONENT} 1 )
+   ENDFOREACH( component )
+   
+   # To make sure we don't use QtCore or QtGui when not in COMPONENTS
+   IF(NOT QT_USE_QTCORE)
+     SET( QT_DONT_USE_QTCORE 1 )
+   ENDIF(NOT QT_USE_QTCORE)
+   
+   IF(NOT QT_USE_QTGUI)
+     SET( QT_DONT_USE_QTGUI 1 )
+   ENDIF(NOT QT_USE_QTGUI)
+ 
+ ENDIF( Qt4_FIND_COMPONENTS )
+ 
  # If Qt3 has already been found, fail.
  IF(QT_QT_LIBRARY)



More information about the Cmake-commits mailing list