Skip to content

Commit 6e73e97

Browse files
author
iwamatsu
committed
Add CMake modules file of ConsoleKit.
Signed-off-by: Nobuhiro Iwamatsu <[email protected]>
1 parent caae28d commit 6e73e97

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

cmake/modules/FindCkConnector.cmake

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
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+
8+
# Copyright (c) 2008, Kevin Kofler, <[email protected]>
9+
# modeled after FindLibArt.cmake:
10+
# Copyright (c) 2006, Alexander Neundorf, <[email protected]>
11+
#
12+
# Redistribution and use is allowed according to the terms of the BSD license.
13+
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14+
15+
16+
if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
17+
18+
# in cache already
19+
SET(CKCONNECTOR_FOUND TRUE)
20+
21+
else (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
22+
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 QUIET ck-connector)
29+
ENDIF (PKG_CONFIG_FOUND)
30+
ENDIF (NOT WIN32)
31+
32+
FIND_PATH(CKCONNECTOR_INCLUDE_DIR ck-connector.h
33+
${_CKCONNECTOR_PC_INCLUDE_DIRS}
34+
)
35+
36+
FIND_LIBRARY(CKCONNECTOR_LIBRARIES NAMES ck-connector
37+
PATHS
38+
${_CKCONNECTOR_PC_LIBDIR}
39+
)
40+
41+
42+
if (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
43+
set(CKCONNECTOR_FOUND TRUE)
44+
endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)
45+
46+
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)
56+
57+
MARK_AS_ADVANCED(CKCONNECTOR_INCLUDE_DIR CKCONNECTOR_LIBRARIES)
58+
59+
endif (CKCONNECTOR_INCLUDE_DIR AND CKCONNECTOR_LIBRARIES)

0 commit comments

Comments
 (0)