[CMake] How do I search for personal libraries?

Michael Wild themiwi at gmail.com
Wed Apr 3 02:52:53 EDT 2013


You should find this interesting:
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file

In short:
* In project A create a AConfig.cmake file and export your targets
* In project B call find_package(A REQUIRED)

HTH

Michael



On Wed, Apr 3, 2013 at 7:44 AM, Saad Khattak <saadrustam at gmail.com> wrote:

> Hi,
>
> Suppose I have two personal repositories: A and B. Repository B has a
> dependency on repository A i.e. repository A builds multiple libraries and
> repository B builds multiple libraries and executables. I can build 32-bit
> and 64-bit libraries/executables for both by having a 'build' and
> 'buildx64' projects generated by CMake. The libraries and executables are
> put in the default folders (e.g. repoA/build/src/libraryName/Debug and
> repoA/buildx64/src/library/Debug).
>
> Repo B's executables depend on repo A's libraries and libraries in B.
> Linking with libraries within B is straightforward as CMake is able to
> figure out the necessary paths for the libraries B is building which B's
> executables depend on.
>
> Repo B also depends on Repo A's libraries and all executables in B have to
> search for them. How do I go about this? Currently I am searching for each
> library by specifying its path:
>
> # I have a CACHE variable for the path to Repo A's build folder that the
> user must provide
> target_link_libraries(myProject
> repoAPath/build/src/LibName/${CMAKE_CFG_INTDIR})
>
> which feels like a very wrong way to go about linking with other libraries
> considering CMake is supposed to make the finding libraries part easier. I
> would appreciate clarification of the workflow in this case.
>
> Thanks,
> Saad
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130403/45d28a07/attachment-0001.htm>


More information about the CMake mailing list