mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix Win32 build, broken by COMMAND_EXPAND_LISTS
Create a win32 analog to make_unix_path_list that escapes the semicolons to prevent cmake turning them into list delimiters.
This commit is contained in:
parent
f5996afd3e
commit
93323cc1dc
@ -20,11 +20,20 @@ function(make_unix_path PATH)
|
|||||||
set(${PATH} ${newpath} PARENT_SCOPE)
|
set(${PATH} ${newpath} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
#PATH variables in the environment are separated by colons, but CMake lists are separated by semicolons. This function transforms the separators.
|
# PATH variables in the environment are separated by colons, but CMake
|
||||||
|
# lists are separated by semicolons. This function transforms the
|
||||||
|
# separators.
|
||||||
function(make_unix_path_list PATH)
|
function(make_unix_path_list PATH)
|
||||||
string(REPLACE ";" ":" newpath "${${PATH}}")
|
string(REPLACE ";" ":" newpath "${${PATH}}")
|
||||||
set(${PATH} ${newpath} PARENT_SCOPE)
|
set(${PATH} ${newpath} PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
# Meanwhile cmake treats the semicolons in Win32 path lists as its own
|
||||||
|
# list separators converting them into spaces on the command
|
||||||
|
# line. Escape them to prevent that.
|
||||||
|
function(make_win32_path_list PATH)
|
||||||
|
string(REPLACE ";" "\\\;" newpath "${${PATH}}")
|
||||||
|
set(${PATH} "${newpath}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# This function will set two or four environment variables to a directory in the parent PARENT_SCOPE
|
# This function will set two or four environment variables to a directory in the parent PARENT_SCOPE
|
||||||
# * _DIRCLASS (eg "prefix", "sitedir" is used to construct the variable name(s) and in error messages
|
# * _DIRCLASS (eg "prefix", "sitedir" is used to construct the variable name(s) and in error messages
|
||||||
@ -241,6 +250,7 @@ function(gnc_add_scheme_targets _TARGET)
|
|||||||
set(fpath "")
|
set(fpath "")
|
||||||
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
|
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
|
||||||
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
|
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
|
||||||
|
make_win32_path_list(LIBRARY_PATH)
|
||||||
else()
|
else()
|
||||||
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{LD_LIBRARY_PATH}")
|
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash:$ENV{LD_LIBRARY_PATH}")
|
||||||
endif()
|
endif()
|
||||||
@ -256,6 +266,9 @@ function(gnc_add_scheme_targets _TARGET)
|
|||||||
if(NOT MINGW64 OR ${GUILE_EFFECTIVE_VERSION} VERSION_LESS 2.2)
|
if(NOT MINGW64 OR ${GUILE_EFFECTIVE_VERSION} VERSION_LESS 2.2)
|
||||||
make_unix_path_list(_GUILE_LOAD_PATH)
|
make_unix_path_list(_GUILE_LOAD_PATH)
|
||||||
make_unix_path_list(_GUILE_LOAD_COMPILED_PATH)
|
make_unix_path_list(_GUILE_LOAD_COMPILED_PATH)
|
||||||
|
elseif(MINGW64)
|
||||||
|
make_win32_path_list(_GUILE_LOAD_PATH)
|
||||||
|
make_win32_path_list(_GUILE_LOAD_COMPILED_PATH)
|
||||||
endif()
|
endif()
|
||||||
make_unix_path_list(_GNC_MODULE_PATH)
|
make_unix_path_list(_GNC_MODULE_PATH)
|
||||||
if (__DEBUG)
|
if (__DEBUG)
|
||||||
|
Loading…
Reference in New Issue
Block a user