[CMake] print content of linking script ?

Ilias Miroslav Miroslav.Ilias at umb.sk
Mon Dec 12 05:39:32 EST 2011


Dear Eric,

I tried the "file(READ..." cmake command, but it does not work during CMake buildup -  the link.txt file is ready for reading only after ending the buildup what is not my case.

Why I need it ?

Some time ago I reported problem about missing static library:
http://www.cmake.org/pipermail/cmake/2011-November/047444.html

Though it is not solved, I would like -  for the CDash buildup - print out the complete (or partial?) "link.txt" command in the "Configure Output",

to extend CDash output as this,  http://repo.ctcc.no/CDash/buildSummary.php?buildid=6251

to see all linked libraries and flags. 

For the linking step I reported above the CMake is assigning couple of libraries, and there is no possibility of removing some of them. So at least, leat us see on-line which ones are linked.

Yours, Miro

________________________________________
From: Eric Noulard [eric.noulard at gmail.com]
Sent: Sunday, December 11, 2011 6:24 PM
To: Ilias Miroslav
Cc: cmake at cmake.org
Subject: Re: [CMake] print content of linking script ?

2011/12/11 Ilias Miroslav <Miroslav.Ilias at umb.sk>:
> Dear all,
>
> is there an easy way of printing out content of the linking file
>
>  CMakeFiles/<TARGET>.dir/link.txt
>
> as a simple command in the CMakeLists.txt file ?
>
> Usually we do cat .../link.txt after the cmake-configuration but we would prefer some more elegant form within the "message(...)" commad.

You can read the content of any file using
file(READ your-file YOURVAR)  cmake command
then use
message("Your-file=${YOURVAR}") to display it,
that said I don't **when** the link.txt file is getting generated so
that I don't
if it'll work from within CMakeLists.txt.

Why do you want to do that?


if you are using Makefile generator then may be

make VERBOSE=1 <target>

would be enough?




--
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list