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

Compilation / Integration in own program via FetchContent does not work on Ubuntu 22.04 #341

Open
firesurfer opened this issue Aug 27, 2024 · 0 comments

Comments

@firesurfer
Copy link

firesurfer commented Aug 27, 2024

Hi I originally came from:

pal-robotics/backward_ros#21 (Which btw. still doesn't work). I therefore tried to include backward-cpp directly in my program. When I followed the guide in the readme I first ran into the following issues:

  1. cmake couldn't clone the repository -> This was due to the SYSTEM argument in the Fetch call. This argument is only supported in cmake > 3.25. Ubuntu 22.04 ships 3.22.1. -> Removing SYSTEM fixes that
  2. None of the targets Backward::Interface, Backward::Object, or Backward::Backward can be found by cmake.

Solution: Directly link against backward_object

So in order to get it working on Ubuntu 22.04 I have now the following CMakeLists.txt

# Also requires one of: libbfd (gnu binutils), libdwarf, libdw (elfutils)
FetchContent_Declare(Backward    #Note: For some reason I ran into issues when the target here is called backwards with a small b at the beginning
    GIT_REPOSITORY https://github.com/bombela/backward-cpp
    GIT_TAG master  # or a version tag, such as v1.6
 
)
FetchContent_MakeAvailable(Backward)

add_executable....
target_link_libraries(my_executable backward_object)

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

No branches or pull requests

1 participant