I am working on an already build shared library.

When I run cmake -C $ILCSOFT/ILCSoft.cmake the output says at somepoint:

-- Check for FastJet (3.1.2)
-- Check for FastJet_LIBRARIES: fastjet
-- Check for FastJet_FASTJET_LIBRARY: /cvmfs/foo...bar/FastJet/3.1.2/lib/libfastjet.so -- ok
-- /cvmfs/foo...bar/v01-17-09/FastJet/3.1.2;

But when I run make install my cc file fails at #include "fastjet/ClusterSequence.hh".

Which means I am not setting up my cmake properly. Right now I am trying to add my fastjet dependency by doing in my CMakeLists.txt:


No errors are thrown, but I cannot import the stuff I want.

I don't think I understand cmake, make and cpp imports for that matter. Could anyone help me?

How do I import a this large library into my cmake?


If it’s chocking at the include stage it’s finding the include directories that’s the problem, not the actual location of a compiles library. From the cmake docs, so try adding where that libraries headers are.


Add include directories to the build.

include_directories([AFTER|BEFORE] [SYSTEM] dir1 [dir2 ...])

Add the given directories to those the compiler uses to search for include files. Relative paths are interpreted as relative to the current source directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.