Commit 8db65390 authored by T.J. Corona's avatar T.J. Corona

Properly set test environment for windows python tests (thanks Ben!)

parent ac1fcee6
......@@ -13,9 +13,22 @@ if(NOT IS_ABSOLUTE ${smtk_module_dir})
${PROJECT_BINARY_DIR}/${smtk_DIR}/${SMTK_PYTHON_MODULEDIR} ABSOLUTE)
endif()
set(envsep ":")
set(pyenv
${PROJECT_BINARY_DIR}
${smtk_module_dir}
$ENV{PYTHONPATH})
if (WIN32)
set(envsep ";")
string(REPLACE ";" "\;" pyenv "${pyenv}")
else ()
string(REPLACE ";" ":" pyenv "${pyenv}")
endif()
set(pathenv)
if (WIN32)
set(pathenv
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
$ENV{PATH})
string(REPLACE ";" "\;" pathenv "${pathenv}")
endif()
foreach (pytest ${pytests})
......@@ -27,6 +40,12 @@ foreach (pytest ${pytests})
set_tests_properties("${pytest}Py"
PROPERTIES
ENVIRONMENT "PYTHONPATH=${PROJECT_BINARY_DIR}${envsep}${smtk_module_dir}${envsep}$ENV{PYTHONPATH}"
ENVIRONMENT "PYTHONPATH=${pyenv}"
)
if (pathenv)
set_property(TEST "${pytest}Py" APPEND
PROPERTY
ENVIRONMENT "PATH=${pathenv}"
)
endif ()
endforeach ()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment