File: ECMSourceVersionControl.cmake

package info (click to toggle)
extra-cmake-modules 5.103.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,116 kB
  • sloc: python: 1,744; cpp: 646; ansic: 258; xml: 182; sh: 36; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 809 bytes parent folder | download | duplicates (2)
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
# SPDX-FileCopyrightText: 2019 Harald Sitter <sitter@kde.org>
#
# SPDX-License-Identifier: BSD-3-Clause

#[=======================================================================[.rst:
ECMSourceVersionControl
--------------------------

Tries to determine whether the source is under version control (git clone,
svn checkout, etc).

``ECM_SOURCE_UNDER_VERSION_CONTROL`` is set when indication is found that
``CMAKE_SOURCE_DIR`` is under version control.

Since 5.63
#]=======================================================================]

if(EXISTS "${CMAKE_SOURCE_DIR}/.git" OR
   EXISTS "${CMAKE_SOURCE_DIR}/.svn" OR
   EXISTS "${CMAKE_SOURCE_DIR}/.hg" OR
   EXISTS "${CMAKE_SOURCE_DIR}/.bzr")
    set(ECM_SOURCE_UNDER_VERSION_CONTROL TRUE)
else()
    set(ECM_SOURCE_UNDER_VERSION_CONTROL FALSE)
endif()