File: ecbuild_policies.cmake

package info (click to toggle)
ecbuild 3.13.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,068 kB
  • sloc: sh: 1,404; perl: 732; f90: 472; cpp: 466; python: 383; ansic: 304; fortran: 43; makefile: 15
file content (51 lines) | stat: -rw-r--r-- 1,803 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# (C) Copyright 2011- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernmental organisation
# nor does it submit to any jurisdiction.

##############################################################################
#
# ecBuild Policies
# ================
#
# NOTE: This file needs to be included with NO_POLICY_SCOPE or it will have no
#       effect!
#
##############################################################################

if( NOT ${PROJECT_NAME}_ECBUILD_POLICIES_INCLUDED )
set( ${PROJECT_NAME}_ECBUILD_POLICIES_INCLUDED TRUE )

if( ECBUILD_2_COMPAT )
  # Allow mixed use of plain and keyword target_link_libraries
  cmake_policy( SET CMP0023 OLD )
  # Allow use of the LOCATION target property.
  cmake_policy( SET CMP0026 OLD )
  # Do not manage VERSION variables in project command
  cmake_policy( SET CMP0048 OLD )
  # RPATH settings on macOS do not affect "install_name"
  # FTM, keep old behavior -- need to test if new behavior impacts binaries in build directory
  cmake_policy( SET CMP0068 OLD )
else()
  # we set these to avoid warnings
  cmake_policy( SET CMP0048 NEW ) # introduced in cmake 3.0
  cmake_policy( SET CMP0068 NEW ) # introduced in cmake 3.9
endif()

# for macosx use @rpath in a target’s install name (CMP0042)
set( CMAKE_MACOSX_RPATH ON )

# find packages use <package>_ROOT by default, new in version 3.12
if( POLICY CMP0074 )
    cmake_policy( SET CMP0074 NEW )
endif()

# Detect invalid indices in the ``list()`` command, new in version 3.21
if( POLICY CMP0121 )
    cmake_policy( SET CMP0121 NEW )
endif()

endif()