summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: a5d2986f4be6aa80e700d9bab0d59de7ba5a9962 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(hal-backend-bluetooth C)

INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)

INCLUDE(FindPkgConfig)
pkg_check_modules(hal-backend-bluetooth_pkgs REQUIRED
	hal-rootstrap
)

SET(SRCS
	${PROJECT_SOURCE_DIR}/${PROJECT_NAME}.c)

FOREACH(flag ${hal-backend-bluetooth_pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

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

ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${hal-backend-bluetooth_pkgs_LDFLAGS})
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${HAL_LIB_DIR} COMPONENT RuntimeLibraries)