> Hi all,
>
>      I want to create a library out of several sources distributed in
> various directory structures. It seems, i need to specify name of all
> sources to ADD_LIBRARY command. Is there any other way to do it ?
> Keeping CMakeLists.txt file in every sub directory will really help
> as i need to create library out of all sources not with the sources
> of a single directory?. In this case, however, how to get the list of
> source files in my main CMakeLists.txt file so as to pass this to
> ADD_LIBRARY command. Can anyone out there to help me in this ?

SET(SOURCES foo.cpp bar.cpp PARENT_SCOPE) in each subdirectory and use
those variables in ADD_LIBRARY() in the parent directory. Make sure to
dive into the subdirs before calling ADD_LIBRARY() as those variables
would otherwise be empty.

Eike
_______________________________________________
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

Reply via email to