From 54bb7ced8678bca42161b5393d86fafcc8ad3130 Mon Sep 17 00:00:00 2001 From: maier Date: Fri, 11 Jan 2013 09:41:52 +0000 Subject: [PATCH] Some minor bugfixes in configure_netcdf.cmake and FindNETCDF.cmake git-svn-id: https://svn.dealii.org/branches/branch_cmake@28018 0785d39b-7218-0410-832d-ea1e28bc413d --- .../cmake/configure/configure_netcdf.cmake | 4 ++-- deal.II/cmake/modules/FindNETCDF.cmake | 23 ++++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/deal.II/cmake/configure/configure_netcdf.cmake b/deal.II/cmake/configure/configure_netcdf.cmake index 3ae1f84682..e2d7044e30 100644 --- a/deal.II/cmake/configure/configure_netcdf.cmake +++ b/deal.II/cmake/configure/configure_netcdf.cmake @@ -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) diff --git a/deal.II/cmake/modules/FindNETCDF.cmake b/deal.II/cmake/modules/FindNETCDF.cmake index a104b327c5..ba930922a1 100644 --- a/deal.II/cmake/modules/FindNETCDF.cmake +++ b/deal.II/cmake/modules/FindNETCDF.cmake @@ -13,16 +13,19 @@ ##### # -# 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) -- 2.39.5