From 9600aa4557d1494658a45168220e1e97197a48ce Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 11 Dec 2014 13:28:29 -0800 Subject: 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 Reviewed-by: Jose Fonseca --- CMakeLists.txt | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'CMakeLists.txt') 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 ) -- cgit v1.2.3