summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-07-23 21:21:47 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-07-23 21:21:47 (GMT)
commitd3fdcd8a680ad0f8b21304b35e8564b774a88ef0 (patch)
tree7eaf482abb38de0349b7844ed6f9e04de88f438d /config
parent6add0919d1dd737a7d9a2da25079d761a85f282e (diff)
parente19b0302cc38d1850ada7a00431511343cddc8a6 (diff)
downloadhdf5-d3fdcd8a680ad0f8b21304b35e8564b774a88ef0.zip
hdf5-d3fdcd8a680ad0f8b21304b35e8564b774a88ef0.tar.gz
hdf5-d3fdcd8a680ad0f8b21304b35e8564b774a88ef0.tar.bz2
Merge pull request #1807 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'e19b0302cc38d1850ada7a00431511343cddc8a6': (31 commits) HDFFV-10845 update note Correct format of drive check Use generator expr to get correct name HDFFV-10845 Allow mingw to find functionality HDFFV-10845 fix comment syntax HDFFV-10845 Windows drive can only goto Z HDFFV-10845 make flags private Correct java load library name access Correct syntax Fix typo Correct OUTPUT_NAME usage CMake generator expr cannot be used in get_property cmd HDFFV-1045 gcc static must be link flags HDFFV-10845 quote multiple strings in cmake link command HDFFV-10845 update mingw cmake changes Add missing target root path, check other export macro HDFFV-10845 skip test if CMake command doesn't support ignore EOL HDFFV-10845 copy files with windows EOL HDFFV-10845 separate test used by copy windows files HDFFV-10845 mingw needs special windows reference files ...
Diffstat (limited to 'config')
-rw-r--r--config/cmake/CTestScript.cmake7
-rw-r--r--config/cmake/ConfigureChecks.cmake2
-rw-r--r--config/cmake/jrunTest.cmake18
-rw-r--r--config/cmake/scripts/CTestScript.cmake2
-rw-r--r--config/cmake/scripts/HDF5config.cmake6
-rw-r--r--config/cmake/userblockTest.cmake8
-rw-r--r--config/cmake/vfdTest.cmake4
-rw-r--r--config/cmake/volTest.cmake4
-rw-r--r--config/cmake_ext_mod/ConfigureChecks.cmake55
-rw-r--r--config/cmake_ext_mod/FindSZIP.cmake2
-rw-r--r--config/cmake_ext_mod/HDFMacros.cmake42
-rw-r--r--config/cmake_ext_mod/HDFUseFortran.cmake2
-rw-r--r--config/cmake_ext_mod/grepTest.cmake14
-rw-r--r--config/cmake_ext_mod/runTest.cmake24
-rw-r--r--config/toolchain/mingw64.cmake10
15 files changed, 121 insertions, 79 deletions
diff --git a/config/cmake/CTestScript.cmake b/config/cmake/CTestScript.cmake
index 0269ba8..e819e58 100644
--- a/config/cmake/CTestScript.cmake
+++ b/config/cmake/CTestScript.cmake
@@ -72,7 +72,7 @@ set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
if (CTEST_USE_TAR_SOURCE)
## Uncompress source if tar or zip file provided
## --------------------------
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
message (STATUS "extracting... [${CMAKE_EXECUTABLE_NAME} -E tar -xvf ${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 ()
@@ -101,6 +101,11 @@ endif ()
include (ProcessorCount)
ProcessorCount (N)
if (NOT N EQUAL 0)
+ if (MAX_PROC_COUNT)
+ if (N GREATER MAX_PROC_COUNT)
+ set (N ${MAX_PROC_COUNT})
+ endif ()
+ endif ()
if (NOT WIN32)
set (CTEST_BUILD_FLAGS -j${N})
endif ()
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index c1abeed..3bd0553 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -102,7 +102,7 @@ endif ()
CHECK_FUNCTION_EXISTS (difftime ${HDF_PREFIX}_HAVE_DIFFTIME)
# Find the library containing clock_gettime()
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
CHECK_FUNCTION_EXISTS (clock_gettime CLOCK_GETTIME_IN_LIBC)
CHECK_LIBRARY_EXISTS (rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT)
CHECK_LIBRARY_EXISTS (posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4)
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake
index 44ac15b..fa687f5 100644
--- a/config/cmake/jrunTest.cmake
+++ b/config/cmake/jrunTest.cmake
@@ -49,7 +49,7 @@ endif ()
message (STATUS "COMMAND: ${TEST_TESTER} -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=${LOG_LEVEL} -Djava.library.path=\"${TEST_LIBRARY_DIRECTORY}\" -cp \"${TEST_CLASSPATH}\" ${TEST_ARGS} ${TEST_PROGRAM} ${ARGN}")
-if (WIN32 AND NOT MINGW)
+if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH}\\;${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -124,9 +124,11 @@ message (STATUS "COMMAND Error: ${TEST_ERROR}")
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
if (NOT TEST_SORT_COMPARE)
@@ -186,9 +188,11 @@ if (NOT TEST_SKIP_COMPARE)
# now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
endif ()
# now compare the error output with the error reference
diff --git a/config/cmake/scripts/CTestScript.cmake b/config/cmake/scripts/CTestScript.cmake
index e1fe85a..dc3939e 100644
--- a/config/cmake/scripts/CTestScript.cmake
+++ b/config/cmake/scripts/CTestScript.cmake
@@ -69,7 +69,7 @@ set (CTEST_CMAKE_COMMAND "\"${CMAKE_COMMAND}\"")
if (CTEST_USE_TAR_SOURCE)
## Uncompress source if tar file provided
## --------------------------
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
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 ()
diff --git a/config/cmake/scripts/HDF5config.cmake b/config/cmake/scripts/HDF5config.cmake
index 44ed531..e6c9619 100644
--- a/config/cmake/scripts/HDF5config.cmake
+++ b/config/cmake/scripts/HDF5config.cmake
@@ -90,7 +90,7 @@ endif ()
set (CTEST_BINARY_NAME "build")
set (CTEST_DASHBOARD_ROOT "${CTEST_SCRIPT_DIRECTORY}")
-if (WIN32)
+if (WIN32 AND NOT MINGW)
set (CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_SOURCE_NAME}")
set (CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}\\${CTEST_BINARY_NAME}")
else ()
@@ -104,7 +104,7 @@ if (NOT DEFINED HPC)
if (NOT DEFINED BUILD_GENERATOR)
message (FATAL_ERROR "BUILD_GENERATOR must be defined - Unix, VS2017, or VS201764, VS2015, VS201564, VS2013, VS201364")
endif ()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (SITE_OS_NAME "Windows")
set (SITE_OS_VERSION "WIN7")
if (BUILD_GENERATOR STREQUAL "VS201764")
@@ -212,7 +212,7 @@ set (REPOSITORY_BRANCH "develop")
###################################################################
-if (WIN32)
+if (WIN32 AND NOT MINGW)
set (BINFILEBASE "HDF5-${CTEST_SOURCE_VERSION}${CTEST_SOURCE_VERSEXT}-win${SITE_OS_BITS}")
include (${CTEST_SCRIPT_DIRECTORY}\\HDF5options.cmake)
include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake)
diff --git a/config/cmake/userblockTest.cmake b/config/cmake/userblockTest.cmake
index 0e9d01b..c9fc36f 100644
--- a/config/cmake/userblockTest.cmake
+++ b/config/cmake/userblockTest.cmake
@@ -55,7 +55,7 @@ if (TEST_CHECKUB STREQUAL "YES")
# of the user block
#s2=`$JAM_BIN/tellub $origfile`
EXECUTE_PROCESS (
- COMMAND ${TEST_PROGRAM} ${TEST_OFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}.len.txt
@@ -73,7 +73,7 @@ if (TEST_CHECKUB STREQUAL "YES")
if (TEST_O_STRING_LEN)
#$JAM_BIN/getub -c $s2 $origfile > $cmpfile
EXECUTE_PROCESS (
- COMMAND ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_O_STRING_LEN} ${TEST_OFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}-ub.cmp
@@ -91,7 +91,7 @@ if (TEST_CHECKUB STREQUAL "YES")
#$JAM_BIN/getub -c $size $hfile > $tfile
EXECUTE_PROCESS (
- COMMAND ${TEST_GET_PROGRAM} -c ${TEST_STRING_SIZE} ${TEST_HFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_GET_PROGRAM} -c ${TEST_STRING_SIZE} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_HFILE}.cmp
@@ -115,7 +115,7 @@ else ()
# call 'ubsize' to get the size of the user block
#ubsize=`$JAM_BIN/tellub $hfile`
EXECUTE_PROCESS (
- COMMAND ${TEST_PROGRAM} ${TEST_HFILE}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_HFILE}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_H_STRING_LEN
OUTPUT_VARIABLE TEST_OUT
diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake
index 8e186e9..3556d07 100644
--- a/config/cmake/vfdTest.cmake
+++ b/config/cmake/vfdTest.cmake
@@ -36,13 +36,13 @@ endif ()
# set (ERROR_APPEND 1)
#endif ()
-message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
set (ENV{HDF5_DRIVER} "${TEST_VFD}")
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out
diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake
index a9dd756..6554f00 100644
--- a/config/cmake/volTest.cmake
+++ b/config/cmake/volTest.cmake
@@ -36,13 +36,13 @@ endif ()
# set (ERROR_APPEND 1)
#endif ()
-message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}")
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}.out
diff --git a/config/cmake_ext_mod/ConfigureChecks.cmake b/config/cmake_ext_mod/ConfigureChecks.cmake
index 63d9ee9..abc88ed 100644
--- a/config/cmake_ext_mod/ConfigureChecks.cmake
+++ b/config/cmake_ext_mod/ConfigureChecks.cmake
@@ -61,17 +61,17 @@ endmacro ()
# ----------------------------------------------------------------------
# WINDOWS Hard code Values
# ----------------------------------------------------------------------
-
set (WINDOWS)
-if (WIN32)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_MINGW 1)
- set (WINDOWS 1) # MinGW tries to imitate Windows
- set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
- endif ()
- set (${HDF_PREFIX}_HAVE_WIN32_API 1)
- set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
- if (NOT UNIX AND NOT MINGW)
+
+if (MINGW)
+ set (${HDF_PREFIX}_HAVE_MINGW 1)
+ set (WINDOWS 1) # MinGW tries to imitate Windows
+ set (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1")
+ set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
+endif ()
+
+if (WIN32 AND NOT MINGW)
+ if (NOT UNIX)
set (WINDOWS 1)
set (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1")
if (MSVC)
@@ -81,6 +81,8 @@ if (WIN32)
endif ()
if (WINDOWS)
+ set (HDF5_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib")
+ set (${HDF_PREFIX}_HAVE_WIN32_API 1)
set (${HDF_PREFIX}_HAVE_STDDEF_H 1)
set (${HDF_PREFIX}_HAVE_SYS_STAT_H 1)
set (${HDF_PREFIX}_HAVE_SYS_TYPES_H 1)
@@ -90,19 +92,16 @@ if (WINDOWS)
set (${HDF_PREFIX}_HAVE_LONGJMP 1)
if (NOT MINGW)
set (${HDF_PREFIX}_HAVE_GETHOSTNAME 1)
+ set (${HDF_PREFIX}_HAVE_FUNCTION 1)
endif ()
- if (NOT UNIX AND NOT CYGWIN AND NOT MINGW)
+ if (NOT UNIX AND NOT CYGWIN)
set (${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO 1)
+ set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
+ set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
+ set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
+ set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
+ set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
- set (${HDF_PREFIX}_HAVE_FUNCTION 1)
- set (${HDF_PREFIX}_GETTIMEOFDAY_GIVES_TZ 1)
- set (${HDF_PREFIX}_HAVE_TIMEZONE 1)
- set (${HDF_PREFIX}_HAVE_GETTIMEOFDAY 1)
- if (MINGW)
- set (${HDF_PREFIX}_HAVE_WINSOCK2_H 1)
- endif ()
- set (${HDF_PREFIX}_HAVE_LIBWS2_32 1)
- set (${HDF_PREFIX}_HAVE_LIBWSOCK32 1)
endif ()
# ----------------------------------------------------------------------
@@ -188,7 +187,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check for the math library "m"
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil ${HDF_PREFIX}_HAVE_LIBM)
CHECK_LIBRARY_EXISTS_CONCAT ("dl" dlopen ${HDF_PREFIX}_HAVE_LIBDL)
CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup ${HDF_PREFIX}_HAVE_LIBWS2_32)
@@ -264,7 +263,7 @@ set (LINUX_LFS 0)
set (HDF_EXTRA_C_FLAGS)
set (HDF_EXTRA_FLAGS)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
# 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)
@@ -324,7 +323,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check for HAVE_OFF64_T functionality
#-----------------------------------------------------------------------------
-if (NOT WINDOWS OR MINGW)
+if (MINGW OR NOT WINDOWS)
HDF_FUNCTION_TEST (HAVE_OFF64_T)
if (${HDF_PREFIX}_HAVE_OFF64_T)
CHECK_FUNCTION_EXISTS (lseek64 ${HDF_PREFIX}_HAVE_LSEEK64)
@@ -403,7 +402,7 @@ if (NOT APPLE)
if (NOT ${HDF_PREFIX}_SIZEOF_SSIZE_T)
set (${HDF_PREFIX}_SIZEOF_SSIZE_T 0)
endif ()
- if (NOT WINDOWS)
+ if (MINGW OR NOT WINDOWS)
HDF_CHECK_TYPE_SIZE (ptrdiff_t ${HDF_PREFIX}_SIZEOF_PTRDIFF_T)
endif ()
endif ()
@@ -427,7 +426,7 @@ else ()
HDF_CHECK_TYPE_SIZE (_Bool ${HDF_PREFIX}_SIZEOF_BOOL)
endif ()
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
#-----------------------------------------------------------------------------
# Check if the dev_t type is a scalar type
#-----------------------------------------------------------------------------
@@ -474,7 +473,7 @@ if (NOT WINDOWS)
CHECK_FUNCTION_EXISTS (_getvideoconfig ${HDF_PREFIX}_HAVE__GETVIDEOCONFIG)
CHECK_FUNCTION_EXISTS (gettextinfo ${HDF_PREFIX}_HAVE_GETTEXTINFO)
CHECK_FUNCTION_EXISTS (_scrsize ${HDF_PREFIX}_HAVE__SCRSIZE)
- if (NOT CYGWIN AND NOT MINGW)
+ if (NOT CYGWIN)
CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo ${HDF_PREFIX}_HAVE_GETCONSOLESCREENBUFFERINFO)
endif ()
CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" ${HDF_PREFIX}_HAVE_TIOCGWINSZ)
@@ -535,7 +534,7 @@ CHECK_FUNCTION_EXISTS (vasprintf ${HDF_PREFIX}_HAVE_VASPRINTF)
CHECK_FUNCTION_EXISTS (waitpid ${HDF_PREFIX}_HAVE_WAITPID)
CHECK_FUNCTION_EXISTS (vsnprintf ${HDF_PREFIX}_HAVE_VSNPRINTF)
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
if (${HDF_PREFIX}_HAVE_VSNPRINTF)
HDF_FUNCTION_TEST (VSNPRINTF_WORKS)
endif ()
@@ -556,7 +555,7 @@ endif ()
#-----------------------------------------------------------------------------
# Check a bunch of other functions
#-----------------------------------------------------------------------------
-if (NOT WINDOWS)
+if (MINGW OR NOT WINDOWS)
foreach (other_test
HAVE_ATTRIBUTE
HAVE_C99_FUNC
diff --git a/config/cmake_ext_mod/FindSZIP.cmake b/config/cmake_ext_mod/FindSZIP.cmake
index b84d768..2303d6d 100644
--- a/config/cmake_ext_mod/FindSZIP.cmake
+++ b/config/cmake_ext_mod/FindSZIP.cmake
@@ -73,7 +73,7 @@ if(SZIP_INCLUDE_DIR AND EXISTS "${SZIP_INCLUDE_DIR}/SZconfig.h")
unset(szip_version_str)
endif()
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SZIP
REQUIRED_VARS SZIP_LIBRARY SZIP_INCLUDE_DIR
VERSION_VAR SZIP_VERSION)
diff --git a/config/cmake_ext_mod/HDFMacros.cmake b/config/cmake_ext_mod/HDFMacros.cmake
index 0a4598d..972896d 100644
--- a/config/cmake_ext_mod/HDFMacros.cmake
+++ b/config/cmake_ext_mod/HDFMacros.cmake
@@ -86,7 +86,7 @@ macro (INSTALL_TARGET_PDB libtarget targetdestination targetcomponent)
${targetfilename}
DESTINATION
${targetdestination}
- CONFIGURATIONS $<CONFIG>
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
OPTIONAL
)
@@ -101,7 +101,7 @@ macro (INSTALL_PROGRAM_PDB progtarget targetdestination targetcomponent)
$<TARGET_PDB_FILE:${progtarget}>
DESTINATION
${targetdestination}
- CONFIGURATIONS $<CONFIG>
+ CONFIGURATIONS Debug RelWithDebInfo
COMPONENT ${targetcomponent}
OPTIONAL
)
@@ -110,24 +110,37 @@ endmacro ()
#-------------------------------------------------------------------------------
macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
- if (WIN32)
- set (LIB_DEBUG_SUFFIX "_D")
- else ()
- set (LIB_DEBUG_SUFFIX "_debug")
- endif ()
if (${libtype} MATCHES "SHARED")
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (LIB_RELEASE_NAME "lib${libname}")
- set (LIB_DEBUG_NAME "lib${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "lib${libname}${CMAKE_DEBUG_POSTFIX}")
else ()
set (LIB_RELEASE_NAME "${libname}")
- set (LIB_DEBUG_NAME "${libname}${LIB_DEBUG_SUFFIX}")
+ set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
endif ()
endif ()
+ set_target_properties (${libtarget}
+ PROPERTIES
+ OUTPUT_NAME
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_DEBUG
+ ${LIB_DEBUG_NAME}
+ OUTPUT_NAME_RELEASE
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_MINSIZEREL
+ ${LIB_RELEASE_NAME}
+ OUTPUT_NAME_RELWITHDEBINFO
+ ${LIB_RELEASE_NAME}
+ )
+ #get_property (target_name TARGET ${libtarget} PROPERTY OUTPUT_NAME)
+ #get_property (target_name_debug TARGET ${libtarget} PROPERTY OUTPUT_NAME_DEBUG)
+ #get_property (target_name_rwdi TARGET ${libtarget} PROPERTY OUTPUT_NAME_RELWITHDEBINFO)
+ #message (STATUS "${target_name} : ${target_name_debug} : ${target_name_rwdi}")
+
if (${libtype} MATCHES "STATIC")
if (WIN32)
set_target_properties (${libtarget}
@@ -179,7 +192,12 @@ macro (HDF_IMPORT_SET_LIB_OPTIONS libtarget libname libtype libversion)
)
endif ()
else ()
- if (CYGWIN)
+ if (MINGW)
+ set_target_properties (${libtarget} PROPERTIES
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}.lib"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
+ elseif (CYGWIN)
set_target_properties (${libtarget} PROPERTIES
IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${IMPORT_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}"
diff --git a/config/cmake_ext_mod/HDFUseFortran.cmake b/config/cmake_ext_mod/HDFUseFortran.cmake
index bed1fc1..bfb45fa 100644
--- a/config/cmake_ext_mod/HDFUseFortran.cmake
+++ b/config/cmake_ext_mod/HDFUseFortran.cmake
@@ -191,7 +191,7 @@ CHECK_FORTRAN_FEATURE(iso_c_binding
# Add debug information (intel Fortran : JB)
#-----------------------------------------------------------------------------
if (CMAKE_Fortran_COMPILER MATCHES ifort)
- if (WIN32)
+ if (WIN32 AND NOT MINGW)
set (CMAKE_Fortran_FLAGS_DEBUG "/debug:full /dbglibs " CACHE "flags" STRING FORCE)
set (CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE "flags" STRING FORCE)
endif ()
diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake
index 4b58639..ab00e70 100644
--- a/config/cmake_ext_mod/grepTest.cmake
+++ b/config/cmake_ext_mod/grepTest.cmake
@@ -43,10 +43,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -60,7 +60,7 @@ endif ()
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -98,9 +98,11 @@ if (TEST_ERRREF)
#always compare output file to reference unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
if (NOT TEST_SORT_COMPARE)
# now compare the output with the reference
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index c9508f3..a904855 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -35,10 +35,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -53,7 +53,7 @@ endif ()
if (NOT TEST_INPUT)
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -64,7 +64,7 @@ if (NOT TEST_INPUT)
else ()
# run the test program with stdin, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
INPUT_FILE ${TEST_INPUT}
@@ -186,9 +186,11 @@ endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
if (NOT TEST_SORT_COMPARE)
@@ -248,9 +250,11 @@ if (NOT TEST_SKIP_COMPARE)
# now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
endif ()
# now compare the error output with the error reference
diff --git a/config/toolchain/mingw64.cmake b/config/toolchain/mingw64.cmake
new file mode 100644
index 0000000..721c39a
--- /dev/null
+++ b/config/toolchain/mingw64.cmake
@@ -0,0 +1,10 @@
+set (CMAKE_SYSTEM_NAME Windows)
+set (CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+set (CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+set (CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
+set (CMAKE_Fortran_COMPILER x86_64-w64-mingw32-gfortran)
+set (CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32)
+set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+set (CMAKE_CROSSCOMPILING_EMULATOR wine64)