summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 42911bd804151d22a15dc056c7ffb2b07a5e4cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(device-manager-plugin-pinetrail C)

INCLUDE(FindPkgConfig)
pkg_check_modules(rpkgs REQUIRED
		vconf
		dlog
		devman
		devman_plugin
		heynoti)
ADD_DEFINITIONS(${rpkgs_CFLAGS})

SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRAINTS true)

SET(SRCS
	device_engine.c
	device-manager-plugin-pinetrail.c)

SET(HEADERS
	device-manager-plugin-pinetrail.h)


SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR "\${prefix}/lib")
SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(DATADIR ${CMAKE_DATADIR})
SET(VERSION 0.2.4)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
ADD_DEFINITIONS("-DENABLE_DLOG_OUT -DSLP_DEBUG")

ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS} ${TARGET_SRCS})

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${rpkgs_LDFLAGS} "-ldl -rdynamic")
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION})


CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)

FOREACH(hfile ${HEADERS})
	INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
ENDFOREACH(hfile)