Is there a way to get the names of all add_library()
calls? E.g.
add_library(lib1
some.cpp
)
add_library(lib2
some.cpp
)
add_library(lib3
some.cpp
)
# And then somehow get in a variable MY_LIBRARIES_NAMES = lib1 lib2 lib3
Is there any cmake call or variable that does that? (I am interested in cmake version 2.8 if it matters)
Thanks!
In newer versions of CMake (>= version 3.7) that would be the
BUILDSYSTEM_TARGETS
directory property:For older versions of CMake you could overwrite the
add_library()
call to collect a list of targets:References