Skip to content

Commit

Permalink
Undo clang-format on CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
imisaacwu committed Nov 5, 2024
1 parent fa3a600 commit 3fde550
Showing 1 changed file with 66 additions and 66 deletions.
132 changes: 66 additions & 66 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13) #Latest versions of Ubuntu should have at least 3.16;
#argparse library requires 3.12.4 currently
cmake_minimum_required(VERSION 3.13) # Latest versions of Ubuntu should have at least 3.16;
# argparse library requires 3.12.4 currently

set(CMAKE_CXX_STANDARD 17) # 11 For the json library, 17 for std library features
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand All @@ -8,14 +8,13 @@ project(Rover LANGUAGES CXX C)

include(FetchContent)

#If a build type was not explicitly specified, default to "RelWithDebInfo"(Same optimization
#as the "Release" configuration but with debugging symbols).
# If a build type was not explicitly specified, default to "RelWithDebInfo" (Same optimization
# as the "Release" configuration but with debugging symbols).
#
#To change, you can pass - DCMAKE_BUILD_TYPE = ... where... is the configuration you would like
#to use.For example, if you want to do a full debug build(little to no optimization, with
#debugging symbols), \
add - DCMAKE_BUILD_TYPE = Debug to your `cmake` command.You may want to do
#a full debug build if code you want to debug gets optimized out by the compiler.
# To change, you can pass -DCMAKE_BUILD_TYPE=... where ... is the configuration you would like
# to use. For example, if you want to do a full debug build (little to no optimization, with
# debugging symbols), add -DCMAKE_BUILD_TYPE=Debug to your `cmake` command. You may want to do
# a full debug build if code you want to debug gets optimized out by the compiler.
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "The type of build to perform.")
set(AVAILABLE_BUILD_TYPES "Debug" "Release" "RelWithDebInfo" "MinSizeRel")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${AVAILABLE_BUILD_TYPES})
Expand All @@ -24,17 +23,17 @@ Building ${CMAKE_BUILD_TYPE} configuration...\n\
Add -DCMAKE_BUILD_TYPE=... to change\n\
========================================")

#Generate a compile_commands.json file by default unless explicitly disabled.
#This allows editors like Visual Studio Code to be able to index the project correctly and
#locate header files and libraries.
# Generate a compile_commands.json file by default unless explicitly disabled.
# This allows editors like Visual Studio Code to be able to index the project correctly and
# locate header files and libraries.
if(NOT CMAKE_EXPORT_COMPILE_COMMANDS)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE STRING "Enable/Disable output of compile commands
during generation." FORCE)
endif()

##====== Module settings ======
#These variables control whether various modules are enabled or disabled.The goal is to allow
#a user to selectively exclude modules that they do not need.
# These variables control whether various modules are enabled or disabled. The goal is to allow
# a user to selectively exclude modules that they do not need.
set(GPS "ARDUPILOT" CACHE STRING "GPS interface to use.")
set(AVAILABLE_GPS "USB" "ARDUPILOT" "NONE")
set_property(CACHE GPS PROPERTY STRINGS ${AVAILABLE_GPS})
Expand All @@ -61,37 +60,38 @@ message(" World Interface:\t${WORLD_INTERFACE}")
message("========================================")

##====== Dependencies ======
#Some of these are optional depending on module settings above.
# Some of these are optional depending on module settings above.

#Get the Eigen linear algebra library.Eigen's CMake config includes its headers as user
#headers instead of system headers by default, so explicitly force them to be system includes
#here to avoid the compiler spamming warnings at us for stuff in the Eigen headers.
# Get the Eigen linear algebra library. Eigen's CMake config includes its headers as user
# headers instead of system headers by default, so explicitly force them to be system includes
# here to avoid the compiler spamming warnings at us for stuff in the Eigen headers.
find_package(Eigen3 REQUIRED NO_MODULE)
include_directories(SYSTEM ${EIGEN3_INCLUDE_DIR})
include_directories("/usr/local/include")

