[CMake] Ada and CMake

Alan W. Irwin irwin at beluga.phys.uvic.ca
Wed Feb 28 01:09:11 EST 2007


On 2007-02-27 23:13-0500 Bill Hoffman wrote:

> Alan W. Irwin wrote:
>> In sum, gnatgcc handles compiling and linking into a library in a manner
>> identical to gcc (it is actually a symlink to an Ada-enabled gcc on Linux
>> systems) so ADD_LIBRARY for the Ada case is easy to implement.  However,
>> gnatmake is required to actually link a viable executable, and the rules 
>> are
>> very different in that case. Thus, an implementation of <SOURCE> (as 
>> defined
>> above) for the CMAKE_(LANG)_LINK_EXECUTABLE case is required to make
>> ADD_EXECUTABLE work properly in the Ada case.
>> 
>> If you do find the time to implement <SOURCE> for the
>> CMAKE_(LANG)_LINK_EXECUTABLE case in CVS, I would be happy to test it.

> I wonder if you could just use the output name, and tack on the ada extension 
> to it. add_executable(foo ...)
> gnatmake foo.ada.

Thanks for that idea. I assume you are referring to the <TARGET> pattern. 
Now that I have looked at it, I believe that should work on Unix systems
unless I run into something I am not anticipating.

On Windows systems, the executable suffix .exe is a complication.  I assume
that in that case <TARGET> would resolve to foo.exe rather than foo.  I
suppose that could be beaten by setting SUFFIX to "" for the target property
so that <TARGET> would resolve to foo on all systems.  I am largely
unfamiliar with Windows.  Would the lack of the suffix on the resulting
windows executable be a problem on that platform?

Anyhow, I will play some more with implementing add_executable for Ada using
<TARGET> within the CMAKE_Ada_LINK_EXECUTABLE string to help get access to
the name of the main Ada source file for the executable.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list