From 75a07dd38b4a491a9d16d24492bea5c6ba90a8ff Mon Sep 17 00:00:00 2001 From: Alexander Neundorf Date: Sun, 12 Feb 2006 14:38:04 +0000 Subject: -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 --- modules/FindLibArt.cmake | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) (limited to 'modules/FindLibArt.cmake') diff --git a/modules/FindLibArt.cmake b/modules/FindLibArt.cmake index da9d68e7..967e8818 100644 --- a/modules/FindLibArt.cmake +++ b/modules/FindLibArt.cmake @@ -1,3 +1,14 @@ +# - Try to find the LibArt 2D graphics library +# Once done this will define +# +# LIBART_FOUND - system has the LibArt +# LIBART_INCLUDE_DIR - the LibArt include directory +# LIBART_LIBRARIES - The libraries needed to use LibArt +# under Windows this also checks in the GNUWIN32 directory, so make +# sure that the GNUWIN32 directory gets found if you use the GNUWIN32 version of PCRE +# under UNIX pkgconfig among others pkg-config is used to find the directories + + INCLUDE(UsePkgConfig) # use pkg-config to get the directories and then use these values @@ -6,35 +17,39 @@ PKGCONFIG(libart-2.0 _libArtIncDir _libArtLinkDir _libArtLinkFlags _libArtCflags SET(LIBART_DEFINITIONS ${_libArtCflags}) -FIND_PATH(LIBART_ROOT_INCLUDE_DIR libart-2.0/libart_lgpl/libart.h - ${_libArtIncDir} - /usr/include - /usr/local/include -) - -SET(LIBART_INCLUDE_DIR ${LIBART_ROOT_INCLUDE_DIR}/libart-2.0 CACHE PATH "LibArt include directory") +# under windows, try to find the base gnuwin32 directory, do nothing under UNIX +FIND_PACKAGE(GNUWIN32) -MARK_AS_ADVANCED(LIBART_ROOT_INCLUDE_DIR) +FIND_PATH(LIBART_INCLUDE_DIR libart_lgpl/libart.h + ${_libArtIncDir}/libart-2.0 + /usr/include/libart-2.0 + /usr/local/include/libart-2.0 + ${GNUWIN32_DIR}/include +) -FIND_LIBRARY(LIBART_LIBRARY NAMES art_lgpl_2 -PATHS -${_libArtLinkDir} -/usr/lib -/usr/local/lib +FIND_LIBRARY(LIBART_LIBRARIES NAMES art_lgpl_2 + PATHS + ${_libArtLinkDir} + /usr/lib + /usr/local/lib + ${GNUWIN32_DIR}/lib ) -IF(LIBART_INCLUDE_DIR AND LIBART_LIBRARY) +IF(LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) SET(LIBART_FOUND TRUE) -ENDIF(LIBART_INCLUDE_DIR AND LIBART_LIBRARY) +ENDIF(LIBART_INCLUDE_DIR AND LIBART_LIBRARIES) IF(LIBART_FOUND) IF(NOT LibArt_FIND_QUIETLY) - MESSAGE(STATUS "Found libart: ${LIBART_LIBRARY}") + MESSAGE(STATUS "Found libart: ${LIBART_LIBRARIES}") ENDIF(NOT LibArt_FIND_QUIETLY) ELSE(LIBART_FOUND) IF(LibArt_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find libart") ENDIF(LibArt_FIND_REQUIRED) ENDIF(LIBART_FOUND) + +MARK_AS_ADVANCED(LIBART_INCLUDE_DIR LIBART_LIBRARIES) + -- cgit v1.2.1