summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2015-10-21 15:44:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2015-10-21 15:44:41 (GMT)
commit78c820b1ee3ba31297f9de1df3ffa88fb137f588 (patch)
tree5c2510d1f8a1e0ef9cbb8dcc2b22d69fffca0ebe /config/cmake_ext_mod
parent83d7feb63c0d38387bfb7814ccfdaa70bc1b77cd (diff)
downloadhdf5-78c820b1ee3ba31297f9de1df3ffa88fb137f588.zip
hdf5-78c820b1ee3ba31297f9de1df3ffa88fb137f588.tar.gz
hdf5-78c820b1ee3ba31297f9de1df3ffa88fb137f588.tar.bz2
[svn-r28158] Merge from CMAMKE_EXT_MOD repo.
Add VS2015 support.
Diffstat (limited to 'config/cmake_ext_mod')
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake67
-rw-r--r--config/cmake_ext_mod/HDFTests.c2
2 files changed, 35 insertions, 34 deletions
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index c76129a..94e5be1 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")
#-----------------------------------------------------------------------------
@@ -90,7 +90,9 @@ if (WINDOWS)
endif (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
set (${HDF_PREFIX}_HAVE_FUNCTION 1)
set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
- set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
+ if (MSVC_VERSION LESS 1900)
+ set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
+ endif (MSVC_VERSION LESS 1900)
set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
if (MINGW)
set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
@@ -640,7 +642,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
@@ -672,7 +674,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")
@@ -684,7 +686,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")
@@ -721,35 +723,34 @@ endif (INLINE_TEST___inline__)
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/HDFTests.c b/config/cmake_ext_mod/HDFTests.c
index 1c23ac3..5c4d360 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;