From: Tom K. <tom...@ve...> - 2015-05-20 18:19:05
|
I figured it out. One need only set CMAKE_Ada_COMPILER_INIT to a list of fully qualified paths to the gcc/gnatgcc one wants. On Wed, May 20, 2015 at 1:17 PM, Tom Kacvinsky <tom...@ve... > wrote: > > > On Tue, May 19, 2015 at 7:22 PM, Alan W. Irwin <ir...@be...> > wrote: > >> On 2015-05-19 13:20-0400 Tom Kacvinsky wrote: >> >> Alan, >>> >>> This is not in regards to plplot proper, but rather the cmake Ada support >>> bundled with plplot. >>> >>> How is add_executable supposed to work? Does it invoke gcc for each >>> adb/ads file, then call the rest of the GNAT tool chain utilities to >>> generate an executable, or does it just invoke gnatmake? the reason I >>> ask >>> is that we aren't listing all of the Ada files necessary to build the >>> executable, but all of the necessary files end up getting compiled. But >>> upon a subsequent build, not all Ada files get recompiled, even if >>> they've >>> changed. I am thinking if gnatmake is used, this change would be >>> detected >>> and the right thing would happen. >>> >>> So, should I be listing all of the necessary Ada files in the >>> add_executable(<target> <files>) invocation so that no matter what is >>> used >>> under the hood, recompiles happen when necessary. >>> >> >> Hi Tom: >> >> From memory I am pretty sure that gnatmake is used under the hood for >> the add_executable case. But the thing to do is to run >> >> make VERBOSE=1 >> >> (or verbose equivalent if you are building with a non-make generator) to >> see exactly what commands are being used for the Ada executable build. >> >> And to answer your last question, I am virtually positive you should >> mention all necessary Ada source files in the add_executable(<target> >> <files>) invocation because that is the way add_excutable is supposed >> to work in general. But to figure it out for sure try with and >> without mentioning all Ada source files for VERBOSE=1 to see the >> exact difference that makes to the build. >> >> Sorry that I am being a little vague here, but our own use of Ada >> language support only uses single files in the add_executable command >> so I don't know exactly what would happen for multiple files. >> Furthermore, it has been a very long while since I worked on our Ada >> language support, and when I implemented that I had very little >> understanding of CMake language support (and that is still the case). >> So I converted existing language support for C over to Ada language >> support using trial and error methods using tests like I suggested >> above to evaluate whether the results were good enough for our needs. >> And stopped when that was finally the case. >> > > Hi again Alan, > > I made the changes to add_executable and it appears gnatmake is not > invoked to build the executable, at least not that I can tell with "make > VERBOSE=1". gcc is getting invoked to make object files from the Ada > source, but the problem I am now running into is that cmake is now using > the system gcc to compile the files, where we want a different gcc to be > used. IS there a way of telling the cmake Ada support to use a different > gcc (like there is for C, C++ and FORTRAN compilers)? I am talking about > tricks with cmake variables, not the PATH setting (as then the gcc that we > want for Ada would be used for C/C++, and for those compiles, we want a > different gcc). > > Thanks, > > Tom > |