From 97a948fa522bab8c9ac0a8b4de62c3fe21e1e396 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Wed, 2 May 2018 12:27:46 +0200 Subject: [PATCH] Fix Perl path MSVC props file #857 --- cmake/msvc/{xs.wperl64d.props => xs.wperl64d.props.in} | 10 +++++++--- xs/CMakeLists.txt | 7 ++++++- 2 files changed, 13 insertions(+), 4 deletions(-) rename cmake/msvc/{xs.wperl64d.props => xs.wperl64d.props.in} (61%) diff --git a/cmake/msvc/xs.wperl64d.props b/cmake/msvc/xs.wperl64d.props.in similarity index 61% rename from cmake/msvc/xs.wperl64d.props rename to cmake/msvc/xs.wperl64d.props.in index b604a56e2..5c7461dc7 100644 --- a/cmake/msvc/xs.wperl64d.props +++ b/cmake/msvc/xs.wperl64d.props.in @@ -1,18 +1,22 @@ + - $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);c:\wperl64d\bin\; + $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);${PROPS_PERL_BIN_PATH}\; - C:\wperl64d\bin\perl.exe + ${PROPS_PERL_EXECUTABLE} slic3r.pl WindowsLocalDebugger - ..\.. + ${PROPS_CMAKE_SOURCE_DIR} diff --git a/xs/CMakeLists.txt b/xs/CMakeLists.txt index abd9c3617..238a0df34 100644 --- a/xs/CMakeLists.txt +++ b/xs/CMakeLists.txt @@ -647,7 +647,12 @@ endif () if (MSVC) # Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box. - set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props") + get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY) + string(REPLACE "/" "\\" PROPS_PERL_BIN_PATH "${PROPS_PERL_BIN_PATH}") + string(REPLACE "/" "\\" PROPS_PERL_EXECUTABLE "${PERL_EXECUTABLE}") + string(REPLACE "/" "\\" PROPS_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}") + configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props.in" "${CMAKE_BINARY_DIR}/xs.wperl64d.props" NEWLINE_STYLE CRLF) + set_target_properties(XS PROPERTIES VS_USER_PROPS "${CMAKE_BINARY_DIR}/xs.wperl64d.props") endif() # l10n