Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use props for includes and remove global includes #3921

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeFilters.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT)
if (H5_HAVE_FILTER_DEFLATE)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE")
endif ()
INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS})
set (HDF5_COMP_INCLUDE_DIRECTORIES "${HDF5_COMP_INCLUDE_DIRECTORIES};${ZLIB_INCLUDE_DIRS}")
message (VERBOSE "Filter HDF5_ZLIB is ON")
else ()
set (HDF5_ENABLE_Z_LIB_SUPPORT OFF CACHE BOOL "" FORCE)
Expand Down Expand Up @@ -148,7 +148,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT)
set (H5_HAVE_FILTER_SZIP 1)
set (H5_HAVE_SZLIB_H 1)
set (H5_HAVE_LIBSZ 1)
INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS})
set (HDF5_COMP_INCLUDE_DIRECTORIES "${HDF5_COMP_INCLUDE_DIRECTORIES};${SZIP_INCLUDE_DIRS}")
message (VERBOSE "Filter SZIP is ON")
if (H5_HAVE_FILTER_SZIP)
set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DECODE")
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON)
# Include directories in the source or build tree should come before other
# directories to prioritize headers in the sources over installed ones.
#-----------------------------------------------------------------------------
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set (HDF5_COMP_INCLUDE_DIRECTORIES)

#-----------------------------------------------------------------------------
# Mac OS X Options
Expand Down
8 changes: 3 additions & 5 deletions HDF5Examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ message (STATUS "HDF5 H5_LIBVER_DIR: ${H5_LIBVER_DIR} HDF5_VERSION_MAJOR: ${HDF5
option (HDF_BUILD_JAVA "Build JAVA support" OFF)
if (HDF_BUILD_JAVA)
find_package (Java)
INCLUDE_DIRECTORIES (
${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH2}
)

include (${H5EX_RESOURCES_DIR}/UseJava.cmake)
endif ()
Expand Down Expand Up @@ -120,7 +116,9 @@ if (HDF_ENABLE_THREADSAFE)
set (H5EX_HDF5_LINK_LIBS ${H5EX_HDF5_LINK_LIBS} Threads::Threads)
endif ()

INCLUDE_DIRECTORIES (${H5EX_HDF5_INCLUDE_DIRS})
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${H5EX_HDF5_INCLUDE_DIRS}"
)

#-----------------------------------------------------------------------------
# Dashboard and Testing Settings
Expand Down
6 changes: 2 additions & 4 deletions HDF5Examples/FORTRAN/H5D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ project (HDF5Examples_FORTRAN_H5D Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT}
${PROJECT_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)

#-----------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions HDF5Examples/FORTRAN/H5G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ project (HDF5Examples_FORTRAN_H5G Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT}
${PROJECT_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)

#-----------------------------------------------------------------------------
Expand Down
7 changes: 2 additions & 5 deletions HDF5Examples/FORTRAN/H5PAR/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@ project (HDF5Examples_FORTRAN_H5PAR Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT}
${PROJECT_BINARY_DIR}
${HDF5_F90_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)

#-----------------------------------------------------------------------------
Expand Down
6 changes: 2 additions & 4 deletions HDF5Examples/FORTRAN/H5T/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ project (HDF5Examples_FORTRAN_H5T Fortran)
#-----------------------------------------------------------------------------
# Setup include Directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (
${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT}
${PROJECT_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${CMAKE_Fortran_MODULE_DIRECTORY}${HDF_MOD_EXT};${HDF5_F90_BINARY_DIR};${PROJECT_BINARY_DIR};${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
)

#-----------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions HDF5Examples/JAVA/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
cmake_minimum_required (VERSION 3.18)
project (HDFJAVA_EXAMPLES Java)

set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)

add_subdirectory (H5D)
add_subdirectory (H5T)
add_subdirectory (H5G)
Expand Down
5 changes: 0 additions & 5 deletions HDF5Examples/JAVA/H5D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project (HDF5Examples_JAVA_H5D Java)

set (CMAKE_VERBOSE_MAKEFILE 1)

set_directory_properties(PROPERTIES
INCLUDE_DIRECTORIES
"${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)

#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions HDF5Examples/JAVA/H5G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project (HDF5Examples_JAVA_GROUPS Java)

set (CMAKE_VERBOSE_MAKEFILE 1)

set_directory_properties(PROPERTIES
INCLUDE_DIRECTORIES
"${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)

#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions HDF5Examples/JAVA/H5J/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project (HDF5Examples_JAVA_INTRO Java)

set (CMAKE_VERBOSE_MAKEFILE 1)

set_directory_properties(PROPERTIES
INCLUDE_DIRECTORIES
"${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)

#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions HDF5Examples/JAVA/H5T/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ project (HDF5Examples_JAVA_H5T Java)

set (CMAKE_VERBOSE_MAKEFILE 1)

set_directory_properties(PROPERTIES
INCLUDE_DIRECTORIES
"${HDFJAVA_LIB_DIR};${JAVA_INCLUDE_PATH};${JAVA_INCLUDE_PATH2}"
)

#-----------------------------------------------------------------------------
# Define Sources
#-----------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion config/cmake/LIBAEC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ configure_file (${LIBAEC_RESOURCES_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${LIBAEC_BINARY_DIR} ${LIBAEC_SOURCE_DIR}/src ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${LIBAEC_BINARY_DIR};${LIBAEC_SOURCE_DIR}/src;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

#-----------------------------------------------------------------------------
# Define LIBAEC Library
Expand Down
4 changes: 3 additions & 1 deletion config/cmake/ZLIB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ endif ()
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
INCLUDE_DIRECTORIES (${ZLIB_BINARY_DIR} ${ZLIB_SOURCE_DIR} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${ZLIB_BINARY_DIR};${ZLIB_SOURCE_DIR};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

#============================================================================
# zlib
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ endif ()
if (BUILD_STATIC_LIBS)
add_library (${HDF5_LIB_TARGET} STATIC ${common_SRCS} H5build_settings.c ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS})
target_include_directories (${HDF5_LIB_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_COMP_INCLUDE_DIRECTORIES};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>;$<BUILD_INTERFACE:${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}>"
)
target_compile_options(${HDF5_LIB_TARGET} PRIVATE "${HDF5_CMAKE_C_FLAGS}")
Expand Down Expand Up @@ -1091,7 +1091,7 @@ endif ()
if (BUILD_SHARED_LIBS)
add_library (${HDF5_LIBSH_TARGET} SHARED ${common_SRCS} H5build_settings.c ${H5_PUBLIC_HEADERS} ${H5_PRIVATE_HEADERS} ${H5_GENERATED_HEADERS} ${H5_MODULE_HEADERS})
target_include_directories (${HDF5_LIBSH_TARGET}
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR};${HDF5_COMP_INCLUDE_DIRECTORIES};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
PUBLIC "$<$<BOOL:${HDF5_ENABLE_HDFS}>:${HDFS_INCLUDE_DIR}>"
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>;$<BUILD_INTERFACE:${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_BINARY_DIR}>"
)
Expand Down
3 changes: 0 additions & 3 deletions test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
#include "H5FDpkg.h"
#include "H5VMprivate.h"
#include "H5Zpkg.h"
#ifdef H5_HAVE_SZLIB_H
#include "szlib.h"
#endif

static const char *FILENAME[] = {"dataset", /* 0 */
"compact_dataset", /* 1 */
Expand Down