Check argument for CMake REGEX FCMangle.h. (#4029)

This commit is contained in:
H. Joe Lee 2024-02-21 13:54:24 -06:00 committed by GitHub
parent 0f56048a04
commit d4b43e0b43
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -31,6 +31,12 @@ endif ()
# Detect name mangling convention used between Fortran and C
#-----------------------------------------------------------------------------
include (FortranCInterface)
#-----------------------------------------------------------------------------
# Verify that the Fortran and C/C++ compilers work together
#-----------------------------------------------------------------------------
FortranCInterface_VERIFY()
FortranCInterface_HEADER (
${CMAKE_BINARY_DIR}/FCMangle.h
MACRO_NAMESPACE "H5_FC_"
@ -38,11 +44,11 @@ FortranCInterface_HEADER (
)
file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL\\(.*,.*\\) +(.*)")
string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
string (REGEX MATCH "H5_FC_GLOBAL\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
set (H5_FC_FUNC "H5_FC_FUNC(name,NAME) ${CMAKE_MATCH_1}")
file (STRINGS ${CMAKE_BINARY_DIR}/FCMangle.h CONTENTS REGEX "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)")
string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
string (REGEX MATCH "H5_FC_GLOBAL_\\(.*,.*\\) +(.*)" RESULT ${CONTENTS})
set (H5_FC_FUNC_ "H5_FC_FUNC_(name,NAME) ${CMAKE_MATCH_1}")
#test code source