summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-08-30 14:25:43 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-08-30 14:25:43 (GMT)
commit919b2c21d0b932552d27cdc4f12389ef86840fd5 (patch)
tree39f0894a4d0167876a3643d2d809b6b97fbb6715 /config
parent172dba34271abcef98763624d46562bca3f147fb (diff)
parentaedd884ff44169c067f1cc1755a31352ae35651b (diff)
downloadhdf5-919b2c21d0b932552d27cdc4f12389ef86840fd5.zip
hdf5-919b2c21d0b932552d27cdc4f12389ef86840fd5.tar.gz
hdf5-919b2c21d0b932552d27cdc4f12389ef86840fd5.tar.bz2
Merge pull request #1913 in HDFFV/hdf5 from ~BYRN/hdf5_adb:hdf5_1_8 to hdf5_1_8
* commit 'aedd884ff44169c067f1cc1755a31352ae35651b': Fix namespace usage Fix EXISTS test syntax Fix EXISTS test and add toolchain
Diffstat (limited to 'config')
-rw-r--r--config/cmake/hdf5-config.cmake.in4
-rw-r--r--config/cmake/vfdTest.cmake8
-rw-r--r--config/cmake_ext_mod/grepTest.cmake8
-rw-r--r--config/cmake_ext_mod/runTest.cmake10
-rw-r--r--config/toolchain/build32.cmake39
5 files changed, 54 insertions, 15 deletions
diff --git a/config/cmake/hdf5-config.cmake.in b/config/cmake/hdf5-config.cmake.in
index 7af255c..6514fee 100644
--- a/config/cmake/hdf5-config.cmake.in
+++ b/config/cmake/hdf5-config.cmake.in
@@ -167,12 +167,12 @@ foreach (libtype IN LISTS ${HDF5_PACKAGE_NAME}_LIB_TYPE)
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp2}-${libtype} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp2}-${libtype} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
else ()
set (${HDF5_PACKAGE_NAME}_${libtype}_${comp}_FOUND 1)
string(TOUPPER ${HDF5_PACKAGE_NAME}_${comp}_${libtype}_LIBRARY COMP_LIBRARY)
- set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF5_PACKAGE@::${hdf5_comp}-${libtype})
+ set (${COMP_LIBRARY} ${${COMP_LIBRARY}} @HDF_PACKAGE_NAMESPACE@${hdf5_comp}-${libtype})
endif ()
endif ()
endforeach ()
diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake
index 3556d07..12ee40b 100644
--- a/config/cmake/vfdTest.cmake
+++ b/config/cmake/vfdTest.cmake
@@ -23,11 +23,11 @@ if (NOT TEST_VFD)
message (FATAL_ERROR "Require TEST_VFD to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@@ -54,7 +54,7 @@ execute_process (
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err)
+if (ERROR_APPEND AND EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM)
file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}")
endif ()
@@ -62,7 +62,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out)
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
endif ()
diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake
index ab00e70..78ee0da 100644
--- a/config/cmake_ext_mod/grepTest.cmake
+++ b/config/cmake_ext_mod/grepTest.cmake
@@ -35,11 +35,11 @@ if (NOT TEST_REFERENCE)
message (FATAL_ERROR "Require TEST_REFERENCE to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@@ -84,7 +84,7 @@ endif ()
# if the TEST_ERRREF exists grep the error output with the error reference
if (TEST_ERRREF)
# if the .err file exists grep the error output with the error reference before comparing stdout
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERR_STREAM)
# TEST_ERRREF should always be matched
@@ -97,7 +97,7 @@ 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 (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
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})
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index 21c8c18..e601653 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -27,11 +27,11 @@ if (NOT TEST_EXPECT)
message (STATUS "Require TEST_EXPECT to be defined")
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT})
endif ()
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
@@ -88,7 +88,7 @@ endif ()
message (STATUS "COMMAND Result: ${TEST_RESULT}")
# if the .err file exists and ERRROR_APPEND is enabled
-if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
+if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
if (TEST_MASK_FILE)
STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}")
@@ -113,7 +113,7 @@ endif ()
# if the return value is !=${TEST_EXPECT} bail out
if (NOT TEST_RESULT EQUAL TEST_EXPECT)
if (NOT TEST_NOERRDISPLAY)
- if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
+ if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
message (STATUS "Output :\n${TEST_STREAM}")
endif ()
@@ -204,7 +204,7 @@ endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
- if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
+ if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}")
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})
diff --git a/config/toolchain/build32.cmake b/config/toolchain/build32.cmake
new file mode 100644
index 0000000..d078956
--- /dev/null
+++ b/config/toolchain/build32.cmake
@@ -0,0 +1,39 @@
+if (WIN32)
+ set (CMAKE_SYSTEM_NAME Windows)
+ set (CMAKE_GENERATOR_PLATFORM "x86")
+elseif(APPLE)
+ set (CMAKE_OSX_ARCHITECTURES "i386")
+else ()
+ set (CMAKE_SYSTEM_NAME Linux)
+
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
+
+ set (LIB32 /usr/lib) # Fedora
+
+ if (EXISTS "/usr/lib32")
+ set (LIB32 /usr/lib32) # Arch, Solus
+ endif ()
+
+ set (CMAKE_SYSTEM_LIBRARY_PATH ${LIB32} CACHE STRING "system library search path" FORCE)
+ set (CMAKE_LIBRARY_PATH ${LIB32} CACHE STRING "library search path" FORCE)
+
+ # this is probably unlikely to be needed, but just in case
+ set (CMAKE_EXE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "executable linker flags" FORCE)
+ set (CMAKE_SHARED_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "shared library linker flags" FORCE)
+ set (CMAKE_MODULE_LINKER_FLAGS "-m32 -L${LIB32}" CACHE STRING "module linker flags" FORCE)
+
+ # on Fedora and Arch and similar, point pkgconfig at 32 bit .pc files. We have
+ # to include the regular system .pc files as well (at the end), because some
+ # are not always present in the 32 bit directory
+ if (EXISTS "${LIB32}/pkgconfig")
+ set (ENV{PKG_CONFIG_LIBDIR} ${LIB32}/pkgconfig:/usr/share/pkgconfig:/usr/lib/pkgconfig:/usr/lib64/pkgconfig)
+ endif ()
+# where is the target environment
+ set (CMAKE_FIND_ROOT_PATH ${LIB32})
+# search for programs in the build host directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+# for libraries and headers in the target directories
+ set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+endif () \ No newline at end of file