[CMake] Problems with CHECK_TYPE_SIZE

Tim Teulings rael at edge.ping.de
Wed Aug 9 14:31:06 EDT 2006


Hello!

I try to use the CHECK_TYPE_SIZE macro in the CheckTypeSize module to
detect the availability and the size of wchar_t.

Since wchar_t is not a build-in type but is defined in <string> I want
the macro to include <string> before calculating the size.

I tried the following sequence:

INCLUDE(CheckTypeSize)
SET(CMAKE_EXTRA_INCLUDE_FILES string)
CHECK_TYPE_SIZE("wchar_t" SIZEOF_WCHAR_T)
SET(CMAKE_EXTRA_INCLUDE_FILES)

But this fails because it seems like the generated test file has the
suffix ".c" and the compiler (gcc in my case) is called using gcc
instead g++. Since gcc in this case compiles in "C"-mode instead in
"C++"-mode like it would it it was call with the g++ frontend and thus
does not have stl headers in the search path (and would not be able to
parse them anyway) test fails with string not being found.

How can I force cmake to use g++ in this case?

-- 
Gruß...
       Tim.


More information about the CMake mailing list