Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,23 @@ project(python_qt_binding)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

# Copy python package into binary directory
file(COPY src/${PROJECT_NAME} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

include(python_qt_binding-extras.cmake)

# Generate a version.py file inside the copied package directory
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}/version.py
"QT_MAJOR_VERSION = ${python_qt_binding_QT_MAJOR_VERSION}\n"
)

# Install the package from the binary directory
ament_python_install_package(${PROJECT_NAME}
PACKAGE_DIR src/${PROJECT_NAME})
PACKAGE_DIR ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME})

install(FILES
cmake/pyproject.toml.in
cmake/shiboken_helper.cmake
cmake/sip_configure.py
cmake/sip_helper.cmake
DESTINATION share/${PROJECT_NAME}/cmake)

Expand All @@ -27,4 +38,6 @@ if(BUILD_TESTING)
TIMEOUT 90)
endif()

ament_package()
ament_package(
CONFIG_EXTRAS "python_qt_binding-extras.cmake"
)
22 changes: 22 additions & 0 deletions cmake/pyproject.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build-system]
requires = ["sip >=6, <7"]
build-backend = "sipbuild.api"

[project]
name = "@PROJECT_NAME@"
version = "1.0.0"

[tool.sip]
project-factory = "pyqtbuild:PyQtProject"

[tool.sip.builder]
qmake = "@python_qt_binding_QMAKE_EXECUTABLE@"

[tool.sip.project]
build-dir = "@SIP_BUILD_DIR@"
sip-files-dir = "@sip_SOURCE_DIR@"
sip-include-dirs = ["@__PYQT_BINDINGS_DIR@"]
abi-version = "@__QT_SIP_ABI_VERSION@"

[tool.sip.bindings.@PROJECT_NAME@]
sip-file = "@SIP_FILE_NAME@"
231 changes: 0 additions & 231 deletions cmake/sip_configure.py

This file was deleted.

Loading