summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2017-03-01 20:47:53 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2017-03-01 20:47:53 (GMT)
commit2562ec3a4b5ee4cff25e182bf0a29795673ca83d (patch)
treebe9f99660f7ff660df6199623b0c556f83c446a1 /config/cmake_ext_mod
parent038359746351249d6023e023f446b2bc612822b6 (diff)
downloadhdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.zip
hdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.tar.gz
hdf5-2562ec3a4b5ee4cff25e182bf0a29795673ca83d.tar.bz2
Update CMake files and formatting
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r--config/cmake_ext_mod/CheckTypeSize.cmake4
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake20
-rw-r--r--config/cmake_ext_mod/FindMPI.cmake6
-rw-r--r--config/cmake_ext_mod/FindSZIP.cmake4
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake4
-rw-r--r--config/cmake_ext_mod/runTest.cmake18
6 files changed, 32 insertions, 24 deletions
diff --git a/config/cmake_ext_mod/CheckTypeSize.cmake b/config/cmake_ext_mod/CheckTypeSize.cmake
index 85b1c6c..d217ac5 100644
--- a/config/cmake_ext_mod/CheckTypeSize.cmake
+++ b/config/cmake_ext_mod/CheckTypeSize.cmake
@@ -7,7 +7,7 @@
# HAVE_${VARIABLE} - does the variable exists or not
#
-MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE)
+macro (HDF_CHECK_TYPE_SIZE TYPE VARIABLE)
set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS 1)
if ("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$")
set (MACRO_CHECK_TYPE_SIZE_FLAGS
@@ -47,4 +47,4 @@ MACRO (HDF_CHECK_TYPE_SIZE TYPE VARIABLE)
endif ()
endif ()
set (CMAKE_ALLOW_UNKNOWN_VARIABLE_READ_ACCESS)
-ENDMACRO ()
+endmacro ()
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 1872cd5..2e99c94 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -45,12 +45,12 @@ endif ()
# does, it appends library to the list.
#-----------------------------------------------------------------------------
set (LINK_LIBS "")
-MACRO (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
+macro (CHECK_LIBRARY_EXISTS_CONCAT LIBRARY SYMBOL VARIABLE)
CHECK_LIBRARY_EXISTS ("${LIBRARY};${LINK_LIBS}" ${SYMBOL} "" ${VARIABLE})
if (${VARIABLE})
set (LINK_LIBS ${LINK_LIBS} ${LIBRARY})
endif ()
-ENDMACRO ()
+endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
@@ -133,7 +133,7 @@ if (NOT WINDOWS)
endif ()
# For other specific tests, use this MACRO.
-MACRO (HDF_FUNCTION_TEST OTHER_TEST)
+macro (HDF_FUNCTION_TEST OTHER_TEST)
if ("${HDF_PREFIX}_${OTHER_TEST}" MATCHES "^${HDF_PREFIX}_${OTHER_TEST}$")
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
set (OTHER_TEST_ADD_LIBRARIES)
@@ -178,7 +178,7 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST)
)
endif ()
endif ()
-ENDMACRO ()
+endmacro ()
#-----------------------------------------------------------------------------
# Check for these functions before the time headers are checked
@@ -188,12 +188,12 @@ HDF_FUNCTION_TEST (STDC_HEADERS)
#-----------------------------------------------------------------------------
# Check IF header file exists and add it to the list.
#-----------------------------------------------------------------------------
-MACRO (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
+macro (CHECK_INCLUDE_FILE_CONCAT FILE VARIABLE)
CHECK_INCLUDE_FILES ("${USE_INCLUDES};${FILE}" ${VARIABLE})
if (${VARIABLE})
set (USE_INCLUDES ${USE_INCLUDES} ${FILE})
endif ()
-ENDMACRO ()
+endmacro ()
#-----------------------------------------------------------------------------
# Check for the existence of certain header files
@@ -346,7 +346,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check the size in bytes of all the int and float types
#-----------------------------------------------------------------------------
-MACRO (HDF_CHECK_TYPE_SIZE type var)
+macro (HDF_CHECK_TYPE_SIZE type var)
set (aType ${type})
set (aVar ${var})
# message (STATUS "Checking size of ${aType} and storing into ${aVar}")
@@ -355,7 +355,7 @@ MACRO (HDF_CHECK_TYPE_SIZE type var)
set (${aVar} 0 CACHE INTERNAL "SizeOf for ${aType}")
# message (STATUS "Size of ${aType} was NOT Found")
endif ()
-ENDMACRO ()
+endmacro ()
HDF_CHECK_TYPE_SIZE (char ${HDF_PREFIX}_SIZEOF_CHAR)
HDF_CHECK_TYPE_SIZE (short ${HDF_PREFIX}_SIZEOF_SHORT)
@@ -572,7 +572,7 @@ if (NOT WINDOWS)
endif ()
# For other CXX specific tests, use this MACRO.
-MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST)
+macro (HDF_CXX_FUNCTION_TEST OTHER_TEST)
if ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$")
set (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}")
set (OTHER_TEST_ADD_LIBRARIES)
@@ -617,7 +617,7 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST)
)
endif ()
endif ()
-ENDMACRO ()
+endmacro ()
#-----------------------------------------------------------------------------
# Check a bunch of cxx functions
diff --git a/config/cmake_ext_mod/FindMPI.cmake b/config/cmake_ext_mod/FindMPI.cmake
index 1fb07d4..ff1ead2 100644
--- a/config/cmake_ext_mod/FindMPI.cmake
+++ b/config/cmake_ext_mod/FindMPI.cmake
@@ -471,7 +471,7 @@ function (interrogate_mpi_compiler lang try_libs)
PATH_SUFFIXES include Include include/${MS_MPI_ARCH_DIR} Include/${MS_MPI_ARCH_DIR2} Include/${MS_MPI_ARCH_DIR} include/${MS_MPI_ARCH_DIR2} Inc Inc/${MS_MPI_ARCH_DIR} Inc/${MS_MPI_ARCH_DIR2})
if (MPI_INCLUDE_PATH_WORK AND MPI_HEADER_PATH)
list(APPEND MPI_INCLUDE_PATH_WORK ${MPI_HEADER_PATH})
- endif()
+ endif ()
set(MPI_LIB "MPI_LIB-NOTFOUND" CACHE FILEPATH "Cleared" FORCE)
find_library(MPI_LIB
@@ -480,8 +480,8 @@ function (interrogate_mpi_compiler lang try_libs)
PATH_SUFFIXES lib lib/${MS_MPI_ARCH_DIR} Lib Lib/${MS_MPI_ARCH_DIR})
if (MPI_LIBRARIES_WORK AND MPI_LIB)
list(APPEND MPI_LIBRARIES_WORK ${MPI_LIB})
- endif()
- endif()
+ endif ()
+ endif ()
if (NOT MPI_LIBRARIES_WORK)
set(MPI_LIBRARIES_WORK "MPI_${lang}_LIBRARIES-NOTFOUND")
diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake
index 1709c2b..bb5f8d6 100644
--- a/config/cmake_ext_mod/FindSZIP.cmake
+++ b/config/cmake_ext_mod/FindSZIP.cmake
@@ -24,7 +24,7 @@
# made to remove references to Qt and make this file more generally applicable
#########################################################################
-MACRO (SZIP_ADJUST_LIB_VARS basename)
+macro (SZIP_ADJUST_LIB_VARS basename)
if (${basename}_INCLUDE_DIR)
# if only the release version was found, set the debug variable also to the release version
@@ -62,7 +62,7 @@ MACRO (SZIP_ADJUST_LIB_VARS basename)
# Make variables changeble to the advanced user
MARK_AS_ADVANCED (${basename}_LIBRARY ${basename}_LIBRARY_RELEASE ${basename}_LIBRARY_DEBUG ${basename}_INCLUDE_DIR )
-ENDMACRO ()
+endmacro ()
# Look for the header file.
diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake
index 6a81e3a..bf254a1 100644
--- a/config/cmake_ext_mod/HDFUseFortran.cmake
+++ b/config/cmake_ext_mod/HDFUseFortran.cmake
@@ -26,7 +26,7 @@ set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}")
# The provided CMake Fortran macros don't provide a general check function
# so this one is used for a sizeof test.
#-----------------------------------------------------------------------------
-MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
+macro (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
message (STATUS "Testing Fortran ${FUNCTION}")
if (CMAKE_REQUIRED_LIBRARIES)
set (CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
@@ -63,7 +63,7 @@ MACRO (CHECK_FORTRAN_FEATURE FUNCTION CODE VARIABLE)
"Determining if the Fortran ${FUNCTION} exists failed with the following output:\n"
"${OUTPUT}\n\n")
endif ()
-ENDMACRO ()
+endmacro ()
#-----------------------------------------------------------------------------
# Configure Checks which require Fortran compilation must go in here
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 0a77dae..9a2236e 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -34,6 +34,14 @@ endif ()
message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+if (TEST_LIBRARY_DIRECTORY)
+ if (WIN32 AND NOT MINGW)
+ set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
+ else ()
+ set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
+ endif ()
+endif ()
+
if (TEST_ENV_VAR)
set (ENV{${TEST_ENV_VAR}} "${TEST_ENV_VALUE}")
endif ()
@@ -92,8 +100,8 @@ if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
- endif()
- endif()
+ endif ()
+ endif ()
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
endif ()
@@ -140,7 +148,7 @@ endif ()
# remove text from the output file
if (TEST_FILTER)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
- string (REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}")
+ string (REGEX REPLACE "${TEST_FILTER}" "${TEST_FILTER_REPLACE}" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}")
endif ()
@@ -149,7 +157,7 @@ if (TEST_REF_FILTER)
file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
STRING(REGEX REPLACE "${TEST_REF_APPEND}" "${TEST_REF_FILTER}" TEST_STREAM "${TEST_STREAM}")
file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
-endif (TEST_REF_FILTER)
+endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
@@ -250,7 +258,7 @@ if (NOT TEST_SKIP_COMPARE)
if (${len_ref} STREQUAL "0")
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
endif ()
- endif()
+ endif ()
if (NOT ${len_act} STREQUAL ${len_ref})
set (TEST_RESULT 1)
endif ()