Skip to content

Commit

Permalink
Don't rebuild wheel files everytime (#10)
Browse files Browse the repository at this point in the history
* Add check done file in cmake

Signed-off-by: Andreas Heinrich <andreas.heinrich@rwth-aachen.de>
  • Loading branch information
andistorm authored Oct 7, 2024
1 parent dbc00d4 commit 60e8494
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python-package-helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,23 @@ function (ev_create_python_wheel_targets)
endif()

set(WHEEL_OUTDIR ${CMAKE_CURRENT_BINARY_DIR}/dist_${EV_CREATE_PYTHON_WHEEL_TARGETS_PACKAGE_NAME})
set(CHECK_DONE_FILE ${CMAKE_CURRENT_BINARY_DIR}/${EV_CREATE_PYTHON_WHEEL_TARGETS_PACKAGE_NAME}_build_wheel_done)

add_custom_target(${EV_CREATE_PYTHON_WHEEL_TARGETS_PACKAGE_NAME}_build_wheel
DEPENDS
"${CHECK_DONE_FILE}"
)

add_custom_command(
OUTPUT
"${CHECK_DONE_FILE}"
# Remove build dir from pip
COMMAND
${CMAKE_COMMAND} -E remove_directory build
COMMAND
${Python3_EXECUTABLE} -m build --wheel --outdir ${WHEEL_OUTDIR} .
COMMAND
${CMAKE_COMMAND} -E touch "${CHECK_DONE_FILE}"
WORKING_DIRECTORY
${EV_CREATE_PYTHON_WHEEL_TARGETS_PACKAGE_SOURCE_DIRECTORY}
DEPENDS
Expand Down

0 comments on commit 60e8494

Please sign in to comment.