google/s2geometry

After installing s2geometry, CMakeLists.txt failed on "find_package(s2geometry REQUIRED)"

GoroYeh-HRI opened this issue · 3 comments

Hello,
I followed your instructions for installing s2geometry and I confirmed it is installed under /usr/local/include
image
image

However, when I'm trying to use s2geometry in my another Cmake project, in CMakeLists.txt I wrote find_package(s2geometry REQUIRED)
and run cmake ...
The compiler has error about this:
image

Also, once I changed the CMakeLists.txt to be:

include_directories(/usr/local/include/s2)

add_executable(myexe ${SOURCES})

target_link_libraries(myexe s2)

cmake .. worked, but when I run make:
image
Why can't s2geometry find absl?

Any idea on how to resolve this issue?
Thanks,

I'll defer to @jmr since I don't poke at the CMake files much. I'm not sure that we support FindPackage automatically.

jmr commented

What's the goal here? Are you trying to just get something working for yourself, or do you want do distribute a CMakeLists.txt for others to use?

Why can't s2geometry find absl?

The error is from cloud_mapper not finding absl. Did you also make install absl, or also add it to include_directories?

I actually resolved this by writing the CMakeLists.txt as this:
image

Also, I installed everything under /usr/local/include and it's able to find.