1
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
3
cmake_minimum_required(VERSION 2.6)
4
cmake_policy(VERSION 2.6)
6
add_definitions("-DPACKAGE_NAME=\"${CMAKE_PROJECT_NAME}\"")
7
add_definitions("-DPACKAGE_BUGREPORT=\"https://bugs.launchpad.net/midori\"")
9
add_definitions("-DPACKAGE_VERSION=\"${VERSION}\"")
10
add_definitions("-DMIDORI_VERSION_SUFFIX=\"-${VERSION}\"")
11
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
12
# Disallow building during install to avoid permission problems
13
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)
15
include(GNUInstallDirs)
16
set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
17
add_definitions("-DMDATADIR=\"${DATADIR}\"")
18
add_definitions("-DSYSCONFDIR=\"${CMAKE_INSTALL_FULL_SYSCONFDIR}\"")
19
add_definitions("-DLIBDIR=\"${CMAKE_INSTALL_FULL_LIBDIR}\"")
20
add_definitions("-DDOCDIR=\"${CMAKE_INSTALL_FULL_DOCDIR}\"")
21
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/config.h" "/* # generated file (stub) */")
23
find_package(PkgConfig)
24
pkg_check_modules(DEPS REQUIRED
29
libsoup-gnome-2.4>=2.27.90
31
add_definitions("-DHAVE_LIBXML")
32
add_definitions("-DGIO_VERSION=\"${DEPS_gio-2.0_VERSION}\"")
33
add_definitions("-DLIBSOUP_VERSION=\"${DEPS_libsoup-gnome-2.4_VERSION}\"")
34
set(PKGS posix libxml-2.0 sqlite3 gmodule-2.0 gio-2.0 libsoup-2.4)
35
if (${DEPS_libsoup-gnome-2.4_VERSION} VERSION_GREATER "2.34.0")
36
set(VALAFLAGS ${VALAFLAGS} "-D;HAVE_LIBSOUP_2_34_0")
38
pkg_check_modules(OPTS
42
add_definitions("-DLIBNOTIFY_VERSION=\"${OPTS_libnotify_VERSION}\"")
43
add_definitions("-DGRANITE_VERSION=\"${OPTS_granite_VERSION}\"")
44
set(PKGS ${PKGS} libnotify zeitgeist-1.0)
45
option(USE_GTK3 "Use GTK+3" OFF)
47
pkg_check_modules(DEPS_GTK REQUIRED
52
add_definitions("-DGTK_VERSION=\"${DEPS_GTK_gtk+-3.0_VERSION}\"")
53
add_definitions("-DWEBKIT_VERSION=\"${DEPS_GTK_webkitgtk-3.0_VERSION}\"")
54
set(PKGS ${PKGS} gtk+-3.0)
55
pkg_check_modules(OPTS_GTK
59
if (OPTS_GTK_unique-3.0_VERSION)
60
add_definitions("-DHAVE_UNIQUE")
61
add_definitions("-DUNIQUE_VERSION=\"${OPTS_GTK_unique-3.0_VERSION}\"")
63
add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
66
find_package(Vala REQUIRED)
67
vala_require("0.16.0")
69
set(GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
70
add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
72
set(CFLAGS "-w -Wno-deprecated-declarations")
74
add_subdirectory (midori)
76
add_subdirectory (data)