diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-08-27 13:34:42 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-08-27 13:34:42 (GMT) |
commit | 4af20a2e0a60c5a834ad29246845d1235b3365a7 (patch) | |
tree | 9b78bba18bb122bb6e85a034e1f52cf782e21955 /Modules | |
parent | dc0c5d082b69e53a8634931c0af6675404fea054 (diff) | |
download | CMake-4af20a2e0a60c5a834ad29246845d1235b3365a7.zip CMake-4af20a2e0a60c5a834ad29246845d1235b3365a7.tar.gz CMake-4af20a2e0a60c5a834ad29246845d1235b3365a7.tar.bz2 |
ENH: #3225: first check the special paths, the the default path, also for
searching kde-config
Alex
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindKDE3.cmake | 80 |
1 files changed, 63 insertions, 17 deletions
diff --git a/Modules/FindKDE3.cmake b/Modules/FindKDE3.cmake index 0fa5873..0cce9f2 100644 --- a/Modules/FindKDE3.cmake +++ b/Modules/FindKDE3.cmake @@ -98,56 +98,102 @@ ENDIF (CMAKE_SYSTEM_NAME MATCHES BSD) #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 + $ENV{KDEDIR}/bin + /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 + OUTPUT_VARIABLE kde_config_version ) -#at first the KDE include direcory + STRING(REGEX MATCH "KDE: .\\." kde_version ${kde_config_version}) + IF (${kde_version} MATCHES "KDE: 3\\.") + EXECUTE_PROCESS(COMMAND ${KDECONFIG_EXECUTABLE} --prefix + OUTPUT_VARIABLE kdedir ) + STRING(REGEX REPLACE "\n" "" KDE3PREFIX "${kdedir}") + + ENDIF (${kde_version} MATCHES "KDE: 3\\.") +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 $ENV{KDEDIR}/include - /opt/kde/include + ${KDE3PREFIX}/include /opt/kde3/include + /opt/kde/include /usr/local/include - /usr/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 $ENV{KDEDIR}/lib - /opt/kde/lib + ${KDE3PREFIX}/lib /opt/kde3/lib - /usr/lib - /usr/local/lib + /opt/kde/lib + NO_DEFAULT_PATH ) -GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH ) +FIND_LIBRARY(KDE3_KDECORE_LIBRARY NAMES kdecore) -#now the KDE service types directory -#FIND_PATH(KDE3_SERVICETYPES_DIR ktexteditor.desktop -# $ENV{KDEDIR}/share/servicetypes/ -# /opt/kde/share/servicetypes/ -# /opt/kde3/share/servicetypes/ -#) +GET_FILENAME_COMPONENT(KDE3_LIB_DIR ${KDE3_KDECORE_LIBRARY} PATH ) #now search for the dcop utilities FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl PATHS $ENV{KDEDIR}/bin - /opt/kde/bin + ${KDE3PREFIX}/bin /opt/kde3/bin + /opt/kde/bin + NO_DEFAULT_PATH ) +FIND_PROGRAM(KDE3_DCOPIDL_EXECUTABLE NAMES dcopidl) + FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp PATHS $ENV{KDEDIR}/bin + ${KDE3PREFIX}/bin + /opt/kde3/bin /opt/kde/bin - /opt/kde3/bin) + NO_DEFAULT_PATH + ) + +FIND_PROGRAM(KDE3_DCOPIDL2CPP_EXECUTABLE NAMES dcopidl2cpp) FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler PATHS $ENV{KDEDIR}/bin + ${KDE3PREFIX}/bin + /opt/kde3/bin /opt/kde/bin - /opt/kde3/bin) + NO_DEFAULT_PATH + ) +FIND_PROGRAM(KDE3_KCFGC_EXECUTABLE NAMES kconfig_compiler) # KDE3Macros.cmake contains all the KDE specific macros INCLUDE(KDE3Macros) |