From 53af9c1b2395fd2ad8e7d803ff59292cd9f4eb0f Mon Sep 17 00:00:00 2001 From: Justin Carpentier Date: Fri, 5 Jun 2020 11:23:55 +0200 Subject: [PATCH] test: enhance WIN32 compatibility --- test.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test.cmake b/test.cmake index 40a2801af..7640fdd9f 100644 --- a/test.cmake +++ b/test.cmake @@ -108,6 +108,9 @@ MACRO(ADD_PYTHON_UNIT_TEST NAME SOURCE) SET(MODULES "${ARGN}") # ARGN is not a variable FOREACH(MODULE_PATH IN LISTS MODULES) LIST(APPEND PYTHONPATH "${CMAKE_BINARY_DIR}/${MODULE_PATH}") + IF(WIN32) + LIST(APPEND PYTHONPATH "${CMAKE_BINARY_DIR}/${MODULE_PATH}/$") + ENDIF(WIN32) ENDFOREACH(MODULE_PATH IN LISTS MODULES) IF(DEFINED ENV{PYTHONPATH}) @@ -120,7 +123,11 @@ MACRO(ADD_PYTHON_UNIT_TEST NAME SOURCE) OUTPUT_VARIABLE PATHSEP OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REPLACE ";" "${PATHSEP}" PYTHONPATH_STR "${PYTHONPATH}") + IF(WIN32) + STRING(REPLACE ";" ":" PYTHONPATH_STR "${PYTHONPATH}") + ELSE(WIN32) + STRING(REPLACE ";" "${PATHSEP}" PYTHONPATH_STR "${PYTHONPATH}") + ENDIF(WIN32) SET(ENV_VARIABLES "PYTHONPATH=${PYTHONPATH_STR}") IF(APPLE) LIST(APPEND ENV_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}")