Browse Source

customized builds

Chris Cromer 1 year ago
parent
commit
235c95aa2b
100 changed files with 5603 additions and 168 deletions
  1. 6
    0
      .configure-custom.sh
  2. 5
    17
      .gitignore
  3. 4
    1
      AUTHORS
  4. 82
    0
      CMakeLists.txt
  5. 0
    92
      Makefile
  6. 0
    12
      README
  7. 67
    0
      README.md
  8. 0
    1
      TODO
  9. 14
    0
      autogen.sh
  10. 17
    0
      autovala/cmake/CMakeLists.txt
  11. 80
    0
      autovala/cmake/FindVala.cmake
  12. 20
    0
      autovala/cmake/FindValadoc.cmake
  13. 34
    0
      autovala/cmake/GObjectIntrospectionMacros.cmake
  14. 42
    0
      autovala/cmake/GSettings.cmake
  15. 28
    0
      autovala/cmake/InstallSymlink.cmake
  16. 286
    0
      autovala/cmake/Makefile
  17. 36
    0
      autovala/cmake/ParseArguments.cmake
  18. 10
    0
      autovala/cmake/README
  19. 173
    0
      autovala/cmake/README.Vala.rst
  20. 5
    0
      autovala/cmake/Tests.cmake
  21. 66
    0
      autovala/cmake/Translations.cmake
  22. 243
    0
      autovala/cmake/ValaPrecompile.cmake
  23. 153
    0
      autovala/cmake/ValaVersion.cmake
  24. 38
    0
      autovala/cmake/Valadoc.cmake
  25. 314
    0
      autovala/configure
  26. 6
    0
      autovala/configure-custom.sh
  27. 17
    0
      cmake/CMakeLists.txt
  28. 80
    0
      cmake/FindVala.cmake
  29. 20
    0
      cmake/FindValadoc.cmake
  30. 34
    0
      cmake/GObjectIntrospectionMacros.cmake
  31. 42
    0
      cmake/GSettings.cmake
  32. 28
    0
      cmake/InstallSymlink.cmake
  33. 286
    0
      cmake/Makefile
  34. 36
    0
      cmake/ParseArguments.cmake
  35. 10
    0
      cmake/README
  36. 173
    0
      cmake/README.Vala.rst
  37. 5
    0
      cmake/Tests.cmake
  38. 66
    0
      cmake/Translations.cmake
  39. 243
    0
      cmake/ValaPrecompile.cmake
  40. 153
    0
      cmake/ValaVersion.cmake
  41. 38
    0
      cmake/Valadoc.cmake
  42. 314
    0
      configure
  43. 87
    0
      data/CMakeLists.txt
  44. 19
    0
      data/config/CMakeLists.txt
  45. 19
    0
      data/config/noaur/CMakeLists.txt
  46. 11
    0
      data/config/noaur/pamac.conf
  47. 45
    0
      data/dbus/CMakeLists.txt
  48. 6
    6
      data/dbus/org.pamac.system.conf
  49. 1
    1
      data/dbus/org.pamac.system.service
  50. 1
    1
      data/dbus/org.pamac.user.service
  51. 8
    0
      data/icons/16x16/apps/CMakeLists.txt
  52. 9
    0
      data/icons/24x24/status/CMakeLists.txt
  53. 8
    0
      data/icons/32x32/apps/CMakeLists.txt
  54. 18
    0
      data/interface/CMakeLists.txt
  55. 0
    0
      data/interface/choose_ignorepkgs_dialog.ui
  56. 0
    0
      data/interface/choose_provider_dialog.ui
  57. 0
    0
      data/interface/history_dialog.ui
  58. 0
    0
      data/interface/manager_window.ui
  59. 935
    0
      data/interface/manager_window_no_aur.ui
  60. 0
    0
      data/interface/preferences_dialog.ui
  61. 617
    0
      data/interface/preferences_dialog_no_aur.ui
  62. 0
    0
      data/interface/progress_box.ui
  63. 0
    0
      data/interface/progress_dialog.ui
  64. 0
    0
      data/interface/transaction_sum_dialog.ui
  65. 17
    0
      data/mime/CMakeLists.txt
  66. 0
    0
      data/pamac-install.desktop
  67. 0
    0
      data/pamac-manager.desktop
  68. 1
    0
      data/pamac-tray-appindicator.desktop
  69. 1
    0
      data/pamac-tray.desktop
  70. 0
    0
      data/pamac-updater.desktop
  71. 6
    0
      data/pamac.installer.gresource.xml
  72. 15
    0
      data/pamac.manager.gresource.xml
  73. 15
    0
      data/pamac.manager_no_aur.gresource.xml
  74. 13
    0
      data/pamac.transaction.gresource.xml
  75. 13
    0
      data/pamac.transaction_no_aur.gresource.xml
  76. 12
    0
      data/pixmaps/CMakeLists.txt
  77. 0
    0
      data/pixmaps/package-available-locked.png
  78. 0
    0
      data/pixmaps/package-available.png
  79. 0
    0
      data/pixmaps/package-generic.png
  80. 0
    0
      data/pixmaps/package-install.png
  81. 0
    0
      data/pixmaps/package-installed-locked.png
  82. 0
    0
      data/pixmaps/package-installed-updated.png
  83. 0
    0
      data/pixmaps/package-reinstall.png
  84. 0
    0
      data/pixmaps/package-remove.png
  85. 0
    0
      data/pixmaps/package-upgrade.png
  86. 17
    0
      data/polkit/CMakeLists.txt
  87. 3
    3
      data/polkit/org.pamac.policy.in
  88. 73
    0
      data/systemd/CMakeLists.txt
  89. 1
    1
      data/systemd/pamac-system.service
  90. 20
    0
      doc/CMakeLists.txt
  91. 249
    0
      pamac.avprj
  92. 6
    0
      po/CMakeLists.txt
  93. 1
    0
      po/LINGUAS
  94. 2
    3
      po/Makefile
  95. 38
    0
      po/POTFILES.in
  96. 9
    7
      po/af.po
  97. 12
    8
      po/ar.po
  98. 12
    8
      po/ast.po
  99. 9
    7
      po/az_AZ.po
  100. 0
    0
      po/be.po

+ 6
- 0
.configure-custom.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+
3
+ENABLE_VARS="kde-tray|ON|KDE_TRAY"
4
+ENABLE_KDE_TRAY_DOC="build with kde tray and appindicator instead of gtk3 tray"
5
+DISABLE_VARS="aur|ON|DISABLE_AUR"
6
+DISABLE_DISABLE_AUR_DOC="disable the AUR in pamac"

+ 5
- 17
.gitignore View File

@@ -1,20 +1,8 @@
1
-pkgbuild
2
-resources/*~
3
-resources/*.c
4
-src/*.c
5
-src/pamac.h
6
-src/pamac.vapi
7
-src/libpamac.so
8
-src/pamac-user-daemon
9
-src/pamac-system-daemon
10
-src/pamac-tray
11
-src/pamac-tray-appindicator
12
-src/pamac-manager
13
-src/pamac-install
14
-src/pamac-updater
15
-src/pamac-refresh
16
-data/polkit/org.manjaro.pamac.policy
17 1
 po/*.mo
18 2
 po/*~
19 3
 po/locale
20
-*.swp
4
+PKGBUILD
5
+*.pkg.tar.xz
6
+*.pkg.tar.xz.sig
7
+data/polkit/org.pamac.policy
8
+/build

+ 4
- 1
AUTHORS View File

@@ -1,2 +1,5 @@
1
-Main developers:
1
+Pamac classic devleopers:
2
+  Chris Cromer <cromer@cromnix.org>
3
+
4
+Pamac developers:
2 5
   Guillaume Benoit <guillaume@manjaro.org>

+ 82
- 0
CMakeLists.txt View File

@@ -0,0 +1,82 @@
1
+### CMakeLists automatically created with AutoVala
2
+### Do not edit
3
+
4
+project (pamac)
5
+cmake_minimum_required (VERSION 2.6)
6
+cmake_policy (VERSION 2.8)
7
+list (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
8
+enable_testing ()
9
+option(ICON_UPDATE "Update the icon cache after installing" ON)
10
+option(BUILD_VALADOC "Build API documentation if Valadoc is available" OFF)
11
+option(DISABLE_AUR "DISABLE_AUR" OFF)
12
+option(KDE_TRAY "KDE_TRAY" OFF)
13
+
14
+if( NOT CMAKE_BUILD_TYPE )
15
+	set(CMAKE_BUILD_TYPE Release)
16
+endif()
17
+
18
+include(GNUInstallDirs)
19
+if( ( ${CMAKE_INSTALL_PREFIX} MATCHES "^/usr/local" ) )
20
+	# A workaround to ensure that works 'out of the box' in Debian-based systems
21
+	set(CMAKE_INSTALL_LIBDIR lib)
22
+endif()
23
+
24
+set(HAVE_VALADOC OFF)
25
+if(BUILD_VALADOC)
26
+	find_package(Valadoc)
27
+	if(VALADOC_FOUND)
28
+		set(HAVE_VALADOC ON)
29
+		include(Valadoc)
30
+	else()
31
+		message("Valadoc not found, will not build documentation")
32
+	endif()
33
+endif()
34
+
35
+find_package(PkgConfig)
36
+
37
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} gdk-3.0)
38
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} gtk+-3.0)
39
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} json-glib-1.0)
40
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} libalpm)
41
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} libcurl)
42
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} libnotify)
43
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} libsoup-2.4)
44
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} polkit-gobject-1)
45
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} vte-2.91)
46
+if (KDE_TRAY)
47
+	set(MODULES_TO_CHECK ${MODULES_TO_CHECK} appindicator3-0.1)
48
+endif ()
49
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} gio-2.0)
50
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} glib-2.0)
51
+set(MODULES_TO_CHECK ${MODULES_TO_CHECK} gobject-2.0)
52
+
53
+pkg_check_modules(DEPS REQUIRED ${MODULES_TO_CHECK})
54
+
55
+
56
+find_program ( WHERE_GRESOURCE glib-compile-resources )
57
+if ( NOT WHERE_GRESOURCE )
58
+	MESSAGE(FATAL_ERROR "Error! GLIB-COMPILE-RESOURCES is not installed.")
59
+endif()
60
+
61
+add_subdirectory(src/vapis)
62
+add_subdirectory(po)
63
+add_subdirectory(data/pixmaps)
64
+add_subdirectory(data/mime)
65
+add_subdirectory(data/polkit)
66
+add_subdirectory(data/systemd)
67
+add_subdirectory(data/dbus)
68
+add_subdirectory(data/config)
69
+add_subdirectory(data)
70
+add_subdirectory(data/icons/24x24/status)
71
+add_subdirectory(data/icons/16x16/apps)
72
+add_subdirectory(data/config/noaur)
73
+add_subdirectory(data/icons/32x32/apps)
74
+add_subdirectory(data/interface)
75
+add_subdirectory(src)
76
+add_subdirectory(src/aur)
77
+add_subdirectory(src/pamac-user-daemon)
78
+add_subdirectory(src/pamac-tray)
79
+add_subdirectory(src/pamac-install)
80
+add_subdirectory(src/pamac-manager)
81
+add_subdirectory(src/pamac-system-daemon)
82
+

+ 0
- 92
Makefile View File

@@ -1,92 +0,0 @@
1
-
2
-prefix ?= /usr
3
-bindir := $(prefix)/bin
4
-libdir := $(prefix)/lib
5
-includedir := $(prefix)/include
6
-datadir := $(prefix)/share
7
-localedir := $(datadir)/locale
8
-sysconfdir ?= /etc
9
-
10
-use_appindicator ?= false
11
-
12
-all:
13
-	cd resources && make resources
14
-	cd src && make binaries
15
-	[ $(use_appindicator) = true ] && cd src && make pamac-tray-appindicator || echo "no appindicator support"
16
-	cd po && make gettext
17
-
18
-clean:
19
-	cd resources && make clean
20
-	cd src && make clean
21
-	cd po && make clean
22
-
23
-install: install_pamac-tray-appindicator
24
-	mkdir -p $(prefix)/share/icons/hicolor
25
-	cp -r data/icons/* $(prefix)/share/icons/hicolor
26
-	mkdir -p $(localedir)
27
-	cp -r po/locale/* $(localedir)
28
-	install -Dm644 src/pamac.h $(includedir)/pamac.h
29
-	install -Dm644 src/pamac.vapi $(datadir)/vala/vapi/pamac.vapi
30
-	install -Dm755 src/libpamac.so $(libdir)/libpamac.so
31
-	install -Dm755 src/pamac-user-daemon $(bindir)/pamac-user-daemon
32
-	install -Dm744 src/pamac-system-daemon $(bindir)/pamac-system-daemon
33
-	install -Dm755 src/pamac-tray $(bindir)/pamac-tray
34
-	install -Dm755 src/pamac-manager $(bindir)/pamac-manager
35
-	ln -srf $(bindir)/pamac-manager $(bindir)/pamac-updater
36
-	install -Dm755 src/pamac-install $(bindir)/pamac-install
37
-	install -Dm644 data/applications/pamac-tray.desktop $(sysconfdir)/xdg/autostart/pamac-tray.desktop
38
-	install -Dm644 data/applications/pamac-manager.desktop $(datadir)/applications/pamac-manager.desktop
39
-	install -Dm644 data/applications/pamac-updater.desktop $(datadir)/applications/pamac-updater.desktop
40
-	install -Dm644 data/applications/pamac-install.desktop $(datadir)/applications/pamac-install.desktop
41
-	install -Dm644 data/config/pamac.conf $(sysconfdir)/pamac.conf
42
-	install -Dm644 data/dbus/org.manjaro.pamac.system.conf $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.system.conf
43
-	install -Dm644 data/dbus/org.manjaro.pamac.user.service $(datadir)/dbus-1/services/org.manjaro.pamac.user.service
44
-	install -Dm644 data/dbus/org.manjaro.pamac.system.service $(datadir)/dbus-1/system-services/org.manjaro.pamac.system.service
45
-	install -Dm644 data/systemd/pamac-system.service $(libdir)/systemd/system/pamac-system.service
46
-	install -Dm644 data/systemd/pamac-cleancache.service $(libdir)/systemd/system/pamac-cleancache.service
47
-	install -Dm644 data/systemd/pamac-cleancache.timer $(libdir)/systemd/system/pamac-cleancache.timer
48
-	install -Dm644 data/systemd/pamac-mirrorlist.service $(libdir)/systemd/system/pamac-mirrorlist.service
49
-	install -Dm644 data/systemd/pamac-mirrorlist.timer $(libdir)/systemd/system/pamac-mirrorlist.timer
50
-	mkdir -p $(sysconfdir)/systemd/system/multi-user.target.wants
51
-	ln -srf $(libdir)/systemd/system/pamac-cleancache.timer $(sysconfdir)/systemd/system/multi-user.target.wants
52
-	ln -srf $(libdir)/systemd/system/pamac-mirrorlist.timer $(sysconfdir)/systemd/system/multi-user.target.wants
53
-	install -Dm644 data/polkit/org.manjaro.pamac.policy $(datadir)/polkit-1/actions/org.manjaro.pamac.policy
54
-	install -Dm644 data/mime/x-alpm-package.xml $(datadir)/mime/packages/x-alpm-package.xml
55
-
56
-install_pamac-tray-appindicator:
57
-	install -Dm755 src/pamac-tray-appindicator $(bindir)/pamac-tray-appindicator &> /dev/null && \
58
-	install -Dm644 data/applications/pamac-tray-appindicator.desktop $(sysconfdir)/xdg/autostart/pamac-tray-appindicator.desktop  &> /dev/null || echo no appindicator support
59
-
60
-uninstall:
61
-	rm -f $(datadir)/icons/hicolor/16x16/apps/system-software-install.png
62
-	rm -f $(datadir)/icons/hicolor/24x24/status/pamac-tray-no-update.png
63
-	rm -f $(datadir)/icons/hicolor/24x24/status/pamac-tray-update.png
64
-	rm -f $(datadir)/icons/hicolor/32x32/apps/system-software-install.png
65
-	rm -f $(datadir)/locale/*/LC_MESSAGES/pamac.mo
66
-	rm -f $(includedir)/pamac.h
67
-	rm -f $(datadir)/vala/vapi/pamac.vapi
68
-	rm -f $(libdir)/libpamac.so
69
-	rm -f $(bindir)/pamac-user-daemon
70
-	rm -f $(bindir)/pamac-system-daemon
71
-	rm -f $(bindir)/pamac-tray
72
-	rm -f $(bindir)/pamac-tray-appindicator
73
-	rm -f $(bindir)/pamac-manager
74
-	rm -f $(bindir)/pamac-updater
75
-	rm -f $(bindir)/pamac-install
76
-	rm -f $(sysconfdir)/xdg/autostart/pamac-tray.desktop
77
-	rm -f $(sysconfdir)/xdg/autostart/pamac-tray-appindicator.desktop
78
-	rm -f $(datadir)/applications/pamac-manager.desktop
79
-	rm -f $(datadir)/applications/pamac-updater.desktop
80
-	rm -f $(datadir)/applications/pamac-install.desktop
81
-	rm -f $(sysconfdir)/pamac.conf
82
-	rm -f $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.system.conf
83
-	rm -f $(datadir)/dbus-1/services/org.manjaro.pamac.user.service
84
-	rm -f $(datadir)/dbus-1/system-services/org.manjaro.pamac.system.service
85
-	rm -f $(libdir)/systemd/system/pamac-system.service
86
-	rm -f $(libdir)/systemd/system/pamac-cleancache.service
87
-	rm -f $(sysconfdir)/systemd/system/pamac-cleancache.timer
88
-	rm -f $(libdir)/systemd/system/pamac-mirrorlist.service
89
-	rm -f $(sysconfdir)/systemd/system/pamac-mirrorlist.timer
90
-	rm -f $(libdir)/systemd/system/multi-user.target.wants/pamac-cleancache.timer
91
-	rm -f $(datadir)/polkit-1/actions/org.manjaro.pamac.policy
92
-	rm -f $(datadir)/mime/packages/x-alpm-package.xml

