Skip to content

Commit

Permalink
feat: add post build script execution
Browse files Browse the repository at this point in the history
Signed-off-by: KhalilSelyan <[email protected]>
  • Loading branch information
KhalilSelyan committed Jun 5, 2024
1 parent b9d755f commit 21f8610
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions autoware_launch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,26 @@ ament_auto_package(
launch
rviz
)

# Copy the script to the build directory and ensure it is executable
add_custom_target(copy_qt5ctsetup ALL

Check warning on line 20 in autoware_launch/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ctsetup)
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/rviz/qt5ctsetup.sh ${CMAKE_CURRENT_BINARY_DIR}/rviz/qt5ctsetup.sh

Check warning on line 21 in autoware_launch/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ctsetup)

Check warning on line 21 in autoware_launch/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ctsetup)
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/rviz
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/rviz/qt5ctsetup.sh

Check warning on line 23 in autoware_launch/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ctsetup)
)

# Create a dummy target
add_custom_target(dummy_target ALL
COMMAND ${CMAKE_COMMAND} -E echo "Running autoware build dummy target"
)

# Custom target to run the script after build
add_custom_target(post_build ALL
COMMAND ${CMAKE_COMMAND} -E echo "Running post-build script"
COMMAND ${CMAKE_COMMAND} -E env bash ${CMAKE_CURRENT_BINARY_DIR}/rviz/qt5ctsetup.sh

Check warning on line 34 in autoware_launch/CMakeLists.txt

View workflow job for this annotation

GitHub Actions / spell-check-differential

Unknown word (ctsetup)
DEPENDS dummy_target copy_qt5ctsetup
)

# Ensure post_build target runs after dummy_target and copy_qt5ctsetup
add_dependencies(post_build dummy_target)
add_dependencies(post_build copy_qt5ctsetup)

0 comments on commit 21f8610

Please sign in to comment.