Darwin.cmake and Fortran Linker

We are seeing an issue using Intel Fortran and Fortran as the Linker Languge. We came across the issue where we wanted to add the headerpad_max_install_names flag to the linker. In the Darwin.cmake file, Fortran is ignored… was this just overlooked?


foreach(lang C CXX OBJC OBJCXX)
  set(CMAKE_${lang}_OSX_COMPATIBILITY_VERSION_FLAG "-compatibility_version ")
  set(CMAKE_${lang}_OSX_CURRENT_VERSION_FLAG "-current_version ")
  set(CMAKE_${lang}_LINK_FLAGS "-Wl,-headerpad_max_install_names")

    set(CMAKE_${lang}_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_${lang}_LINK_FLAGS}")

  set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-dynamiclib -Wl,-headerpad_max_install_names")
  set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "-bundle -Wl,-headerpad_max_install_names")
  set(CMAKE_SHARED_MODULE_LOADER_${lang}_FLAG "-Wl,-bundle_loader,")

Actually all the settings in that loop are potentially language- and/or compile-specific and should not be in Darwin.cmake at all. They should be over in Modules/Platform/Apple-<id>-<lang>.cmake but have not been fully refactored. In the case of Intel Fortran, they should go in Modules/Platform/Apple-Intel-Fortran.cmake or the macro it invokes.