diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2019-06-18 12:46:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2019-06-18 12:46:25 (GMT) |
commit | e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360 (patch) | |
tree | 18f277bcdb333d7091c598c39b70e4a2e3b50cd0 /hl/fortran/test | |
parent | f73a190d2c2e2bfe80508599e0d76d62c358ae68 (diff) | |
download | hdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.zip hdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.tar.gz hdf5-e7f16c6f2c7b031d7e9b4ba22a9fcdad4d258360.tar.bz2 |
HDFFV-10805 Add option to only build shared targets
HDFFV-10805 Add ONLY_SHARED_LIBS option and prefer shared over static
HDFFV-10803 Update FindSZIP.cmake find module
Remove unneeded modules and update java modules
Diffstat (limited to 'hl/fortran/test')
-rw-r--r-- | hl/fortran/test/CMakeLists.txt | 47 | ||||
-rw-r--r-- | hl/fortran/test/CMakeTests.cmake | 60 |
2 files changed, 30 insertions, 77 deletions
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt index fca2852..c152142 100644 --- a/hl/fortran/test/CMakeLists.txt +++ b/hl/fortran/test/CMakeLists.txt @@ -13,18 +13,10 @@ set (H5_TESTS macro (ADD_H5_FORTRAN_EXE file) add_executable (hl_f90_${file} ${file}.F90) - target_include_directories (hl_f90_${file} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) target_compile_options(hl_f90_${file} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (hl_f90_${file} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} - ) # set_property(TARGET hl_f90_${file} APPEND PROPERTY # LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> # ) @@ -34,35 +26,30 @@ macro (ADD_H5_FORTRAN_EXE file) if(MSVC) set_property(TARGET hl_f90_${file} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() - set_target_properties (hl_f90_${file} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER test/hl/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) - if (BUILD_SHARED_LIBS) - add_executable (hl_f90_${file}-shared ${file}.F90) - target_include_directories (hl_f90_${file}-shared + if (NOT BUILD_SHARED_LIBS) + target_include_directories (hl_f90_${file} PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" + "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" ) - target_compile_options(hl_f90_${file}-shared + target_link_libraries (hl_f90_${file} PRIVATE - $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> + ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_F90_TEST_LIB_TARGET} + ) + set_target_properties (hl_f90_${file} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER test/hl/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + ) + else () + target_include_directories (hl_f90_${file} + PRIVATE + "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" ) - target_link_libraries (hl_f90_${file}-shared + target_link_libraries (hl_f90_${file} PRIVATE ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_F90_TEST_LIBSH_TARGET} ) -# set_property(TARGET hl_f90_${file}-shared APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> -# ) -# set_property(TARGET hl_f90_${file}-shared APPEND PROPERTY -# LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_LINK_FLAGS}> -# ) - if(MSVC) - set_property(TARGET hl_f90_${file}-shared PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") - endif() - set_target_properties (hl_f90_${file}-shared PROPERTIES + set_target_properties (hl_f90_${file} PROPERTIES LINKER_LANGUAGE Fortran FOLDER test/hl/fortran Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index 54cc6ef..2137d1a 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -16,6 +16,18 @@ ############################################################################## ############################################################################## +set (test_CLEANFILES + dsetf1.h5 + dsetf2.h5 + dsetf3.h5 + dsetf4.h5 + dsetf5.h5 + f1img.h5 + f1tab.h5 + f2tab.h5 + tstds.h5 +) + macro (ADD_H5_FORTRAN_TEST file) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_FORTRAN_f90_${file} COMMAND $<TARGET_FILE:hl_f90_${file}>) @@ -32,61 +44,15 @@ macro (ADD_H5_FORTRAN_TEST file) ) endif () set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES DEPENDS HL_FORTRAN_test-clear-objects) - if (BUILD_SHARED_LIBS) - if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND $<TARGET_FILE:hl_f90_${file}-shared>) - else () - add_test (NAME HL_FORTRAN_f90_${file}-shared COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:hl_f90_${file}-shared>" - -D "TEST_ARGS:STRING=" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=hl_f90_${file}-shared.txt" - #-D "TEST_REFERENCE=hl_f90_${file}-shared.out" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" - ) - endif () - set_tests_properties (HL_FORTRAN_f90_${file}-shared PROPERTIES DEPENDS HL_FORTRAN_test-shared-clear-objects) - endif () endmacro () # Remove any output file left over from previous test run add_test ( NAME HL_FORTRAN_test-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - dsetf1.h5 - dsetf2.h5 - dsetf3.h5 - dsetf4.h5 - dsetf5.h5 - f1img.h5 - f1tab.h5 - f2tab.h5 - tstds.h5 + -E remove ${test_CLEANFILES} ) -if (BUILD_SHARED_LIBS) - add_test ( - NAME HL_FORTRAN_test-shared-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - dsetf1.h5 - dsetf2.h5 - dsetf3.h5 - dsetf4.h5 - dsetf5.h5 - f1img.h5 - f1tab.h5 - f2tab.h5 - tstds.h5 - ) - set_tests_properties (HL_FORTRAN_test-shared-clear-objects - PROPERTIES DEPENDS "HL_FORTRAN_f90_tsttable;HL_FORTRAN_f90_tstimage;HL_FORTRAN_f90_tstlite;HL_FORTRAN_f90_tstds" - ) -endif () - foreach (h5_test ${H5_TESTS}) ADD_H5_FORTRAN_TEST(${h5_test}) endforeach () |