diff options
author | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2006-02-12 14:38:04 +0000 |
commit | 75a07dd38b4a491a9d16d24492bea5c6ba90a8ff (patch) | |
tree | 0a65094e22bba335545b8ffe4a33fe7790edb21c /modules/FindLibXml2.cmake | |
parent | bce40e0de3b22a291ecaa2b75358e6a998e1579b (diff) | |
download | extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.gz extra-cmake-modules-75a07dd38b4a491a9d16d24492bea5c6ba90a8ff.tar.bz2 |
-moved the cmake code to find kdewin32 out of FindKDE4.cmake and into its own FindKDEWIN32.cmake file
-added a new FindGNUWIN32.cmake file, which tries to find the gnuwin32 base directory
-changed all "FOO_LIBRARY" variable names to "FOO_LIBRARIES" to be more consistent with the other cmake modules
-added a macro_getenv_win_path() which replaces all backslahes with slashes from environment variables
-modified the kde4_add_kcfg_files() command, so that the generated header is also processed by moc
-all tests compile and link
Alex
CCMAIL:kde-buildsystem@kde.org
The changes to the windows stuff are untested, since I don't have a windows box.
Please check that everything still works. Please have a look at FindGNUWIN32.cmake,
there are probably ways to improve this. The resulting GNUWIN32_DIR variable is used in other
cmake modules as default path to search for headers and libraries.
svn path=/trunk/KDE/kdelibs/; revision=508648
Diffstat (limited to 'modules/FindLibXml2.cmake')
-rw-r--r-- | modules/FindLibXml2.cmake | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/modules/FindLibXml2.cmake b/modules/FindLibXml2.cmake index b40635c8..0ccd8ca2 100644 --- a/modules/FindLibXml2.cmake +++ b/modules/FindLibXml2.cmake @@ -3,7 +3,7 @@ # # LIBXML2_FOUND - system has LibXml2 # LIBXML2_INCLUDE_DIR - the LibXml2 include directory -# LIBXML2_LIBRARY - Link these to use OpenGL and GLU +# LIBXML2_LIBRARIES - the libraries needed to use LibXml2 # LIBXML2_DEFINITIONS - Compiler switches required for using LibXml2 # # use pkg-config to get the directories and then use these values @@ -15,24 +15,31 @@ INCLUDE(UsePkgConfig) PKGCONFIG(libxml-2.0 _LibXml2IncDir _LibXml2LinkDir _LibXml2LinkFlags _LibXml2Cflags) SET(LIBXML2_DEFINITIONS ${_LibXml2Cflags}) -
-# this is a hack dealing with lists in CMAKE_INCLUDE_PATH -foreach(incDir ${CMAKE_INCLUDE_PATH}) - FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h - ${incDir}/libxml2 - ${_LibXml2IncDir}/libxml2 - /usr/include/libxml2 - /usr/local/include/libxml2 - ) -endforeach(incDir ${CMAKE_INCLUDE_PATH}) - -IF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARY) + +FIND_PACKAGE(GNUWIN32) + +FIND_PATH(LIBXML2_INCLUDE_DIR libxml/xpath.h + ${_LibXml2IncDir}/libxml2 + /usr/include/libxml2 + /usr/local/include/libxml2 + ${GNUWIN32_DIR}/include/libxml2 +) + +FIND_LIBRARY(LIBXML2_LIBRARIES NAMES xml2 libxml2 + PATHS + ${_LibXml2LinkDir} + /usr/lib + /usr/local/lib + ${GNUWIN32_DIR}/lib +) + +IF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) SET(LIBXML2_FOUND TRUE) -ENDIF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARY) +ENDIF(LIBXML2_INCLUDE_DIR AND LIBXML2_LIBRARIES) IF(LIBXML2_FOUND) IF(NOT LibXml2_FIND_QUIETLY) - MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARY}") + MESSAGE(STATUS "Found LibXml2: ${LIBXML2_LIBRARIES}") ENDIF(NOT LibXml2_FIND_QUIETLY) ELSE(LIBXML2_FOUND) IF(LibXml2_FIND_REQUIRED) @@ -40,3 +47,4 @@ ELSE(LIBXML2_FOUND) ENDIF(LibXml2_FIND_REQUIRED) ENDIF(LIBXML2_FOUND) +MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)
\ No newline at end of file |