blob: 35ff3c3a72e050d49b854517a349bcb71d1521ca (
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
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(DEPENDENTS "dlog deviced")
SET(SRCS
src/haptic.c)
INCLUDE(FindPkgConfig)
pkg_check_modules(rpkgs REQUIRED ${DEPENDENTS})
FOREACH(flag ${rpkgs_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g -fno-omit-frame-pointer")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,--no-as-needed")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${rpkgs_LDFLAGS})
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DENABLE_DLOG_OUT -DSLP_DEBUG")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR})
|