|
From: <ai...@us...> - 2010-07-21 16:38:43
|
Revision: 11091
http://plplot.svn.sourceforge.net/plplot/?rev=11091&view=rev
Author: airwin
Date: 2010-07-21 16:38:37 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
Obtain PYTHON_VERSION in a way that works for both python2 and
python3 and which ignores trailing information after the triplet version
number.
Do not allow the user to fiddle with PYTHON_VERSION result variable.
Modified Paths:
--------------
trunk/cmake/modules/python.cmake
Modified: trunk/cmake/modules/python.cmake
===================================================================
--- trunk/cmake/modules/python.cmake 2010-07-16 18:28:37 UTC (rev 11090)
+++ trunk/cmake/modules/python.cmake 2010-07-21 16:38:37 UTC (rev 11091)
@@ -159,17 +159,17 @@
# Get the Python version.
execute_process(
COMMAND
- ${PYTHON_EXECUTABLE} -c "import sys; print sys.version.split()[0]"
- OUTPUT_VARIABLE PYTHON_version_output
+ ${PYTHON_EXECUTABLE} -c "import sys; print('%s.%s.%s' % sys.version_info[0:3])"
+ OUTPUT_VARIABLE PYTHON_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- SET(PYTHON_VERSION ${PYTHON_version_output} CACHE STRING "Python version")
+ message(STATUS "DEBUG: PYTHON_VERSION = ${PYTHON_VERSION}")
# Enable plsmem if the Python and Swig versions support it
transform_version(NUMERICAL_SWIG_MINIMUM_VERSION_FOR_PLSMEM "1.3.38")
transform_version(NUMERICAL_PYTHON_MINIMUM_VERSION_FOR_PLSMEM "2.6.0")
transform_version(NUMERICAL_SWIG_VERSION "${SWIG_VERSION}")
- transform_version(NUMERICAL_PYTHON_VERSION "${PYTHON_version_output}")
+ transform_version(NUMERICAL_PYTHON_VERSION "${PYTHON_VERSION}")
SET(PYTHON_HAVE_PYBUFFER OFF)
IF(NUMERICAL_SWIG_MINIMUM_VERSION_FOR_PLSMEM LESS NUMERICAL_SWIG_VERSION)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|