svn path=/trunk/KDE/kdegraphics/cmake/modules/; revision=534865remotes/origin/old/work/newpageview
parent
956af1981d
commit
136a17a6be
1 changed files with 60 additions and 0 deletions
@ -0,0 +1,60 @@ |
||||
# - Try to find the Imlib graphics library |
||||
# Once done this will define |
||||
# |
||||
# IMLIB_FOUND - system has IMLIB |
||||
# IMLIB_INCLUDE_DIR - the IMLIB include directory |
||||
# IMLIB_LIBRARIES - Link these to use IMLIB |
||||
# IMLIB_DEFINITIONS - Compiler switches required for using IMLIB |
||||
# |
||||
|
||||
IF (DEFINED CACHED_IMLIB) |
||||
|
||||
# in cache already |
||||
IF ("${CACHED_IMLIB}" STREQUAL "YES") |
||||
SET(IMLIB_FOUND TRUE) |
||||
ENDIF ("${CACHED_IMLIB}" STREQUAL "YES") |
||||
|
||||
ELSE (DEFINED CACHED_IMLIB) |
||||
|
||||
# use pkg-config to get the directories and then use these values |
||||
# in the FIND_PATH() and FIND_LIBRARY() calls |
||||
INCLUDE(UsePkgConfig) |
||||
|
||||
PKGCONFIG(libagg _IMLIBIncDir _IMLIBLinkDir _IMLIBLinkFlags _IMLIBCflags) |
||||
|
||||
set(IMLIB_DEFINITIONS ${_IMLIBCflags}) |
||||
|
||||
FIND_PATH(IMLIB_INCLUDE_DIR Imlib.h |
||||
${_IMLIBIncDir} |
||||
/usr/include |
||||
/usr/local/include |
||||
) |
||||
|
||||
FIND_LIBRARY(IMLIB_LIBRARIES NAMES Imlib |
||||
PATHS |
||||
${_IMLIBLinkDir} |
||||
/usr/lib |
||||
/usr/local/lib |
||||
) |
||||
|
||||
if (IMLIB_INCLUDE_DIR AND IMLIB_LIBRARIES) |
||||
SET(imlib_found true) |
||||
endif (IMLIB_INCLUDE_DIR AND IMLIB_LIBRARIES) |
||||
|
||||
if (IMLIB_FOUND) |
||||
set(CACHED_IMLIB "YES") |
||||
if (NOT IMLIB_FIND_QUIETLY) |
||||
message(STATUS "Found IMLIB: ${IMLIB_LIBRARIES}") |
||||
endif (NOT IMLIB_FIND_QUIETLY) |
||||
else (IMLIB_FOUND) |
||||
set(CACHED_IMLIB "NO") |
||||
if (IMLIB_FIND_REQUIRED) |
||||
message(FATAL_ERROR "Could NOT find IMLIB") |
||||
endif (IMLIB_FIND_REQUIRED) |
||||
endif (IMLIB_FOUND) |
||||
|
||||
MARK_AS_ADVANCED(IMLIB_INCLUDE_DIR IMLIB_LIBRARIES) |
||||
|
||||
set(CACHED_IMLIB ${CACHED_IMLIB} CACHE INTERNAL "If liImlib was checked") |
||||
|
||||
ENDIF (DEFINED CACHED_IMLIB) |
||||
Loading…
Reference in new issue