FindNetCDF.cmake 945 B

12345678910111213141516171819202122232425262728
  1. # - Try to find NetCDF
  2. # Once done this will define
  3. # NETCDF_FOUND - System has NetCDF
  4. # NETCDF_INCLUDE_DIRS - The NetCDF include directories
  5. # NETCDF_LIBRARIES - The libraries needed to use NetCDF
  6. find_path(NETCDF_INCLUDE_DIR netcdf.h)
  7. find_library(NETCDF_C_LIBRARY netcdf)
  8. find_library(NETCDF_CXX_LIBRARY netcdf_c++)
  9. set(NETCDF_LIBRARIES ${NETCDF_C_LIBRARY})
  10. # The C++ API currently doesn't come with the prebuilt binaries
  11. # on Windows, so only include the C++ lib if found.
  12. if(NETCDF_CXX_LIBRARY)
  13. set(NETCDF_LIBRARIES ${NETCDF_CXX_LIBRARY} ${NETCDF_LIBRARIES})
  14. endif()
  15. set(NETCDF_INCLUDE_DIRS ${NETCDF_INCLUDE_DIR} )
  16. include(FindPackageHandleStandardArgs)
  17. # handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE
  18. # if all listed variables are TRUE
  19. find_package_handle_standard_args(NetCDF DEFAULT_MSG
  20. NETCDF_C_LIBRARY NETCDF_INCLUDE_DIR)
  21. mark_as_advanced(NETCDF_INCLUDE_DIR NETCDF_C_LIBRARY NETCDF_CXX_LIBRARY)