[CMake] Different handling of spaces in COMPILE_FLAGS on Windows XP

David Cole david.cole at kitware.com
Tue Aug 28 10:27:33 EDT 2012


On Mon, Aug 27, 2012 at 2:37 PM, Robert Dailey <rcdailey.lists at gmail.com> wrote:
> I'm seeing different results here between Windows 7 and Windows XP.
> Here is the CMake code I use to add /FI (force includes) to the
> compiler flags for a source file:
>
> function( _force_include header_file )
>         if( MSVC )
>                 foreach( source ${ARGN} )
>                         get_filename_component( ext ${source} EXT )
>                         if( ext STREQUAL ".cpp" )
>                                 set_property( SOURCE ${source} APPEND_STRING PROPERTY
>                                         COMPILE_FLAGS "/FI${header_file} "
>                                 )
>                         endif()
>                 endforeach()
>         else()
>                 message( SEND_ERROR "_force_include() not implemented on this platform" )
>         endif()
> endfunction()
>
> Here is the Visual Studio 2008 vcproj output on XP:
>
>         AdditionalOptions=" and
> Settings/superpc/dev/DominoProcessDecompCMake/cmake/files/source/hash_map_hack.hpp"
>         ForcedIncludeFiles="C:/Documents"
>
> And on Windows 7 it is:
>
>         ForcedIncludeFiles="C:/Documents and
> Settings/superpc/dev/DominoProcessDecompCMake/cmake/files/source/hash_map_hack.hpp"
>
> Any reason why I'm getting different results on XP vs W7? I'm running
> CMake 2.8.9 on both platforms with the same CMake scripts & code.
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



Something *ELSE* must also be different. I don't think we have code
that should generate different VC output files for the same version of
VC on Windows XP and Windows 7. (It's possible, but I consider it
highly unlikely.)

Is there a service pack level difference? Something in the environment?

Can you track it down in the CMake source code to something that would
logically be different between XP and 7?


More information about the CMake mailing list