summaryrefslogtreecommitdiffstats
path: root/Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-04-01 09:19:54 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-04-03 07:16:17 (GMT)
commit8a2f62cc18ece0ebfed0ff6abf53d419d43d2fa1 (patch)
tree465c79b4ce0f366fe40a00e1be9e965f3c04af4d /Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake
parent5ad73b608d4fc7cc6b30017159b800802a503b0c (diff)
downloadCMake-8a2f62cc18ece0ebfed0ff6abf53d419d43d2fa1.zip
CMake-8a2f62cc18ece0ebfed0ff6abf53d419d43d2fa1.tar.gz
CMake-8a2f62cc18ece0ebfed0ff6abf53d419d43d2fa1.tar.bz2
FindPython*: Add capability to control virtual env handling.
Fixes: #19097
Diffstat (limited to 'Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake')
-rw-r--r--Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake b/Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake
new file mode 100644
index 0000000..020ecac
--- /dev/null
+++ b/Tests/FindPython/VirtualEnv/VirtualEnvDefault.cmake
@@ -0,0 +1,6 @@
+
+find_package (Python3 REQUIRED)
+
+if (NOT Python3_EXECUTABLE MATCHES "^${PYTHON3_VIRTUAL_ENV}/.+")
+ message (FATAL_ERROR "Fail to use virtual environment")
+endif()