Initial Version
[apps/native/position-finder-server.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(position-finder-server C)
3
4 SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
5 SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res")
6 SET(CMAKE_VERBOSE_MAKEFILE 0)
7
8 SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
9 SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res")
10
11 INCLUDE(FindPkgConfig)
12 pkg_check_modules(APP_PKGS REQUIRED
13         dlog
14         aul
15         capi-appfw-application
16         capi-appfw-service-application
17         capi-system-peripheral-io
18         ecore
19         eina
20         iotcon
21 )
22
23 FOREACH (flag ${APP_PKGS_CFLAGS})
24     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
25 ENDFOREACH(flag)
26
27 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE")
28 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
29 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
30
31 INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc)
32
33 ADD_EXECUTABLE(${PROJECT_NAME}
34         ${PROJECT_ROOT_DIR}/src/controller.c
35         ${PROJECT_ROOT_DIR}/src/model.c
36         ${PROJECT_ROOT_DIR}/src/main.c
37         ${PROJECT_ROOT_DIR}/src/model/model_ultrasonic_sensor.c
38         ${PROJECT_ROOT_DIR}/src/model/model_infrared_motion_sensor.c
39         ${PROJECT_ROOT_DIR}/src/model/model_infrared_obstacle_avoidance_sensor.c
40         ${PROJECT_ROOT_DIR}/src/model/model_touch_sensor.c
41 )
42 #${PROJECT_ROOT_DIR}/src/connectivity.c
43
44 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm)
45 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${APP_PKGS_LDFLAGS})
46
47 # Install
48 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX})
49
50 INSTALL(FILES ${PROJECT_ROOT_DIR}/tizen-manifest.xml DESTINATION ${SYS_PACKAGES_DIR} RENAME org.tizen.position-finder-server.xml)
51 INSTALL(DIRECTORY DESTINATION ${PREFIX}/data)
52 INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/position_finder_server.png DESTINATION ${SYS_ICONS_DIR})
53 INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-server.dat DESTINATION ${INSTALL_RESDIR})
54 INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-client.dat DESTINATION ${INSTALL_RESDIR})
55
56 # End of a file