summaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
blob: 252c54c7efd0766d802332feaba8b43c0d57a864 (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
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

# View related
	src/view/ivug-main-view.cpp
	src/view/ivug-main-view-toolbar.cpp
	src/view/ivug-main-view-menu.cpp

	src/view/ivug-name-view.c
	src/view/ivug-details-view.c
	src/view/ivug-crop-view.cpp

# SetAs View
	src/view/ivug-setas-view.c
	src/view/ivug-setas-view-wallpaper.cpp
	src/view/ivug-setas-view-callerid.cpp

# Slider
	src/slider/ivug-slider.cpp
	src/slider/ivug-slider-item.cpp
	src/slider/ivug-slider-mouse.cpp

# Control related
	src/control/ivug-parameter.c
	src/control/ivug-context.c
	src/control/ivug-filter.c
	src/control/ivug-detail-info.c
	src/control/ivug-setas.cpp
	src/control/ivug-crop-ug.cpp
	src/control/ivug-widget.c
	src/control/ivug-selectioninfo.c
	src/control/ivug-popup.c
)

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

INCLUDE_DIRECTORIES(
	${CMAKE_SOURCE_DIR}/include
	${IVUG_SOURCE_WIDGET_DIR}/include
	${IVUG_SOURCE_COMMON_DIR}/include
	${IVUG_SOURCE_MEDIA_DIR}/include
	src
	src/include
	src/control
	${IVUG_SOURCE_FEATURE_DIR}/include
	${IVUG_SOURCE_SLIDESHOW_DIR}/include

# Below include directory should be removed for make module more indepentatly
	${IVUG_SOURCE_SLIDESHOW_DIR}/src/effect/include
)

MESSAGE("Checking " ${PROJECT_NAME}
)

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
	elementary
	edje
	evas
	eina
	dlog
	ecore
	ecore-file
	ecore-imf
	ecore-x
	ecore-input
	ecore-evas
	utilX
	ui-gadget-1
	drm-client
	icu-i18n
	glib-2.0
	vconf
	capi-appfw-application
	capi-appfw-app-manager
	capi-system-runtime-info
)


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})
message("LDFLAGS1="${pkgs_LDFLAGS})

ADD_DEFINITIONS("-DUG_MODULE_API=__attribute__ \(\(visibility\(\"default\"\)\)\)")
ADD_DEFINITIONS("-DPACKAGE=\"${PROJECT_NAME}\"")

#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 ivug_widget ivug_medialist ivug_slideshow
)

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

SET(THEME_FOLDER images/theme)
SET(THEME white)

# 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-effect.edc 			ivug-effect.edj 		layout		images)
BUILD_EDJ(ivug-details.edc 			ivug-details.edj 		layout		images)
BUILD_EDJ(ivug-selectioninfo.edc	ivug-selectioninfo.edj 	layout		images)
BUILD_EDJ(ivug-popup.edc			ivug-popup.edj 			layout		images)
BUILD_EDJ(ivug-crop-view.edc		ivug-crop-view.edj 		layout		crop-view)
BUILD_EDJ(ivug-icons.edc 			ivug-icons.edj 			layout		icons)
BUILD_EDJ(ivug-slider.edc 			ivug-slider.edj 		layout		icons)
BUILD_EDJ(ivug-gengrid.edc 			ivug-gengrid.edj 		layout		gengrid)

BUILD_EDJ(ivug-setas.edc 			ivug-setas.edj 			layout		${THEME_FOLDER}/${THEME})
BUILD_EDJ(ivug-naviframe.edc		ivug-naviframe.edj		layout		${THEME_FOLDER}/${THEME})
BUILD_EDJ(ivug-name-view.edc 		ivug-name-view.edj 		layout		${THEME_FOLDER}/${THEME})
BUILD_EDJ(ivug-genlist.edc 			ivug-genlist.edj 		layout/genlist	../${THEME_FOLDER}/${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)