summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 8c25cef7520d754d44dff3c3ab85801360bf0d3e (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(smartsearch CXX)

SET(SMARTSEARCH_PKG_NAME org.tizen.smartsearch)
SET(DATADIR "/opt/apps/${SMARTSEARCH_PKG_NAME}/data")

SET(SRCS
	src/search_bar.cpp
	src/smartsearch.cpp
	src/ps_searcher.cpp
	src/ps_makeupviews.cpp
	src/ps_app_interface.cpp
	src/common_util.cpp
)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include )

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED 
	appcore-efl
	aul
	db-util
	dlog
	elementary
	ecore
	ecore-imf
	ecore-input
	ecore-x
	ui-gadget-1
	utilX
	x11
	memo
	icu-i18n
	email-service
	msg-service
	libsoup-2.4
	json-glib-1.0
	glib-2.0
	capi-appfw-application
	capi-appfw-app-manager
	capi-web-favorites
	capi-content-media-content
	contacts-service2
	calendar-service2
	libxml-2.0
)


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

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS} -fpie -Wall")
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(BINDIR "${PREFIX}/bin")
SET(RESDIR "${PREFIX}/res")
SET(DATADIR "/opt/usr/apps/${SMARTSEARCH_PKG_NAME}/data")
SET(DBDIR "${DATADIR}")
SET(LOCALEDIR "${RESDIR}/locale")
SET(ICONDIR "/usr/share/icons/default/small")
SET(EDJDIR "${RESDIR}/edje")

ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
ADD_DEFINITIONS("-DDBDIR=\"${DATADIR}\"")
ADD_DEFINITIONS("-DSEARCHPKG=\"${SMARTSEARCH_PKG_NAME}\"")

ADD_DEFINITIONS("-D__ENABLE_DEBUG_UTIL")
ADD_DEFINITIONS("-D__ENABLE_PLATFORM_DEBUG")
#ADD_DEFINITIONS("-D__ENABLE_TOP_BACK_BTN")

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")

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

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

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

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.edj DESTINATION res/edje)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION res/icons FILES_MATCHING PATTERN "*.png")
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/images/ DESTINATION res/icons FILES_MATCHING PATTERN "*.jpg")

# install desktop file & icon
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
#CONFIGURE_FILE(data/${SMARTSEARCH_PKG_NAME}.desktop.in ${SMARTSEARCH_PKG_NAME}.desktop)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${SMARTSEARCH_PKG_NAME}.xml DESTINATION /usr/share/packages/)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/images/${SMARTSEARCH_PKG_NAME}.png DESTINATION ${ICONDIR})
INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.smartsearch.rule DESTINATION  /opt/etc/smack/accesses.d)

#install application HOME directory
INSTALL(DIRECTORY DESTINATION ${DATADIR})

# i18n
ADD_SUBDIRECTORY(po)