Skip to content

Commit

Permalink
Check argument for CMake REGEX FCMangle.h. (HDFGroup#4029)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoklee authored and lrknox committed Mar 4, 2024
1 parent 6e3c793 commit 746b101
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/cmake/HDFUseFortran.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,24 @@ 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_"
SYMBOL_NAMESPACE "H5_FC_"
)

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
Expand Down

0 comments on commit 746b101

Please sign in to comment.