]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Try to also find libnetcdf since we need to link with both kinds of libraries.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Jan 2013 03:41:25 +0000 (03:41 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Jan 2013 03:41:25 +0000 (03:41 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@28015 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/modules/FindNETCDF.cmake

index a9098599b79b52b6badb48a4501455b3de0f4dcb..e2601f117b539c14b5708433afd1070dd229d971 100644 (file)
@@ -1,6 +1,6 @@
 #####
 ##
-## 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.
 ##
@@ -13,7 +13,9 @@
 #####
 
 #
-# 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)
@@ -31,7 +33,14 @@ FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
 # 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
@@ -39,13 +48,15 @@ FIND_LIBRARY(NETCDF_LIBRARY NAMES netcdf_c++ netcdf_cpp
   )
 
 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
   )
@@ -54,4 +65,3 @@ ELSE()
     "An optional hint to a NETCDF installation"
     )
 ENDIF()
-

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.