3 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 PROJECT(bluetooth-share-ui C)
6 SET(SRCS ${CMAKE_SOURCE_DIR}/src/bt-share-ui-main.c
7 ${CMAKE_SOURCE_DIR}/src/bt-share-ui-ipc.c
8 ${CMAKE_SOURCE_DIR}/src/bt-share-ui-widget.c
9 ${CMAKE_SOURCE_DIR}/src/bt-share-ui-popup.c
10 ${CMAKE_SOURCE_DIR}/src/bt-share-ui-view.c )
12 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
14 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
15 SET(CMAKE_BUILD_TYPE "Release")
16 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
17 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
19 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
21 INCLUDE(FindPkgConfig)
22 pkg_check_modules(pkgs REQUIRED
34 capi-appfw-application
35 capi-network-bluetooth
39 FOREACH(flag ${pkgs_CFLAGS})
40 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -g")
42 #SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
44 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall")
45 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g ")
46 SET(CMAKE_C_FLAGS_RELEASE "-O2")
47 #This is flag for Gprof
48 #SET(CMAKE_C_FLAGS_RELEASE "-pg")
50 FIND_PROGRAM(UNAME NAMES uname)
51 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
52 IF("${ARCH}" STREQUAL "arm")
53 ADD_DEFINITIONS("-DTARGET")
54 MESSAGE("add -DTARGET")
55 ENDIF("${ARCH}" STREQUAL "arm")
57 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}/\"")
58 ADD_DEFINITIONS("-DSLP_DEBUG")
60 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
62 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
63 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
65 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
67 # install desktop file & icon
68 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
69 INSTALL(FILES ${CMAKE_BINARY_DIR}/data/org.tizen.bluetooth-share-ui.xml DESTINATION /usr/share/packages)
70 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/data/org.tizen.bluetooth-share-ui.png DESTINATION /usr/share/icons/default/small)
72 ADD_CUSTOM_TARGET(bt-share-layout.edj
73 COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/images
74 ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/bt-share-layout.edc ${CMAKE_CURRENT_BINARY_DIR}/bt-share-layout.edj
75 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/bt-share-layout.edc
77 ADD_DEPENDENCIES(${PROJECT_NAME} bt-share-layout.edj)
79 ADD_CUSTOM_TARGET(images.edj
80 COMMAND edje_cc -id ${CMAKE_CURRENT_SOURCE_DIR}/data/images
81 ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/images.edc ${CMAKE_CURRENT_BINARY_DIR}/images.edj
82 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/data/edc/images.edc
84 ADD_DEPENDENCIES(${PROJECT_NAME} images.edj)
87 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/bt-share-layout.edj DESTINATION ${PREFIX}/res/edje)
88 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/images.edj DESTINATION ${PREFIX}/res/edje)