Hi all!
I'm still struggling with cmake for hsi/hpi, and I just can't get my
head round it's strange ways, and what online documentation there is I
don't find helpful either. So maybe someone can help me with this
simple problem:
I have a C++ header file zz.h in my source directory
I want this preprocessed by the C preprocessor into a file zz.i in the
target directory
This is a simple operation, and cmake even generates i-files as
default targets in C++ projects. So if I have a simple CMakeLists.txt
going like
add_executable(xx xx.cpp)
(really only this one line!) and xx.cpp is also very simple:
#define mac "MACRO"
int main ( int argc , char * argv[] )
{
char * str = mac ;
}
if i now run
cmake .
make xx.i
I get this output:
Preprocessing CXX source to CMakeFiles/xx.dir/xx.i
lo and behold, CMakeFiles/xx.dir/xx.i is the C-preprocessed file. I
didn't need to specify anything in the CMakeLists.txt, cmake knows
perfectly well how to invoke the C/C++ preprocessor and make an i-file
from a .cpp file. My question is: how can I get it to uses this
capability on my source file zz.h to get zz.i in the target directory?
So far the answer was to run a custom command, with differentiation
between MSVC and gcc, probably use of a cmake command file - T. Modes
has managed to coerce cmake into doing what's needed for hsi/hpi with
a good dozen lines of code, but I have the feeling this is not at all
needed - and the current code is so obscure that I'm not at all happy
with it, because it's really such a standard task that in a classic
makefile it'd be there by default, like .i .h. But I can't figure it
out. Help!
I'd also appreciate a link to documentation that explains the concepts
behind cmake. I get the feeling that the online documentation for
cmake is deliberately sketchy to promote the sales of the book which
is featured on the main page. It's either making hello-world-type
projects with three source files and a bit of configuration or
extremely terse 'Documentation' which has no conceptual explanations
or examples. You know what cmake syntax reminds me of? Lisp. and that
has always been good for giving me a headache. There's a down side to
a simple syntax: it's all in semantics.
Kay
--
You received this message because you are subscribed to the Google Groups
"Hugin and other free panoramic software" group.
A list of frequently asked questions is available at:
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at http://groups.google.com/group/hugin-ptx