summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8ca0a82a3ac84ee9cc75878d51f5f877af3ab4aa (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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(slp_devman_plugin C)

SET(SRCS
	src/device_manager_io.c
	src/device_manager_plugin_pinetrail.c)

IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
	SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)

SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED devman devman_plugin svi)

FOREACH(flag ${pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)


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

ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})

ADD_EXECUTABLE(slp_plugin_test src/test/slp_plugin_test.c)
TARGET_LINK_LIBRARIES(slp_plugin_test ${pkgs_LDFLAGS} ${PROJECT_NAME})

SET(PREFIX ${CMAKE_INSTALL_PREFIX})

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib COMPONENT RuntimeLibraries)
INSTALL(TARGETS slp_plugin_test DESTINATION bin)