Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MostafaMollaali
dynamic
Commits
7de77c20
Commit
7de77c20
authored
12 years ago
by
Lars Bilke
Browse files
Options
Downloads
Patches
Plain Diff
Added FindNetCDF.cmake from
https://github.com/jedbrown/cmake-modules
parent
16dddc14
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FindNetCDF.cmake
+71
-0
71 additions, 0 deletions
FindNetCDF.cmake
with
71 additions
and
0 deletions
FindNetCDF.cmake
0 → 100644
+
71
−
0
View file @
7de77c20
# - Find NetCDF
# Find the native NetCDF includes and library
#
# NETCDF_INCLUDES - where to find netcdf.h, etc
# NETCDF_LIBRARIES - Link these libraries when using NetCDF
# NETCDF_FOUND - True if NetCDF found including required interfaces (see below)
#
# Your package can require certain interfaces to be FOUND by setting these
#
# NETCDF_CXX - require the C++ interface and link the C++ library
# NETCDF_F77 - require the F77 interface and link the fortran library
# NETCDF_F90 - require the F90 interface and link the fortran library
#
# The following are not for general use and are included in
# NETCDF_LIBRARIES if the corresponding option above is set.
#
# NETCDF_LIBRARIES_C - Just the C interface
# NETCDF_LIBRARIES_CXX - C++ interface, if available
# NETCDF_LIBRARIES_F77 - Fortran 77 interface, if available
# NETCDF_LIBRARIES_F90 - Fortran 90 interface, if available
#
# Normal usage would be:
# set (NETCDF_F90 "YES")
# find_package (NetCDF REQUIRED)
# target_link_libraries (uses_f90_interface ${NETCDF_LIBRARIES})
# target_link_libraries (only_uses_c_interface ${NETCDF_LIBRARIES_C})
if
(
NETCDF_INCLUDES AND NETCDF_LIBRARIES
)
# Already in cache, be silent
set
(
NETCDF_FIND_QUIETLY TRUE
)
endif
(
NETCDF_INCLUDES AND NETCDF_LIBRARIES
)
find_path
(
NETCDF_INCLUDES netcdf.h
HINTS NETCDF_DIR ENV NETCDF_DIR
)
find_library
(
NETCDF_LIBRARIES_C NAMES netcdf
)
mark_as_advanced
(
NETCDF_LIBRARIES_C
)
set
(
NetCDF_has_interfaces
"YES"
)
# will be set to NO if we're missing any interfaces
set
(
NetCDF_libs
"
${
NETCDF_LIBRARIES_C
}
"
)
get_filename_component
(
NetCDF_lib_dirs
"
${
NETCDF_LIBRARIES_C
}
"
PATH
)
macro
(
NetCDF_check_interface lang header libs
)
if
(
NETCDF_
${
lang
}
)
find_path
(
NETCDF_INCLUDES_
${
lang
}
NAMES
${
header
}
HINTS
"
${
NETCDF_INCLUDES
}
"
NO_DEFAULT_PATH
)
find_library
(
NETCDF_LIBRARIES_
${
lang
}
NAMES
${
libs
}
HINTS
"
${
NetCDF_lib_dirs
}
"
NO_DEFAULT_PATH
)
mark_as_advanced
(
NETCDF_INCLUDES_
${
lang
}
NETCDF_LIBRARIES_
${
lang
}
)
if
(
NETCDF_INCLUDES_
${
lang
}
AND NETCDF_LIBRARIES_
${
lang
}
)
list
(
INSERT NetCDF_libs 0
${
NETCDF_LIBRARIES_
${
lang
}}
)
# prepend so that -lnetcdf is last
else
(
NETCDF_INCLUDES_
${
lang
}
AND NETCDF_LIBRARIES_
${
lang
}
)
set
(
NetCDF_has_interfaces
"NO"
)
message
(
STATUS
"Failed to find NetCDF interface for
${
lang
}
"
)
endif
(
NETCDF_INCLUDES_
${
lang
}
AND NETCDF_LIBRARIES_
${
lang
}
)
endif
(
NETCDF_
${
lang
}
)
endmacro
(
NetCDF_check_interface
)
NetCDF_check_interface
(
CXX netcdfcpp.h netcdf_c++
)
NetCDF_check_interface
(
F77 netcdf.inc netcdff
)
NetCDF_check_interface
(
F90 netcdf.mod netcdff
)
set
(
NETCDF_LIBRARIES
"
${
NetCDF_libs
}
"
CACHE STRING
"All NetCDF libraries required for interface level"
)
# handle the QUIETLY and REQUIRED arguments and set NETCDF_FOUND to TRUE if
# all listed variables are TRUE
include
(
FindPackageHandleStandardArgs
)
find_package_handle_standard_args
(
NetCDF DEFAULT_MSG NETCDF_LIBRARIES NETCDF_INCLUDES NetCDF_has_interfaces
)
mark_as_advanced
(
NETCDF_LIBRARIES NETCDF_INCLUDES
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment