@@ -360,11 +360,15 @@ function( ecbuild_add_library_impl )
360360 if ( "${_p_TYPE} " STREQUAL LIBS )
361361 target_link_libraries ( ${_PAR_TARGET} ${_p_INTF} ${deps} )
362362 ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): linking with [${deps} ] ${_p_INTF} " )
363- ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): [${skipped_deps} ] not found - not linking ${_p_INTF} " )
363+ if ( skipped_deps )
364+ ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): [${skipped_deps} ] not found - not linking ${_p_INTF} " )
365+ endif ()
364366 else ()
365367 target_include_directories ( ${_PAR_TARGET} ${_p_INTF} ${deps} )
366368 ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): add [${deps} ] to include_directories ${_p_INTF} " )
367- ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): [${skipped_deps} ] not found - not adding to include_directories ${_p_INTF} " )
369+ if ( skipped_deps )
370+ ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): [${skipped_deps} ] not found - not adding to include_directories ${_p_INTF} " )
371+ endif ()
368372 endif ()
369373 endfunction ()
370374
@@ -581,16 +585,16 @@ function( ecbuild_add_library_impl )
581585
582586 # add definitions to compilation
583587 if ( DEFINED _PAR_PUBLIC_DEFINITIONS )
584- target_compile_definitions (${_PAR_TARGET} PUBLIC ${_PAR_PUBLIC_DEFINITIONS} )
585- ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): adding PUBLIC definitions ${_PAR_PUBLIC_DEFINITIONS} " )
588+ target_compile_definitions (${_PAR_TARGET} ${_PUBLIC_INTF} ${_PAR_PUBLIC_DEFINITIONS} )
589+ ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): adding ${_PUBLIC_INTF} definitions ${_PAR_PUBLIC_DEFINITIONS} " )
586590 endif ()
587591 if ( DEFINED _PAR_PRIVATE_DEFINITIONS )
588592 target_compile_definitions (${_PAR_TARGET} PRIVATE ${_PAR_PRIVATE_DEFINITIONS} )
589593 ecbuild_debug("ecbuild_add_library(${_PAR_TARGET} ): adding PRIVATE definitions ${_PAR_PRIVATE_DEFINITIONS} " )
590594 endif ()
591595 if ( DEFINED _PAR_DEFINITIONS )
592596 if ( _PAR_TYPE MATCHES "INTERFACE" )
593- target_compile_definitions (${_PAR_TARGET} PUBLIC ${_PAR_DEFINITIONS} )
597+ target_compile_definitions (${_PAR_TARGET} INTERFACE ${_PAR_DEFINITIONS} )
594598 else ()
595599 target_compile_definitions (${_PAR_TARGET} PRIVATE ${_PAR_DEFINITIONS} )
596600 endif ()
0 commit comments