From 3d26fcea33359da4f0e684255948d67cbecb5064 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 17 Dec 2015 23:37:55 +0000 Subject: Fix PERL_EXECUTABLE to be a native path, so that system() works. --- infrastructure/cmake/CMakeLists.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'infrastructure') diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt index 335d44e6..f55f7be2 100644 --- a/infrastructure/cmake/CMakeLists.txt +++ b/infrastructure/cmake/CMakeLists.txt @@ -4,6 +4,14 @@ enable_testing() set(base_dir ${CMAKE_SOURCE_DIR}/../..) +macro(cmake_to_native_path cmake_path native_path) + if(WIN32) + string(REPLACE "/" "\\" ${native_path} "${cmake_path}") + else() + set(${native_path} "${cmake_path}") + endif() +endmacro() + set(files_to_configure infrastructure/BoxPlatform.pm contrib/mac_osx/org.boxbackup.bbackupd.plist @@ -272,4 +280,5 @@ find_library(pcred_lib_path pcred ${base_dir}/../pcre-win32/lib) target_link_libraries(lib_common PUBLIC "${pcreposixd_lib_path}" "${pcred_lib_path}") # Define the location of the Perl executable, needed by testbackupstorefix -target_compile_definitions(test_backupstorefix PRIVATE -DPERL_EXECUTABLE="${PERL_EXECUTABLE}") +cmake_to_native_path(PERL_EXECUTABLE perl_executable_native) +target_compile_definitions(test_backupstorefix PRIVATE -DPERL_EXECUTABLE="${perl_executable_native}") -- cgit v1.2.3