[CMake] Problem in ADD_CUSTOM_COMMAND

Micha Renner Micha.Renner at t-online.de
Mon Feb 11 08:30:43 EST 2008


In general, this code-fragment works:

SET(_srcDir1 /${vpcl_path})
SET(_destination /${PROJECT_SOURCE_DIR}})

IF (MSVC)
	SET(command xcopy)
	SET(_parameter "/Y/I")
ELSE(MSVC)
	set(command cp)
ENDIF(MSVC)
	
ADD_CUSTOM_TARGET(myTarget ALL DEPENDS ${_srcDir1})

FILE(TO_NATIVE_PATH ${_srcDir1} _srcDir1)
FILE(TO_NATIVE_PATH ${_destination} _destination)

ADD_CUSTOM_COMMAND(
	TARGET myTarget
	POST_BUILD
	COMMAND ${command} ${_srcDir1} ${_destination} ${_parameter}
	) 

With MS-copy there are sometimes problems especially if you use
directory names like sigC++ or libxml++

Michael



More information about the CMake mailing list