diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-05-11 22:27:13 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-05-11 22:27:13 (GMT) |
commit | 97fcff2445f0caf89394e2f0060fa01f4161d8c1 (patch) | |
tree | 970177248ef57c830e5142ce7f8448c4936d6773 /Modules/FindKDE4.cmake | |
parent | 221a169cb90adee5d4c74408f501ad282ecebc2c (diff) | |
download | CMake-97fcff2445f0caf89394e2f0060fa01f4161d8c1.zip CMake-97fcff2445f0caf89394e2f0060fa01f4161d8c1.tar.gz CMake-97fcff2445f0caf89394e2f0060fa01f4161d8c1.tar.bz2 |
ENH: use the new FILE(TO_CMAKE_PATH ...) command instead of regexps
BUG: append the kde 4 cmake module path instead of prepending it
Alex
Diffstat (limited to 'Modules/FindKDE4.cmake')
-rw-r--r-- | Modules/FindKDE4.cmake | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/Modules/FindKDE4.cmake b/Modules/FindKDE4.cmake index 17affad..94f29a6 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) - MESSAGE(FATAL_ERROR "ERROR: cmake/modules/FindKDE4Internal.cmake not found in ${_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) - |