install(DIRECTORY dirs... TYPE <type> | DESTINATION <dir> [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [OPTIONAL] [MESSAGE_NEVER] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [EXCLUDE_FROM_ALL] [FILES_MATCHING] [[PATTERN <...
INSTALL的这个版本用来安装不是目标的程序,比如shell脚本。使用TARGETS格式安装该工程内部构建的目标。 DIRECTORY版本的install命令 install(DIRECTORY dirs... DESTINATION <dir> [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [OPTIONAL] [CONFIGURATIONS [Debug|Releas...
${CMAKE_INSTALL_PREFIX}/<DESTINATION 定义的路径> 第二种,普通文件的安装 install(<FILES|PROGRAMS> files... DESTINATION <dir> [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [RENAME <name>] [OPTIONAL]) 1. 2. 3. 4. 5. 可用于安装一般文件,并可以...
INSTALL(DIRECTORY dirs... DESTINATION <dir> [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [[PATTERN <pattern> | REGEX <regex>] [EXCLUDE] [PERMISSIONS permissions...]] [...]) 这...
file(<COPY|INSTALL> <files>... DESTINATION <dir> [FILE_PERMISSIONS <permissions>...] [DIRECTORY_PERMISSIONS <permissions>...] [NO_SOURCE_PERMISSIONS] [USE_SOURCE_PERMISSIONS] [FOLLOW_SYMLINK_CHAIN] [FILES_MATCHING] [[PATTERN <pattern> | REGEX <regex>] ...
install(DIRECTORY${STAGED_INSTALL_PREFIX}/DESTINATION.USE_SOURCE_PERMISSIONS) 我们使用SCRIPT参数声明一个额外的安装规则。CMake 脚本install_hook.cmake将被执行,但仅限于 GNU/Linux 和 macOS。该脚本将打印已安装可执行文件的RPATH并运行它。我们将在下一节中详细讨论这一点: ...
[<source>...]) 使用样例: add_library(opencv_core SHARED IMPORTED) (16) configure_file 含义:将文件复制到另一个位置并修改其内容。 语法: configure_file(<input> <output> [NO_SOURCE_PERMISSIONS | USE_SOURCE_PERMISSIONS | FILE_PERMISSIONS <permissions>...]) 使用样例: configure_file(CMakeLists...
动态库 mylib 安装到${CMAKE_INSTALL_PREFIX}/lib 目录 ; 静态库 mystaticlib 安装到${CMAKE_INSTALL_PREFIX}/libstatic 目录 。 1)普通文件的安装: INSTALL(FILES files... DESTINATION <dir> [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]] ...
PROJECT_BINARY_DIR:运行cmake命令的目录。笔者建议定义为${PROJECT_SOURCE_DIR}/build下。具体原因见后文外部编译部分; CMAKE_INCLUDE_PATH:环境变量,非cmake变量; CMAKE_LIBRARY_PATH:环境变量; CMAKE_CURRENT_SOURCE_DIR:当前处理的CMakeLists.txt文件所在路径; ...
INSTALL(DIRECTORY dirs... DESTINATION <dir> [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [[PATTERN <pattern> | REGEX <regex>] ...