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

Can't compile as sub-dependency #1260

Open
paro- opened this issue Aug 22, 2022 · 2 comments
Open

Can't compile as sub-dependency #1260

paro- opened this issue Aug 22, 2022 · 2 comments
Labels

Comments

@paro-
Copy link

paro- commented Aug 22, 2022

Hello,

I'm not managing to compile my project, not sure it's abseil's fault.
My project depends on s2geometry, which in turn depends on abseil.
s2geometry used to include their own version of abseil, but now that they made it external I can't compile anymore.

Indeed in my CMakeLists.txt I added add_subdirectory(third-party/abseil) before add_subdirectory(third-party/s2geometry) but s2 complained that it couldn't find abslConfig.cmake so I used set(ABSL_ENABLE_INSTALL ON) to have it, but now I'm stuck on the following error:
CMake Error at build/third-party/abseil-cpp/abslConfig.cmake:32 (include):
[cmake] include could not find load file:
[cmake]
[cmake] [...]/build/third-party/abseil-cpp/abslTargets.cmake
[cmake] Call Stack (most recent call first):
[cmake] third-party/s2geometry/CMakeLists.txt:71 (find_package)

The targets don't seem to be installed when add_subdirectory(third-party/abseil) finishes, when s2 launches find_package(absl REQUIRED).
Which brings me to my question: is there a way to include abseil as a sub-dependency, or am I missing something here?

Best regards,
Paul

@paro- paro- added the bug label Aug 22, 2022
@anpol
Copy link
Contributor

anpol commented Sep 5, 2022

You can try disabling find_package for Abseil after including it as as a subdirectory:

add_subdirectory(third_party/absl)

# Disable subsequent find_package(absl)
set(absl_FOUND TRUE)

add_subdirectory(third_party/s2geometry)

If that doesn't help, you might have to use ExternalProject_Add for all third-party packages.

@MBkkt
Copy link
Contributor

MBkkt commented Dec 27, 2022

google/s2geometry#285
Also fixed in s2, don't think it's best solution but works for us

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants