Debian Codegraph @

liblomiri-app-launch/CMakeLists.txt

raw
1 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
2 include_directories(${CMAKE_CURRENT_BINARY_DIR})
3
4
5 ##########################
6 # Library
7 ##########################
8
9 add_lttng_gen_tp(NAME lomiri-app-launch-trace)
10
11 EXECUTE_PROCESS(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION)
12 if ("${GCC_VERSION}" VERSION_LESS "5.0")
13 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=pedantic")
14 endif()
15
16 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
17 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wpedantic")
18 add_definitions ( -DOOM_HELPER="${pkglibexecdir}/oom-adjust-setuid-helper" )
19 add_definitions ( -DLIBERTINE_LAUNCH="${CMAKE_INSTALL_FULL_BINDIR}/libertine-launch" )
20 add_definitions ( -DG_LOG_DOMAIN="lomiri-app-launch" )
21 add_definitions ( -DLOMIRI_APP_LAUNCH_ARCH="${LOMIRI_APP_LAUNCH_ARCH}" )
22 add_definitions ( -DHELPER_EXEC_TOOL_DIR="${pkglibexecdir}" )
23 add_definitions ( -DHELPER_HELPER_TOOL="${pkglibexecdir}/systemd-helper-helper" )
24 add_definitions ( -DAA_EXEC_PATH="${AA_EXEC_PATH}" )
25 if (${USE_SYSTEMD})
26 add_definitions ( -DUSE_SYSTEMD=1 )
27 endif()
28
29 if(ENABLE_MIRCLIENT)
30 set(LAL_USE_MIRCLIENT 1)
31 endif()
32
33 configure_file(config.h.in config.h)
34
35 set(LAUNCHER_HEADERS
36 lomiri-app-launch.h
37 ${CMAKE_CURRENT_BINARY_DIR}/config.h
38 )
39
40 set(LAUNCHER_CPP_HEADERS
41 appid.h
42 application.h
43 helper.h
44 oom.h
45 registry.h
46 type-tagger.h
47 )
48
49 set(LAUNCHER_CPP_SOURCES
50 application.cpp
51 app-store-base.h
52 app-store-base.cpp
53 app-store-click.h
54 app-store-click.cpp
55 app-store-legacy.h
56 app-store-legacy.cpp
57 app-store-libertine.h
58 app-store-libertine.cpp
59 app-store-snap.h
60 app-store-snap.cpp
61 helper.cpp
62 helper-impl.h
63 registry.cpp
64 registry-impl.h
65 registry-impl.cpp
66 application-impl-base.h
67 application-impl-base.cpp
68 application-impl-click.h
69 application-impl-click.cpp
70 application-impl-legacy.h
71 application-impl-legacy.cpp
72 application-impl-libertine.h
73 application-impl-libertine.cpp
74 application-impl-snap.h
75 application-impl-snap.cpp
76 application-info-desktop.h
77 application-info-desktop.cpp
78 application-icon-finder.h
79 application-icon-finder.cpp
80 info-watcher.h
81 info-watcher.cpp
82 info-watcher-zg.h
83 info-watcher-zg.cpp
84 glib-thread.h
85 glib-thread.cpp
86 jobs-base.h
87 jobs-base.cpp
88 jobs-systemd.h
89 jobs-systemd.cpp
90 jobs-posix.h
91 jobs-posix.cpp
92 signal-unsubscriber.h
93 snapd-info.h
94 snapd-info.cpp
95 string-util.h
96 )
97
98 set(LAUNCHER_SOURCES
99 lomiri-app-launch.cpp
100 second-exec-core.c
101 lomiri-app-launch-trace.c
102 utils.c
103 utils-shared.c
104 )
105
106 add_custom_target(format
107 COMMAND clang-format -i -style=file ${LAUNCHER_CPP_HEADERS} ${LAUNCHER_CPP_SOURCES}
108 )
109
110 set(LAUNCHER_GEN_SOURCES
111 )
112
113 add_gdbus_codegen_with_namespace(LAUNCHER_GEN_SOURCES proxy-socket-demangler com.lomiri.LomiriAppLaunch. proxy ${CMAKE_SOURCE_DIR}/data/com.lomiri.LomiriAppLaunch.SocketDemangler.xml)
114
115 add_library(launcher-static ${LAUNCHER_SOURCES} ${LAUNCHER_CPP_SOURCES} ${LAUNCHER_GEN_SOURCES})
116
117 target_link_libraries(launcher-static
118 ${GLIB2_LIBARIES}
119 ${GOBJECT2_LIBRARIES}
120 ${LIBUPSTART_LIBRARIES}
121 ${GIO2_LIBRARIES}
122 ${LTTNG_LIBRARIES}
123 ${JSONGLIB_LIBRARIES}
124 ${CLICK_LIBRARIES}
125 ${ZEITGEIST_LIBRARIES}
126 ${MIR_LIBRARIES}
127 ${LIBERTINE_LIBRARIES}
128 ${CURL_LIBRARIES}
129 -lpthread
130 -Wl,--no-undefined
131 )
132
133 add_library(lomiri-launcher SHARED ${LAUNCHER_SOURCES} ${LAUNCHER_CPP_SOURCES} ${LAUNCHER_GEN_SOURCES})
134
135 set_target_properties(lomiri-launcher PROPERTIES
136 VERSION ${SOVERSION_MAJOR}.${SOVERSION_MINOR}.${SOVERSION_PATCH}
137 SOVERSION ${ABI_VERSION}
138 OUTPUT_NAME "lomiri-app-launch"
139 LINK_FLAGS "${ldflags} -Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/liblomiri-app-launch.map"
140 LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/liblomiri-app-launch.map"
141 )
142
143 target_link_libraries(lomiri-launcher
144 ${GLIB2_LIBARIES}
145 ${GOBJECT2_LIBRARIES}
146 ${LIBUPSTART_LIBRARIES}
147 ${GIO2_LIBRARIES}
148 ${LTTNG_LIBRARIES}
149 ${JSONGLIB_LIBRARIES}
150 ${CLICK_LIBRARIES}
151 ${ZEITGEIST_LIBRARIES}
152 ${MIR_LIBRARIES}
153 ${LIBERTINE_LIBRARIES}
154 ${CURL_LIBRARIES}
155 -lpthread
156 -Wl,--no-undefined
157 )
158
159 target_include_directories(lomiri-launcher PUBLIC
160 ${CMAKE_CURRENT_BINARY_DIR}
161 )
162
163 install(
164 FILES ${LAUNCHER_HEADERS}
165 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/liblomiri-app-launch-${SOVERSION_MAJOR}"
166 )
167
168 install(
169 FILES ${LAUNCHER_CPP_HEADERS}
170 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/liblomiri-app-launch-${SOVERSION_MAJOR}/lomiri-app-launch"
171 )
172
173 install(
174 TARGETS lomiri-launcher
175 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
176 )
177
178 ##########################
179 # Pkg Config
180 ##########################
181
182 set(apiversion "${SOVERSION_MAJOR}")
183 set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
184 set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
185
186 if(ENABLE_MIRCLIENT)
187 set(MIRCLIENT_PC_REQ "${MIR_MODULE_NAME}")
188 endif()
189
190 configure_file("lomiri-app-launch.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/lomiri-app-launch-${SOVERSION_MAJOR}.pc" @ONLY)
191 install(
192 FILES "${CMAKE_CURRENT_BINARY_DIR}/lomiri-app-launch-${SOVERSION_MAJOR}.pc"
193 DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
194 )
195
196 ##########################
197 # Introspection
198 ##########################
199
200 include(UseGObjectIntrospection)
201
202 set(INTROSPECTION_GIRS)
203 set(_introspection_files ${LAUNCHER_HEADERS})
204 set(LomiriAppLaunch_0_gir "lomiri-app-launch")
205 set(LomiriAppLaunch_0_gir_INCLUDES GObject-2.0)
206
207 gir_get_cflags(_cflags)
208 list_prefix(MIR_C_INCLUDES MIR_INCLUDE_DIRS "-I")
209 set(LomiriAppLaunch_0_gir_CFLAGS ${c_flags} ${MIR_C_INCLUDES} "-L/usr/local/lib")
210 set(LomiriAppLaunch_0_gir_LIBS lomiri-app-launch)
211
212 list_make_absolute(_abs_introspection_files _introspection_files "${CMAKE_CURRENT_SOURCE_DIR}/")
213 set(LomiriAppLaunch_0_gir_FILES ${_abs_introspection_files})
214 set(LomiriAppLaunch_0_gir_SCANNERFLAGS --c-include "lomiri-app-launch.h")
215 set(LomiriAppLaunch_0_gir_EXPORT_PACKAGES "lomiri-app-launch-${SOVERSION_MAJOR}")
216
217 list(APPEND INTROSPECTION_GIRS LomiriAppLaunch-0.gir)
218 gir_add_introspections(INTROSPECTION_GIRS)
219
220 add_subdirectory(abi-check)