summaryrefslogtreecommitdiffstats
path: root/Modules/FindKDE3.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-06-09 20:04:06 (GMT)
committerBrad King <brad.king@kitware.com>2008-06-09 20:04:06 (GMT)
commite2ec3b671b3753da42df167ba1a4e496d08b5ce2 (patch)
treefe2cea51ff2d1d1e681483a4bdad911fea88457c /Modules/FindKDE3.cmake
parent05434489079708e9896d03b7fc9153ded1d960b4 (diff)
downloadCMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.zip
CMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.tar.gz
CMake-e2ec3b671b3753da42df167ba1a4e496d08b5ce2.tar.bz2
ENH: Cleanup Find* modules with new HINTS feature
- The find_* commands now provide a HINTS option. - The option specifies paths to be preferred over the system paths. - Many Find* modules were using two find calls with NO_DEFAULT_PATH to approximate the behavior, but that blocked users from overriding things with CMAKE_PREFIX_PATH. - This commit uses the HINTS feature to get desired behavior in only one find command call.
Diffstat (limited to 'Modules/FindKDE3.cmake')
-rw-r--r--Modules/FindKDE3.cmake50
1 files changed, 16 insertions, 34 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake
index d8ef875..79d66ec 100644
--- a/Modules/FindKDE3.cmake
+++ b/Modules/FindKDE3.cmake
@@ -103,27 +103,15 @@ ENDIF (NOT CMAKE_BUILD_TYPE)
#SET(CMAKE_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
#SET(CMAKE_MODULE_LINKER_FLAGS "-Wl,--fatal-warnings -avoid-version -Wl,--no-undefined -lc")
-# all calls to FIND_PROGRAM/PATH/LIBRARY() follow the same scheme:
-# at first try some special paths with the argument "NO_DEFAULT_PATH"
-# so only these paths are checked
-# this is followed by a second call to FIND_PROGRAM/PATH/LIBRARY()
-# but this time without any paths and without NO_DEFAULT_PATH
-# this second call will do nothing if the first call already found
-# what it was looking for, if not, it will search only in the default
-# directories (/usr, /usr/local, etc.)
-
#now try to find some kde stuff
-FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config PATHS
+FIND_PROGRAM(KDECONFIG_EXECUTABLE NAMES kde-config
+ HINTS
$ENV{KDEDIR}/bin
+ PATHS
/opt/kde3/bin
/opt/kde/bin
- NO_DEFAULT_PATH
)
-
-FIND_PROGRAM(KDECONFIG_EXECUTABLE kde-config)
-
-
SET(KDE3PREFIX)
IF(KDECONFIG_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --version
@@ -143,29 +131,26 @@ ENDIF(KDECONFIG_EXECUTABLE)
# at first the KDE include direcory
# kpassdlg.h comes from kdeui and doesn't exist in KDE4 anymore
FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h
+ HINTS
$ENV{KDEDIR}/include
${KDE3PREFIX}/include
+ PATHS
/opt/kde3/include
/opt/kde/include
/usr/include/kde
/usr/local/include/kde
- NO_DEFAULT_PATH
)
-FIND_PATH(KDE3_INCLUDE_DIR kpassdlg.h)
-
#now the KDE library directory
FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore
- PATHS
+ HINTS
$ENV{KDEDIR}/lib
${KDE3PREFIX}/lib
+ PATHS
/opt/kde3/lib
/opt/kde/lib
- NO_DEFAULT_PATH
)
-FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore)
-
SET(QT_AND_KDECORE_LIBS ${QT_LIBRARIES} ${KDE3_KDECORE_LIBRARY})
GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH )
@@ -179,36 +164,33 @@ IF(NOT KDE3_LIBTOOL_DIR)
ENDIF(NOT KDE3_LIBTOOL_DIR)
#now search for the dcop utilities
-FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl PATHS
+FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl
+ HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
+ PATHS
/opt/kde3/bin
/opt/kde/bin
- NO_DEFAULT_PATH
)
-FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl)
-
-FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp PATHS
+FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp
+ HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
+ PATHS
/opt/kde3/bin
/opt/kde/bin
- NO_DEFAULT_PATH
)
-FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp)
-
-FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler PATHS
+FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler
+ HINTS
$ENV{KDEDIR}/bin
${KDE3PREFIX}/bin
+ PATHS
/opt/kde3/bin
/opt/kde/bin
- NO_DEFAULT_PATH
)
-FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler)
-
# KDE3Macros.cmake contains all the KDE specific macros
INCLUDE(KDE3Macros)