summaryrefslogtreecommitdiffstats
path: root/config/cmake/ConfigureChecks.cmake
diff options
context:
space:
mode:
authorAllen Byrne <50328838+byrnHDF@users.noreply.github.com>2021-11-18 05:53:00 (GMT)
committerGitHub <noreply@github.com>2021-11-18 05:53:00 (GMT)
commitaa2f6735fb7b0dbeae52e9478890e81216c63744 (patch)
treeb501fdc9caabbbd58d026d675e744caf6022bfdf /config/cmake/ConfigureChecks.cmake
parentb823ddc52636596a886c9cc8424142b7c28a1b29 (diff)
downloadhdf5-aa2f6735fb7b0dbeae52e9478890e81216c63744.zip
hdf5-aa2f6735fb7b0dbeae52e9478890e81216c63744.tar.gz
hdf5-aa2f6735fb7b0dbeae52e9478890e81216c63744.tar.bz2
Github #969 Use stdout instead of file for configure check (#1089)
* Use stdout instead of file for configure check * Make change requested by #1157 * Change fortran to use stderr for configure * Correct typo * remove obsolete file check * Fortran statement fix
Diffstat (limited to 'config/cmake/ConfigureChecks.cmake')
-rw-r--r--config/cmake/ConfigureChecks.cmake9
1 files changed, 4 insertions, 5 deletions
diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake
index 7b9d603..483e551 100644
--- a/config/cmake/ConfigureChecks.cmake
+++ b/config/cmake/ConfigureChecks.cmake
@@ -232,7 +232,7 @@ endif ()
# so this one is used.
#-----------------------------------------------------------------------------
set (RUN_OUTPUT_PATH_DEFAULT ${CMAKE_BINARY_DIR})
-macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
+macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR RETURN_OUTPUT_VAR)
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "Detecting C ${FUNCTION_NAME}")
endif ()
@@ -248,7 +248,7 @@ macro (C_RUN FUNCTION_NAME SOURCE_CODE RETURN_VAR)
RUN_OUTPUT_VARIABLE OUTPUT_VAR
)
- set (${RETURN_VAR} ${OUTPUT_VAR})
+ set (${RETURN_OUTPUT_VAR} ${OUTPUT_VAR})
if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0")
message (VERBOSE "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ")
@@ -304,12 +304,11 @@ set (PROG_SRC
#define C_LDBL_DIG DECIMAL_DIG\n\
#else\n\
#define C_LDBL_DIG LDBL_DIG\n\
-#endif\n\nint main() {\nFILE *pFile = fopen(\"pac_Cconftest.out\",\"w\")\\\;\nfprintf(pFile, \"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n
+#endif\n\nint main() {\nprintf(\"\\%d\\\;\\%d\\\;\", C_LDBL_DIG, C_FLT128_DIG)\\\;\n\nreturn 0\\\;\n}\n
"
)
-C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES)
-file (READ "${RUN_OUTPUT_PATH_DEFAULT}/pac_Cconftest.out" PROG_OUTPUT4)
+C_RUN ("maximum decimal precision for C" ${PROG_SRC} PROG_RES PROG_OUTPUT4)
message (STATUS "Testing maximum decimal precision for C - ${PROG_OUTPUT4}")
# dnl The output from the above program will be: