[CMake] Build cmake dependency

Pietro Paolini pietro.paolini at cognitivecredit.com
Fri Feb 28 04:18:48 EST 2020


Hi all,

I really cannot say I am an expert with CMake however I have been using 
it for a while now, even though mainly by copying and pasting snippet 
of code from the web therefore not understanding things properly.

I am working on a project which depends on a libary which is itself 
built using CMake, I'd like my project to build the library itself 
during its own build and I can successfully do that by adding the 
folder to the root CMakeLists.txt of my current prject, however I 
couldn't find a way to include its headers and link the shared object.

I had to resort to a bash script which compiles and installs the 
dependency in a pre-defined location and add such location to my 
project's CMake's setting file through the use of 
include_directories()/link_directories(). It works but I'd like to get 
CMake to do what I want and not having to find workaroun, I am pretty 
confident I am missing something here, is there a better way to do that 
?


Thanks,
Pietro




More information about the CMake mailing list