Remove tv profile dependency for cynara
[platform/core/location/lbs-location.git] / location / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(location C)
3
4 SET(LIB_NAME "lbs-location")
5 SET(INC_DIR "include")
6 SET(MANAGER_DIR "manager")
7 SET(MODULE_DIR "module")
8
9 ADD_DEFINITIONS("-DLIBDIR=\"${LIBDIR}\"")
10
11 INCLUDE_DIRECTORIES(
12         ${INC_DIR}
13         ${MANAGER_DIR}
14         ${MODULE_DIR}
15 )
16
17 ### Build ###
18 SET(SRCS
19         ${MANAGER_DIR}/location.c
20         ${MANAGER_DIR}/location-marshal.c
21         ${MANAGER_DIR}/location-ielement.c
22         ${MANAGER_DIR}/location-setting.c
23         ${MANAGER_DIR}/location-position.c
24         ${MANAGER_DIR}/location-batch.c
25         ${MANAGER_DIR}/location-velocity.c
26         ${MANAGER_DIR}/location-accuracy.c
27         ${MANAGER_DIR}/location-boundary.c
28         ${MANAGER_DIR}/location-satellite.c
29         ${MANAGER_DIR}/location-signaling-util.c
30         ${MANAGER_DIR}/location-common-util.c
31         ${MANAGER_DIR}/location-gps.c
32         ${MANAGER_DIR}/location-wps.c
33         ${MANAGER_DIR}/location-passive.c
34         ${MANAGER_DIR}/location-fused.c
35         ${MANAGER_DIR}/location-privacy.c
36
37         ${MODULE_DIR}/module-internal.c
38 )
39
40 SET(SRCS_MOBILE
41         ${MANAGER_DIR}/location-hybrid-mobile.c
42 )
43
44 SET (INSTALL_HEADERS
45         ${INC_DIR}/location-types.h
46
47         ${MANAGER_DIR}/location.h
48         ${MANAGER_DIR}/location-position.h
49         ${MANAGER_DIR}/location-batch.h
50         ${MANAGER_DIR}/location-velocity.h
51         ${MANAGER_DIR}/location-accuracy.h
52         ${MANAGER_DIR}/location-boundary.h
53         ${MANAGER_DIR}/location-satellite.h
54         ${MANAGER_DIR}/location-setting.h
55
56         ${MODULE_DIR}/location-module.h
57 )
58
59 ADD_LIBRARY(${LIB_NAME} SHARED ${SRCS} ${SRCS_MOBILE})
60 TARGET_LINK_LIBRARIES(${LIB_NAME} ${pkgs_LDFLAGS} -lm)
61 SET_TARGET_PROPERTIES(${LIB_NAME} PROPERTIES VERSION ${FULLVER} SOVERSION ${MAJORVER} CLEAN_DIRECT_OUTPUT 1)
62
63 IF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MANAGER_DIR}/location-marshal.c)
64         MESSAGE ("")
65         MESSAGE ("<<< Generating location-marshal.c >>>")
66
67         EXECUTE_PROCESS(
68                 COMMAND glib-genmarshal --header --prefix=location ${CMAKE_CURRENT_SOURCE_DIR}/manager/location-marshal.list
69                 OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/manager/location-marshal.h
70         )
71
72         EXECUTE_PROCESS(
73                 COMMAND glib-genmarshal --body --prefix=location ${CMAKE_CURRENT_SOURCE_DIR}/manager/location-marshal.list
74                 OUTPUT_VARIABLE marshal_var
75         )
76
77         EXECUTE_PROCESS(
78                 COMMAND echo "#include \"location-marshal.h\" ${marshal_var}"
79                 OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/manager/location-marshal.c
80         )
81
82 ENDIF (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${MANAGER_DIR}/location-marshal.c)
83
84 INSTALL(TARGETS ${LIB_NAME} DESTINATION ${LIBDIR} COMPONENT Runtime)
85 FOREACH(ITEM IN ITEMS ${INSTALL_HEADERS})
86         MESSAGE ("${ITEM}")
87         INSTALL(FILES ${ITEM} DESTINATION ${INCLUDEDIR}/${PROJECT_NAME})
88 ENDFOREACH()