summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8907057a85998d4e1a7c5ab66f609710dcaad91e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(my-account C)

MESSAGE("build account setting menu")

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
SET(RESDIR "${PREFIX}/res")
SET(LOCALEDIR "${RESDIR}/locale")
SET(IMGDIR "${RESDIR}/images")
SET(EDJDIR "${RESDIR}/edje")
SET(ICONDIR "${CMAKE_SHARE_PREFIX}/icons/default/small")
SET(XMLDIR "${CMAKE_SHARE_PREFIX}/packages")
SET(DATADIR "${CMAKE_DATA_PREFIX}")
SET(TABLEDIR "${PREFIX}/shared/res/tables")

ADD_DEFINITIONS("-DPACKAGE=\"my-account\"")
ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DIMGDIR=\"${IMGDIR}\"")
ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
ADD_DEFINITIONS("-DTABLEDIR=\"${TABLEDIR}\"")

IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
        SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")

#------- for development --------
ADD_DEFINITIONS("-DMA_LOG_LEVEL_2")
#--------------------------------

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")

INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.my-account.xml DESTINATION /usr/share/packages/)

SET(SRCS
src/my-account-main.c
src/my-account-ui-widget.c
src/my-account-view-main.c
)

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)

# include library +
SET(dependents "glib-2.0 elementary efl-extension dlog vconf capi-appfw-application accounts-svc")

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
${dependents}
)
# include library -

FOREACH(flag ${pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIE -Wl,-rpath,${LIBDIR}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

FIND_PROGRAM(UNAME NAMES uname)
EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
IF("${ARCH}" STREQUAL "arm")
	ADD_DEFINITIONS("-DTARGET")
	MESSAGE("add -DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
ADD_DEFINITIONS("-fpie")
MESSAGE("CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")

SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")

ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} "-pie")
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)

# install image
INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/images/tw_ic_popup_btn_check.png DESTINATION ${IMGDIR})

ADD_CUSTOM_TARGET(${PROJECT_NAME}.edj
		COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/data/images
		${CMAKE_SOURCE_DIR}/data/edc/${PROJECT_NAME}.edc ${PROJECT_NAME}.edj
		DEPENDS ${CMAKE_SOURCE_DIR}/data/edc/${PROJECT_NAME}.edc
)
ADD_DEPENDENCIES(${PROJECT_NAME} ${PROJECT_NAME}.edj)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj DESTINATION ${EDJDIR})



# i18n
ADD_SUBDIRECTORY(po)