Add namespace for CMake targets

The usual convention with modern CMake is to namespace the targets.
This gives the netCDF namespace to the package.
This commit is contained in:
Keith F. Prussing 2019-11-19 14:45:21 -05:00
parent adf2f4d098
commit 808803ceeb

View File

@ -2043,6 +2043,7 @@ set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/netCDF)
install(EXPORT netCDFTargets
DESTINATION ${ConfigPackageLocation}
COMPONENT headers
NAMESPACE netCDF::
)
include(CMakePackageConfigHelpers)
@ -2063,6 +2064,7 @@ INSTALL(
COMPONENT headers
)
add_library(netCDF::netcdf ALIAS netcdf)
target_include_directories(netcdf
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>