Skip to content
Merged
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Include cmake configs
include(cmake/cpu_optimizations.cmake)
include(cmake/disable_target_warnings.cmake)
include(cmake/install_app.cmake)
include(cmake/platform.cmake)
include(cmake/imgui.cmake)
include(cmake/imguizmo.cmake)
Expand Down
2 changes: 1 addition & 1 deletion apps/camera_lidar_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,4 @@ if(MSVC)
target_compile_options(camera_lidar_calibration PRIVATE /bigobj)
endif()

install(TARGETS camera_lidar_calibration DESTINATION bin)
hdmapping_install_app(camera_lidar_calibration)
2 changes: 1 addition & 1 deletion apps/camera_lidar_intrinsics_calib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ if(MSVC)
target_compile_options(camera_lidar_intrinsics_calib PRIVATE /bigobj)
endif()

install(TARGETS camera_lidar_intrinsics_calib DESTINATION bin)
hdmapping_install_app(camera_lidar_intrinsics_calib)
2 changes: 1 addition & 1 deletion apps/camera_lidar_trajectory_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ if(MSVC)
target_compile_options(camera_lidar_trajectory_viewer PRIVATE /bigobj)
endif()

install(TARGETS camera_lidar_trajectory_viewer DESTINATION bin)
hdmapping_install_app(camera_lidar_trajectory_viewer)
2 changes: 1 addition & 1 deletion apps/compare_trajectories/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ if (MSVC)
target_compile_options(mandeye_compare_trajectories PRIVATE /bigobj)
endif()

install(TARGETS mandeye_compare_trajectories DESTINATION bin)
hdmapping_install_app(mandeye_compare_trajectories)
2 changes: 1 addition & 1 deletion apps/concatenate_multi_livox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ if (MSVC)
target_compile_options(concatenate_multi_livox PRIVATE /bigobj)
endif()

install (TARGETS concatenate_multi_livox DESTINATION bin)
hdmapping_install_app(concatenate_multi_livox)
15 changes: 14 additions & 1 deletion apps/console_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,17 @@ endif()

if (MSVC)
target_compile_options(laz_to_mcap PRIVATE /bigobj)
endif()
endif()

# These are built whenever BUILD_WITH_CLI_TOOLS is ON (the default), so they
# ship in the DEB package alongside the GUI apps.
hdmapping_install_app(
matrix_mul
multiply_timestamps_session_point_cloud_laz
multiply_timestamps_session_trajectory_csv
laz_to_ply
laz_to_pcd
pcd_to_laz
laz_to_txt
laz_to_mcap
mcap_to_laz)
2 changes: 1 addition & 1 deletion apps/hd_mapper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ if(WIN32)
COMMAND_EXPAND_LISTS)
endif()

install(TARGETS hd_mapper DESTINATION bin)
hdmapping_install_app(hd_mapper)
4 changes: 3 additions & 1 deletion apps/lidar_odometry_step_1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,6 @@ if (MSVC)
target_compile_options(drag_folder_with_mandeye_data_and_drop_here-precision_forestry PRIVATE /bigobj)
endif()

install(TARGETS drag_folder_with_mandeye_data_and_drop_here-precision_forestry DESTINATION bin)
hdmapping_install_app(
lidar_odometry_step_1
drag_folder_with_mandeye_data_and_drop_here-precision_forestry)
2 changes: 1 addition & 1 deletion apps/livox_mid_360_intrinsic_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ if (MSVC)
target_compile_options(livox_mid_360_intrinsic_calibration PRIVATE /bigobj)
endif()

install(TARGETS livox_mid_360_intrinsic_calibration DESTINATION bin)
hdmapping_install_app(livox_mid_360_intrinsic_calibration)
2 changes: 1 addition & 1 deletion apps/mandeye_mission_recorder_calibration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ if (MSVC)
target_compile_options(mandeye_mission_recorder_calibration PRIVATE /bigobj)
endif()

install(TARGETS mandeye_mission_recorder_calibration DESTINATION bin)
hdmapping_install_app(mandeye_mission_recorder_calibration)
2 changes: 1 addition & 1 deletion apps/mandeye_raw_data_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ if (MSVC)
target_compile_options(mandeye_raw_data_viewer PRIVATE /bigobj)
endif()

