<p dir="ltr">"John Barbero Unenge" <<a href="mailto:john.barbero.unenge@gmail.com">john.barbero.unenge@gmail.com</a>> wrote:<br>
><br>
> I'm tearing my hair out about how to include thrid party libraries in my cmake project. Currently I build Poco and a bunch of others that all generate their respective <LibName>Config.cmake which I use with find_package. I have a wrapping build script that builds all of my dependencies and package them separately for debug and release ...<br>
><br>
> I thought I could just do:<br>
><br>
> find_package(Foo<br>
>             HINTS "${CMAKE_SOURCE_DIR}/some/path/debug/libFoo/lib/cmake"<br>
>             REQUIRED<br>
> )<br>
> get_target_property(LIB_FOO_DEBUG lib_foo LOCATION)<br>
><br>
> find_package(Foo<br>
>             HINTS "${CMAKE_SOURCE_DIR}/some/path/release/libFoo/lib/cmake"<br>
>             REQUIRED<br>
> )<br>
> get_target_property(LIB_FOO_RELEASE lib_foo LOCATION)<br>
><br>
> set(LIB_FOO_LIBRARIES optimized "${LIB_FOO_RELEASE}" debug "${LIB_FOO_DEBUG}")<br>
><br>
> message("LIB_FOO_LIBRARIES: \"${LIB_FOO_LIBRARIES}\"")<br>
> # Gives: LIB_FOO_LIBRARIES: "optimized;C:/path/to/proj/some/path/debug/libFoo/lib/foo.lib;debug;C:/path/to/proj/some/path/debug/libFoo/lib/foo.lib"<br>
><br>
> It seems like the first call to find_package for target Foo is cached, whis I don't really want.<br>
><br>
> Am I going about this the wrong way? How do I properly work with 3rd party libraries with the Visual Studio generator?<br>
><br>
> Any pointers are greatly appreciated.</p>
<p dir="ltr">Qt seems to manage it, if I'm reading <br>
<a href="http://doc.qt.io/qt-5/cmake-manual.html">http://doc.qt.io/qt-5/cmake-manual.html</a><br>
right.  Maybe you can find a clue there.<br>
</p>