summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-03-30 17:32:55 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-03-30 17:32:55 (GMT)
commitc923afdf50173d8fd80d252375eb01f3eb8fdf8e (patch)
treeed93d0ead945d4f5c5115e76134639ba7ba11865 /hl
parent6a664ffa5aba85eb2d35526fa9d41a5b69f7f21d (diff)
downloadhdf5-c923afdf50173d8fd80d252375eb01f3eb8fdf8e.zip
hdf5-c923afdf50173d8fd80d252375eb01f3eb8fdf8e.tar.gz
hdf5-c923afdf50173d8fd80d252375eb01f3eb8fdf8e.tar.bz2
[svn-r26654] Bring trunk CMake changes to branch.
Tested: local linux
Diffstat (limited to 'hl')
-rw-r--r--hl/fortran/examples/CMakeLists.txt2
-rw-r--r--hl/fortran/src/CMakeLists.txt48
-rw-r--r--hl/fortran/test/CMakeLists.txt4
3 files changed, 27 insertions, 27 deletions
diff --git a/hl/fortran/examples/CMakeLists.txt b/hl/fortran/examples/CMakeLists.txt
index 64c641d..bded2d9 100644
--- a/hl/fortran/examples/CMakeLists.txt
+++ b/hl/fortran/examples/CMakeLists.txt
@@ -5,7 +5,6 @@ PROJECT (HDF5_HL_F90_EXAMPLES C CXX Fortran)
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
- ${CMAKE_Fortran_MODULE_DIRECTORY}
${HDF5_F90_BINARY_DIR}
${HDF5_F90_SRC_DIR}/src
)
@@ -24,6 +23,7 @@ foreach (example ${examples})
${HDF5_F90_LIB_TARGET}
${HDF5_LIB_TARGET}
)
+ target_include_directories (hl_f90_ex_${example} PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
set_target_properties (hl_f90_ex_${example} PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (hl_f90_ex_${example} PROPERTIES FOLDER examples/hl/fortran)
diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt
index c9d3c32..6e6e44a 100644
--- a/hl/fortran/src/CMakeLists.txt
+++ b/hl/fortran/src/CMakeLists.txt
@@ -8,7 +8,6 @@ INCLUDE_DIRECTORIES (
${HDF5_HL_SRC_DIR}/src
${HDF5_F90_SRC_DIR}/src
${HDF5_F90_BINARY_DIR}
- ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-----------------------------------------------------------------------------
@@ -53,8 +52,8 @@ if (BUILD_SHARED_LIBS)
if (WIN32)
set_property (TARGET ${HDF5_HL_F90_LIB_TARGET}
APPEND PROPERTY COMPILE_DEFINITIONS
- BUILD_HDF5_DLL
- )
+ BUILD_HDF5_HL_DLL
+ )
if (MSVC)
set (SHARED_LINK_FLAGS "/DLL")
endif (MSVC)
@@ -67,7 +66,6 @@ if (WIN32)
)
endif (WIN32)
TARGET_FORTRAN_PROPERTIES (${HDF5_HL_F90_LIB_TARGET} ${LIB_TYPE} " " ${SHARED_LINK_FLAGS})
-set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES LINKER_LANGUAGE Fortran)
target_link_libraries (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_LIB_TARGET}")
H5_SET_LIB_OPTIONS (${HDF5_HL_F90_LIB_TARGET} ${HDF5_HL_F90_LIB_NAME} ${LIB_TYPE})
@@ -75,37 +73,35 @@ set_target_properties (${HDF5_HL_F90_LIB_TARGET} PROPERTIES
FOLDER libraries/hl/fortran
LINKER_LANGUAGE Fortran
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
)
#-----------------------------------------------------------------------------
# Add file(s) to CMake Install
#-----------------------------------------------------------------------------
+
if (WIN32)
- install (
- FILES
- ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5ds.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5tb.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5lt.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE}/h5im.mod
- DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}
- COMPONENT
- fortheaders
- )
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY}/\${BUILD_TYPE})
else (WIN32)
- install (
- FILES
- ${CMAKE_Fortran_MODULE_DIRECTORY}/h5ds.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/h5tb.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/h5lt.mod
- ${CMAKE_Fortran_MODULE_DIRECTORY}/h5im.mod
- DESTINATION
- ${HDF5_INSTALL_INCLUDE_DIR}
- COMPONENT
- fortheaders
- )
+ set (MOD_BUILD_DIR ${CMAKE_Fortran_MODULE_DIRECTORY})
endif (WIN32)
+set (mod_files
+ ${MOD_BUILD_DIR}/h5ds.mod
+ ${MOD_BUILD_DIR}/h5tb.mod
+ ${MOD_BUILD_DIR}/h5lt.mod
+ ${MOD_BUILD_DIR}/h5im.mod
+)
+
+install (
+ FILES
+ ${mod_files}
+ DESTINATION
+ ${HDF5_INSTALL_INCLUDE_DIR}
+ COMPONENT
+ fortheaders
+)
+
#-----------------------------------------------------------------------------
# Add Target(s) to CMake Install for import into other projects
#-----------------------------------------------------------------------------
diff --git a/hl/fortran/test/CMakeLists.txt b/hl/fortran/test/CMakeLists.txt
index 97510c6..55fb987 100644
--- a/hl/fortran/test/CMakeLists.txt
+++ b/hl/fortran/test/CMakeLists.txt
@@ -11,6 +11,7 @@ add_executable (hl_f90_tstds tstds.f90)
TARGET_NAMING (hl_f90_tstds ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (hl_f90_tstds ${LIB_TYPE} " " " ")
target_link_libraries (hl_f90_tstds ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
+target_include_directories (hl_f90_tstds PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
set_target_properties (hl_f90_tstds PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (hl_f90_tstds PROPERTIES FOLDER test/hl/fortran)
@@ -19,6 +20,7 @@ add_executable (hl_f90_tstlite tstlite.f90)
TARGET_NAMING (hl_f90_tstlite ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (hl_f90_tstlite ${LIB_TYPE} " " " ")
target_link_libraries (hl_f90_tstlite ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
+target_include_directories (hl_f90_tstlite PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
set_target_properties (hl_f90_tstlite PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (hl_f90_tstlite PROPERTIES FOLDER test/hl/fortran)
@@ -27,6 +29,7 @@ add_executable (hl_f90_tstimage tstimage.f90)
TARGET_NAMING (hl_f90_tstimage ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (hl_f90_tstimage ${LIB_TYPE} " " " ")
target_link_libraries (hl_f90_tstimage ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
+target_include_directories (hl_f90_tstimage PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
set_target_properties (hl_f90_tstimage PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (hl_f90_tstimage PROPERTIES FOLDER test/hl/fortran)
@@ -35,6 +38,7 @@ add_executable (hl_f90_tsttable tsttable.f90)
TARGET_NAMING (hl_f90_tsttable ${LIB_TYPE})
TARGET_FORTRAN_PROPERTIES (hl_f90_tsttable ${LIB_TYPE} " " " ")
target_link_libraries (hl_f90_tsttable ${HDF5_HL_F90_LIB_TARGET} ${HDF5_F90_LIB_TARGET})
+target_include_directories (hl_f90_tsttable PRIVATE ${CMAKE_Fortran_MODULE_DIRECTORY})
set_target_properties (hl_f90_tsttable PROPERTIES LINKER_LANGUAGE Fortran)
set_target_properties (hl_f90_tsttable PROPERTIES FOLDER test/hl/fortran)