Understanding the CMake
COMPONENTkeyword in theinstallcommandHello there, I recently had a number of questions around the CMake COMPONENT keyword used in the CMake install command and using COMPONENTS in the CMake find_package command.
https://discourse.cmake.org/t/understanding-the-cmake-component-keyword-in-the-install-command/971
为了更好的组织 build 产物
实践效果
install command
-
只安装
lib component
-
安装所有(
NOT CMAKE_INSTALL_COMPONENT条件成立)
cpack
如文章所说,设置 CPACK_COMPONENTS_ALL 即可指定需要打包的组件。
相关资料及理解
@cmake.org: If
COMPONENTis not provided a default component “Unspecified” is created. The default component name may be controlled with the CMAKE_INSTALL_DEFAULT_COMPONENT_NAME variable.