summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0286945)
raw | patch | inline | side by side (parent: 0286945)
author | Alejandro Hernandez <ajhernandez@ti.com> | |
Fri, 3 Feb 2017 15:11:58 +0000 (10:11 -0500) | ||
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | |
Mon, 6 Feb 2017 10:59:32 +0000 (12:59 +0200) |
Previously only binding with python3 was supported, this patch allows
compilation of pykms with python3 or python2. When compiling with
python2 some of the python scripts located in the py/test will not work
since they import python3 only modules
Signed-off-by: Alejandro Hernandez <ajhernandez@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
compilation of pykms with python3 or python2. When compiling with
python2 some of the python scripts located in the py/test will not work
since they import python3 only modules
Signed-off-by: Alejandro Hernandez <ajhernandez@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
CMakeLists.txt | patch | blob | history | |
README.md | patch | blob | history | |
py/pykms/CMakeLists.txt | patch | blob | history |
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 324b7df28b5485ecee4c747acdf54ad6ba40e0b2..57088bc5f78fd98a6605fb66332874a2f63b29de 100644 (file)
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" FALSE)
set(KMSXX_ENABLE_PYTHON ON CACHE BOOL "Enable Python wrappers")
option(TREAT_WARNINGS_AS_ERRORS "Treat warnings as errors" FALSE)
set(KMSXX_ENABLE_PYTHON ON CACHE BOOL "Enable Python wrappers")
+set(KMSXX_PYTHON_VERSION "python3;python2" CACHE STRING "Python pkgconfig package")
+
set(KMSXX_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
set(KMSXX_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
diff --git a/README.md b/README.md
index 0a0a798c7408335127dad4cc1cf9915cc1aeaa80..f0f3b97dea67e03bbf972c04ff6fdb788bb98627 100644 (file)
--- a/README.md
+++ b/README.md
You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
-Option name | Values | Default | Notes
---------------------- | ------------- | -------- | --------
-CMAKE_BUILD_TYPE | Release/Debug | Release |
-BUILD_SHARED_LIBS | ON/OFF | OFF |
-KMSXX_ENABLE_PYTHON | ON/OFF | ON |
-KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
+Option name | Values | Default | Notes
+--------------------- | ------------- | --------------- | --------
+CMAKE_BUILD_TYPE | Release/Debug | Release |
+BUILD_SHARED_LIBS | ON/OFF | OFF |
+KMSXX_ENABLE_PYTHON | ON/OFF | ON |
+KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
+KMSXX_PYTHON_VERSION | python3/python2 | python3;python2 | Name of the python pkgconfig file
## Env variables
## Env variables
index a671b7a5fafe5625bd1ba4d12fc5e1d96d22306b..505c0c38eaca71c65ed57d4a54d946deade45796 100644 (file)
--- a/py/pykms/CMakeLists.txt
+++ b/py/pykms/CMakeLists.txt
include_directories(${LIBDRM_INCLUDE_DIRS})
link_directories(${LIBDRM_LIBRARY_DIRS})
include_directories(${LIBDRM_INCLUDE_DIRS})
link_directories(${LIBDRM_LIBRARY_DIRS})
-pkg_check_modules(PYTHON python3 REQUIRED)
+pkg_search_module(PYTHON REQUIRED ${KMSXX_PYTHON_VERSION})
include_directories(${PYTHON_INCLUDE_DIRS})
if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
include_directories(${PYTHON_INCLUDE_DIRS})
if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)