Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install the profiler in a version-safe manner #170

Merged
merged 4 commits into from
Feb 20, 2021
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
8 changes: 5 additions & 3 deletions profiler/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,17 @@ if(TARGET UNIT_Profiler_Remotery_TEST)
endif()

if(IGN_PROFILER_REMOTERY)
set(IGN_PROFILER_SCRIPT_PATH ${CMAKE_INSTALL_LIBDIR}/ignition/ignition-common${PROJECT_VERSION_MAJOR})
set(IGN_PROFILER_VIS_PATH ${IGN_DATA_INSTALL_DIR}/profiler_vis)

configure_file(Remotery/ign_remotery_vis.in
${CMAKE_CURRENT_BINARY_DIR}/ign_remotery_vis)
${CMAKE_CURRENT_BINARY_DIR}/ign_remotery_vis
@ONLY)

install(PROGRAMS
${CMAKE_CURRENT_BINARY_DIR}/ign_remotery_vis
DESTINATION bin)
DESTINATION ${IGN_PROFILER_SCRIPT_PATH})

install(DIRECTORY Remotery/vis/
DESTINATION ${IGN_DATA_INSTALL_DIR}/profiler_vis)
DESTINATION ${IGN_PROFILER_VIS_PATH})
endif()
13 changes: 12 additions & 1 deletion profiler/src/Remotery/ign_remotery_vis.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
#!/usr/bin/env bash

VIS_PATH=@CMAKE_INSTALL_PREFIX@/@IGN_PROFILER_VIS_PATH@/index.html
SCRIPT_PATH=@IGN_PROFILER_SCRIPT_PATH@/ign_remotery_vis
VIS_PATH=@IGN_PROFILER_VIS_PATH@/index.html

# Get the full path to this script
SCRIPT=`realpath $0`

# Strip the known script path off the end of the full path
INSTALL_ROOT=${SCRIPT%${SCRIPT_PATH}}

# Append the relative vis path
VIS_PATH=$INSTALL_ROOT/$VIS_PATH

# Open with a system web browser
if [ -x "$(command -v xdg-open)" ]; then
xdg-open $VIS_PATH
elif [ -x "$(command -v open)" ]; then
Expand Down
7 changes: 5 additions & 2 deletions tutorials/profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ From terminal 1:
From terminal 2, open the visualizer using one of the following commands

```{.sh}
# Use a launcher script (Linux and macOS)
ign_remotery_vis
# Find the launcher script and use it (Linux and macOS)
find /usr | grep ign_remotery_vis
...

/usr/<path_to>/ign_remotery_vis

# Use the source path (Linux)
# Substitute the path to your ign-common source checkout
Expand Down