Skip to content

Commit

Permalink
pyktx (Python bindings for libktx) (KhronosGroup#698)
Browse files Browse the repository at this point in the history
Add Python bindings, documentation and tests. Add to CI.

Adds a manual Publish step for publishing to PyPl. See KhronosGroup#663 for details.

Fixes KhronosGroup#663.

Co-authored-by: Mark Callow <[email protected]>
  • Loading branch information
ShukantPal and MarkCallow authored Nov 29, 2023
1 parent f8eef1e commit 482d2dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ CMAKE_DEPENDENT_OPTION( KTX_FEATURE_TOOLS
option( KTX_FEATURE_DOC "Create KTX documentation." OFF )
option( KTX_FEATURE_STATIC_LIBRARY "Create static libraries (shared otherwise)." ${LIB_TYPE_DEFAULT} )
option( KTX_FEATURE_JNI "Create Java bindings for libktx." OFF )
option( KTX_FEATURE_PY "Create Python source distribution." OFF )
option( KTX_FEATURE_TESTS "Create unit tests." ON )
option( KTX_FEATURE_TOOLS_CTS "Enable KTX CLI Tools CTS tests (requires CTS submodule)." OFF )

Expand Down Expand Up @@ -731,6 +732,10 @@ if(KTX_FEATURE_JNI)
add_subdirectory(interface/java_binding)
endif()

if(KTX_FEATURE_PY)
add_subdirectory(interface/python_binding)
endif()

create_version_header(lib ktx)
create_version_file()

Expand Down
14 changes: 14 additions & 0 deletions cmake/docs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ function( CreateDocJSWrappers )
add_docs_cmake_plus( jswrappers.doc pkgdoc/jswrappersDoxyLayout.xml )
endfunction()

# pyktxwrappers.doc
function( CreateDocPyktxWrappers )
add_custom_command(
TARGET libktx.doc
POST_BUILD
COMMAND
${CMAKE_COMMAND} -E copy_directory ${KTX_BUILD_DIR}/interface/python_binding/docs/html/pyktx/html ${KTX_BUILD_DIR}/docs/html/pyktx
)
add_dependencies( libktx.doc pyktx )
endfunction()

# ktxpkg.doc
function( CreateDocKTX )
set( DOXYGEN_PROJECT_NAME "Khronos Texture Software" )
Expand All @@ -215,6 +226,9 @@ endfunction()
CreateDocLibKTX()
CreateDocTools()
CreateDocJSWrappers()
if (KTX_FEATURE_PY)
CreateDocPyktxWrappers()
endif()
CreateDocKTX()

add_dependencies( libktx.doc ktxpkg.doc ktx_version )
Expand Down

0 comments on commit 482d2dc

Please sign in to comment.