~tintou/libappstore/Isis-start

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
95
96
97
# Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation

cmake_minimum_required (VERSION 2.6)
cmake_policy (VERSION 2.6)
project (appstore)

set (PKG_NAME ${CMAKE_PROJECT_NAME})
set (PKG_VERSION 0.1)
set (API_VERSION 1.0)

# Used to create GObject introspection files
set (PKG_GIR_NAME AppStore)

list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)

set (RESOURCES_DIR ${CMAKE_INSTALL_PREFIX}/share/${PKG_NAME}/)
set (GETTEXT_PACKAGE ${PKG_NAME})

set (CPACK_PACKAGE_VERSION ${PKG_VERSION})
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}")
set (CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}")

include (CPack)
add_custom_target (dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)

find_package (Vala REQUIRED)
include (ValaVersion)
include (ValaPrecompile)

ensure_vala_version ("0.16.1" MINIMUM)

#
# Packages in PKG_DEPS are used with the vala compiler and other related tools (not versioned.)
# Packages in PKG_DEPS_CHECK are used with PKG-Config and for linking, etc. They can contain versions.
#
# Both should contain *the same packages*, except for those whose VAPI file has a different name. In
# such case, PKG_DEPS would use the name of the VAPI, and PKG_DEPS_CHECK would use the name of the
# package known by pkg-config.
#

find_package (PkgConfig)

# Alternative Gtk+ support
pkg_check_modules (GTK gtk+-3.0)
if (${GTK_FOUND})
    set (PKG_DEPS
        gtk+-3.0
        sqlheavy-0.1
        gee-1.0
        appstream)

    set (PKG_DEPS_CHECK
        gtk+-3.0>=3.3.14
        packagekit-glib2
        sqlheavy-0.1
        gthread-2.0
        gee-1.0
        appstream)
    set (VALAC_OPTIONS
     --thread
     --target-glib=2.32
     -D HAVE_GTK)
    message("-- Gtk+ support, ON")
else ()
    set (PKG_DEPS
        sqlheavy-0.1
        gee-1.0
        appstream)

    set (PKG_DEPS_CHECK
        packagekit-glib2
        sqlheavy-0.1
        gthread-2.0
        gee-1.0
        appstream)
    set (VALAC_OPTIONS
     --thread
     --target-glib=2.32)
    message("-- Gtk+ support, OFF")
endif ()

# GI dependencies
set (GI_PKG_DEPS Gtk-3.0 Gee-1.0)

# Check for the deps
pkg_check_modules (DEPS REQUIRED ${PKG_DEPS_CHECK})


if (CMAKE_SYSTEM_NAME MATCHES "Linux")
    set (VALAC_OPTIONS ${VALAC_OPTIONS} --define=LINUX)
endif ()

add_subdirectory (lib)
#add_subdirectory (tools)
#add_subdirectory (doc)
#add_subdirectory (po)