summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2015-12-14 15:22:29 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2015-12-14 15:22:29 (GMT)
commit7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a (patch)
tree6bd24199653eff3e99f312d748ba4909686bef61 /config
parent8e9b142d9cd347432d400b4f9b3b88a3f047c06d (diff)
parent2cb441c507dfbd4437ccf29e232a9b730e6e1003 (diff)
downloadhdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.zip
hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.gz
hdf5-7a0cdfbbacc86aa73e91dedc4d89e3e59214d50a.tar.bz2
[svn-r28636] merge from trunk.
Diffstat (limited to 'config')
-rw-r--r--config/cmake/ConversionTests.c14
-rw-r--r--config/cmake/H5pubconf.h.in27
-rw-r--r--config/cmake/HDF518_Examples.cmake.in115
-rw-r--r--config/cmake/HDF5UseFortran.cmake10
-rw-r--r--config/cmake/HDF5_Examples.cmake.in50
-rw-r--r--config/cmake/HDFCompilerFlags.cmake4
-rwxr-xr-xconfig/cmake/scripts/CTestScript.cmake67
-rwxr-xr-xconfig/cmake/scripts/HDF5config.cmake (renamed from config/cmake/scripts/HDF518config.cmake)69
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake138
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake114
-rw-r--r--config/cmake_ext_mod/HDFTests.c22
11 files changed, 383 insertions, 247 deletions
diff --git a/config/cmake/ConversionTests.c b/config/cmake/ConversionTests.c
index d964bf8..b8946a8 100644
--- a/config/cmake/ConversionTests.c
+++ b/config/cmake/ConversionTests.c
@@ -1,5 +1,8 @@
#ifdef H5_LDOUBLE_TO_LONG_SPECIAL_TEST
+#include <string.h>
+#include <stdlib.h>
+
int main(void)
{
long double ld = 20041683600089727.779961L;
@@ -58,6 +61,9 @@ done:
#ifdef H5_LONG_TO_LDOUBLE_SPECIAL_TEST
+#include <string.h>
+#include <stdlib.h>
+
int main(void)
{
long double ld;
@@ -117,6 +123,10 @@ done:
#endif
#ifdef H5_LDOUBLE_TO_LLONG_ACCURATE_TEST
+
+#include <string.h>
+#include <stdlib.h>
+
int main(void)
{
long double ld = 20041683600089727.779961L;
@@ -156,6 +166,10 @@ done:
#endif
#ifdef H5_LLONG_TO_LDOUBLE_CORRECT_TEST
+
+#include <string.h>
+#include <stdlib.h>
+
int main(void)
{
long double ld;
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index fd3a1d6..ce8219f 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -100,6 +100,9 @@
/* Define if library information should be embedded in the executables */
#cmakedefine H5_HAVE_EMBEDDED_LIBINFO @H5_HAVE_EMBEDDED_LIBINFO@
+/* Define to 1 if you have the `fcntl' function. */
+#cmakedefine H5_HAVE_FCNTL @H5_HAVE_FCNTL@
+
/* Define to 1 if you have the <features.h> header file. */
#cmakedefine H5_HAVE_FEATURES_H @H5_HAVE_FEATURES_H@
@@ -109,6 +112,9 @@
/* Define if support for szip filter is enabled */
#cmakedefine H5_HAVE_FILTER_SZIP @H5_HAVE_FILTER_SZIP@
+/* Define to 1 if you have the `flock' function. */
+#cmakedefine H5_HAVE_FLOCK @H5_HAVE_FLOCK@
+
/* Define to 1 if you have the `fork' function. */
#cmakedefine H5_HAVE_FORK @H5_HAVE_FORK@
@@ -157,6 +163,9 @@
/* Define to 1 if you have the `gettimeofday' function. */
#cmakedefine H5_HAVE_GETTIMEOFDAY @H5_HAVE_GETTIMEOFDAY@
+/* Define if the compiler understands inline */
+#cmakedefine H5_HAVE_INLINE @H5_HAVE_INLINE@
+
/* Define if library will contain instrumentation to detect correct
optimization operation */
#cmakedefine H5_HAVE_INSTRUMENTED_LIBRARY @H5_HAVE_INSTRUMENTED_LIBRARY@
@@ -371,6 +380,12 @@
/* Define to 1 if you have the `_scrsize' function. */
#cmakedefine H5_HAVE__SCRSIZE @H5_HAVE__SCRSIZE@
+/* Define if the compiler understands __inline */
+#cmakedefine H5_HAVE___INLINE @H5_HAVE___INLINE@
+
+/* Define if the compiler understands __inline__ */
+#cmakedefine H5_HAVE___INLINE__ @H5_HAVE___INLINE__@
+
/* Define if HDF5's high-level library headers should be included in hdf5.h */
#cmakedefine H5_INCLUDE_HL @H5_INCLUDE_HL@
@@ -563,6 +578,12 @@
/* The size of `__int64', as computed by sizeof. */
#define H5_SIZEOF___INT64 @H5_SIZEOF___INT64@
+/* Define to 1 if you have the <stdbool.h> header file. */
+#cmakedefine H5_HAVE_STDBOOL_H @H5_HAVE_STDBOOL_H@
+
+/* The size of `bool', as computed by sizeof. */
+#cmakedefine H5_SIZEOF_BOOL @H5_SIZEOF_BOOL@
+
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine H5_STDC_HEADERS @H5_STDC_HEADERS@
@@ -619,12 +640,6 @@
/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine H5_const
-/* Define to `__inline__' or `__inline' if that's what the C compiler
- calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-#cmakedefine H5_inline @H5_inline@
-#endif
-
/* Define to `long int' if <sys/types.h> does not define. */
#cmakedefine H5_off_t
diff --git a/config/cmake/HDF518_Examples.cmake.in b/config/cmake/HDF518_Examples.cmake.in
index c82fcf2..1be5c65 100644
--- a/config/cmake/HDF518_Examples.cmake.in
+++ b/config/cmake/HDF518_Examples.cmake.in
@@ -1,47 +1,85 @@
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
###############################################################################################################
-# This script will build and run the examples from a compressed file
+# This script will build and run the examples from a folder
# Execute from a command line:
-# ctest -S HDF518_Examples.cmake,HDF5Examples-0.1.1-Source -C Release -VV -O test.log
+# ctest -S HDF518_Examples.cmake,OPTION=VALUE -C Release -VV -O test.log
###############################################################################################################
-set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
-set(STATICLIBRARIES "@H5_ENABLE_STATIC_LIB@")
-set(CTEST_SOURCE_NAME ${CTEST_SCRIPT_ARG})
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
-set(CTEST_BUILD_CONFIGURATION "Release")
-#set(NO_MAC_FORTRAN "true")
-#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
-#set(CTEST_USE_TAR_SOURCE "${CTEST_SCRIPT_ARG}")
+
+# handle input parameters to script.
+#INSTALLDIR - HDF5-1.8 root folder
+#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo
+#CTEST_SOURCE_NAME - name of source folder; HDF4Examples
+#STATIC_LIBRARIES - Default is YES
+#FORTRAN_LIBRARIES - Default is NO
+##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac)
+if(DEFINED CTEST_SCRIPT_ARG)
+ # transform ctest script arguments of the form
+ # script.ctest,var1=value1,var2=value2
+ # to variables with the respective names set to the respective values
+ string(REPLACE "," ";" script_args "${CTEST_SCRIPT_ARG}")
+ foreach(current_var ${script_args})
+ if ("${current_var}" MATCHES "^([^=]+)=(.+)$")
+ set("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}")
+ endif()
+ endforeach()
+endif()
+if(NOT DEFINED INSTALLDIR)
+ set(INSTALLDIR "@CMAKE_INSTALL_PREFIX@")
+endif()
+if(NOT DEFINED CTEST_BUILD_CONFIGURATION)
+ set(CTEST_BUILD_CONFIGURATION "Release")
+endif()
+if(NOT DEFINED CTEST_SOURCE_NAME)
+ set(CTEST_SOURCE_NAME "HDF5Examples")
+endif()
+if(NOT DEFINED STATIC_LIBRARIES)
+ set(STATICLIBRARIES "YES")
+endif()
+if(NOT DEFINED FORTRAN_LIBRARIES)
+ set(FORTRANLIBRARIES "NO")
+endif()
+
+#TAR_SOURCE - name of tarfile
+#if(NOT DEFINED TAR_SOURCE)
+# set(CTEST_USE_TAR_SOURCE "HDF5Examples-1.2.1-Source")
+#endif()
###############################################################################################################
# Adjust the following SET Commands as needed
###############################################################################################################
if(WIN32)
- if(STATICLIBRARIES)
+ if(${STATICLIBRARIES})
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
- endif(STATICLIBRARIES)
+ endif()
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else(WIN32)
- if(STATICLIBRARIES)
+ if(${STATICLIBRARIES})
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- endif(STATICLIBRARIES)
+ endif()
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif(WIN32)
+if(${FORTRANLIBRARIES})
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
+else()
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
+endif()
+set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
# For any comments please contact cdashhelp@hdfgroup.org
#
###############################################################################################################
-
+
#-----------------------------------------------------------------------------
# MAC machines need special option
#-----------------------------------------------------------------------------
@@ -52,14 +90,14 @@ if(APPLE)
set(ENV{CC} "${XCODE_CC}")
set(ENV{CXX} "${XCODE_CXX}")
if(NOT NO_MAC_FORTRAN)
- # Shared fortran is not supported, build static
+ # Shared fortran is not supported, build static
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else(NOT NO_MAC_FORTRAN)
+ else()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
- endif(NOT NO_MAC_FORTRAN)
+ endif()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif(APPLE)
-
+endif()
+
#-----------------------------------------------------------------------------
set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
## --------------------------
@@ -68,28 +106,28 @@ if(CTEST_USE_TAR_SOURCE)
## --------------------------
if(WIN32)
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip]")
- execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
- else(WIN32)
+ execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
+ else()
message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]")
- execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
- endif(WIN32)
-
+ execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
+ endif()
+
if(NOT rv EQUAL 0)
message(STATUS "extracting... [error-(${rv}) clean up]")
file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed")
- endif(NOT rv EQUAL 0)
+ endif()
endif(CTEST_USE_TAR_SOURCE)
-
+
#-----------------------------------------------------------------------------
## Clear the build directory
## --------------------------
set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
-else (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+else ()
file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
-endif (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+endif ()
# Use multiple CPU cores to build
include(ProcessorCount)
@@ -97,17 +135,17 @@ ProcessorCount(N)
if(NOT N EQUAL 0)
if(NOT WIN32)
set(CTEST_BUILD_FLAGS -j${N})
- endif(NOT WIN32)
+ endif()
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
set (CTEST_CONFIGURE_COMMAND
"${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
)
-
+
#-----------------------------------------------------------------------------
## -- set output to english
set($ENV{LC_MESSAGES} "en_EN")
-
+
#-----------------------------------------------------------------------------
configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
@@ -115,11 +153,20 @@ ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
## --------------------------
ctest_start (Experimental)
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Configure Notes)
+endif()
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Build)
+endif()
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Test)
+endif()
if(res GREATER 0)
message (FATAL_ERROR "tests FAILED")
-endif(res GREATER 0)
+endif()
#-----------------------------------------------------------------------------
-##############################################################################################################
-message(STATUS "DONE")
+##############################################################################################################
+message(STATUS "DONE") \ No newline at end of file
diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake
index 8ca10a7..c3e5a24 100644
--- a/config/cmake/HDF5UseFortran.cmake
+++ b/config/cmake/HDF5UseFortran.cmake
@@ -217,9 +217,9 @@ list(GET PROG_OUTPUT 4 NUM_RKIND)
set(H5CONFIG_F_NUM_IKIND "INTEGER, PARAMETER :: num_ikinds = ${NUM_IKIND}")
set(H5CONFIG_F_IKIND "INTEGER, DIMENSION(1:num_ikinds) :: ikind = (/${pac_validIntKinds}/)")
-message ( " ........REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}")
-message ( " ........INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}")
-message ( " ........MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}")
+message (STATUS "....REAL KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}")
+message (STATUS "....INTEGER KINDS FOUND ${PAC_FC_ALL_REAL_KINDS}")
+message (STATUS "....MAX DECIMAL PRECISION ${H5_PAC_FC_MAX_REAL_PRECISION}")
#-----------------------------------------------------------------------------
# Determine the available KINDs for REALs and INTEGERs
@@ -258,7 +258,7 @@ string(REGEX REPLACE " " "" pack_int_sizeof "${pack_int_sizeof}")
set(PAC_FC_ALL_INTEGER_KINDS_SIZEOF "\{${pack_int_sizeof}\}")
-message("...FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}")
+message(STATUS "....FOUND SIZEOF for INTEGER KINDs ${PAC_FC_ALL_INTEGER_KINDS_SIZEOF}")
# **********
# REALS
# **********
@@ -297,7 +297,7 @@ string(REGEX REPLACE " " "" pack_real_sizeof "${pack_real_sizeof}")
set(H5CONFIG_F_RKIND_SIZEOF "INTEGER, DIMENSION(1:num_rkinds) :: rkind_sizeof = (/${pack_real_sizeof}/)")
-message("...FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}")
+message(STATUS "....FOUND SIZEOF for REAL KINDs \{${pack_real_sizeof}\}")
set(PAC_FC_ALL_REAL_KINDS_SIZEOF "\{${pack_real_sizeof}\}")
diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in
index 65e2e9e..40e2b32 100644
--- a/config/cmake/HDF5_Examples.cmake.in
+++ b/config/cmake/HDF5_Examples.cmake.in
@@ -7,14 +7,14 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@")
set(CTEST_DASHBOARD_ROOT ${CTEST_SCRIPT_DIRECTORY})
-#set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
# handle input parameters to script.
#INSTALLDIR - HDF5 root folder
#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF4Examples
-#STATICLIBRARIES - Default is YES
-#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac)
+#STATIC_LIBRARIES - Default is YES
+#FORTRAN_LIBRARIES - Default is NO
+##NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac)
if(DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
# script.ctest,var1=value1,var2=value2
@@ -35,9 +35,12 @@ endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
set(CTEST_SOURCE_NAME "HDF5Examples")
endif()
-if(NOT DEFINED STATICLIBRARIES)
+if(NOT DEFINED STATIC_LIBRARIES)
set(STATICLIBRARIES "YES")
endif()
+if(NOT DEFINED FORTRAN_LIBRARIES)
+ set(FORTRANLIBRARIES "NO")
+endif()
#TAR_SOURCE - name of tarfile
#if(NOT DEFINED TAR_SOURCE)
@@ -48,23 +51,29 @@ endif()
# Adjust the following SET Commands as needed
###############################################################################################################
if(WIN32)
- if(STATICLIBRARIES)
+ if(${STATICLIBRARIES})
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
- endif(STATICLIBRARIES)
+ endif()
set(ENV{HDF5_DIR} "${INSTALLDIR}/cmake")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}\\build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else(WIN32)
- if(STATICLIBRARIES)
+ if(${STATICLIBRARIES})
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- endif(STATICLIBRARIES)
+ endif()
set(ENV{HDF5_DIR} "${INSTALLDIR}/share/cmake")
set(ENV{LD_LIBRARY_PATH} "${INSTALLDIR}/lib")
set(CTEST_BINARY_NAME ${CTEST_SOURCE_NAME}/build)
set(CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_SOURCE_NAME}")
set(CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}/${CTEST_BINARY_NAME}")
endif(WIN32)
+if(${FORTRANLIBRARIES})
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
+else()
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
+endif()
+set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_PACKAGE_NAME:STRING=@HDF5_PACKAGE@@HDF_PACKAGE_EXT@")
###############################################################################################################
# For any comments please contact cdashhelp@hdfgroup.org
@@ -83,11 +92,11 @@ if(APPLE)
if(NOT NO_MAC_FORTRAN)
# Shared fortran is not supported, build static
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
- else(NOT NO_MAC_FORTRAN)
+ else()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=OFF")
- endif(NOT NO_MAC_FORTRAN)
+ endif()
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
-endif(APPLE)
+endif()
#-----------------------------------------------------------------------------
set(CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
@@ -107,7 +116,7 @@ if(CTEST_USE_TAR_SOURCE)
message(STATUS "extracting... [error-(${rv}) clean up]")
file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
message(FATAL_ERROR "error: extract of ${CTEST_SOURCE_NAME} failed")
- endif(NOT rv EQUAL 0)
+ endif()
endif(CTEST_USE_TAR_SOURCE)
#-----------------------------------------------------------------------------
@@ -116,9 +125,9 @@ endif(CTEST_USE_TAR_SOURCE)
set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)
if (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
-else (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+else ()
file(MAKE_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
-endif (EXISTS "${CTEST_BINARY_DIRECTORY}" AND IS_DIRECTORY "${CTEST_BINARY_DIRECTORY}")
+endif ()
# Use multiple CPU cores to build
include(ProcessorCount)
@@ -126,7 +135,7 @@ ProcessorCount(N)
if(NOT N EQUAL 0)
if(NOT WIN32)
set(CTEST_BUILD_FLAGS -j${N})
- endif(NOT WIN32)
+ endif()
set(ctest_test_args ${ctest_test_args} PARALLEL_LEVEL ${N})
endif()
set (CTEST_CONFIGURE_COMMAND
@@ -144,11 +153,20 @@ ctest_read_custom_files ("${CTEST_BINARY_DIRECTORY}")
## --------------------------
ctest_start (Experimental)
ctest_configure (BUILD "${CTEST_BINARY_DIRECTORY}")
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Configure Notes)
+endif()
ctest_build (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Build)
+endif()
ctest_test (BUILD "${CTEST_BINARY_DIRECTORY}" APPEND ${ctest_test_args} RETURN_VALUE res)
+if(LOCAL_SUBMIT)
+ ctest_submit (PARTS Test)
+endif()
if(res GREATER 0)
message (FATAL_ERROR "tests FAILED")
-endif(res GREATER 0)
+endif()
#-----------------------------------------------------------------------------
##############################################################################################################
message(STATUS "DONE") \ No newline at end of file
diff --git a/config/cmake/HDFCompilerFlags.cmake b/config/cmake/HDFCompilerFlags.cmake
index c637c73..665db32 100644
--- a/config/cmake/HDFCompilerFlags.cmake
+++ b/config/cmake/HDFCompilerFlags.cmake
@@ -16,12 +16,12 @@ if (CMAKE_COMPILER_IS_GNUCC)
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_COMPILER_IS_GNUCXX)
if (CMAKE_BUILD_TYPE MATCHES Debug)
- set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99")
+ set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Og -ftrapv -fno-common")
endif ()
else (CMAKE_BUILD_TYPE MATCHES Debug)
- set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS} -std=c99")
+ set (CMAKE_CXX_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_CXX_FLAGS}")
if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstdarg-opt")
endif ()
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index 9d0953e..403eedd 100755
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -56,6 +56,13 @@ if(APPLE)
set(ENV{CC} "${XCODE_CC}")
set(ENV{CXX} "${XCODE_CXX}")
+ if(NOT NO_MAC_FORTRAN)
+ # Shared fortran is not supported, build static
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_ANSI_CFLAGS:STRING=-fPIC")
+ else(NOT NO_MAC_FORTRAN)
+ set(BUILD_OPTIONS "${BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+ endif(NOT NO_MAC_FORTRAN)
+
set(BUILD_OPTIONS "${BUILD_OPTIONS} -DCTEST_USE_LAUNCHERS:BOOL=ON -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF")
endif(APPLE)
@@ -66,13 +73,13 @@ if(CTEST_USE_TAR_SOURCE)
## Uncompress source if tar file provided
## --------------------------
if(WIN32)
- message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_USE_TAR_SOURCE}.zip]")
+ message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} x ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}\\${CTEST_USE_TAR_SOURCE}.zip RESULT_VARIABLE rv)
else()
- message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_USE_TAR_SOURCE}.tar]")
+ message(STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar]")
execute_process(COMMAND ${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${CTEST_DASHBOARD_ROOT}/${CTEST_USE_TAR_SOURCE}.tar RESULT_VARIABLE rv)
endif()
-
+
if(NOT rv EQUAL 0)
message(STATUS "extracting... [error-(${rv}) clean up]")
file(REMOVE_RECURSE "${CTEST_SOURCE_DIRECTORY}")
@@ -159,12 +166,23 @@ endif()
#-----------------------------------------------------------------------------
# Send the main script as a note.
-list(APPEND CTEST_NOTES_FILES
- "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
- "${CMAKE_CURRENT_LIST_FILE}"
- "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
-)
-
+if(USE_AUTOTOOLS)
+ ## autotools builds need to use make and does not use the cacheinit.cmake file
+ ## -- make command
+ ## -----------------
+ find_program(MAKE NAMES make)
+ list(APPEND CTEST_NOTES_FILES
+ "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
+ "${CMAKE_CURRENT_LIST_FILE}"
+ )
+else()
+ list(APPEND CTEST_NOTES_FILES
+ "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}"
+ "${CMAKE_CURRENT_LIST_FILE}"
+ "${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake"
+ )
+endif()
+
#-----------------------------------------------------------------------------
# Check for required variables.
# --------------------------
@@ -181,20 +199,27 @@ endforeach(req)
#-----------------------------------------------------------------------------
# Initialize the CTEST commands
#------------------------------
-if(LOCAL_MEMCHECK_TEST)
- find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
- set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
- )
-else()
- if(LOCAL_COVERAGE_TEST)
- find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+if(USE_AUTOTOOLS)
+ set(CTEST_CONFIGURE_COMMAND "${CTEST_SOURCE_DIRECTORY}/configure ${ADD_BUILD_OPTIONS}")
+ set(CTEST_BUILD_COMMAND "${MAKE} ${CTEST_BUILD_FLAGS}")
+ configure_file(${CTEST_SOURCE_DIRECTORY}/config/cmake/CTestCustom.cmake ${CTEST_BINARY_DIRECTORY}/CTestCustom.cmake)
+ file(WRITE ${CTEST_BINARY_DIRECTORY}/CTestTestfile.cmake "ADD_TEST(makecheck \"${MAKE}\" \"${CTEST_BUILD_FLAGS}\" \"-i\" \"check\")")
+else(USE_AUTOTOOLS)
+ if(LOCAL_MEMCHECK_TEST)
+ find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+ set (CTEST_CONFIGURE_COMMAND
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/mccacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ )
+ else()
+ if(LOCAL_COVERAGE_TEST)
+ find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+ endif()
+ set (CTEST_CONFIGURE_COMMAND
+ "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
+ )
endif()
- set (CTEST_CONFIGURE_COMMAND
- "${CTEST_CMAKE_COMMAND} -C \"${CTEST_SOURCE_DIRECTORY}/config/cmake/cacheinit.cmake\" -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} ${BUILD_OPTIONS} \"-G${CTEST_CMAKE_GENERATOR}\" \"${CTEST_SOURCE_DIRECTORY}\""
- )
endif()
-
+
#-----------------------------------------------------------------------------
## -- set output to english
set($ENV{LC_MESSAGES} "en_EN")
diff --git a/config/cmake/scripts/HDF518config.cmake b/config/cmake/scripts/HDF5config.cmake
index 897bcbe..8bcc56b 100755
--- a/config/cmake/scripts/HDF518config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -1,8 +1,8 @@
-##########################################################################################
-### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ###
-### BUILD_GENERATOR required [Unix, VS2013, VS201364, VS2012, VS201264] ###
-### ctest -S HDF518config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf518.log ###
-##########################################################################################
+#############################################################################################
+### ${CTEST_SCRIPT_ARG} is of the form OPTION=VALUE ###
+### BUILD_GENERATOR required [Unix, VS2015, VS201564, VS2013, VS201364, VS2012, VS201264] ###
+### ctest -S HDF5config.cmake,BUILD_GENERATOR=VS201264 -C Release -V -O hdf519.log ###
+#############################################################################################
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
############################################################################
@@ -11,6 +11,8 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# where valid options for OPTION are:
# BUILD_GENERATOR - The cmake build generator:
# Unix * Unix Makefiles
+# VS2015 * Visual Studio 14 2015
+# VS201564 * Visual Studio 14 2015 Win64
# VS2013 * Visual Studio 12 2013
# VS201364 * Visual Studio 12 2013 Win64
# VS2012 * Visual Studio 11 2012
@@ -19,11 +21,13 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
# INSTALLDIR - root folder where hdf5 is installed
# CTEST_BUILD_CONFIGURATION - Release, Debug, etc
# CTEST_SOURCE_NAME - source folder
-# STATICLIBRARIES - Build/use static libraries
+# STATIC_LIBRARIES - Build/use static libraries
+# FORTRAN_LIBRARIES - Build/use fortran libraries
# NO_MAC_FORTRAN - Yes to be SHARED on a Mac
##############################################################################
set(CTEST_SOURCE_VERSION 1.9)
+set(CTEST_SOURCE_VERSEXT "")
##############################################################################
# handle input parameters to script.
@@ -31,7 +35,8 @@ set(CTEST_SOURCE_VERSION 1.9)
#INSTALLDIR - HDF5-1.9 root folder
#CTEST_BUILD_CONFIGURATION - Release, Debug, RelWithDebInfo
#CTEST_SOURCE_NAME - name of source folder; HDF5-1.9
-#STATICLIBRARIES - Default is YES
+#STATIC_LIBRARIES - Default is YES
+#FORTRAN_LIBRARIES - Default is NO
#NO_MAC_FORTRAN - set to TRUE to allow shared libs on a Mac
if(DEFINED CTEST_SCRIPT_ARG)
# transform ctest script arguments of the form
@@ -47,28 +52,32 @@ endif()
# build generator must be defined
if(NOT DEFINED BUILD_GENERATOR)
- message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2013, VS201364, VS2012, or VS201264")
+ message(FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
else()
if(${BUILD_GENERATOR} STREQUAL "Unix")
- set(CMAKE_GENERATOR "Unix Makefiles")
+ set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS201564")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64")
elseif(${BUILD_GENERATOR} STREQUAL "VS2013")
- set(CMAKE_GENERATOR "Visual Studio 12 2013")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013")
elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
- set(CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 12 2013 Win64")
elseif(${BUILD_GENERATOR} STREQUAL "VS2012")
- set(CMAKE_GENERATOR "Visual Studio 11 2012")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012")
elseif(${BUILD_GENERATOR} STREQUAL "VS201264")
- set(CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
+ set(CTEST_CMAKE_GENERATOR "Visual Studio 11 2012 Win64")
else()
- message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2013, VS201364, VS2012, or VS201264")
+ message(FATAL_ERROR "Invalid BUILD_GENERATOR must be - Unix, VS2015, VS201564, VS2013, VS201364, VS2012, or VS201264")
endif()
endif()
if(NOT DEFINED INSTALLDIR)
if(WIN32)
- set(INSTALLDIR "/usr/local/myhdf5")
- else()
set(INSTALLDIR "C:\\Program\ Files\\myhdf5")
+ else()
+ set(INSTALLDIR "/usr/local/myhdf5")
endif()
endif()
if(NOT DEFINED CTEST_BUILD_CONFIGURATION)
@@ -77,10 +86,10 @@ endif()
if(NOT DEFINED CTEST_SOURCE_NAME)
set(CTEST_SOURCE_NAME "hdf5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}")
endif()
-if(NOT DEFINED STATICLIBRARIES)
+if(NOT DEFINED STATIC_LIBRARIES)
set(STATICLIBRARIES "YES")
endif()
-if(NOT DEFINED FORTRANLIBRARIES)
+if(NOT DEFINED FORTRAN_LIBRARIES)
set(FORTRANLIBRARIES "NO")
endif()
@@ -99,7 +108,15 @@ endif()
if(WIN32)
set(SITE_OS_NAME "Windows")
set(SITE_OS_VERSION "WIN7")
- if(${BUILD_GENERATOR} STREQUAL "VS201364")
+ if(${BUILD_GENERATOR} STREQUAL "VS201564")
+ set(SITE_OS_BITS "64")
+ set(SITE_COMPILER_NAME "vs2015")
+ set(SITE_COMPILER_VERSION "14")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS2015")
+ set(SITE_OS_BITS "32")
+ set(SITE_COMPILER_NAME "vs2015")
+ set(SITE_COMPILER_VERSION "14")
+ elseif(${BUILD_GENERATOR} STREQUAL "VS201364")
set(SITE_OS_BITS "64")
set(SITE_COMPILER_NAME "vs2013")
set(SITE_COMPILER_VERSION "12")
@@ -155,12 +172,12 @@ set(REPOSITORY_URL "http://svn.hdfgroup.uiuc.edu/hdf5/trunk")
#### format: set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DXXX:YY=ZZZZ")
###################################################################
-if(STATICLIBRARIES)
+if(${STATICLIBRARIES})
set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_SHARED_LIBS:BOOL=OFF")
######### Following describes computer ############
## following is optional to describe build ##
set(SITE_BUILDNAME_SUFFIX "STATIC")
-endif(STATICLIBRARIES)
+endif()
###################################################################
### uncomment/comment and change the following lines for other configuration options
@@ -178,11 +195,11 @@ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ALLOW_EXTERNAL_SUPPORT:STRING
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF")
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_SZIP_ENCODING:BOOL=OFF")
#### fortran ####
-if(FORTRANLIBRARIES)
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF_BUILD_FORTRAN:BOOL=ON")
- ### enable Fortran 2003 depends on HDF5_BUILD_FORTRAN
- set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_ENABLE_F2003:BOOL=ON")
-endif(FORTRANLIBRARIES)
+if(${FORTRANLIBRARIES})
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=ON")
+else()
+ set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DHDF5_BUILD_FORTRAN:BOOL=OFF")
+endif()
### disable test program builds
#set(ADD_BUILD_OPTIONS "${ADD_BUILD_OPTIONS} -DBUILD_TESTING:BOOL=OFF")
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 6885187..cfda66b 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -31,13 +31,13 @@ if (APPLE)
endif (APPLE)
# Check for Darwin (not just Apple - we also want to catch OpenDarwin)
-if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- set (${HDF_PREFIX}_HAVE_DARWIN 1)
+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ set (${HDF_PREFIX}_HAVE_DARWIN 1)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# Check for Solaris
-if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
- set (${HDF_PREFIX}_HAVE_SOLARIS 1)
+if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
+ set (${HDF_PREFIX}_HAVE_SOLARIS 1)
endif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
#-----------------------------------------------------------------------------
@@ -141,10 +141,6 @@ MACRO (HDF_FUNCTION_TEST OTHER_TEST)
set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif (CMAKE_REQUIRED_LIBRARIES)
- foreach (def ${HDF_EXTRA_TEST_DEFINITIONS})
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}")
- endforeach (def)
-
foreach (def
HAVE_SYS_TIME_H
HAVE_UNISTD_H
@@ -266,27 +262,23 @@ set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
if (NOT WINDOWS)
- if (NOT ${HDF_PREFIX}_HAVE_SOLARIS)
+ # Might want to check explicitly for Linux and possibly Cygwin
+ # instead of checking for not Solaris or Darwin.
+ if (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
# Linux Specific flags
# This was originally defined as _POSIX_SOURCE which was updated to
# _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
# functionality so clock_gettime and CLOCK_MONOTONIC are defined
- # correctly.
+ # correctly. This was later updated to 200112L so that
+ # posix_memalign() is visible for the direct VFD code on Linux
+ # systems.
# POSIX feature information can be found in the gcc manual at:
# http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
- set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=199506L)
- # _BSD_SOURCE deprecated in GLIBC >= 2.20
- TRY_RUN (HAVE_DEFAULT_SOURCE_RUN HAVE_DEFAULT_SOURCE_COMPILE
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DHAVE_DEFAULT_SOURCE
- OUTPUT_VARIABLE OUTPUT
- )
- if (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
- set (HDF_EXTRA_FLAGS -D_DEFAULT_SOURCE)
- else (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
- set (HDF_EXTRA_FLAGS -D_BSD_SOURCE)
- endif (HAVE_DEFAULT_SOURCE_COMPILE AND HAVE_DEFAULT_SOURCE_RUN)
+ set (HDF_EXTRA_C_FLAGS -D_POSIX_C_SOURCE=200112L)
+
+ # Need to add this so that O_DIRECT is visible for the direct
+ # VFD on Linux systems.
+ set (HDF_EXTRA_C_FLAGS -D_GNU_SOURCE)
option (HDF_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON)
if (HDF_ENABLE_LARGE_FILE)
@@ -297,6 +289,11 @@ if (NOT WINDOWS)
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=-DTEST_LFS_WORKS
OUTPUT_VARIABLE OUTPUT
)
+
+ # The LARGEFILE definitions were from the transition period
+ # and are probably no longer needed. The FILE_OFFSET_BITS
+ # check should be generalized for all POSIX systems as it
+ # is in the Autotools.
if (TEST_LFS_WORKS_COMPILE)
if (TEST_LFS_WORKS_RUN MATCHES 0)
set (TEST_LFS_WORKS 1 CACHE INTERNAL ${msg})
@@ -319,7 +316,7 @@ if (NOT WINDOWS)
endif (TEST_LFS_WORKS_COMPILE)
endif (HDF_ENABLE_LARGE_FILE)
set (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF_EXTRA_FLAGS})
- endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS)
+ endif (NOT ${HDF_PREFIX}_HAVE_SOLARIS AND NOT ${HDF_PREFIX}_HAVE_DARWIN)
endif (NOT WINDOWS)
add_definitions (${HDF_EXTRA_FLAGS})
@@ -422,6 +419,19 @@ if (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T)
set (${HDF_PREFIX}_SIZEOF_OFF64_T 0)
endif (NOT ${HDF_PREFIX}_SIZEOF_OFF64_T)
+#-----------------------------------------------------------------------------
+# Extra C99 types
+#-----------------------------------------------------------------------------
+
+# _Bool type support
+CHECK_INCLUDE_FILE_CONCAT (stdbool.h ${HDF_PREFIX}_HAVE_STDBOOL_H)
+if (HAVE_STDBOOL_H)
+ set (CMAKE_EXTRA_INCLUDE_FILES stdbool.h)
+ HDF_CHECK_TYPE_SIZE (bool ${HDF_PREFIX}_SIZEOF_BOOL)
+else (HAVE_STDBOOL_H)
+ HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
+endif (HAVE_STDBOOL_H)
+
if (NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if the dev_t type is a scalar type
@@ -437,6 +447,7 @@ if (NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check a bunch of time functions
#-----------------------------------------------------------------------------
+ CHECK_FUNCTION_EXISTS (gettimeofday ${HDF_PREFIX}_HAVE_GETTIMEOFDAY)
foreach (test
HAVE_TM_GMTOFF
HAVE___TM_GMTOFF
@@ -479,6 +490,8 @@ endif (NOT WINDOWS)
# Check for some functions that are used
#
CHECK_FUNCTION_EXISTS (alarm ${HDF_PREFIX}_HAVE_ALARM)
+CHECK_FUNCTION_EXISTS (fcntl ${HDF_PREFIX}_HAVE_FCNTL)
+CHECK_FUNCTION_EXISTS (flock ${HDF_PREFIX}_HAVE_FLOCK)
CHECK_FUNCTION_EXISTS (fork ${HDF_PREFIX}_HAVE_FORK)
CHECK_FUNCTION_EXISTS (frexpf ${HDF_PREFIX}_HAVE_FREXPF)
CHECK_FUNCTION_EXISTS (frexpl ${HDF_PREFIX}_HAVE_FREXPL)
@@ -556,10 +569,6 @@ MACRO (HDF_CXX_FUNCTION_TEST OTHER_TEST)
set (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}")
endif (CMAKE_REQUIRED_LIBRARIES)
- foreach (def ${HDF_EXTRA_TEST_DEFINITIONS})
- set (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}")
- endforeach (def)
-
foreach (def
HAVE_SYS_TIME_H
HAVE_UNISTD_H
@@ -626,7 +635,7 @@ if (WINDOWS)
"${CURRENT_TEST_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE"
)
endif (LARGEFILE)
- set (MACRO_CHECK_FUNCTION_DEFINITIONS
+ set (MACRO_CHECK_FUNCTION_DEFINITIONS
"-DHAVE_IOEO ${CMAKE_REQUIRED_FLAGS}")
if (CMAKE_REQUIRED_LIBRARIES)
set (CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
@@ -658,7 +667,7 @@ if (WINDOWS)
if ("${HAVE_IOEO_EXITCODE}" EQUAL 0)
set (${HDF_PREFIX}_HAVE_IOEO 1 CACHE INTERNAL "Test InitOnceExecuteOnce")
message (STATUS "Performing Test InitOnceExecuteOnce - Success")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test InitOnceExecuteOnce succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${HAVE_IOEO}\n")
@@ -670,7 +679,7 @@ if (WINDOWS)
endif (CMAKE_CROSSCOMPILING AND "${HAVE_IOEO_EXITCODE}" MATCHES "FAILED_TO_RUN")
message (STATUS "Performing Test InitOnceExecuteOnce - Failed")
- file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+ file (APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing InitOnceExecuteOnce Test failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${HAVE_IOEO_EXITCODE}\n")
@@ -682,60 +691,45 @@ endif (WINDOWS)
#-----------------------------------------------------------------------------
# Determine how 'inline' is used
#-----------------------------------------------------------------------------
-set (HDF_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE)
foreach (inline_test inline __inline__ __inline)
- set (INLINE_TEST_INLINE ${inline_test})
- HDF_FUNCTION_TEST (INLINE_TEST_${inline_test})
+ string (TOUPPER ${inline_test} INLINE_TEST_MACRO)
+ HDF_FUNCTION_TEST (HAVE_${INLINE_TEST_MACRO})
endforeach (inline_test)
-set (HDF_EXTRA_TEST_DEFINITIONS)
-if (INLINE_TEST___inline__)
- set (${HDF_PREFIX}_inline __inline__)
-else (INLINE_TEST___inline__)
- if (INLINE_TEST___inline)
- set (${HDF_PREFIX}_inline __inline)
- else (INLINE_TEST___inline)
- if (INLINE_TEST_inline)
- set (${HDF_PREFIX}_inline inline)
- endif (INLINE_TEST_inline)
- endif (INLINE_TEST___inline)
-endif (INLINE_TEST___inline__)
-
#-----------------------------------------------------------------------------
# Check how to print a Long Long integer
#-----------------------------------------------------------------------------
if (NOT ${HDF_PREFIX}_PRINTF_LL_WIDTH OR ${HDF_PREFIX}_PRINTF_LL_WIDTH MATCHES "unknown")
set (PRINT_LL_FOUND 0)
message (STATUS "Checking for appropriate format for 64 bit long:")
- foreach (HDF5_PRINTF_LL l64 l L q I64 ll)
- set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH=${HDF5_PRINTF_LL}")
- if (${HDF_PREFIX}_SIZEOF_LONG_LONG)
- set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG")
- endif (${HDF_PREFIX}_SIZEOF_LONG_LONG)
- TRY_RUN (HDF5_PRINTF_LL_TEST_RUN HDF5_PRINTF_LL_TEST_COMPILE
- ${CMAKE_BINARY_DIR}
- ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
- CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS}
- OUTPUT_VARIABLE OUTPUT
+ set (CURRENT_TEST_DEFINITIONS "-DPRINTF_LL_WIDTH")
+ if (${HDF_PREFIX}_SIZEOF_LONG_LONG)
+ set (CURRENT_TEST_DEFINITIONS "${CURRENT_TEST_DEFINITIONS} -DHAVE_LONG_LONG")
+ endif (${HDF_PREFIX}_SIZEOF_LONG_LONG)
+ TRY_RUN (${HDF_PREFIX}_PRINTF_LL_TEST_RUN ${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE
+ ${CMAKE_BINARY_DIR}
+ ${HDF_RESOURCES_EXT_DIR}/HDFTests.c
+ CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${CURRENT_TEST_DEFINITIONS}
+ OUTPUT_VARIABLE OUTPUT
+ )
+ if (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
+ if (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
+ string(REGEX REPLACE ".*PRINTF_LL_WIDTH=\\[(.*)\\].*" "\\1" ${HDF_PREFIX}_PRINTF_LL "${OUTPUT}")
+ set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${${HDF_PREFIX}_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll")
+ set (PRINT_LL_FOUND 1)
+ else (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
+ message ("Width test failed with result: ${${HDF_PREFIX}_PRINTF_LL_TEST_RUN}")
+ endif (${HDF_PREFIX}_PRINTF_LL_TEST_RUN MATCHES 0)
+ else (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
+ file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
+ "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH failed with the following output:\n ${OUTPUT}\n"
)
- if (HDF5_PRINTF_LL_TEST_COMPILE)
- if (HDF5_PRINTF_LL_TEST_RUN MATCHES 0)
- set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"${HDF5_PRINTF_LL}\"" CACHE INTERNAL "Width for printf for type `long long' or `__int64', us. `ll")
- set (PRINT_LL_FOUND 1)
- else (HDF5_PRINTF_LL_TEST_RUN MATCHES 0)
- message ("Width with ${HDF5_PRINTF_LL} failed with result: ${HDF5_PRINTF_LL_TEST_RUN}")
- endif (HDF5_PRINTF_LL_TEST_RUN MATCHES 0)
- else (HDF5_PRINTF_LL_TEST_COMPILE)
- file (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
- "Test ${HDF_PREFIX}_PRINTF_LL_WIDTH for ${HDF5_PRINTF_LL} failed with the following output:\n ${OUTPUT}\n"
- )
- endif (HDF5_PRINTF_LL_TEST_COMPILE)
- endforeach (HDF5_PRINTF_LL)
+ endif (${HDF_PREFIX}_PRINTF_LL_TEST_COMPILE)
if (PRINT_LL_FOUND)
- message (STATUS "Checking for apropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}")
+ message (STATUS "Checking for appropriate format for 64 bit long: found ${${HDF_PREFIX}_PRINTF_LL_WIDTH}")
else (PRINT_LL_FOUND)
- message (STATUS "Checking for apropriate format for 64 bit long: not found")
+ message (STATUS "Checking for appropriate format for 64 bit long: not found")
set (${HDF_PREFIX}_PRINTF_LL_WIDTH "\"unknown\"" CACHE INTERNAL
"Width for printf for type `long long' or `__int64', us. `ll"
)
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 7660a8a..3f91405 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -1,12 +1,12 @@
#-------------------------------------------------------------------------------
-MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
+macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
# May need to build JPEG with PIC on x64 machines with gcc
# Need to use CMAKE_ANSI_CFLAGS define so that compiler test works
if (${compress_type} MATCHES "SVN")
EXTERNALPROJECT_ADD (JPEG
SVN_REPOSITORY ${JPEG_URL}
- # [SVN_REVISION rev]
+ # [SVN_REVISION rev]
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
@@ -18,7 +18,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
- )
+ )
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
GIT_REPOSITORY ${JPEG_URL}
@@ -33,7 +33,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
- )
+ )
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
URL ${JPEG_URL}
@@ -49,34 +49,34 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
- )
+ )
endif (${compress_type} MATCHES "SVN")
- externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
+ externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
-##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
+##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target jpeg-static
add_library(jpeg-static STATIC IMPORTED)
-# Create imported target jpeg-shared
- add_library(jpeg-shared SHARED IMPORTED)
- if (BUILD_SHARED_LIBS)
- HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "")
- add_dependencies (JPEG jpeg-shared)
- set (JPEG_SHARED_LIBRARY "jpeg-shared")
- set (JPEG_LIBRARIES ${JPEG_shared_LIBRARY})
- endif (BUILD_SHARED_LIBS)
HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "")
add_dependencies (JPEG jpeg-static)
set (JPEG_STATIC_LIBRARY "jpeg-static")
set (JPEG_LIBRARIES ${JPEG_static_LIBRARY})
-
+ if (BUILD_SHARED_LIBS)
+ # Create imported target jpeg-shared
+ add_library(jpeg-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "")
+ add_dependencies (JPEG jpeg-shared)
+ set (JPEG_SHARED_LIBRARY "jpeg-shared")
+ set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_shared_LIBRARY})
+ endif (BUILD_SHARED_LIBS)
+
set (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src")
set (JPEG_FOUND 1)
set (JPEG_INCLUDE_DIRS ${JPEG_INCLUDE_DIR_GEN} ${JPEG_INCLUDE_DIR})
-ENDMACRO (EXTERNAL_JPEG_LIBRARY)
+endmacro (EXTERNAL_JPEG_LIBRARY)
#-------------------------------------------------------------------------------
-MACRO (PACKAGE_JPEG_LIBRARY compress_type)
+macro (PACKAGE_JPEG_LIBRARY compress_type)
add_custom_target (JPEG-GenHeader-Copy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_INCLUDE_DIR_GEN}/jconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
@@ -85,14 +85,14 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type)
if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
add_dependencies (JPEG-GenHeader-Copy JPEG)
endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
-ENDMACRO (PACKAGE_JPEG_LIBRARY)
+endmacro (PACKAGE_JPEG_LIBRARY)
#-------------------------------------------------------------------------------
-MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding)
+macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
if (${compress_type} MATCHES "SVN")
EXTERNALPROJECT_ADD (SZIP
SVN_REPOSITORY ${SZIP_URL}
- # [SVN_REVISION rev]
+ # [SVN_REVISION rev]
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
@@ -105,11 +105,11 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
- )
+ )
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
GIT_REPOSITORY ${SZIP_URL}
- # [SVN_REVISION rev]
+ # [SVN_REVISION rev]
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
@@ -122,7 +122,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
- )
+ )
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
URL ${SZIP_URL}
@@ -139,34 +139,34 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
- )
+ )
endif (${compress_type} MATCHES "SVN")
- externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
+ externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
-##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
+##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target szip-static
add_library(szip-static STATIC IMPORTED)
-# Create imported target szip-shared
- add_library(szip-shared SHARED IMPORTED)
- if (BUILD_SHARED_LIBS)
- HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "")
- add_dependencies (SZIP szip-shared)
- set (SZIP_SHARED_LIBRARY "szip-shared")
- set (SZIP_LIBRARIES ${SZIP_shared_LIBRARY})
- endif (BUILD_SHARED_LIBS)
HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "")
add_dependencies (SZIP szip-static)
set (SZIP_STATIC_LIBRARY "szip-static")
set (SZIP_LIBRARIES ${SZIP_static_LIBRARY})
+ if (BUILD_SHARED_LIBS)
+ # Create imported target szip-shared
+ add_library(szip-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "")
+ add_dependencies (SZIP szip-shared)
+ set (SZIP_SHARED_LIBRARY "szip-shared")
+ set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_shared_LIBRARY})
+ endif (BUILD_SHARED_LIBS)
set (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src")
set (SZIP_FOUND 1)
set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIR_GEN} ${SZIP_INCLUDE_DIR})
-ENDMACRO (EXTERNAL_SZIP_LIBRARY)
+endmacro (EXTERNAL_SZIP_LIBRARY)
#-------------------------------------------------------------------------------
-MACRO (PACKAGE_SZIP_LIBRARY compress_type)
+macro (PACKAGE_SZIP_LIBRARY compress_type)
add_custom_target (SZIP-GenHeader-Copy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
@@ -175,14 +175,14 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type)
if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
add_dependencies (SZIP-GenHeader-Copy SZIP)
endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
-ENDMACRO (PACKAGE_SZIP_LIBRARY)
+endmacro (PACKAGE_SZIP_LIBRARY)
#-------------------------------------------------------------------------------
-MACRO (EXTERNAL_ZLIB_LIBRARY compress_type)
+macro (EXTERNAL_ZLIB_LIBRARY compress_type)
if (${compress_type} MATCHES "SVN")
EXTERNALPROJECT_ADD (ZLIB
SVN_REPOSITORY ${ZLIB_URL}
- # [SVN_REVISION rev]
+ # [SVN_REVISION rev]
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
@@ -194,11 +194,11 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- )
+ )
elseif (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
GIT_REPOSITORY ${ZLIB_URL}
- # [SVN_REVISION rev]
+ # [SVN_REVISION rev]
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
@@ -210,7 +210,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- )
+ )
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
URL ${ZLIB_URL}
@@ -226,39 +226,39 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- )
+ )
endif (${compress_type} MATCHES "SVN")
- externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
+ externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
if (WIN32)
set (ZLIB_LIB_NAME "zlib")
else (WIN32)
set (ZLIB_LIB_NAME "z")
endif (WIN32)
-##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
+##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target zlib-static
add_library(zlib-static STATIC IMPORTED)
-# Create imported target zlib-shared
- add_library(zlib-shared SHARED IMPORTED)
- if (BUILD_SHARED_LIBS)
- HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "")
- add_dependencies (ZLIB zlib-shared)
- set (ZLIB_SHARED_LIBRARY "zlib-shared")
- set (ZLIB_LIBRARIES ${ZLIB_SHARED_LIBRARY})
- endif (BUILD_SHARED_LIBS)
HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "")
add_dependencies (ZLIB zlib-static)
set (ZLIB_STATIC_LIBRARY "zlib-static")
set (ZLIB_LIBRARIES ${ZLIB_static_LIBRARY})
+ if (BUILD_SHARED_LIBS)
+ # Create imported target zlib-shared
+ add_library(zlib-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "")
+ add_dependencies (ZLIB zlib-shared)
+ set (ZLIB_SHARED_LIBRARY "zlib-shared")
+ set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY})
+ endif (BUILD_SHARED_LIBS)
set (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}")
set (ZLIB_INCLUDE_DIR "${SOURCE_DIR}")
set (ZLIB_FOUND 1)
set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR_GEN} ${ZLIB_INCLUDE_DIR})
-ENDMACRO (EXTERNAL_ZLIB_LIBRARY)
+endmacro (EXTERNAL_ZLIB_LIBRARY)
#-------------------------------------------------------------------------------
-MACRO (PACKAGE_ZLIB_LIBRARY compress_type)
+macro (PACKAGE_ZLIB_LIBRARY compress_type)
add_custom_target (ZLIB-GenHeader-Copy ALL
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_INCLUDE_DIR_GEN}/zconf.h ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
@@ -267,4 +267,4 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type)
if (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
add_dependencies (ZLIB-GenHeader-Copy ZLIB)
endif (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
-ENDMACRO (PACKAGE_ZLIB_LIBRARY)
+endmacro (PACKAGE_ZLIB_LIBRARY)
diff --git a/config/cmake_ext_mod/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 1c23ac3..8478d1b 100644
--- a/config/cmake_ext_mod/HDFTests.c
+++ b/config/cmake_ext_mod/HDFTests.c
@@ -213,7 +213,7 @@ SIMPLE_TEST(struct stat sb; sb.st_blocks=0);
int main(void)
{
- char *llwidthArgs[] = { "l64", "l", "L", "q", "ll", NULL };
+ char *llwidthArgs[] = { "I64", "l64", "l", "L", "q", "ll", NULL };
char *s = malloc(128);
char **currentArg = NULL;
LL_TYPE x = (LL_TYPE)1048576 * (LL_TYPE)1048576;
@@ -454,13 +454,19 @@ SIMPLE_TEST(struct text_info w; w.screenwidth=0);
#endif /* HAVE_TM_GMTOFF */
-
-#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline )
+#if defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE )
#ifndef __cplusplus
+#if defined( HAVE_INLINE )
+# define INLINE_KW inline
+#elif defined ( HAVE___INLINE__ )
+# define INLINE_KW __inline__
+#elif defined ( HAVE___INLINE )
+# define INLINE_KW __inline
+#endif /* HAVE_INLINE */
typedef int foo_t;
-static INLINE_TEST_INLINE foo_t static_foo () { return 0; }
-INLINE_TEST_INLINE foo_t foo () {return 0; }
-int main() { return 0; }
-#endif
+static INLINE_KW foo_t static_foo () { return 0; }
+INLINE_KW foo_t foo () {return 0; }
+int main(void) { return 0; }
+#endif /* __cplusplus */
+#endif /* defined( HAVE_INLINE ) || defined( HAVE___INLINE__ ) || defined( HAVE___INLINE ) */
-#endif /* INLINE_TEST */