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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -