tizen 2.4 release
[apps/home/net-popup.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(net-popup C)
3
4 SET(SRCS ${CMAKE_SOURCE_DIR}/src/net-popup.c)
5
6 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
7 SET(LOCALEDIR "${PREFIX}/share/locale")
8
9 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
10         SET(CMAKE_BUILD_TYPE "Release")
11 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
12 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
13
14 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
15
16 INCLUDE(FindPkgConfig)
17 pkg_check_modules(pkgs REQUIRED
18         appcore-efl
19         bundle
20         dlog
21         ecore
22         edje
23         elementary
24         evas
25         syspopup
26         notification
27         capi-appfw-application
28         dbus-glib-1
29         glib-2.0
30         appsvc
31         vconf
32         efl-extension)
33
34 FOREACH(flag ${pkgs_CFLAGS})
35         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
36 ENDFOREACH(flag)
37
38 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden -fPIE")
39 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
40 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE")
41
42 FIND_PROGRAM(UNAME NAMES uname)
43 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
44 IF("${ARCH}" STREQUAL "arm")
45         ADD_DEFINITIONS("-DTARGET")
46         MESSAGE("add -DTARGET")
47 ENDIF("${ARCH}" STREQUAL "arm")
48
49 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
50
51 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
52
53 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
54 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -pie)
55
56 ADD_CUSTOM_TARGET(netpopup-custom.edj
57         COMMAND edje_cc ${CMAKE_CURRENT_SOURCE_DIR}/edcs/netpopup-custom.edc
58                 ${CMAKE_CURRENT_SOURCE_DIR}/edcs/netpopup-custom.edj
59                 DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edcs/netpopup-custom.edc
60 )
61
62 ADD_DEPENDENCIES(${PROJECT_NAME} netpopup-custom.edj)
63
64 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
65
66 # install desktop file & icon
67 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
68 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edcs/netpopup-custom.edj DESTINATION /usr/ug/res/edje/net-popup/)
69 INSTALL(FILES ${CMAKE_BINARY_DIR}/resources/net.netpopup.xml DESTINATION ${PREFIX}/share/packages/)
70
71 ADD_SUBDIRECTORY(po)