Skip to content

Commit

Permalink
Correct language issues
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Dec 8, 2023
1 parent cadf8f5 commit 6264c42
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion FORTRAN/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.12)
PROJECT (HDF5Examples_F90 C CXX Fortran)
PROJECT (HDF5Examples_F90)

#-----------------------------------------------------------------------------
# Build the Fortran Examples
Expand Down
2 changes: 1 addition & 1 deletion JAVA/H5D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Class-Path: ${HDFJAVA_CLASSJARS}
)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${HDF5_JAVA_LIBRARY})
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARY})
endforeach ()

if (H5EX_BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion JAVA/H5G/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Class-Path: ${HDFJAVA_CLASSJARS}
)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${HDF5_JAVA_LIBRARY})
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARY})
endforeach ()

if (H5EX_BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion JAVA/H5J/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Class-Path: ${HDFJAVA_CLASSJARS}
)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${HDF5_JAVA_LIBRARY})
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARY})
endforeach ()

if (H5EX_BUILD_TESTING)
Expand Down
2 changes: 1 addition & 1 deletion JAVA/H5T/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Class-Path: ${HDFJAVA_CLASSJARS}
)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_JAR_FILE ${EXAMPLE_VARNAME}_${example_name} JAR_FILE)
get_target_property (${EXAMPLE_VARNAME}_${example_name}_CLASSPATH ${EXAMPLE_VARNAME}_${example_name} CLASSDIR)
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${HDF5_JAVA_LIBRARY})
add_dependencies (${EXAMPLE_VARNAME}_${example_name} ${H5EX_JAVA_LIBRARY})
endforeach ()

if (H5EX_BUILD_TESTING)
Expand Down
27 changes: 18 additions & 9 deletions config/cmake/HDFExampleMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ macro (BASIC_SETTINGS varname)
set (CMAKE_C_STANDARD 99)
set (CMAKE_C_STANDARD_REQUIRED TRUE)

set (CMAKE_CXX_STANDARD 98)
set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
set (CMAKE_CXX_EXTENSIONS OFF)
if (HDF_BUILD_CPP_LIB)
ENABLE_LANGUAGE (CXX)

set (CMAKE_CXX_STANDARD 98)
set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
set (CMAKE_CXX_EXTENSIONS OFF)
endif ()

#-----------------------------------------------------------------------------
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS}")
endif ()
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
endif ()

Expand All @@ -68,7 +72,7 @@ macro (BASIC_SETTINGS varname)
if (CMAKE_COMPILER_IS_GNUCC)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmessage-length=0")
endif ()
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=0")
endif ()

Expand All @@ -83,8 +87,10 @@ macro (BASIC_SETTINGS varname)
set (HDF_WARNINGS_BLOCKED 1)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /w")
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
string (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w")
endif ()
endif ()
if (WIN32)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
Expand All @@ -98,7 +104,9 @@ macro (BASIC_SETTINGS varname)
# Most compilers use -w to suppress warnings.
if (NOT HDF_WARNINGS_BLOCKED)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
if (CMAKE_CXX_COMPILER_LOADED AND CMAKE_COMPILER_IS_GNUCXX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
endif ()
endif ()
endif ()

Expand Down Expand Up @@ -217,7 +225,8 @@ macro (HDF5_SUPPORT)
if (HDF_BUILD_JAVA)
if (${HDF5_BUILD_JAVA} AND HDF5_Java_FOUND)
set (CMAKE_JAVA_INCLUDE_PATH "${CMAKE_JAVA_INCLUDE_PATH};${HDF5_JAVA_INCLUDE_DIRS}")
message (STATUS "HDF5 jars:${HDF5_JAVA_INCLUDE_DIRS}}")
set (H5EX_JAVA_LIBRARY ${HDF5_JAVA_LIBRARY})
message (STATUS "HDF5 lib:${H5EX_JAVA_LIBRARY} jars:${HDF5_JAVA_INCLUDE_DIRS}}")
else ()
set (HDF_BUILD_JAVA OFF CACHE BOOL "Build Java support" FORCE)
message (STATUS "HDF5 Java libs not found - disable build of Java examples")
Expand Down
4 changes: 1 addition & 3 deletions config/cmake/HDFMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@ macro (HDF_DIR_PATHS package_prefix)
endif ()

SET_HDF_BUILD_TYPE()
#-----------------------------------------------------------------------------
# Setup output Directories
#-----------------------------------------------------------------------------

SET_HDF_OUTPUT_DIRS(${package_prefix})

include (FetchContent)
Expand Down

0 comments on commit 6264c42

Please sign in to comment.