You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

60 lines
1.9 KiB

  1. # - Try to find the ConsoleKit connector library (libck-connector)
  2. # Once done this will define
  3. #
  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
  7. # Copyright (c) 2008, Kevin Kofler, <kevin.kofler@chello.at>
  8. # modeled after FindLibArt.cmake:
  9. # Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
  10. #
  11. # Redistribution and use is allowed according to the terms of the BSD license.
  12. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  13. if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
  14. # in cache already
  15. SET(CKCONNECTOR_FOUND TRUE)
  16. else (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
  17. IF (NOT WIN32)
  18. FIND_PACKAGE(PkgConfig)
  19. IF (PKG_CONFIG_FOUND)
  20. # use pkg-config to get the directories and then use these values
  21. # in the FIND_PATH() and FIND_LIBRARY() calls
  22. pkg_check_modules(_CKCONNECTOR_PC QUIET ck-connector)
  23. ENDIF (PKG_CONFIG_FOUND)
  24. ENDIF (NOT WIN32)
  25. FIND_PATH(CKCONNECTOR_INCLUDE_DIR ck-connector.h
  26. ${_CKCONNECTOR_PC_INCLUDE_DIRS}
  27. )
  28. FIND_LIBRARY(CKCONNECTOR_LIBRARIES NAMES ck-connector
  29. PATHS
  30. ${_CKCONNECTOR_PC_LIBDIR}
  31. )
  32. if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
  33. set(CKCONNECTOR_FOUND TRUE)
  34. endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
  35. if (CKCONNECTOR_FOUND)
  36. if (NOT CkConnector_FIND_QUIETLY)
  37. message(STATUS "Found ck-connector: ${CKCONNECTOR_LIBRARIES}")
  38. endif (NOT CkConnector_FIND_QUIETLY)
  39. else (CKCONNECTOR_FOUND)
  40. if (CkConnector_FIND_REQUIRED)
  41. message(FATAL_ERROR "Could NOT find ck-connector")
  42. endif (CkConnector_FIND_REQUIRED)
  43. endif (CKCONNECTOR_FOUND)
  44. MARK_AS_ADVANCED(CKCONNECTOR_INCLUDE_DIR CKCONNECTOR_LIBRARIES)
  45. endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)