diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 9fe422db9..1b9195a5c 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -43,10 +43,13 @@ if( EC_HAVE_FORTRAN ) add_custom_command( OUTPUT ${_eccodes_mod} - #WORKING_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} + WORKING_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY} #COMMAND ${CMAKE_COMMAND} -E create_symlink "${CMAKE_Fortran_MODULE_DIRECTORY}/grib_api.mod" ${_eccodes_mod} - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_Fortran_MODULE_DIRECTORY}/grib_api.mod" ${_eccodes_mod} + #COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_Fortran_MODULE_DIRECTORY}/grib_api.mod" ${_eccodes_mod} + + COMMAND "/usr/bin/sh" "-c" "if test -f GRIB_API.mod; then ln -s GRIB_API.mod ECCODES.mod; fi" + COMMAND "/usr/bin/sh" "-c" "if test -f grib_api.mod; then ln -s grib_api.mod eccodes.mod; fi" DEPENDS grib_api_f90 VERBATIM diff --git a/fortran/extrules.am b/fortran/extrules.am index bfeb597fa..c0bc3d29f 100644 --- a/fortran/extrules.am +++ b/fortran/extrules.am @@ -1 +1 @@ -proto:;-p4 edit grib_fortran_prototypes.h;mkptypes -A $(libgrib_api_fortran_prototypes) > grib_fortran_prototypes.h +proto:;-mkptypes -A $(libgrib_api_fortran_prototypes) > temp && mv temp grib_fortran_prototypes.h; rm -f temp