aboutsummaryrefslogtreecommitdiff
path: root/modules/FindKDE4Internal.cmake
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2010-01-17 18:11:01 +0000
committerAlexander Neundorf <neundorf@kde.org>2010-01-17 18:11:01 +0000
commit08134581fe028a5dd1a94b9b8bc2022c7c1e23f9 (patch)
tree2cfe99635e0ed2b5b8202861c8ecd5af04b1dea5 /modules/FindKDE4Internal.cmake
parent9c18c97448697082b34db4345d3ae527284b408a (diff)
downloadextra-cmake-modules-08134581fe028a5dd1a94b9b8bc2022c7c1e23f9.tar.gz
extra-cmake-modules-08134581fe028a5dd1a94b9b8bc2022c7c1e23f9.tar.bz2
-use imported targets for the Qt4 libs also in the 4.4 release branch
This fixes handling release and debug versions of Qt, and is a major improvement for the deployment of KDE under Windows. Alex svn path=/branches/KDE/4.4/kdelibs/; revision=1076181
Diffstat (limited to 'modules/FindKDE4Internal.cmake')
-rw-r--r--modules/FindKDE4Internal.cmake16
1 files changed, 13 insertions, 3 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake
index c6f5599e..569776a6 100644
--- a/modules/FindKDE4Internal.cmake
+++ b/modules/FindKDE4Internal.cmake
@@ -303,6 +303,10 @@ endif(POLICY CMP0011)
# Only do something if it hasn't been found yet
if(NOT KDE4_FOUND)
+# get the directory of the current file, used later on in the file
+get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
+
+
include (MacroEnsureVersion)
# We may only search for other packages with "REQUIRED" if we are required ourselves.
@@ -317,6 +321,13 @@ else(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
set(_REQ_STRING_KDE4_MESSAGE "STATUS")
endif(KDE4_FIND_REQUIRED OR KDE4Internal_FIND_REQUIRED)
+
+# Store CMAKE_MODULE_PATH and then append the current dir to it, so we are sure
+# we get the FindQt4.cmake located next to us and not a different one.
+# The original CMAKE_MODULE_PATH is restored later on.
+set(_kde_cmake_module_path_back ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH ${kde_cmake_module_dir} ${CMAKE_MODULE_PATH} )
+
# if the minimum Qt requirement is changed, change all occurrence in the
# following lines
if( NOT QT_MIN_VERSION )
@@ -351,6 +362,8 @@ if(NOT PERL_FOUND)
message(STATUS "Perl not found")
endif(NOT PERL_FOUND)
+# restore the original CMAKE_MODULE_PATH
+set(CMAKE_MODULE_PATH ${_kde_cmake_module_path_back})
# we check for Phonon not here, but further below, i.e. after KDELibsDependencies.cmake
# has been loaded, which helps in the case that phonon is installed to the same
@@ -390,9 +403,6 @@ include (CheckCXXCompilerFlag)
include (CheckCXXSourceCompiles)
-# get the directory of the current file, used later on in the file
-get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
-
# are we trying to compile kdelibs ? kdelibs_SOURCE_DIR comes from "project(kdelibs)" in kdelibs/CMakeLists.txt
# then enter bootstrap mode