summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--README.md13
-rw-r--r--py/pykms/CMakeLists.txt2
3 files changed, 10 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 324b7df..57088bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,8 @@ option(BUILD_SHARED_LIBS "Build shared libs" FALSE)
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")
diff --git a/README.md b/README.md
index 0a0a798..f0f3b97 100644
--- a/README.md
+++ b/README.md
@@ -72,12 +72,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
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
diff --git a/py/pykms/CMakeLists.txt b/py/pykms/CMakeLists.txt
index a671b7a..505c0c3 100644
--- a/py/pykms/CMakeLists.txt
+++ b/py/pykms/CMakeLists.txt
@@ -1,7 +1,7 @@
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)