Permalink
Browse files

BUG: Extension build system: Fix use of wrapper script on windows. Fi…

…xes #4247

This commit ensures the build configuration is passed to the wrapped
command.

It fixes error like this one:


8:   SetMakeCommand:C:\D\Support\CMake-3.5.0-rc3\bin\cmake.exe --build . --config "$(Configuration)"
8:
8:   SetCTestConfiguration:MakeCommand:C:\D\Support\CMake-3.5.0-rc3\bin\cmake.exe --build . --config "$(Configuration)"
8:
8:   Build project
8:
8:   MakeCommand:C:\D\Support\CMake-3.5.0-rc3\bin\cmake.exe --build . --config "$(Configuration)"
8:   Run command: "C:\D\Support\CMake-3.5.0-rc3\bin\cmake.exe" "--build" "." "--config" "$(Configuration)"
8:
8:   Microsoft (R) Build Engine version 12.0.40629.0
8:   [Microsoft .NET Framework, version 4.0.30319.34209]
8:   Copyright (C) Microsoft Corporation. All rights reserved.
8:   Build started 10/12/2016 10:57:46 PM.
8:
8:   Project "C:\D\N\Slicer-1-build\Slicer-build\Extensions\CMake\Testing\build_with_upload-build\TestExtA-build\ALL_BUILD.vcxproj" on node 1 (default targets).
8:   Project "C:\D\N\Slicer-1-build\Slicer-build\Extensions\CMake\Testing\build_with_upload-build\TestExtA-build\ALL_BUILD.vcxproj" (1) is building "C:\D\N\Slic
er-1-build\Slicer-build\Extensions\CMake\Testing\build_with_upload-build\TestExtA-build\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
8:
8:
8: C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(61,5): error MSB8013: This project doesn't contain the Configuration an
d Platform combination of $(Configuration)|x64. [C:\D\N\Slicer-1-build\Slicer-build\Extensions\CMake\Testing\build_with_upload-build\TestExtA-build\ZERO_CHECK.v
cxproj] [C:\D\N\Slicer-1-build\Slicer-build\Extensions\CMake\Testing\build_with_upload-build\TestExtA.vcxproj]
8:

git-svn-id: http://svn.slicer.org/Slicer4/trunk@25440 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
jcfr committed Oct 13, 2016
1 parent c226f73 commit 41df9c1a2d09a6b2d417a27b6feb573b52cdbfef
@@ -192,7 +192,7 @@ foreach(EXTENSION_NAME ${EXTENSION_LIST})
message(STATUS "Configuring extension upload wrapper script: ${upload_extension_wrapper_script}")
file(WRITE ${upload_extension_wrapper_script} "
execute_process(
COMMAND ${EXTENSION_UPLOAD_COMMAND}
COMMAND ${EXTENSION_UPLOAD_WRAPPER_COMMAND}
WORKING_DIR \"${EXTENSION_SUPERBUILD_BINARY_DIR}\"
RESULT_VARIABLE result
)
@@ -205,7 +205,7 @@ foreach(EXTENSION_NAME ${EXTENSION_LIST})
SOURCE_DIR ${EXTENSION_SOURCE_DIR}
BINARY_DIR ${EXTENSION_SUPERBUILD_BINARY_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND} -P ${upload_extension_wrapper_script}
BUILD_COMMAND ${CMAKE_COMMAND} -DCTEST_BUILD_CONFIGURATION=${CTEST_BUILD_CONFIGURATION} -P ${upload_extension_wrapper_script}
INSTALL_COMMAND ""
${EP_ARG_EXTENSION_DEPENDS}
)
@@ -117,6 +117,11 @@ set(EXTENSION_COMMAND_BUILD_CONF_ARG_LIST
-C ${CTEST_BUILD_CONFIGURATION}
-DCTEST_BUILD_CONFIGURATION:STRING=${CTEST_BUILD_CONFIGURATION}
)
set(dollar "$")
set(EXTENSION_COMMAND_BUILD_CONF_WRAPPER_ARG_LIST
-C ${dollar}{CTEST_BUILD_CONFIGURATION}
-DCTEST_BUILD_CONFIGURATION:STRING=${dollar}{CTEST_BUILD_CONFIGURATION}
)

#-----------------------------------------------------------------------------
# Set EXTENSION_TEST_COMMAND
@@ -148,4 +153,6 @@ set(EXTENSION_OPERATING_SYSTEM \"${EXTENSION_OPERATING_SYSTEM}\")")
set(script_args_file ${CMAKE_CURRENT_BINARY_DIR}/${EXTENSION_NAME}-upload-command-args.cmake)
file(WRITE ${script_args_file} "${EXTENSION_UPLOAD_COMMAND_ARG_LIST}")

set(EXTENSION_UPLOAD_COMMAND ${CMAKE_CTEST_COMMAND} ${EXTENSION_COMMAND_BUILD_CONF_ARG_LIST} -DCTEST_MODEL:STRING=${CTEST_MODEL} -DSCRIPT_ARGS_FILE:FILEPATH=${script_args_file} -S ${EXTENSION_SCRIPT} -V${CTEST_EXTRA_VERBOSE_ARG})
set(EXTENSION_UPLOAD_COMMAND_ARGS -DCTEST_MODEL:STRING=${CTEST_MODEL} -DSCRIPT_ARGS_FILE:FILEPATH=${script_args_file} -S ${EXTENSION_SCRIPT} -V${CTEST_EXTRA_VERBOSE_ARG})
set(EXTENSION_UPLOAD_COMMAND ${CMAKE_CTEST_COMMAND} ${EXTENSION_COMMAND_BUILD_CONF_ARG_LIST} ${EXTENSION_UPLOAD_COMMAND_ARGS})
set(EXTENSION_UPLOAD_WRAPPER_COMMAND ${CMAKE_CTEST_COMMAND} ${EXTENSION_COMMAND_BUILD_CONF_WRAPPER_ARG_LIST} ${EXTENSION_UPLOAD_COMMAND_ARGS})

0 comments on commit 41df9c1

Please sign in to comment.