Chris Johnson wrote:
> * I do not want to use the add_library(component1 OBJECT
> ${component1_sources}) and add_library(toplevel
> $ ... ) syntax if it can be avoided.
Is the constraint that you want a top-level something like
# All components:
set(components component1 component2)
fore
So a) add_library( OBJECT)
you could add a custom target and rename big to big_part
add_custom_target( big )
add_custom_command( TARGET big
OUTPUT bigl.a
DEPENDS big_part A B
COMMAND ... )
ties you to a platform though
why are you conglo
No, the quoted text is absolutely correct. If you were to do
add_executable(exec ${srcs})
target_link_libraries(exec big)
A and B would be linked in automatically, as CMake tracks the link
dependencies, just as the quote states. This does not mean that libbig.a
contains libA.a and libB.a, only
I know that one cannot link static libraries together; they're just
archives of objects, really. But since CMake abstracts the actual
construction of the library, it could conceivably know how to do the right
thing and collect all the needed objects recursively, as it appears to do
for executables
I have a project which uses a number of libraries, a bit like this:
CMakeLists.txt -> add_subdirectories, add_executable
Lib1 -> add_library
Lib2 -> add_library, links to/uses Lib1
As the libraries are individually useful I'd like to keep them individually
buildable (i.e., out-of-tree). Obviousl
Sorry overread the last point in your mail. I don’t believe there is a way to
avoid this directly. What you seem to want is what Xcode calls a prelinked
library (http://cocoadev.com/SingleObjectPrelink) . CMake does not have such an
option as far as I know
--
Johannes S. Mueller-Roemer, MSc
Wis
In the example on that site an OBJECT library is created (the output consists
of multiple .obj files), you used STATIC libraries instead (which each output a
single .lib)
--
Johannes S. Mueller-Roemer, MSc
Wiss. Mitarbeiter - Interactive Engineering Technologies (IET)
Fraunhofer-Institut für Gr