From 28cdad35a59cf2639d1ed72725837c8eeb8ddad9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Wed, 9 Sep 2020 16:47:53 +0100 Subject: [PATCH] ECC-1143: Fix for Fortran modules within bundles --- fortran/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/fortran/CMakeLists.txt b/fortran/CMakeLists.txt index 6ae04a24b..7362750d7 100644 --- a/fortran/CMakeLists.txt +++ b/fortran/CMakeLists.txt @@ -42,10 +42,15 @@ if( HAVE_FORTRAN ) # SOURCES grib_fortran.c grib_f77.c # LIBS eccodes ) - ecbuild_add_library( TARGET eccodes_f90 - SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h - GENERATED grib_f90.f90 eccodes_f90.f90 - PRIVATE_LIBS eccodes ) + # Note: $ will be present only while building (for the whole bundle), + # whereas $ is only present once you install the package / bundle + ecbuild_add_library( TARGET eccodes_f90 + SOURCES grib_fortran.c grib_f90.f90 eccodes_f90.f90 grib_kinds.h + GENERATED grib_f90.f90 eccodes_f90.f90 + PUBLIC_INCLUDES $ + $ + PRIVATE_LIBS eccodes ) + if( DEFINED ecbuild_VERSION AND NOT ${ecbuild_VERSION} VERSION_LESS 3.1 ) # Installed module directory is not in the PUBLIC INCLUDES! target_include_directories( eccodes_f90 PUBLIC $ )