Skip to content

Edit cmake#183

Merged
charliehuang09 merged 8 commits into
mainfrom
edit-cmake
May 20, 2026
Merged

Edit cmake#183
charliehuang09 merged 8 commits into
mainfrom
edit-cmake

Conversation

@charliehuang09
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Copilot AI review requested due to automatic review settings May 20, 2026 03:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the project’s CMake build definitions to use target_sources() and to decompose previously monolithic libraries (notably camera and localization) into smaller component targets, alongside some CMake policy/build invocation updates.

Changes:

  • Restructures utils and pathing CMake targets to use add_library(<name>) + target_sources().
  • Splits camera and localization into multiple component libraries and introduces an aggregate camera interface target.
  • Updates CMake policy handling and raises the CMake minimum required version in src/.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/utils/CMakeLists.txt Converts utils to target_sources() style and reformats link dependencies.
src/pathing/CMakeLists.txt Converts pathing to target_sources() style and changes its link dependencies.
src/localization/CMakeLists.txt Splits localization into multiple component libraries and rewires linking.
src/camera/CMakeLists.txt Splits camera into component libraries and introduces an aggregate camera interface target.
src/calibration/CMakeLists.txt Refactors calibration executables’ CMake definitions (with some redundancy introduced).
src/CMakeLists.txt Raises cmake_minimum_required for the src subdir and adjusts executable link lists.
CMakeLists.txt Adds policy guards and FetchContent extract-timestamp setting.
scripts/build.sh Adds -Wno-dev to the CMake configure invocation.
Comments suppressed due to low confidence (4)

src/localization/CMakeLists.txt:18

  • OpencvApriltagDetector directly uses OpenCV APIs, but the target links only utils. This can produce link failures when OpenCV isn't already on the final link line. Link this target against OpenCV (prefer imported targets if available, otherwise ${OpenCV_LIBS}) so its dependency is explicit.
add_library(OpencvApriltagDetector)
target_sources(OpencvApriltagDetector
  PRIVATE
    opencv_apriltag_detector.cc
)
target_link_libraries(OpencvApriltagDetector PRIVATE
  utils
)

src/localization/CMakeLists.txt:27

  • NvidiaApriltagDetector includes and uses OpenCV types/functions (and OpenCV-VPI interop), but the target links only utils. To avoid unresolved OpenCV symbols, add the required OpenCV link dependency (prefer imported targets if available, otherwise ${OpenCV_LIBS}) to this target.
add_library(NvidiaApriltagDetector)
target_sources(NvidiaApriltagDetector
  PRIVATE
    nvidia_apriltag_detector.cc
)
target_link_libraries(NvidiaApriltagDetector PRIVATE
  utils
)

src/calibration/CMakeLists.txt:17

  • frame_shower sources are specified twice (in add_executable(frame_shower frame_shower.cc) and again in target_sources(frame_shower ...)). This is redundant; keep the source list in one place to avoid confusion.
add_executable(frame_shower frame_shower.cc)
target_sources(frame_shower
  PRIVATE
  frame_shower.cc
)

src/calibration/CMakeLists.txt:28

  • focus_calibrate sources are specified twice (in add_executable(focus_calibrate focus_calibrate.cc) and again in target_sources(focus_calibrate ...)). This is redundant; keep the source list in one place to avoid confusion.
add_executable(focus_calibrate focus_calibrate.cc)
target_sources(focus_calibrate
  PRIVATE
  focus_calibrate.cc
)

Comment thread src/camera/CMakeLists.txt
PRIVATE
cv_camera.cc
write_frame.cc
write_frame.cc
Comment thread src/camera/CMakeLists.txt
Comment on lines +73 to +76
target_link_libraries(UVCCamera PRIVATE
uvc
absl::status
utils
Comment on lines +95 to +114
add_library(localization)
target_sources(localization
PRIVATE
run_localization.cc
multi_camera_detector.cc
)
target_link_libraries(localization PRIVATE
GPUApriltagDetector
OpencvApriltagDetector
NvidiaApriltagDetector
SquareSolver
JointSolver
MultitagSolver
PositionReceiver
UnambiguousEstimator
SimulationSender
NetworktableSender
utils
camera
)
Comment on lines +1 to +9
add_library(GPUApriltagDetector)
target_sources(GPUApriltagDetector
PRIVATE
gpu_apriltag_detector.cc
)
target_link_libraries(GPUApriltagDetector PRIVATE
971apriltag
utils
)
)
target_link_libraries(pathing PRIVATE
utils
localization
Comment on lines +1 to +6
add_executable(IntrinsicsCalibrate intrinsics_calibrate.cc intrinsics_calibrate_lib.cc)
target_sources(IntrinsicsCalibrate
PRIVATE
intrinsics_calibrate.cc
intrinsics_calibrate_lib.cc
)
Comment thread src/CMakeLists.txt
@@ -1,4 +1,5 @@
cmake_minimum_required(VERSION 3.10)
cmake_minimum_required(VERSION 3.16...4.0)
Comment thread CMakeLists.txt
Comment on lines +3 to +5
if(POLICY CMP0135)
cmake_policy(SET CMP0135 NEW)
endif()
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
Signed-off-by: Charlie Huang <charliehuang09@gmail.com>
This reverts commit 0c49e80.
@charliehuang09 charliehuang09 merged commit 1dbdf51 into main May 20, 2026
1 check passed
@charliehuang09 charliehuang09 deleted the edit-cmake branch May 20, 2026 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants