{"id":13408305,"url":"https://github.com/mosteo/ada4cmake","last_synced_at":"2026-01-27T10:19:53.879Z","repository":{"id":34440192,"uuid":"38374265","full_name":"mosteo/ada4cmake","owner":"mosteo","description":"cmake macros for simple gnat project inclusion","archived":false,"fork":false,"pushed_at":"2020-09-14T10:36:59.000Z","size":22,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-07-31T20:29:53.713Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mosteo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-01T14:01:12.000Z","updated_at":"2023-05-17T03:33:10.000Z","dependencies_parsed_at":"2022-09-14T06:11:36.334Z","dependency_job_id":null,"html_url":"https://github.com/mosteo/ada4cmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosteo%2Fada4cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosteo%2Fada4cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosteo%2Fada4cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mosteo%2Fada4cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mosteo","download_url":"https://codeload.github.com/mosteo/ada4cmake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243584076,"owners_count":20314695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T20:00:52.008Z","updated_at":"2026-01-27T10:19:53.819Z","avatar_url":"https://github.com/mosteo.png","language":"CMake","funding_links":[],"categories":["Deployment"],"sub_categories":["Build and Package"],"readme":"# ada4cmake\nCMake macros for simple gnat project inclusion\n\nRationale\n---------\ngprbuild/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.\n\nMy current workflow for projects in which I have to cooperate with people using CMake boils down\nto 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.\n\nThis project addresses a typical debian-family open-source setup, in which native packages are used, meaning standard gcc/g++/gnat.\n\nThe two functions here provided allow easy integration of Ada code in such a setup.\n\nUsage\n-----\n**Note:** These functions only work for **out-of-source** building with CMake \u003e= 2.8\n\nIn order to make available your Ada code through a library, just include the supplied `CMakeAda.cmake` file and use the following syntax:\n\n```cmake\nadd_ada_library(TARGET GPRFILE RELDIR)\n# TARGET is the plain name of the library (e.g., adatest for libadatest.a)\n# GPRFILE is the GPR project file that builds the above library\n# RELDIR is the relative folder in which gprbuild builds the library (e.g. lib)\n```\n\nand then link with:\n\n```cmake\nadd_executable(main main.c)\ntarget_link_libraries(main plainlibname)\n# There is no need to make a explicit dependency on the library\n```\n\nFor executables built in pure Ada (no C/C++ main file) there is a similar function:\n\n```cmake\nadd_ada_executable(TARGET GPRFILE)\n# TARGET is the plain name of the executable\n# GPRFILE is the GPR project file that builds said executable\n``` \n\nSee the `example` folder for details:\n```bash\ncd example\nmkdir build\ncd build\ncmake ..\nmake\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosteo%2Fada4cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmosteo%2Fada4cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmosteo%2Fada4cmake/lists"}