Skip to content

Commit

Permalink
Merge pull request jrl-umi3218#395 from jcarpent/master
Browse files Browse the repository at this point in the history
Enhance WIN32 compatibility
  • Loading branch information
jcarpent authored Jun 5, 2020
2 parents e715bf7 + 53af9c1 commit 9e21ae2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}/$<CONFIG>")
ENDIF(WIN32)
ENDFOREACH(MODULE_PATH IN LISTS MODULES)

IF(DEFINED ENV{PYTHONPATH})
Expand All @@ -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}")
Expand Down

0 comments on commit 9e21ae2

Please sign in to comment.