[CMake] Faking a library

2013-10-16 Thread Magnus Therning
When defining a library via add_library() it's possible to link against it by just putting its name into target_link_libraries(). Is there some way of wrapping up an external library in a similar way? As a concrete example I'm playing around with gtest[1] via externalproject_add() like this:

Re: [CMake] Faking a library

2013-10-16 Thread Robert Maynard
You can create imported libraries with the add_library command using the IMPORTED option. I have very quick example at: https://github.com/robertmaynard/Sandbox/blob/master/ImportedLibrary/CMakeLists.txt On Wed, Oct 16, 2013 at 5:00 PM, Magnus Therning wrote: > When defining a library via add_li

Re: [CMake] Faking a library

2013-10-16 Thread Alexander Neundorf
On Wednesday 16 October 2013, Magnus Therning wrote: > When defining a library via add_library() it's possible to link > against it by just putting its name into target_link_libraries(). Is > there some way of wrapping up an external library in a similar way? > > As a concrete example I'm playing

Re: [CMake] Faking a library

2013-10-18 Thread Magnus Therning
On Wed, Oct 16, 2013 at 11:36:53PM +0200, Alexander Neundorf wrote: > On Wednesday 16 October 2013, Magnus Therning wrote: >> When defining a library via add_library() it's possible to link >> against it by just putting its name into target_link_libraries(). >> Is there some way of wrapping up an e

Re: [CMake] Faking a library

2013-10-19 Thread Игорь Пашев
2013/10/19 Magnus Therning : > Is it possible to put the include path in some property on the library > as well, to avoid using a separate variable for that? SET_TARGET_PROPERTIES (target PROPERTIES ) -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http:

Re: [CMake] Faking a library

2013-10-19 Thread Magnus Therning
On Sat, Oct 19, 2013 at 11:28:53AM +0400, Игорь Пашев wrote: > 2013/10/19 Magnus Therning : > > Is it possible to put the include path in some property on the library > > as well, to avoid using a separate variable for that? > > SET_TARGET_PROPERTIES (target PROPERTIES ) Of course, but then how

Re: [CMake] Faking a library

2013-10-19 Thread Nick Hutchinson
As of 2.8.12, you can set target properties on an imported library to specify its include directories, compile options etc, and these will be automatically propagated to any other target that links to it via target_link_libraries(). No more tedious faffing about with global variables like GTEST_INC

Re: [CMake] Faking a library

2013-10-19 Thread Alexander Neundorf
On Saturday 19 October 2013, you wrote: > On Sat, Oct 19, 2013 at 11:28:53AM +0400, Игорь Пашев wrote: > > 2013/10/19 Magnus Therning : > > > Is it possible to put the include path in some property on the library > > > as well, to avoid using a separate variable for that? > > > > SET_TARGET_PROPER

Re: [CMake] Faking a library

2013-10-19 Thread Magnus Therning
On Sat, Oct 19, 2013 at 08:11:52PM +0100, Nick Hutchinson wrote: > As of 2.8.12, you can set target properties on an imported library > to specify its include directories, compile options etc, and these > will be automatically propagated to any other target that links to > it via target_link_librar