A program that automatically generates CMake and Meson configuration files for your Vala project

Overview

AUTOVALA

IMPORTANT: Autovala has been migrated to Gitlab

https://gitlab.com/rastersoft/autovala

Autovala is a program and a library designed to help in the creation of projects with Vala and CMake. It also has support for Genie.

Now also has experimental Meson build system support.

The idea is quite simple: CMake is very powerful, but writting the CMakeLists files is boring and repetitive. Why not let the computer create them, by guessing what to do with each file? And if, at the end, there are mistakes, let the user fix them in an easy way, and generate the final CMakeLists files.

This is what Autovala does. This process is done in three steps:

* First, Autovala checks all the folders and files, and writes a project
file with the type of each file
* It also peeks the source files to determine which Vala packages they need,
and generate automagically that list
* After that (and after allowing the user to check, if (s)he wishes, the
project file), it uses that project file to generate the needed CMakeLists
files

Autovala greatly simplifies the process of working with Vala because:

* Automatically determines the vala packages and libraries needed to compile
and run the project, by inspecting the source code
* Automatically generates the .vapi and pkg-config files for libraries
* Automatically determinates the final destination for an icon, by checking
its type (svg or png) and, in the later case, its size.
* Automatically generates manpages from text files in several possible input
format (markdown, html, latex...).
* Greatly simplifies creating libraries in Vala, or a project with a binary
that uses a library defined in the same project.
* Automatically generates the metadata files to create .DEB and .RPM packages.
* Easily integrates unitary tests for each binary in the project.
* Can generate automatically DBUS bindings by using the DBUS introspection
capabilities.
* Automatically generates the list of source files for GETTEXT.
* Simplifies mixing C and Vala source files.

COMPILING AUTOVALA

Details about how to compile autovala are available in the INSTALL.md file.

You also can compile the plugins for Gedit and Scratch Text Editor, which are in the folders gedit_plugin and scratch_plugin. You can find inside the instructions.

USING AUTOVALA

The DOC folder contains the Wiki dumped in HTML format. Just open the index.html file with your browser, or go to the Wiki section in GitHub, and enjoy.

CONTACTING THE AUTHOR

Sergio Costas Rodriguez
[email protected]
http://www.rastersoft.com
https://gitlab.com/rastersoft/autovala

Comments
  • Generated meson files fail to build

    Generated meson files fail to build

    I am trying to generate meson files for our project that has AutoVala in use: https://github.com/cromnix/pamac-classic

    The CMake files work great and everything builds just fine. However the meson files don't work. This is the output I get when trying to build:

    meson --prefix=/usr --sysconfdir=/etc
    The Meson build system
    Version: 0.43.0
    Source dir: /home/cromer/Desktop/projects/pamac-classic/test
    Build dir: /home/cromer/Desktop/projects/pamac-classic/test/build
    Build type: native build
    
    Meson encountered an error in file meson.build, line 252, column 0:
    Assignment target must be an id.
    cfg_pamac-installer = configuration_data()
    ^
    
    A full log can be found at /home/cromer/Desktop/projects/pamac-classic/test/build/meson-logs/meson-log.txt
    

    This is the generated meson.build file: https://gist.github.com/cromerc/38782d85b179410905382e5a0e8cb440

    opened by cromerc 36
  • Gedit plugin make fails

    Gedit plugin make fails

    The CMake of the gedit plugin passes without any problems, but the Make fails with

    [ 75%] Building C object src/CMakeFiles/AutovalaGeditPlugin.dir/valaplugin.c.o
    /home/philipp/Programme/autovala/gedit_plugin/install/src/valaplugin.c:16:31: fatal error: gedit/gedit-panel.h: Datei oder Verzeichnis nicht gefunden
     #include <gedit/gedit-panel.h>
                                   ^
    compilation terminated.
    make[2]: *** [src/CMakeFiles/AutovalaGeditPlugin.dir/valaplugin.c.o] Fehler 1
    make[1]: *** [src/CMakeFiles/AutovalaGeditPlugin.dir/all] Fehler 2
    make: *** [all] Fehler 2
    

    Maybe there is some dependency missing in the CMake files? I'm running Ubuntu GNOME with programs from ppa:gnome3-team/gnome3, ppa:gnome3-team/gnome3-staging and ppa:ricotz/testing, so they should be fairly up to date.

    opened by Ferruck 29
  • make fails on dbus include

    make fails on dbus include

    while trying to use "make" which is the result of cmake produced by autovala compilation fails with fatal error: dbus/dbus-glib-lowlevel.h: no such file or directory.

    although file /usr/include/dbus-1.0/dbus/dbus-glib-lowlevel.h exist (corresponding -dev packages installed).

    vala project used act as a dbus client, not server.

    opened by zabbal 28
  • copy cmake/* during update

    copy cmake/* during update

    Since autovala uses cmake/* files would be handy if they would be installed (/usr/share/autovala or whatever) during autovala installation and used by autovala (symlink or copy) in project directory during "autovala update" command.

    This will remove code duplication and makes autovala usage much easier.

    opened by zabbal 27
  • [Feature request] symlinks during install

    [Feature request] symlinks during install

    It would be nice to have a way to make symlinks during install. I think that there are 2 possible ways that this could be implemented. custom: target link symlink Basically take advantage of the already existing custom tag but instead of copying a file create a symlink.

    or just a symlink tag: symlink: target link

    Right now I do some ugly hacky stuff to get symlinks created during the install step, it would be nice if autovala had support for symlinks built in.

    opened by cromerc 26
  • Icon installation in hicolor uses wrong directory names

    Icon installation in hicolor uses wrong directory names

    Autovala installs hicolor icons using wrong directory names like 16, 22, 24, 32 while the hicolor theme only looks for icons in directories with names like 16x16, 22x22, 24x24, 32x32 instead (see the index.theme file in /usr/share/icons/hicolor). This issue effectively renders the installed icons useless because they will never be found.

    Additionally, I think it would be handy to have some control over icon destinations. Besides the mentioned subdirectory names (which can differ between themes) also being able to install icons in other themes than hicolor. For example, I need to ship icons for ubuntu-mono-dark and ubuntu-mono-light.

    opened by ztefn 26
  • vala dbus bindings autogeneration

    vala dbus bindings autogeneration

    In my project I have client which uses 3rd party dbus service from vala. Right now I obtain corresponding .vala code through d-bus introspection:

    call to "dbus-send --session --type=method_call --print-reply=literal --dest=... org.freedesktop.DBus.Introspectable.Introspect" and then calling to "vala-dbus-binding-tool --api-path="

    Is there a way to automate this with autovala?

    opened by zabbal 24
  • Add gresources support

    Add gresources support

    The gresource system (and glib-compile-resources) is a handy way of dealing with resources, including embedding them into your program.

    When there's a .gresource.xml file is found, glib-compile-resources should be called and the resulting C/H files included in the compilation, and a basic VAPI generated for it.

    opened by AstraLuma 23
  • update-icon-cache for all themes called after installing icons in one location

    update-icon-cache for all themes called after installing icons in one location

    Hi,

    Yesterday I ran the autovale-generated CMake for my app within a prestine Fedora 22 vm install and noticed the icons not showing up. An simple update-icon-cache command was able to solve that. Apparently the install script did not run the command at the right time.

    So after investigating when exacltly when the update command was called, I found the calls for all themes in one specific (seemingly random) location: /data/icons/hicolor/22x22/CMakeLists.txt (see contents below this message)

    I suppose this is the cause of the problem, the update command seems to be called after having installed just a few icons of one theme, while other icons have yet to be installed...

    If you need to do some deeper analysis I can e-mail you the full project source.

    ### CMakeLists automatically created with AutoVala
    ### Do not edit
    
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp-connected.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/status/)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp-connecting-1.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/status/)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp-connecting-2.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/status/)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp-connecting-3.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/status/)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp-disconnected.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/status/)
    install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/myapp.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/22x22/apps/)
    IF( NOT (${ICON_UPDATE} STREQUAL "OFF" ))
        install (CODE "execute_process ( COMMAND /usr/bin/gtk-update-icon-cache-3.0 -t ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/gnome )" )
        install (CODE "execute_process ( COMMAND /usr/bin/gtk-update-icon-cache-3.0 -t ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor )" )
        install (CODE "execute_process ( COMMAND /usr/bin/gtk-update-icon-cache-3.0 -t ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/ubuntu-mono-dark )" )
        install (CODE "execute_process ( COMMAND /usr/bin/gtk-update-icon-cache-3.0 -t ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/icons/ubuntu-mono-light )" )
    ENDIF()
    
    opened by ztefn 17
  • Incorrect warnings

    Incorrect warnings

    When running autovala update I get this:

    Updating project file
    Warning: Trying to add twice the file src/pamac-tray/tray-appindicator.vala for translation
    Warning: Trying to add twice the file src/pamac-tray/tray-gtk.vala for translation
    Storing configuration in file /home/cromer/Desktop/projects/pamac-classic/pamac.avprj
    Updating CMake files
    Warning: Trying to add twice the file src/pamac-tray/tray-appindicator.vala for translation
    Warning: Trying to add twice the file src/pamac-tray/tray-gtk.vala for translation
    Updating Meson files
    Warning: Trying to add twice the file src/pamac-tray/tray-appindicator.vala for translation
    Warning: Trying to add twice the file src/pamac-tray/tray-gtk.vala for translation
    Done
    

    This is caused by doing translations that depend on a build flag:

    if KDE_TRAY
    translate: vala src/pamac-tray/tray-appindicator.vala
    else
    translate: vala src/pamac-tray/tray-gtk.vala
    end
    

    There are no problems when building, it builds correctly. Just kind of ugly that it spits out these warnings.

    opened by cromerc 16
  • Another strange issue (with gedit plugin :)

    Another strange issue (with gedit plugin :)

    Hi again! So, it seems a regression of issue #52 has come up again. The plugin does not show up in the plugin preferences (v 3.18.2, arch linux).

    However, if you cannot reproduce this, it's probably because my install is messed up. Lately I cannot get the gedit-code-assistance plugin to do anything (at least for Vala) in gedit. I should probably try on another machine..... Let me know if you have any insight.

    Thanks again for a truly impressive piece of software :)

    opened by xdave 16
  • [Feature Request] More tags -- options for

    [Feature Request] More tags -- options for "autovala po".

    Hi, i have some request for the "autovala po" command, now the command executed to generate the pot file is; xgettext --from-code=UTF-8 -d wifi-qrcode -o wifi-qrcode.pot -p po --keyword='_' --add-comments=Translators -f po/POTFILES.in

    can you add same options to the xgettext command with the relative tags in the avprj file? The options --> tags to add are the seguent:

    1. --package-name= --> project_name (already existing in avrpj)
    2. --package-version= --> version (already existing in avrpj)
    3. --copyright-holder= --> po_copyright_holder
    4. --msgid-bugs-address= --> po_msgid_bugs_address

    to have a command like this and a more complete pot file:

    xgettext --from-code=UTF-8 -d wifi-qrcode -o wifi-qrcode.pot -p po --keyword='_' --add-comments=Translators -f po/POTFILES.in --copyright-holder="Copyright Info" --package-name=wifi-qrcode --package-version=0.20 --msgid-bugs-address=www.mybugzilla.bug

    The xgettext option are explained in this page: https://www.gnu.org/software/gettext/manual/html_node/xgettext-Invocation.html

    thanks

    opened by squall77it 2
  • Meson installing cmake

    Meson installing cmake

    I just noticed that the packages built with meson are installing CMakeLists.txt files into the package. After install I have this: /usr/share/doc/CMakeLists.txt /usr/share/pamac/CMakeLists.txt

    opened by cromerc 2
  • [Feature request] custom tag directories

    [Feature request] custom tag directories

    It would be nice if the custom tag had a component to choose the correct directory for the files for both meson and cmake. For example right now I have these custom tags:

    custom: data/dbus/org.pamac.system.conf ${CMAKE_INSTALL_SYSCONFDIR}/dbus-1/system.d
    custom: data/dbus/org.pamac.user.service ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services
    custom: data/dbus/org.pamac.system.service ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/system-services
    custom: data/systemd/pamac-system.service ${CMAKE_INSTALL_LIBDIR}/systemd/system
    custom: data/systemd/pamac-cleancache.service ${CMAKE_INSTALL_LIBDIR}/systemd/system
    custom: data/systemd/pamac-cleancache.timer ${CMAKE_INSTALL_LIBDIR}/systemd/system
    custom: data/systemd/pamac-mirrorlist.service ${CMAKE_INSTALL_LIBDIR}/systemd/system
    custom: data/systemd/pamac-mirrorlist.timer ${CMAKE_INSTALL_LIBDIR}/systemd/system
    custom: data/polkit/org.pamac.policy ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/polkit-1/actions
    custom: data/mime/x-alpm-package.xml ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATAROOTDIR}/mime/packages
    

    Naturally in meson this is broken since $CMAKE_INSTALL_DATAROOTDIR is not set.

    My suggestion would be to change the custom tag to this:

    custom: data/dbus/org.pamac.system.conf dbus-1/system.d sysconfdir
    custom: data/dbus/org.pamac.user.service dbus-1/services datarootdir
    custom: data/dbus/org.pamac.system.service dbus-1/system-services datarootdir
    custom: data/systemd/pamac-system.service systemd/system libdir
    custom: data/systemd/pamac-cleancache.service systemd/system libdir
    custom: data/systemd/pamac-cleancache.timer systemd/system libdir
    custom: data/systemd/pamac-mirrorlist.service systemd/system libdir
    custom: data/systemd/pamac-mirrorlist.timer systemd/system libdir
    custom: data/polkit/org.pamac.policy polkit-1/actions datarootdir
    custom: data/mime/x-alpm-package.xml mime/packages datarootdir
    

    By having 3 arguments to the custom tag we can choose where on the system the files get installed to. This will also allow prefix installs to work correctly. For example I am using DESTDIR="$pkgdir" in a pacman PKGBUILD, which means I need the custom tag to respect the DESTDIR for the installation.

    For example sysconfdir would put the correct directory "$DESTDIR/$PREFIX/etc" into the cmake/meson directories.

    opened by cromerc 9
  • Conditional compilation

    Conditional compilation

    Currently it is not possible to have conditional compilation with CMake style expressions. This doesnot allow for very important system checking (Linux, Windows or OSX). For example I cannot have if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") in my avprj. This is interpreted wrongly. I suggest that you leave expressions in parentheses as is instead of tokenizing them. Also is there any alternative way of currently doing it. As vala only supports boolean macro variables, I tried to do this if and add compile options (-D PLATFORM_LINUX) inside it

    opened by meghprkh 3
Owner
Sergio Costas
Sergio Costas
Bear is a tool that generates a compilation database for clang tooling.

ʕ·ᴥ·ʔ Build EAR Bear is a tool that generates a compilation database for clang tooling. The JSON compilation database is used in the clang project to

László Nagy 2.9k Sep 17, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 388 Sep 16, 2022
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 79 Sep 12, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 72 Apr 14, 2022
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.3k Sep 21, 2022
CMake checks cache helper modules – for fast CI CMake builds!

cmake-checks-cache Cross platform CMake projects do platform introspection by the means of "Check" macros. Have a look at CMake's How To Write Platfor

Cristian Adam 60 Aug 17, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 37 Dec 30, 2021
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 160 Sep 5, 2022
Make CMake less painful when trying to write Modern Flexible CMake

Izzy's eXtension Modules IXM is a CMake library for writing Modern flexible CMake. This means: Reducing the amount of CMake written Selecting reasonab

IXM 107 Sep 1, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 28 Sep 1, 2022
CMake module for building IDL files with MIDL and generating CLR DLL using Tlbimp

FindIDL CMake module for building IDL files with MIDL and generating CLR DLL using Tlbimp. Introduction Requirements Usage find_package() add_idl() ad

Apriorit Inc. 16 Jul 26, 2022
Check for coding style issues in CMake files

cmakelint parses CMake files and reports style issues. cmakelint requires Python. Installation sudo pip install cmakelint Usage Syntax: cmakelint [--c

Richard Quirk 97 Mar 21, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
Project to enable using CMake from a Maven build.

CMake-Maven-Project Introduction A Maven project for the CMake build system. It can be used by including it as a plugin within your Maven project's po

null 58 Jul 13, 2022
Enhanced CMake Project Manager plugin for Qt Creator

CMakeProjectManager2 Alternative CMake support for Qt Creator. Main differents from original CMakeProject plugin: Project file list readed from file s

Alexander Drozdov 71 May 24, 2022
Installation example for a C++ project (Windows) with Cmake.

CMakeInstallExample Installation example for a C++ project (Windows) with Cmake. Contents This project demonstrates how to use cmake with cpack to gen

Paul T 28 Jul 13, 2022
Example project which demonstrates various CMake features.

CMake example Example project which demonstrates various CMake features. CDash testing dashboard (probably empty but you can submit your test result t

Radovan Bast 141 Feb 28, 2022
Template for reliable, cross-platform C++ project setup using cmake.

The C++ CMake Project Template cmake-init is a sophisticated copy & paste template for modern C and C++ projects. The main goals include support of al

CG Internals 798 Sep 17, 2022
CMake module for downloading an external project's source at configure time

DownloadProject Platform Build status Linux Mac OSX Windows (VS2015) This repository contains a generalized implementation for downloading an external

Crascit Pty Ltd 430 Sep 19, 2022