[CMake] External_Project and WIndows

Richard Offer richard at whitequeen.com
Sat Aug 6 11:53:15 EDT 2011


Hi,

I'm trying to build Google protocol buffers as an external project on
Windows and am hitting an issue with over assuming something is a path.


I need to be able to call msbuild with options. (/p:Configuration=Debug),
but cmake converts this to \p:Configuration=Debug before passing the
string to msbuild.


Which obviously throws a wobbly.


A backup plan is to use a batch file to split cmake and msbuild, but I
wondered if there was a cleaner solution ?


For information the actual recipe is

ExternalProject_Add(
	${PROTOBUF}32
	PREFIX exports
	URL ${PROJECT_SOURCE_DIR}/depot/${PROTOBUF}.tar.gz
	UPDATE_COMMAND ""
	BUILD_IN_SOURCE 1
	PATCH_COMMAND cmake.exe -E copy
${PROJECT_SOURCE_DIR}/depot/protobuf-vs2010.sln vsprojects/protobuf.sln
	CONFIGURE_COMMAND ""
	BUILD_COMMAND "msbuild vsprojects/protobuf.sln '/p:Configuration=Debug'
'/p:Platform=Win32'"
	TEST_BEFORE_INSTALL 1
	TEST_COMMAND tests.exe
#  INSTALL_COMMAND nmake install DESTDIR=${PROJECT_BINARY_DIR}/exports
)



Thanks,

Richard.




More information about the CMake mailing list