[prev in list] [next in list] [prev in thread] [next in thread]
List: cmake
Subject: Re: [CMake] Scope of imported targets
From: Bill Hoffman <bill.hoffman () kitware ! com>
Date: 2012-07-28 1:20:49
Message-ID: 50133E71.4010000 () kitware ! com
[Download RAW message or body]
On 7/27/2012 7:43 PM, James Bigler wrote:
> Is there are particular reason why imported targets don't have global
> scope (doc says current directory and below), but regular targets do
> (seen everywhere)?
>
> This seems really inconsistent to me.
>
> I'm trying to build a custom library from other pieces using my own set
> of commands. I can't use add_custom_target directly since I can't use
> the resulting target in target_link_libraries. I then found a link
> where it suggested to use add_library(IMPORTED) and set the file with
> the results of my custom target. Unfortunately, this library lives in a
> sub directory and it can't be seen outside like the original library
> used to.
>
> Now, I'm kind of stuck. I want a library type target, but IMPORTED
> doesn't provide the correct scoping (i.e. global).
>
This was fixed in 2.8.8
- Optionally allow IMPORTED targets to be globally visible
Something like this:
add_library(${lib} SHARED IMPORTED GLOBAL)
-Bill
--
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
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic