Skip to content

Commit f7b9391

Browse files
authored
Merge pull request #3945 from ahojnnes/user/joschonb/fix-prebuild-path
Wrap variables in cmake/prebuild in quotes to handle spaces in paths
2 parents e8db1fe + fbfe474 commit f7b9391

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

cmake/prebuild.cmake

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,23 +1323,23 @@ else(NOT CMAKE_CROSSCOMPILING)
13231323

13241324
set(GETARCH_DIR "${PROJECT_BINARY_DIR}/getarch_build")
13251325
set(GETARCH_BIN "getarch${CMAKE_EXECUTABLE_SUFFIX}")
1326-
file(MAKE_DIRECTORY ${GETARCH_DIR})
1327-
configure_file(${TARGET_CONF_TEMP} ${GETARCH_DIR}/${TARGET_CONF} COPYONLY)
1326+
file(MAKE_DIRECTORY "${GETARCH_DIR}")
1327+
configure_file("${TARGET_CONF_TEMP}" "${GETARCH_DIR}/${TARGET_CONF}" COPYONLY)
13281328
if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
13291329
if (CMAKE_ASM_COMPILER_ID STREQUAL "")
1330-
try_compile(GETARCH_RESULT ${GETARCH_DIR}
1330+
try_compile(GETARCH_RESULT "${GETARCH_DIR}"
13311331
SOURCES ${GETARCH_SRC}
13321332
CMAKE_FLAGS "-DCMAKE_ASM_COMPILER=${CMAKE_C_COMPILER}"
13331333
COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
13341334
OUTPUT_VARIABLE GETARCH_LOG
1335-
COPY_FILE ${PROJECT_BINARY_DIR}/${GETARCH_BIN}
1335+
COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
13361336
)
13371337
else()
1338-
try_compile(GETARCH_RESULT ${GETARCH_DIR}
1338+
try_compile(GETARCH_RESULT "${GETARCH_DIR}"
13391339
SOURCES ${GETARCH_SRC}
13401340
COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} -I"${GETARCH_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
13411341
OUTPUT_VARIABLE GETARCH_LOG
1342-
COPY_FILE ${PROJECT_BINARY_DIR}/${GETARCH_BIN}
1342+
COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH_BIN}"
13431343
)
13441344
endif()
13451345
if (NOT ${GETARCH_RESULT})
@@ -1370,19 +1370,19 @@ execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH_BIN}" 1 OUTPUT_VARIABLE
13701370
message(STATUS "GETARCH results:\n${GETARCH_MAKE_OUT}")
13711371

13721372
# append config data from getarch to the TARGET file and read in CMake vars
1373-
file(APPEND ${TARGET_CONF_TEMP} ${GETARCH_CONF_OUT})
1373+
file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH_CONF_OUT})
13741374
ParseGetArchVars(${GETARCH_MAKE_OUT})
13751375

13761376
set(GETARCH2_DIR "${PROJECT_BINARY_DIR}/getarch2_build")
13771377
set(GETARCH2_BIN "getarch_2nd${CMAKE_EXECUTABLE_SUFFIX}")
1378-
file(MAKE_DIRECTORY ${GETARCH2_DIR})
1379-
configure_file(${TARGET_CONF_TEMP} ${GETARCH2_DIR}/${TARGET_CONF} COPYONLY)
1378+
file(MAKE_DIRECTORY "${GETARCH2_DIR}")
1379+
configure_file("${TARGET_CONF_TEMP}" "${GETARCH2_DIR}/${TARGET_CONF}" COPYONLY)
13801380
if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore")
1381-
try_compile(GETARCH2_RESULT ${GETARCH2_DIR}
1382-
SOURCES ${PROJECT_SOURCE_DIR}/getarch_2nd.c
1381+
try_compile(GETARCH2_RESULT "${GETARCH2_DIR}"
1382+
SOURCES "${PROJECT_SOURCE_DIR}/getarch_2nd.c"
13831383
COMPILE_DEFINITIONS ${EXFLAGS} ${GETARCH_FLAGS} ${GETARCH2_FLAGS} -I"${GETARCH2_DIR}" -I"${PROJECT_SOURCE_DIR}" -I"${PROJECT_BINARY_DIR}"
13841384
OUTPUT_VARIABLE GETARCH2_LOG
1385-
COPY_FILE ${PROJECT_BINARY_DIR}/${GETARCH2_BIN}
1385+
COPY_FILE "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}"
13861386
)
13871387

13881388
if (NOT ${GETARCH2_RESULT})
@@ -1395,9 +1395,9 @@ execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 0 OUTPUT_VARIABL
13951395
execute_process(COMMAND "${PROJECT_BINARY_DIR}/${GETARCH2_BIN}" 1 OUTPUT_VARIABLE GETARCH2_CONF_OUT)
13961396

13971397
# append config data from getarch_2nd to the TARGET file and read in CMake vars
1398-
file(APPEND ${TARGET_CONF_TEMP} ${GETARCH2_CONF_OUT})
1398+
file(APPEND "${TARGET_CONF_TEMP}" ${GETARCH2_CONF_OUT})
13991399

1400-
configure_file(${TARGET_CONF_TEMP} ${TARGET_CONF_DIR}/${TARGET_CONF} COPYONLY)
1400+
configure_file("${TARGET_CONF_TEMP}" "${TARGET_CONF_DIR}/${TARGET_CONF}" COPYONLY)
14011401

14021402
ParseGetArchVars(${GETARCH2_MAKE_OUT})
14031403

0 commit comments

Comments
 (0)