blob: 1425abb4c664d636d5298ba1621b387ce8fa2027 [file] [log] [blame]
Ronald Cron2581d912024-06-10 16:05:53 +02001#
2# CMake build system design considerations:
3#
4# - Include directories:
5# + Do not define include directories globally using the include_directories
6# command but rather at the target level using the
7# target_include_directories command. That way, it is easier to guarantee
8# that targets are built using the proper list of include directories.
9# + Use the PUBLIC and PRIVATE keywords to specify the scope of include
10# directories. That way, a target linking to a library (using the
11# target_link_libraries command) inherits from the library PUBLIC include
12# directories and not from the PRIVATE ones.
13# - TF_PSA_CRYPTO_TARGET_PREFIX: CMake targets are designed to be alterable by
14# calling CMake in order to avoid target name clashes, via the use of
15# TF_PSA_CRYPTO_TARGET_PREFIX. The value of this variable is prefixed to the
16# tfpsacrypto and apidoc targets.
17#
18
19# We specify a minimum requirement of 3.10.2, but for now use 3.5.1 here
20# until our infrastructure catches up.
21cmake_minimum_required(VERSION 3.5.1)
22
23# https://cmake.org/cmake/help/latest/policy/CMP0011.html
24# Setting this policy is required in CMake >= 3.18.0, otherwise a warning is generated. The OLD
25# policy setting is deprecated, and will be removed in future versions.
26cmake_policy(SET CMP0011 NEW)
27# https://cmake.org/cmake/help/latest/policy/CMP0012.html
28# Setting the CMP0012 policy to NEW is required for FindPython3 to work with CMake 3.18.2
29# (there is a bug in this particular version), otherwise, setting the CMP0012 policy is required
30# for CMake versions >= 3.18.3 otherwise a deprecated warning is generated. The OLD policy setting
31# is deprecated and will be removed in future versions.
32cmake_policy(SET CMP0012 NEW)
33
34if(LIB_INSTALL_DIR)
35 set(CMAKE_INSTALL_LIBDIR "${LIB_INSTALL_DIR}")
36endif()
37
38add_subdirectory(include)