install(<TYPE>files...DESTINATION[PERMISSIONSpermissions...][CONFIGURATIONS[Debug|Release|...]][COMPONENT<component>][OPTIONAL][NAMELINK_ONLY|NAMELINK_SKIP]) 在这个结构中,我们可以看到以下几个关键部分: <TYPE>:这是一个必选参数,它定义了我们要安装的内容的类型。这个参数可以是TARGETS(目标),FILES(文件...
install(TARGETStargets...[EXPORT<export-name>][RUNTIME_DEPENDENCIESargs...|RUNTIME_DEPENDENCY_SET<set-name>][[ARCHIVE|LIBRARY|RUNTIME|OBJECTS|FRAMEWORK|BUNDLE|PRIVATE_HEADER|PUBLIC_HEADER|RESOURCE|FILE_SET<set-name>][DESTINATION][PERMISSIONSpermissions...][CONFIGURATIONS[Debug|Release|...]][COMPONENT...
INSTALL(DIRECTORY dirs... DESTINATION [FILE_PERMISSIONS permissions...] [DIRECTORY_PERMISSIONS permissions...] [USE_SOURCE_PERMISSIONS] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [[PATTERN <pattern> | REGEX <regex>] [EXCLUDE] [PERMISSIONS permissions...]] [...]) 这里主要...
FILE_PERMISSIONS和DIRECTORY_PERMISSIONS 指定安装之后的权限 PATTERN和REGEX:指定用于过滤的正则表达式,PERMISSIONS用于指定经过滤后的文件权限 安装导出 install(EXPORT <export-name> DESTINATION [NAMESPACE <namespace>] [[FILE <name>.cmake]| [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]]...
install(DIRECTORY icons scripts/ DESTINATION share/myproj PATTERN "CVS" EXCLUDE PATTERN "scripts/*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ) 会将icons路径安装到share/myproject/icons下,同时把scripts目录安装到share/myproj路径下。icons将具备默认的文件权限,scripts将会被...
INSTALL指令包含了各种安装类型,我们需要一个个分开解释: 目标文件的安装: INSTALL(TARGETS targets... [[ARCHIVE|LIBRARY|RUNTIME] [DESTINATION ] [PERMISSIONS permissions...] [CONFIGURATIONS [Debug|Release|...]] [COMPONENT <component>] [OPTIONAL] ] [....
CMake的install命令的基本结构如下: install(<TYPE> files... DESTINATION [PERMISSIONS permissions...][CONFIGURATIONS [Debug|Release|...]][COMPONENT <component>][OPTIONAL] [NAMELINK_ONLY|NAMELINK_SKIP]) 在这个结构中,我们可以看到以下几个关键部分: :这是...
PATTERN用于使用正则表达式进行过滤,PERMISSIONS用于指定PATTERN过滤后的文件权限。 举例: INSTALL(DIRECTORY icons scripts/ DESTINATION share/myproj PATTERN "CVS" EXCLUDE PATTERN "scripts/*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE WONER_READ GROUP+EXECUTE GROUP_READ) 这条指令的执行结果是: 将icons目录安装到<pre...
cmake -DCMAKE_INSTALL_PREFIX=/usr ..[路径] INCLUDE_DIRECTORIES(追加标志 头文件路径) INCLUDE_DIRECTORIES([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...) 向工程添加多个特定的头文件搜索路径,路径之间用空格分隔,如果路径包含空格,可以使用双引号将它括起来。默认的行为是追加到当前头文件搜索路径的后面。有如下...
INSTALL(DIRECTORY icons scripts/ DESTINATION share/myproj PATTERN "CVS" EXCLUDE PATTERN "scripts/*" PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ) 这条指令的执行结果是: 将icons 目录安装到 <prefix>/share/myproj,将 scripts/ 中的内容安装到 ...