CMAKE_MINIMUM_REQUIRED(VERSION 2.6) PROJECT(${P_NAME} C) SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin") SET(CMAKE_VERBOSE_MAKEFILE 0) SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}") SET(PROJECT_RESOURCES_DIR "${PROJECT_ROOT_DIR}/res") SET(CHECK_MODULES dlog aul capi-appfw-application capi-appfw-service-application capi-system-peripheral-io iotcon eina ecore libcurl glib-2.0 json-glib-1.0 ) INCLUDE(FindPkgConfig) pkg_check_modules(APP_PKGS REQUIRED ${CHECK_MODULES}) ADD_DEFINITIONS(-DCBOR_FILE_IN_RES="${INSTALL_RESDIR}/${CBOR_FILE}") ADD_DEFINITIONS(-DCBOR_FILE_IN_DATA="${INSTALL_OWNER_DATADIR}/${CBOR_FILE}") ADD_DEFINITIONS(-DWEB_API_URI_PUBLIC=\"http://13.56.171.255/api/sensor/data\") FOREACH (flag ${APP_PKGS_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") ENDFOREACH(flag) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall -Winline -g -fno-builtin-malloc -fPIE") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") INCLUDE_DIRECTORIES(${PROJECT_ROOT_DIR}/inc) SET(SRCS ${PROJECT_ROOT_DIR}/src/connectivity.c ${PROJECT_ROOT_DIR}/src/controller.c ${PROJECT_ROOT_DIR}/src/controller_internal.c ${PROJECT_ROOT_DIR}/src/resource.c ${PROJECT_ROOT_DIR}/src/resource/resource_led.c ${PROJECT_ROOT_DIR}/src/webutil.c ) ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -lm) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${APP_PKGS_LDFLAGS}) Message("APP_LABEL : ${APP_LABEL}") CONFIGURE_FILE(${PROJECT_ROOT_DIR}/tizen-manifest.xml.in ${ORG_PREFIX}.${PROJECT_NAME}.xml @ONLY) # Install INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX}) INSTALL(DIRECTORY DESTINATION ${INSTALL_OWNER_DATADIR}) INSTALL(FILES ${ORG_PREFIX}.${PROJECT_NAME}.xml DESTINATION ${SYS_PACKAGES_DIR}) INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/default_icon.png DESTINATION ${SYS_ICONS_DIR} RENAME ${PROJECT_NAME}.png) INSTALL(FILES ${PROJECT_ROOT_DIR}/res/${CBOR_FILE} DESTINATION ${INSTALL_RESDIR}) # End of a file