The issue is that when some automated tools do not know the
CMAKE_SOURCE_DIR, then they have hard time to determine which file
is referred to.
This could happen even by wrong design of 'some automated tool' or
by parallel CMake execution using the same cout/cerr.
Instead it would be nice if there will be an option to print the
file name as absolute path. Please see desired example:
CMake Error at /home/user/Projects/libraries/LibFoo/tests/CMakeLists.txt:16 (set_property):
set_property could not find TARGET LibFoo. Perhaps it has not yet been
- I use KDevelop as my Linux IDE which has as you may know pretty
nice CMake integration. The thing is, that when I use out-the-source
build, KDevelop has a problem when parsing the CMake error outputs.
It assumes the file is referred to the build directory (which in
fact is correct because the KDevelop runs the build command in the
build directory), but it is not. The CMake assumes the 'contract' is
that the CMakeLists.txt would be always considered as relative to
- Another driver is when I do parallel build on build server, the
actual context of the CMake error line is hard to determine. Here is
impossible to get the proper context (the only relevant context is
the printed line itself).
Last but not least: it is not much practical to maintain my own
CMake repo just for this change :-).
I would like to know if someone is interested and would accept
this as an issue.
I can then fill this as an issue and in other discussion propose how
to design the absolute/relative path switching.
At this moment the 'GetIsInTryCompile()'
flag which influence the absolute/relative printing is set only as
hardcodded value (as far as I know).
Re: Absolute path printing of CMakeLists.txt files in title of CMake error messages.
> *What is the real driver behind?*
> - I use KDevelop as my Linux IDE which has as you may know pretty nice
> CMake integration.
I believe KDevelop is getting support for the cmake server, so exposing
messages through that would probably solve this aspect. Specifically, there
is a cmMessenger class and messages go through that. If you add virtual
method(s?) to it you can add an implementation specifically for the server
which passes the messages over the protocol to the IDE.
> - Another driver is when I do parallel build on build server, the actual
> context of the CMake error line is hard to determine. Here is impossible
> to get the proper context (the only relevant context is the printed line