Merge lp:~kalikiana/midori/cmake into lp:midori

Proposed by Christian Dywan
Status: Merged
Approved by: Paweł Forysiuk
Approved revision: 6369
Merged at revision: 6370
Proposed branch: lp:~kalikiana/midori/cmake
Merge into: lp:midori
Diff against target: 956 lines (+878/-2)
14 files modified
CMakeLists.txt (+184/-0)
cmake/ContainTest.cmake (+18/-0)
cmake/FindIntltool.cmake (+30/-0)
cmake/FindVala.cmake (+18/-0)
cmake/GLibHelpers.cmake (+71/-0)
cmake/ParseArguments.cmake (+36/-0)
cmake/ValaPrecompile.cmake (+236/-0)
data/CMakeLists.txt (+34/-0)
extensions/CMakeLists.txt (+92/-0)
icons/CMakeLists.txt (+12/-0)
midori/CMakeLists.txt (+64/-0)
po/CMakeLists.txt (+18/-0)
po/POTFILES.in (+0/-2)
tests/CMakeLists.txt (+65/-0)
To merge this branch: bzr merge lp:~kalikiana/midori/cmake
Reviewer Review Type Date Requested Status
Paweł Forysiuk Approve
Review via email: mp+180722@code.launchpad.net

Commit message

Implement CMake build setup

To post a comment you must log in.
Revision history for this message
Paweł Forysiuk (tuxator) :
review: Approve
Revision history for this message
RabbitBot (rabbitbot-a) wrote :

Attempt to merge into lp:midori failed due to conflicts:

text conflict in po/POTFILES.in

