From 7d41ce23a757b56d6b4c96d741f9a4b175606a70 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Thu, 7 Aug 2014 00:21:42 -0400 Subject: [PATCH] Build Python 3 bindings in subdirectory Build the Python 3 cv2 module in lib/python3/, to avoid potential naming conflicts with the Python 2 bindings. The Python 2 bindings are placed directly in lib/, where they are required for the Buildbot to successfully execute the Python tests. --- modules/python/common.cmake | 2 +- modules/python/python2/CMakeLists.txt | 3 +++ modules/python/python3/CMakeLists.txt | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/python/common.cmake b/modules/python/common.cmake index 581822e..30f6d28 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -72,7 +72,7 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; pri OUTPUT_STRIP_TRAILING_WHITESPACE) set_target_properties(${the_module} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}/${MODULE_NAME}" + LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}/${MODULE_INSTALL_SUBDIR}" PREFIX "" OUTPUT_NAME cv2 SUFFIX ${CVPY_SUFFIX}) diff --git a/modules/python/python2/CMakeLists.txt b/modules/python/python2/CMakeLists.txt index 01a3b47..158763e 100644 --- a/modules/python/python2/CMakeLists.txt +++ b/modules/python/python2/CMakeLists.txt @@ -4,6 +4,8 @@ endif() set(the_description "The python2 bindings") set(MODULE_NAME python2) +# Buildbot requires Python 2 to be in root lib dir +set(MODULE_INSTALL_SUBDIR "") set(PYTHON_INCLUDE_PATH ${PYTHON2_INCLUDE_PATH}) set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON2_NUMPY_INCLUDE_DIRS}) @@ -17,6 +19,7 @@ set(PYTHON_VERSION_MINOR ${PYTHON2_VERSION_MINOR}) include(../common.cmake) unset(MODULE_NAME) +unset(MODULE_INSTALL_SUBDIR) unset(PYTHON_INCLUDE_PATH) unset(PYTHON_NUMPY_INCLUDE_DIRS) unset(PYTHON_EXECUTABLE) diff --git a/modules/python/python3/CMakeLists.txt b/modules/python/python3/CMakeLists.txt index 14672d3..4b6fe4f 100644 --- a/modules/python/python3/CMakeLists.txt +++ b/modules/python/python3/CMakeLists.txt @@ -4,6 +4,7 @@ endif() set(the_description "The python3 bindings") set(MODULE_NAME python3) +set(MODULE_INSTALL_SUBDIR python3) set(PYTHON_INCLUDE_PATH ${PYTHON3_INCLUDE_PATH}) set(PYTHON_NUMPY_INCLUDE_DIRS ${PYTHON3_NUMPY_INCLUDE_DIRS}) @@ -17,6 +18,7 @@ set(PYTHON_VERSION_MINOR ${PYTHON3_VERSION_MINOR}) include(../common.cmake) unset(MODULE_NAME) +unset(MODULE_INSTALL_SUBDIR) unset(PYTHON_INCLUDE_PATH) unset(PYTHON_NUMPY_INCLUDE_DIRS) unset(PYTHON_EXECUTABLE) -- 2.7.4