aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/Modules/FindPython3Interp.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Modules/FindPython3Interp.cmake')
-rw-r--r--cmake/Modules/FindPython3Interp.cmake37
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/Modules/FindPython3Interp.cmake b/cmake/Modules/FindPython3Interp.cmake
new file mode 100644
index 000000000..a77029160
--- /dev/null
+++ b/cmake/Modules/FindPython3Interp.cmake
@@ -0,0 +1,37 @@
+# - Find python interpreter
+# This module finds if Python interpreter is installed and determines where the
+# executables are. This code sets the following variables:
+#
+# PYTHONINTERP3_FOUND - Was the Python executable found
+# PYTHON3_EXECUTABLE - path to the Python interpreter
+#
+
+#=============================================================================
+# Copyright 2005-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+FIND_PROGRAM(PYTHON3_EXECUTABLE
+ NAMES python3.2mu python3.2m python3.2u python3.2 python3.1 python3.0 python3
+ PATHS
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.2\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.1\\InstallPath]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.0\\InstallPath]
+ )
+
+# handle the QUIETLY and REQUIRED arguments and set PYTHONINTERP_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Python3Interp DEFAULT_MSG PYTHON3_EXECUTABLE)
+
+MARK_AS_ADVANCED(PYTHON3_EXECUTABLE)
+
+