소스파일
CMakeLists.txt
add_library(): 라이브러리 생성
add_library(<name> [STATIC | SHARED | MODULE]
[EXCLUDE_FROM_ALL]
[<source>...])
Adds a library target called ``<name>`` to be built from the source files
listed in the command invocation. The ``<name>``
corresponds to the logical target name and must be globally unique within
a project. The actual file name of the library built is constructed based
on conventions of the native platform (such as ``lib<name>.a`` or
``<name>.lib``).
target_link_libraries(): 라이브러리 링크
Specify libraries or flags to use when linking a given target and/or
its dependents. :ref:`Usage requirements <Target Usage Requirements>`
from linked library targets will be propagated. Usage requirements
of a target's dependencies affect compilation of its own sources.
Overview
^^^^^^^^
This command has several signatures as detailed in subsections below.
All of them have the general form
target_link_libraries(<target> ... <item>... ...)
The named ``<target>`` must have been created by a command such as
``add_executable()`` or ``add_library()`` and must not be an
:ref:`ALIAS target <Alias Targets>`. If policy ``CMP0079`` is not
set to ``NEW`` then the target must have been created in the current
Library, Executable 만 빌드해보자
$ cmake --build . --target Library
$ cmake --build . --target Executable