File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -166,9 +166,20 @@ if(NOT EXISTS "${YOLOS_CPP_DIR}/include/yolos/yolos.hpp")
166166 message (FATAL_ERROR "Failed to extract YOLOs-CPP" )
167167 endif ()
168168
169- # Rename extracted folder (usually YOLOs-CPP-master) to standard name
169+ # Find the extracted folder (can vary by branch, e.g. YOLOs-CPP-main or YOLOs-CPP-master)
170+ file (GLOB EXTRACTED_DIRS "${CMAKE_BINARY_DIR} /YOLOs-CPP-*" )
171+ if (NOT EXTRACTED_DIRS)
172+ message (FATAL_ERROR "Extraction failed: Could not find YOLOs-CPP-* directory in ${CMAKE_BINARY_DIR} " )
173+ endif ()
174+
175+ # Use the first match
176+ list (GET EXTRACTED_DIRS 0 EXTRACTED_DIR)
177+
178+ # Remove build dir if it exists from previous run
170179 file (REMOVE_RECURSE "${YOLOS_CPP_DIR} " )
171- file (RENAME "${CMAKE_BINARY_DIR} /YOLOs-CPP-${YOLOS_CPP_VERSION} " "${YOLOS_CPP_DIR} " )
180+
181+ # Rename to standard build directory
182+ file (RENAME "${EXTRACTED_DIR} " "${YOLOS_CPP_DIR} " )
172183 file (REMOVE "${CMAKE_BINARY_DIR} /yolos_cpp.tar.gz" )
173184endif ()
174185
You can’t perform that action at this time.
0 commit comments