Hi,
So I want to add CGAL v6.1.1 to my cmake/c++ project. For all other libraries, I’m using CPM, so my approach was to do the same with CGAL.
Therefore, I added
CPMAddPackage(
NAME CGAL
GITHUB_REPOSITORY CGAL/cgal
GIT_TAG v6.1.1
OPTIONS
"CGAL_ENABLE_TESTING OFF"
)
to my root cmake and then tried to link it:
# Build Executable
add_executable(Pulsar src/main.cpp ${LIBS_SOURCES})
# Link the executable to the libraries it needs
target_include_directories(Pulsar PRIVATE
src
)
# Link all external dependencies directly
target_link_libraries(Pulsar PRIVATE
spdlog::spdlog
OpenXLSX::OpenXLSX
cxxopts::cxxopts
Eigen3::Eigen
CGAL::CGAL
)
Surprisingly this failed with the following message:
CMake Error at CMakeLists.txt:86 (target_link_libraries):
[cmake] Target "Pulsar" links to:
[cmake]
[cmake] CGAL::CGAL
[cmake]
[cmake] but the target was not found.
I have to admit I don’t understand this. Ok, I know cgal 6.1.1 is a header only thing, but still, this should work, right?
What I really really want to is to avoid and system-wide installation. ![]()
Please help