~midori/midori/trunk

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Christian Dywan
  • Date: 2013-08-18 00:47:45 UTC
  • mto: This revision was merged to the branch mainline in revision 6370.
  • Revision ID: christian.dywan@canonical.com-20130818004745-7yo9c8utphdhjt1k
Initial minimal CMake build setup

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
 
2
 
 
3
cmake_minimum_required(VERSION 2.6)
 
4
cmake_policy(VERSION 2.6)
 
5
project(midori C)
 
6
add_definitions("-DPACKAGE_NAME=\"${CMAKE_PROJECT_NAME}\"")
 
7
add_definitions("-DPACKAGE_BUGREPORT=\"https://bugs.launchpad.net/midori\"")
 
8
set(VERSION 0.5.5)
 
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)
 
14
 
 
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) */")
 
22
 
 
23
find_package(PkgConfig)
 
24
pkg_check_modules(DEPS REQUIRED
 
25
                  libxml-2.0>=2.6
 
26
                  sqlite3>=3.6.19
 
27
                  gmodule-2.0
 
28
                  gio-2.0>=2.32.3
 
29
                  libsoup-gnome-2.4>=2.27.90
 
30
                  )
 
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")
 
37
endif ()
 
38
pkg_check_modules(OPTS
 
39
                  libnotify
 
40
                  zeitgeist-1.0>=0.3.14
 
41
                  )
 
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)
 
46
if (USE_GTK3)
 
47
    pkg_check_modules(DEPS_GTK REQUIRED
 
48
                      gtk+-3.0>=3.0.0
 
49
                      webkitgtk-3.0>=1.8.3
 
50
                      javascriptcoregtk-3.0
 
51
                      )
 
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
 
56
                      gcr-3>=2.32
 
57
                      unique-3.0>=0.9
 
58
                      )
 
59
    if (OPTS_GTK_unique-3.0_VERSION)
 
60
        add_definitions("-DHAVE_UNIQUE")
 
61
        add_definitions("-DUNIQUE_VERSION=\"${OPTS_GTK_unique-3.0_VERSION}\"")
 
62
    endif ()
 
63
    add_definitions("-DGCR_VERSION=\"${OPTS_GTK_gcr-3_VERSION}\"")
 
64
endif ()
 
65
 
 
66
find_package(Vala REQUIRED)
 
67
vala_require("0.16.0")
 
68
 
 
69
set(GETTEXT_PACKAGE ${CMAKE_PROJECT_NAME})
 
70
add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
 
71
 
 
72
set(CFLAGS "-w -Wno-deprecated-declarations")
 
73
 
 
74
add_subdirectory (midori)
 
75
add_subdirectory (po)
 
76
add_subdirectory (data)