Re: [CMake] how to modify scope of imported library

2012-03-09 Thread Cong Ma
I just did the same thing as Petr,

Hopefully, we can do it gracefully with 2.8.8.

Thanks~~

On Fri, Mar 9, 2012 at 10:48 AM, Alexander Neundorf  wrote:

> On Friday 09 March 2012, Petr Kmoch wrote:
> > Hi,
> >
> > I was solving a similar problem in our setup at work. The problem was
> > that the parent couldn't know in advance which libraries will be
> > imported by children. Conceptually speaking, I solved this by creating
> > my own set of global properties which contain all necessary details
> > about the libraries imported. These properties are appended to when a
> > child imports a library, and then scanned once more in the parent and
> > imported again:
>
> I need to check, but I think with the upcoming 2.8.8 release there will be
> a
> new GLOBAL option for add_library(.. IMPORTED), to make the imported target
> globally visible.
>
> Alex
> --
>
> 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
>



-- 

*CONG MA *

*skype: cong.ma.curve*

*
*

*CURVE DENTAL*

*A Fresh, Web-based Alternative to Dental Software*

*www.curvedental.com*
--

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

[CMake] how to modify scope of imported library

2012-03-08 Thread Cong Ma
Hi,

Imported library has scope in the directory in which it is created and
below.

If I want to use this library in parent scope, what should I do?

for example,

top CMakeLists.txt

add_subdirectory(sub)
add_executable(myapp main.cpp)
target_link_libraries(myapp imported_lib)

sub CMakeLists.txt

add_library(imported_lib STATIC IMPORTED)

Thanks for your helping~~
-- 

*CONG MA *
--

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