Fix compilation in path with spaces

Compilation with the default settings failed when downloading PCSX2 into
a directory with spaces somewhere in its path:
* In CompileGResources.cmake the paths had been escaped already, resulting
  in double escaping the strings (i.e. embedding them in quotes _and_
  escaping spaces with a backslash. cmake wasn't able to parse the line
  any more.
* In pcsx2/CMakeLists.txt the paths were not escaped, but also not
  embedded in quotes, resulting in an invalid Bash command.
This commit fixes these cases (but is neither a review to find all cases
or making sure other characters such as a newline character would work).
This commit is contained in:
Ignaz Forster 2021-02-08 00:03:19 +01:00 committed by refractionpcsx2
parent a40e6ba693
commit b6246a7ba4
2 changed files with 4 additions and 4 deletions

View File

@ -150,7 +150,7 @@ function(COMPILE_GRESOURCES output xml_out)
# Generate gresources XML target.
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_OUTPUT=${Q}${CG_XML_FILE_PATH}${Q}")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_OUTPUT=${CG_XML_FILE_PATH}")
if(CG_ARG_COMPRESS_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_COMPRESS_ALL=True")
@ -182,7 +182,7 @@ function(COMPILE_GRESOURCES output xml_out)
"GXML_RESOURCES=${Q}${CG_ARG_RESOURCES}${Q}")
list(APPEND CG_CMAKE_SCRIPT_ARGS "-P")
list(APPEND CG_CMAKE_SCRIPT_ARGS
"${Q}${GCR_CMAKE_MACRO_DIR}/BuildTargetScript.cmake${Q}")
"${GCR_CMAKE_MACRO_DIR}/BuildTargetScript.cmake")
get_filename_component(CG_XML_FILE_PATH_ONLY_NAME
"${CG_XML_FILE_PATH}" NAME)

View File

@ -1151,8 +1151,8 @@ endif()
if(NOT DISABLE_SETCAP)
if(PACKAGE_MODE)
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_INSTALL_FULL_BINDIR}/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_INSTALL_FULL_BINDIR}/${Output}; set +x\")")
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_INSTALL_FULL_BINDIR}/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_INSTALL_FULL_BINDIR}/${Output}'; set +x\")")
else()
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f ${CMAKE_SOURCE_DIR}/bin/${Output} ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' ${CMAKE_SOURCE_DIR}/bin/${Output}; set +x\")")
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_SOURCE_DIR}/bin/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_SOURCE_DIR}/bin/${Output}'; set +x\")")
endif()
endif()