mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-27 07:30:33 +08:00
actually adding the dependencies file...
This commit is contained in:
parent
efc20c64d2
commit
ca850af099
@ -10,10 +10,16 @@ cmake_minimum_required(VERSION 3.12.0)
|
||||
|
||||
#Project Name
|
||||
project(netCDF
|
||||
LANGUAGES C CXX
|
||||
HOMEPAGE_URL "https://www.unidata.ucar.edu/software/netcdf/"
|
||||
DESCRIPTION "NetCDF is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data."
|
||||
LANGUAGES C CXX
|
||||
HOMEPAGE_URL "https://www.unidata.ucar.edu/software/netcdf/"
|
||||
DESCRIPTION "NetCDF is a set of software libraries and machine-independent data formats that support the creation, access, and sharing of array-oriented scientific data."
|
||||
)
|
||||
|
||||
#Add custom CMake Module
|
||||
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/;${PROJECT_SOURCE_DIR}/cmake"
|
||||
CACHE INTERNAL "Location of our custom CMake modules.")
|
||||
|
||||
set(PACKAGE "netCDF" CACHE STRING "")
|
||||
|
||||
# Backport of built-in `PROJECT_IS_TOP_LEVEL` from CMake 3.21
|
||||
@ -114,10 +120,6 @@ IF(MSVC)
|
||||
ADD_COMPILE_OPTIONS("/utf-8")
|
||||
ENDIF()
|
||||
|
||||
#Add custom CMake Module
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/"
|
||||
CACHE INTERNAL "Location of our custom CMake modules.")
|
||||
|
||||
# auto-configure style checks, other CMake modules.
|
||||
INCLUDE(CheckLibraryExists)
|
||||
INCLUDE(CheckIncludeFile)
|
||||
@ -201,7 +203,6 @@ SET(EXTRA_DEPS "")
|
||||
# End Project Properties
|
||||
################################
|
||||
|
||||
|
||||
################################
|
||||
# Set CTest Properties
|
||||
################################
|
||||
@ -603,28 +604,6 @@ ENDIF()
|
||||
SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
|
||||
SET(REMOTETESTSERVERS "remotetest.unidata.ucar.edu" CACHE STRING "test servers to use for remote test")
|
||||
|
||||
|
||||
macro(set_std_filter filter)
|
||||
# Upper case the filter name
|
||||
string(TOUPPER "${filter}" upfilter)
|
||||
string(TOLOWER "${filter}" downfilter)
|
||||
if(ENABLE_FILTER_${upfilter})
|
||||
# Define a test flag for filter
|
||||
IF(${filter}_FOUND)
|
||||
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
|
||||
SET(ENABLE_${upfilter} TRUE)
|
||||
SET(HAVE_${upfilter} ON)
|
||||
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
|
||||
MESSAGE(">>> Standard Filter: ${downfilter}")
|
||||
ELSE()
|
||||
SET(ENABLE_${upfilter} FALSE)
|
||||
SET(HAVE_${upfilter} OFF)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(HAVE_${upfilter} OFF)
|
||||
ENDIF()
|
||||
endmacro(set_std_filter)
|
||||
|
||||
# Locate some compressors
|
||||
OPTION(ENABLE_FILTER_SZIP "Enable use of Szip compression library if it is available. Required if ENABLE_NCZARR is true." ON)
|
||||
OPTION(ENABLE_FILTER_BZ2 "Enable use of Bz2 compression library if it is available." ON)
|
||||
@ -1188,6 +1167,17 @@ MARK_AS_ADVANCED(ENABLE_DAP_REMOTE_TESTS ENABLE_DAP_LONG_TESTS USE_REMOTE_CDASH
|
||||
MARK_AS_ADVANCED(ENABLE_DOXYGEN_BUILD_RELEASE_DOCS DOXYGEN_ENABLE_TASKS ENABLE_DOXYGEN_SERVER_SIDE_SEARCH)
|
||||
MARK_AS_ADVANCED(ENABLE_SHARED_LIBRARY_VERSION)
|
||||
|
||||
##################################
|
||||
# Dependencies
|
||||
##################################
|
||||
|
||||
include(cmake/dependencies.cmake)
|
||||
message(STATUS "HDF5VERSION: ${HDF5_VERSION}")
|
||||
|
||||
################################
|
||||
# End Dependencies
|
||||
################################
|
||||
|
||||
################################
|
||||
# Option checks
|
||||
################################
|
||||
|
@ -1,3 +1,5 @@
|
||||
include(netcdf_functions_macros)
|
||||
|
||||
################################
|
||||
# PkgConfig
|
||||
################################
|
||||
@ -123,7 +125,7 @@ IF(USE_HDF5)
|
||||
REGEX "#define[ \t]+H5_VERSION")
|
||||
string(REGEX REPLACE ".*H5_VERSION .*\"\(.*\)\".*" "\\1" _hdf5_version "${_hdf5_version_lines}")
|
||||
set(HDF5_VERSION "${_hdf5_version}" CACHE STRING "")
|
||||
set(HDF5_VERSION ${HDF5_VERSION} )
|
||||
set(HDF5_VERSION ${HDF5_VERSION} PARENT_SCOPE)
|
||||
unset(_hdf5_version)
|
||||
unset(_hdf5_version_lines)
|
||||
endif ()
|
||||
@ -132,6 +134,7 @@ IF(USE_HDF5)
|
||||
# If HDF5_VERSION is still empty, we have a problem.
|
||||
# Error out.
|
||||
###
|
||||
message(STATUS "Thing: ${HDF5_VERSION}")
|
||||
IF("${HDF5_VERSION}" STREQUAL "")
|
||||
MESSAGE(FATAL_ERR "Unable to determine HDF5 version. NetCDF requires at least version ${HDF5_VERSION_REQUIRED}. Please ensure that libhdf5 is installed and accessible.")
|
||||
ENDIF()
|
||||
@ -641,7 +644,7 @@ IF(ENABLE_PNETCDF)
|
||||
IF(NOT PNETCDF)
|
||||
MESSAGE(STATUS "Cannot find PnetCDF library. Disabling PnetCDF support.")
|
||||
SET(USE_PNETCDF OFF CACHE BOOL "")
|
||||
ENDIF
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
################################
|
||||
|
20
cmake/netcdf_functions_macros.cmake
Normal file
20
cmake/netcdf_functions_macros.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
macro(set_std_filter filter)
|
||||
# Upper case the filter name
|
||||
string(TOUPPER "${filter}" upfilter)
|
||||
string(TOLOWER "${filter}" downfilter)
|
||||
if(ENABLE_FILTER_${upfilter})
|
||||
# Define a test flag for filter
|
||||
IF(${filter}_FOUND)
|
||||
INCLUDE_DIRECTORIES(${${filter}_INCLUDE_DIRS})
|
||||
SET(ENABLE_${upfilter} TRUE)
|
||||
SET(HAVE_${upfilter} ON)
|
||||
SET(STD_FILTERS "${STD_FILTERS} ${downfilter}")
|
||||
MESSAGE(">>> Standard Filter: ${downfilter}")
|
||||
ELSE()
|
||||
SET(ENABLE_${upfilter} FALSE)
|
||||
SET(HAVE_${upfilter} OFF)
|
||||
ENDIF()
|
||||
ELSE()
|
||||
SET(HAVE_${upfilter} OFF)
|
||||
ENDIF()
|
||||
endmacro(set_std_filter)
|
Loading…
Reference in New Issue
Block a user