summaryrefslogtreecommitdiffstats
path: root/Modules/FindKDE4.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-05-14 19:22:53 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-05-14 19:22:53 (GMT)
commit3d4c7887378bb3f0d486f7ec8166161f0b639c06 (patch)
tree0d65d17ad789d459ffe83f8a2c38affa1492eb2d /Modules/FindKDE4.cmake
parent401922e04ba57d5672abf1cb112f79018e0e8f74 (diff)
downloadCMake-3d4c7887378bb3f0d486f7ec8166161f0b639c06.zip
CMake-3d4c7887378bb3f0d486f7ec8166161f0b639c06.tar.gz
CMake-3d4c7887378bb3f0d486f7ec8166161f0b639c06.tar.bz2
ENH: merge from main tree
Diffstat (limited to 'Modules/FindKDE4.cmake')
-rw-r--r--Modules/FindKDE4.cmake33
1 files changed, 12 insertions, 21 deletions
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake
index 17affad..211947e 100644
--- a/Modules/FindKDE4.cmake
+++ b/Modules/FindKDE4.cmake
@@ -10,18 +10,15 @@
#
# Author: Alexander Neundorf <neundorf@kde.org>
+FILE(TO_CMAKE_PATH "$ENV{KDEDIRS}" _KDEDIRS)
+
# First try to find kde-config
FIND_PROGRAM(KDE4_KDECONFIG_EXECUTABLE NAMES kde-config
PATHS
${CMAKE_INSTALL_PREFIX}/bin
- $ENV{KDEDIR}/bin
+ ${_KDEDIRS}
/opt/kde4/bin
- /opt/kde
- /bin
- /usr/bin
- /usr/local/bin
- NO_SYSTEM_PATH
- NO_CMAKE_SYSTEM_PATH
+ NO_DEFAULT_PATH
)
@@ -33,14 +30,7 @@ IF (KDE4_KDECONFIG_EXECUTABLE)
# then ask kde-config for the kde data dirs
EXEC_PROGRAM(${KDE4_KDECONFIG_EXECUTABLE} ARGS --path data OUTPUT_VARIABLE _data_DIR )
-
- IF(WIN32)
- # cmake can't handle paths with '\' correct :-(
- STRING(REGEX REPLACE "\\\\" "/" _data_DIR "${_data_DIR}")
- ELSE(WIN32)
- # replace the ":" with ";" so that it becomes a valid cmake list
- STRING(REGEX REPLACE ":" ";" _data_DIR "${_data_DIR}")
- ENDIF(WIN32)
+ FILE(TO_CMAKE_PATH "${_data_DIR}" _data_DIR)
# then check the data dirs for FindKDE4Internal.cmake
FIND_PATH(KDE4_DATA_DIR cmake/modules/FindKDE4Internal.cmake ${_data_DIR})
@@ -48,7 +38,7 @@ IF (KDE4_KDECONFIG_EXECUTABLE)
# if it has been found...
IF (KDE4_DATA_DIR)
- SET(CMAKE_MODULE_PATH ${KDE4_DATA_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
+ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${KDE4_DATA_DIR}/cmake/modules)
IF (KDE4_FIND_QUIETLY)
SET(_quiet QUIET)
@@ -61,13 +51,14 @@ IF (KDE4_KDECONFIG_EXECUTABLE)
# use FindKDE4Internal.cmake to do the rest
FIND_PACKAGE(KDE4Internal ${_req} ${_quiet})
ELSE (KDE4_DATA_DIR)
+ IF (KDE4_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_data_DIR}")
+ ENDIF (KDE4_FIND_REQUIRED)
ENDIF (KDE4_DATA_DIR)
+ELSE (KDE4_KDECONFIG_EXECUTABLE)
+ IF (KDE4_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "ERROR: Could not find KDE4 kde-config")
+ ENDIF (KDE4_FIND_REQUIRED)
ENDIF (KDE4_KDECONFIG_EXECUTABLE)
-
-IF (KDE4_FIND_REQUIRED AND NOT KDE4_FOUND)
- MESSAGE(FATAL_ERROR "ERROR: Could not find KDE4")
-ENDIF (KDE4_FIND_REQUIRED AND NOT KDE4_FOUND)
-