[CMake] ADA language

Alan W. Irwin irwin at beluga.phys.uvic.ca
Mon Jul 23 12:22:46 EDT 2007


On 2007-07-23 16:19+0200 Camek, Alexander wrote:

>
> Hi Alan,
>
>> By the way, with the standard Unix Makefile generator you can
>> find out exactly what was set by looking through the
>> generated Makefiles or even easier, invoke make as "make
>> VERBOSE=1 ..." which is how I know that <CMAKE_Ada_COMPILER>
>> is set correctly for Linux and Mac OS X systems using the
>> PLplot Ada modules.

> That's what I am almost use here and I also do a
SET(CMAKE_VERBOSE_MAKEFILE TRUE). But when I want to compile my main.adb I
always get the error: gnatmake: "cmake_ada_link_flags" not found So I look
deeper into the whole and found out that the above line is also wrong. It
says: cd C:\Projects\foo\bar && C:/MinGW/bin/gnatmake.exe
CMAKE_Ada_LINK_FLAGS -aIC:/Projects/foo/bar ../bin/bar.adb -cargs -largs
-LC:\Projects\fooBuild\lib That's for me the reason why I belief cmake
doesn't parse the bracketed variable, as you called them, correctly. It only
usese here in my enviroment the inner string of the brackets.

The equivalent I get for the Ada interface to PLplot Linux (for building our
12th example) is the following:

cd /home/software/plplot_cvs/HEAD/build_dir/examples/ada && /usr/bin/gnatmake  -fPIC -aI/home/software/plplot_cvs/HEAD/plplot_cmake/examples/ada -aI/home/software/plplot_cvs/HEAD/plplot_cmake/bindings/ada -aL/home/software/plplot_cvs/HEAD/build_dir/bindings/ada/CMakeFiles/plplotadad.dir xthick12a.adb -cargs   -largs -rdynamic -L/home/software/plplot_cvs/HEAD/build_dir/bindings/ada -L/home/software/plplot_cvs/HEAD/build_dir/src -L/home/software/plplot_cvs/HEAD/build_dir/lib/csa -L/home/software/plplot_cvs/HEAD/build_dir/lib/nn -L/home/software/autotools/install/lib -L/usr/lib/gcc-lib/i486-linux/3.3.5/adalib -lplplotadad -lplplotd -lltdl -ldl -lcsirocsa -lm -lcsironn -lqhull -lfreetype -lgnat -Wl,-rpath,/home/software/plplot_cvs/HEAD/build_dir/bindings/ada:/home/software/plplot_cvs/HEAD/build_dir/src:/home/software/plplot_cvs/HEAD/build_dir/lib/csa:/home/software/plplot_cvs/HEAD/build_dir/lib/nn:/home/software/autotools/install/lib:/usr/lib/gcc-lib/i486-linux/3.3.5/adalib

So <CMAKE_Ada_LINK_FLAGS> is being properly expanded in my Linux case (and
in the Mac OS X case of one of the Plplot testers) but not in your MinGW
case, and the question is why the difference?

If I correctly recall the previous discussions here (MinGW gurus, please
correct my summary if I am wrong), there are two MinGW platforms ("pure"
MinGW and MinGW/MSYS) with separate CMake generators.  Have you got a
mismatch between the generator you are using and your actual platform?

In any case, I suggest you try both the pure MinGW case with appropriate
generator, and then the MinGW/MSYS case with appropriate generator to see if
the lack of expansion of <CMAKE_Ada_LINK_FLAGS> happens for both platforms.
Also, if you have a friend with a Linux platform see if everything works for
you on that platform.

> I use here your CMakeAdaInformation.cmake, and also all other modules
except the ada.cmake, because as I see you disable it with the option
ENABLE_ada (it is never set to true).

option(ENABLE_ada "Enable Ada bindings" OFF) means Ada is disabled by
default for PLplot, but the user can always specify it with the cmake
command-line option -DENABLE_ada=ON.  If you want the default to be ON, then
simply change that line to

option(ENABLE_ada "Enable Ada bindings" ON)

The rest of that file is fundamentally important since it finds the gnat
library and runs enable_language(Ada).  Are you doing both those things?

Until you can figure out what your CMake/Ada issue is, I would stick as
closely to the PLplot case as possible.  That includes (see above) trying to
get everything to work on a Linux platform.

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 libLASi project (unifont.org/lasi); 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