11set (tmpdir ${CMAKE_CURRENT_BINARY_DIR} )
22
33add_executable (test_minimal test_minimal.f90)
4- target_link_libraries (test_minimal PRIVATE h5fortran ${HDF5_LIBRARIES} )
5- target_include_directories (test_minimal PRIVATE ${CMAKE_BINARY_DIR} ${ HDF5_INCLUDE_DIRS} )
4+ target_link_libraries (test_minimal PRIVATE h5fortran::h5fortran ${HDF5_LIBRARIES} )
5+ target_include_directories (test_minimal PRIVATE ${HDF5_INCLUDE_DIRS} )
66add_test (NAME h5fortran:minimal COMMAND $<TARGET_FILE:test_minimal> ${tmpdir} )
77if (WIN32 AND HDF5_ROOT)
88 set_tests_properties (h5fortran:minimal PROPERTIES ENVIRONMENT "PATH=${HDF5_ROOT} /bin;$ENV{PATH} " )
99endif ()
1010
1111add_executable (test_errors test_error.f90)
12- target_link_libraries (test_errors PRIVATE h5fortran ${HDF5_LIBRARIES} )
13- target_include_directories (test_errors PRIVATE ${CMAKE_BINARY_DIR} ${ HDF5_INCLUDE_DIRS} )
12+ target_link_libraries (test_errors PRIVATE h5fortran::h5fortran ${HDF5_LIBRARIES} )
13+ target_include_directories (test_errors PRIVATE ${HDF5_INCLUDE_DIRS} )
1414add_test (NAME h5fortran:ErrorCheck COMMAND $<TARGET_FILE:test_errors> ${tmpdir} )
1515set_tests_properties (h5fortran:ErrorCheck PROPERTIES SKIP_RETURN_CODE 77)
1616if (WIN32 AND HDF5_ROOT)
1717 set_tests_properties (h5fortran:ErrorCheck PROPERTIES ENVIRONMENT "PATH=${HDF5_ROOT} /bin;$ENV{PATH} " )
1818endif ()
1919
2020add_executable (testh5 test_hdf5_ifc.f90)
21- target_link_libraries (testh5 PRIVATE h5fortran ${HDF5_LIBRARIES} )
22- target_include_directories (testh5 PRIVATE ${CMAKE_BINARY_DIR} ${ HDF5_INCLUDE_DIRS} )
21+ target_link_libraries (testh5 PRIVATE h5fortran::h5fortran ${HDF5_LIBRARIES} )
22+ target_include_directories (testh5 PRIVATE ${HDF5_INCLUDE_DIRS} )
2323if (${CMAKE_Fortran_COMPILER_ID} STREQUAL GNU)
2424 target_compile_options (testh5 PRIVATE -Wno-compare-reals)
2525endif ()
@@ -32,8 +32,8 @@ if(WIN32 AND HDF5_ROOT)
3232endif ()
3333
3434add_executable (test_deflate test_deflate.f90)
35- target_link_libraries (test_deflate PRIVATE h5fortran ${HDF5_LIBRARIES} )
36- target_include_directories (test_deflate PRIVATE ${CMAKE_BINARY_DIR} ${ HDF5_INCLUDE_DIRS} )
35+ target_link_libraries (test_deflate PRIVATE h5fortran::h5fortran ${HDF5_LIBRARIES} )
36+ target_include_directories (test_deflate PRIVATE ${HDF5_INCLUDE_DIRS} )
3737add_test (NAME h5fortran:deflate COMMAND $<TARGET_FILE:test_deflate> ${tmpdir} )
3838set_tests_properties (h5fortran:deflate PROPERTIES SKIP_RETURN_CODE 77)
3939if (WIN32 AND HDF5_ROOT)
@@ -45,8 +45,8 @@ set(testfile ${tmpdir}/p5.h5)
4545
4646# ====
4747add_executable (test_shape test_shape.f90)
48- target_link_libraries (test_shape PRIVATE h5fortran ${HDF5_LIBRARIES} )
49- target_include_directories (test_shape PRIVATE ${CMAKE_BINARY_DIR} ${ HDF5_INCLUDE_DIRS} )
48+ target_link_libraries (test_shape PRIVATE h5fortran::h5fortran ${HDF5_LIBRARIES} )
49+ target_include_directories (test_shape PRIVATE ${HDF5_INCLUDE_DIRS} )
5050
5151add_test (NAME h5fortran:ShapeCheck COMMAND $<TARGET_FILE:test_shape> ${testfile} /group69/flux_node)
5252set_tests_properties (h5fortran:ShapeCheck PROPERTIES
0 commit comments