update test for whether to set CMake policy CMP0074 is needed.

This commit is contained in:
Axel Kohlmeyer
2020-05-19 11:53:47 -04:00
parent ffaa77af6b
commit 16db223d03
3 changed files with 10 additions and 3 deletions

View File

@ -6,7 +6,8 @@
# TBB_MALLOC_FOUND - True if tbb found.
#
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# silence warning about ignoring <PackageName>_ROOT and use it.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
########################################################

View File

@ -1,8 +1,10 @@
enable_language(C)
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# silence warning about ignoring <PackageName>_ROOT and use it.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
find_package(HDF5 REQUIRED)
target_link_libraries(h5md PRIVATE ${HDF5_LIBRARIES})
target_include_directories(h5md PUBLIC ${HDF5_INCLUDE_DIRS})

View File

@ -1,8 +1,12 @@
# USER-NETCDF can use NetCDF, Parallel NetCDF (PNetCDF), or both. At least one necessary.
# NetCDF library enables dump style "netcdf", while PNetCDF enables dump style "netcdf/mpiio"
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# silence warning about ignoring <PackageName>_ROOT and use it.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
# may use NetCDF or PNetCDF with MPI, but must have NetCDF without
if(NOT BUILD_MPI)
find_package(NetCDF REQUIRED)
else()