Skip to content

Commit 0e099ff

Browse files
committed
Windows: Fix test runner with .dll
1 parent e3b28de commit 0e099ff

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

cmake/test/CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,15 @@ if(BUILD_PYTHON)
150150
)
151151
# Set PYTHONPATH to find pygetdata module
152152
# $<CONFIG> is Release/Debug on multi-config (Windows), empty on single-config (Unix)
153-
set_tests_properties(python_${testname} PROPERTIES
154-
ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/lib/$<CONFIG>"
155-
)
153+
# On Windows, also add DLL directory to PATH so getdata.dll can be found
154+
if(WIN32)
155+
set_tests_properties(python_${testname} PROPERTIES
156+
ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/lib/$<CONFIG>;PATH=${CMAKE_BINARY_DIR}/bin/$<CONFIG>;$ENV{PATH}"
157+
)
158+
else()
159+
set_tests_properties(python_${testname} PROPERTIES
160+
ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/lib/$<CONFIG>"
161+
)
162+
endif()
156163
endforeach()
157164
endif()

0 commit comments

Comments
 (0)