diff options
author | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-06-25 17:39:35 (GMT) |
---|---|---|
committer | M. Scot Breitenfeld <brtnfld@hdfgroup.org> | 2019-06-25 17:39:35 (GMT) |
commit | 35c9af8371c4da7f5327c76ddab097b442128f59 (patch) | |
tree | d51be51c385a9b463388ba154efc3fa37cad49e8 /hl/fortran/examples | |
parent | c752332bfd0e9c3090f3a0c02d0253cd45c2e2ce (diff) | |
parent | 1d8f7bf297100ec11204442708a7f670a89f3f02 (diff) | |
download | hdf5-inactive/parallel_vds_develop.zip hdf5-inactive/parallel_vds_develop.tar.gz hdf5-inactive/parallel_vds_develop.tar.bz2 |
Merge branch 'develop' into parallel_vds_developinactive/parallel_vds_develop
Diffstat (limited to 'hl/fortran/examples')
-rw-r--r-- | hl/fortran/examples/CMakeLists.txt | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt index 27971b2..e41b8fe 100644 --- a/hl/fortran/examples/CMakeLists.txt +++ b/hl/fortran/examples/CMakeLists.txt @@ -8,18 +8,10 @@ set (examples foreach (example ${examples}) add_executable (hl_f90_ex_${example} ${HDF5_HL_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) - target_include_directories (hl_f90_ex_${example} - PRIVATE - "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" - ) target_compile_options(hl_f90_ex_${example} PRIVATE $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:${WIN_COMPILE_FLAGS}> ) - target_link_libraries (hl_f90_ex_${example} - PRIVATE - ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} - ) # set_property(TARGET hl_f90_ex_${example} APPEND PROPERTY # LINK_FLAGS $<$<STREQUAL:"x${CMAKE_Fortran_SIMULATE_ID}","xMSVC">:"-SUBSYSTEM:CONSOLE"> # ) @@ -29,11 +21,35 @@ foreach (example ${examples}) if(MSVC) set_property(TARGET hl_f90_ex_${example} PROPERTY LINK_FLAGS "/SUBSYSTEM:CONSOLE ${WIN_LINK_FLAGS}") endif() - set_target_properties (hl_f90_ex_${example} PROPERTIES - LINKER_LANGUAGE Fortran - FOLDER examples/hl/fortran - Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static - ) + if (NOT BUILD_SHARED_LIBS) + target_include_directories (hl_f90_ex_${example} + PRIVATE + "${CMAKE_Fortran_MODULE_DIRECTORY}/static;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" + ) + target_link_libraries (hl_f90_ex_${example} + PRIVATE + ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} + ) + set_target_properties (hl_f90_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/hl/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/static + ) + else () + target_include_directories (hl_f90_ex_${example} + PRIVATE + "${CMAKE_Fortran_MODULE_DIRECTORY}/shared;${HDF5_F90_BINARY_DIR};${HDF5_F90_SRC_DIR}/src" + ) + target_link_libraries (hl_f90_ex_${example} + PRIVATE + ${HDF5_HL_F90_LIBSH_TARGET} ${HDF5_F90_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} + ) + set_target_properties (hl_f90_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/hl/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}/shared + ) + endif () endforeach () if (BUILD_TESTING) |