[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cmake
Subject:    [CMake] CMake error reporting with absolute paths?
From:       Kevin Funk <krf () gmx ! de>
Date:       2013-07-26 7:35:55
Message-ID: 1588628.mGa4qjIGMT () kerberos
[Download RAW message or body]

Hey there,

I've been wondering if that topic came up at some point:

CMake currently does the following error reporting in case something goes 
wrong: 

Output:
"""
CMake Error at src/CMakeLists.txt:14 (add_executable):

(...)
"""

So, while this is fine at a first glance, it isn't exactly easy to parse \
for  both humans and machines because the message doesn't tell you the \
absolute  file path. You have a to know about the base folder to find out \
the absolute  path. Which is the CMake project root folder, right.

This question came up in order to fix a bug [1] in KDevelop -- KDevelop has \
 CMake support and also provides parsing CLI output to some extend. It can 
parse command-line output and provide clickable entries for quickly opening \
 the relevant file in case of errors.

The problematic part is that for CMake one cannot easily parse the line \
"CMake  Error at src/CMakeLists.txt:14 (add_executable):" because, again, \
you have to  maintain a context to find the absolute path. So, while it is \
of course  possible to achieve this (pass the CMake root to the output \
parser), it is a  bit cumbersome to do so because other \
compilers/Makefile-generators tend to  use absolute paths in error \
reporting.

So, keeping it short: In my opinion it would make sense to use absolute \
paths  in such scenarios (error reporting). Both to simplify parsing CMake \
output for  third-party tools and for making it easier to find the relevant \
file when  running CMake manually.

What do others think?

Greets

[1] https://bugs.kde.org/show_bug.cgi?id=321982

-- 
Kevin Funk
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: \
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more \
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at \
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic