Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Tom Birdsong <40648863+tbirdso@users.noreply.github.com>
Signed-off-by: Victor Chang <mocsharp@users.noreply.github.com>
  • Loading branch information
mocsharp and tbirdso committed Aug 20, 2024
1 parent b9f23bb commit d6a1bf5
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/deps)
include(HoloHubConfigHelpers)

# Set install directory
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_SOURCE_DIR}/install")
endif()

# Enable Testing
include(CTest)
Expand Down
23 changes: 14 additions & 9 deletions applications/endoscopy_tool_tracking/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,20 +159,25 @@ install(
COMPONENT "holohub-apps"
)

file(READ "${endoscopy_tool_tracking_BINARY_DIR}/endoscopy_tool_tracking.yaml" APP_YAML_FILE)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/endoscopy_tool_tracking.yaml" APP_YAML_FILE)
string(REPLACE "gxf_extensions/lstm_tensor_rt_inference/" "" APP_YAML_FILE "${APP_YAML_FILE}")
file(WRITE "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_cpp/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}")
file(WRITE "${CMAKE_BINARY_DIR}/packaging/cpp/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}")

install(
FILES ${CMAKE_BINARY_DIR}/packaging/cpp/endoscopy_tool_tracking.yaml
DESTINATION endoscopy_tool_tracking_cpp
COMPONENT "holohub-apps"
)

install(
DIRECTORY ${gxf_lstm_tensor_rt_inference_BINARY_DIR}/
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_cpp"
DESTINATION endoscopy_tool_tracking_cpp
FILES_MATCHING PATTERN "*.so"
PATTERN "CMakeFiles" EXCLUDE)

install(
FILES
${lstm_tensor_rt_inference_BINARY_DIR}/liblstm_tensor_rt_inference.so
${tool_tracking_postprocessor_BINARY_DIR}/libtool_tracking_postprocessor.so
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_cpp"
install( FILES
${lstm_tensor_rt_inference_BINARY_DIR}/liblstm_tensor_rt_inference.so
${tool_tracking_postprocessor_BINARY_DIR}/libtool_tracking_postprocessor.so
DESTINATION endoscopy_tool_tracking_cpp
COMPONENT "holohub-apps"
)
)
21 changes: 14 additions & 7 deletions applications/endoscopy_tool_tracking/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,29 +66,36 @@ endif()

# Install application and dependencies into the install/ directory for packaging
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/endoscopy_tool_tracking.py
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_python"
FILES endoscopy_tool_tracking.py
DESTINATION "endoscopy_tool_tracking_python"
COMPONENT "holohub-apps"
)

file(READ "${CMAKE_CURRENT_SOURCE_DIR}/endoscopy_tool_tracking.yaml" APP_YAML_FILE)
string(REPLACE "gxf_extensions/lstm_tensor_rt_inference/" "" APP_YAML_FILE "${APP_YAML_FILE}")
file(WRITE "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_python/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}")
file(WRITE "${CMAKE_BINARY_DIR}/packaging/python/endoscopy_tool_tracking.yaml" "${APP_YAML_FILE}")

install(
FILES ${CMAKE_BINARY_DIR}/packaging/python/endoscopy_tool_tracking.yaml
DESTINATION endoscopy_tool_tracking_python
COMPONENT "holohub-apps"
)

install(
DIRECTORY ${gxf_lstm_tensor_rt_inference_BINARY_DIR}/
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_python"
DESTINATION endoscopy_tool_tracking_python
FILES_MATCHING PATTERN "*.so"
PATTERN "CMakeFiles" EXCLUDE)
PATTERN "CMakeFiles" EXCLUDE
)

install(
FILES
${lstm_tensor_rt_inference_BINARY_DIR}/liblstm_tensor_rt_inference.so
${tool_tracking_postprocessor_BINARY_DIR}/libtool_tracking_postprocessor.so
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_python"
DESTINATION "endoscopy_tool_tracking_python"
COMPONENT "holohub-apps"
)

install(
DIRECTORY ${Holohub-internal_BINARY_DIR}/python/lib/holohub
DESTINATION "${CMAKE_SOURCE_DIR}/install/endoscopy_tool_tracking_python")
DESTINATION endoscopy_tool_tracking_python)
15 changes: 12 additions & 3 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ build_desc() {
echo " Default: build"
echo " Associated environment variable: CMAKE_BUILD_PATH"
echo " --benchmark : Build for Holoscan Flow Benchmarking."
echo " --install : Install applications and its dependencies to"
echo " install/<app> if supported."
echo " --configure-args <extra_args> : Additional configuration arguments"
echo " multiple arguments can be passed between quotes"
echo " or using several --configure-args in the command line"
Expand Down Expand Up @@ -604,6 +606,7 @@ build() {
local build_type="${CMAKE_BUILD_TYPE:-release}"
local build_path="${CMAKE_BUILD_PATH}"
local benchmark=false
local install=false

for i in "${!ARGS[@]}"; do
arg="${ARGS[i]}"
Expand All @@ -623,6 +626,8 @@ build() {
benchmark=true
configure_args="${configure_args} -DCMAKE_CXX_FLAGS=-I$PWD/benchmarks/holoscan_flow_benchmarking"
echo "Building for Holoscan Flow Benchmarking"
elif [ "$arg" = "--install" ]; then
install=true
elif [ "$arg" = "--configure-args" ]; then
configure_args="${configure_args} ${ARGS[i+1]}"
echo "Adding configuration arguments: ${ARGS[i+1]}"
Expand Down Expand Up @@ -678,9 +683,12 @@ build() {
run_command cmake --build ${build_path} -j
ret=$?
check_exit_code $ret "Error building application."
run_command cmake --install ${build_path}
ret=$?
check_exit_code $ret "Error installing application."

if [ $install == true ]; then
run_command cmake --install ${build_path}
ret=$?
check_exit_code $ret "Error installing application."
fi

if [ $benchmark == true ]; then
app_source_root_path=$(get_app_source_root_dir $1)
Expand Down Expand Up @@ -903,6 +911,7 @@ clear_cache() {
echo "Clearing cache..."
run_command rm -rf ${SCRIPT_DIR}/build
run_command rm -rf ${SCRIPT_DIR}/build-*
run_command rm -rf ${SCRIPT_DIR}/install
}

clear_cache_desc() {
Expand Down

0 comments on commit d6a1bf5

Please sign in to comment.