In CMake, one can define a target, for example a C or C++ library, with add_library
, with the following syntax:
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
[source1] [source2 ...])
But what are possible kind of sources? They can be .h
or .cxx
files containing code obviously. But they can also be .rc
resources files, or even .obj
object files used by the linker.
So what types of "non-code" are allowed as sources of a target in CMake, depending on the language, target type, platform? The page on SOURCES
is rather uninformative. Is it located somewhere else in the documentation?
Also, can this list of allowed source types be customized and extended, and how?
EDIT
As an example, objects provided as sources of a target are used everywhere in tensorflow's CMake files, for example here.