File: ECMFeatureSummary.cmake

package info (click to toggle)
kf6-extra-cmake-modules 6.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,524 kB
  • sloc: python: 668; cpp: 326; ansic: 291; xml: 182; sh: 62; makefile: 8
file content (40 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download
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
# SPDX-FileCopyrightText: 2023 David Faure <faure@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause

#[=======================================================================[.rst:
ECMFeatureSummary
-----------------

Call feature_summary(), except when being called from a subdirectory.
This ensures that frameworks being used as submodules by third-party applications
do not call feature_summary(), so that it doesn't end up being called multiple
times in the same cmake run.


::

  include(ECMFeatureSummary)
  ecm_feature_summary([... see feature_summary documentation ...])

Example:

.. code-block:: cmake

  find_package(ECM REQUIRED)
  include(ECMFeatureSummary)
  ecm_feature_summary(WHAT ALL   FATAL_ON_MISSING_REQUIRED_PACKAGES)

Since 5.247
#]=======================================================================]

cmake_policy(VERSION 3.16)

include(FeatureSummary)
function(ecm_feature_summary)

    if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
       feature_summary(${ARGV})
    endif()

endfunction()