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

Robert Dailey rcdailey.lists at gmail.com
Mon Aug 27 14:37:55 EDT 2012


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.


More information about the CMake mailing list