diff options
author | Frederik Gladhorn <gladhorn@kde.org> | 2009-11-17 19:51:53 +0000 |
---|---|---|
committer | Frederik Gladhorn <gladhorn@kde.org> | 2009-11-17 19:51:53 +0000 |
commit | edb1d277de5a4531122534b635e919826b8c99f2 (patch) | |
tree | 166d85b664fdc9a46302e228a19b0c2d303f111a | |
parent | 83a60c0ed58c2fd9658de70ca8c9bd94fb862194 (diff) | |
download | extra-cmake-modules-edb1d277de5a4531122534b635e919826b8c99f2.tar.gz extra-cmake-modules-edb1d277de5a4531122534b635e919826b8c99f2.tar.bz2 |
improve findattica
svn path=/trunk/KDE/kdelibs/; revision=1050643
-rw-r--r-- | modules/FindAttica.cmake | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/modules/FindAttica.cmake b/modules/FindAttica.cmake index 1bc1693a..22a30469 100644 --- a/modules/FindAttica.cmake +++ b/modules/FindAttica.cmake @@ -10,8 +10,38 @@ # # Redistribution and use is allowed according to the terms of the BSD license. +IF (ATTICA_INCLUDE_DIR AND ATTICA_LIBRARIES) + # in cache already + SET(Attica_FIND_QUIETLY TRUE) +ENDIF (ATTICA_INCLUDE_DIR AND ATTICA_LIBRARIES) + +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_ATTICA QUIET libattica-0.1) + SET(ATTICA_DEFINITIONS ${PC_ATTICA_CFLAGS_OTHER}) +ENDIF (NOT WIN32) + +FIND_PATH(ATTICA_INCLUDE_DIR attica/provider.h + HINTS + ${PC_ATTICA_INCLUDEDIR} + ${PC_ATTICA_INCLUDE_DIRS} + PATH_SUFFIXES attica + ) + +FIND_LIBRARY(ATTICA_LIBRARIES NAMES attica libattica + HINTS + ${PC_ATTICA_LIBDIR} + ${PC_ATTICA_LIBRARY_DIRS} + ) + +INCLUDE(FindPackageHandleStandardArgs) + +# handle the QUIETLY and REQUIRED arguments and set ATTICA_FOUND to TRUE if +# all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(libattica DEFAULT_MSG ATTICA_LIBRARIES ATTICA_INCLUDE_DIR) + +MARK_AS_ADVANCED(ATTICA_INCLUDE_DIR ATTICA_LIBRARIES) + -if (NOT WIN32) - include(FindPkgConfig) - pkg_check_modules(ATTICA REQUIRED libattica) -endif (NOT WIN32) |