[Cmake-commits] [cmake-commits] hoffman committed FortranCInterface.cmake 1.11 1.12

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Oct 30 16:50:14 EDT 2008


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv10864

Modified Files:
	FortranCInterface.cmake 
Log Message:
ENH: fix uppercase version so defines are not upper as well


Index: FortranCInterface.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FortranCInterface.cmake,v
retrieving revision 1.11
retrieving revision 1.12
diff -C 2 -d -r1.11 -r1.12
*** FortranCInterface.cmake	29 Oct 2008 23:49:18 -0000	1.11
--- FortranCInterface.cmake	30 Oct 2008 20:50:12 -0000	1.12
***************
*** 85,89 ****
        end module test_interface
      ")
!   
    foreach(interface 
        "test_interface$" 
--- 85,89 ----
        end module test_interface
      ")
!   set(worked FALSE)
    foreach(interface 
        "test_interface$" 
***************
*** 107,110 ****
--- 107,116 ----
      endif(worked)
    endforeach(interface)
+   if(NOT worked)
+     message(STATUS "Failed to find C binding to Fortran module functions.")
+     set(${prefix} "BROKEN_C_FORTRAN_MODULE_BINDING" PARENT_SCOPE)
+     set(${suffix} "BROKEN_C_FORTRAN_MODULE_BINDING" PARENT_SCOPE)
+     set(${found} FALSE PARENT_SCOPE)
+   endif(NOT worked)
  endfunction(discover_fortran_module_mangling)
  
***************
*** 190,210 ****
      else(found)
        set(FORTRAN_C_MODULE_MANGLING_FOUND FALSE CACHE INTERNAL
!         "SUFFIX for Fortran to c name mangling")
      endif(found)
    endif(NOT FORTRAN_C_MANGLING_FOUND)
    foreach(f ${${FUNCTIONS}})
      if(FORTRAN_C_MANGLING_UPPERCASE)
!       string(TOUPPER "${f}" f)
      else()
!       string(TOLOWER "${f}" f)
      endif()
      if("${f}" MATCHES ":")
        string(REGEX REPLACE "(.*):(.*)" "\\1" module "${f}")
        string(REGEX REPLACE "(.*):(.*)" "\\2" function "${f}")
        set(HEADER_CONTENT "${HEADER_CONTENT}
! #define ${NAMESPACE}${module}_${function} ${FORTRAN_C_MODULE_PREFIX}${module}${FORTRAN_C_MODULE_SUFFIX}${function}
  ")
      else("${f}" MATCHES ":")
!       set(function "${FORTRAN_C_PREFIX}${f}${FORTRAN_C_SUFFIX}")
        if("${f}" MATCHES "_" AND FORTRAN_C_MANGLING_EXTRA_UNDERSCORE)
          set(function "${function}_")
--- 196,218 ----
      else(found)
        set(FORTRAN_C_MODULE_MANGLING_FOUND FALSE CACHE INTERNAL
!         "Fortran to C Module calling not availible.")
      endif(found)
    endif(NOT FORTRAN_C_MANGLING_FOUND)
    foreach(f ${${FUNCTIONS}})
      if(FORTRAN_C_MANGLING_UPPERCASE)
!       string(TOUPPER "${f}" fcase)
      else()
!       string(TOLOWER "${f}" fcase)
      endif()
      if("${f}" MATCHES ":")
        string(REGEX REPLACE "(.*):(.*)" "\\1" module "${f}")
        string(REGEX REPLACE "(.*):(.*)" "\\2" function "${f}")
+       string(REGEX REPLACE "(.*):(.*)" "\\1" module_case "${fcase}")
+       string(REGEX REPLACE "(.*):(.*)" "\\2" function_case "${fcase}")
        set(HEADER_CONTENT "${HEADER_CONTENT}
! #define ${NAMESPACE}${module}_${function} ${FORTRAN_C_MODULE_PREFIX}${module_case}${FORTRAN_C_MODULE_SUFFIX}${function_case}
  ")
      else("${f}" MATCHES ":")
!       set(function "${FORTRAN_C_PREFIX}${fcase}${FORTRAN_C_SUFFIX}")
        if("${f}" MATCHES "_" AND FORTRAN_C_MANGLING_EXTRA_UNDERSCORE)
          set(function "${function}_")



More information about the Cmake-commits mailing list