mirror of
https://github.com/Unidata/netcdf-cxx4.git
synced 2024-11-21 03:13:46 +08:00
CMake: Use namespaced target name for netCDF-C library
This commit is contained in:
parent
e293307a2c
commit
8f2b4f2b34
@ -376,9 +376,9 @@ ELSE()
|
||||
ENDIF()
|
||||
|
||||
|
||||
if (NOT TARGET netcdf)
|
||||
add_library(netcdf UNKNOWN IMPORTED)
|
||||
set_target_properties(netcdf PROPERTIES
|
||||
if (NOT TARGET netCDF::netcdf)
|
||||
add_library(netCDF::netcdf UNKNOWN IMPORTED)
|
||||
set_target_properties(netCDF::netcdf PROPERTIES
|
||||
IMPORTED_LOCATION "${NETCDF_C_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${NETCDF_C_INCLUDE_DIR}"
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ TARGET_INCLUDE_DIRECTORIES(netcdf-cxx4 PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
)
|
||||
TARGET_LINK_LIBRARIES(netcdf-cxx4 PUBLIC netcdf)
|
||||
TARGET_LINK_LIBRARIES(netcdf-cxx4 PUBLIC netCDF::netcdf)
|
||||
TARGET_LINK_LIBRARIES(netcdf-cxx4 PUBLIC ${ALL_TLL_LIBS})
|
||||
target_include_directories(netcdf-cxx4 SYSTEM PUBLIC "${HDF5_C_INCLUDE_DIRS}")
|
||||
|
||||
|
@ -18,9 +18,9 @@ else()
|
||||
set(NETCDF_C_INCLUDE_DIR "@NETCDF_C_INCLUDE_DIR@")
|
||||
endif()
|
||||
|
||||
if (NOT TARGET netcdf)
|
||||
add_library(netcdf UNKNOWN IMPORTED)
|
||||
set_target_properties(netcdf PROPERTIES
|
||||
if (NOT TARGET netCDF::netcdf)
|
||||
add_library(netCDF::netcdf UNKNOWN IMPORTED)
|
||||
set_target_properties(netCDF::netcdf PROPERTIES
|
||||
IMPORTED_LOCATION "${NETCDF_C_LIBRARY}"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${NETCDF_C_INCLUDE_DIR}"
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user