install(TARGETS mandeye_raw_data_viewer DESTINATION bin)
hdmapping_install_app(mandeye_raw_data_viewer)
2 changes: 1 addition & 1 deletion apps/mandeye_single_session_viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ if (MSVC)
target_compile_options(mandeye_single_session_viewer PRIVATE /bigobj)
endif()

install(TARGETS mandeye_single_session_viewer DESTINATION bin)
hdmapping_install_app(mandeye_single_session_viewer)
2 changes: 1 addition & 1 deletion apps/manual_color/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ if (MSVC)
target_compile_options(mandeye_with_360_camera_manual_coloring PRIVATE /bigobj)
endif()

install(TARGETS mandeye_with_360_camera_manual_coloring DESTINATION bin)
hdmapping_install_app(mandeye_with_360_camera_manual_coloring)
2 changes: 1 addition & 1 deletion apps/multi_session_registration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ if (MSVC)
target_compile_options(multi_session_registration_step_3 PRIVATE /bigobj)
endif()

install (TARGETS multi_session_registration_step_3 DESTINATION bin)
hdmapping_install_app(multi_session_registration_step_3)
2 changes: 1 addition & 1 deletion apps/multi_view_tls_registration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ if (MSVC)
target_compile_options(multi_view_tls_registration_step_2 PRIVATE /bigobj)
endif()

install (TARGETS multi_view_tls_registration_step_2 DESTINATION bin)
hdmapping_install_app(multi_view_tls_registration_step_2)
2 changes: 1 addition & 1 deletion apps/multi_view_tls_registration_legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ if (MSVC)
target_compile_options(multi_view_tls_registration_step_2_legacy PRIVATE /bigobj)
endif()

install (TARGETS multi_view_tls_registration_step_2_legacy DESTINATION bin)
hdmapping_install_app(multi_view_tls_registration_step_2_legacy)
2 changes: 1 addition & 1 deletion apps/precision_forestry_tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ if (MSVC)
target_compile_options(precision_forestry_tools PRIVATE /bigobj)
endif()

install (TARGETS precision_forestry_tools DESTINATION bin)
hdmapping_install_app(precision_forestry_tools)
2 changes: 1 addition & 1 deletion apps/single_session_manual_coloring/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ if (MSVC)
target_compile_options(single_session_manual_coloring PRIVATE /bigobj)
endif()

install(TARGETS single_session_manual_coloring DESTINATION bin)
hdmapping_install_app(single_session_manual_coloring)
2 changes: 1 addition & 1 deletion apps/split_multi_livox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ if (MSVC)
target_compile_options(split_multi_livox PRIVATE /bigobj)
endif()

install (TARGETS split_multi_livox DESTINATION bin)
hdmapping_install_app(split_multi_livox)
50 changes: 50 additions & 0 deletions cmake/install_app.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
include_guard()

# Prefix applied to installed executable names, so that generic tool names
# (laz_to_ply, matrix_mul, pcd_to_laz, ...) do not collide with unrelated
# binaries once they land in a shared directory like /usr/local/bin.
set(HDMAPPING_BINARY_PREFIX "hdmapping-" CACHE STRING
"Prefix applied to installed executable names")

# hdmapping_install_app(<target>...)
#
# Installs each target into <prefix>/bin as "${HDMAPPING_BINARY_PREFIX}<name>",
# leaving the build-tree name alone. Keeping build/bin/ unprefixed is
# deliberate: deploy_mandeye.bat validates the build output against a hardcoded
# list of plain .exe names, and IDE run configurations reference them too.
#
# install(TARGETS) has no RENAME option, and the obvious workaround --
# install(PROGRAMS $<TARGET_FILE:t> RENAME ...) -- is wrong here: it copies the
# binary verbatim, so the installed executable keeps the build-tree RUNPATH
# (build/3rdparty/LASzip/lib) instead of having it stripped, and would resolve
# the bundled liblaszip.so from the build directory rather than the system
# liblaszip that CPACK_DEBIAN_PACKAGE_DEPENDS declares. So install(TARGETS)
# stays responsible for the copy (and its RPATH rewriting), and the file is
# renamed immediately afterwards by an install-time script.
#
# $<TARGET_FILE_NAME:> (not the target name) carries the platform executable
# suffix, so the installed Windows name keeps its .exe. DESTDIR has to be
# honoured explicitly, the way CMake's own generated cmake_install.cmake does,
# because CPack stages the DEB through it.
function(hdmapping_install_app)
foreach(target_name IN LISTS ARGN)
if(NOT TARGET ${target_name})
message(FATAL_ERROR "hdmapping_install_app: no such target '${target_name}'")
endif()

