diff options
author | Kitware Robot <kwrobot@kitware.com> | 2012-08-13 17:47:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-08-13 18:19:16 (GMT) |
commit | 77543bde41b0e52c3959016698b529835945d62d (patch) | |
tree | ff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/FindQt4.cmake | |
parent | 7bbaa4283de26864b2e55e819db0884771585467 (diff) | |
download | CMake-77543bde41b0e52c3959016698b529835945d62d.zip CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2 |
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command
names became case-insensitive. Now the preferred style is lower-case.
Run the following shell code:
cmake --help-command-list |
grep -v "cmake version" |
while read c; do
echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r-- | Modules/FindQt4.cmake | 840 |
1 files changed, 420 insertions, 420 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index e3eb1e6..e20e764 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -334,139 +334,139 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# 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 ) +# 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_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) + if(NOT QT_USE_QTGUI) + set( QT_DONT_USE_QTGUI 1 ) + endif(NOT QT_USE_QTGUI) -ENDIF( Qt4_FIND_COMPONENTS ) +endif( Qt4_FIND_COMPONENTS ) # If Qt3 has already been found, fail. -IF(QT_QT_LIBRARY) - IF(Qt4_FIND_REQUIRED) - MESSAGE( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") - ELSE(Qt4_FIND_REQUIRED) - IF(NOT Qt4_FIND_QUIETLY) - MESSAGE( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") - ENDIF(NOT Qt4_FIND_QUIETLY) - RETURN() - ENDIF(Qt4_FIND_REQUIRED) -ENDIF(QT_QT_LIBRARY) +if(QT_QT_LIBRARY) + if(Qt4_FIND_REQUIRED) + message( FATAL_ERROR "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") + else(Qt4_FIND_REQUIRED) + if(NOT Qt4_FIND_QUIETLY) + message( STATUS "Qt3 and Qt4 cannot be used together in one project. If switching to Qt4, the CMakeCache.txt needs to be cleaned.") + endif(NOT Qt4_FIND_QUIETLY) + return() + endif(Qt4_FIND_REQUIRED) +endif(QT_QT_LIBRARY) -INCLUDE(CheckCXXSymbolExists) -INCLUDE(MacroAddFileDependencies) -INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +include(CheckCXXSymbolExists) +include(MacroAddFileDependencies) +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -SET(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) +set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake) -SET( QT_DEFINITIONS "") +set( QT_DEFINITIONS "") # convenience macro for dealing with debug/release library names -MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename) +macro (_QT4_ADJUST_LIB_VARS _camelCaseBasename) - STRING(TOUPPER "${_camelCaseBasename}" basename) + string(TOUPPER "${_camelCaseBasename}" basename) # The name of the imported targets, i.e. the prefix "Qt4::" must not change, # since it is stored in EXPORT-files as name of a required library. If the name would change # here, this would lead to the imported Qt4-library targets not being resolved by cmake anymore. - IF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + if (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) - IF(NOT TARGET Qt4::${_camelCaseBasename}) - ADD_LIBRARY(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED ) + if(NOT TARGET Qt4::${_camelCaseBasename}) + add_library(Qt4::${_camelCaseBasename} UNKNOWN IMPORTED ) - IF (QT_${basename}_LIBRARY_RELEASE) - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) + if (QT_${basename}_LIBRARY_RELEASE) + set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) if(QT_USE_FRAMEWORKS) - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" ) + set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}/${_camelCaseBasename}" ) else() - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" ) + set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_RELEASE "${QT_${basename}_LIBRARY_RELEASE}" ) endif() - ENDIF (QT_${basename}_LIBRARY_RELEASE) + endif (QT_${basename}_LIBRARY_RELEASE) - IF (QT_${basename}_LIBRARY_DEBUG) - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) + if (QT_${basename}_LIBRARY_DEBUG) + set_property(TARGET Qt4::${_camelCaseBasename} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) if(QT_USE_FRAMEWORKS) - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" ) + set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}/${_camelCaseBasename}" ) else() - SET_PROPERTY(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" ) + set_property(TARGET Qt4::${_camelCaseBasename} PROPERTY IMPORTED_LOCATION_DEBUG "${QT_${basename}_LIBRARY_DEBUG}" ) endif() - ENDIF (QT_${basename}_LIBRARY_DEBUG) - ENDIF(NOT TARGET Qt4::${_camelCaseBasename}) + endif (QT_${basename}_LIBRARY_DEBUG) + endif(NOT TARGET Qt4::${_camelCaseBasename}) # If QT_USE_IMPORTED_TARGETS is enabled, the QT_QTFOO_LIBRARY variables are set to point at these # imported targets. This works better in general, and is also in almost all cases fully # backward compatible. The only issue is when a project A which had this enabled then exports its - # libraries via export or EXPORT_LIBRARY_DEPENDENCIES(). In this case the libraries from project + # libraries via export or export_library_dependencies(). In this case the libraries from project # A will depend on the imported Qt targets, and the names of these imported targets will be stored # in the dependency files on disk. This means when a project B then uses project A, these imported # targets must be created again, otherwise e.g. "Qt4__QtCore" will be interpreted as name of a # library file on disk, and not as a target, and linking will fail: - IF(QT_USE_IMPORTED_TARGETS) - SET(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} ) - SET(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} ) - ELSE(QT_USE_IMPORTED_TARGETS) + if(QT_USE_IMPORTED_TARGETS) + set(QT_${basename}_LIBRARY Qt4::${_camelCaseBasename} ) + set(QT_${basename}_LIBRARIES Qt4::${_camelCaseBasename} ) + else(QT_USE_IMPORTED_TARGETS) # if the release- as well as the debug-version of the library have been found: - IF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) + if (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value - IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + if (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set(QT_${basename}_LIBRARY optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) + else(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) # if there are no configuration types and CMAKE_BUILD_TYPE has no value # then just use the release libraries - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) - ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE} ) + endif(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) + set(QT_${basename}_LIBRARIES optimized ${QT_${basename}_LIBRARY_RELEASE} debug ${QT_${basename}_LIBRARY_DEBUG}) + endif (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) # if only the release version was found, set the debug variable also to the release version - IF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) - SET(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) - ENDIF (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + if (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) + set(QT_${basename}_LIBRARY_DEBUG ${QT_${basename}_LIBRARY_RELEASE}) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_RELEASE}) + set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_RELEASE}) + endif (QT_${basename}_LIBRARY_RELEASE AND NOT QT_${basename}_LIBRARY_DEBUG) # if only the debug version was found, set the release variable also to the debug version - IF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) - SET(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) - SET(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) - ENDIF (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) + if (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) + set(QT_${basename}_LIBRARY_RELEASE ${QT_${basename}_LIBRARY_DEBUG}) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY_DEBUG}) + set(QT_${basename}_LIBRARIES ${QT_${basename}_LIBRARY_DEBUG}) + endif (QT_${basename}_LIBRARY_DEBUG AND NOT QT_${basename}_LIBRARY_RELEASE) # put the value in the cache: - SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) + set(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE) - ENDIF(QT_USE_IMPORTED_TARGETS) + endif(QT_USE_IMPORTED_TARGETS) - SET(QT_${basename}_FOUND 1) + set(QT_${basename}_FOUND 1) - ELSE (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + else (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) - SET(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE) + set(QT_${basename}_LIBRARY "" CACHE STRING "The Qt ${basename} library" FORCE) - ENDIF (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) + endif (QT_${basename}_LIBRARY_RELEASE OR QT_${basename}_LIBRARY_DEBUG) - IF (QT_${basename}_INCLUDE_DIR) + if (QT_${basename}_INCLUDE_DIR) #add the include directory to QT_INCLUDES - SET(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES}) - ENDIF (QT_${basename}_INCLUDE_DIR) + set(QT_INCLUDES "${QT_${basename}_INCLUDE_DIR}" ${QT_INCLUDES}) + endif (QT_${basename}_INCLUDE_DIR) # Make variables changeble to the advanced user - MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) -ENDMACRO (_QT4_ADJUST_LIB_VARS) + mark_as_advanced(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR) +endmacro (_QT4_ADJUST_LIB_VARS) function(_QT4_QUERY_QMAKE VAR RESULT) execute_process(COMMAND "${QT_QMAKE_EXECUTABLE}" -query ${VAR} @@ -480,13 +480,13 @@ function(_QT4_QUERY_QMAKE VAR RESULT) endfunction(_QT4_QUERY_QMAKE) -SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE) +set(QT4_INSTALLED_VERSION_TOO_OLD FALSE) -GET_FILENAME_COMPONENT(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME) +get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trolltech\\Versions;DefaultQtVersion]" NAME) # check for qmake # Debian uses qmake-qt4 # macports' Qt uses qmake-mac -FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS +find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin" @@ -495,224 +495,224 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS ) # double check that it was a Qt4 qmake, if not, re-find with different names -IF (QT_QMAKE_EXECUTABLE) +if (QT_QMAKE_EXECUTABLE) - IF(QT_QMAKE_EXECUTABLE_LAST) - STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED) - ENDIF(QT_QMAKE_EXECUTABLE_LAST) + if(QT_QMAKE_EXECUTABLE_LAST) + string(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED) + endif(QT_QMAKE_EXECUTABLE_LAST) - SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE) + set(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE) _qt4_query_qmake(QT_VERSION QTVERSION) # check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path - IF(NOT QTVERSION) - SET(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE) - FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS + if(NOT QTVERSION) + set(QT_QMAKE_EXECUTABLE NOTFOUND CACHE FILEPATH "" FORCE) + find_program(QT_QMAKE_EXECUTABLE NAMES qmake4 qmake-qt4 PATHS "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin" $ENV{QTDIR}/bin DOC "The qmake executable for the Qt installation to use" ) - IF(QT_QMAKE_EXECUTABLE) + if(QT_QMAKE_EXECUTABLE) _qt4_query_qmake(QT_VERSION QTVERSION) - ENDIF(QT_QMAKE_EXECUTABLE) - ENDIF(NOT QTVERSION) + endif(QT_QMAKE_EXECUTABLE) + endif(NOT QTVERSION) -ENDIF (QT_QMAKE_EXECUTABLE) +endif (QT_QMAKE_EXECUTABLE) -IF (QT_QMAKE_EXECUTABLE AND QTVERSION) +if (QT_QMAKE_EXECUTABLE AND QTVERSION) # ask qmake for the mkspecs directory # we do this first because QT_LIBINFIX might be set - IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED) + if (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs) # do not replace : on windows as it might be a drive letter # and windows should already use ; as a separator - IF(NOT WIN32) - STRING(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}") - ENDIF(NOT WIN32) + if(NOT WIN32) + string(REPLACE ":" ";" qt_mkspecs_dirs "${qt_mkspecs_dirs}") + endif(NOT WIN32) set(qt_cross_paths) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/mkspecs") endforeach(qt_cross_path) - SET(QT_MKSPECS_DIR NOTFOUND) - FIND_PATH(QT_MKSPECS_DIR NAMES qconfig.pri + set(QT_MKSPECS_DIR NOTFOUND) + find_path(QT_MKSPECS_DIR NAMES qconfig.pri HINTS ${qt_cross_paths} ${qt_mkspecs_dirs} DOC "The location of the Qt mkspecs containing qconfig.pri") - ENDIF() - - IF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") - FILE(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents) - STRING(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}") - STRING(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}") - STRING(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}") - STRING(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}") - STRING(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}") - ENDIF(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") - IF("${QT_EDITION}" MATCHES "DesktopLight") - SET(QT_EDITION_DESKTOPLIGHT 1) - ENDIF("${QT_EDITION}" MATCHES "DesktopLight") + endif() + + if(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") + file(READ ${QT_MKSPECS_DIR}/qconfig.pri _qconfig_FILE_contents) + string(REGEX MATCH "QT_CONFIG[^\n]+" QT_QCONFIG "${_qconfig_FILE_contents}") + string(REGEX MATCH "CONFIG[^\n]+" QT_CONFIG "${_qconfig_FILE_contents}") + string(REGEX MATCH "EDITION[^\n]+" QT_EDITION "${_qconfig_FILE_contents}") + string(REGEX MATCH "QT_LIBINFIX[^\n]+" _qconfig_qt_libinfix "${_qconfig_FILE_contents}") + string(REGEX REPLACE "QT_LIBINFIX *= *([^\n]*)" "\\1" QT_LIBINFIX "${_qconfig_qt_libinfix}") + endif(EXISTS "${QT_MKSPECS_DIR}/qconfig.pri") + if("${QT_EDITION}" MATCHES "DesktopLight") + set(QT_EDITION_DESKTOPLIGHT 1) + endif("${QT_EDITION}" MATCHES "DesktopLight") # ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the # others and for setting QT_LIBRARY_DIR - IF (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG) OR QT_QMAKE_CHANGED) + if (NOT (QT_QTCORE_LIBRARY_RELEASE OR QT_QTCORE_LIBRARY_DEBUG) OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP) - SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND) - SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND) - FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE + set(QT_QTCORE_LIBRARY_RELEASE NOTFOUND) + set(QT_QTCORE_LIBRARY_DEBUG NOTFOUND) + find_library(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4 HINTS ${QT_LIBRARY_DIR_TMP} NO_DEFAULT_PATH ) - FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG + find_library(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4 HINTS ${QT_LIBRARY_DIR_TMP} NO_DEFAULT_PATH ) - IF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) - FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE + if(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) + find_library(QT_QTCORE_LIBRARY_RELEASE NAMES QtCore${QT_LIBINFIX} QtCore${QT_LIBINFIX}4 HINTS ${QT_LIBRARY_DIR_TMP} ) - FIND_LIBRARY(QT_QTCORE_LIBRARY_DEBUG + find_library(QT_QTCORE_LIBRARY_DEBUG NAMES QtCore${QT_LIBINFIX}_debug QtCore${QT_LIBINFIX}d QtCore${QT_LIBINFIX}d4 HINTS ${QT_LIBRARY_DIR_TMP} ) - ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) + endif(NOT QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCORE_LIBRARY_DEBUG) # try dropping a hint if trying to use Visual Studio with Qt built by mingw - IF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) - IF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) - MESSAGE( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.") - ENDIF(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) - ENDIF(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) + if(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) + if(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) + message( FATAL_ERROR "It appears you're trying to use Visual Studio with Qt built by mingw. Those compilers do not produce code compatible with each other.") + endif(EXISTS ${QT_LIBRARY_DIR_TMP}/libqtmain.a) + endif(NOT QT_QTCORE_LIBRARY_RELEASE AND MSVC) - ENDIF () + endif () # set QT_LIBRARY_DIR based on location of QtCore found. - IF(QT_QTCORE_LIBRARY_RELEASE) - GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH) - SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) - SET(QT_QTCORE_FOUND 1) - ELSEIF(QT_QTCORE_LIBRARY_DEBUG) - GET_FILENAME_COMPONENT(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH) - SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) - SET(QT_QTCORE_FOUND 1) - ELSE() - MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" " + if(QT_QTCORE_LIBRARY_RELEASE) + get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_RELEASE}" PATH) + set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) + set(QT_QTCORE_FOUND 1) + elseif(QT_QTCORE_LIBRARY_DEBUG) + get_filename_component(QT_LIBRARY_DIR_TMP "${QT_QTCORE_LIBRARY_DEBUG}" PATH) + set(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) + set(QT_QTCORE_FOUND 1) + else() + message(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" " "but QtCore could not be found there. " "Qt is NOT installed correctly for the target build environment.") - IF(Qt4_FIND_REQUIRED) - MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") - ENDIF(Qt4_FIND_REQUIRED) - ENDIF() + if(Qt4_FIND_REQUIRED) + message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") + endif(Qt4_FIND_REQUIRED) + endif() # ask qmake for the binary dir - IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) + if (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_BINS qt_bins) - SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE) - ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) - - IF (APPLE) - SET(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK}) - IF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) - SET(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE) - SET(CMAKE_FIND_FRAMEWORK FIRST) - ELSE (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) - SET(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE) - SET(CMAKE_FIND_FRAMEWORK LAST) - ENDIF (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) - ENDIF (APPLE) + set(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE) + endif (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED) + + if (APPLE) + set(CMAKE_FIND_FRAMEWORK_OLD ${CMAKE_FIND_FRAMEWORK}) + if (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + set(QT_USE_FRAMEWORKS ON CACHE INTERNAL "" FORCE) + set(CMAKE_FIND_FRAMEWORK FIRST) + else (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + set(QT_USE_FRAMEWORKS OFF CACHE INTERNAL "" FORCE) + set(CMAKE_FIND_FRAMEWORK LAST) + endif (EXISTS ${QT_LIBRARY_DIR}/QtCore.framework) + endif (APPLE) # ask qmake for the include dir - IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)) + if (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED)) _qt4_query_qmake(QT_INSTALL_HEADERS qt_headers) - SET(QT_QTCORE_INCLUDE_DIR NOTFOUND) - FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore + set(QT_QTCORE_INCLUDE_DIR NOTFOUND) + find_path(QT_QTCORE_INCLUDE_DIR QtCore HINTS ${qt_headers} ${QT_LIBRARY_DIR} PATH_SUFFIXES QtCore qt4/QtCore ) # Set QT_HEADERS_DIR based on finding QtCore header - IF(QT_QTCORE_INCLUDE_DIR) - IF(QT_USE_FRAMEWORKS) - SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) - ELSE(QT_USE_FRAMEWORKS) - GET_FILENAME_COMPONENT(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE) - SET(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) - ENDIF(QT_USE_FRAMEWORKS) - ELSEIF() - MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}") - MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.") - ENDIF() - ENDIF() - - IF(APPLE) - SET(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD}) - ENDIF(APPLE) + if(QT_QTCORE_INCLUDE_DIR) + if(QT_USE_FRAMEWORKS) + set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) + else(QT_USE_FRAMEWORKS) + get_filename_component(qt_headers "${QT_QTCORE_INCLUDE_DIR}/../" ABSOLUTE) + set(QT_HEADERS_DIR "${qt_headers}" CACHE INTERNAL "" FORCE) + endif(QT_USE_FRAMEWORKS) + elseif() + message("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_HEADERS as ${qt_headers}") + message("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly.") + endif() + endif() + + if(APPLE) + set(CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK_OLD}) + endif(APPLE) # Set QT_INCLUDE_DIR based on QT_HEADERS_DIR - IF(QT_HEADERS_DIR) - IF(QT_USE_FRAMEWORKS) + if(QT_HEADERS_DIR) + if(QT_USE_FRAMEWORKS) # Qt/Mac frameworks has two include dirs. # One is the framework include for which CMake will add a -F flag # and the other is an include dir for non-framework Qt modules - SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} ) - ELSE(QT_USE_FRAMEWORKS) - SET(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) - ENDIF(QT_USE_FRAMEWORKS) - ENDIF(QT_HEADERS_DIR) + set(QT_INCLUDE_DIR ${QT_HEADERS_DIR} ${QT_QTCORE_LIBRARY_RELEASE} ) + else(QT_USE_FRAMEWORKS) + set(QT_INCLUDE_DIR ${QT_HEADERS_DIR}) + endif(QT_USE_FRAMEWORKS) + endif(QT_HEADERS_DIR) # Set QT_INCLUDES - SET( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) + set( QT_INCLUDES ${QT_MKSPECS_DIR}/default ${QT_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) # ask qmake for the documentation directory - IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) + if (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir) - SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE) - ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) + set(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE) + endif (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED) # ask qmake for the plugins directory - IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) + if (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir) - SET(QT_PLUGINS_DIR NOTFOUND) + set(QT_PLUGINS_DIR NOTFOUND) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins") endforeach(qt_cross_path) - FIND_PATH(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer + find_path(QT_PLUGINS_DIR NAMES accessible imageformats sqldrivers codecs designer HINTS ${qt_cross_paths} ${qt_plugins_dir} DOC "The location of the Qt plugins") - ENDIF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) + endif (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED) # ask qmake for the translations directory - IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) + if (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir) - SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE) - ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) + set(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE) + endif (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED) # ask qmake for the imports directory - IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) + if (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) _qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir) if(qt_imports_dir) - SET(QT_IMPORTS_DIR NOTFOUND) + set(QT_IMPORTS_DIR NOTFOUND) foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH}) set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports") endforeach(qt_cross_path) - FIND_PATH(QT_IMPORTS_DIR NAMES Qt + find_path(QT_IMPORTS_DIR NAMES Qt HINTS ${qt_cross_paths} ${qt_imports_dir} DOC "The location of the Qt imports" NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH) mark_as_advanced(QT_IMPORTS_DIR) endif(qt_imports_dir) - ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) + endif (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED) # Make variables changeble to the advanced user - MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR + mark_as_advanced( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR QT_PLUGINS_DIR QT_TRANSLATIONS_DIR) @@ -724,32 +724,32 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ############################################# # Save required variable - SET(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) - SET(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) + set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES}) + set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS}) # Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES - SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") + set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}") # Check for Window system symbols (note: only one should end up being set) CHECK_CXX_SYMBOL_EXISTS(Q_WS_X11 "QtCore/qglobal.h" Q_WS_X11) CHECK_CXX_SYMBOL_EXISTS(Q_WS_WIN "QtCore/qglobal.h" Q_WS_WIN) CHECK_CXX_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS) CHECK_CXX_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC) - IF(Q_WS_MAC) - IF(QT_QMAKE_CHANGED) - UNSET(QT_MAC_USE_COCOA CACHE) - ENDIF(QT_QMAKE_CHANGED) + if(Q_WS_MAC) + if(QT_QMAKE_CHANGED) + unset(QT_MAC_USE_COCOA CACHE) + endif(QT_QMAKE_CHANGED) CHECK_CXX_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) - ENDIF(Q_WS_MAC) + endif(Q_WS_MAC) - IF (QT_QTCOPY_REQUIRED) + if (QT_QTCOPY_REQUIRED) CHECK_CXX_SYMBOL_EXISTS(QT_IS_QTCOPY "QtCore/qglobal.h" QT_KDE_QT_COPY) - IF (NOT QT_IS_QTCOPY) - MESSAGE(FATAL_ERROR "qt-copy is required, but hasn't been found") - ENDIF (NOT QT_IS_QTCOPY) - ENDIF (QT_QTCOPY_REQUIRED) + if (NOT QT_IS_QTCOPY) + message(FATAL_ERROR "qt-copy is required, but hasn't been found") + endif (NOT QT_IS_QTCOPY) + endif (QT_QTCOPY_REQUIRED) # Restore CMAKE_REQUIRED_INCLUDES and CMAKE_REQUIRED_FLAGS variables - SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) - SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) + set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVE}) + set(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS_SAVE}) # ############################################# @@ -761,48 +761,48 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ######################################## - SET(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools + set(QT_MODULES QtGui Qt3Support QtSvg QtScript QtTest QtUiTools QtHelp QtWebKit QtXmlPatterns phonon QtNetwork QtMultimedia QtNsPlugin QtOpenGL QtSql QtXml QtDesigner QtDBus QtScriptTools QtDeclarative) - IF(Q_WS_X11) - SET(QT_MODULES ${QT_MODULES} QtMotif) - ENDIF(Q_WS_X11) - - IF(QT_QMAKE_CHANGED) - FOREACH(QT_MODULE ${QT_MODULES}) - STRING(TOUPPER ${QT_MODULE} _upper_qt_module) - SET(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND) - SET(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND) - SET(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND) - ENDFOREACH(QT_MODULE) - SET(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND) - SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND) - SET(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND) - SET(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND) - SET(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND) - SET(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND) - SET(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND) - SET(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND) - SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND) - SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND) - SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND) - SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND) - SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND) - SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND) - SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND) - SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND) - SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND) - IF(Q_WS_WIN) - SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND) - SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND) - ENDIF(Q_WS_WIN) - ENDIF(QT_QMAKE_CHANGED) - - FOREACH(QT_MODULE ${QT_MODULES}) - STRING(TOUPPER ${QT_MODULE} _upper_qt_module) - FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE} + if(Q_WS_X11) + set(QT_MODULES ${QT_MODULES} QtMotif) + endif(Q_WS_X11) + + if(QT_QMAKE_CHANGED) + foreach(QT_MODULE ${QT_MODULES}) + string(TOUPPER ${QT_MODULE} _upper_qt_module) + set(QT_${_upper_qt_module}_INCLUDE_DIR NOTFOUND) + set(QT_${_upper_qt_module}_LIBRARY_RELEASE NOTFOUND) + set(QT_${_upper_qt_module}_LIBRARY_DEBUG NOTFOUND) + endforeach(QT_MODULE) + set(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR NOTFOUND) + set(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NOTFOUND) + set(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NOTFOUND) + set(QT_QTASSISTANTCLIENT_INCLUDE_DIR NOTFOUND) + set(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NOTFOUND) + set(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NOTFOUND) + set(QT_QTASSISTANT_INCLUDE_DIR NOTFOUND) + set(QT_QTASSISTANT_LIBRARY_RELEASE NOTFOUND) + set(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND) + set(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND) + set(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND) + set(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND) + set(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND) + set(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND) + set(QT_QAXSERVER_INCLUDE_DIR NOTFOUND) + set(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND) + set(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND) + if(Q_WS_WIN) + set(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND) + set(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND) + endif(Q_WS_WIN) + endif(QT_QMAKE_CHANGED) + + foreach(QT_MODULE ${QT_MODULES}) + string(TOUPPER ${QT_MODULE} _upper_qt_module) + find_path(QT_${_upper_qt_module}_INCLUDE_DIR ${QT_MODULE} PATHS ${QT_HEADERS_DIR}/${QT_MODULE} ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers @@ -810,31 +810,31 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ) # phonon doesn't seem consistent, let's try phonondefs.h for some # installations - IF(${QT_MODULE} STREQUAL "phonon") - FIND_PATH(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h + if(${QT_MODULE} STREQUAL "phonon") + find_path(QT_${_upper_qt_module}_INCLUDE_DIR phonondefs.h PATHS ${QT_HEADERS_DIR}/${QT_MODULE} ${QT_LIBRARY_DIR}/${QT_MODULE}.framework/Headers NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - ENDIF(${QT_MODULE} STREQUAL "phonon") - ENDFOREACH(QT_MODULE) + endif(${QT_MODULE} STREQUAL "phonon") + endforeach(QT_MODULE) - IF(Q_WS_WIN) - SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) + if(Q_WS_WIN) + set(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR - FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt + find_path(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt PATHS ${QT_HEADERS_DIR}/ActiveQt NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt + find_path(QT_QAXSERVER_INCLUDE_DIR ActiveQt PATHS ${QT_HEADERS_DIR}/ActiveQt NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - ENDIF(Q_WS_WIN) + endif(Q_WS_WIN) # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR - FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents + find_path(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents PATHS ${QT_HEADERS_DIR}/QtDesigner ${QT_LIBRARY_DIR}/QtDesigner.framework/Headers @@ -842,7 +842,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ) # Set QT_QTASSISTANT_INCLUDE_DIR - FIND_PATH(QT_QTASSISTANT_INCLUDE_DIR QtAssistant + find_path(QT_QTASSISTANT_INCLUDE_DIR QtAssistant PATHS ${QT_HEADERS_DIR}/QtAssistant ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers @@ -850,7 +850,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ) # Set QT_QTASSISTANTCLIENT_INCLUDE_DIR - FIND_PATH(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient + find_path(QT_QTASSISTANTCLIENT_INCLUDE_DIR QAssistantClient PATHS ${QT_HEADERS_DIR}/QtAssistant ${QT_LIBRARY_DIR}/QtAssistant.framework/Headers @@ -864,48 +864,48 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ######################################## # find the libraries - FOREACH(QT_MODULE ${QT_MODULES}) - STRING(TOUPPER ${QT_MODULE} _upper_qt_module) - FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_RELEASE + foreach(QT_MODULE ${QT_MODULES}) + string(TOUPPER ${QT_MODULE} _upper_qt_module) + find_library(QT_${_upper_qt_module}_LIBRARY_RELEASE NAMES ${QT_MODULE}${QT_LIBINFIX} ${QT_MODULE}${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_LIBRARY(QT_${_upper_qt_module}_LIBRARY_DEBUG + find_library(QT_${_upper_qt_module}_LIBRARY_DEBUG NAMES ${QT_MODULE}${QT_LIBINFIX}_debug ${QT_MODULE}${QT_LIBINFIX}d ${QT_MODULE}${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - ENDFOREACH(QT_MODULE) + endforeach(QT_MODULE) # QtUiTools is sometimes not in the same directory as the other found libraries # e.g. on Mac, its never a framework like the others are - IF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) - FIND_LIBRARY(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) - ENDIF(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) + if(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) + find_library(QT_QTUITOOLS_LIBRARY_RELEASE NAMES QtUiTools${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) + endif(QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTUITOOLS_LIBRARY_RELEASE) # Set QT_QTDESIGNERCOMPONENTS_LIBRARY - FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - FIND_LIBRARY(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_RELEASE NAMES QtDesignerComponents${QT_LIBINFIX} QtDesignerComponents${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTDESIGNERCOMPONENTS_LIBRARY_DEBUG NAMES QtDesignerComponents${QT_LIBINFIX}_debug QtDesignerComponents${QT_LIBINFIX}d QtDesignerComponents${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) # Set QT_QTMAIN_LIBRARY - IF(Q_WS_WIN) - FIND_LIBRARY(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - FIND_LIBRARY(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - ENDIF(Q_WS_WIN) + if(Q_WS_WIN) + find_library(QT_QTMAIN_LIBRARY_RELEASE NAMES qtmain${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTMAIN_LIBRARY_DEBUG NAMES qtmain${QT_LIBINFIX}d PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + endif(Q_WS_WIN) # Set QT_QTASSISTANTCLIENT_LIBRARY - FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - FIND_LIBRARY(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTASSISTANTCLIENT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTASSISTANTCLIENT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) # Set QT_QTASSISTANT_LIBRARY - FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient${QT_LIBINFIX} QtAssistantClient${QT_LIBINFIX}4 QtAssistant${QT_LIBINFIX} QtAssistant${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClient${QT_LIBINFIX}_debug QtAssistantClient${QT_LIBINFIX}d QtAssistantClient${QT_LIBINFIX}d4 QtAssistant${QT_LIBINFIX}_debug QtAssistant${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) # Set QT_QTHELP_LIBRARY - FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) - IF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) - FIND_LIBRARY(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) - ENDIF(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) + find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} QtCLucene${QT_LIBINFIX}4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + find_library(QT_QTCLUCENE_LIBRARY_DEBUG NAMES QtCLucene${QT_LIBINFIX}_debug QtCLucene${QT_LIBINFIX}d QtCLucene${QT_LIBINFIX}d4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH) + if(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) + find_library(QT_QTCLUCENE_LIBRARY_RELEASE NAMES QtCLucene${QT_LIBINFIX} PATHS ${QT_LIBRARY_DIR}) + endif(Q_WS_MAC AND QT_QTCORE_LIBRARY_RELEASE AND NOT QT_QTCLUCENE_LIBRARY_RELEASE) ############################################ @@ -919,9 +919,9 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # library include path to QT_INCLUDES _QT4_ADJUST_LIB_VARS(QtCore) - FOREACH(QT_MODULE ${QT_MODULES}) + foreach(QT_MODULE ${QT_MODULES}) _QT4_ADJUST_LIB_VARS(${QT_MODULE}) - ENDFOREACH(QT_MODULE) + endforeach(QT_MODULE) _QT4_ADJUST_LIB_VARS(QtAssistant) _QT4_ADJUST_LIB_VARS(QtAssistantClient) @@ -929,11 +929,11 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) _QT4_ADJUST_LIB_VARS(QtDesignerComponents) # platform dependent libraries - IF(Q_WS_WIN) + if(Q_WS_WIN) _QT4_ADJUST_LIB_VARS(qtmain) _QT4_ADJUST_LIB_VARS(QAxServer) _QT4_ADJUST_LIB_VARS(QAxContainer) - ENDIF(Q_WS_WIN) + endif(Q_WS_WIN) ####################################### @@ -944,104 +944,104 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) ####################################### - IF(QT_QMAKE_CHANGED) - SET(QT_UIC_EXECUTABLE NOTFOUND) - SET(QT_MOC_EXECUTABLE NOTFOUND) - SET(QT_UIC3_EXECUTABLE NOTFOUND) - SET(QT_RCC_EXECUTABLE NOTFOUND) - SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND) - SET(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND) - SET(QT_LUPDATE_EXECUTABLE NOTFOUND) - SET(QT_LRELEASE_EXECUTABLE NOTFOUND) - SET(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND) - SET(QT_DESIGNER_EXECUTABLE NOTFOUND) - SET(QT_LINGUIST_EXECUTABLE NOTFOUND) - ENDIF(QT_QMAKE_CHANGED) - - FIND_PROGRAM(QT_MOC_EXECUTABLE + if(QT_QMAKE_CHANGED) + set(QT_UIC_EXECUTABLE NOTFOUND) + set(QT_MOC_EXECUTABLE NOTFOUND) + set(QT_UIC3_EXECUTABLE NOTFOUND) + set(QT_RCC_EXECUTABLE NOTFOUND) + set(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND) + set(QT_DBUSXML2CPP_EXECUTABLE NOTFOUND) + set(QT_LUPDATE_EXECUTABLE NOTFOUND) + set(QT_LRELEASE_EXECUTABLE NOTFOUND) + set(QT_QCOLLECTIONGENERATOR_EXECUTABLE NOTFOUND) + set(QT_DESIGNER_EXECUTABLE NOTFOUND) + set(QT_LINGUIST_EXECUTABLE NOTFOUND) + endif(QT_QMAKE_CHANGED) + + find_program(QT_MOC_EXECUTABLE NAMES moc-qt4 moc PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_UIC_EXECUTABLE + find_program(QT_UIC_EXECUTABLE NAMES uic-qt4 uic PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_UIC3_EXECUTABLE + find_program(QT_UIC3_EXECUTABLE NAMES uic3 PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_RCC_EXECUTABLE + find_program(QT_RCC_EXECUTABLE NAMES rcc PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_DBUSCPP2XML_EXECUTABLE + find_program(QT_DBUSCPP2XML_EXECUTABLE NAMES qdbuscpp2xml PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_DBUSXML2CPP_EXECUTABLE + find_program(QT_DBUSXML2CPP_EXECUTABLE NAMES qdbusxml2cpp PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_LUPDATE_EXECUTABLE + find_program(QT_LUPDATE_EXECUTABLE NAMES lupdate-qt4 lupdate PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_LRELEASE_EXECUTABLE + find_program(QT_LRELEASE_EXECUTABLE NAMES lrelease-qt4 lrelease PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_QCOLLECTIONGENERATOR_EXECUTABLE + find_program(QT_QCOLLECTIONGENERATOR_EXECUTABLE NAMES qcollectiongenerator-qt4 qcollectiongenerator PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_DESIGNER_EXECUTABLE + find_program(QT_DESIGNER_EXECUTABLE NAMES designer-qt4 designer PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_PROGRAM(QT_LINGUIST_EXECUTABLE + find_program(QT_LINGUIST_EXECUTABLE NAMES linguist-qt4 linguist PATHS ${QT_BINARY_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - IF (QT_MOC_EXECUTABLE) - SET(QT_WRAP_CPP "YES") - ENDIF (QT_MOC_EXECUTABLE) + if (QT_MOC_EXECUTABLE) + set(QT_WRAP_CPP "YES") + endif (QT_MOC_EXECUTABLE) - IF (QT_UIC_EXECUTABLE) - SET(QT_WRAP_UI "YES") - ENDIF (QT_UIC_EXECUTABLE) + if (QT_UIC_EXECUTABLE) + set(QT_WRAP_UI "YES") + endif (QT_UIC_EXECUTABLE) - MARK_AS_ADVANCED( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE + mark_as_advanced( QT_UIC_EXECUTABLE QT_UIC3_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_DBUSXML2CPP_EXECUTABLE QT_DBUSCPP2XML_EXECUTABLE QT_LUPDATE_EXECUTABLE QT_LRELEASE_EXECUTABLE QT_QCOLLECTIONGENERATOR_EXECUTABLE QT_DESIGNER_EXECUTABLE QT_LINGUIST_EXECUTABLE) # get the directory of the current file, used later on in the file - GET_FILENAME_COMPONENT( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component( _qt4_current_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) ############################################### @@ -1050,7 +1050,7 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ############################################### - INCLUDE("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake") + include("${_qt4_current_dir}/Qt4ConfigDependentSettings.cmake") ####################################### @@ -1059,84 +1059,84 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ####################################### - SET( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers ) - - SET( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets ) - SET( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer ) - SET( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs ) - SET( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows ) - SET( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin ) - SET( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb ) - SET( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem ) - SET( QT_ICONENGINES_PLUGINS qsvgicon ) - SET( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) - SET( QT_INPUTMETHODS_PLUGINS qimsw_multi ) - SET( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) - IF(APPLE) - SET( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) - ELSEIF(WIN32) - SET( QT_PHONON_BACKEND_PLUGINS phonon_ds9 ) - ENDIF() - SET( QT_SCRIPT_PLUGINS qtscriptdbus ) - SET( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) - - SET( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} ) - SET( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets ) - SET( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} ) - SET( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} ) - SET( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} ) - SET( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} ) - SET( QT_QTSVG_PLUGINS qsvg qsvgicon ) - - IF(QT_QMAKE_CHANGED) - FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) - STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) - SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) - FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) - STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) - UNSET(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE) - UNSET(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE) - UNSET(QT_${_upper_qt_plugin}_LIBRARY CACHE) - UNSET(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE) - UNSET(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE) - UNSET(QT_${_upper_qt_plugin}_PLUGIN CACHE) - ENDFOREACH(QT_PLUGIN) - ENDFOREACH(QT_PLUGIN_TYPE) - ENDIF(QT_QMAKE_CHANGED) + set( QT_PLUGIN_TYPES accessible bearer codecs decorations designer gfxdrivers graphicssystems iconengines imageformats inputmethods mousedrivers phonon_backend script sqldrivers ) + + set( QT_ACCESSIBLE_PLUGINS qtaccessiblecompatwidgets qtaccessiblewidgets ) + set( QT_BEARER_PLUGINS qcorewlanbearer qgenericbearer ) + set( QT_CODECS_PLUGINS qcncodecs qjpcodecs qkrcodecs qtwcodecs ) + set( QT_DECORATIONS_PLUGINS qdecorationdefault qdecorationwindows ) + set( QT_DESIGNER_PLUGINS arthurplugin containerextension customwidgetplugin phononwidgets qdeclarativeview qt3supportwidgets qwebview taskmenuextension worldtimeclockplugin ) + set( QT_GRAPHICSDRIVERS_PLUGINS qgfxtransformed qgfxvnc qscreenvfb ) + set( QT_GRAPHICSSYSTEMS_PLUGINS qglgraphicssystem qtracegraphicssystem ) + set( QT_ICONENGINES_PLUGINS qsvgicon ) + set( QT_IMAGEFORMATS_PLUGINS qgif qjpeg qmng qico qsvg qtiff ) + set( QT_INPUTMETHODS_PLUGINS qimsw_multi ) + set( QT_MOUSEDRIVERS_PLUGINS qwstslibmousehandler ) + if(APPLE) + set( QT_PHONON_BACKEND_PLUGINS phonon_qt7 ) + elseif(WIN32) + set( QT_PHONON_BACKEND_PLUGINS phonon_ds9 ) + endif() + set( QT_SCRIPT_PLUGINS qtscriptdbus ) + set( QT_SQLDRIVERS_PLUGINS qsqldb2 qsqlibase qsqlite qsqlite2 qsqlmysql qsqloci qsqlodbc qsqlpsql qsqltds ) + + set( QT_PHONON_PLUGINS ${QT_PHONON_BACKEND_PLUGINS} ) + set( QT_QT3SUPPORT_PLUGINS qtaccessiblecompatwidgets ) + set( QT_QTCORE_PLUGINS ${QT_BEARER_PLUGINS} ${QT_CODECS_PLUGINS} ) + set( QT_QTGUI_PLUGINS qtaccessiblewidgets qgif qjpeg qmng qico qtiff ${QT_DECORATIONS_PLUGINS} ${QT_GRAPHICSDRIVERS_PLUGINS} ${QT_GRAPHICSSYSTEMS_PLUGINS} ${QT_INPUTMETHODS_PLUGINS} ${QT_MOUSEDRIVERS_PLUGINS} ) + set( QT_QTSCRIPT_PLUGINS ${QT_SCRIPT_PLUGINS} ) + set( QT_QTSQL_PLUGINS ${QT_SQLDRIVERS_PLUGINS} ) + set( QT_QTSVG_PLUGINS qsvg qsvgicon ) + + if(QT_QMAKE_CHANGED) + foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + unset(QT_${_upper_qt_plugin}_LIBRARY_RELEASE CACHE) + unset(QT_${_upper_qt_plugin}_LIBRARY_DEBUG CACHE) + unset(QT_${_upper_qt_plugin}_LIBRARY CACHE) + unset(QT_${_upper_qt_plugin}_PLUGIN_RELEASE CACHE) + unset(QT_${_upper_qt_plugin}_PLUGIN_DEBUG CACHE) + unset(QT_${_upper_qt_plugin}_PLUGIN CACHE) + endforeach(QT_PLUGIN) + endforeach(QT_PLUGIN_TYPE) + endif(QT_QMAKE_CHANGED) # find_library works better than find_file but we need to set prefixes to only match plugins - FOREACH(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) - STRING(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) - SET(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) - FOREACH(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) - STRING(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) - IF(QT_IS_STATIC) - FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_RELEASE + foreach(QT_PLUGIN_TYPE ${QT_PLUGIN_TYPES}) + string(TOUPPER ${QT_PLUGIN_TYPE} _upper_qt_plugin_type) + set(QT_${_upper_qt_plugin_type}_PLUGINS_DIR ${QT_PLUGINS_DIR}/${QT_PLUGIN_TYPE}) + foreach(QT_PLUGIN ${QT_${_upper_qt_plugin_type}_PLUGINS}) + string(TOUPPER ${QT_PLUGIN} _upper_qt_plugin) + if(QT_IS_STATIC) + find_library(QT_${_upper_qt_plugin}_LIBRARY_RELEASE NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_LIBRARY(QT_${_upper_qt_plugin}_LIBRARY_DEBUG + find_library(QT_${_upper_qt_plugin}_LIBRARY_DEBUG NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) _QT4_ADJUST_LIB_VARS(${QT_PLUGIN}) - ELSE(QT_IS_STATIC) + else(QT_IS_STATIC) # find_library works easier/better than find_file but we need to set suffixes to only match plugins - SET(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES}) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) - FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_RELEASE + set(CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT ${CMAKE_FIND_LIBRARY_SUFFIXES}) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_MODULE_SUFFIX} ${CMAKE_SHARED_LIBRARY_SUFFIX}) + find_library(QT_${_upper_qt_plugin}_PLUGIN_RELEASE NAMES ${QT_PLUGIN}${QT_LIBINFIX} ${QT_PLUGIN}${QT_LIBINFIX}4 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - FIND_LIBRARY(QT_${_upper_qt_plugin}_PLUGIN_DEBUG + find_library(QT_${_upper_qt_plugin}_PLUGIN_DEBUG NAMES ${QT_PLUGIN}${QT_LIBINFIX}_debug ${QT_PLUGIN}${QT_LIBINFIX}d ${QT_PLUGIN}${QT_LIBINFIX}d4 PATHS ${QT_${_upper_qt_plugin_type}_PLUGINS_DIR} NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH ) - MARK_AS_ADVANCED(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) - ENDIF(QT_IS_STATIC) - ENDFOREACH(QT_PLUGIN) - ENDFOREACH(QT_PLUGIN_TYPE) + mark_as_advanced(QT_${_upper_qt_plugin}_PLUGIN_RELEASE QT_${_upper_qt_plugin}_PLUGIN_DEBUG) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_DEFAULT}) + endif(QT_IS_STATIC) + endforeach(QT_PLUGIN) + endforeach(QT_PLUGIN_TYPE) ###################################### @@ -1145,57 +1145,57 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION) # ###################################### - INCLUDE("${_qt4_current_dir}/Qt4Macros.cmake") + include("${_qt4_current_dir}/Qt4Macros.cmake") # set version variables - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}") + string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}") -ENDIF(QT_QMAKE_EXECUTABLE AND QTVERSION) +endif(QT_QMAKE_EXECUTABLE AND QTVERSION) #support old QT_MIN_VERSION if set, but not if version is supplied by find_package() -IF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) - SET(Qt4_FIND_VERSION ${QT_MIN_VERSION}) -ENDIF(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) +if(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) + set(Qt4_FIND_VERSION ${QT_MIN_VERSION}) +endif(NOT Qt4_FIND_VERSION AND QT_MIN_VERSION) -IF( Qt4_FIND_COMPONENTS ) +if( Qt4_FIND_COMPONENTS ) # if components specified in find_package(), make sure each of those pieces were found - SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR) - FOREACH( component ${Qt4_FIND_COMPONENTS} ) - STRING( TOUPPER ${component} _COMPONENT ) + set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR) + foreach( component ${Qt4_FIND_COMPONENTS} ) + string( TOUPPER ${component} _COMPONENT ) if(${_COMPONENT} STREQUAL "QTMAIN") - IF(Q_WS_WIN) - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY) - ENDIF(Q_WS_WIN) + if(Q_WS_WIN) + set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_LIBRARY) + endif(Q_WS_WIN) else(${_COMPONENT} STREQUAL "QTMAIN") - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) + set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_${_COMPONENT}_INCLUDE_DIR QT_${_COMPONENT}_LIBRARY) endif(${_COMPONENT} STREQUAL "QTMAIN") - ENDFOREACH( component ) + endforeach( component ) if(Qt4_FIND_COMPONENTS MATCHES QtGui) - SET(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) + set(_QT4_FOUND_REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} QT_UIC_EXECUTABLE) endif(Qt4_FIND_COMPONENTS MATCHES QtGui) -ELSE( Qt4_FIND_COMPONENTS ) +else( Qt4_FIND_COMPONENTS ) # if no components specified, we'll make a default set of required variables to say Qt is found - SET(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR + set(_QT4_FOUND_REQUIRED_VARS QT_QMAKE_EXECUTABLE QT_MOC_EXECUTABLE QT_RCC_EXECUTABLE QT_UIC_EXECUTABLE QT_INCLUDE_DIR QT_LIBRARY_DIR QT_QTCORE_LIBRARY) -ENDIF( Qt4_FIND_COMPONENTS ) +endif( Qt4_FIND_COMPONENTS ) if (QT_VERSION_MAJOR GREATER 4) - SET(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}") - SET(QT4_FOUND FALSE) - IF(Qt4_FIND_REQUIRED) - MESSAGE( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x") - ELSE(Qt4_FIND_REQUIRED) - IF(NOT Qt4_FIND_QUIETLY) - MESSAGE( STATUS "${VERSION_MSG}") - ENDIF(NOT Qt4_FIND_QUIETLY) - ENDIF(Qt4_FIND_REQUIRED) + set(VERSION_MSG "Found unsuitable Qt version \"${QTVERSION}\" from ${QT_QMAKE_EXECUTABLE}") + set(QT4_FOUND FALSE) + if(Qt4_FIND_REQUIRED) + message( FATAL_ERROR "${VERSION_MSG}, this code requires Qt 4.x") + else(Qt4_FIND_REQUIRED) + if(NOT Qt4_FIND_QUIETLY) + message( STATUS "${VERSION_MSG}") + endif(NOT Qt4_FIND_QUIETLY) + endif(Qt4_FIND_REQUIRED) else() FIND_PACKAGE_HANDLE_STANDARD_ARGS(Qt4 REQUIRED_VARS ${_QT4_FOUND_REQUIRED_VARS} @@ -1209,8 +1209,8 @@ endif() # ####################################### # Backwards compatibility for CMake1.4 and 1.2 -SET (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) -SET (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) -SET( QT_QT_LIBRARY "") -SET(QT_FOUND ${QT4_FOUND}) +set (QT_MOC_EXE ${QT_MOC_EXECUTABLE} ) +set (QT_UIC_EXE ${QT_UIC_EXECUTABLE} ) +set( QT_QT_LIBRARY "") +set(QT_FOUND ${QT4_FOUND}) |