~novaburst-dev/midori

ref: v9.0 midori/CMakeLists.txt -rw-r--r-- 2.9 KiB
b75acbf6Nova 6ede58c0-ccbc-40fe-befb-cb5d876208c5 6 months ago
                                                                                
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
# Copyright (C) 2013-2018 Christian Dywan <christian@twotoasts.de>

cmake_minimum_required(VERSION 3.2)

# dh_translations detects this if there's no variable used
set (GETTEXT_PACKAGE "midori")
add_definitions("-DGETTEXT_PACKAGE=\"${GETTEXT_PACKAGE}\"")
project(${GETTEXT_PACKAGE} C)
set(PROJECT_DOMAIN org.midori_browser.Midori)
set(PROJECT_BUGS https://github.com/midori-browser/core/issues)
set(PROJECT_WEBSITE https://www.midori-browser.org)
set(CORE_VERSION 9.0)

execute_process(COMMAND "git" "describe" "--tags"
                OUTPUT_VARIABLE REVISION
                ERROR_QUIET
                OUTPUT_STRIP_TRAILING_WHITESPACE)
if (REVISION)
    set(CORE_VERSION "${REVISION}")
    # All warnings are errors in development builds
    set(VALAFLAGS ${VALAFLAGS} --fatal-warnings)
else ()
    # No runtime type checks
    set(VALAFLAGS ${VALAFLAGS} --disable-assert)
endif ()

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Disallow building during install to avoid permission problems
set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1)

include(FindIntltool)

find_package(Vala REQUIRED)
vala_require("0.30.0")
set(VALAFLAGS ${VALAFLAGS}
    --debug
    --target-glib=2.46
    --enable-deprecated
    )

include(GNUInstallDirs)
set(DATADIR ${CMAKE_INSTALL_FULL_DATADIR})
set(PLUGINDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}" CACHE STRING "Location for system-wide plugins")

find_package(PkgConfig)
pkg_check_modules(DEPS REQUIRED
                  sqlite3>=3.6.19
                  gio-2.0>=2.46.2
                  libsoup-2.4>=2.48.0
                  )
set(PKGS sqlite3 gio-2.0 libsoup-2.4)

pkg_check_modules(DEPS_GTK REQUIRED
                  gtk+-3.0>=3.12.0
                  webkit2gtk-4.0>=2.16.6
                  gcr-ui-3>=2.32
                  libpeas-gtk-1.0
                  json-glib-1.0>=0.12
                  libarchive
                  )
set(PKGS ${PKGS} gtk+-3.0 libsoup-2.4 gcr-ui-3 libpeas-gtk-1.0 json-glib-1.0 posix)
set(EXTRA_VAPIS
    ${CMAKE_SOURCE_DIR}/vapi/config.vapi
    ${CMAKE_SOURCE_DIR}/vapi/libarchive.vapi
    ${CMAKE_SOURCE_DIR}/vapi/webkit2gtk-4.0.vapi
    ${CMAKE_SOURCE_DIR}/vapi/javascriptcoregtk-4.0.vapi)

add_definitions("-DGCR_API_SUBJECT_TO_CHANGE")
set(CFLAGS "${CFLAGS} -g")

# Explicitly add -fPIC for older toolchains
set(VALA_CFLAGS "-g -fPIC -w -Werror")

set(LIBCORE "${CMAKE_PROJECT_NAME}-core")
set(CORE_USER_AGENT_VERSION "Midori/6")

configure_file(config.h.in config.h @ONLY)

# CMake provides no uninstall target by design
add_custom_target (uninstall
    COMMAND "xargs" "rm" "-v" "<" "install_manifest.txt")

install(FILES COPYING README.md DESTINATION ${CMAKE_INSTALL_DOCDIR})

set(DESKTOP_ICON "${PROJECT_DOMAIN}" CACHE STRING "The Icon value to be used in the .desktop file")

add_subdirectory (core)
add_subdirectory (web)
add_subdirectory (extensions)
enable_testing()
add_subdirectory (tests)
add_subdirectory (po)
add_subdirectory (icons)
add_subdirectory (data)