1
- set (properties ${TEST_PROPERTIES} )
1
+ set (properties " ${TEST_PROPERTIES} " )
2
2
set (script)
3
3
set (tests)
4
4
@@ -21,7 +21,7 @@ if(NOT EXISTS "${TEST_EXECUTABLE}")
21
21
)
22
22
endif ()
23
23
# We need to figure out if some environment is needed to run the test listing.
24
- cmake_parse_arguments ("_properties" "" "ENVIRONMENT " "" ${properties} )
24
+ cmake_parse_arguments ("_properties" "" "" "ENVIRONMENT " ${properties} )
25
25
if (_properties_ENVIRONMENT)
26
26
foreach (_env ${_properties_ENVIRONMENT} )
27
27
string (REGEX REPLACE "([a-zA-Z0-9_]+)=(.*)" "\\ 1" _key "${_env} " )
@@ -31,6 +31,13 @@ if(_properties_ENVIRONMENT)
31
31
endif ()
32
32
endforeach ()
33
33
endif ()
34
+ # Set Path to avoid DLL missing
35
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
36
+ string (REPLACE "?" ";" DLL_LIBRARY_PATH "$ENV{DLL_LIBRARY_PATH} " )
37
+ set (ENV{Path } "${DLL_LIBRARY_PATH} ;$ENV{Path} " )
38
+ string (REPLACE ";" "\\\\ ;" DLL_LIBRARY_PATH "${DLL_LIBRARY_PATH} " )
39
+ endif ()
40
+
34
41
execute_process (
35
42
COMMAND "${TEST_EXECUTABLE} " --list-tests
36
43
WORKING_DIRECTORY "${TEST_WORKING_DIR} "
@@ -75,6 +82,13 @@ foreach(line ${output})
75
82
WORKING_DIRECTORY "${TEST_WORKING_DIR} "
76
83
${properties}
77
84
)
85
+ if (CMAKE_HOST_SYSTEM_NAME STREQUAL Windows)
86
+ add_command(set_tests_properties
87
+ "${pretty_target} "
88
+ PROPERTIES
89
+ ENVIRONMENT "Path=${DLL_LIBRARY_PATH} "
90
+ )
91
+ endif ()
78
92
list (APPEND tests "${pretty_target} " )
79
93
else ()
80
94
message (FATAL_ERROR
0 commit comments