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

Cmake refactor for gtest #31

Merged
merged 14 commits into from
May 26, 2023

Conversation

Ryanf55
Copy link
Contributor

@Ryanf55 Ryanf55 commented May 1, 2023

This refactors the cmake code to build and test from top level of the project.

* Bring in gtest through fetchcontent
* Use cmake options
* Use target properties and link flags instead of global properties
* Stop globbing
* Bump cmake min version to match 22.04
* Reduce random variables that aren't used
* Stop referring to directories above current cmake
* Properly use CTest to allow optional testing
* Solves dronecan#28

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
…ather than global CANARD_CXX_FLAGS

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
CMakeLists.txt Outdated
#list(APPEND SRC_FILES ${DSDL_GENERATED_SOURCES})

# check arguments for 32-bit build
option(CMAKE_32BIT "Enable 32 bit build" ON)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move this down to where it's used.

@bugobliterator bugobliterator force-pushed the cmake-refactor-for-gtest branch 2 times, most recently from 4fb1073 to 429d198 Compare May 15, 2023 04:25
@bugobliterator bugobliterator force-pushed the cmake-refactor-for-gtest branch 2 times, most recently from a44e3cc to 6eafbda Compare May 15, 2023 05:00
@bugobliterator bugobliterator force-pushed the cmake-refactor-for-gtest branch 8 times, most recently from 8303516 to 187d1d7 Compare May 15, 2023 06:04
tests/CMakeLists.txt Outdated Show resolved Hide resolved
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
* This verifies the same version is used everywhere

Signed-off-by: Ryan Friedman <ryanfriedman5410+github@gmail.com>
@Ryanf55 Ryanf55 marked this pull request as ready for review May 24, 2023 15:33
@Ryanf55
Copy link
Contributor Author

Ryanf55 commented May 25, 2023

Hi @bugobliterator , can you please allow this workflow to build, and give it a review?

set(MODULES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/modules)
set(TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR}/tests)
#
# Copyright (c) 2016-2017 UAVCAN Team
Copy link
Collaborator

Choose a reason for hiding this comment

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

DroneCAN team now

@bugobliterator bugobliterator merged commit 1dffd1c into dronecan:master May 26, 2023
1 check passed
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.

None yet

2 participants