# Create a temporary directory and copy a `.git` directory from another project into this directory in order to have some data to work with.
# Copy/link the patched `ECMSourceVersionControl.cmake` into this temporary directory.
# Create a `CMakeLists.txt` file which may look like this:
```
cmake_minimum_required(VERSION 3.7.2)
project(ECMSourceVersionControlTest)
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR})
# Just by incluloading this module, variable
# ECM_SOURCE_UNDER_VERSION_CONTROL may be set to either
# TRUE or FALSE, depending on if the source directory is
# under a known version control (Git, Subversion,
# Mercurial, Bazaar). Depending on the recognized version
# control, variable ECM_SOURCE_VERSION_CONTROL_WHICH may
# be set to either "git", "svn", "hg", or "bzr".
include(ECMSourceVersionControl)
# The following two functions do not print anything exceptmessage("ECM_SOURCE_UNDER_VERSION_CONTROL=" ${ECM_SOURCE_UNDER_VERSION_CONTROL})
# warnings, but set variablesmessage("ECM_SOURCE_VERSION_CONTROL_WHICH=" ${ECM_SOURCE_VERSION_CONTROL_WHICH})
# In order to retrieve the revision and branch
# ECM_SOURCE_VERSION_CONTROL_REVISION and# of the checkout in the source directory, the
# ECM_SOURCE_VERSION_CONTROL_BRANCH, respectively, given# following two functions may be helpful:
# that no error occurred and the version control system isecm_source_version_control_probe_revision(ECM_SOURCE_VERSION_CONTROL_REVISION)
# Git.ecm_source_version_control_probe_branch(ECM_SOURCE_VERSION_CONTROL_BRANCH)
ecm_source_version_control_probe_revison(message("ECM_SOURCE_VERSION_CONTROL_REVISION=" ${ECM_SOURCE_VERSION_CONTROL_REVISION})
ecm_source_version_control_probe_branch(message("ECM_SOURCE_VERSION_CONTROL_BRANCH=" ${ECM_SOURCE_VERSION_CONTROL_BRANCH})
# The following function will print out a status
# message on the recognized Git revision and branch (so,
# it works only on Git repos). It will in its turn
# invoke ecm_source_version_control_probe_revision() and
# ecm_source_version_control_probe_branch() in order to
# collect the necessary data.
ecm_source_version_control_status()
```
In another temporary directory, run `cmake` referring to the first temporary directory.