+ 0
- 12
README View File

@@ -1,12 +0,0 @@
1
-A DBus daemon and Gtk3 frontend for libalpm written in Vala
2
-
3
-Features:
4
-- Alpm bindings for Vala
5
-- a DBus daemon to perform every tasks with root access using polkit to check authorizations
6
-- a Gtk3 Package Manager
7
-- a Gtk3 Updates Manager
8
-- a Tray icon with configurable periodic refresh and updates notifications
9
-- a complete AUR support:
10
-	* multiple words search capability
11
-	* Enable/Disable check updates from AUR
12
-	* Build and update AUR packages

+ 67
- 0
README.md View File

@@ -0,0 +1,67 @@
1
+# Pamac-classic
2
+
3
+A graphical package manager for pacman
4
+
5
+# Features:
6
+
7
+- Alpm bindings for Vala
8
+- A DBus daemon to perform every tasks with root access using polkit to check authorizations
9
+- A Gtk3 Package Manager
10
+- A Gtk3 Updates Manager
11
+- A Tray icon with configurable periodic refresh and updates notifications
12
+- Complete AUR support:
13
+	* Multiple words search capability
14
+	* Enable/Disable check updates from AUR
15
+	* Build and update AUR packages
16
+
17
+# How to build
18
+
19
+## Requirements
20
+
21
+- GTK+: 3.0
22
+- GIO: 2.0
23
+- GLib: 2.0
24
+- GObject: 2.0
25
+- Json-Glib: 1.0
26
+- libalpm
27
+- libcurl
28
+- LibSoup: 2.4
29
+- polkit-gobject-1
30
+- libnotify
31
+- vte: 2.91
32
+- appindicator-gtk3 (optional to build KDE tray icon)
33
+- CMake
34
+- Vala
35
+- AutoVala (optional to regenerate CMake files)
36
+
37
+## Using CMake
38
+
39
+```
40
+mkdir build
41
+cd build
42
+cmake .. \
43
+    -DCMAKE_INSTALL_PREFIX=/usr \
44
+    -DCMAKE_INSTALL_LIBDIR=/usr/lib \
45
+    -DCMAKE_INSTALL_SYSCONFDIR=/etc
46
+make
47
+```
48
+### Extra build flags
49
+
50
+- -DDISABLE_AUR=ON (to disable AUR in Pamac)
51
+- -DKDE_TRAY=true (to build kde tray icon instead of gtk tray icon)
52
+
53
+## Using configure
54
+
55
+The configure script is just a wrapper for CMake, in the background the build process is the same.
56
+
57
+```
58
+./configure --prefix=/usr \
59
+	--libdir=/usr/lib \
60
+	--sysconfdir=/etc
61
+make
62
+```
63
+
64
+### Extra configure options
65
+
66
+- --disable-aur (to disable Aur in Pamac)
67
+- --enable-kde-tray (to build kde tray icon instead of gtk tray icon)

+ 0
- 1
TODO View File

@@ -1 +0,0 @@
1
-

+ 14
- 0
autogen.sh View File

@@ -0,0 +1,14 @@
1
+#!/bin/bash
2
+
3
+# Generate translations for certain files such as polkit
4
+pushd "${PWD}"/po
5
+make
6
+make clean
7
+popd
8
+
9
+# Update the autovala environment
10
+export AUTOVALA_CMAKE_SCRIPT="${PWD}"/autovala/cmake
11
+autovala refresh
12
+autovala cmake
13
+cp "${PWD}"/autovala/configure "${PWD}"/configure
14
+cp "${PWD}"/autovala/configure-custom.sh "${PWD}"/.configure-custom.sh

+ 17
- 0
autovala/cmake/CMakeLists.txt View File

@@ -0,0 +1,17 @@
1
+### CMakeLists automatically created with AutoVala
2
+### Do not edit
3
+
4
+IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
5
+	install(DIRECTORY
6
+		${CMAKE_CURRENT_SOURCE_DIR}/
7
+	DESTINATION
8
+		share/autovala/cmake
9
+	)
10
+ELSE()
11
+	install(FILES
12
+		${CMAKE_CURRENT_SOURCE_DIR}/
13
+	DESTINATION
14
+		share/autovala/cmake
15
+	)
16
+ENDIF()
17
+

+ 80
- 0
autovala/cmake/FindVala.cmake View File

@@ -0,0 +1,80 @@
1
+##
2
+# Copyright 2009-2010 Jakob Westhoff, 2014 Raster Software Vigo
3
+# All rights reserved.
4
+# 
5
+# Redistribution and use in source and binary forms, with or without
6
+# modification, are permitted provided that the following conditions are met:
7
+# 
8
+#    1. Redistributions of source code must retain the above copyright notice,
9
+#       this list of conditions and the following disclaimer.
10
+# 
11
+#    2. Redistributions in binary form must reproduce the above copyright notice,
12
+#       this list of conditions and the following disclaimer in the documentation
13
+#       and/or other materials provided with the distribution.
14
+# 
15
+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
16
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18
+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+# 
26
+# The views and conclusions contained in the software and documentation are those
27
+# of the authors and should not be interpreted as representing official policies,
28
+# either expressed or implied, of Jakob Westhoff
29
+##
30
+
31
+##
32
+# Find module for the Vala compiler (valac)
33
+#
34
+# This module determines wheter a Vala compiler is installed on the current
35
+# system and where its executable is.
36
+#
37
+# Call the module using "find_package(Vala) from within your CMakeLists.txt.
38
+#
39
+# The following variables will be set after an invocation:
40
+#
41
+#  VALA_FOUND       Whether the vala compiler has been found or not
42
+#  VALA_EXECUTABLE  Full path to the valac executable if it has been found
43
+#  VALA_VERSION     Version number of the available valac
44
+##
45
+
46
+
47
+# Search for the valac executable in the usual system paths.
48
+find_program(VALA_EXECUTABLE NAMES valac)
49
+
50
+if (VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")
51
+
52
+# if valac executable is not found, it can be that valac is not installed, or
53
+# that the OS is source-based (like gentoo), and doesn't do a link from
54
+# valac-X.YY to valac. In that case, search for the specific valac binary after
55
+
56
+	if (NOT VALA_DEFERRING_COMPILER_SEARCH)
57
+		message (STATUS "VALAC not found. Deferring compiler search")
58
+	endif(NOT VALA_DEFERRING_COMPILER_SEARCH)
59
+	set(VALA_DEFERRING_COMPILER_SEARCH TRUE)
60
+	unset(VALA_EXECUTABLE)
61
+	unset(VALA_VERSION)
62
+
63
+else(VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")
64
+
65
+# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
66
+# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
67
+# VALA_EXECUTABLE is set)
68
+
69
+	include(FindPackageHandleStandardArgs)
70
+	find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE)
71
+
72
+	mark_as_advanced(VALA_EXECUTABLE)
73
+
74
+# Determine the valac version
75
+	if(VALA_FOUND)
76
+	    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
77
+	    string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
78
+	    string(STRIP ${VALA_VERSION} "VALA_VERSION")
79
+	endif(VALA_FOUND)
80
+endif(VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")

+ 20
- 0
autovala/cmake/FindValadoc.cmake View File

@@ -0,0 +1,20 @@
1
+
2
+# Search for the valadocc executable in the usual system paths.
3
+find_program(VALADOC_EXECUTABLE NAMES valadoc)
4
+
5
+# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
6
+# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
7
+# VALA_EXECUTABLE is set)
8
+
9
+include(FindPackageHandleStandardArgs)
10
+find_package_handle_standard_args(Valadoc DEFAULT_MSG VALADOC_EXECUTABLE)
11
+
12
+mark_as_advanced(VALADOC_EXECUTABLE)
13
+
14
+# Determine the valac version
15
+if(VALA_FOUND)
16
+    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" 
17
+                    OUTPUT_VARIABLE "VALA_VERSION")
18
+    string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
19
+    string(STRIP ${VALA_VERSION} "VALA_VERSION")
20
+endif(VALA_FOUND)

+ 34
- 0
autovala/cmake/GObjectIntrospectionMacros.cmake View File

@@ -0,0 +1,34 @@
1
+macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION)
2
+    set(PACKAGES "")
3
+    foreach(PKG ${ARGN})
4
+        set(PACKAGES ${PACKAGES} --include=${PKG})
5
+    endforeach()
6
+    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
7
+    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
8
+            --quiet
9
+            --library ${TARGET_NAME} ${PACKAGES}
10
+            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
11
+            -L${CMAKE_CURRENT_BINARY_DIR}
12
+            --nsversion=${GRANITE_VERSION} ${HEADER})")
13
+    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
14
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
15
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
16
+endmacro()
17
+
18
+macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION)
19
+    set(PACKAGES "")
20
+    foreach(PKG ${ARGN})
21
+        set(PACKAGES ${PACKAGES} --include=${PKG})
22
+    endforeach()
23
+    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
24
+    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
25
+            --quiet
26
+            --library ${TARGET_NAME} --program ${EXE_NAME} ${PACKAGES}
27
+            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
28
+            -L${CMAKE_CURRENT_BINARY_DIR}
29
+            -I${CMAKE_CURRENT_BINARY_DIR}
30
+            --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})")
31
+    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
32
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
33
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
34
+endmacro()

+ 42
- 0
autovala/cmake/GSettings.cmake View File

@@ -0,0 +1,42 @@
1
+# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
2
+
3
+option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON)
4
+
5
+option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL})
6
+
7
+if(GSETTINGS_LOCALINSTALL)
8
+    message(STATUS "GSettings schemas will be installed locally.")
9
+endif()
10
+
11
+if(GSETTINGS_COMPILE)
12
+    message(STATUS "GSettings shemas will be compiled.")
13
+endif()
14
+
15
+macro(add_schema SCHEMA_NAME)
16
+
17
+    set(PKG_CONFIG_EXECUTABLE pkg-config)
18
+    # Have an option to not install the schema into where GLib is
19
+    if (GSETTINGS_LOCALINSTALL)
20
+        SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
21
+    else (GSETTINGS_LOCALINSTALL)
22
+        execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
23
+        SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
24
+    endif (GSETTINGS_LOCALINSTALL)
25
+
26
+    # Run the validator and error if it fails
27
+    execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas  OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
28
+    execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
29
+
30
+    if (_schemas_invalid)
31
+      message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
32
+    endif (_schemas_invalid)
33
+
34
+    # Actually install and recomple schemas
35
+    message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
36
+    install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
37
+
38
+    if (GSETTINGS_COMPILE)
39
+        install (CODE "message (STATUS \"Compiling GSettings schemas\")")
40
+        install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
41
+    endif ()
42
+endmacro()

+ 28
- 0
autovala/cmake/InstallSymlink.cmake View File

@@ -0,0 +1,28 @@
1
+##
2
+# This module with create symlinks during install
3
+##
4
+
5
+macro(install_symlink _filepath _sympath)
6
+    get_filename_component(_symname ${_sympath} NAME)
7
+    get_filename_component(_installdir ${_sympath} PATH)
8
+
9
+    if (BINARY_PACKAGING_MODE)
10
+        execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
11
+                        ${_filepath}
12
+                        ${CMAKE_CURRENT_BINARY_DIR}/${_symname})
13
+        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_symname}
14
+                DESTINATION ${_installdir})
15
+    else ()
16
+        install(CODE "
17
+            if (\"\$ENV{DESTDIR}\" STREQUAL \"\")
18
+                execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
19
+                                ${_filepath}
20
+                                ${_installdir}/${_symname})
21
+            else ()
22
+                execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
23
+                                ${_filepath}
24
+                                \$ENV{DESTDIR}/${_installdir}/${_symname})
25
+            endif ()
26
+        ")
27
+    endif ()
28
+endmacro(install_symlink)

+ 286
- 0
autovala/cmake/Makefile View File

@@ -0,0 +1,286 @@
1
+# CMAKE generated file: DO NOT EDIT!
2
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
3
+
4
+# Default target executed when no arguments are given to make.
5
+default_target: all
6
+.PHONY : default_target
7
+
8
+#=============================================================================
9
+# Special targets provided by cmake.
10
+
11
+# Disable implicit rules so canoncical targets will work.
12
+.SUFFIXES:
13
+
14
+# Remove some rules from gmake that .SUFFIXES does not remove.
15
+SUFFIXES =
16
+
17
+.SUFFIXES: .hpux_make_needs_suffix_list
18
+
19
+# Suppress display of executed commands.
20
+$(VERBOSE).SILENT:
21
+
22
+# A target that is always out of date.
23
+cmake_force:
24
+.PHONY : cmake_force
25
+
26
+#=============================================================================
27
+# Set environment variables for the build.
28
+
29
+# The shell in which to execute make rules.
30
+SHELL = /bin/sh
31
+
32
+# The CMake executable.
33
+CMAKE_COMMAND = /usr/bin/cmake
34
+
35
+# The command to remove a file.
36
+RM = /usr/bin/cmake -E remove -f
37
+
38
+# The top-level source directory on which CMake was run.
39
+CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake
40
+
41
+# The top-level build directory on which CMake was run.
42
+CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake
43
+
44
+#=============================================================================
45
+# Targets provided globally by CMake.
46
+
47
+# Special rule for the target edit_cache
48
+edit_cache:
49
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
50
+	/usr/bin/cmake -i .
51
+.PHONY : edit_cache
52
+
53
+# Special rule for the target edit_cache
54
+edit_cache/fast: edit_cache
55
+.PHONY : edit_cache/fast
56
+
57
+# Special rule for the target install
58
+install: preinstall
59
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
60
+	/usr/bin/cmake -P cmake_install.cmake
61
+.PHONY : install
62
+
63
+# Special rule for the target install
64
+install/fast: preinstall/fast
65
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
66
+	/usr/bin/cmake -P cmake_install.cmake
67
+.PHONY : install/fast
68
+
69
+# Special rule for the target install/local
70
+install/local: preinstall
71
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
72
+	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
73
+.PHONY : install/local
74
+
75
+# Special rule for the target install/local
76
+install/local/fast: install/local
77
+.PHONY : install/local/fast
78
+
79
+# Special rule for the target install/strip
80
+install/strip: preinstall
81
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
82
+	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
83
+.PHONY : install/strip
84
+
85
+# Special rule for the target install/strip
86
+install/strip/fast: install/strip
87
+.PHONY : install/strip/fast
88
+
89
+# Special rule for the target list_install_components
90
+list_install_components:
91
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
92
+.PHONY : list_install_components
93
+
94
+# Special rule for the target list_install_components
95
+list_install_components/fast: list_install_components
96
+.PHONY : list_install_components/fast
97
+
98
+# Special rule for the target rebuild_cache
99
+rebuild_cache:
100
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
101
+	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
102
+.PHONY : rebuild_cache
103
+
104
+# Special rule for the target rebuild_cache
105
+rebuild_cache/fast: rebuild_cache
106
+.PHONY : rebuild_cache/fast
107
+
108
+# The main all target
109
+all: cmake_check_build_system
110
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks
111
+	$(MAKE) -f CMakeFiles/Makefile2 all
112
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0
113
+.PHONY : all
114
+
115
+# The main clean target
116
+clean:
117
+	$(MAKE) -f CMakeFiles/Makefile2 clean
118
+.PHONY : clean
119
+
120
+# The main clean target
121
+clean/fast: clean
122
+.PHONY : clean/fast
123
+
124
+# Prepare targets for installation.
125
+preinstall: all
126
+	$(MAKE) -f CMakeFiles/Makefile2 preinstall
127
+.PHONY : preinstall
128
+
129
+# Prepare targets for installation.
130
+preinstall/fast:
131
+	$(MAKE) -f CMakeFiles/Makefile2 preinstall
132
+.PHONY : preinstall/fast
133
+
134
+# clear depends
135
+depend:
136
+	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
137
+.PHONY : depend
138
+
139
+#=============================================================================
140
+# Target rules for targets named scratch
141
+
142
+# Build rule for target.
143
+scratch: cmake_check_build_system
144
+	$(MAKE) -f CMakeFiles/Makefile2 scratch
145
+.PHONY : scratch
146
+
147
+# fast build rule for target.
148
+scratch/fast:
149
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build
150
+.PHONY : scratch/fast
151
+
152
+src/entry.o: src/entry.c.o
153
+.PHONY : src/entry.o
154
+
155
+# target to build an object file
156
+src/entry.c.o:
157
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o
158
+.PHONY : src/entry.c.o
159
+
160
+src/entry.i: src/entry.c.i
161
+.PHONY : src/entry.i
162
+
163
+# target to preprocess a source file
164
+src/entry.c.i:
165
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i
166
+.PHONY : src/entry.c.i
167
+
168
+src/entry.s: src/entry.c.s
169
+.PHONY : src/entry.s
170
+
171
+# target to generate assembly for a file
172
+src/entry.c.s:
173
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s
174
+.PHONY : src/entry.c.s
175
+
176
+src/main_window.o: src/main_window.c.o
177
+.PHONY : src/main_window.o
178
+
179
+# target to build an object file
180
+src/main_window.c.o:
181
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o
182
+.PHONY : src/main_window.c.o
183
+
184
+src/main_window.i: src/main_window.c.i
185
+.PHONY : src/main_window.i
186
+
187
+# target to preprocess a source file
188
+src/main_window.c.i:
189
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i
190
+.PHONY : src/main_window.c.i
191
+
192
+src/main_window.s: src/main_window.c.s
193
+.PHONY : src/main_window.s
194
+
195
+# target to generate assembly for a file
196
+src/main_window.c.s:
197
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s
198
+.PHONY : src/main_window.c.s
199
+
200
+src/menu.o: src/menu.c.o
201
+.PHONY : src/menu.o
202
+
203
+# target to build an object file
204
+src/menu.c.o:
205
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o
206
+.PHONY : src/menu.c.o
207
+
208
+src/menu.i: src/menu.c.i
209
+.PHONY : src/menu.i
210
+
211
+# target to preprocess a source file
212
+src/menu.c.i:
213
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i
214
+.PHONY : src/menu.c.i
215
+
216
+src/menu.s: src/menu.c.s
217
+.PHONY : src/menu.s
218
+
219
+# target to generate assembly for a file
220
+src/menu.c.s:
221
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s
222
+.PHONY : src/menu.c.s
223
+
224
+src/notebook.o: src/notebook.c.o
225
+.PHONY : src/notebook.o
226
+
227
+# target to build an object file
228
+src/notebook.c.o:
229
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o
230
+.PHONY : src/notebook.c.o
231
+
232
+src/notebook.i: src/notebook.c.i
233
+.PHONY : src/notebook.i
234
+
235
+# target to preprocess a source file
236
+src/notebook.c.i:
237
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i
238
+.PHONY : src/notebook.c.i
239
+
240
+src/notebook.s: src/notebook.c.s
241
+.PHONY : src/notebook.s
242
+
243
+# target to generate assembly for a file
244
+src/notebook.c.s:
245
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s
246
+.PHONY : src/notebook.c.s
247
+
248
+# Help Target
249
+help:
250
+	@echo "The following are some of the valid targets for this Makefile:"
251
+	@echo "... all (the default if no target is provided)"
252
+	@echo "... clean"
253
+	@echo "... depend"
254
+	@echo "... edit_cache"
255
+	@echo "... install"
256
+	@echo "... install/local"
257
+	@echo "... install/strip"
258
+	@echo "... list_install_components"
259
+	@echo "... rebuild_cache"
260
+	@echo "... scratch"
261
+	@echo "... src/entry.o"
262
+	@echo "... src/entry.i"
263
+	@echo "... src/entry.s"
264
+	@echo "... src/main_window.o"
265
+	@echo "... src/main_window.i"
266
+	@echo "... src/main_window.s"
267
+	@echo "... src/menu.o"
268
+	@echo "... src/menu.i"
269
+	@echo "... src/menu.s"
270
+	@echo "... src/notebook.o"
271
+	@echo "... src/notebook.i"
272
+	@echo "... src/notebook.s"
273
+.PHONY : help
274
+
275
+
276
+
277
+#=============================================================================
278
+# Special targets to cleanup operation of make.
279
+
280
+# Special rule to run CMake to check the build system integrity.
281
+# No rule that depends on this can have commands that come from listfiles
282
+# because they might be regenerated.
283
+cmake_check_build_system:
284
+	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
285
+.PHONY : cmake_check_build_system
286
+

+ 36
- 0
autovala/cmake/ParseArguments.cmake View File

@@ -0,0 +1,36 @@
1
+##
2
+# This is a helper Macro to parse optional arguments in Macros/Functions
3
+# It has been taken from the public CMake wiki.  
4
+# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
5
+# licensing.
6
+##
7
+macro(parse_arguments prefix arg_names option_names)
8
+  set(DEFAULT_ARGS)
9
+  foreach(arg_name ${arg_names})
10
+    set(${prefix}_${arg_name})
11
+  endforeach(arg_name)
12
+  foreach(option ${option_names})
13
+    set(${prefix}_${option} FALSE)
14
+  endforeach(option)
15
+
16
+  set(current_arg_name DEFAULT_ARGS)
17
+  set(current_arg_list)
18
+  foreach(arg ${ARGN})
19
+    set(larg_names ${arg_names})
20
+    list(FIND larg_names "${arg}" is_arg_name)
21
+    if(is_arg_name GREATER -1)
22
+      set(${prefix}_${current_arg_name} ${current_arg_list})
23
+      set(current_arg_name ${arg})
24
+      set(current_arg_list)
25
+    else(is_arg_name GREATER -1)
26
+      set(loption_names ${option_names})
27
+      list(FIND loption_names "${arg}" is_option)
28
+      if(is_option GREATER -1)
29
+	    set(${prefix}_${arg} TRUE)
30
+      else(is_option GREATER -1)
31
+	    set(current_arg_list ${current_arg_list} ${arg})
32
+      endif(is_option GREATER -1)
33
+    endif(is_arg_name GREATER -1)
34
+  endforeach(arg)
35
+  set(${prefix}_${current_arg_name} ${current_arg_list})
36
+endmacro(parse_arguments)

+ 10
- 0
autovala/cmake/README View File

@@ -0,0 +1,10 @@
1
+        Elementary CMake modules
2
+
3
+This is a set of CMake modules: Translations, GSettings, and Vala modules.
4
+
5
+For all the Vala related modules see README.Vala.rst: 
6
+    - ParseArguments.cmake
7
+    - ValaPrecompile.cmake
8
+    - ValaVersion.cmake
9
+    - FindVala.cmake
10
+

+ 173
- 0
autovala/cmake/README.Vala.rst View File

@@ -0,0 +1,173 @@
1
+==========
2
+Vala CMake
3
+==========
4
+:Author: 
5
+    Jakob Westhoff
6
+:Version:
7
+    Draft
8
+
9
+
10
+Overview
11
+========
12
+
13
+Vala CMake is a collection of macros for the CMake_ build system to allow the
14
+creation and management of projects developed using the Vala_ programming
15
+language or its "Genie" flavor (less tested).
16
+
17
+
18
+Installation
19
+============
20
+
21
+To use the Vala macros in your own project you need to copy the macro files to
22
+an arbitrary folder in your projects directory and reference them in your
23
+``CMakeLists.txt`` file.
24
+
25
+Assuming the macros are stored under ``cmake/vala`` in your projects folder you
26
+need to add the following information to your base ``CMakeLists.txt``::
27
+
28
+    list(APPEND CMAKE_MODULE_PATH 
29
+        ${CMAKE_SOURCE_DIR}/cmake/vala
30
+    )
31
+
32
+After the new module path as been added you can simply include the provided
33
+modules or use the provided find routines.
34
+
35
+
36
+Finding Vala
37
+============
38
+
39
+The find module for vala works like any other Find module in CMake.
40
+You can use it by simply calling the usual ``find_package`` function. Default
41
+parameters like ``REQUIRED`` and ``QUIETLY`` are supported.
42
+
43
+::
44
+
45
+    find_package(Vala REQUIRED)
46
+
47
+After a successful call to the find_package function the following variables 
48
+will be set:
49
+
50
+VALA_FOUND
51
+    Whether the vala compiler has been found or not
52
+
53
+VALA_EXECUTABLE
54
+    Full path to the valac executable if it has been found
55
+
56
+VALA_VERSION
57
+    Version number of the available valac
58
+
59
+
60
+Precompiling Vala sources
61
+=========================
62
+
63
+CMake is mainly supposed to handle c or c++ based projects. Luckily every vala
64
+program is translated into plain c code using the vala compiler, followed by
65
+normal compilation of the generated c program using gcc.
66
+
67
+The macro ``vala_precompile`` uses that fact to create c files from your .vala
68
+sources for further CMake processing. 
69
+
70
+The first parameter provided is a variable, which will be filled with a list of
71
+c files outputted by the vala compiler. This list can than be used in
72
+conjunction with functions like ``add_executable`` or others to create the
73
+necessary compile rules with CMake.
74
+
75
+The initial variable is followed by a list of .vala files to be compiled.
76
+Please take care to add every vala file belonging to the currently compiled
77
+project or library as Vala will otherwise not be able to resolve all
78
+dependencies.
79
+
80
+The following sections may be specified afterwards to provide certain options
81
+to the vala compiler:
82
+
83
+PACKAGES  
84
+    A list of vala packages/libraries to be used during the compile cycle. The
85
+    package names are exactly the same, as they would be passed to the valac
86
+    "--pkg=" option.
87
+
88
+OPTIONS
89
+    A list of optional options to be passed to the valac executable. This can be
90
+    used to pass "--thread" for example to enable multi-threading support.
91
+
92
+DIRECTORY
93
+    Specify the directory where the output source files will be stored. If 
94
+    ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR.
95
+
96
+CUSTOM_VAPIS
97
+    A list of custom vapi files to be included for compilation. This can be
98
+    useful to include freshly created vala libraries without having to install
99
+    them in the system.
100
+
101
+GENERATE_VAPI
102
+    Pass all the needed flags to the compiler to create an internal vapi for
103
+    the compiled library. The provided name will be used for this and a
104
+    <provided_name>.vapi file will be created.
105
+
106
+GENERATE_HEADER
107
+    Let the compiler generate a header file for the compiled code. There will
108
+    be a header file as well as an internal header file being generated called
109
+    <provided_name>.h and <provided_name>_internal.h
110
+
111
+The following call is a simple example to the vala_precompile macro showing an
112
+example to every of the optional sections::
113
+
114
+    vala_precompile(VALA_C
115
+        source1.vala
116
+        source2.vala
117
+        source3.vala
118
+    PACKAGES
119
+        gtk+-2.0
120
+        gio-1.0
121
+        posix
122
+    OPTIONS
123
+        --thread
124
+    CUSTOM_VAPIS
125
+        some_vapi.vapi
126
+    GENERATE_VAPI
127
+        myvapi
128
+    GENERATE_HEADER
129
+        myheader
130
+    )
131
+
132
+Most important is the variable VALA_C which will contain all the generated c
133
+file names after the call. The easiest way to use this information is to tell
134
+CMake to create an executable out of it.
135
+
136
+::
137
+
138
+    add_executable(myexecutable ${VALA_C})
139
+
140
+
141
+Further reading
142
+===============
143
+
144
+The `Pdf Presenter Console`__ , which is a vala based project of mine, makes
145
+heavy usage of the here described macros.  To look at a real world example of
146
+these macros the mentioned project is the right place to take a look. The svn
147
+trunk of it can be found at::
148
+
149
+	svn://pureenergy.cc/pdf_presenter_console/trunk
150
+
151
+
152
+__ http://westhoffswelt.de/projects/pdf_presenter_console.html
153
+
154
+
155
+Acknowledgments
156
+===============
157
+
158
+Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me
159
+a lot with the initial version of this macros and always answered my mostly
160
+dumb CMake questions.
161
+
162
+.. _CMake: http://cmake.org
163
+.. _Vala: http://live.gnome.org/Vala
164
+.. _Genie: http://live.gnome.org/Genie
165
+
166
+
167
+
168
+..
169
+   Local Variables:
170
+   mode: rst
171
+   fill-column: 79
172
+   End: 
173
+   vim: et syn=rst tw=79

+ 5
- 0
autovala/cmake/Tests.cmake View File

@@ -0,0 +1,5 @@
1
+# Test macros for Marlin, feel free to re-use them.
2
+
3
+macro(add_test_executable EXE_NAME)
4
+    add_test(${EXE_NAME} gtester ${CMAKE_CURRENT_BINARY_DIR}/${EXE_NAME})
5
+endmacro()

+ 66
- 0
autovala/cmake/Translations.cmake View File

@@ -0,0 +1,66 @@
1
+# Translations.cmake, CMake macros written for Marlin, feel free to re-use them
2
+
3
+macro(add_translations_directory NLS_PACKAGE)
4
+    add_custom_target (i18n ALL COMMENT “Building i18n messages.”)
5
+    find_program (MSGFMT_EXECUTABLE msgfmt)
6
+    file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po)
7
+    foreach (PO_INPUT ${PO_FILES})
8
+        get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE)
9
+        set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo)
10
+        add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT})
11
+
12
+        install (FILES ${MO_OUTPUT} DESTINATION
13
+            share/locale/${PO_INPUT_BASE}/LC_MESSAGES
14
+            RENAME ${NLS_PACKAGE}.mo)
15
+    endforeach (PO_INPUT ${PO_FILES})
16
+endmacro(add_translations_directory)
17
+
18
+
19
+macro(add_translations_catalog NLS_PACKAGE)
20
+    add_custom_target (pot COMMENT “Building translation catalog.”)
21
+    find_program (XGETTEXT_EXECUTABLE xgettext)
22
+
23
+    set(C_SOURCE "")
24
+    set(VALA_SOURCE "")
25
+    set(GLADE_SOURCE "")
26
+
27
+    foreach(FILES_INPUT ${ARGN})
28
+        set(BASE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT})
29
+
30
+        file (GLOB_RECURSE SOURCE_FILES ${BASE_DIRECTORY}/*.c)
31
+        foreach(C_FILE ${SOURCE_FILES})
32
+            set(C_SOURCE ${C_SOURCE} ${C_FILE})
33
+        endforeach()
34
+
35
+        file (GLOB_RECURSE SOURCE_FILES ${BASE_DIRECTORY}/*.vala)
36
+        foreach(VALA_C_FILE ${SOURCE_FILES})
37
+            set(VALA_SOURCE ${VALA_SOURCE} ${VALA_C_FILE})
38
+        endforeach()
39
+
40
+        file (GLOB_RECURSE SOURCE_FILES ${BASE_DIRECTORY}/*.ui)
41
+        foreach(GLADE_C_FILE ${SOURCE_FILES})
42
+            set(GLADE_SOURCE ${GLADE_SOURCE} ${GLADE_C_FILE})
43
+        endforeach()
44
+    endforeach()
45
+
46
+    set(BASE_XGETTEXT_COMMAND
47
+        ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE}
48
+        -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot
49
+        --keyword="_" --keyword="N_" --from-code=UTF-8)
50
+
51
+   set(CONTINUE_FLAG "")
52
+
53
+    IF(NOT "${C_SOURCE}" STREQUAL "")
54
+        add_custom_command(TARGET pot COMMAND ${BASE_XGETTEXT_COMMAND} ${C_SOURCE})
55
+        set(CONTINUE_FLAG "-j")
56
+    ENDIF()
57
+
58
+    IF(NOT "${VALA_SOURCE}" STREQUAL "")
59
+        add_custom_command(TARGET pot COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LC\# ${VALA_SOURCE})
60
+        set(CONTINUE_FLAG "-j")
61
+    ENDIF()
62
+
63
+    IF(NOT "${GLADE_SOURCE}" STREQUAL "")
64
+        add_custom_command (TARGET pot COMMAND ${BASE_XGETTEXT_COMMAND} ${CONTINUE_FLAG} -LGlade ${GLADE_SOURCE})
65
+    ENDIF()  
66
+endmacro()

+ 243
- 0
autovala/cmake/ValaPrecompile.cmake View File

@@ -0,0 +1,243 @@
1
+##
2
+# Copyright 2009-2010 Jakob Westhoff. All rights reserved.
3
+# Copyright 2012 elementary.
4
+#
5
+# Redistribution and use in source and binary forms, with or without
6
+# modification, are permitted provided that the following conditions are met:
7
+#
8
+#    1. Redistributions of source code must retain the above copyright notice,
9
+#       this list of conditions and the following disclaimer.
10
+#
11
+#    2. Redistributions in binary form must reproduce the above copyright notice,
12
+#       this list of conditions and the following disclaimer in the documentation
13
+#       and/or other materials provided with the distribution.
14
+#
15
+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
16
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18
+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+#
26
+# The views and conclusions contained in the software and documentation are those
27
+# of the authors and should not be interpreted as representing official policies,
28
+# either expressed or implied, of Jakob Westhoff
29
+##
30
+
31
+include(ParseArguments)
32
+find_package(Vala REQUIRED)
33
+
34
+##
35
+# Compile vala files to their c equivalents for further processing.
36
+#
37
+# The "vala_precompile" macro takes care of calling the valac executable on the
38
+# given source to produce c files which can then be processed further using
39
+# default cmake functions.
40
+#
41
+# The first parameter provided is a variable, which will be filled with a list
42
+# of c files outputted by the vala compiler. This list can than be used in
43
+# conjuction with functions like "add_executable" or others to create the
44
+# neccessary compile rules with CMake.
45
+#
46
+# The initial variable is followed by a list of .vala files to be compiled.
47
+# Please take care to add every vala file belonging to the currently compiled
48
+# project or library as Vala will otherwise not be able to resolve all
49
+# dependencies.
50
+#
51
+# The following sections may be specified afterwards to provide certain options
52
+# to the vala compiler:
53
+#
54
+# PACKAGES
55
+#   A list of vala packages/libraries to be used during the compile cycle. The
56
+#   package names are exactly the same, as they would be passed to the valac
57
+#   "--pkg=" option.
58
+#
59
+# OPTIONS
60
+#   A list of optional options to be passed to the valac executable. This can be
61
+#   used to pass "--thread" for example to enable multi-threading support.
62
+#
63
+# CUSTOM_VAPIS
64
+#   A list of custom vapi files to be included for compilation. This can be
65
+#   useful to include freshly created vala libraries without having to install
66
+#   them in the system.
67
+#
68
+# GENERATE_VAPI
69
+#   Pass all the needed flags to the compiler to create an internal vapi for
70
+#   the compiled library. The provided name will be used for this and a
71
+#   <provided_name>.vapi file will be created.
72
+#
73
+# GENERATE_HEADER
74
+#   Let the compiler generate a header file for the compiled code. There will
75
+#   be a header file as well as an internal header file being generated called
76
+#   <provided_name>.h and <provided_name>_internal.h
77
+#
78
+# GENERATE_GIR
79
+#   Have the compiler generate a GObject-Introspection repository file with
80
+#   name: <provided_name>.gir. This can be later used to create a binary typelib
81
+#   using the GI compiler.
82
+#
83
+# GENERATE_SYMBOLS
84
+#   Output a <provided_name>.symbols file containing all the exported symbols.
85
+#
86
+# The following call is a simple example to the vala_precompile macro showing
87
+# an example to every of the optional sections:
88
+#
89
+#   vala_precompile(VALA_C mytargetname
90
+#       source1.vala
91
+#       source2.vala
92
+#       source3.vala
93
+#   PACKAGES
94
+#       gtk+-2.0
95
+#       gio-1.0
96
+#       posix
97
+#   DIRECTORY
98
+#       gen
99
+#   OPTIONS
100
+#       --thread
101
+#   CUSTOM_VAPIS
102
+#       some_vapi.vapi
103
+#   GENERATE_VAPI
104
+#       myvapi
105
+#   GENERATE_HEADER
106
+#       myheader
107
+#   GENERATE_GIR
108
+#       mygir
109
+#   GENERATE_SYMBOLS
110
+#       mysymbols
111
+#   )
112
+#
113
+# Most important is the variable VALA_C which will contain all the generated c
114
+# file names after the call.
115
+##
116
+
117
+macro(vala_precompile output target_name)
118
+    parse_arguments(ARGS "TARGET;PACKAGES;OPTIONS;DIRECTORY;GENERATE_GIR;GENERATE_SYMBOLS;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN})
119
+
120
+    if(ARGS_DIRECTORY)
121
+        set(DIRECTORY ${ARGS_DIRECTORY})
122
+    else(ARGS_DIRECTORY)
123
+        set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
124
+    endif(ARGS_DIRECTORY)
125
+    include_directories(${DIRECTORY})
126
+    set(vala_pkg_opts "")
127
+    foreach(pkg ${ARGS_PACKAGES})
128
+        list(APPEND vala_pkg_opts "--pkg=${pkg}")
129
+    endforeach(pkg ${ARGS_PACKAGES})
130
+    set(in_files "")
131
+    set(out_files "")
132
+    set(out_files_display "")
133
+    set(${output} "")
134
+
135
+    foreach(src ${ARGS_DEFAULT_ARGS})
136
+        string(REGEX MATCH "^([a-zA-Z]:)?/" IS_MATCHED ${src})
137
+        if(${IS_MATCHED} MATCHES "/")
138
+            set(src_file_path ${src})
139
+        else()
140
+            set(src_file_path ${CMAKE_CURRENT_SOURCE_DIR}/${src})
141
+        endif()
142
+        list(APPEND in_files ${src_file_path})
143
+        string(REPLACE ".vala" ".c" src ${src})
144
+        string(REPLACE ".gs" ".c" src ${src})
145
+        if(${IS_MATCHED} MATCHES "/")
146
+            get_filename_component(VALA_FILE_NAME ${src} NAME)
147
+            set(out_file "${DIRECTORY}/${VALA_FILE_NAME}")
148
+            list(APPEND out_files "${DIRECTORY}/${VALA_FILE_NAME}")
149
+        else()
150
+            set(out_file "${DIRECTORY}/${src}")
151
+            list(APPEND out_files "${DIRECTORY}/${src}")
152
+        endif()
153
+        list(APPEND ${output} ${out_file})
154
+        list(APPEND out_files_display "${src}")
155
+    endforeach(src ${ARGS_DEFAULT_ARGS})
156
+
157
+    set(custom_vapi_arguments "")
158
+    if(ARGS_CUSTOM_VAPIS)
159
+        foreach(vapi ${ARGS_CUSTOM_VAPIS})
160
+            if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
161
+                list(APPEND custom_vapi_arguments ${vapi})
162
+            else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
163
+                list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi})
164
+            endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR})
165
+        endforeach(vapi ${ARGS_CUSTOM_VAPIS})
166
+    endif(ARGS_CUSTOM_VAPIS)
167
+
168
+    set(vapi_arguments "")
169
+    if(ARGS_GENERATE_VAPI)
170
+        list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi")
171
+        list(APPEND out_files_display "${ARGS_GENERATE_VAPI}.vapi")
172
+        set(vapi_arguments "--library=${ARGS_GENERATE_VAPI}" "--vapi=${ARGS_GENERATE_VAPI}.vapi")
173
+
174
+        # Header and internal header is needed to generate internal vapi
175
+        if (NOT ARGS_GENERATE_HEADER)
176
+            set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI})
177
+        endif(NOT ARGS_GENERATE_HEADER)
178
+    endif(ARGS_GENERATE_VAPI)
179
+
180
+    set(header_arguments "")
181
+    if(ARGS_GENERATE_HEADER)
182
+        list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h")
183
+        list(APPEND out_files_display "${ARGS_GENERATE_HEADER}.h")
184
+        list(APPEND header_arguments "--header=${ARGS_GENERATE_HEADER}.h")
185
+    endif(ARGS_GENERATE_HEADER)
186
+
187
+    set(gir_arguments "")
188
+    if(ARGS_GENERATE_GIR)
189
+        list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_GIR}.gir")
190
+        list(APPEND out_files_display "${ARGS_GENERATE_GIR}.gir")
191
+        set(gir_arguments "--gir=${ARGS_GENERATE_GIR}.gir")
192
+    endif(ARGS_GENERATE_GIR)
193
+
194
+    set(symbols_arguments "")
195
+    if(ARGS_GENERATE_SYMBOLS)
196
+        list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_SYMBOLS}.symbols")
197
+        list(APPEND out_files_display "${ARGS_GENERATE_SYMBOLS}.symbols")
198
+        set(symbols_arguments "--symbols=${ARGS_GENERATE_SYMBOLS}.symbols")
199
+    endif(ARGS_GENERATE_SYMBOLS)
200
+
201
+    set(os_defines "")
202
+    if(WIN32)
203
+        list(APPEND os_defines "-D" "\"G_OS_WIN32\"")
204
+    endif(WIN32)
205
+
206
+    # Workaround for a bug that would make valac run twice. This file is written
207
+    # after the vala compiler generates C source code.
208
+    set (extra_name ${extra_name}_ )
209
+    set(OUTPUT_STAMP ${CMAKE_CURRENT_BINARY_DIR}/${target_name}${extra_name}valac.stamp)
210
+
211
+    add_custom_command(
212
+    OUTPUT
213
+        ${OUTPUT_STAMP}
214
+    COMMAND
215
+        ${VALA_EXECUTABLE}
216
+    ARGS
217
+        "-C"
218
+        ${header_arguments}
219
+        ${vapi_arguments}
220
+        ${gir_arguments}
221
+        ${symbols_arguments}
222
+        "-b" ${CMAKE_CURRENT_SOURCE_DIR}
223
+        "-d" ${DIRECTORY}
224
+        ${os_defines}
225
+        ${vala_pkg_opts}
226
+        ${ARGS_OPTIONS}
227
+        ${in_files}
228
+        ${custom_vapi_arguments}
229
+    COMMAND
230
+        touch
231
+    ARGS
232
+        ${OUTPUT_STAMP}
233
+    DEPENDS
234
+        ${in_files}
235
+        ${ARGS_CUSTOM_VAPIS}
236
+    COMMENT
237
+        "Generating ${out_files_display}"
238
+    )
239
+
240
+    # This command will be run twice for some reason (pass a non-empty string to COMMENT
241
+    # in order to see it). Since valac is not executed from here, this won't be a problem.
242
+    add_custom_command(OUTPUT ${out_files} DEPENDS ${OUTPUT_STAMP} COMMENT "")
243
+endmacro(vala_precompile)

+ 153
- 0
autovala/cmake/ValaVersion.cmake View File

@@ -0,0 +1,153 @@
1
+##
2
+# Copyright (C) 2014 Raster Software Vigo
3
+# Autovala is free software: you can redistribute it and/or modify it
4
+# under the terms of the GNU General Public License as published by the
5
+# Free Software Foundation, either version 3 of the License, or
6
+# (at your option) any later version.
7
+#
8
+# Autovala is distributed in the hope that it will be useful, but
9
+# WITHOUT ANY WARRANTY; without even the implied warranty of
10
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
+# See the GNU General Public License for more details.
12
+#
13
+# You should have received a copy of the GNU General Public License along
14
+# with this program.  If not, see <http://www.gnu.org/licenses/>.
15
+#
16
+# Copyright (C) 2013, Valama development team
17
+#
18
+# Copyright 2009-2010 Jakob Westhoff All rights reserved.
19
+# 
20
+# Redistribution and use in source and binary forms, with or without
21
+# modification, are permitted provided that the following conditions are met:
22
+# 
23
+#	1. Redistributions of source code must retain the above copyright notice,
24
+#	   this list of conditions and the following disclaimer.
25
+# 
26
+#	2. Redistributions in binary form must reproduce the above copyright notice,
27
+#	   this list of conditions and the following disclaimer in the documentation
28
+#	   and/or other materials provided with the distribution.
29
+# 
30
+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
31
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
32
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
33
+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
36
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
37
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
38
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
39
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
+# 
41
+# The views and conclusions contained in the software and documentation are those
42
+# of the authors and should not be interpreted as representing official policies,
43
+# either expressed or implied, of Jakob Westhoff
44
+##
45
+
46
+include(ParseArguments)
47
+find_package(Vala REQUIRED)
48
+
49
+##
50
+# Ensure a certain valac version is available
51
+#
52
+# The initial argument is the version to check for
53
+# 
54
+# It may be followed by a optional parameter to specifiy a version range. The
55
+# following options are valid:
56
+# 
57
+# EXACT
58
+#   Vala needs to be available in the exact version given
59
+# 
60
+# MINIMUM
61
+#   The provided version is the minimum version. Therefore Vala needs to be
62
+#   available in the given version or any higher version
63
+#
64
+# MAXIMUM
65
+#   The provided version is the maximum. Therefore Vala needs to be available
66
+#   in the given version or any version older than this
67
+#
68
+# If no option is specified the version will be treated as a minimal version.
69
+##
70
+macro(ensure_vala_version ensure_version)
71
+
72
+	if (USE_VALA_BINARY)
73
+		message(STATUS "Forced use of vala binary ${USE_VALA_BINARY}")
74
+		set(VALA_EXECUTABLE ${USE_VALA_BINARY})
75
+	else (USE_VALA_BINARY)
76
+
77
+		message(STATUS "checking for Vala version of valac-${ensure_version}")
78
+	
79
+		unset(version_accepted)
80
+		execute_process(COMMAND "valac-${ensure_version}" "--version"
81
+			OUTPUT_VARIABLE "VALA_VERSION" OUTPUT_STRIP_TRAILING_WHITESPACE)
82
+		if (NOT VALA_VERSION)
83
+	
84
+			find_program(VALA_EXECUTABLE "valac")
85
+	
86
+			# If the specific version asked for this project is not found,
87
+			# try to use the one pointed by the valac link
88
+	
89
+			parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN})
90
+			set(compare_message "")
91
+			set(error_message "")
92
+			if(ARGS_MINIMUM)
93
+				set(compare_message "a minimum ")
94
+				set(error_message "or greater ")
95
+			elseif(ARGS_MAXIMUM)
96
+				set(compare_message "a maximum ")
97
+				set(error_message "or less ")
98
+			endif(ARGS_MINIMUM)
99
+	
100
+			message(STATUS "checking for ${compare_message}Vala version of ${ensure_version}" )
101
+	
102
+			execute_process(COMMAND ${VALA_EXECUTABLE} "--version"
103
+				OUTPUT_VARIABLE "VALA_VERSION" OUTPUT_STRIP_TRAILING_WHITESPACE)
104
+		else(NOT VALA_VERSION)
105
+			set(VALA_EXECUTABLE "valac-${ensure_version}")
106
+		endif(NOT VALA_VERSION)
107
+
108
+		# this code allows to identify development versions as the right version
109
+		# e.g. 0.19.1 -> 0.20 ; 0.20.1 -> 0.20 ;
110
+		# But this code seems to not be fine 0.24.0.2-2235 -> 0.26
111
+		# Thanks to Yannick Inizan
112
+		string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
113
+		string(STRIP ${VALA_VERSION} "VALA_VERSION")
114
+		string(REPLACE "." ";" VALA_LIST "${VALA_VERSION}")
115
+		list(GET VALA_LIST 0 maj_ver)
116
+		list(GET VALA_LIST 1 min_ver)
117
+		list(GET VALA_LIST 2 rev_ver)
118
+		math(EXPR is_odd "${min_ver} % 2")
119
+		list(LENGTH VALA_LIST len)
120
+		#if((${is_odd} EQUAL 1))
121
+		#	math(EXPR min_ver "${min_ver} + 1")
122
+		#elseif(len GREATER 3)
123
+		#	math(EXPR min_ver "${min_ver} + 2")
124
+		#endif()
125
+
126
+		set(VALA_SVERSION "${maj_ver}.${min_ver}" CACHE INTERNAL "")
127
+
128
+		# MINIMUM is the default if no option is specified
129
+		if(ARGS_EXACT)
130
+			if(${VALA_SVERSION} VERSION_EQUAL ${ensure_version} )
131
+				set(version_accepted TRUE)
132
+			endif(${VALA_SVERSION} VERSION_EQUAL ${ensure_version})
133
+		elseif(ARGS_MAXIMUM)
134
+			if(${VALA_SVERSION} VERSION_LESS ${ensure_version} OR ${VALA_SVERSION} VERSION_EQUAL ${ensure_version})
135
+				set(version_accepted TRUE)
136
+			endif(${VALA_SVERSION} VERSION_LESS ${ensure_version} OR ${VALA_SVERSION} VERSION_EQUAL ${ensure_version})
137
+		else(ARGS_MAXIMUM)
138
+			if(${VALA_SVERSION} VERSION_GREATER ${ensure_version} OR ${VALA_SVERSION} VERSION_EQUAL ${ensure_version})
139
+				set(version_accepted TRUE)
140
+			endif(${VALA_SVERSION} VERSION_GREATER ${ensure_version} OR ${VALA_SVERSION} VERSION_EQUAL ${ensure_version})
141
+		endif(ARGS_EXACT)
142
+	
143
+		if (NOT version_accepted)
144
+			message(FATAL_ERROR 
145
+				"Vala version ${ensure_version} ${error_message}is required."
146
+			)
147
+		endif(NOT version_accepted)
148
+	
149
+		message(STATUS
150
+			"  found Vala, version ${VALA_SVERSION}"
151
+		)
152
+	endif(USE_VALA_BINARY)
153
+endmacro(ensure_vala_version)

+ 38
- 0
autovala/cmake/Valadoc.cmake View File

@@ -0,0 +1,38 @@
1
+include(ParseArguments)
2
+find_package(Valadoc REQUIRED)
3
+
4
+macro(valadoc target outdir)
5
+	parse_arguments(ARGS "PACKAGES;OPTIONS;CUSTOM_VAPIS" "" ${ARGN})
6
+	set(vala_pkg_opts "")
7
+	foreach(pkg ${ARGS_PACKAGES})
8
+		list(APPEND vala_pkg_opts "--pkg=${pkg}")
9
+	endforeach(pkg ${ARGS_PACKAGES})
10
+
11
+	set(vapi_dir_opts "")
12
+	foreach(src ${ARGS_CUSTOM_VAPIS})
13
+		get_filename_component(pkg ${src} NAME_WE)
14
+		list(APPEND vala_pkg_opts "--pkg=${pkg}")
15
+		
16
+		get_filename_component(path ${src} PATH)
17
+		list(APPEND vapi_dir_opts "--vapidir=${path}")
18
+	endforeach(src ${ARGS_DEFAULT_ARGS})
19
+	list(REMOVE_DUPLICATES vapi_dir_opts)
20
+
21
+	add_custom_command(TARGET ${target}
22
+	COMMAND
23
+		${VALADOC_EXECUTABLE}
24
+	ARGS
25
+		"--force"
26
+		"-b" ${CMAKE_CURRENT_SOURCE_DIR}
27
+		"-o" ${outdir}
28
+		"--package-name=${CMAKE_PROJECT_NAME}"
29
+		"--package-version=${PROJECT_VERSION}"
30
+		${vala_pkg_opts}
31
+		${vapi_dir_opts}
32
+		${ARGS_OPTIONS}
33
+		${in_files} 
34
+	DEPENDS
35
+		${in_files}
36
+		${ARGS_CUSTOM_VAPIS}
37
+	)
38
+endmacro(valadoc)

+ 314
- 0
autovala/configure View File

@@ -0,0 +1,314 @@
1
+#!/bin/sh
2
+
3
+# Autotools-style (./configure) wrapper for CMake
4
+# <https://github.com/nemequ/configure-cmake>
5
+#
6
+#   *** IMPORTANT ***
7
+#
8
+#   You must include the GNUInstallDirs module (which comes with
9
+#   CMake) in your project.  Just put "include (GNUInstallDirs)" in
10
+#   you CMakeLists.txt and you should be good.
11
+#
12
+# This script was originally written for Squash
13
+# <https://quixdb.github.io/squash/> by Evan Nemerson
14
+# <evan@nemerson.com>, but has been spun off into a separate
15
+# repository.  Please feel free to copy it into your own repository,
16
+# though I would appreciate it if you would post improvements, bugs,
17
+# feature requests, etc. to the issue tracker at
18
+# <https://github.com/nemequ/configure-cmake/issues>.
19
+#
20
+# To the extent possible under law, the author(s) hereby waive all
21
+# copyright and related or neighboring rights to this work.  For
22
+# details, see <https://creativecommons.org/publicdomain/zero/1.0/>
23
+
24
+TOP_SRCDIR="$(dirname $0)"
25
+CMAKE_CMD="cmake ${TOP_SRCDIR}"
26
+
27
+BUILD_TYPE="Debug"
28
+PREFIX=/usr/local
29
+LIBDIR=
30
+CMAKE_ARGS=
31
+
32
+if [ -e "${TOP_SRCDIR}/.configure-custom.sh" ]; then
33
+    . "${TOP_SRCDIR}/.configure-custom.sh"
34
+fi
35
+
36
+quote() {
37
+    echo "$1" | sed -e "s|'|'\\\\''|g; 1s/^/'/; \$s/\$/'/"
38
+}
39
+
40
+extract_var_string() {
41
+    VAR_NAME=$1
42
+    VAR_NAME=$(echo $1 | sed -e 's/[ \t]*$//')
43
+    if [ "x$2" != "x" ]; then
44
+        VAR_VALUE=$2
45
+    else
46
+        VAR_VALUE=yes
47
+    fi
48
+
49
+    if [ "x$3" != "x" ]; then
50
+        VAR_UC_NAME=$3
51
+    else
52
+        VAR_UC_NAME=$(echo "$1" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_' | sed 's/_$//g')
53
+    fi
54
+}
55
+
56
+set_config_var() {
57
+    is_with=n
58
+    case "$1" in
59
+        "--enable-"*)
60
+            name="${1#--enable-}"
61
+            cfg="${ENABLE_VARS}"
62
+            ;;
63
+        "--disable-"*)
64
+            name="${1#--disable-}";
65
+            cfg="${DISABLE_VARS}";
66
+            ;;
67
+        "--with-"*)
68
+            # IFS="=" read -ra WITHARGS <<< "${1}"
69
+            name="${1#--with-}"
70
+            cfg="${WITH_VARS}"
71
+            is_with=y
72
+            ;;
73
+    esac
74
+
75
+    found=n
76
+    for varstring in $cfg; do
77
+        extract_var_string $(echo "${varstring}" | tr '|' ' ')
78
+        if [ "x$VAR_NAME" = "x$name" ]; then
79
+            found=y
80
+            break;
81
+        fi
82
+    done
83
+
84
+    if [ "$found" = "y" ]; then
85
+        if [ "x$is_with" = "xy" ]; then
86
+            CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "$2")"
87
+        else
88
+            CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "${VAR_VALUE}")"
89
+        fi
90
+    else
91
+        echo "Unknown parameter: ${1}"
92
+        exit 1
93
+    fi
94
+}
95
+
96
+prefix_to_offset() {
97
+    expr $(echo "${1}" | awk '{ print length }') + 1
98
+}
99
+
100
+print_help() {
101
+    cat <<EOF >&2
102
+  -h, --help              display this help and exit
103
+  --disable-debug         disable debugging mode
104
+  --pass-thru             pass remaining arguments through to CMake
105
+  --prefix=PREFIX         install architecture-independent files in PREFIX
106
+                          [$PREFIX]
107
+  --bindir=DIR            user executables [PREFIX/bin]
108
+  --sbindir=DIR           system admin executables [PREFIX/sbin]
109
+  --libexecdir=DIR        program executables [PREFIX/libexec]
110
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
111
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
112
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
113
+  --libdir=DIR            object code libraries [PREFIX/lib]
114
+  --includedir=DIR        C header files [PREFIX/include]
115
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
116
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
117
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
118
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
119
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
120
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
121
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/PROJECT_NAME]
122
+EOF
123
+
124
+    first=y
125
+    for varstring in ${ENABLE_VARS}; do
126
+        if [ $first = 'y' ]; then
127
+            echo ""
128
+            first=n
129
+        fi
130
+        extract_var_string $(echo "${varstring}" | tr '|' ' ')
131
+        var_doc_name="ENABLE_${VAR_UC_NAME}_DOC"
132
+        eval "docstring=\$$var_doc_name"
133
+        if [ "x${docstring}" = "x" ]; then
134
+            printf "  --enable-%-14s enable %s support\n" "${VAR_NAME}" "$(echo -n "${VAR_NAME}" | tr '-' ' ')"
135
+        else
136
+            printf "  --enable-%-14s %s\n" "${VAR_NAME}" "$docstring"
137
+        fi
138
+    done
139
+
140
+    first=y
141
+    for varstring in ${DISABLE_VARS}; do
142
+        if [ $first = 'y' ]; then
143
+            echo ""
144
+            first=n
145
+        fi
146
+        extract_var_string $(echo "${varstring}" | tr '|' ' ')
147
+        var_doc_name="DISABLE_${VAR_UC_NAME}_DOC"
148
+        eval "docstring=\$$var_doc_name"
149
+        if [ "x${docstring}" = "x" ]; then
150
+            printf "  --disable-%-13s disable %s support\n" "${VAR_NAME}" "$(echo -n "${VAR_NAME}" | tr '-' ' ')"
151
+        else
152
+            printf "  --disable-%-13s %s\n" "${VAR_NAME}" "$docstring"
153
+        fi
154
+    done
155
+
156
+    first=y
157
+    for varstring in ${WITH_VARS}; do
158
+        if [ $first = 'y' ]; then
159
+            echo ""
160
+            first=n
161
+        fi
162
+        extract_var_string $(echo "${varstring}" | tr '|' ' ')
163
+        var_doc_name="WITH_${VAR_UC_NAME}_DOC"
164
+        eval "docstring=\$$var_doc_name"
165
+        paraminfo="${VAR_NAME}=${VAR_VALUE}"
166
+        if [ "x${docstring}" = "x" ]; then
167
+            printf "  --with-%-16s enable %s support\n" "$paraminfo" "$(echo -n "${VAR_NAME}" | tr '-' ' ')"
168
+        else
169
+            printf "  --with-%-16s %s\n" "$paraminfo" "$docstring"
170
+        fi
171
+    done
172
+
173
+    exit 0
174
+}
175
+
176
+while [ $# != 0 ]; do
177
+    case "$1" in
178
+        "--prefix="*)
179
+            PREFIX="${1#*=}";;
180
+        "--prefix")
181
+            PREFIX="${2}"; shift;;
182
+        "--bindir="*)
183
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_BINDIR=$(quote "${1#*=}")";;
184
+        "--bindir")
185
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_BINDIR=$(quote "$2")"; shift;;
186
+        "--sbindir="*)
187
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SBINDIR=$(quote "${1#*=}")";;
188
+        "--sbindir")
189
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SBINDIR=$(quote "$2")"; shift;;
190
+        "--libexecdir="*)
191
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LIBEXECDIR=$(quote "${1#*=}")";;
192
+        "--libexecdir")
193
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LIBEXECDIR=$(quote "$2")"; shift;;
194
+        "--sysconfdir="*)
195
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SYSCONFDIR=$(quote "${1#*=}")";;
196
+        "--sysconfdir")
197
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SYSCONFDIR=$(quote "$2")"; shift;;
198
+        "--sharedstatedir="*)
199
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SHAREDSTATEDIR=$(quote "${1#*=}")";;
200
+        "--sharedstatedir")
201
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_SHAREDSTATEDIR=$(quote "$2")"; shift;;
202
+        "--localstatedir="*)
203
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALSTATEDIR=$(quote "${1#*=}")";;
204
+        "--localstatedir")
205
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALSTATEDIR=$(quote "$2")"; shift;;
206
+        "--libdir="*)
207
+            LIBDIR="${1#*=}";;
208
+        "--libdir")
209
+            LIBDIR="${2}"; shift;;
210
+        "--includedir="*)
211
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INCLUDEDIR=$(quote "${1#*=}")";;
212
+        "--includedir")
213
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INCLUDEDIR=$(quote "$2")"; shift;;
214
+        "--oldincludedir="*)
215
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_OLDINCLUDEDIR=$(quote "${1#*=}")";;
216
+        "--oldincludedir")
217
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_OLDINCLUDEDIR=$(quote "$2")"; shift;;
218
+        "--datarootdir="*)
219
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATAROOTDIR=$(quote "${1#*=}")";;
220
+        "--datarootdir")
221
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATAROOTDIR=$(quote "$2")"; shift;;
222
+        "--datadir="*)
223
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATADIR=$(quote "${1#*=}")";;
224
+        "--datadir")
225
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DATADIR=$(quote "$2")"; shift;;
226
+        "--infodir="*)
227
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INFODIR=$(quote "${1#*=}")";;
228
+        "--infodir")
229
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_INFODIR=$(quote "$2")"; shift;;
230
+        "--localedir="*)
231
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALEDIR=$(quote "${1#*=}")";;
232
+        "--localedir")
233
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_LOCALEDIR=$(quote "$2")"; shift;;
234
+        "--mandir="*)
235
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_MANDIR=$(quote "${1#*=}")";;
236
+        "--mandir")
237
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_MANDIR=$(quote "$2")"; shift;;
238
+        "--docdir="*)
239
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DOCDIR=$(quote "${1#*=}")";;
240
+        "--docdir")
241
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DOCDIR=$(quote "$2")"; shift;;
242
+
243
+        "CC="*)
244
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_COMPILER=$(quote "${1#*=}")";;
245
+        "CXX="*)
246
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_COMPILER=$(quote "${1#*=}")";;
247
+        "CFLAGS="*)
248
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_FLAGS=$(quote "${1#*=}")";;
249
+        "CXXFLAGS="*)
250
+            CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_FLAGS=$(quote "${1#*=}")";;
251
+        "LDFLAGS="*)
252
+            LDFLAGS="$LDFLAGS ${1#*=}";;
253
+
254
+        "--help")
255
+            print_help;;
256
+        "-h")
257
+            print_help;;
258
+
259
+        # This flag is the only one which may be a bit surprising to
260
+        # people.  Autotools always builds with debugging symbols enabled
261
+        # (AFAIK), but for cmake you have to do -DCMAKE_BUILD_TYPE=Debug.
262
+        # Unfortunately this can change other things as well, so although
263
+        # I realize there is no --disable-debug flag I thought it would be
264
+        # prudent to support one here.
265
+        "--disable-debug")
266
+            BUILD_TYPE="Release";;
267
+
268
+        "--pass-thru")
269
+            shift;
270
+            while [ $# != 0 ]; do
271
+                CMAKE_ARGS="$CMAKE_ARGS $(quote "${1}")";
272
+                shift;
273
+            done;;
274
+
275
+        "--enable-"*)
276
+            set_config_var "$1"
277
+            ;;
278
+
279
+        "--disable-"*)
280
+            set_config_var "$1"
281
+            ;;
282
+
283
+        "--with-"*)
284
+            name=$(echo "${1#--with-}" | awk '{split($1,v,"="); print v[1]}')
285
+            case "${1}" in
286
+                "--with-${name}="*)
287
+                    set_config_var "--with-${name}" "${1#--with-${name}=}";;
288
+                "--with-${name}")
289
+                    set_config_var "$1" "$2";
290
+                    shift;;
291
+            esac
292
+            ;;
293
+
294
+        *)
295
+            echo "$0: error: unrecognized option: \`$1'" >&2
296
+            echo "Try \`$0 --help' for more information" >&2
297
+            exit -1
298
+    esac;
299
+    shift
300
+done
301
+
302
+if [ "x${LIBDIR}" = "x" ]; then
303
+    LIBDIR="${PREFIX}/lib"
304
+fi
305
+
306
+# Unlike CFLAGS/CXXFLAGS/CC/CXX, LDFLAGS isn't handled by CMake, so we
307
+# need to parse it here.
308
+if [ "x${LDFLAGS}" != "x" ]; then
309
+    for varname in EXE MODULE SHARED STATIC; do
310
+        CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_${varname}_LINKER_FLAGS=$(quote "$LDFLAGS")"
311
+    done
312
+fi
313
+
314
+eval "cmake ${TOP_SRCDIR} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_LIBDIR=${LIBDIR} ${CMAKE_ARGS}"

+ 6
- 0
autovala/configure-custom.sh View File

@@ -0,0 +1,6 @@
1
+#!/bin/bash
2
+
3
+ENABLE_VARS="kde-tray|ON|KDE_TRAY"
4
+ENABLE_KDE_TRAY_DOC="build with kde tray and appindicator instead of gtk3 tray"
5
+DISABLE_VARS="aur|ON|DISABLE_AUR"
6
+DISABLE_DISABLE_AUR_DOC="disable the AUR in pamac"

+ 17
- 0
cmake/CMakeLists.txt View File

@@ -0,0 +1,17 @@
1
+### CMakeLists automatically created with AutoVala
2
+### Do not edit
3
+
4
+IF(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/)
5
+	install(DIRECTORY
6
+		${CMAKE_CURRENT_SOURCE_DIR}/
7
+	DESTINATION
8
+		share/autovala/cmake
9
+	)
10
+ELSE()
11
+	install(FILES
12
+		${CMAKE_CURRENT_SOURCE_DIR}/
13
+	DESTINATION
14
+		share/autovala/cmake
15
+	)
16
+ENDIF()
17
+

+ 80
- 0
cmake/FindVala.cmake View File

@@ -0,0 +1,80 @@
1
+##
2
+# Copyright 2009-2010 Jakob Westhoff, 2014 Raster Software Vigo
3
+# All rights reserved.
4
+# 
5
+# Redistribution and use in source and binary forms, with or without
6
+# modification, are permitted provided that the following conditions are met:
7
+# 
8
+#    1. Redistributions of source code must retain the above copyright notice,
9
+#       this list of conditions and the following disclaimer.
10
+# 
11
+#    2. Redistributions in binary form must reproduce the above copyright notice,
12
+#       this list of conditions and the following disclaimer in the documentation
13
+#       and/or other materials provided with the distribution.
14
+# 
15
+# THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR
16
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
17
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
18
+# EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
19
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
21
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
22
+# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
23
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
+# 
26
+# The views and conclusions contained in the software and documentation are those
27
+# of the authors and should not be interpreted as representing official policies,
28
+# either expressed or implied, of Jakob Westhoff
29
+##
30
+
31
+##
32
+# Find module for the Vala compiler (valac)
33
+#
34
+# This module determines wheter a Vala compiler is installed on the current
35
+# system and where its executable is.
36
+#
37
+# Call the module using "find_package(Vala) from within your CMakeLists.txt.
38
+#
39
+# The following variables will be set after an invocation:
40
+#
41
+#  VALA_FOUND       Whether the vala compiler has been found or not
42
+#  VALA_EXECUTABLE  Full path to the valac executable if it has been found
43
+#  VALA_VERSION     Version number of the available valac
44
+##
45
+
46
+
47
+# Search for the valac executable in the usual system paths.
48
+find_program(VALA_EXECUTABLE NAMES valac)
49
+
50
+if (VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")
51
+
52
+# if valac executable is not found, it can be that valac is not installed, or
53
+# that the OS is source-based (like gentoo), and doesn't do a link from
54
+# valac-X.YY to valac. In that case, search for the specific valac binary after
55
+
56
+	if (NOT VALA_DEFERRING_COMPILER_SEARCH)
57
+		message (STATUS "VALAC not found. Deferring compiler search")
58
+	endif(NOT VALA_DEFERRING_COMPILER_SEARCH)
59
+	set(VALA_DEFERRING_COMPILER_SEARCH TRUE)
60
+	unset(VALA_EXECUTABLE)
61
+	unset(VALA_VERSION)
62
+
63
+else(VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")
64
+
65
+# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
66
+# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
67
+# VALA_EXECUTABLE is set)
68
+
69
+	include(FindPackageHandleStandardArgs)
70
+	find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE)
71
+
72
+	mark_as_advanced(VALA_EXECUTABLE)
73
+
74
+# Determine the valac version
75
+	if(VALA_FOUND)
76
+	    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION")
77
+	    string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
78
+	    string(STRIP ${VALA_VERSION} "VALA_VERSION")
79
+	endif(VALA_FOUND)
80
+endif(VALA_EXECUTABLE STREQUAL "VALA_EXECUTABLE-NOTFOUND")

+ 20
- 0
cmake/FindValadoc.cmake View File

@@ -0,0 +1,20 @@
1
+
2
+# Search for the valadocc executable in the usual system paths.
3
+find_program(VALADOC_EXECUTABLE NAMES valadoc)
4
+
5
+# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call.
6
+# Furthermore set VALA_FOUND to TRUE if Vala has been found (aka.
7
+# VALA_EXECUTABLE is set)
8
+
9
+include(FindPackageHandleStandardArgs)
10
+find_package_handle_standard_args(Valadoc DEFAULT_MSG VALADOC_EXECUTABLE)
11
+
12
+mark_as_advanced(VALADOC_EXECUTABLE)
13
+
14
+# Determine the valac version
15
+if(VALA_FOUND)
16
+    execute_process(COMMAND ${VALA_EXECUTABLE} "--version" 
17
+                    OUTPUT_VARIABLE "VALA_VERSION")
18
+    string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION})
19
+    string(STRIP ${VALA_VERSION} "VALA_VERSION")
20
+endif(VALA_FOUND)

+ 34
- 0
cmake/GObjectIntrospectionMacros.cmake View File

@@ -0,0 +1,34 @@
1
+macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION)
2
+    set(PACKAGES "")
3
+    foreach(PKG ${ARGN})
4
+        set(PACKAGES ${PACKAGES} --include=${PKG})
5
+    endforeach()
6
+    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
7
+    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
8
+            --quiet
9
+            --library ${TARGET_NAME} ${PACKAGES}
10
+            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
11
+            -L${CMAKE_CURRENT_BINARY_DIR}
12
+            --nsversion=${GRANITE_VERSION} ${HEADER})")
13
+    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
14
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
15
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
16
+endmacro()
17
+
18
+macro(add_target_gir_with_executable TARGET_NAME EXE_NAME GIR_NAME HEADER EXE_HEADER CFLAGS GRANITE_VERSION)
19
+    set(PACKAGES "")
20
+    foreach(PKG ${ARGN})
21
+        set(PACKAGES ${PACKAGES} --include=${PKG})
22
+    endforeach()
23
+    install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\")
24
+    execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME}
25
+            --quiet
26
+            --library ${TARGET_NAME} --program ${EXE_NAME} ${PACKAGES}
27
+            -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir
28
+            -L${CMAKE_CURRENT_BINARY_DIR}
29
+            -I${CMAKE_CURRENT_BINARY_DIR}
30
+            --nsversion=${GRANITE_VERSION} ${HEADER} ${EXE_HEADER})")
31
+    install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)")
32
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/)
33
+    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/)
34
+endmacro()

+ 42
- 0
cmake/GSettings.cmake View File

@@ -0,0 +1,42 @@
1
+# GSettings.cmake, CMake macros written for Marlin, feel free to re-use them.
2
+
3
+option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON)
4
+
5
+option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL})
6
+
7
+if(GSETTINGS_LOCALINSTALL)
8
+    message(STATUS "GSettings schemas will be installed locally.")
9
+endif()
10
+
11
+if(GSETTINGS_COMPILE)
12
+    message(STATUS "GSettings shemas will be compiled.")
13
+endif()
14
+
15
+macro(add_schema SCHEMA_NAME)
16
+
17
+    set(PKG_CONFIG_EXECUTABLE pkg-config)
18
+    # Have an option to not install the schema into where GLib is
19
+    if (GSETTINGS_LOCALINSTALL)
20
+        SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/")
21
+    else (GSETTINGS_LOCALINSTALL)
22
+        execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
23
+        SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/")
24
+    endif (GSETTINGS_LOCALINSTALL)
25
+
26
+    # Run the validator and error if it fails
27
+    execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas  OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE)
28
+    execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE)
29
+
30
+    if (_schemas_invalid)
31
+      message (SEND_ERROR "Schema validation error: ${_schemas_invalid}")
32
+    endif (_schemas_invalid)
33
+
34
+    # Actually install and recomple schemas
35
+    message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}")
36
+    install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL)
37
+
38
+    if (GSETTINGS_COMPILE)
39
+        install (CODE "message (STATUS \"Compiling GSettings schemas\")")
40
+        install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})")
41
+    endif ()
42
+endmacro()

+ 28
- 0
cmake/InstallSymlink.cmake View File

@@ -0,0 +1,28 @@
1
+##
2
+# This module with create symlinks during install
3
+##
4
+
5
+macro(install_symlink _filepath _sympath)
6
+    get_filename_component(_symname ${_sympath} NAME)
7
+    get_filename_component(_installdir ${_sympath} PATH)
8
+
9
+    if (BINARY_PACKAGING_MODE)
10
+        execute_process(COMMAND "${CMAKE_COMMAND}" -E create_symlink
11
+                        ${_filepath}
12
+                        ${CMAKE_CURRENT_BINARY_DIR}/${_symname})
13
+        install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${_symname}
14
+                DESTINATION ${_installdir})
15
+    else ()
16
+        install(CODE "
17
+            if (\"\$ENV{DESTDIR}\" STREQUAL \"\")
18
+                execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
19
+                                ${_filepath}
20
+                                ${_installdir}/${_symname})
21
+            else ()
22
+                execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink
23
+                                ${_filepath}
24
+                                \$ENV{DESTDIR}/${_installdir}/${_symname})
25
+            endif ()
26
+        ")
27
+    endif ()
28
+endmacro(install_symlink)

+ 286
- 0
cmake/Makefile View File

@@ -0,0 +1,286 @@
1
+# CMAKE generated file: DO NOT EDIT!
2
+# Generated by "Unix Makefiles" Generator, CMake Version 2.8
3
+
4
+# Default target executed when no arguments are given to make.
5
+default_target: all
6
+.PHONY : default_target
7
+
8
+#=============================================================================
9
+# Special targets provided by cmake.
10
+
11
+# Disable implicit rules so canoncical targets will work.
12
+.SUFFIXES:
13
+
14
+# Remove some rules from gmake that .SUFFIXES does not remove.
15
+SUFFIXES =
16
+
17
+.SUFFIXES: .hpux_make_needs_suffix_list
18
+
19
+# Suppress display of executed commands.
20
+$(VERBOSE).SILENT:
21
+
22
+# A target that is always out of date.
23
+cmake_force:
24
+.PHONY : cmake_force
25
+
26
+#=============================================================================
27
+# Set environment variables for the build.
28
+
29
+# The shell in which to execute make rules.
30
+SHELL = /bin/sh
31
+
32
+# The CMake executable.
33
+CMAKE_COMMAND = /usr/bin/cmake
34
+
35
+# The command to remove a file.
36
+RM = /usr/bin/cmake -E remove -f
37
+
38
+# The top-level source directory on which CMake was run.
39
+CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake
40
+
41
+# The top-level build directory on which CMake was run.
42
+CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake
43
+
44
+#=============================================================================
45
+# Targets provided globally by CMake.
46
+
47
+# Special rule for the target edit_cache
48
+edit_cache:
49
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
50
+	/usr/bin/cmake -i .
51
+.PHONY : edit_cache
52
+
53
+# Special rule for the target edit_cache
54
+edit_cache/fast: edit_cache
55
+.PHONY : edit_cache/fast
56
+
57
+# Special rule for the target install
58
+install: preinstall
59
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
60
+	/usr/bin/cmake -P cmake_install.cmake
61
+.PHONY : install
62
+
63
+# Special rule for the target install
64
+install/fast: preinstall/fast
65
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
66
+	/usr/bin/cmake -P cmake_install.cmake
67
+.PHONY : install/fast
68
+
69
+# Special rule for the target install/local
70
+install/local: preinstall
71
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
72
+	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
73
+.PHONY : install/local
74
+
75
+# Special rule for the target install/local
76
+install/local/fast: install/local
77
+.PHONY : install/local/fast
78
+
79
+# Special rule for the target install/strip
80
+install/strip: preinstall
81
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
82
+	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
83
+.PHONY : install/strip
84
+
85
+# Special rule for the target install/strip
86
+install/strip/fast: install/strip
87
+.PHONY : install/strip/fast
88
+
89
+# Special rule for the target list_install_components
90
+list_install_components:
91
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
92
+.PHONY : list_install_components
93
+
94
+# Special rule for the target list_install_components
95
+list_install_components/fast: list_install_components
96
+.PHONY : list_install_components/fast
97
+
98
+# Special rule for the target rebuild_cache
99
+rebuild_cache:
100
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
101
+	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
102
+.PHONY : rebuild_cache
103
+
104
+# Special rule for the target rebuild_cache
105
+rebuild_cache/fast: rebuild_cache
106
+.PHONY : rebuild_cache/fast
107
+
108
+# The main all target
109
+all: cmake_check_build_system
110
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks
111
+	$(MAKE) -f CMakeFiles/Makefile2 all
112
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0
113
+.PHONY : all
114
+
115
+# The main clean target
116
+clean:
117
+	$(MAKE) -f CMakeFiles/Makefile2 clean
118
+.PHONY : clean
119
+
120
+# The main clean target
121
+clean/fast: clean
122
+.PHONY : clean/fast
123
+
124
+# Prepare targets for installation.
125
+preinstall: all
126
+	$(MAKE) -f CMakeFiles/Makefile2 preinstall
127
+.PHONY : preinstall
128
+
129
+# Prepare targets for installation.
130
+preinstall/fast:
131
+	$(MAKE) -f CMakeFiles/Makefile2 preinstall
132
+.PHONY : preinstall/fast
133
+
134
+# clear depends
135
+depend:
136
+	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
137
+.PHONY : depend
138
+
139
+#=============================================================================
140
+# Target rules for targets named scratch
141
+
142
+# Build rule for target.
143
+scratch: cmake_check_build_system
144
+	$(MAKE) -f CMakeFiles/Makefile2 scratch
145
+.PHONY : scratch
146
+
147
+# fast build rule for target.
148
+scratch/fast:
149
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build
150
+.PHONY : scratch/fast
151
+
152
+src/entry.o: src/entry.c.o
153
+.PHONY : src/entry.o
154
+
155
+# target to build an object file
156
+src/entry.c.o:
157
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o
158
+.PHONY : src/entry.c.o
159
+
160
+src/entry.i: src/entry.c.i
161
+.PHONY : src/entry.i
162
+
163
+# target to preprocess a source file
164
+src/entry.c.i:
165
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i
166
+.PHONY : src/entry.c.i
167
+
168
+src/entry.s: src/entry.c.s
169
+.PHONY : src/entry.s
170
+
171
+# target to generate assembly for a file
172
+src/entry.c.s:
173
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s
174
+.PHONY : src/entry.c.s
175
+
176
+src/main_window.o: src/main_window.c.o
177
+.PHONY : src/main_window.o
178
+
179
+# target to build an object file
180
+src/main_window.c.o:
181
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o
182
+.PHONY : src/main_window.c.o
183
+
184
+src/main_window.i: src/main_window.c.i
185
+.PHONY : src/main_window.i
186
+
187
+# target to preprocess a source file
188
+src/main_window.c.i:
189
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i
190
+.PHONY : src/main_window.c.i
191
+
192
+src/main_window.s: src/main_window.c.s
193
+.PHONY : src/main_window.s
194
+
195
+# target to generate assembly for a file
196
+src/main_window.c.s:
197
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s
198
+.PHONY : src/main_window.c.s
199
+
200
+src/menu.o: src/menu.c.o
201
+.PHONY : src/menu.o
202
+
203
+# target to build an object file
204
+src/menu.c.o:
205
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o
206
+.PHONY : src/menu.c.o
207
+
208
+src/menu.i: src/menu.c.i
209
+.PHONY : src/menu.i
210
+
211
+# target to preprocess a source file
212
+src/menu.c.i:
213
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i
214
+.PHONY : src/menu.c.i
215
+
216
+src/menu.s: src/menu.c.s
217
+.PHONY : src/menu.s
218
+
219
+# target to generate assembly for a file
220
+src/menu.c.s:
221
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s
222
+.PHONY : src/menu.c.s
223
+
224
+src/notebook.o: src/notebook.c.o
225
+.PHONY : src/notebook.o
226
+
227
+# target to build an object file
228
+src/notebook.c.o:
229
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o
230
+.PHONY : src/notebook.c.o
231
+
232
+src/notebook.i: src/notebook.c.i
233
+.PHONY : src/notebook.i
234
+
235
+# target to preprocess a source file
236
+src/notebook.c.i:
237
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i
238
+.PHONY : src/notebook.c.i
239
+
240
+src/notebook.s: src/notebook.c.s
241
+.PHONY : src/notebook.s
242
+
243
+# target to generate assembly for a file
244
+src/notebook.c.s:
245
+	$(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s
246
+.PHONY : src/notebook.c.s
247
+
248
+# Help Target
249
+help:
250
+	@echo "The following are some of the valid targets for this Makefile:"
251
+	@echo "... all (the default if no target is provided)"
252
+	@echo "... clean"
253
+	@echo "... depend"
254
+	@echo "... edit_cache"
255
+	@echo "... install"
256
+	@echo "... install/local"
257
+	@echo "... install/strip"
258
+	@echo "... list_install_components"
259
+	@echo "... rebuild_cache"
260
+	@echo "... scratch"
261
+	@echo "... src/entry.o"
262
+	@echo "... src/entry.i"
263
+	@echo "... src/entry.s"
264
+	@echo "... src/main_window.o"
265
+	@echo "... src/main_window.i"
266
+	@echo "... src/main_window.s"
267
+	@echo "... src/menu.o"
268
+	@echo "... src/menu.i"
269
+	@echo "... src/menu.s"
270
+	@echo "... src/notebook.o"
271
+	@echo "... src/notebook.i"
272
+	@echo "... src/notebook.s"
273
+.PHONY : help
274
+
275
+
276
+
277
+#=============================================================================
278
+# Special targets to cleanup operation of make.
279
+
280
+# Special rule to run CMake to check the build system integrity.
281
+# No rule that depends on this can have commands that come from listfiles
282
+# because they might be regenerated.
283
+cmake_check_build_system:
284
+	$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
285
+.PHONY : cmake_check_build_system
286
+

+ 36
- 0
cmake/ParseArguments.cmake View File

@@ -0,0 +1,36 @@
1
+##
2
+# This is a helper Macro to parse optional arguments in Macros/Functions
3
+# It has been taken from the public CMake wiki.  
4
+# See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and
5
+# licensing.
6
+##
7
+macro(parse_arguments prefix arg_names option_names)
8
+  set(DEFAULT_ARGS)
9
+  foreach(arg_name ${arg_names})
10
+    set(${prefix}_${arg_name})
11
+  endforeach(arg_name)
12
+  foreach(option ${option_names})
13
+    set(${prefix}_${option} FALSE)
14
+  endforeach(option)
15
+
16
+  set(current_arg_name DEFAULT_ARGS)
17
+  set(current_arg_list)
18
+  foreach(arg ${ARGN})
19
+    set(larg_names ${arg_names})
20
+    list(FIND larg_names "${arg}" is_arg_name)
21
+    if(is_arg_name GREATER -1)
22
+      set(${prefix}_${current_arg_name} ${current_arg_list})
23
+      set(current_arg_name ${arg})
24
+      set(current_arg_list)
25
+    else(is_arg_name GREATER -1)
26
+      set(loption_names ${option_names})
27
+      list(FIND loption_names "${arg}" is_option)
28
+      if(is_option GREATER -1)
29
+	    set(${prefix}_${arg} TRUE)
30
+      else(is_option GREATER -1)
31
+	    set(current_arg_list ${current_arg_list} ${arg})
32
+      endif(is_option GREATER -1)
33
+    endif(is_arg_name GREATER -1)
34
+  endforeach(arg)
35
+  set(${prefix}_${current_arg_name} ${current_arg_list})
36
+endmacro(parse_arguments)

+ 10
- 0
cmake/README View File

@@ -0,0 +1,10 @@
1
+        Elementary CMake modules
2
+
3
+This is a set of CMake modules: Translations, GSettings, and Vala modules.
4
+
5
+For all the Vala related modules see README.Vala.rst: 
6
+    - ParseArguments.cmake
7