From 314e5ce5ee03baebff4731c44c0aca871135603d Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 11 Jan 2013 14:53:25 +0100 Subject: Add an umbrella cmake config file for Qt 5. Change-Id: I96b6e96539a84a5919992afbaee757fa080b7ae0 Reviewed-by: Oswald Buddenhagen Reviewed-by: Alexander Neundorf Reviewed-by: Stephen Kelly --- src/corelib/Qt5Config.cmake.in | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/corelib/Qt5Config.cmake.in (limited to 'src/corelib/Qt5Config.cmake.in') diff --git a/src/corelib/Qt5Config.cmake.in b/src/corelib/Qt5Config.cmake.in new file mode 100644 index 0000000000..408dd64496 --- /dev/null +++ b/src/corelib/Qt5Config.cmake.in @@ -0,0 +1,43 @@ + +if (CMAKE_VERSION VERSION_LESS 2.8.9) + message(FATAL_ERROR \"Qt5 requires at least CMake version 2.8.9\") +endif() + +if (NOT Qt5_FIND_COMPONENTS) + set(Qt5_NOT_FOUND_MESSAGE \"The Qt5 package requires at least one component\") + set(Qt5_FOUND False) + return() +endif() + +set(_Qt5_FIND_PARTS_REQUIRED) +if (Qt5_FIND_REQUIRED) + set(_Qt5_FIND_PARTS_REQUIRED REQUIRED) +endif() +set(_Qt5_FIND_PARTS_QUIET) +if (Qt5_FIND_QUIETLY) + set(_Qt5_FIND_PARTS_QUIET QUIET) +endif() + +get_filename_component(_qt5_install_prefix \"${CMAKE_CURRENT_LIST_DIR}/$${CMAKE_RELATIVE_INSTALL_DIR}\" ABSOLUTE) + +set(_Qt5_NOTFOUND_MESSAGE) + +foreach(module ${Qt5_FIND_COMPONENTS}) + find_package(Qt5${module} + ${_Qt5_FIND_PARTS_QUIET} + ${_Qt5_FIND_PARTS_REQUIRED} + PATHS \"${_qt5_install_prefix}\" NO_DEFAULT_PATH + ) + if (NOT Qt5${module}_FOUND) + if (Qt5_FIND_REQUIRED_${module}) + set(_Qt5_NOTFOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake\\\"\\n\") + elseif(NOT Qt5_FIND_QUIETLY) + message(WARNING \"Failed to find Qt5 component \\\"${module}\\\" config file at \\\"${_qt5_install_prefix}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake\\\"\") + endif() + endif() +endforeach() + +if (_Qt5_NOTFOUND_MESSAGE) + set(Qt5_NOT_FOUND_MESSAGE \"${_Qt5_NOTFOUND_MESSAGE}\") + set(Qt5_FOUND False) +endif() -- cgit v1.2.3