Skip to content

Commit

Permalink
CMake: Use namespaced target name for netCDF-C library
Browse files Browse the repository at this point in the history
  • Loading branch information
ZedThree committed May 16, 2020
1 parent e293307 commit 8f2b4f2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand Down
2 changes: 1 addition & 1 deletion cxx4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
6 changes: 3 additions & 3 deletions netCDFCxxConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand Down

0 comments on commit 8f2b4f2

Please sign in to comment.