[CMake] Include paths not being searched?

Ryan Pavlik rpavlik at iastate.edu
Wed Mar 17 11:16:16 EDT 2010



On 03/17/2010 10:06 AM, David Doria wrote:
>> Those files should not need to be on the include path since your compiler should know how to find them (after all, they belong to the c++ standard library). Do you happen to use -nostdinc or -nostdinc++ in your compile flags? Also, what is your c++ compiler?
>>
>> If you do a verbose build ("make VERBOSE=1"), what do you see on the compile line?
>>
>> Michael
>>
>>
>>      
> I am using:
> g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2)
>
> I am not using -nostdinc or -nostdinc++.
>
> The verbose output showed me that it is running gcc (instead of g++).
> I imagine this is the problem. Does cmake tell make to use gcc if the
> file extensions are .c? That is only thing I can think of that is
> different about this project than my normal projects (which typically
> have .cxx and .cpp). Is there a way to force it to use g++ no matter
> what the extensions are?
>
> Thanks,
>
> David
>    
Yep, that would be the issue - there is no mystical way of telling C++ 
from C without a different extension. Look up these statements:
set_property(SOURCE ${SOURCE} PROPERTY LANGUAGE CXX)
set_target_properties(${APP} PROPERTIES HAS_CXX yes)

or just rename your files to match convention: .cpp, .cxx, and .C should 
all work fine...

Ryan

-- 
Ryan Pavlik
HCI Graduate Student
Virtual Reality Applications Center
Iowa State University

rpavlik at iastate.edu
http://academic.cleardefinition.com
Internal VRAC/HCI Site: http://tinyurl.com/rpavlik



More information about the CMake mailing list