Quoting Stephen Collyer <[EMAIL PROTECTED]>:

Stefan Buschmann wrote:
Just add the corresponding command line option for the compiler:

ADD_DEFINITIONS(
     /Zc:wchar_t-                                # Treat wchar_t as
built-in type
)

BTW: The command line switch for a specific option is usually mentioned
in the comments for that option in Visual Studio.

Thanks. However, as far as I can see, ADD_DEFINITIONS adds the
option globally for all projects. I want to restrict it to
one only - is that possible ?

Yes, it's possible.

You need to set CMAKE_CXX_FLAGS for that project. I can't remember now if that variable is read-only. In case it is read only, use SET_TARGET_PROPERTIES for each target you want wchar_t as built-in and set the COMPILE_FLAGS property.

You may want to add an IF( MSVC70 OR MSVC71 ), since in Visual Studio 2005 and 2008 wchar_t is already a built-in type.

--
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)

_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to