#Find the WebSocket++ library and Boost(provides the ASIO backend for Websocket++ and also
#provides the program_options argument parser).Only the `system` component of Boost is
#currently required.
# Find the WebSocket++ library and Boost (provides the ASIO backend for Websocket++ and also
# provides the program_options argument parser). Only the `system` component of Boost is
# currently required.
find_package(websocketpp REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)

#Find Frozen, library used for constexpr immutable containers
# Find Frozen, library used for constexpr immutable containers
find_package(frozen REQUIRED)
#Frozen is just an interface library, only containing headers and some CMake settings.It
#should be fine to "link" the library to every target, since if the headers are not included,
#it will not have any effect on size or performance.This will help us not have to worry about
#making sure the headers are available in every file that includes Constants.h, for example.
# Frozen is just an interface library, only containing headers and some CMake settings. It
# should be fine to "link" the library to every target, since if the headers are not included,
# it will not have any effect on size or performance. This will help us not have to worry about
# making sure the headers are available in every file that includes Constants.h, for example.
link_libraries(frozen::frozen)

#Find argparse, library used for parsing command line arguments
# Find argparse, library used for parsing command line arguments
find_package(argparse REQUIRED)

#Find the JSON library

# Find the JSON library
find_package(nlohmann_json 3.2.0 REQUIRED)

