summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 881c9cddda303f491178d2ca7ad61622dadaabed (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET (this_target osp-locations)

SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)

INCLUDE_DIRECTORIES (
	${ROOTSTRAP_ROOT}/usr/include/location
	inc
	src
	/usr/include/osp
	/usr/include/osp/app
	/usr/include/osp/base
	/usr/include/osp/io
	/usr/include/osp/system
	/usr/include/osp/security
	)

SET (${this_target}_SOURCE_FILES
	src/FLocCoordinates.cpp
	src/FLocLocationCriteria.cpp
	src/FLocLocation.cpp
	src/FLocLocationProvider.cpp
	src/FLoc_EllipsoidModel.cpp
	src/FLoc_LocationImpl.cpp
	src/FLoc_LocationManager.cpp
	src/FLoc_LocationProviderImpl.cpp
	src/FLoc_MathUtils.cpp
	src/FLoc_LocationMonitor.cpp
	)

SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )

## SET C COMPILER FLAGS
SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")

## SET CPP COMPILER FLAGS
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")

## Create Library
ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})

## SET LINKER FLAGS
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")

TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw")
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-uifw")
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-location-manager")
TARGET_LINK_LIBRARIES(${this_target} "-lpthread")

SET_TARGET_PROPERTIES(${this_target}
	PROPERTIES
	VERSION ${FULLVER}
	SOVERSION ${MAJORVER}
	CLEAN_DIRECT_OUTPUT 1
	)

INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp
				FILES_MATCHING PATTERN "*.so*"
				PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
										GROUP_EXECUTE GROUP_READ
										WORLD_EXECUTE WORLD_READ)

INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")

# pkgconfig file
CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)