@@ -62,6 +62,10 @@ if(PHREEQCRM_FORTRAN_TESTING)
62
62
source_group ("Source Files" FILES "../src/BMI_not_implemented.inc" )
63
63
source_group ("Source Files" FILES "../src/IPhreeqcPhast/IPhreeqc/IPhreeqc_interface.F90" )
64
64
source_group ("Source Files" FILES "../src/RM_interface.F90" )
65
+
66
+ if (PHREEQCRM_STATIC_RUNTIME)
67
+ set_property (TARGET FortranAdvect PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
68
+ endif ()
65
69
endif ()
66
70
67
71
@@ -163,6 +167,10 @@ if(PHREEQCRM_FORTRAN_TESTING)
163
167
target_link_libraries (TestRM FortranAdvect)
164
168
endif ()
165
169
170
+ if (PHREEQCRM_STATIC_RUNTIME)
171
+ set_property (TARGET TestRM PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
172
+ endif ()
173
+
166
174
#-----------------------------------------------------------------------------#
167
175
168
176
# test PhreeqcRM dtor
@@ -181,6 +189,10 @@ target_link_libraries(TestRMdtor PhreeqcRM::PhreeqcRM)
181
189
182
190
add_test (TestRMdtor TestRMdtor)
183
191
192
+ if (PHREEQCRM_STATIC_RUNTIME)
193
+ set_property (TARGET TestRMdtor PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
194
+ endif ()
195
+
184
196
#-----------------------------------------------------------------------------#
185
197
186
198
# test BMIPhreeqcRM dtor
@@ -201,6 +213,10 @@ target_link_libraries(TestBMIdtor PhreeqcRM::PhreeqcRM)
201
213
202
214
add_test (TestBMIdtor TestBMIdtor)
203
215
216
+ if (PHREEQCRM_STATIC_RUNTIME)
217
+ set_property (TARGET TestBMIdtor PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" )
218
+ endif ()
219
+
204
220
#-----------------------------------------------------------------------------#
205
221
206
222
# test compile and run
@@ -274,6 +290,16 @@ set_property(TARGET TestRM APPEND
274
290
TestAllMethods_py.log .txt
275
291
)
276
292
293
+ if (WIN32 AND PHREEQCRM_FORTRAN_TESTING)
294
+ # this attempts to find the location of libiomp5md.dll to add it to the path
295
+ # this should work for the most recent versions of oneAPI (ifort and ifx)
296
+ get_filename_component (FORTRAN_COMPILER_DIR ${CMAKE_Fortran_COMPILER} DIRECTORY )
297
+ file (TO_NATIVE_PATH "${FORTRAN_COMPILER_DIR} " FORTRAN_COMPILER_DIR_NATIVE)
298
+ set_tests_properties (TestRM PROPERTIES
299
+ ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:${FORTRAN_COMPILER_DIR_NATIVE} "
300
+ )
301
+ endif ()
302
+
277
303
if (MSVC AND BUILD_SHARED_LIBS )
278
304
# copy PhreeqcRM dll
279
305
add_custom_command (TARGET TestRM POST_BUILD
0 commit comments