summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 71c8ab46adf0292c4f23f0c8c3707ec3658c8f93 (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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(slp-location C)

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR "\${prefix}/lib")
SET(INCLUDEDIR "\${prefix}/include")

# Set required packages
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED glib-2.0 gthread-2.0 gobject-2.0 gmodule-2.0
		capi-appfw-app-manager capi-appfw-package-manager pkgmgr-info
		privacy-manager-client dlog vconf json-glib-1.0 lbs-dbus)

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

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS}  -Wl,-zdefs -fvisibility=hidden ")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror -Wextra -fvisibility=hidden -fPIC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter -Wno-missing-field-initializers -Wno-missing-declarations -Wall -Wcast-align -Wno-sign-compare")

ADD_DEFINITIONS("-DFEATURE_DLOG_DEBUG")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS(" -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" ")

MESSAGE(${CMAKE_C_FLAGS})
MESSAGE(${CMAKE_EXE_LINKER_FLAGS})

# pkgconfig file
SET(PREFIX ${CMAKE_INSTALL_PREFIX})

CONFIGURE_FILE(location.pc.in location.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/location.pc DESTINATION lib/pkgconfig)

#INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME liblbs-dbus)

ADD_SUBDIRECTORY(location)
#ADD_SUBDIRECTORY(tests)