-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
executable file
·149 lines (124 loc) · 6.56 KB
/
CMakeLists.txt
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
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_POLICY(SET CMP0053 NEW) # Simplify variable reference and escape sequence evaluation
SET(MAJORVER 0)
SET(FULLVER 1)
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(VERSION ${FULLVER})
SET(LIB_INSTALL_DIR ${PREFIX}/lib)
PROJECT(app_common C)
#AUX_SOURCE_DIRECTORY(src SOURCES)
SET(CAPI_APPFW_APP_COMMON_SOURCES src/app-common.c)
SET(CAPI_APPFW_APP_MANAGER_SOURCES src/app-manager.c)
SET(CAPI_APPFW_THEME_MANAGER_SOURCES src/dummy-theme-manager.c)
SET(CAPI_SYSTEM_INFO_SOURCES src/dummy-system-info.c)
SET(CAPI_SYSTEM_SYSTEM_SETTINGS_SOURCES src/dummy-system-system-settings.c)
SET(DLOG_SOURCES src/dlog.c)
SET(BASE_UTIL_SOURCES src/dummy-base-util.c)
SET(FEEDBACK_SOURCES src/dummy-feedback.c)
SET(TTRACE_SOURCES src/dummy-ttrace.c)
SET(INIPARSER_SOURCES src/dummy-iniparser.c)
ADD_DEFINITIONS("-DSHARE_PREFIX=\"${SHARE_INSTALL_PREFIX}/aul\"")
# Set required packages
INCLUDE(FindPkgConfig)
#SET(APPCOMMON_LIB_PKG_CHECK_MODULES )
#pkg_check_modules(libpkgs REQUIRED ${APPCOMMON_LIB_PKG_CHECK_MODULES})
#FOREACH(flag ${libpkgs_CFLAGS})
# SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
#ENDFOREACH(flag)
#pkg_check_modules(APP_LAUNCHER_DEPS glib-2.0 pkgmgr-info bundle)
#FOREACH(APP_LAUNCHER_FLAGS ${APP_LAUNCHER_DEPS_CFLAGS})
# SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${APP_LAUNCHER_FLAGS}")
#ENDFOREACH(APP_LAUNCHER_FLAGS)
# Compiler flags
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
IF( NOT WIN32 )
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" )
#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpic -fPIC")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Werror")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
ENDIF()
SET(CMAKE_SKIP_BUILD_RPATH true)
# Linker flags
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -fPIC")
# APP_COMMON
add_library(capi-appfw-app-common SHARED ${CAPI_APPFW_APP_COMMON_SOURCES})
TARGET_LINK_LIBRARIES(capi-appfw-app-common ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(capi-appfw-app-common PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(capi-appfw-app-common PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS capi-appfw-app-common DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# APP_MANAGER
add_library(capi-appfw-app-manager SHARED ${CAPI_APPFW_APP_MANAGER_SOURCES})
TARGET_LINK_LIBRARIES(capi-appfw-app-manager ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(capi-appfw-app-manager PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(capi-appfw-app-manager PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS capi-appfw-app-manager DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# THEME_MANAGER
add_library(capi-appfw-tizen-theme SHARED ${CAPI_APPFW_THEME_MANAGER_SOURCES})
TARGET_LINK_LIBRARIES(capi-appfw-tizen-theme ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(capi-appfw-tizen-theme PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(capi-appfw-tizen-theme PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS capi-appfw-tizen-theme DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# SYSTEM_INFO
add_library(capi-system-info SHARED ${CAPI_SYSTEM_INFO_SOURCES})
TARGET_LINK_LIBRARIES(capi-system-info ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(capi-system-info PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(capi-system-info PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS capi-system-info DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# SYSTEM_SETTINGS
add_library(capi-system-system-settings SHARED ${CAPI_SYSTEM_SYSTEM_SETTINGS_SOURCES})
TARGET_LINK_LIBRARIES(capi-system-system-settings ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(capi-system-system-settings PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(capi-system-system-settings PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS capi-system-system-settings DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# DLOG
add_library(dlog SHARED ${DLOG_SOURCES})
TARGET_LINK_LIBRARIES(dlog ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(dlog PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(dlog PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS dlog DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
CONFIGURE_FILE(dlog.pc.in ${CMAKE_CURRENT_BINARY_DIR}/dlog.pc @ONLY)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/dlog.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/dlog.h DESTINATION include/dlog)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/tizen_error.h DESTINATION include/dlog)
# BASE UTIL
add_library(base-utils-i18n SHARED ${BASE_UTIL_SOURCES})
TARGET_LINK_LIBRARIES(base-utils-i18n ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(base-utils-i18n PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(base-utils-i18n PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS base-utils-i18n DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# FEEDBACK
add_library(feedback SHARED ${FEEDBACK_SOURCES})
TARGET_LINK_LIBRARIES(feedback ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(feedback PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(feedback PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS feedback DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# TTRACE
add_library(ttrace SHARED ${TTRACE_SOURCES})
TARGET_LINK_LIBRARIES(ttrace ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(ttrace PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(ttrace PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS ttrace DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# INIPARSER
add_library(iniparser SHARED ${INIPARSER_SOURCES})
TARGET_LINK_LIBRARIES(iniparser ${libpkgs_LDFLAGS})
SET_TARGET_PROPERTIES(iniparser PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(iniparser PROPERTIES VERSION ${FULLVER})
INSTALL(TARGETS iniparser DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
# pkgconfig file
# INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${PREFIX}/pkgconfig)
#CONFIGURE_FILE(aul.pc.in aul.pc @ONLY)
#CONFIGURE_FILE(feature/preexec_list.txt.in feature/preexec_list.txt @ONLY)
# Install headers, other files
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/app_common.h DESTINATION include/app-common)
#INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/aul.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/feature/preexec_list.txt DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
#INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/data/miregex DESTINATION ${SHARE_INSTALL_PREFIX}/aul )
# tool
#ADD_SUBDIRECTORY(tool)
#ADD_SUBDIRECTORY(parser)