[CMake] Finding internal libraries

Petr Kmoch petr.kmoch at gmail.com
Mon Jul 13 03:26:10 EDT 2015


Hi John.

I have no first-hand experience with it, but I believe the ExternalProject
module could be just what you're looking for (
http://www.cmake.org/cmake/help/v3.2/module/ExternalProject.html ). It
allows you to configure and build several projects at build time under a
CMake "superbuild" master project, while the "subprojects" themselves
remain unaware of this setup.

Petr

On Thu, Jul 9, 2015 at 5:18 PM, John LaGrone <jlagrone at smu.edu> wrote:

> On 07/08/2015 06:52 PM, cmake-request at cmake.org wrote:
>
>  cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
>>> project(ex1)
>>> find_package(foo REQUIRED)
>>> add_executable(ex1.x ex1.c)
>>> target_link_libraries(ex1.x foo)
>>>
>>
>> I don't understand. Does building the examples and lib (ie, 'everything')
>> together work or not?
>>
>> Thanks,
>>
>> Steve.
>>
>
> If I remove the "find_package(foo REQUIRED)" line or don't make it
> required, everything compiles. With the find_package command in place, the
> build fails at the configuration stage because it cannot find the package
> foo since it has not been built/installed. I think this makes perfect
> sense, but was wondering if there was a way to keep the find_package
> commands in the examples because it more accurately reflects a typical
> usage and hence makes for a better example.
>
> Thanks,
> John
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150713/e68304a4/attachment.html>


More information about the CMake mailing list