chr1shr / voro

Voro++: a three-dimensional Voronoi cell library in C++
Other
154 stars 44 forks source link

CMake fix when library is used in project via FetchContent #19

Closed cbyrohl closed 2 years ago

cbyrohl commented 2 years ago

I use voro++ in a CMake project via something like

FetchContent_Declare(
        VORO
        GIT_REPOSITORY https://github.com/cbyrohl/voro)
FetchContent_MakeAvailable(VORO)
target_link_libraries(PROJECT PRIVATE voro++)

In certain cases, such as building all tests, including those from voro++, the voro++.hh cannot be found. This seems to be fixed by adjusting CMAKE_SOURCE_DIR => CMAKE_CURRENT_SOURCE_DIR.