#Find the CAN library; contains packet and protocol definitions and does not
#actually require physical CAN to be present.
# Find the CAN library; contains packet and protocol definitions and does not
# actually require physical CAN to be present.
FetchContent_Declare(
HindsightCAN
GIT_REPOSITORY https://github.com/huskyroboticsteam/HindsightCAN.git
Expand All @@ -103,7 +103,7 @@ FetchContent_Declare(LoguruGitRepo
GIT_REPOSITORY "https://github.com/emilk/loguru"
GIT_TAG "master"
)
#set any loguru compile - time flags before calling MakeAvailable()
# set any loguru compile-time flags before calling MakeAvailable()
set(LOGURU_WITH_STREAMS TRUE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
FetchContent_MakeAvailable(LoguruGitRepo) # defines target 'loguru::loguru'
Expand All @@ -116,13 +116,13 @@ if(WITH_TESTS)
find_package(Catch2 REQUIRED)
endif()

#Libraries needed to interface with real - life sensors.If we aren't using the real world
#interface, these aren't needed.
# Libraries needed to interface with real-life sensors. If we aren't using the real world
# interface, these aren't needed.
if(WORLD_INTERFACE STREQUAL "REAL")
if(GPS STREQUAL "USB")
#Find pkg - config(needed for libgps, as it doesn't have CMake configuration)
# Find pkg-config (needed for libgps, as it doesn't have CMake configuration)
find_package(PkgConfig REQUIRED)
#Find the libgps USB GPS library.
# Find the libgps USB GPS library.
pkg_check_modules(libgps REQUIRED libgps)
endif()
endif()
Expand All @@ -136,7 +136,7 @@ add_library(camera SHARED
)
target_link_libraries(camera PUBLIC ${OpenCV_LIBS})

#shared library for utility code
# shared library for utility code
add_library(utils SHARED
utils/core.cpp
utils/random.cpp
Expand All @@ -155,22 +155,22 @@ add_library(utils SHARED
target_link_libraries(utils ${OpenCV_LIBS})

## ====== CAN Interfaces =======
#Stub CAN interface is used for the tests(and for the Rover if
#CAN is disabled) and the real CAN interface is used for the Rover if CAN is
#enabled.
# Stub CAN interface is used for the tests (and for the Rover if
# CAN is disabled) and the real CAN interface is used for the Rover if CAN is
# enabled.

#Common CAN source files
# Common CAN source files

#** DON'T MAKE THIS SHARED**
#Making this library shared causes some memory fuckery
#No clue why but CAN I / O goes to shit.Don't do it.
# **DON'T MAKE THIS SHARED**
# Making this library shared causes some memory fuckery
# No clue why but CAN I/O goes to shit. Don't do it.
add_library(can_interface STATIC)
target_sources(can_interface PRIVATE
CAN/CANMotor.cpp
CAN/CANUtils.cpp
)

#Hardware specific source files
# Hardware specific source files
target_sources(can_interface PRIVATE
CAN/CAN.cpp)
target_link_libraries(can_interface PUBLIC
Expand All @@ -195,20 +195,20 @@ else()
endif()

## ====== World Interfaces =======
#hardware - agnostic utilities and common code for world interface
# hardware-agnostic utilities and common code for world interface
add_library(world_interface_core STATIC
world_interface/gps_common_interface.cpp
#ar / Detector.cpp
#ar / MarkerSet.cpp
#ar / MarkerPattern.cpp
#ar / Tag.cpp
#ar / read_landmarks.cpp
#ar/Detector.cpp
#ar/MarkerSet.cpp
#ar/MarkerPattern.cpp
#ar/Tag.cpp
#ar/read_landmarks.cpp
world_interface/motor/base_motor.cpp
)
target_include_directories(world_interface_core SYSTEM PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_libraries(world_interface_core PUBLIC ${vision_libs} opencv_aruco ${OpenCV_LIBS} utils camera)

#CAN library(above) requires some utilities from this
# CAN library (above) requires some utilities from this
target_link_libraries(can_interface PUBLIC utils)

add_library(stub_world_interface STATIC
Expand Down Expand Up @@ -268,9 +268,9 @@ add_library(constants SHARED Constants.cpp)
link_libraries(constants)

add_executable(Rover Rover.cpp)
#** DON'T MAKE THIS SHARED**
#Making this library shared causes some memory fuckery
#No clue why but CAN I / O goes to shit.Don't do it.
# **DON'T MAKE THIS SHARED**
# Making this library shared causes some memory fuckery
# No clue why but CAN I/O goes to shit. Don't do it.
add_library(rover_common STATIC
Globals.cpp
control_interface.cpp
Expand Down Expand Up @@ -307,38 +307,38 @@ target_link_libraries(TunePID ${vision_libs})
if(WITH_TESTS)
add_executable(tests
Tests.cpp
#AR Detection tests
#ar / DetectorTests.cpp
#ar / MarkerSetTests.cpp
#Camera tests
#../ tests / camera / CameraParamsTests.cpp
#GPS tests
# AR Detection tests
# ar/DetectorTests.cpp
# ar/MarkerSetTests.cpp
# Camera tests
# ../tests/camera/CameraParamsTests.cpp
# GPS tests
../tests/gps/GPSDatumTest.cpp
../tests/gps/GPSConverterTest.cpp
#Controller tests
# Controller tests
../tests/control/TrapezoidalVelocityProfileTest.cpp
../tests/control/JacobianControllerTest.cpp
../tests/control/PIDControllerTest.cpp
../tests/control/PlanarArmControllerTest.cpp
#Kinematics tests
# Kinematics tests
../tests/kinematics/DiffDriveKinematicsTest.cpp
../tests/kinematics/SwerveDriveKinematicsTest.cpp
../tests/kinematics/PlanarArmFKTest.cpp
../tests/kinematics/FabrikSolver2DTest.cpp
#Filter tests
# Filter tests
../tests/filters/RollingAvgFilterTest.cpp
../tests/filters/EKFTest.cpp
../tests/filters/MultiSensorEKFTest.cpp
../tests/filters/StateSpaceUtilsTest.cpp
#Command tests
# Command tests
../tests/commands/DriveToWaypointCommandTest.cpp
#Util tests
# Util tests
../tests/util/CoreTest.cpp
../tests/util/DataTest.cpp
../tests/util/MathTest.cpp
../tests/util/TimeTest.cpp
../tests/util/SchedulerTest.cpp
#Protocol / teleop tests
# Protocol/teleop tests
../tests/kinematics/DiffWristKinematicsTest.cpp)

target_link_libraries(tests
Expand Down

0 comments on commit 3fde550

Please sign in to comment.