Hi

In a library project there are two level of subdirectories that contain modules
to be included into the main library.
In other words, directory lib contains subdirectories foo and bar
Subdirectory foo contains A and B.
Subdirectory bar contains C and D.
All of the objects from A, B, C and D must belong to the library

I understand I can use at the bottom levels A, B, C, D
 add_library() with the OBJECT argument
and I should be able to use add_library() in the top directory
to collect all of the object files from the subdirectories

add_library(... $<TARGET_OBJECTS:some_name> ...)

for each of the sub directories. But the documentation is unclear
about the naming schema to use. What is the syntax/meaning of some_name ?

add_library(... $<TARGET_OBJECTS:foo/A> $<TARGET_OBJECTS:foo/B> $<TARGET_OBJECTS:bar/C> $<TARGET_OBJECTS:bar/D> ...)

Or I need to gather at level foo and bar the objects from bottom layer
and recursively make them go up one level by one level ?

Thanks
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to