summaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
blob: 776e475e8b727b5e7c2c5768414eabfedbd33b91 (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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)

SET(VERSION_MAJOR 0)
SET(VERSION "${VERSION_MAJOR}.1.0")

PROJECT(ug-image-viewer-efl C CXX)

EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_SYSTEM_VERSION)

SET(PREFIX ${CMAKE_INSTALL_PREFIX})

SET(SRCS
# Entry point
	src/ug-image-viewer.c

# Common
	src/common/ivug-config.c

# View related
	src/view/ivug-main-view.c
	src/view/ivug-setas-view.c
	src/view/ivug-detail-info.c
	src/view/ivug-details-view.c
	src/view/ivug-popup.c
	src/view/ivug-slider.c
	src/view/ivug-slider-item.c
	src/view/ivug-slider-slideshow.c
	src/view/ivug-slider-mouse.c

# Control related
	src/control/ivug-uuid.c
	src/control/ivug-parameter.c
	src/control/ivug-ext-ug.c
	src/control/ivug-main.c

# Helper files
	src/util/ivug-util.c
	src/util/ivug-file-info.c
	src/util/ivug-widget.c
	src/util/ivug-listpopup.c

# Data & List management
	src/data/ivug-data.c
	src/data/ivug-data-list.c
	src/data/ivug-data-shuffle.c
	src/data/ivug-mediadata.c
	src/data/ivug-data-filter.c

# Effect files
	src/effect/ivug-effect.c
	src/effect/ivug-slide.c
	src/effect/ivug-anim.c
)

# message("System = ${CMAKE_SYSTEM_VERSION}")

INCLUDE_DIRECTORIES(
	${CMAKE_CURRENT_SOURCE_DIR}
	${CMAKE_SOURCE_WIDGET_DIR}/include
	${CMAKE_SOURCE_COMMON_DIR}/include
	src
	src/common
	src/view
	src/util
	src/control
	src/widget
	src/data
	src/effect/include
)

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
	elementary
	edje
	evas
	eina
	dlog
	ecore
	ecore-file
	ecore-imf
	ecore-input
	ecore-x
	ecore-evas
	efreet-mime
	utilX
	ui-gadget
	libmedia-service
	aul
	libexif
	appcore-efl
	appcore-common
	bundle
	mm-fileinfo
	icu-i18n
	icu-io
	icu-le
	icu-lx
	icu-uc
	pmapi
	appsvc
	vconf
)


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

if("${CMAKE_SYSTEM_VERSION}" STREQUAL "arm")
	pkg_check_modules(armpkgs REQUIRED
	)

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

endif()

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")

#message("CFLAGS="${CMAKE_C_FLAGS})
#message("CXXFLAGS="${CMAKE_CXX_FLAGS})
#message("LDFLAGS="${LDFLAGS})

ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DUG_MODULE_API=__attribute__ \(\(visibility\(\"default\"\)\)\)")
ADD_DEFINITIONS("-DPACKAGE=\"${PROJECT_NAME}\"")
ADD_DEFINITIONS("-DDATADIR=\"${CMAKE_DATA_DIR}\"")
#ADD_DEFINITIONS("-D_USE_MEDIAINFO_STRINGID_")

#ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})

SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/lib)

TARGET_LINK_LIBRARIES(${PROJECT_NAME}
	${pkgs_LDFLAGS} ${armpkgs_LDFLAGS}
	-ldl
	ivug_common
)

INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)

FUNCTION (BUILD_EDJ _in _out _base _dir)
	ADD_CUSTOM_TARGET(${_out}
			COMMAND
				edje_cc -id ${_base}/${_dir}
				${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in}
				${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out}
			DEPENDS
				${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_in}
	)
	ADD_DEPENDENCIES(${PROJECT_NAME} ${_out})
	INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${_base}/${_out} DESTINATION ${CMAKE_INSTALL_PREFIX}/res/edje/${PROJECT_NAME})
ENDFUNCTION (BUILD_EDJ)


# Build edc files
BUILD_EDJ(ivug-base.edc 			ivug-base.edj 			layout	images)
BUILD_EDJ(ivug-main.edc 			ivug-main.edj 			layout	images)
BUILD_EDJ(ivug-icons.edc 			ivug-icons.edj 			layout	icons)
BUILD_EDJ(ivug-setas.edc 			ivug-setas.edj 			layout	images)
BUILD_EDJ(ivug-naviframe.edc		ivug-naviframe.edj		layout	images/gray-theme)
BUILD_EDJ(ivug-toolbar.edc 			ivug-toolbar.edj 		layout	images/gray-theme)
BUILD_EDJ(ivug-button.edc 			ivug-button.edj 		layout	images/gray-theme)
BUILD_EDJ(ivug-effect.edc 			ivug-effect.edj 		layout	images)
BUILD_EDJ(ivug-slider.edc 			ivug-slider.edj 		layout	icons)
BUILD_EDJ(ivug-details.edc 			ivug-details.edj 		layout	images)
BUILD_EDJ(ivug-selectioninfo.edc 	ivug-selectioninfo.edj 	layout	images)
BUILD_EDJ(ivug-genlist.edc 			ivug-genlist.edj 		layout/genlist	images/gray-theme)

# Install image files.
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/res/images/ DESTINATION ${CMAKE_INSTALL_PREFIX}/res/images/${PROJECT_NAME})

#
INSTALL(DIRECTORY DESTINATION ${CMAKE_DATA_DIR}/${PROJECT_NAME})

# i18n
ADD_SUBDIRECTORY(res/po)