diff options
author | Alexander Neundorf <neundorf@kde.org> | 2009-11-22 10:51:38 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2009-11-22 10:51:38 (GMT) |
commit | a10198c54e1e9a3798360ffc253325f9f643e272 (patch) | |
tree | e30bec47c0eccdcdbead0552dcc56b578bae7e38 | |
parent | 2d9c72c7e50e64baa8ce3905c079f067ee64f806 (diff) | |
download | CMake-a10198c54e1e9a3798360ffc253325f9f643e272.zip CMake-a10198c54e1e9a3798360ffc253325f9f643e272.tar.gz CMake-a10198c54e1e9a3798360ffc253325f9f643e272.tar.bz2 |
don't use deprecated UsePkgConfig.cmake file in FindLibXslt.cmake, some cosmetics
-use find_package(PkgConfig) instead of include(UsePkgConfig)
-remove the "if already cached make silent" logic, this is already handled by find_package_handle_standard_args()
-remove the if(WIN32) around pkg-config, it shouldn't be necessary
Alex
-rw-r--r-- | Modules/FindLibXml2.cmake | 21 | ||||
-rw-r--r-- | Modules/FindLibXslt.cmake | 33 |
2 files changed, 22 insertions, 32 deletions
diff --git a/Modules/FindLibXml2.cmake b/Modules/FindLibXml2.cmake index fc4c23d..9139aad 100644 --- a/Modules/FindLibXml2.cmake +++ b/Modules/FindLibXml2.cmake @@ -1,4 +1,4 @@ -# - Try to find LibXml2 +# - Try to find the LibXml2 xml processing library # Once done this will define # # LIBXML2_FOUND - System has LibXml2 @@ -21,20 +21,13 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) -IF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) - # in cache already - SET(LibXml2_FIND_QUIETLY TRUE) -ENDIF (LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +FIND_PACKAGE(PkgConfig) +PKG_CHECK_MODULES(PC_LIBXML libxml-2.0) +SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) -IF (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - FIND_PACKAGE(PkgConfig) - PKG_CHECK_MODULES(PC_LIBXML libxml-2.0) - SET(LIBXML2_DEFINITIONS ${PC_LIBXML_CFLAGS_OTHER}) -ENDIF (NOT WIN32) - -FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h +FIND_PATH(LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h HINTS ${PC_LIBXML_INCLUDEDIR} ${PC_LIBXML_INCLUDE_DIRS} diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index 5c3953a..d16d1ff 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -1,4 +1,4 @@ -# - Try to find LibXslt +# - Try to find the LibXslt library # Once done this will define # # LIBXSLT_FOUND - system has LibXslt @@ -20,26 +20,23 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) -IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) - # in cache already - SET(LibXslt_FIND_QUIETLY TRUE) -ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES) - -IF (NOT WIN32) - # use pkg-config to get the directories and then use these values - # in the FIND_PATH() and FIND_LIBRARY() calls - INCLUDE(UsePkgConfig) - PKGCONFIG(libxslt _LibXsltIncDir _LibXsltLinkDir _LibXsltLinkFlags _LibXsltCflags) - SET(LIBXSLT_DEFINITIONS ${_LibXsltCflags}) -ENDIF (NOT WIN32) - -FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h - ${_LibXsltIncDir} +# use pkg-config to get the directories and then use these values +# in the FIND_PATH() and FIND_LIBRARY() calls +FIND_PACKAGE(PkgConfig) +PKG_CHECK_MODULES(PC_LIBXSLT libxslt) +SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER}) + + +FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h + HINTS + ${PC_LIBXSLT_INCLUDEDIR} + ${PC_LIBXSLT_INCLUDE_DIRS} ) FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt - PATHS - ${_LibXsltLinkDir} + HINTS + ${PC_LIBXSLT_LIBDIR} + ${PC_LIBXSLT_LIBRARY_DIRS} ) INCLUDE(FindPackageHandleStandardArgs) |