wo80 / Triangle

CMake project for Jonathan Shewchuk's Triangle mesh generator.
Other
63 stars 26 forks source link

Using triangle as library for other project #27

Open mimre25 opened 6 years ago

mimre25 commented 6 years ago

Hi, I'm not quite sure if this is the right place to post it, but I have a really hard time getting triangle to be included in my project.

I've already made a stackoverflow post (https://stackoverflow.com/questions/48669411/make-cmake-subdirectory-linking-to-external-library-fails/48669542) and am struggling with this since Monday.

I even installed it as system library but that doesn't help either.

It would be really cool if you could take a look.

I'm currently thinking, that the problem is the triangle library itself, and not the way I'm trying to include it, as that works fine for other libraries.

Thanks!

jzarl commented 6 years ago

Linking against triangle from cmake should be pretty straight-forward. In the CMakeLists.txt, write something like this:

find_package(Triangle)
target_link_libraries(your-target Triangle::triangle-api)