Skip to content

Commit 3e03baf

Browse files
committed
don't spill config test to source dir
1 parent a149c1f commit 3e03baf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cmake/hdf5.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ message(STATUS "HDF5 library: ${HDF5_LIBRARIES}")
8282
set(CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS})
8383
set(CMAKE_REQUIRED_LIBRARIES ${HDF5_LIBRARIES})
8484

85+
set(ENV{BINDIR} ${CMAKE_CURRENT_BINARY_DIR})
86+
8587
include(CheckFortranSourceCompiles)
8688
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/test_minimal.f90 _code)
8789
check_fortran_source_compiles(${_code} HDF5_compiles_ok SRC_EXT f90)

src/tests/test_minimal.f90

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ program test_minimal
1212
integer :: i,l
1313

1414
call get_command_argument(1, argv, length=l, status=i)
15-
if (i /= 0 .or. l == 0) error stop 'specify path'
15+
if (i /= 0 .or. l == 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
16+
if (i /= 0 .or. l == 0) argv = '.'
17+
1618
filename = trim(argv) // '/junk_minimal.h5'
1719
print *, 'test path: ', filename
1820

0 commit comments

Comments
 (0)