diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2015-05-07 21:05:14 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2015-05-07 21:05:14 (GMT) |
commit | 984ecb72c2fa62d233383b24047e04061754ae34 (patch) | |
tree | a0a1ce905153a08466dae1354e14d426c86b3849 /fortran/examples/CMakeLists.txt | |
parent | ed599421c5ef01347368d50b1b7dbed3b323c43f (diff) | |
parent | 8f82c9b8be875cd28e18402e920f8e162d8f8d38 (diff) | |
download | hdf5-984ecb72c2fa62d233383b24047e04061754ae34.zip hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.gz hdf5-984ecb72c2fa62d233383b24047e04061754ae34.tar.bz2 |
[svn-r27038] Merge of r26393-27031 from the trunk.
Tested on 64-bit linux VM w/ C++ and Fortran 2003
Diffstat (limited to 'fortran/examples/CMakeLists.txt')
-rw-r--r-- | fortran/examples/CMakeLists.txt | 49 |
1 files changed, 22 insertions, 27 deletions
diff --git a/fortran/examples/CMakeLists.txt b/fortran/examples/CMakeLists.txt index 1f59f32..2bf0bf6 100644 --- a/fortran/examples/CMakeLists.txt +++ b/fortran/examples/CMakeLists.txt @@ -8,7 +8,7 @@ PROJECT (HDF5_F90_EXAMPLES C CXX Fortran) #----------------------------------------------------------------------------- # Setup include Directories #----------------------------------------------------------------------------- -INCLUDE_DIRECTORIES (${CMAKE_Fortran_MODULE_DIRECTORY} ${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) +INCLUDE_DIRECTORIES (${HDF5_F90_BINARY_DIR} ${HDF5_F90_SRC_DIR}/src) #----------------------------------------------------------------------------- # Define Sources @@ -41,57 +41,52 @@ set (F2003_examples foreach (example ${examples}) add_executable (f90_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f90_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_${example} " " " ") - if (WIN32) - set_property (TARGET f90_ex_${example} - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f90_ex_${example} ${LIB_TYPE} " " " ") target_link_libraries (f90_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - set_target_properties (f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f90_ex_${example} PROPERTIES FOLDER examples/fortran) + target_include_directories (f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f90_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endforeach (example ${examples}) if (HDF5_ENABLE_F2003) foreach (example ${F2003_examples}) add_executable (f03_ex_${example} ${HDF5_F90_EXAMPLES_SOURCE_DIR}/${example}.f90) TARGET_NAMING (f03_ex_${example} ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f03_ex_${example} " " " ") - if (WIN32) - set_property (TARGET f03_ex_${example} - APPEND PROPERTY COMPILE_DEFINITIONS HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f03_ex_${example} ${LIB_TYPE} " " " ") target_link_libraries (f03_ex_${example} ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ) - set_target_properties (f03_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f03_ex_${example} PROPERTIES FOLDER examples/fortran03) + target_include_directories (f03_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f03_ex_${example} PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran03 + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endforeach (example ${F2003_examples}) endif (HDF5_ENABLE_F2003) if (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) add_executable (f90_ex_ph5example ${HDF5_F90_EXAMPLES_SOURCE_DIR}/ph5example.f90) TARGET_NAMING (f90_ex_ph5example ${LIB_TYPE}) - TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example " " " ") - if (WIN32) - set_property (TARGET f90_ex_ph5example - APPEND PROPERTY COMPILE_DEFINITIONS - HDF5F90_WINDOWS - ) - endif (WIN32) + TARGET_FORTRAN_PROPERTIES (f90_ex_ph5example ${LIB_TYPE} " " " ") target_link_libraries (f90_ex_ph5example ${HDF5_F90_LIB_TARGET} ${HDF5_LIB_TARGET} ${MPI_Fortran_LIBRARIES} ) - set_target_properties (f90_ex_ph5example PROPERTIES LINKER_LANGUAGE Fortran) - set_target_properties (f90_ex_ph5example PROPERTIES FOLDER examples/fortran) + target_include_directories (f90_ex_ph5example PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY}/static) + set_target_properties (f90_ex_ph5example PROPERTIES + LINKER_LANGUAGE Fortran + FOLDER examples/fortran + Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + ) endif (H5_HAVE_PARALLEL AND MPI_Fortran_FOUND) if (BUILD_TESTING) |