diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 0d4bab29f12ea265f7271ffc15eddb5098c87419..f1124fc1276105b2412ef1774bc1461ed29c7290 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -435,8 +435,8 @@ endif()
 
 if(PKG_USER-NETCDF)
   find_package(NetCDF REQUIRED)
-  include_directories(NETCDF_INCLUDE_DIR)
-  list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARY})
+  include_directories(${NETCDF_INCLUDE_DIRS})
+  list(APPEND LAMMPS_LINK_LIBS ${NETCDF_LIBRARIES})
   add_definitions(-DLMP_HAS_NETCDF -DNC_64BIT_DATA=0x0020)
 endif()