From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.228.39 with SMTP id sf7mr40946747pac.45.1435833853114; Thu, 02 Jul 2015 03:44:13 -0700 (PDT) X-Received: by 10.140.35.170 with SMTP id n39mr418404qgn.0.1435833853062; Thu, 02 Jul 2015 03:44:13 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!ff1no874802igc.0!news-out.google.com!w15ni14766qge.0!nntp.google.com!t90no368971qga.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 2 Jul 2015 03:44:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2001:660:6602:4:9a90:96ff:febf:5a88; posting-account=pwYQiQkAAAA3aYJLpu5F4Anl_UXMyGLQ NNTP-Posting-Host: 2001:660:6602:4:9a90:96ff:febf:5a88 References: <8ee03ab1-6745-4aa4-82ee-be1eccc9afc9@p3g2000vbv.googlegroups.com> <87liyugwsf.fsf@ludovic-brenta.org> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: C++/cmake project, injecting Ada... From: "Alejandro R. Mosteo" Injection-Date: Thu, 02 Jul 2015 10:44:13 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3829 X-Received-Body-CRC: 1147573353 Xref: news.eternal-september.org comp.lang.ada:26568 Date: 2015-07-02T03:44:12-07:00 List-Id: On Friday, April 29, 2011 at 10:17:18 AM UTC+2, Alex R. Mosteo wrote: > >> The challenge: throwing Ada into this mix without disrupting > >> everyone's workflow to an unreasonable level. > 2) Somehow massage cmake into using a single call to gprbuild, and normal= ly=20 > use it to compile the Ada part into a library. I guess this library can b= e=20 > easily linked with the rest of C/C++ compiled sources, since I have seen= =20 > cmake projects which build many intermediate libraries. Since there's onl= y=20 > one interaction between cmake and Ada (launching gprbuild), perhaps the= =20 > problem of debugging everyone's else builds would be a reasonable burden;= =20 > especially if the Ada parts are disabled by default and only compiled by= =20 > people interested in them. Sorry for resurrecting this 4-year old thread, but yesterday I gave a new s= hot at this and I think things have changed for the better with CMake. To summarize, the challenge was to contribute Ada code to a C/C++ project u= sing the CMake build environment and with minimal disruption for all parts = involved. What I've found is that CMake 2.8 adds an "external project" build command = that enables calling gprbuild with ease. If you're in a debian-based distro= which packages gnat, the other contributors that are interested in compili= ng your Ada part just need to install a package. To me that qualifies as mi= nimal disruption :) Advantages to each side: 1) The Ada contributor can keep using the wonderful Ada built-in dependency= management. If he wants to share a library, an appropriately crafted gpr f= ile will expose the code to the C/C++ side in the usual way. If the result = is a mere executable things are even simpler. 2) The C/C++ side just keeps working as usual, enabling the Ada parts if ne= eded. I've prepared a couple of CMake helper macros that give the basic idea and = can be enhanced for more involved actions (like installing the Ada library,= etc). It is here [1]. Basically, you issue an add_ada_library() and that's= it for the CMake side. Incidentally, I saw another effort to integrate gnat and CMake, but it seem= s it is going the full CMake way: adding Ada support so source files are re= cognized and compiled individually and so on. I'm not sure how the binding = stage is managed there, but for interested people here it is too [2]. [1] https://github.com/mosteo/ada4cmake [2] https://github.com/offa/cmake-ada