dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

build_info.h (or config_info.h) similar to git_info.h ? #110

Closed miroi closed 9 years ago

miroi commented 9 years ago

In order to restore CMake configuration printouts and have the possibility to include them into the code I suggest to have a "config_info.h" file generation. This include file, analogous to "git_info.h", would contain important CMake buildup parameters, as compilers & flags, libraries ...

bast commented 9 years ago

Yes we want to have something like that but please mind that it is not so simple to do this in a program-agnostic way. Fortran has line length limitations and therefore including config_info.h will probably fail. One way out would be to only include this in C code and Fortran would call C which then prints. Also every code prints differently (buffered or unbuffered). I suggest that we first introduce it in the code in question (DIRAC or some other code). Then we abstract and observe and eventually the module can grow into an Autocmake module. Here bottom-up is IMO better than trying to introduce it in Autocmake directly.

bast commented 9 years ago

What we can do is that we generate build_info.h and we let the program deal with it.

bast commented 9 years ago

Closing this discussion. Feel free to create a module for this but my advice is to grow the module first within an actual project.

miroi commented 9 years ago

The idea o generating the build_info.h is smart. Variables inside could be printed out by the program alone (written in Fortran,C or C++).

In DIRAC we generated own Fortran printing commands. The build_info.h file requires dedicated routine(s) to print variables content.

bast commented 9 years ago

Yes we need to leave this to the program since every program does that differently. Another problem is the line limit of Fortran.

miroi commented 9 years ago

I'll implant the the build_info.h printout into the mathlibs-tester program to have an example of that.