Revision history for this message
RabbitBot (rabbitbot-a) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'CMakeLists.txt'
2--- CMakeLists.txt 1970-01-01 00:00:00 +0000
3+++ CMakeLists.txt 2013-09-01 17:11:24 +0000
4@@ -0,0 +1,184 @@
5+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
6+
7+cmake_minimum_required(VERSION 2.6)
8+cmake_policy(VERSION 2.6)
9+project(midori C)
10+add_definitions("-DPACKAGE_NAME=\"${CMAKE_PROJECT_NAME}\"")
11+add_definitions("-DPACKAGE_BUGREPORT=\"https://bugs.launchpad.net/midori\"")
12+
13+set(VERSION 0.5.5)
14+add_definitions("-DPACKAGE_VERSION=\"${VERSION}\"")
15+add_definitions("-DMIDORI_VERSION_SUFFIX=\"${VERSION}\"")
16+
17+string(REPLACE "." ";" VERSION_LIST ${VERSION})
18+LIST(GET VERSION_LIST 0 MIDORI_MAJOR_VERSION)
19+add_definitions("-DMIDORI_MAJOR_VERSION=${MIDORI_MAJOR_VERSION}")
20+LIST(GET VERSION_LIST 1 MIDORI_MINOR_VERSION)
21+add_definitions("-DMIDORI_MINOR_VERSION=${MIDORI_MINOR_VERSION}")
22+LIST(GET VERSION_LIST 2 MIDORI_MICRO_VERSION)
23+add_definitions("-DMIDORI_MICRO_VERSION=${MIDORI_MICRO_VERSION}")
24+
25+list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
26+# Disallow building during install to avoid permission problems
27+set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
28+
29+include(GNUInstallDirs)
30+set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
31+add_definitions("-DMDATADIR=\"${DATADIR}\"")
32+add_definitions("-DSYSCONFDIR=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}\"")
33+add_definitions("-DLIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
34+add_definitions("-DDOCDIR=\"${CMAKE_INSTALL_FULL_DOCDIR}\"")
35+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config.h" "/* # generated file (stub) */")
36+
37+find_file (UNISTD unistd.h)
38+if (UNISTD)
39+ add_definitions("-DHAVE_UNISTD_H")
40+endif ()
41+find_file (SIGNAL signal.h)
42+if (SIGNAL)
43+ add_definitions("-DHAVE_SIGNAL_H")
44+endif ()
45+
46+find_library (X11 X11)
47+if (X11)
48+ # Pass /usr/X11R6/include for OpenBSD
49+ find_file (SCRNSAVER X11/extensions/scrnsaver.h /usr/X11R6/include)
50+ find_library (XSS Xss /usr/lib/X11R6/lib)
51+ if (SCRNSAVER AND XSS)
52+ add_definitions("-DHAVE_X11_EXTENSIONS_SCRNSAVER_H")
53+ endif ()
54+endif ()
55+
56+if (WIN32)
57+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_WIN32")
58+endif ()
59+
60+string(FIND ${CMAKE_SYSTEM_NAME} "FreeBSD" FREEBSD)
61+if (FREEBSD GREATER -1)
62+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_FREEBSD")
63+endif ()
64+
65+if (APPLE)
66+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_OSX")
67+endif ()
68+
69+find_package(PkgConfig)
70+pkg_check_modules(DEPS REQUIRED
71+ libxml-2.0>=2.6
72+ sqlite3>=3.6.19
73+ gmodule-2.0
74+ gio-2.0>=2.32.3
75+ libsoup-gnome-2.4>=2.27.90
76+ )
77+add_definitions("-DHAVE_LIBXML")
78+add_definitions("-DGIO_VERSION=\"${DEPS_gio-2.0_VERSION}\"")
79+add_definitions("-DLIBSOUP_VERSION=\"${DEPS_libsoup-gnome-2.4_VERSION}\"")
80+set(PKGS posix linux libxml-2.0 sqlite3 gmodule-2.0 gio-2.0 libsoup-2.4)
81+if (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.34.0")
82+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_LIBSOUP_2_34_0")
83+endif ()
84+
85+# Always pass >1 module, otherwise we get different variable names
86+pkg_check_modules(OPTS gio-2.0 libnotify)
87+add_definitions("-DLIBNOTIFY_VERSION=\"${OPTS_libnotify_VERSION}\"")
88+set(PKGS ${PKGS} libnotify)
89+
90+option(USE_GTK3 "Use GTK+3" OFF)
91+option(HALF_BRO_INCOM_WEBKIT2 "Serve as a guniea pig" OFF)
92+option(USE_ZEITGEIST "Zeitgeist history integration" ON)
93+option(USE_GRANITE "Fancy notebook and pop-overs" OFF)
94+
95+if (USE_GRANITE)
96+ if (NOT USE_GTK3 AND NOT HALF_BRO_INCOM_WEBKIT2)
97+ set(USE_GTK3 ON)
98+ endif ()
99+
100+ pkg_check_modules(GRANITE granite>=0.2)
101+ set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${GRANITE_INCLUDE_DIRS}")
102+ set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${GRANITE_LIBRARIES}")
103+ add_definitions("-DHAVE_GRANITE")
104+ add_definitions("-DGRANITE_VERSION=\"${GRANITE_VERSION}\"")
105+ set(PKGS ${PKGS} granite)
106+else ()
107+ add_definitions("-DGRANITE_VERSION=\"No\"")
108+endif()
109+
110+if (USE_ZEITGEIST)
111+ pkg_check_modules(ZEITGEIST zeitgeist-1.0>=0.3.14)
112+ set(OPTS_INCLUDE_DIRS "${OPTS_INCLUDE_DIRS};${ZEITGEIST_INCLUDE_DIRS}")
113+ set(OPTS_LIBRARIES "${OPTS_LIBRARIES};${ZEITGEIST_LIBRARIES}")
114+ add_definitions("-DHAVE_ZEITGEIST")
115+ set(PKGS ${PKGS} zeitgeist-1.0)
116+endif()
117+
118+if (USE_GTK3)
119+ pkg_check_modules(DEPS_GTK REQUIRED
120+ gtk+-3.0>=3.0.0
121+ webkitgtk-3.0>=1.8.3
122+ javascriptcoregtk-3.0
123+ )
124+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"")
125+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkitgtk-3.0_VERSION}\"")
126+ set(PKGS ${PKGS} gtk+-3.0)
127+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi")
128+ # Always pass >1 module, otherwise we get different variable names
129+ pkg_check_modules(OPTS_GTK
130+ gio-2.0
131+ gcr-3>=2.32
132+ )
133+ add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
134+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_GTK3")
135+elseif (HALF_BRO_INCOM_WEBKIT2)
136+ # Note: WebKitGTK+ 2.0.0 matches 1.11.91; 1.11.92 > 2.0.0
137+ pkg_check_modules(DEPS_GTK REQUIRED
138+ gtk+-3.0>=3.0.0
139+ webkit2gtk-3.0>=1.11.91
140+ javascriptcoregtk-3.0
141+ )
142+ add_definitions("-DHAVE_WEBKIT2")
143+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"")
144+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit2gtk-3.0_VERSION}\"")
145+ set(PKGS ${PKGS} gtk+-3.0)
146+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkit2gtk-3.0.vapi")
147+ # Always pass >1 module, otherwise we get different variable names
148+ pkg_check_modules(OPTS_GTK
149+ gio-2.0
150+ gcr-3>=2.32
151+ )
152+ add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
153+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_GTK3")
154+ set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_WEBKIT2")
155+else ()
156+ pkg_check_modules(DEPS_GTK REQUIRED
157+ gtk+-2.0>=2.24.0
158+ webkit-1.0>=1.8.3
159+ javascriptcoregtk-1.0
160+ )
161+ add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-2.0_VERSION}\"")
162+ add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkit-1.0_VERSION}\"")
163+ set(PKGS ${PKGS} gtk+-2.0)
164+ set(EXTRA_VAPIS ${EXTRA_VAPIS} "${CMAKE_SOURCE_DIR}/midori/webkitgtk-3.0.vapi")
165+ add_definitions("-DGCR_VERSION=\"No\"")
166+endif ()
167+
168+find_package(Vala REQUIRED)
169+vala_require("0.16.0")
170+set(VALAFLAGS ${VALAFLAGS}
171+ --enable-deprecated
172+ --debug
173+ )
174+
175+# dh_translations detects this if there's no variable used
176+set (GETTEXT_PACKAGE "midori")
177+add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
178+
179+set(CFLAGS "-w -Wno-deprecated-declarations")
180+set(LIBMIDORI "${CMAKE_PROJECT_NAME}-core")
181+
182+add_subdirectory (midori)
183+add_subdirectory (po)
184+add_subdirectory (icons)
185+add_subdirectory (data)
186+enable_testing()
187+add_subdirectory (tests)
188+add_subdirectory (extensions)
189
190=== added directory 'cmake'
191=== added file 'cmake/ContainTest.cmake'
192--- cmake/ContainTest.cmake 1970-01-01 00:00:00 +0000
193+++ cmake/ContainTest.cmake 2013-09-01 17:11:24 +0000
194@@ -0,0 +1,18 @@
195+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
196+
197+include(ParseArguments)
198+
199+macro(contain_test test_name)
200+ parse_arguments(ARGS "TEST" "" ${ARGN})
201+ set(TEST_ENV "")
202+ foreach(VARIABLE XDG_DATA_HOME XDG_CONFIG_HOME XDG_CACHE_HOME XDG_DATA_HOME XDG_RUNTIME_DIR TMPDIR)
203+ set(CONTAINER "${CMAKE_CURRENT_BINARY_DIR}/${test_name}-folders/${VARIABLE}")
204+ file(MAKE_DIRECTORY ${CONTAINER})
205+ set(TEST_ENV "${TEST_ENV}${VARIABLE}=${CONTAINER};")
206+ endforeach()
207+ set_tests_properties(${test_name} PROPERTIES
208+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
209+ TIMEOUT 42
210+ ENVIRONMENT "${TEST_ENV}"
211+ )
212+endmacro(contain_test)
213
214=== added file 'cmake/FindIntltool.cmake'
215--- cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000
216+++ cmake/FindIntltool.cmake 2013-09-01 17:11:24 +0000
217@@ -0,0 +1,30 @@
218+# FindIntltool.cmake
219+#
220+# Jim Nelson <jim@yorba.org>
221+# Copyright 2012-2013 Yorba Foundation
222+# Copyright (C) 2013 Christian Dywan
223+
224+find_program (INTLTOOL_MERGE_EXECUTABLE intltool-merge)
225+find_program (INTLTOOL_UPDATE_EXECUTABLE intltool-update)
226+
227+if (INTLTOOL_MERGE_EXECUTABLE)
228+ set (INTLTOOL_MERGE_FOUND TRUE)
229+ macro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
230+ add_custom_target ("${desktop_id}.desktop" ALL
231+ ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style ${CMAKE_SOURCE_DIR}/${po_dir}
232+ ${CMAKE_CURRENT_SOURCE_DIR}/${desktop_id}.desktop.in ${desktop_id}.desktop
233+ )
234+ install (FILES "${CMAKE_CURRENT_BINARY_DIR}/${desktop_id}.desktop"
235+ DESTINATION "${CMAKE_INSTALL_PREFIX}/share/applications")
236+ endmacro (INTLTOOL_MERGE_DESKTOP desktop_id po_dir)
237+endif ()
238+
239+if (INTLTOOL_UPDATE_EXECUTABLE)
240+ set (INTLTOOL_UPDATE_FOUND TRUE)
241+ add_custom_target (pot
242+ COMMAND ${INTLTOOL_UPDATE_EXECUTABLE} "-p" "-g" ${GETTEXT_PACKAGE}
243+ WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/po"
244+ )
245+endif ()
246+
247+
248
249=== added file 'cmake/FindVala.cmake'
250--- cmake/FindVala.cmake 1970-01-01 00:00:00 +0000
251+++ cmake/FindVala.cmake 2013-09-01 17:11:24 +0000
252@@ -0,0 +1,18 @@
253+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
254+
255+find_program(VALA_EXECUTABLE NAMES valac)
256+if (NOT VALA_NOTFOUND)
257+ execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
258+ string(REPLACE "Vala " "" VALA_VERSION ${VALA_VERSION})
259+ string(STRIP ${VALA_VERSION} VALA_VERSION)
260+else ()
261+ message(FATAL_ERROR "valac not found")
262+endif ()
263+
264+macro(vala_require VALA_REQUIRED)
265+ if (${VALA_VERSION} VERSION_GREATER ${VALA_REQUIRED} OR ${VALA_VERSION} VERSION_EQUAL ${VALA_REQUIRED})
266+ message(STATUS "valac ${VALA_VERSION} found")
267+ else ()
268+ message(FATAL_ERROR "valac >= ${VALA_REQUIRED} or later required")
269+ endif ()
270+endmacro(vala_require)
271
272=== added file 'cmake/GLibHelpers.cmake'
273--- cmake/GLibHelpers.cmake 1970-01-01 00:00:00 +0000
274+++ cmake/GLibHelpers.cmake 2013-09-01 17:11:24 +0000
275@@ -0,0 +1,71 @@
276+# Copyright (C) 2010 David Sansome <me@davidsansome.com>
277+cmake_minimum_required(VERSION 2.6)
278+if(POLICY CMP0011)
279+ cmake_policy(SET CMP0011 NEW)
280+endif(POLICY CMP0011)
281+
282+find_program(GLIB_MKENUMS glib-mkenums)
283+find_program(GLIB_GENMARSHAL glib-genmarshal)
284+
285+macro(add_glib_marshal outfiles name prefix otherinclude)
286+ add_custom_command(
287+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
288+ COMMAND ${GLIB_GENMARSHAL} --header "--prefix=${prefix}"
289+ "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
290+ > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
291+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
292+ )
293+ add_custom_command(
294+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
295+ COMMAND echo "\\#include \\\"${otherinclude}\\\"" > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
296+ COMMAND echo "\\#include \\\"glib-object.h\\\"" >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
297+ COMMAND echo "\\#include \\\"${name}.h\\\"" >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
298+ COMMAND ${GLIB_GENMARSHAL} --body "--prefix=${prefix}"
299+ "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
300+ >> "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
301+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}.list"
302+ "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
303+ )
304+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
305+endmacro(add_glib_marshal)
306+
307+macro(add_glib_enumtypes_t outfiles name htemplate ctemplate)
308+ add_custom_command(
309+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
310+ COMMAND ${GLIB_MKENUMS}
311+ --template "${htemplate}"
312+ ${ARGN} > "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
313+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
314+ DEPENDS ${ARGN} "${htemplate}"
315+ )
316+ add_custom_command(
317+ OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
318+ COMMAND ${GLIB_MKENUMS}
319+ --template "${ctemplate}"
320+ ${ARGN} > "${CMAKE_CURRENT_BINARY_DIR}/${name}.c"
321+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
322+ DEPENDS ${ARGN} ${ctemplate}
323+ "${CMAKE_CURRENT_BINARY_DIR}/${name}.h"
324+ )
325+ list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c")
326+endmacro(add_glib_enumtypes_t)
327+
328+macro(add_glib_enumtypes outfiles name includeguard)
329+ set(htemplate "${CMAKE_CURRENT_BINARY_DIR}/${name}.h.template")
330+ set(ctemplate "${CMAKE_CURRENT_BINARY_DIR}/${name}.c.template")
331+
332+ # Write the .h template
333+ add_custom_command(
334+ OUTPUT ${htemplate} ${ctemplate}
335+ COMMAND ${CMAKE_COMMAND}
336+ "-Dctemplate=${ctemplate}"
337+ "-Dhtemplate=${htemplate}"
338+ "-Dname=${name}"
339+ "-Dincludeguard=${includeguard}"
340+ "\"-Dheaders=${ARGN}\""
341+ -P "${CMAKE_SOURCE_DIR}/CMake/MakeGLibEnumTemplates.cmake"
342+ DEPENDS "${CMAKE_SOURCE_DIR}/CMake/MakeGLibEnumTemplates.cmake" ${headers}
343+ )
344+
345+ add_glib_enumtypes_t(${outfiles} ${name} ${htemplate} ${ctemplate} ${ARGN})
346+endmacro(add_glib_enumtypes)
347
348=== added file 'cmake/ParseArguments.cmake'
349--- cmake/ParseArguments.cmake 1970-01-01 00:00:00 +0000
350+++ cmake/ParseArguments.cmake 2013-09-01 17:11:24 +0000
351@@ -0,0 +1,36 @@
352+##
353+# This is a helper Macro to parse optional arguments in Macros/Functions
354+# It has been taken from the public CMake wiki.
355+# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
356+# licensing.
357+##
358+macro(parse_arguments prefix arg_names option_names)
359+ set(DEFAULT_ARGS)
360+ foreach(arg_name ${arg_names})
361+ set(${prefix}_${arg_name})
362+ endforeach(arg_name)
363+ foreach(option ${option_names})
364+ set(${prefix}_${option} FALSE)
365+ endforeach(option)
366+
367+ set(current_arg_name DEFAULT_ARGS)
368+ set(current_arg_list)
369+ foreach(arg ${ARGN})
370+ set(larg_names ${arg_names})
371+ list(FIND larg_names "${arg}" is_arg_name)
372+ if(is_arg_name GREATER -1)
373+ set(${prefix}_${current_arg_name} ${current_arg_list})
374+ set(current_arg_name ${arg})
375+ set(current_arg_list)
376+ else(is_arg_name GREATER -1)
377+ set(loption_names ${option_names})
378+ list(FIND loption_names "${arg}" is_option)
379+ if(is_option GREATER -1)
380+ set(${prefix}_${arg} TRUE)
381+ else(is_option GREATER -1)
382+ set(current_arg_list ${current_arg_list} ${arg})
383+ endif(is_option GREATER -1)
384+ endif(is_arg_name GREATER -1)
385+ endforeach(arg)
386+ set(${prefix}_${current_arg_name} ${current_arg_list})
387+endmacro(parse_arguments)
388
389=== added file 'cmake/ValaPrecompile.cmake'
390--- cmake/ValaPrecompile.cmake 1970-01-01 00:00:00 +0000
391+++ cmake/ValaPrecompile.cmake 2013-09-01 17:11:24 +0000
392@@ -0,0 +1,236 @@
393+##
394+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
395+# Copyright 2012 elementary.
396+#
397+# Redistribution and use in source and binary forms, with or without
398+# modification, are permitted provided that the following conditions are met:
399+#
400+# 1. Redistributions of source code must retain the above copyright notice,
401+# this list of conditions and the following disclaimer.
402+#
403+# 2. Redistributions in binary form must reproduce the above copyright notice,
404+# this list of conditions and the following disclaimer in the documentation
405+# and/or other materials provided with the distribution.
406+#
407+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
408+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
409+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
410+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
411+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
412+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
413+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
414+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
415+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
416+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
417+#
418+# The views and conclusions contained in the software and documentation are those
419+# of the authors and should not be interpreted as representing official policies,
420+# either expressed or implied, of Jakob Westhoff
421+##
422+
423+include(ParseArguments)
424+find_package(Vala REQUIRED)
425+
426+##
427+# Compile vala files to their c equivalents for further processing.
428+#
429+# The "vala_precompile" macro takes care of calling the valac executable on the
430+# given source to produce c files which can then be processed further using
431+# default cmake functions.
432+#
433+# The first parameter provided is a variable, which will be filled with a list
434+# of c files outputted by the vala compiler. This list can than be used in
435+# conjuction with functions like "add_executable" or others to create the
436+# neccessary compile rules with CMake.
437+#
438+# The initial variable is followed by a list of .vala files to be compiled.
439+# Please take care to add every vala file belonging to the currently compiled
440+# project or library as Vala will otherwise not be able to resolve all
441+# dependencies.
442+#
443+# The following sections may be specified afterwards to provide certain options
444+# to the vala compiler:
445+#
446+# PACKAGES
447+# A list of vala packages/libraries to be used during the compile cycle. The
448+# package names are exactly the same, as they would be passed to the valac
449+# "--pkg=" option.
450+#
451+# OPTIONS
452+# A list of optional options to be passed to the valac executable. This can be
453+# used to pass "--thread" for example to enable multi-threading support.
454+#
455+# CUSTOM_VAPIS
456+# A list of custom vapi files to be included for compilation. This can be
457+# useful to include freshly created vala libraries without having to install
458+# them in the system.
459+#
460+# GENERATE_VAPI
461+# Pass all the needed flags to the compiler to create an internal vapi for
462+# the compiled library. The provided name will be used for this and a
463+# <provided_name>.vapi file will be created.
464+#
465+# GENERATE_HEADER
466+# Let the compiler generate a header file for the compiled code. There will
467+# be a header file as well as an internal header file being generated called
468+# <provided_name>.h and <provided_name>_internal.h
469+#
470+# GENERATE_GIR
471+# Have the compiler generate a GObject-Introspection repository file with
472+# name: <provided_name>.gir. This can be later used to create a binary typelib
473+# using the GI compiler.
474+#
475+# GENERATE_SYMBOLS
476+# Output a <provided_name>.symbols file containing all the exported symbols.
477+#
478+# The following call is a simple example to the vala_precompile macro showing
479+# an example to every of the optional sections:
480+#
481+# vala_precompile(VALA_C mytargetname
482+# source1.vala
483+# source2.vala
484+# source3.vala
485+# PACKAGES
486+# gtk+-2.0
487+# gio-1.0
488+# posix
489+# DIRECTORY
490+# gen
491+# OPTIONS
492+# --thread
493+# CUSTOM_VAPIS
494+# some_vapi.vapi
495+# GENERATE_VAPI
496+# myvapi
497+# GENERATE_HEADER
498+# myheader
499+# GENERATE_GIR
500+# mygir
501+# GENERATE_SYMBOLS
502+# mysymbols
503+# )
504+#
505+# Most important is the variable VALA_C which will contain all the generated c
506+# file names after the call.
507+##
508+
509+macro(vala_precompile output target_name)
510+ parse_arguments(ARGS "TARGET;PACKAGES;OPTIONS;DIRECTORY;GENERATE_GIR;GENERATE_SYMBOLS;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
511+
512+ if(ARGS_DIRECTORY)
513+ set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY})
514+ else(ARGS_DIRECTORY)
515+ set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
516+ endif(ARGS_DIRECTORY)
517+ include_directories(${DIRECTORY})
518+ set(vala_pkg_opts "")
519+ foreach(pkg ${ARGS_PACKAGES})
520+ list(APPEND vala_pkg_opts "--pkg=${pkg}")
521+ endforeach(pkg ${ARGS_PACKAGES})
522+ set(in_files "")
523+ set(out_files "")
524+ set(out_files_display "")
525+ set(${output} "")
526+
527+ foreach(src ${ARGS_DEFAULT_ARGS})
528+ string(REGEX MATCH "^/" IS_MATCHED ${src})
529+ if(${IS_MATCHED} MATCHES "/")
530+ set(src_file_path ${src})
531+ else()
532+ set(src_file_path ${CMAKE_CURRENT_SOURCE_DIR}/${src})
533+ endif()
534+ list(APPEND in_files ${src_file_path})
535+ string(REPLACE ".vala" ".c" src ${src})
536+ string(REPLACE ".gs" ".c" src ${src})
537+ if(${IS_MATCHED} MATCHES "/")
538+ get_filename_component(VALA_FILE_NAME ${src} NAME)
539+ set(out_file "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
540+ list(APPEND out_files "${CMAKE_CURRENT_BINARY_DIR}/${VALA_FILE_NAME}")
541+ else()
542+ set(out_file "${DIRECTORY}/${src}")
543+ list(APPEND out_files "${DIRECTORY}/${src}")
544+ endif()
545+ list(APPEND ${output} ${out_file})
546+ list(APPEND out_files_display "${src}")
547+ endforeach(src ${ARGS_DEFAULT_ARGS})
548+
549+ set(custom_vapi_arguments "")
550+ if(ARGS_CUSTOM_VAPIS)
551+ foreach(vapi ${ARGS_CUSTOM_VAPIS})
552+ if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
553+ list(APPEND custom_vapi_arguments ${vapi})
554+ else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
555+ list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
556+ endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
557+ endforeach(vapi ${ARGS_CUSTOM_VAPIS})
558+ endif(ARGS_CUSTOM_VAPIS)
559+
560+ set(vapi_arguments "")
561+ if(ARGS_GENERATE_VAPI)
562+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
563+ list(APPEND out_files_display "${ARGS_GENERATE_VAPI}.vapi")
564+ set(vapi_arguments "--library=${ARGS_GENERATE_VAPI}" "--vapi=${ARGS_GENERATE_VAPI}.vapi")
565+
566+ # Header and internal header is needed to generate internal vapi
567+ if (NOT ARGS_GENERATE_HEADER)
568+ set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
569+ endif(NOT ARGS_GENERATE_HEADER)
570+ endif(ARGS_GENERATE_VAPI)
571+
572+ set(header_arguments "")
573+ if(ARGS_GENERATE_HEADER)
574+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
575+ list(APPEND out_files_display "${ARGS_GENERATE_HEADER}.h")
576+ list(APPEND header_arguments "--header=${ARGS_GENERATE_HEADER}.h")
577+ endif(ARGS_GENERATE_HEADER)
578+
579+ set(gir_arguments "")
580+ if(ARGS_GENERATE_GIR)
581+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_GIR}.gir")
582+ list(APPEND out_files_display "${ARGS_GENERATE_GIR}.gir")
583+ set(gir_arguments "--gir=${ARGS_GENERATE_GIR}.gir")
584+ endif(ARGS_GENERATE_GIR)
585+
586+ set(symbols_arguments "")
587+ if(ARGS_GENERATE_SYMBOLS)
588+ list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_SYMBOLS}.symbols")
589+ list(APPEND out_files_display "${ARGS_GENERATE_SYMBOLS}.symbols")
590+ set(symbols_arguments "--symbols=${ARGS_GENERATE_SYMBOLS}.symbols")
591+ endif(ARGS_GENERATE_SYMBOLS)
592+
593+ # Workaround for a bug that would make valac run twice. This file is written
594+ # after the vala compiler generates C source code.
595+ set(OUTPUT_STAMP ${CMAKE_CURRENT_BINARY_DIR}/${target_name}_valac.stamp)
596+
597+ add_custom_command(
598+ OUTPUT
599+ ${OUTPUT_STAMP}
600+ COMMAND
601+ ${VALA_EXECUTABLE}
602+ ARGS
603+ "-C"
604+ ${header_arguments}
605+ ${vapi_arguments}
606+ ${gir_arguments}
607+ ${symbols_arguments}
608+ "-b" ${CMAKE_CURRENT_SOURCE_DIR}
609+ "-d" ${DIRECTORY}
610+ ${vala_pkg_opts}
611+ ${ARGS_OPTIONS}
612+ ${in_files}
613+ ${custom_vapi_arguments}
614+ COMMAND
615+ touch
616+ ARGS
617+ ${OUTPUT_STAMP}
618+ DEPENDS
619+ ${in_files}
620+ ${ARGS_CUSTOM_VAPIS}
621+ COMMENT
622+ "Generating ${out_files_display}"
623+ )
624+
625+ # This command will be run twice for some reason (pass a non-empty string to COMMENT
626+ # in order to see it). Since valac is not executed from here, this won't be a problem.
627+ add_custom_command(OUTPUT ${out_files} DEPENDS ${OUTPUT_STAMP} COMMENT "")
628+endmacro(vala_precompile)
629
630=== added file 'data/CMakeLists.txt'
631--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
632+++ data/CMakeLists.txt 2013-09-01 17:11:24 +0000
633@@ -0,0 +1,34 @@
634+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
635+
636+include(FindIntltool)
637+if (NOT INTLTOOL_MERGE_FOUND)
638+ message(FATAL_ERROR "intltool-merge not found")
639+elseif (NOT INTLTOOL_UPDATE_FOUND)
640+ message(FATAL_ERROR "intltool-update not found")
641+endif ()
642+
643+file(GLOB_RECURSE DATA_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
644+list(REMOVE_ITEM DATA_FILES "CMakeLists.txt")
645+
646+foreach(FILE ${DATA_FILES})
647+ string(FIND ${FILE} "faq." FAQ_FILE)
648+ string(FIND ${FILE} "midori." MIDORI_FILE)
649+ string(FIND ${FILE} ".desktop" DESKTOP_FILE)
650+ if (FAQ_FILE GREATER -1)
651+ elseif (DESKTOP_FILE GREATER -1)
652+ string(SUBSTRING ${FILE} 0 ${DESKTOP_FILE} DESKTOP_ID)
653+ INTLTOOL_MERGE_DESKTOP (${DESKTOP_ID} po)
654+ elseif(MIDORI_FILE GREATER -1)
655+ else()
656+ string(FIND ${FILE} "/" IS_DIR)
657+ if (IS_DIR GREATER -1)
658+ string(REPLACE "/" ";" DIR_LIST ${FILE})
659+ LIST(GET DIR_LIST 0 S_DIR)
660+ LIST(GET DIR_LIST 1 S_FILE)
661+ install(FILES ${S_DIR}/${S_FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/${S_DIR})
662+ else ()
663+ install(FILES ${FILE} DESTINATION ${CMAKE_INSTALL_DATADIR}/midori/res/)
664+ endif()
665+ endif()
666+
667+endforeach()
668
669=== added file 'extensions/CMakeLists.txt'
670--- extensions/CMakeLists.txt 1970-01-01 00:00:00 +0000
671+++ extensions/CMakeLists.txt 2013-09-01 17:11:24 +0000
672@@ -0,0 +1,92 @@
673+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
674+
675+set(EXTENSIONDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}")
676+include_directories(
677+ "${CMAKE_SOURCE_DIR}"
678+ "${CMAKE_SOURCE_DIR}/midori"
679+ "${CMAKE_SOURCE_DIR}/katze"
680+ ${DEPS_INCLUDE_DIRS}
681+ ${OPTS_INCLUDE_DIRS}
682+ ${DEPS_GTK_INCLUDE_DIRS}
683+ ${OPTS_GTK_INCLUDE_DIRS}
684+ ${CMAKE_BINARY_DIR}
685+ "${CMAKE_BINARY_DIR}/midori"
686+ )
687+file(GLOB EXTENSIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
688+if (HALF_BRO_INCOM_WEBKIT2)
689+ list(REMOVE_ITEM EXTENSIONS
690+ "adblock.c"
691+ "cookie-permissions"
692+ "addons.c"
693+ "formhistory"
694+ "external-download-manager.vala"
695+ "nojs"
696+ "nsplugin-manager.vala"
697+ )
698+endif ()
699+
700+foreach(UNIT_SRC ${EXTENSIONS})
701+ string(FIND ${UNIT_SRC} ".c" UNIT_EXTENSION)
702+ if (UNIT_EXTENSION GREATER -1)
703+ string(REPLACE ".c" "" UNIT ${UNIT_SRC})
704+ add_library(${UNIT} MODULE ${UNIT_SRC})
705+ target_link_libraries(${UNIT}
706+ ${LIBMIDORI}
707+ )
708+ set_target_properties(${UNIT} PROPERTIES
709+ COMPILE_FLAGS ${CFLAGS}
710+ )
711+ install(TARGETS ${UNIT}
712+ LIBRARY DESTINATION ${EXTENSIONDIR}
713+ )
714+ endif ()
715+endforeach ()
716+
717+foreach(UNIT_SRC ${EXTENSIONS})
718+ string(FIND ${UNIT_SRC} "." UNIT_EXTENSION)
719+ if (UNIT_EXTENSION EQUAL -1)
720+ file(GLOB UNIT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${UNIT_SRC}/*.c")
721+ if (UNIT_FILES)
722+ add_library(${UNIT_SRC} MODULE ${UNIT_FILES})
723+ target_link_libraries(${UNIT_SRC}
724+ ${LIBMIDORI}
725+ )
726+ set_target_properties(${UNIT_SRC} PROPERTIES
727+ COMPILE_FLAGS ${CFLAGS}
728+ )
729+ install(TARGETS ${UNIT_SRC}
730+ LIBRARY DESTINATION ${EXTENSIONDIR}
731+ )
732+ endif ()
733+ endif ()
734+endforeach ()
735+
736+foreach(UNIT_SRC ${EXTENSIONS})
737+ string(FIND ${UNIT_SRC} ".vala" UNIT_EXTENSION)
738+ if (UNIT_EXTENSION GREATER -1)
739+ string(REPLACE ".vala" "" UNIT ${UNIT_SRC})
740+ include(ValaPrecompile)
741+ vala_precompile(UNIT_SRC_C ${UNIT}
742+ ${UNIT_SRC}
743+ PACKAGES
744+ ${PKGS}
745+ OPTIONS
746+ ${VALAFLAGS}
747+ CUSTOM_VAPIS
748+ ${EXTRA_VAPIS}
749+ "${CMAKE_SOURCE_DIR}/midori/midori.vapi"
750+ "${CMAKE_SOURCE_DIR}/katze/katze.vapi"
751+ "${CMAKE_BINARY_DIR}/midori/${LIBMIDORI}.vapi"
752+ )
753+ add_library(${UNIT} MODULE ${UNIT_SRC_C})
754+ target_link_libraries(${UNIT}
755+ ${LIBMIDORI}
756+ )
757+ set_target_properties(${UNIT} PROPERTIES
758+ COMPILE_FLAGS ${CFLAGS}
759+ )
760+ install(TARGETS ${UNIT}
761+ LIBRARY DESTINATION ${EXTENSIONDIR}
762+ )
763+ endif ()
764+endforeach ()
765
766=== added file 'icons/CMakeLists.txt'
767--- icons/CMakeLists.txt 1970-01-01 00:00:00 +0000
768+++ icons/CMakeLists.txt 2013-09-01 17:11:24 +0000
769@@ -0,0 +1,12 @@
770+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
771+
772+macro(install_icon name cat size)
773+ file(GLOB FILENAME RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${size}/${name}.*")
774+ install(FILES ${FILENAME} DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/${size}/${cat})
775+endmacro()
776+
777+foreach(SIZE "16x16;22x22;scalable")
778+ install_icon(midori apps ${SIZE})
779+ install_icon(extension categories ${SIZE})
780+ install_icon(internet-news-reader status ${SIZE})
781+endforeach()
782
783=== added file 'midori/CMakeLists.txt'
784--- midori/CMakeLists.txt 1970-01-01 00:00:00 +0000
785+++ midori/CMakeLists.txt 2013-09-01 17:11:24 +0000
786@@ -0,0 +1,64 @@
787+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
788+
789+set(LIBMIDORI_VERSION 0.5.5)
790+set(LIBMIDORI_SOVERSION 0)
791+
792+file(GLOB MIDORI_VALA_SOURCE ../katze/*.vala *.vala ../panels/*.vala)
793+file(GLOB LIBMIDORI_SOURCE ../katze/*.c ../panels/*.c ../toolbars/*.c midori-*.vala midori-*.c sokoke.c)
794+include(GLibHelpers)
795+add_glib_marshal(LIBMIDORI_SOURCE marshal ${CMAKE_PROJECT_NAME}_cclosure_marshal "midori.h")
796+set(MIDORI_SOURCE
797+ main.c
798+ )
799+
800+include(ValaPrecompile)
801+vala_precompile(LIBMIDORI_SOURCE_C ${CMAKE_PROJECT_NAME}
802+ ${MIDORI_VALA_SOURCE}
803+PACKAGES
804+ ${PKGS}
805+OPTIONS
806+ ${VALAFLAGS}
807+CUSTOM_VAPIS
808+ ${EXTRA_VAPIS}
809+GENERATE_VAPI
810+ "${CMAKE_PROJECT_NAME}-core"
811+GENERATE_HEADER
812+ "${CMAKE_PROJECT_NAME}-core"
813+)
814+
815+add_library(${LIBMIDORI} SHARED ${LIBMIDORI_SOURCE_C} ${LIBMIDORI_SOURCE})
816+include_directories(
817+ ${CMAKE_SOURCE_DIR}
818+ ${CMAKE_CURRENT_SOURCE_DIR}
819+ "${CMAKE_SOURCE_DIR}/katze"
820+ "${CMAKE_SOURCE_DIR}/toolbars"
821+ ${CMAKE_BINARY_DIR}
822+ ${DEPS_INCLUDE_DIRS}
823+ ${OPTS_INCLUDE_DIRS}
824+ ${DEPS_GTK_INCLUDE_DIRS}
825+ ${OPTS_GTK_INCLUDE_DIRS}
826+ )
827+target_link_libraries(${LIBMIDORI}
828+ ${DEPS_LIBRARIES}
829+ ${OPTS_LIBRARIES}
830+ ${DEPS_GTK_LIBRARIES}
831+ ${OPTS_GTK_LIBRARIES}
832+ )
833+set_target_properties(${LIBMIDORI} PROPERTIES
834+ COMPILE_FLAGS ${CFLAGS}
835+ SOVERSION 1
836+ VERSION 0.0.0
837+ )
838+install(TARGETS ${LIBMIDORI}
839+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
840+ )
841+
842+add_executable(${CMAKE_PROJECT_NAME} main.c)
843+target_link_libraries(${CMAKE_PROJECT_NAME}
844+ ${LIBMIDORI})
845+set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
846+ COMPILE_FLAGS ${CFLAGS}
847+ )
848+install(TARGETS ${CMAKE_PROJECT_NAME}
849+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
850+ )
851
852=== added file 'po/CMakeLists.txt'
853--- po/CMakeLists.txt 1970-01-01 00:00:00 +0000
854+++ po/CMakeLists.txt 2013-09-01 17:11:24 +0000
855@@ -0,0 +1,18 @@
856+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
857+
858+include(FindGettext)
859+if (GETTEXT_FOUND)
860+ add_definitions("-DENABLE_NLS")
861+ set(LANGUAGES $ENV{LINGUAS})
862+ if (NOT LANGUAGES)
863+ file(GLOB POTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.po")
864+ string(REPLACE ".po" " " LANGUAGES ${POTFILES})
865+ endif ()
866+ message(STATUS "gettext found: ${LANGUAGES}")
867+ string(REPLACE " " ";" LANGUAGES ${LANGUAGES})
868+ foreach(LANG ${LANGUAGES})
869+ GETTEXT_PROCESS_PO_FILES(${LANG} ALL PO_FILES "${LANG}.po")
870+ endforeach ()
871+else ()
872+ message(STATUS "gettext not found")
873+endif ()
874
875=== modified file 'po/POTFILES.in'
876--- po/POTFILES.in 2013-08-21 23:24:00 +0000
877+++ po/POTFILES.in 2013-09-01 17:11:24 +0000
878@@ -67,8 +67,6 @@
879 katze/midori-hsts.vala
880 katze/katze-separatoraction.vala
881 katze/gtk3-compat.c
882-katze/katze-http-cookies-sqlite.c
883-katze/katze-http-cookies.c
884 midori/midori-panedaction.vala
885 midori/midori-privatedata.c
886 midori/midori-dialog.vala
887
888=== added file 'tests/CMakeLists.txt'
889--- tests/CMakeLists.txt 1970-01-01 00:00:00 +0000
890+++ tests/CMakeLists.txt 2013-09-01 17:11:24 +0000
891@@ -0,0 +1,65 @@
892+# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
893+
894+include(ContainTest)
895+add_custom_target(check COMMAND "env" "CTEST_OUTPUT_ON_FAILURE=1" "${CMAKE_CTEST_COMMAND}")
896+
897+include_directories(
898+ "${CMAKE_SOURCE_DIR}"
899+ "${CMAKE_SOURCE_DIR}/midori"
900+ ${DEPS_INCLUDE_DIRS}
901+ ${OPTS_INCLUDE_DIRS}
902+ ${DEPS_GTK_INCLUDE_DIRS}
903+ ${OPTS_GTK_INCLUDE_DIRS}
904+ ${CMAKE_BINARY_DIR}
905+ "${CMAKE_BINARY_DIR}/midori"
906+ )
907+file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.c)
908+foreach(UNIT_SRC ${TESTS})
909+ string(REPLACE ".c" "" UNIT ${UNIT_SRC})
910+ add_executable(${UNIT} ${UNIT_SRC})
911+ add_test(NAME ${UNIT} COMMAND ${UNIT})
912+ contain_test(${UNIT})
913+ target_link_libraries(${UNIT}
914+ ${LIBMIDORI}
915+ )
916+ set_target_properties(${UNIT} PROPERTIES
917+ COMPILE_FLAGS ${CFLAGS}
918+ )
919+endforeach ()
920+
921+file(GLOB TESTS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
922+foreach(UNIT_SRC ${TESTS})
923+ string(REPLACE ".vala" "" UNIT ${UNIT_SRC})
924+ include(ValaPrecompile)
925+ vala_precompile(UNIT_SRC_C ${UNIT}
926+ ${UNIT_SRC}
927+ PACKAGES
928+ ${PKGS}
929+ OPTIONS
930+ ${VALAFLAGS}
931+ CUSTOM_VAPIS
932+ ${EXTRA_VAPIS}
933+ "${CMAKE_SOURCE_DIR}/midori/midori.vapi"
934+ "${CMAKE_SOURCE_DIR}/katze/katze.vapi"
935+ "${CMAKE_BINARY_DIR}/midori/${LIBMIDORI}.vapi"
936+ )
937+ add_executable(${UNIT} ${UNIT_SRC_C})
938+ add_test(NAME ${UNIT} COMMAND ${UNIT})
939+ contain_test(${UNIT})
940+ target_link_libraries(${UNIT}
941+ ${LIBMIDORI}
942+ )
943+ set_target_properties(${UNIT} PROPERTIES
944+ COMPILE_FLAGS ${CFLAGS}
945+ )
946+endforeach ()
947+
948+file(GLOB TESTS *.sh)
949+foreach(UNIT_SRC ${TESTS})
950+ string(REPLACE ".sh" "" UNIT ${UNIT_SRC})
951+ add_test(NAME ${UNIT} COMMAND ${UNIT_SRC})
952+ set_tests_properties(${UNIT} PROPERTIES
953+ ENVIRONMENT "SRCDIR=${CMAKE_SOURCE_DIR}"
954+ ENVIRONMENT "BLDDIR=${CMAKE_BINARY_DIR}"
955+ )
956+endforeach ()

Subscribers

People subscribed via source and target branches

to all changes: