<div dir="ltr">Build fails at link time, because a static library imported using pkg-config is not in the standard path: <div><br></div><div><div>[ 74%] Linking CXX executable valhalla_add_predicted_traffic</div><div>/usr/bin/c++   ... -lprime_server ...</div></div><div><br></div><div>Usually, cmake uses the absolute path to the static library, but instead, pkg-config provides the library name and the library dir separately. Here is the imported target:</div><div><br></div><div>add_library(libprime_server INTERFACE IMPORTED)</div><div>pkg_check_modules(libprime_server REQUIRED libprime_server>=0.6.3)</div><div>set_target_properties(libprime_server PROPERTIES</div><div>    INTERFACE_LINK_LIBRARIES "${libprime_server_LIBRARIES}"</div><div>    INTERFACE_INCLUDE_DIRECTORIES "${libprime_server_INCLUDE_DIRS}")</div><div><br></div><div>The library dir is defined in the CMakeCache.txt (both in the LDFLAGS in LIBRARY_DIRS): </div><div><br></div><div><div>libprime_server_LDFLAGS:INTERNAL=-L/home/francis/local/lib;-lprime_server</div></div><div><div>libprime_server_LIBRARY_DIRS:INTERNAL=/home/francis/local/lib</div></div><div><br></div><div>However, it seems no property exists to actually specify the library dir of imported target, nor the linker flags to pass when using the imported target.</div><div><br></div><div>What would be the best way to specify the library dir for an imported library?</div><div><br></div><div>Thanks!</div><div><br></div><div>Francis Giraldeau</div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Francis Giraldeau</div></div>