add more spacing
[personal-kdebase.git] / workspace / cmake / modules / FindCkConnector.cmake
blob1301c527c57ad813c3efcf5743ce61312c42d648
1 # - Try to find the ConsoleKit connector library (libck-connector)
2 # Once done this will define
4 #  CKCONNECTOR_FOUND - system has the CK Connector
5 #  CKCONNECTOR_INCLUDE_DIR - the CK Connector include directory
6 #  CKCONNECTOR_LIBRARIES - the libraries needed to use CK Connector
8 # Copyright (c) 2008, Kevin Kofler, <kevin.kofler@chello.at>
9 # modeled after FindLibArt.cmake:
10 # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
12 # Redistribution and use is allowed according to the terms of the BSD license.
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16 if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
18   # in cache already
19   SET(CKCONNECTOR_FOUND TRUE)
21 else (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
23   IF (NOT WIN32)
24     FIND_PACKAGE(PkgConfig)
25     IF (PKG_CONFIG_FOUND)
26       # use pkg-config to get the directories and then use these values
27       # in the FIND_PATH() and FIND_LIBRARY() calls
28       pkg_check_modules(_CKCONNECTOR_PC ck-connector)
29     ENDIF (PKG_CONFIG_FOUND)
30   ENDIF (NOT WIN32)
32   FIND_PATH(CKCONNECTOR_INCLUDE_DIR ck-connector.h
33      ${_CKCONNECTOR_PC_INCLUDE_DIRS}
34   )
36   FIND_LIBRARY(CKCONNECTOR_LIBRARIES NAMES ck-connector
37      PATHS
38      ${_CKCONNECTOR_PC_LIBDIR}
39   )
42   if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
43      set(CKCONNECTOR_FOUND TRUE)
44   endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
47   if (CKCONNECTOR_FOUND)
48      if (NOT CkConnector_FIND_QUIETLY)
49         message(STATUS "Found ck-connector: ${CKCONNECTOR_LIBRARIES}")
50      endif (NOT CkConnector_FIND_QUIETLY)
51   else (CKCONNECTOR_FOUND)
52      if (CkConnector_FIND_REQUIRED)
53         message(FATAL_ERROR "Could NOT find ck-connector")
54      endif (CkConnector_FIND_REQUIRED)
55   endif (CKCONNECTOR_FOUND)
57   MARK_AS_ADVANCED(CKCONNECTOR_INCLUDE_DIR CKCONNECTOR_LIBRARIES)
59 endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)