From 01ac55532b2c94c968d8b528e33a2ac1b945a33f Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Mon, 20 Nov 2023 17:13:38 +0100 Subject: [PATCH] stub: try to avoid have ; replace by list separator (3rd try) --- stubs.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stubs.cmake b/stubs.cmake index 5d312ba11..c494ad33b 100644 --- a/stubs.cmake +++ b/stubs.cmake @@ -102,16 +102,20 @@ function(GENERATE_STUBS module_path module_name module_install_dir) set(ENV_PATH) set(optional_args ${ARGN}) if(WIN32) - set(_path $ENV{PATH}) + # Ton of conflict between path separators, cmake lists separator and + # generator expression foreach(py_target IN LISTS optional_args) if(TARGET ${py_target}) set(_is_lib "$,SHARED_LIBRARY>") set(_target_dir "$") - set(_path "$<${_is_lib}:${_target_dir}\\\;>${_path}") + set(_target_path "$<${_is_lib}:${_target_dir}>@${_target_path}") endif() endforeach() - set(ENV_PATH PATH=${_path}) + string(REPLACE ";" "@" _path_cmake $ENV{PATH}) + set(_path_cmake "${_target_path}${_path_cmake}") + string(REPLACE "@" "\;" _path_str ${_path_cmake}) + set(ENV_PATH "PATH=${_path_str}") endif() add_custom_target(