Skip to content

Commit

Permalink
Make ctests platform independent
Browse files Browse the repository at this point in the history
Windows doesn't have a mechanism similar to rpaths. Instead, shared
libraries are searched in the current working directory and  in the
directory with the executable followed by directories in the environment
variable PATH.

Add the path to the shared libarpack library to PATH for ctests that run
executables that are located in a different directory and that set the
current working directory not to the directory with the libarpack.dll.
Use a generator expression that should be working independent on the CMake
generator.
  • Loading branch information
mmuetzel committed Sep 22, 2024
1 parent f2921f2 commit 44fe87f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,11 @@ function(build_tests)
configure_file(EXAMPLES/MATRIX_MARKET/issue215.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue215.mtx)
configure_file(EXAMPLES/MATRIX_MARKET/issue215.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/issue215.sh)
add_test(NAME issue215_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} issue215.sh)
if (WIN32 AND BUILD_SHARED_LIBS)
set_tests_properties(arpackmm_tst issue401_tst issue215_tst
PROPERTIES
ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$<TARGET_FILE_DIR:arpack>")
endif()
endif()

if (PYTHON3)
Expand Down

0 comments on commit 44fe87f

Please sign in to comment.