diff options
| author | David Faure <faure@kde.org> | 2006-05-31 13:58:32 +0000 | 
|---|---|---|
| committer | David Faure <faure@kde.org> | 2006-05-31 13:58:32 +0000 | 
| commit | a93dc995227d4ad66b1fb781842276130618b6ff (patch) | |
| tree | fff5f66a14b61554694db11474b4dec506747b78 /modules | |
| parent | 16f77f3ff06a1a5051a0b12d6223aa85a16e7f28 (diff) | |
| download | extra-cmake-modules-a93dc995227d4ad66b1fb781842276130618b6ff.tar.gz extra-cmake-modules-a93dc995227d4ad66b1fb781842276130618b6ff.tar.bz2 | |
Save 8 calls to pkg-config when reconfiguring and qtdbus is all in the cache already.
svn path=/trunk/KDE/kdelibs/; revision=546948
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/FindQtDBus.cmake | 59 | 
1 files changed, 34 insertions, 25 deletions
| diff --git a/modules/FindQtDBus.cmake b/modules/FindQtDBus.cmake index eb3abcff..28de058d 100644 --- a/modules/FindQtDBus.cmake +++ b/modules/FindQtDBus.cmake @@ -20,35 +20,44 @@  #    Generates adaptor code from the given XML files.  # -# use pkg-config to get the directories and then use these values -# in the FIND_PATH() and FIND_LIBRARY() calls -INCLUDE(UsePkgConfig) +if (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) -PKGCONFIG("dbus-1" _dbusIncDir _dbusLinkDir _dbusLinkFlags _dbusCflags) -PKGCONFIG("dbus-qt4-1" _qdbusIncDir _qdbusLinkDir _qdbusLinkFlags _qdbusCflags) +   # already in cache +   set(QDBUS_FOUND TRUE) -set(QDBUS_DEFINITIONS ${_dbusCflags} ${_qdbusCflags} CACHE INTERNAL "Definitions for Qt DBUS") -set(QDBUS_INCLUDE_DIRS ${_dbusIncDir} ${_qdbusIncDir} CACHE INTERNAL "Include dirs for Qt DBUS") +else (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) -FIND_LIBRARY(QDBUS_LIBRARIES NAMES dbus-qt4-1 -  PATHS ${_qdbusLinkDir} -) +   # use pkg-config to get the directories and then use these values +   # in the FIND_PATH() and FIND_LIBRARY() calls +   INCLUDE(UsePkgConfig) -if (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) -   set(QDBUS_FOUND TRUE) -endif (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) - -message(STATUS "QtDBus Results: ${QDBUS_LIBRARIES} ${QDBUS_INCLUDE_DIRS} ${QDBUS_DEFINITIONS}") -if (QDBUS_FOUND) -  if (NOT QDBUS_FIND_QUIETLY) -    message(STATUS "Found QtDBus: ${QDBUS_LIBRARIES}") -  endif (NOT QDBUS_FIND_QUIETLY) -else (QDBUS_FOUND) -  message(STATUS "You need the CVS version of D-BUS library. The one that your distribution installed, even if it's 0.61, probably won't be enough to compile QtDBus.") -  message(STATUS "You need the Subversion or CVS version of QtDBus. It's official home is now in trunk/kdesupport/") -  message(STATUS "See also the PORTING-TO-DBUS.txt file in kdelibs/") -  message(FATAL_ERROR "Could NOT find QtDBus") -endif (QDBUS_FOUND) +   PKGCONFIG("dbus-1" _dbusIncDir _dbusLinkDir _dbusLinkFlags _dbusCflags) +   PKGCONFIG("dbus-qt4-1" _qdbusIncDir _qdbusLinkDir _qdbusLinkFlags _qdbusCflags) + +   set(QDBUS_DEFINITIONS ${_dbusCflags} ${_qdbusCflags} CACHE INTERNAL "Definitions for Qt DBUS") +   set(QDBUS_INCLUDE_DIRS ${_dbusIncDir} ${_qdbusIncDir} CACHE INTERNAL "Include dirs for Qt DBUS") + +   FIND_LIBRARY(QDBUS_LIBRARIES NAMES dbus-qt4-1 +     PATHS ${_qdbusLinkDir} +   ) + +   if (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) +      set(QDBUS_FOUND TRUE) +   endif (QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES) + +   message(STATUS "QtDBus Results: ${QDBUS_LIBRARIES} ${QDBUS_INCLUDE_DIRS} ${QDBUS_DEFINITIONS}") +   if (QDBUS_FOUND) +     if (NOT QDBUS_FIND_QUIETLY) +       message(STATUS "Found QtDBus: ${QDBUS_LIBRARIES}") +     endif (NOT QDBUS_FIND_QUIETLY) +   else (QDBUS_FOUND) +     message(STATUS "You need the CVS version of D-BUS library. The one that your distribution installed, even if it's 0.61, probably won't be enough to compile QtDBus.") +     message(STATUS "You need the Subversion or CVS version of QtDBus. It's official home is now in trunk/kdesupport/") +     message(STATUS "See also the PORTING-TO-DBUS.txt file in kdelibs/") +     message(FATAL_ERROR "Could NOT find QtDBus") +   endif (QDBUS_FOUND) + +endif(QDBUS_INCLUDE_DIRS AND QDBUS_LIBRARIES)  find_program(QDBUS_IDL2CPP_EXECUTABLE NAME dbusidl2cpp PATHS)  find_program(QDBUS_CPP2XML_EXECUTABLE NAME dbuscpp2xml PATHS) | 