install(TARGETS ${target_name} RUNTIME DESTINATION bin)

# Declared after the install(TARGETS) above and in the same directory,
# so it runs after it.
install(CODE "
set(_hdmapping_bindir \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin\")
set(_hdmapping_plain \"\${_hdmapping_bindir}/$<TARGET_FILE_NAME:${target_name}>\")
set(_hdmapping_prefixed \"\${_hdmapping_bindir}/${HDMAPPING_BINARY_PREFIX}$<TARGET_FILE_NAME:${target_name}>\")
if(EXISTS \"\${_hdmapping_plain}\")
file(REMOVE \"\${_hdmapping_prefixed}\")
file(RENAME \"\${_hdmapping_plain}\" \"\${_hdmapping_prefixed}\")
message(STATUS \"Installing: \${_hdmapping_prefixed}\")
endif()
")
endforeach()
endfunction()
13 changes: 9 additions & 4 deletions deploy_mandeye.bat
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,15 @@ echo Copying executables and DLLs...
xcopy /Y /Q "%BUILD_DIR%\*.exe" "%DEPLOY_DIR%\" >nul
xcopy /Y /Q "%BUILD_DIR%\*.dll" "%DEPLOY_DIR%\" >nul

rem Everything the last known-good build produced. If a target wasn't
rem built (e.g. you only built a subset), it just won't be in BUILD_DIR
rem and xcopy above silently skips it - so check explicitly and warn.
set "EXPECTED=concatenate_multi_livox.exe drag_folder_with_mandeye_data_and_drop_here-precision_forestry.exe laz_to_pcd.exe laz_to_ply.exe laz_to_txt.exe lidar_odometry_step_1.exe livox_mid_360_intrinsic_calibration.exe mandeye_compare_trajectories.exe mandeye_mission_recorder_calibration.exe mandeye_raw_data_viewer.exe mandeye_single_session_viewer.exe mandeye_with_360_camera_manual_coloring.exe matrix_mul.exe multiply_timestamps_session_point_cloud_laz.exe multiply_timestamps_session_trajectory_csv.exe multi_session_registration_step_3.exe multi_view_tls_registration_step_2.exe pcd_to_laz.exe precision_forestry_tools.exe single_session_manual_coloring.exe split_multi_livox.exe freeglut.dll laszip3.dll opencv_world4130.dll proj_9_3.dll tbb12.dll z.dll"
rem Everything a default build produces. If a target wasn't built (e.g. you
rem only built a subset), it just won't be in BUILD_DIR and the xcopy above
rem silently skips it - so check explicitly and warn.
rem
rem This list has to be kept in sync by hand with the hdmapping_install_app()
rem calls in apps/*/CMakeLists.txt. hd_mapper is deliberately absent: it is
rem gated behind BUILD_WITH_HD_MAPPER_APPLICATION, which defaults to OFF, so
rem listing it would warn on every normal build.
set "EXPECTED=camera_lidar_calibration.exe camera_lidar_intrinsics_calib.exe camera_lidar_trajectory_viewer.exe concatenate_multi_livox.exe drag_folder_with_mandeye_data_and_drop_here-precision_forestry.exe laz_to_mcap.exe laz_to_pcd.exe laz_to_ply.exe laz_to_txt.exe lidar_odometry_step_1.exe livox_mid_360_intrinsic_calibration.exe mandeye_compare_trajectories.exe mandeye_mission_recorder_calibration.exe mandeye_raw_data_viewer.exe mandeye_single_session_viewer.exe mandeye_with_360_camera_manual_coloring.exe matrix_mul.exe mcap_to_laz.exe multiply_timestamps_session_point_cloud_laz.exe multiply_timestamps_session_trajectory_csv.exe multi_session_registration_step_3.exe multi_view_tls_registration_step_2.exe multi_view_tls_registration_step_2_legacy.exe pcd_to_laz.exe precision_forestry_tools.exe single_session_manual_coloring.exe split_multi_livox.exe freeglut.dll laszip3.dll opencv_world4130.dll proj_9_3.dll tbb12.dll z.dll"

set "MISSING="
for %%F in (%EXPECTED%) do (
Expand Down
Loading