[CMake] Finding internal libraries

John LaGrone jlagrone at smu.edu
Thu Jul 9 11:18:43 EDT 2015


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



More information about the CMake mailing list