[CMake] building c code as c++ code

John Pretz pretz at umdgrb.umd.edu
Sun Jun 10 11:19:59 EDT 2007


Oh, you're a hero.  Thank you.  I didn't even realize that gcc had an 
option to force compilation as c++.  But that works.

I'll file a bug report nonetheless.

Thanks,

John

Brandon Van Every wrote:
> On 6/10/07, John Pretz <pretz at umdgrb.umd.edu> wrote:
>> Yes, if I say: PROJECT(projectname CXX) in the source, then it doesn't
>> generate a target for my .c files.  The resulting makefiles don't even
>> try to compile the .c file.
> 
> Hrm, that sucks.  I would look in the bug tracker about this.  CMake
> shouldn't be making draconian assumptions about .c or .C suffixes.
> 
> I'll wager a workaround is to use (PROJECT blah CXX C) and pass a
> "compile as C++" flag to the compiler somehow.  Lotsa stuff in the
> mailing list archives about how to pass compiler flags.  I guess if
> that workaround works, then the issue is not a showstopper, just
> significantly annoying.  You should still ping bug tracker so that
> people realize the issue does affect people.
> 
> 
> Cheers,
> Brandon Van Every
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list