build: don't use wx utils as UNIX cmds on Windows

Don't convert wx-config and wxrc into UNIX commands on a Windows host,
as the paths may have spaces in them and this will break the invocation.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2024-02-28 13:11:23 +00:00
parent 53e1f44a69
commit e5aa685f70
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
1 changed files with 11 additions and 3 deletions

View File

@ -223,7 +223,11 @@ else()
# is set
if(NOT wxWidgets_CONFIG_EXECUTABLE)
if(DEFINED ENV{WX_CONFIG})
separate_arguments(wxWidgets_CONFIG_EXECUTABLE UNIX_COMMAND $ENV{WX_CONFIG})
if(NOT CMAKE_HOST_WIN32)
separate_arguments(wxWidgets_CONFIG_EXECUTABLE UNIX_COMMAND "$ENV{WX_CONFIG}")
else()
set(wxWidgets_CONFIG_EXECUTABLE "$ENV{WX_CONFIG}")
endif()
else()
find_wx_util(wxWidgets_CONFIG_EXECUTABLE wx-config)
endif()
@ -654,10 +658,14 @@ if(CMAKE_HOST_WIN32 AND CMAKE_CROSSCOMPILING)
set(WXRC ${CMAKE_SOURCE_DIR}/dependencies/wxrc/wxrc.exe)
endif()
if(WXRC)
if(WXRC AND NOT CMAKE_HOST_WIN32)
separate_arguments(WXRC UNIX_COMMAND ${WXRC})
elseif(DEFINED ENV{WXRC})
separate_arguments(WXRC UNIX_COMMAND $ENV{WXRC})
if(NOT CMAKE_HOST_WIN32)
separate_arguments(WXRC UNIX_COMMAND "$ENV{WXRC}")
else()
set(WXRC "$ENV{WXRC}")
endif()
elseif(wxWidgets_CONFIG_EXECUTABLE)
execute_process(
COMMAND ${wxWidgets_CONFIG_EXECUTABLE} --utility=wxrc