Re: [CMake] How to test for the usability of a target

2013-10-21 Thread Johannes Zarl
On Wednesday, 16. October 2013, 19:45:32, Alexander Neundorf wrote: > On Tuesday 15 October 2013, Johannes Zarl wrote: > > I'd like to make some code in my build system dependent on the existance > > of a target. Basically I'd like to write something like this: > > > > if(TARGET optional_lib) > >

Re: [CMake] How to test for the usability of a target

2013-10-16 Thread Alexander Neundorf
On Tuesday 15 October 2013, Johannes Zarl wrote: > Hi, > > I'd like to make some code in my build system dependent on the existance of > a target. Basically I'd like to write something like this: > > if(TARGET optional_lib) > add_library(bar ${bar_srcs}) > target_link_library(bar optional_lib

Re: [CMake] How to test for the usability of a target

2013-10-16 Thread Johannes Zarl
On Wednesday, 16. October 2013, 01:22:09, Matthew Woehlke wrote: > If you *REALLY* need to know about all your targets before you decide on > linking, then you're going to have to implement multi-pass project > parsing. This is possible - see e.g. VTK - but makes the configuration > process much mo

Re: [CMake] How to test for the usability of a target

2013-10-15 Thread Matthew Woehlke
On 2013-10-15 11:49, Johannes Zarl wrote: I'd like to make some code in my build system dependent on the existance of a target. Basically I'd like to write something like this: if(TARGET optional_lib) add_library(bar ${bar_srcs}) target_link_library(bar optional_lib) endif() The problem I

Re: [CMake] How to test for the usability of a target

2013-10-15 Thread Andreas Mohr
Hi, On Tue, Oct 15, 2013 at 12:00:05PM -0400, cmake-requ...@cmake.org wrote: > Date: Tue, 15 Oct 2013 17:49:40 +0200 > From: Johannes Zarl > Hi, > > I'd like to make some code in my build system dependent on the existance of a > target. Basically I'd like to write something like this: > > if(

[CMake] How to test for the usability of a target

2013-10-15 Thread Johannes Zarl
Hi, I'd like to make some code in my build system dependent on the existance of a target. Basically I'd like to write something like this: if(TARGET optional_lib) add_library(bar ${bar_srcs}) target_link_library(bar optional_lib) endif() The problem I have is that for a couple of reasons th