diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2007-07-10 11:08:43 +0000 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2007-07-10 11:08:43 +0000 |
commit | cf2cfaf67614854651a5b754d718e2478ea042ad (patch) | |
tree | d4b3e074bf962394410a2795da7b32553359d292 | |
parent | 9acfb803ba35333263c31040f9fce81c2ac7bc0c (diff) | |
download | extra-cmake-modules-cf2cfaf67614854651a5b754d718e2478ea042ad.tar.gz extra-cmake-modules-cf2cfaf67614854651a5b754d718e2478ea042ad.tar.bz2 |
added support for searching cmake modules in all given kde install locations (KDEDIRS based)
svn path=/trunk/KDE/kdelibs/; revision=686007
-rw-r--r-- | modules/FindKDE4Internal.cmake | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/FindKDE4Internal.cmake b/modules/FindKDE4Internal.cmake index 24803eab..063531fc 100644 --- a/modules/FindKDE4Internal.cmake +++ b/modules/FindKDE4Internal.cmake @@ -263,6 +263,28 @@ get_filename_component( kde_cmake_module_dir ${CMAKE_CURRENT_LIST_FILE} PATH) if (NOT _kdeBootStrapping) # this file contains all dependencies of all libraries of kdelibs, Alex include(${kde_cmake_module_dir}/KDELibsDependencies.cmake) + + # allow searching cmake modules in all given kde install locations (KDEDIRS based) + exec_program(kde4-config ARGS --path data OUTPUT_VARIABLE _data_DIR) + file(TO_CMAKE_PATH "${_data_DIR}" _data_DIR) + foreach(dir ${_data_DIR}) + set (apath ${dir}/cmake/modules) + if (EXISTS ${apath}) + set (included 0) + STRING(TOLOWER ${apath} _apath) + # ignore already added pathes, case insensitive + foreach(adir ${CMAKE_MODULE_PATH}) + STRING(TOLOWER ${adir} _adir) + if (${_adir} STREQUAL ${_apath}) + set (included 1) + endif (${_adir} STREQUAL ${_apath}) + endforeach(adir) + if (NOT included) + message(STATUS "Adding ${dir}/cmake/modules to CMAKE_MODULE_PATH") + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${dir}/cmake/modules) + endif (NOT included) + endif (EXISTS ${apath}) + endforeach(dir) endif (NOT _kdeBootStrapping) # this macro implements some very special logic how to deal with the cache |