[CMake] add_library without source code
cmake.org › pipermail › cmakeJul 27, 2010 · I tried to use add_library only with the library name and too use target_link_libraries to add the libraries of the su-modules, which didn't work. I don't like to have source files in the root directory, so i don't have source files for the commands add_library or add_executable in the root CMakeLists.txt file.
add_library — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpSource files may be listed directly in the add_library call or added later by calls to target_sources() with the PRIVATE or PUBLIC keywords. If an interface library has source files (i.e. the SOURCES target property is set), it will appear in the generated buildsystem as a build target much like a target defined by the add_custom_target() command.