summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDylan Baker <dylanx.c.baker@intel.com>2014-12-11 13:28:29 -0800
committerDylan Baker <baker.dylan.c@gmail.com>2015-01-19 10:16:47 -0800
commit9600aa4557d1494658a45168220e1e97197a48ce (patch)
treec5f2621fe82cf4781a82d85d04e9db7a62918112 /CMakeLists.txt
parentee8579b452f0a6e59b1dd879b50715a83554fafc (diff)
cmake: use cmake builtin python module
This removes a bunch of code that we rolled for finding python interpreters, and uses the cmake builtins. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt22
1 files changed, 3 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 301222240..ac4ba1b34 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,28 +187,12 @@ IF(PIGLIT_BUILD_GLX_TESTS)
pkg_check_modules(GLPROTO REQUIRED glproto)
ENDIF()
-# Check for presence of Python 2.7 or greater.
-foreach(python_cmd python2 python)
- execute_process(
- COMMAND ${python_cmd} -c "import sys; assert '2.7' <= sys.version < '3'"
- OUTPUT_QUIET
- ERROR_QUIET
- RESULT_VARIABLE python_version_check_error_code)
- if(python_version_check_error_code EQUAL 0)
- set(python ${python_cmd})
- break()
- endif(python_version_check_error_code EQUAL 0)
-endforeach(python_cmd)
-
-if(NOT DEFINED python)
- message(FATAL_ERROR "python version 2.7 required")
-endif(NOT DEFINED python)
-
+FIND_PACKAGE(PythonInterp 2.7 REQUIRED)
include(PiglitFindMako)
# Require numpy
execute_process(
- COMMAND ${python} -c "import numpy"
+ COMMAND ${PYTHON_EXECUTABLE} -c "import numpy"
OUTPUT_QUIET
ERROR_QUIET
RESULT_VARIABLE import_numpy_error_code)
@@ -507,7 +491,7 @@ set (CPACK_PACKAGE_VERSION_MINOR "0")
# Use current date in YYYYMMDD format as patch number
execute_process (
- COMMAND ${python} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
+ COMMAND ${PYTHON_EXECUTABLE} -c "import time, sys; sys.stdout.write(time.strftime('%Y%m%d'))"
OUTPUT_VARIABLE CPACK_PACKAGE_VERSION_PATCH
)