py: Reorganize source directory
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 2 Jan 2017 14:42:08 +0000 (16:42 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 3 Jan 2017 08:46:42 +0000 (10:46 +0200)
Separate the Python bindings sources from the test scripts. While at it,
remove the unneeded run.sh script.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
19 files changed:
py/CMakeLists.txt
py/pykms/CMakeLists.txt [new file with mode: 0644]
py/pykms/pykms.cpp [moved from py/pykms.cpp with 100% similarity]
py/pykms/pykmsbase.cpp [moved from py/pykmsbase.cpp with 100% similarity]
py/pykms/pykmsomap.cpp [moved from py/pykmsomap.cpp with 100% similarity]
py/pykms/pykmsutil.cpp [moved from py/pykmsutil.cpp with 100% similarity]
py/pykms/pyvid.cpp [moved from py/pyvid.cpp with 100% similarity]
py/run.sh [deleted file]
py/tests/CMakeLists.txt [new file with mode: 0644]
py/tests/alpha-test.py [moved from py/alpha-test.py with 100% similarity]
py/tests/cam.py [moved from py/cam.py with 100% similarity]
py/tests/db.py [moved from py/db.py with 100% similarity]
py/tests/functest.py [moved from py/functest.py with 100% similarity]
py/tests/gamma.py [moved from py/gamma.py with 100% similarity]
py/tests/helpers.py [moved from py/helpers.py with 100% similarity]
py/tests/iact.py [moved from py/iact.py with 100% similarity]
py/tests/kmsmodeview.py [moved from py/kmsmodeview.py with 100% similarity]
py/tests/test.py [moved from py/test.py with 100% similarity]
py/tests/trans-test.py [moved from py/trans-test.py with 100% similarity]

index 69bb845..77f19b4 100644 (file)
@@ -1,34 +1,2 @@
-include_directories(${LIBDRM_INCLUDE_DIRS})
-link_directories(${LIBDRM_LIBRARY_DIRS})
-
-pkg_check_modules(PYTHON python3 REQUIRED)
-include_directories(${PYTHON_INCLUDE_DIRS})
-
-if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-endif()
-
-include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)
-
-set(SRCS pykms.cpp pykmsbase.cpp pykmsutil.cpp pyvid.cpp)
-
-if(LIBDRM_OMAP_FOUND)
-    set(SRCS ${SRCS} pykmsomap.cpp)
-endif()
-
-add_library(pykms SHARED ${SRCS})
-target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES})
-
-# Don't add a 'lib' prefix to the shared library
-set_target_properties(pykms PROPERTIES PREFIX "")
-
-file(GLOB PY_SRCS "*.py")
-add_custom_target(pyextras SOURCES ${PY_SRCS})
-
-add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
-set_property(TEST pytest PROPERTY
-        ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
-)
-
-# XXX Where should pykms.so be installed?
-#install(TARGETS pykms DESTINATION lib)
+add_subdirectory(pykms)
+add_subdirectory(tests)
diff --git a/py/pykms/CMakeLists.txt b/py/pykms/CMakeLists.txt
new file mode 100644 (file)
index 0000000..3e6e0e1
--- /dev/null
@@ -0,0 +1,26 @@
+include_directories(${LIBDRM_INCLUDE_DIRS})
+link_directories(${LIBDRM_LIBRARY_DIRS})
+
+pkg_check_modules(PYTHON python3 REQUIRED)
+include_directories(${PYTHON_INCLUDE_DIRS})
+
+if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
+endif()
+
+include_directories(${PROJECT_SOURCE_DIR}/ext/pybind11/include)
+
+set(SRCS pykms.cpp pykmsbase.cpp pykmsutil.cpp pyvid.cpp)
+
+if(LIBDRM_OMAP_FOUND)
+    set(SRCS ${SRCS} pykmsomap.cpp)
+endif()
+
+add_library(pykms SHARED ${SRCS})
+target_link_libraries(pykms kms++ kms++util ${LIBDRM_LIBRARIES})
+
+# Don't add a 'lib' prefix to the shared library
+set_target_properties(pykms PROPERTIES PREFIX "")
+
+# XXX Where should pykms.so be installed?
+#install(TARGETS pykms DESTINATION lib)
similarity index 100%
rename from py/pykms.cpp
rename to py/pykms/pykms.cpp
similarity index 100%
rename from py/pykmsbase.cpp
rename to py/pykms/pykmsbase.cpp
similarity index 100%
rename from py/pykmsomap.cpp
rename to py/pykms/pykmsomap.cpp
similarity index 100%
rename from py/pykmsutil.cpp
rename to py/pykms/pykmsutil.cpp
similarity index 100%
rename from py/pyvid.cpp
rename to py/pykms/pyvid.cpp
diff --git a/py/run.sh b/py/run.sh
deleted file mode 100755 (executable)
index f0ead78..0000000
--- a/py/run.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-PYTHONPATH=build/py/ python3 $*
-
diff --git a/py/tests/CMakeLists.txt b/py/tests/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a670ed9
--- /dev/null
@@ -0,0 +1,7 @@
+file(GLOB PY_SRCS "*.py")
+add_custom_target(pyextras SOURCES ${PY_SRCS})
+
+add_test(NAME pytest COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/functest.py")
+set_property(TEST pytest PROPERTY
+        ENVIRONMENT "PYTHONPATH=." "LD_LIBRARY_PATH=."
+)
similarity index 100%
rename from py/alpha-test.py
rename to py/tests/alpha-test.py
similarity index 100%
rename from py/cam.py
rename to py/tests/cam.py
similarity index 100%
rename from py/db.py
rename to py/tests/db.py
similarity index 100%
rename from py/functest.py
rename to py/tests/functest.py
similarity index 100%
rename from py/gamma.py
rename to py/tests/gamma.py
similarity index 100%
rename from py/helpers.py
rename to py/tests/helpers.py
similarity index 100%
rename from py/iact.py
rename to py/tests/iact.py
similarity index 100%
rename from py/kmsmodeview.py
rename to py/tests/kmsmodeview.py
similarity index 100%
rename from py/test.py
rename to py/tests/test.py
similarity index 100%
rename from py/trans-test.py
rename to py/tests/trans-test.py