[CMake] building c code as c++ code

Brandon Van Every bvanevery at gmail.com
Sun Jun 10 11:03:33 EDT 2007


On 6/10/07, Brandon Van Every <bvanevery at gmail.com> wrote:
> On 6/10/07, John Pretz <pretz at umdgrb.umd.edu> wrote:
> >
> > What I need to do is convince cmake that this .c source code is supposed
> > to be compiled with a c++ compiler.  If I rename the files (foo.c ->
> > foo.cxx), it builds correctly, but again, assume I'm not allowed to
> > modify the files.
>
> You're saying PROJECT(projectname CXX) doesn't work?  If it doesn't,
> that's a showstopper bug.  I'd be surprised.

What state of confusion caused you to put PROJECT(MyProject CXX C) in
your CMakeLists.txt?  That's your problem.  If you want all C++ then
you shouldn't be telling it to do C also.


Cheers,
Brandon Van Every


More information about the CMake mailing list