summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2013-01-05 20:46:22 +0100
committerSebastien Helleu <flashcode@flashtux.org>2013-01-05 20:46:22 +0100
commit323801f869727000196b27eb09f593929db4fe38 (patch)
treec50879f87dea02351378a50e6365b19eb41deda3 /cmake
parent680486b1d3423b31f5ed60d4867f2649452e5d48 (diff)
downloadweechat-323801f869727000196b27eb09f593929db4fe38.zip
core: add cmake option ENABLE_PYTHON3 and configure option --enable-python3
With this option, the python plugin will be built and linked with Python 3 (if found, or Python 2 as fallback). This option it not (yet) recommended, because many scripts are working only with Python 2.x. It should be used only to tests scripts with Python 3.x in WeeChat.
Diffstat (limited to 'cmake')
-rw-r--r--cmake/FindPython.cmake31
1 files changed, 22 insertions, 9 deletions
diff --git a/cmake/FindPython.cmake b/cmake/FindPython.cmake
index d917600d9..801655a92 100644
--- a/cmake/FindPython.cmake
+++ b/cmake/FindPython.cmake
@@ -33,10 +33,17 @@ IF(PYTHON_FOUND)
SET(PYTHON_FIND_QUIETLY TRUE)
ENDIF(PYTHON_FOUND)
-FIND_PROGRAM(PYTHON_EXECUTABLE
- NAMES python2.7 python2.6 python2.5 python
- PATHS /usr/bin /usr/local/bin /usr/pkg/bin
- )
+IF(ENABLE_PYTHON3)
+ FIND_PROGRAM(PYTHON_EXECUTABLE
+ NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
+ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
+ )
+ELSE(ENABLE_PYTHON3)
+ FIND_PROGRAM(PYTHON_EXECUTABLE
+ NAMES python2.7 python2.6 python2.5 python
+ PATHS /usr/bin /usr/local/bin /usr/pkg/bin
+ )
+ENDIF(ENABLE_PYTHON3)
IF(PYTHON_EXECUTABLE)
EXECUTE_PROCESS(
@@ -58,11 +65,17 @@ IF(PYTHON_EXECUTABLE)
NAMES Python.h
PATHS ${PYTHON_INC_DIR}
)
-
- FIND_LIBRARY(PYTHON_LIBRARY
- NAMES python2.7 python2.6 python2.5 python
- PATHS ${PYTHON_POSSIBLE_LIB_PATH}
- )
+ IF(ENABLE_PYTHON3)
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES python3.4 python3.3 python3.2 python3.1 python3.0 python3 python2.7 python2.6 python2.5 python
+ PATHS ${PYTHON_POSSIBLE_LIB_PATH}
+ )
+ ELSE(ENABLE_PYTHON3)
+ FIND_LIBRARY(PYTHON_LIBRARY
+ NAMES python2.7 python2.6 python2.5 python
+ PATHS ${PYTHON_POSSIBLE_LIB_PATH}
+ )
+ ENDIF(ENABLE_PYTHON3)
IF(PYTHON_LIBRARY AND PYTHON_INCLUDE_PATH)
EXECUTE_PROCESS(