Merge branch 'master' of ssh://review.tizen.org:29418/apps/native/position-finder...
[apps/native/position-finder-server.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(${P_NAME} C)
3
4 SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
5 SET(CMAKE_VERBOSE_MAKEFILE 0)
6
7 SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
8 SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res")
9
10 INCLUDE(FindPkgConfig)
11 pkg_check_modules(APP_PKGS REQUIRED
12         dlog
13         aul
14         capi-appfw-application
15         capi-appfw-service-application
16         capi-system-peripheral-io
17         ecore
18         eina
19         iotcon
20         gio-2.0
21         libcurl
22         glib-2.0
23         json-glib-1.0
24 )
25
26 ADD_DEFINITIONS(-DCBOR_FILE_IN_RES="${INSTALL_RESDIR}/${CBOR_FILE}")
27 ADD_DEFINITIONS(-DCBOR_FILE_IN_DATA="${INSTALL_OWNER_DATADIR}/${CBOR_FILE}")
28 ADD_DEFINITIONS(-DCONF_FILE="${INSTALL_OWNER_DATADIR}/${CONF_FILE}")
29
30 FOREACH (flag ${APP_PKGS_CFLAGS})
31     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
32 ENDFOREACH(flag)
33
34 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE")
35 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
36 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
37
38 INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc)
39
40 ADD_EXECUTABLE(${PROJECT_NAME}
41         ${PROJECT_ROOT_DIR}/src/controller.c
42         ${PROJECT_ROOT_DIR}/src/controller_internal.c
43         ${PROJECT_ROOT_DIR}/src/connectivity.c
44         ${PROJECT_ROOT_DIR}/src/webutil.c
45         ${PROJECT_ROOT_DIR}/src/resource.c
46         ${PROJECT_ROOT_DIR}/src/resource/resource_illuminance_sensor.c
47         ${PROJECT_ROOT_DIR}/src/resource/resource_infrared_motion_sensor.c
48         ${PROJECT_ROOT_DIR}/src/resource/resource_infrared_obstacle_avoidance_sensor.c
49         ${PROJECT_ROOT_DIR}/src/resource/resource_touch_sensor.c
50         ${PROJECT_ROOT_DIR}/src/resource/resource_ultrasonic_sensor.c
51         ${PROJECT_ROOT_DIR}/src/resource/resource_led.c
52         ${PROJECT_ROOT_DIR}/src/resource/resource_vibration_sensor.c
53         ${PROJECT_ROOT_DIR}/src/resource/resource_flame_sensor.c
54         ${PROJECT_ROOT_DIR}/src/resource/resource_rain_sensor.c
55         ${PROJECT_ROOT_DIR}/src/resource/resource_sound_detection_sensor.c
56         ${PROJECT_ROOT_DIR}/src/resource/resource_tilt_sensor.c
57 )
58
59 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm)
60 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${APP_PKGS_LDFLAGS})
61
62 Message("APP_LABEL : ${APP_LABEL}")
63
64 CONFIGURE_FILE(${PROJECT_ROOT_DIR}/tizen-manifest.xml.in ${ORG_PREFIX}.${PROJECT_NAME}.xml @ONLY)
65 # Install
66 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX})
67 INSTALL(DIRECTORY DESTINATION ${INSTALL_OWNER_DATADIR})
68 INSTALL(FILES ${ORG_PREFIX}.${PROJECT_NAME}.xml DESTINATION ${SYS_PACKAGES_DIR})
69 INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/default_icon.png DESTINATION ${SYS_ICONS_DIR} RENAME ${PROJECT_NAME}.png)
70 INSTALL(FILES ${PROJECT_ROOT_DIR}/res/${CBOR_FILE} DESTINATION ${INSTALL_RESDIR})
71
72 # End of a file