Add installation of executables (#59)

Fixes #55

---------

Co-authored-by: Sutou Kouhei <kou@clear-code.com>
Co-authored-by: Benson Muite <benson_muite@emailplus.org>
This commit is contained in:
Daijiro Fukuda 2025-10-16 15:24:17 +09:00 committed by GitHub
parent 6e1fa67cf2
commit 010ea250f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 23 additions and 6 deletions

View File

@ -118,12 +118,21 @@ configure_file(openarm-can.pc.in ${CMAKE_CURRENT_BINARY_DIR}/openarm-can.pc
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/openarm-can.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
set(OPENARM_CAN_LIBEXEC_DIR "${CMAKE_INSTALL_LIBEXECDIR}/openarm-can")
add_executable(motor-check setup/motor_check.cpp)
target_link_libraries(motor-check openarm_can)
install(TARGETS motor-check DESTINATION ${OPENARM_CAN_LIBEXEC_DIR})
# Add motor control example executable
add_executable(openarm-demo examples/demo.cpp)
target_link_libraries(openarm-demo openarm_can)
install(TARGETS openarm-demo DESTINATION ${OPENARM_CAN_LIBEXEC_DIR})
# Install scripts
install(PROGRAMS setup/change_baudrate.py setup/configure_socketcan.sh
setup/configure_socketcan_4_arms.sh setup/set_zero.sh
DESTINATION ${OPENARM_CAN_LIBEXEC_DIR})
# Add tests
if(BUILD_TESTING)

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
usr/include/*
usr/include/
usr/lib/*/lib*.so
usr/lib/*/pkgconfig/*
usr/lib/*/cmake/OpenArmCAN/*
usr/lib/*/pkgconfig/
usr/lib/*/cmake/OpenArmCAN/

View File

@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
setup/configure_socketcan.sh usr/libexec/openarm-can
setup/set_zero.sh usr/libexec/openarm-can
setup/change_baudrate.py usr/libexec/openarm-can
usr/libexec/

View File

@ -36,6 +36,12 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
Header files and development libraries for OpenARM CAN control library.
%package utils
Summary: Setup and configuration utility scripts
%description utils
Setup and configuration utility scripts.
%prep
%autosetup
@ -60,5 +66,9 @@ Header files and development libraries for OpenARM CAN control library.
%{_libdir}/libopenarm_can.so
%{_libdir}/pkgconfig/openarm-can.pc
%files utils
%license LICENSE.txt
%{_libexecdir}/openarm-can/
%changelog
%autochangelog