summaryrefslogtreecommitdiff
path: root/Modules/FindQt4.cmake
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2014-03-29 20:22:54 -0600
committerClinton Stimpson <clinton@elemtech.com>2014-03-29 20:22:54 -0600
commit83934757c942672d8bea79f11e51a184b168a212 (patch)
treedd6d3dc88daeb1a8ba07e1feb8d324667bb4c789 /Modules/FindQt4.cmake
parent4c0cc9ab9195d348ea5f1b004789ec334531bbb1 (diff)
downloadcmake-83934757c942672d8bea79f11e51a184b168a212.tar.gz
Find*: Make find_package(.. QUIET) affect Check* modules.
Fixes issues #14812 and #14813 where find_package(OpenMP QUIET) and find_package(Qt4 QUIET) would still print out messages when calling check*() functions. Also a partial fix for #14445 where building CMake (without cmake-gui) when Qt5 is installed and Qt4 is not installed and warnings come out of FindQt4.cmake.
Diffstat (limited to 'Modules/FindQt4.cmake')
-rw-r--r--Modules/FindQt4.cmake20
1 files changed, 11 insertions, 9 deletions
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index d0515c6826..e44d1d9d8e 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -335,6 +335,7 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/CheckCXXSymbolExists.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/MacroAddFileDependencies.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(${CMAKE_CURRENT_LIST_DIR}/CMakePushCheckState.cmake)
set(QT_USE_FILE ${CMAKE_ROOT}/Modules/UseQt4.cmake)
@@ -613,9 +614,13 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
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(NOT Qt4_FIND_QUIETLY)
+ 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.")
+ endif()
set(Qt4_FOUND FALSE)
if(Qt4_FIND_REQUIRED)
message( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
@@ -747,11 +752,10 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
# Find out what window system we're using
#
#############################################
- # Save required variable
- set(CMAKE_REQUIRED_INCLUDES_SAVE ${CMAKE_REQUIRED_INCLUDES})
- set(CMAKE_REQUIRED_FLAGS_SAVE ${CMAKE_REQUIRED_FLAGS})
+ cmake_push_check_state()
# Add QT_INCLUDE_DIR to CMAKE_REQUIRED_INCLUDES
set(CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES};${QT_INCLUDE_DIR}")
+ set(CMAKE_REQUIRED_QUIET ${Qt4_FIND_QUIETLY})
# 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)
@@ -771,9 +775,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
endif ()
endif ()
- # 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})
+ cmake_pop_check_state()
#
#############################################