summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 976bd8785a520918d7b5f0bf516daa651d769186 (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
CMAKE_MINIMUM_REQUIRED(VERSION 1.0)
PROJECT(d2d-conv-setting C)
SET(PACKAGE org.tizen.d2d-conv-setting)

FILE(GLOB SRCS
	src/*.c
	src/ui/*.c
	)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc)

FIND_LIBRARY(LIB_M m)

SET(PKG_LDFLAGS "-pthread ${LIB_M} -pie")
SET(PKG_CFLAGS "-g -Wall -fPIE -funroll-loops")

INCLUDE(FindPkgConfig)
pkg_check_modules(BASE_PKG REQUIRED elementary efl-extension)
FOREACH(flag ${BASE_PKG_CFLAGS})
	SET(PKG_CFLAGS "${PKG_CFLAGS} ${flag}")
ENDFOREACH(flag)
FOREACH(flag ${BASE_PKG_LDFLAGS})
	SET(PKG_LDFLAGS "${PKG_LDFLAGS} ${flag}")
ENDFOREACH(flag)

pkg_check_modules(TIZEN_PKG REQUIRED 
	dlog
	appcore-efl
	capi-appfw-application
	capi-system-system-settings
	capi-system-device
	capi-appfw-app-manager
	d2d-conv-manager
)

FOREACH(flag ${TIZEN_PKG_CFLAGS})
	SET(PKG_CFLAGS "${PKG_CFLAGS} ${flag}")
ENDFOREACH(flag)
FOREACH(flag ${TIZEN_PKG_LDFLAGS})
	SET(PKG_LDFLAGS "${PKG_LDFLAGS} ${flag}")
ENDFOREACH(flag)

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PKG_CFLAGS}")

# install desktop file & icon
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
SET(SHDIR "${PREFIX}/shared")
SET(RESDIR "${PREFIX}/res")
SET(LOCALEDIR "${RESDIR}/locale")
SET(IMGDIR "${RESDIR}/images")

ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
ADD_DEFINITIONS("-DLOCALE_DIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DICON_DIR=\"${IMGDIR}\"")

ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${PKG_LDFLAGS})

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})
# for workaround taskmanager behaviour
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PACKAGE}.png DESTINATION ${SHDIR}/res/)

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/${PACKAGE}.xml ${CMAKE_SOURCE_DIR}/${PACKAGE}.xml @ONLY)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/${PACKAGE}.xml DESTINATION ${PKG_MANIFEST_PATH})

INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${IMGDIR} FILES_MATCHING PATTERN "*.png")

# i18n
ADD_SUBDIRECTORY(po)