# Create a temporary directory and copy either a .git, .svn, or .hg directory from another project into this directory.
# 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 including 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 except
# warnings, but set variables
# ECM_SOURCE_VERSION_CONTROL_REVISION and
# ECM_SOURCE_VERSION_CONTROL_BRANCH, respectively, given
# that no error occurred and the version control system is
# Git.
ecm_source_version_control_probe_revison()
ecm_source_version_control_probe_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
message(${ECM_SOURCE_UNDER_VERSION_CONTROL})# invoke ecm_source_version_control_probe_revison() and
message(${ECM_SOURCE_VERSION_CONTROL_REVISION})# ecm_source_version_control_probe_branch() in order to
message(${ECM_SOURCE_VERSION_CONTROL_BRANCH})# collect the necessary data.
message(${ECM_SOURCE_VERSION_CONTROL_COMMIT_COUNT}ecm_source_version_control_status()
```
In another temporary directory, run `cmake` referring to the first temporary directory.