[CMake] Get find_package to choose INSTALLed libraries instead of libraries in the build folder

Saad Khattak saadrustam at gmail.com
Fri Jan 12 18:12:08 EST 2018


Thank you Marc.

That's interesting, I was not aware that they were relinked. I thought they
were just copied.

I guess I'll have to provide the install directory to pick the libraries
found in the install directory instead of the build directory?

Regards,
Saad

On Fri, Jan 12, 2018 at 2:57 AM CHEVRIER, Marc <marc.chevrier at sap.com>
wrote:

> Hi,
>
>
>
> During install step, installed libraries and executables are relinked to
> generate binaries without absolute paths so installed artifacts are
> independent from your build tree.
>
>
>
> During build step, build binaries are used as well as absolute paths so
> produced binaries can be used during build step (i.e. launching an
> executable produced) without requirements regarding paths settings (i.e.
> PATH or LD_LIBRARY_PATH).
>
>
>
>
>
> *From: *CMake <cmake-bounces at cmake.org> on behalf of Saad Khattak <
> saadrustam at gmail.com>
> *Date: *Thursday 11 January 2018 at 19:44
> *To: *Cmake Mailing List <cmake at cmake.org>
> *Subject: *[CMake] Get find_package to choose INSTALLed libraries instead
> of libraries in the build folder
>
>
>
> Hi,
>
>
>
> I would like find_package(MyLib) to link find the libraries found in the
> INSTALL folder instead of the build folder.
>
>
>
> Currently, when I do a find_package(MyLib) and then
> target_link_libraries(target MyLib) the paths all point to MyLib's build
> folder and not the folder where MyLib's library/headers were installed.
>
>
>
> Thank you,
>
> Saad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180112/66d4ea96/attachment.html>


More information about the CMake mailing list