Home Download Buy Blog Forum Support

'file_regex' for CMake build system

'file_regex' for CMake build system

Postby Rezzie on Thu Aug 18, 2011 7:52 am

I've made a build system for using CMake (with Clang) by copying across the one for Makefiles, but the 'file_regex' is tripping up sometimes with what appear to be multi-line matches.

For example, with the following build output:

Code: Select all
[ 16%] Building CXX object CMakeFiles/ray.dir/src/main.cpp.o
/home/rezzie/ray/src/main.cpp:27:4: error: use of undeclared identifier 'Camera'
   Camera cam;
   ^
/home/rezzie/ray/src/main.cpp:105:4: error: expected unqualified-id
   return EXIT_SUCCESS;


The first error doesn't work, as the regex highlights the "[ 16%] Building ...." line and then the file path, up to the '27:4'. The second error is picked up correctly; I'm guessing because it's not preceded by a "Building" line.

Can someone help me modify the regex so it'll work with Clang/CMake output? It's currently:

Code: Select all
^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$


Thanks!
Rezzie
 
Posts: 7
Joined: Thu Aug 18, 2011 7:42 am

Re: 'file_regex' for CMake build system

Postby jps on Thu Aug 18, 2011 8:00 am

Does changing the [^:] to [^:\n] help? (i.e., changing from matching any character but ':' to any character but ':' and '\n')
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: 'file_regex' for CMake build system

Postby Rezzie on Thu Aug 18, 2011 8:25 am

That works perfectly. Thank you :)
Rezzie
 
Posts: 7
Joined: Thu Aug 18, 2011 7:42 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 16 guests