• Stars
    star
    4
  • Rank 3,304,323 (Top 66 %)
  • Language CMake
  • License
    GNU General Publi...
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

cmake macros for simple gnat project inclusion

ada4cmake

CMake macros for simple gnat project inclusion

Rationale

gprbuild/gnatbuild/gnatmake are the simplest way of compiling gnat project files, with powerful dependency resolution built-in and binder/linker steps for proper Ada compliancy. Hence, trying to replicate all their features in CMake would be not only a huge task, but a pointless one.

My current workflow for projects in which I have to cooperate with people using CMake boils down to this: provide my Ada code in a library they can link against easily and incorporate into the CMake project with minimal fuss. We all Ada lovers know that cooperation is simpler if we don't need to modify other people's workflow to acommodate our toolchain.

This project addresses a typical debian-family open-source setup, in which native packages are used, meaning standard gcc/g++/gnat.

The two functions here provided allow easy integration of Ada code in such a setup.

Usage

Note: These functions only work for out-of-source building with CMake >= 2.8

In order to make available your Ada code through a library, just include the supplied CMakeAda.cmake file and use the following syntax:

add_ada_library(TARGET GPRFILE RELDIR)
# TARGET is the plain name of the library (e.g., adatest for libadatest.a)
# GPRFILE is the GPR project file that builds the above library
# RELDIR is the relative folder in which gprbuild builds the library (e.g. lib)

and then link with:

add_executable(main main.c)
target_link_libraries(main plainlibname)
# There is no need to make a explicit dependency on the library

For executables built in pure Ada (no C/C++ main file) there is a similar function:

add_ada_executable(TARGET GPRFILE)
# TARGET is the plain name of the executable
# GPRFILE is the GPR project file that builds said executable

See the example folder for details:

cd example
mkdir build
cd build
cmake ..
make

More Repositories

1

btrfs-status

My personal assessment on btrfs status vs the official one at https://btrfs.wiki.kernel.org/index.php/Status
19
star
2

rxada

An Ada 2012 implementation of the Rx methodology
Ada
17
star
3

yeison

A json-like data structure library in Ada
Ada
8
star
4

iterators

Functional iterators for Ada 2012
Ada
6
star
5

sheetmusic

Transcriptions of public domain music using Lilypond and Musescore
LilyPond
5
star
6

alire-old-discussion

Design of an Ada language library repository
5
star
7

agpl

Ada General Purpose Library -- Miscellaneous utilities
Ada
4
star
8

player-ada

Ada bindings for the player robotic platform
Ada
4
star
9

stopwatch

A type to track elapsed time
Ada
3
star
10

workers

Simple-to-use worker pools for Ada
Ada
3
star
11

adagio

G2 network server leaf
Ada
3
star
12

uri-ada

URI parsing for Ada
Ada
3
star
13

unitest

Test of unicode flags in GNAT
Ada
3
star
14

vnet

High-level virtual network for robotics experimentation
C++
2
star
15

aaa

Alex's Ada Assortment
Ada
2
star
16

optional

Optional types for Ada
Ada
2
star
17

hungarian

Ada wrapper for the fast Stachniss' Hungarian solver
Ada
2
star
18

gnat-gpl-bugs

Test cases for various bugs in the latest GNAT GPL edition, to check their fixing on successive editions
Ada
2
star
19

2022-AEiC-alire-tutorial

Materials for the Alire tutorial at AEiC'22
TeX
2
star
20

mandelbrot_ascii

Mandelbrot renderer in "ASCII" (unicode actually, but text nonetheless)
Ada
2
star
21

umwi

Unicode Monospace Width Information
Ada
1
star
22

den

Directory Enumeration for Ada
Ada
1
star
23

cant-stop-odds

Odds for the Can't stop game
Python
1
star
24

ekfvloc

EKF-based localization library for Gearbox and Player
C++
1
star
25

vmapfile

vmapfile map driver changes to be contributed to player 3 robotic platform
C++
1
star
26

sancta

SANCTA multi-robot task allocation library
Ada
1
star
27

ansi-ada

ANSI control sequences for the Ada language
Ada
1
star
28

utf8test

Test unicode output with `-gnatW8`
Ada
1
star
29

minirest

Minimalist REST Ada client library
Ada
1
star
30

embedded-aws-templates

Ripped out minimal functionality from Ada Web Server and Templates Parser for embedded resources
Ada
1
star
31

Ada_CI_Workflows

Ready-to-use workflows to add Continuous Integration to Ada projects
Ada
1
star
32

skel_ada

Skeleton for Ada projects
1
star
33

ajunitgen

Generator of JUnit-compatible XML reports in Ada
Ada
1
star
34

toml_slicer

TOML file direct manipulation without parsing
Ada
1
star
35

dl-ada

Minimal binding to libdl
Ada
1
star