#####
##
-## Copyright (C) 2012 by the deal.II authors
+## Copyright (C) 2012, 2013 by the deal.II authors
##
## This file is part of the deal.II library.
##
#####
#
-# Try to find the NETCDF library
+# Try to find the NETCDF library. In order to work with NETCDF, we
+# need to link with both the C++ and C libraries, typically provided
+# as libnetcdf_c++.so and libnetcdf.so
#
INCLUDE(FindPackageHandleStandardArgs)
# TODO: netcdf might externally depend on hdf5. Check and fix this.
#
-FIND_LIBRARY(NETCDF_LIBRARY NAMES netcdf_c++ netcdf_cpp
+FIND_LIBRARY(NETCDF_CPLUSCPLUS_LIBRARY NAMES netcdf_c++ netcdf_cpp
+ HINTS
+ ${NETCDF_DIR}
+ PATH_SUFFIXES
+ lib${LIB_SUFFIX} lib64 lib
+ )
+
+FIND_LIBRARY(NETCDF_C_LIBRARY NAMES netcdf
HINTS
${NETCDF_DIR}
PATH_SUFFIXES
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETCDF DEFAULT_MSG
- NETCDF_LIBRARY
+ NETCDF_CPLUSCPLUS_LIBRARY
+ NETCDF_C_LIBRARY
NETCDF_INCLUDE_DIR
)
IF(NETCDF_FOUND)
MARK_AS_ADVANCED(
- NETCDF_LIBRARY
+ NETCDF_CPLUSCPLUS_LIBRARY
+ NETCDF_C_LIBRARY
NETCDF_INCLUDE_DIR
NETCDF_DIR
)
"An optional hint to a NETCDF installation"
)
ENDIF()
-