c++ - Cmake: how to mark library as dependent on a system library -
i have c++ library dependent on linux system library util. can compile library g++ command "g++ lib.cpp -lutil", , compiles fine.
when added library our larger project when ran troubles. can go each target includes our library , use 'target_link_libraries' command have include util. problem there many targets depend on library. better if edit cmakelists.txt of library , depends on util. can't find way of doing that.
is possible mark library being dependent on util, target including library link in util?
all have link library lib util using target_link_libraries. whenever other targets (executables or libraries) link lib linked util.
Comments
Post a Comment