consolidate setting CMake policy CMP0074 into main cmake file

This commit is contained in:
Axel Kohlmeyer
2020-05-19 15:20:41 -04:00
parent 16db223d03
commit 48a9e0d732
4 changed files with 5 additions and 14 deletions

View File

@ -3,6 +3,11 @@
# This file is part of LAMMPS
# Created by Christoph Junghans and Richard Berger
cmake_minimum_required(VERSION 3.10)
# set policy to silence warnings about ignoring <PackageName>_ROOT but use it
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
########################################
project(lammps CXX)
set(SOVERSION 0)

View File

@ -6,10 +6,6 @@
# TBB_MALLOC_FOUND - True if tbb found.
#
# silence warning about ignoring <PackageName>_ROOT and use it.
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
########################################################
# TBB Malloc

View File

@ -1,10 +1,5 @@
enable_language(C)
# 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,11 +1,6 @@
# 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"
# 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)