]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Some minor bugfixes in configure_netcdf.cmake and FindNETCDF.cmake
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Jan 2013 09:41:52 +0000 (09:41 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Jan 2013 09:41:52 +0000 (09:41 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_cmake@28018 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/configure/configure_netcdf.cmake
deal.II/cmake/modules/FindNETCDF.cmake

index 3ae1f84682877b072bbbf074e1198d9af54eb23f..e2d7044e30183135132850888f46d2654082fdf1 100644 (file)
@@ -27,8 +27,8 @@ ENDMACRO()
 
 
 MACRO(FEATURE_NETCDF_CONFIGURE_EXTERNAL var)
-  INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIR})
-  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${NETCDF_LIBRARY})
+  INCLUDE_DIRECTORIES(${NETCDF_INCLUDE_DIRS})
+  LIST(APPEND DEAL_II_EXTERNAL_LIBRARIES ${NETCDF_LIBRARIES})
   SET(HAVE_LIBNETCDF TRUE)
 
   SET(${var} TRUE)
index a104b327c57cf4c62268e04d922ee0b07e683272..ba930922a17df62ed6b38433f6bf57c653b0df5a 100644 (file)
 #####
 
 #
-# 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
+# Try to find the NETCDF C and C++ libraries
+#
+# This module exports
+#
+#   NETCDF_LIBRARIES
+#   NETCDF_INCLUDE_DIRS
 #
 
 INCLUDE(FindPackageHandleStandardArgs)
 
 SET_IF_EMPTY(NETCDF_DIR "$ENV{NETCDF_DIR}")
 
-FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
+FIND_PATH(NETCDF_INCLUDE_DIRS netcdf.hh
   HINTS
     ${NETCDF_DIR}
   PATH_SUFFIXES
@@ -30,7 +33,10 @@ FIND_PATH(NETCDF_INCLUDE_DIR netcdf.hh
   )
 
 #
-# TODO: netcdf might externally depend on hdf5. Check and fix this.
+# TODO:
+#
+# - netcdf might externally depend on hdf5. Check and fix this.
+# - separate C++ and C library search
 #
 
 FIND_LIBRARY(NETCDF_CPLUSPLUS_LIBRARY NAMES netcdf_c++ netcdf_cpp
@@ -47,10 +53,15 @@ FIND_LIBRARY(NETCDF_C_LIBRARY NAMES netcdf
     lib${LIB_SUFFIX} lib64 lib
   )
 
+SET(NETCDF_LIBRARIES
+  ${NETCDF_CPLUSPLUS_LIBRARY}
+  ${NETCDF_C_LIBRARY}
+  )
+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETCDF DEFAULT_MSG
   NETCDF_CPLUSPLUS_LIBRARY
   NETCDF_C_LIBRARY
-  NETCDF_INCLUDE_DIR
+  NETCDF_INCLUDE_DIRS
   )
 
 IF(NETCDF_FOUND)

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.