Skip to content

Commit 6dc4f29

Browse files
committed
example: LD_LIBRARY_PATH
1 parent 7a2ca45 commit 6dc4f29

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

example/CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.11...3.25)
1+
cmake_minimum_required(VERSION 3.22...3.27)
22

33
project(h5fortranExample
44
LANGUAGES C CXX Fortran)
@@ -43,11 +43,14 @@ add_test(NAME CPP_fcn COMMAND cpp_fcn)
4343

4444
# properties
4545
get_property(test_names DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY TESTS)
46-
set_property(TEST ${test_names} PROPERTY TIMEOUT 10)
4746
set_property(TEST ${test_names} PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
4847

49-
if(WIN32 AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
48+
if(WIN32)
5049
set_property(TEST ${test_names} PROPERTY
51-
ENVIRONMENT_MODIFICATION "PATH=path_list_append:${ZLIB_INCLUDE_DIRS}/../bin;PATH=path_list_append:${ZLIB_INCLUDE_DIR}/../bin;PATH=path_list_append:${PROJECT_BINARY_DIR}/bin;PATH=path_list_append:${h5fortran_DIR}/../bin"
50+
ENVIRONMENT_MODIFICATION "PATH=path_list_append:${ZLIB_INCLUDE_DIRS}/../bin;PATH=path_list_append:${h5fortran_DIR}/../bin"
51+
)
52+
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
53+
set_property(TEST ${test_names} PROPERTY
54+
ENVIRONMENT_MODIFICATION "LD_LIBRARY_PATH=path_list_append:${ZLIB_INCLUDE_DIRS}/../lib;LD_LIBRARY_PATH=path_list_append:${h5fortran_DIR}/../lib"
5255
)
5356
endif()

0 commit comments

Comments
 (0)