Skip to content

Commit

Permalink
don't spill config test to source dir
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 13, 2020
1 parent a149c1f commit 3e03baf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cmake/hdf5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ message(STATUS "HDF5 library: ${HDF5_LIBRARIES}")
set(CMAKE_REQUIRED_INCLUDES ${HDF5_INCLUDE_DIRS})
set(CMAKE_REQUIRED_LIBRARIES ${HDF5_LIBRARIES})

set(ENV{BINDIR} ${CMAKE_CURRENT_BINARY_DIR})

include(CheckFortranSourceCompiles)
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/src/tests/test_minimal.f90 _code)
check_fortran_source_compiles(${_code} HDF5_compiles_ok SRC_EXT f90)
Expand Down
4 changes: 3 additions & 1 deletion src/tests/test_minimal.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ program test_minimal
integer :: i,l

call get_command_argument(1, argv, length=l, status=i)
if (i /= 0 .or. l == 0) error stop 'specify path'
if (i /= 0 .or. l == 0) call get_environment_variable("BINDIR", argv, length=l, status=i)
if (i /= 0 .or. l == 0) argv = '.'

filename = trim(argv) // '/junk_minimal.h5'
print *, 'test path: ', filename

Expand Down

0 comments on commit 3e03baf

Please sign in to comment.