cmake_parser/doc/command/project/
install.rs

1use cmake_parser_derive::CMake;
2
3use crate::{
4    command::common::{FileMatch, Permission},
5    doc::command_scope::{CommandScope, ToCommandScope},
6    Token,
7};
8
9/// Specify rules to run at install time.
10///
11/// Reference: <https://cmake.org/cmake/help/v3.26/command/install.html>
12#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
13#[cmake(pkg = "crate")]
14pub enum Install<'t> {
15    Targets(TargetsInstall<'t>),
16    ImportedRuntimeArtifacts(ImportedRuntimeArtifactsInstall<'t>),
17    #[cmake(transparent)]
18    Files(FilesInstall<'t>),
19    #[cmake(transparent)]
20    Programs(FilesInstall<'t>),
21    Directory(DirectoryInstall<'t>),
22    Script(ScriptInstall<'t>),
23    Code(ScriptInstall<'t>),
24    #[cmake(transparent)]
25    Export(ExportInstall<'t>),
26    #[cmake(transparent)]
27    ExportAndroidMk(ExportInstall<'t>),
28    RuntimeDependencySet(RuntimeDependencySetInstall<'t>),
29}
30
31impl<'t> ToCommandScope for Install<'t> {
32    fn to_command_scope(&self) -> CommandScope {
33        CommandScope::Project
34    }
35}
36
37#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
38#[cmake(pkg = "crate")]
39pub struct TargetsInstall<'t> {
40    pub targets: Vec<Token<'t>>,
41    pub export: Option<Token<'t>>,
42    pub runtime_dependency: Option<RuntimeDependency<'t>>,
43    pub output_artifacts: Option<Vec<OutputArtifactTargets<'t>>>,
44    pub includes: Option<IncludesDestination<'t>>,
45}
46
47#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
48#[cmake(pkg = "crate")]
49pub struct ImportedRuntimeArtifactsInstall<'t> {
50    pub imported_runtime_artifacts: Vec<Token<'t>>,
51    pub runtime_dependency_set: Option<RuntimeDependencySet<'t>>,
52    pub output_artifacts: Option<Vec<OutputArtifactImportedRuntimeArtifacts<'t>>>,
53}
54
55#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
56#[cmake(pkg = "crate", default = "files")]
57pub struct FilesInstall<'t> {
58    #[cmake(rename = "")]
59    pub files: Vec<Token<'t>>,
60    pub kind: InstallKind<'t>,
61    pub permissions: Option<Vec<Permission>>,
62    pub configurations: Option<Vec<Token<'t>>>,
63    pub component: Option<Token<'t>>,
64    pub rename: Option<Token<'t>>,
65    pub optional: bool,
66    pub exclude_from_all: bool,
67}
68
69#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
70#[cmake(pkg = "crate")]
71pub struct DirectoryInstall<'t> {
72    #[cmake(rename = "DIRECTORY")]
73    pub dirs: Vec<Token<'t>>,
74    pub kind: InstallKind<'t>,
75    pub file_permissions: Option<Vec<Permission>>,
76    pub directory_permissions: Option<Vec<Permission>>,
77    pub use_source_permissions: bool,
78    pub optional: bool,
79    pub message_never: bool,
80    pub configurations: Option<Vec<Token<'t>>>,
81    pub component: Option<Token<'t>>,
82    pub files_matching: bool,
83    pub file_matches: Option<Vec<FileMatch<'t>>>,
84}
85
86#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
87#[cmake(pkg = "crate", default = "scripts")]
88pub struct ScriptInstall<'t> {
89    #[cmake(rename = "")]
90    pub scripts: Vec<ScriptKind<'t>>,
91    pub component: Option<ScriptComponent<'t>>,
92    pub exclude_from_all: bool,
93}
94
95#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
96#[cmake(pkg = "crate")]
97pub struct ExportInstall<'t> {
98    #[cmake(positional)]
99    pub export_name: Token<'t>,
100    pub destination: Token<'t>,
101    pub namespace: Option<Token<'t>>,
102    pub file: Option<Token<'t>>,
103    pub permissions: Option<Vec<Permission>>,
104    pub configurations: Option<Vec<Token<'t>>>,
105    pub cxx_modules_directory: Option<Token<'t>>,
106    pub export_link_interface_libraries: bool,
107    pub component: Option<Token<'t>>,
108    pub exclude_from_all: bool,
109}
110
111#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
112#[cmake(pkg = "crate")]
113pub struct RuntimeDependencySetInstall<'t> {
114    #[cmake(rename = "RUNTIME_DEPENDENCY_SET")]
115    pub set_name: Token<'t>,
116    pub runtime_dependency_sets: Option<Vec<Dependency<'t>>>,
117    pub pre_include_regexes: Option<Vec<Token<'t>>>,
118    pub pre_exclude_regexes: Option<Vec<Token<'t>>>,
119    pub post_include_regexes: Option<Vec<Token<'t>>>,
120    pub post_exclude_regexes: Option<Vec<Token<'t>>>,
121    pub post_include_files: Option<Vec<Token<'t>>>,
122    pub post_exclude_files: Option<Vec<Token<'t>>>,
123    pub directories: Option<Vec<Token<'t>>>,
124}
125
126#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
127#[cmake(pkg = "crate", match_fields)]
128pub struct Dependency<'t> {
129    pub kind: Option<DependencyKind>,
130    pub destination: Option<Token<'t>>,
131    pub permissions: Option<Vec<Permission>>,
132    pub configurations: Option<Vec<Token<'t>>>,
133    pub component: Option<Token<'t>>,
134    pub namelink_component: Option<Token<'t>>,
135    pub optional: bool,
136    pub exclude_from_all: bool,
137}
138
139#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
140#[cmake(pkg = "crate")]
141pub enum DependencyKind {
142    Library,
143    Runtime,
144    Framework,
145}
146
147#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
148#[cmake(pkg = "crate", transparent)]
149pub enum ScriptKind<'t> {
150    Script(Token<'t>),
151    Code(Token<'t>),
152}
153
154#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
155#[cmake(pkg = "crate", transparent)]
156pub enum ScriptComponent<'t> {
157    AllComponents,
158    Component(Token<'t>),
159}
160
161#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
162#[cmake(pkg = "crate", transparent)]
163pub enum RuntimeDependency<'t> {
164    RuntimeDependencies(RuntimeDependencies<'t>),
165    RuntimeDependencySet(RuntimeDependencySet<'t>),
166}
167
168#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
169#[cmake(pkg = "crate", transparent)]
170pub enum InstallKind<'t> {
171    Type(InstallKindType),
172    Destination(Token<'t>),
173}
174
175#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
176#[cmake(pkg = "crate")]
177pub enum InstallKindType {
178    Bin,
179    Sbin,
180    Lib,
181    Include,
182    #[cmake(rename = "SYSCONF")]
183    SysConf,
184    #[cmake(rename = "SHAREDSTATE")]
185    SharedState,
186    #[cmake(rename = "LOCALSTATE")]
187    LocalState,
188    #[cmake(rename = "RUNSTATE")]
189    RunState,
190    Data,
191    Info,
192    Locale,
193    Man,
194    Doc,
195}
196
197#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
198#[cmake(pkg = "crate", positional)]
199pub struct RuntimeDependencies<'t> {
200    pub deps: Vec<Token<'t>>,
201}
202
203#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
204#[cmake(pkg = "crate", positional)]
205pub struct RuntimeDependencySet<'t> {
206    pub set_name: Token<'t>,
207}
208
209#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
210#[cmake(pkg = "crate", match_fields)]
211pub struct OutputArtifactTargets<'t> {
212    pub kind: Option<ArtifactKindTargets<'t>>,
213    pub destination: Option<Token<'t>>,
214    pub permissions: Option<Vec<Permission>>,
215    pub configurations: Option<Vec<Token<'t>>>,
216    pub component: Option<Token<'t>>,
217    pub namelink_component: Option<Token<'t>>,
218    pub optional: bool,
219    pub exclude_from_all: bool,
220    pub namelink: Option<Namelink>,
221}
222
223#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
224#[cmake(pkg = "crate", match_fields)]
225pub struct OutputArtifactImportedRuntimeArtifacts<'t> {
226    pub kind: Option<ArtifactKindImportedRuntimeArtifacts>,
227    pub destination: Option<Token<'t>>,
228    pub permissions: Option<Vec<Permission>>,
229    pub configurations: Option<Vec<Token<'t>>>,
230    pub component: Option<Token<'t>>,
231    pub optional: bool,
232    pub exclude_from_all: bool,
233}
234
235#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
236#[cmake(pkg = "crate")]
237pub enum ArtifactKindTargets<'t> {
238    Archive,
239    Library,
240    Runtime,
241    Objects,
242    Framework,
243    Bundle,
244    PrivateHeader,
245    PublicHeader,
246    Resource,
247    #[cmake(transparent)]
248    FileSet(Token<'t>),
249    CssModulesBmi,
250}
251
252#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
253#[cmake(pkg = "crate")]
254pub enum ArtifactKindImportedRuntimeArtifacts {
255    Library,
256    Runtime,
257    Framework,
258    Bundle,
259}
260
261#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
262#[cmake(pkg = "crate")]
263pub enum Namelink {
264    NamelinkOnly,
265    NamelinkSkip,
266}
267
268#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
269pub struct IncludesDestination<'t> {
270    dirs: Option<Vec<Token<'t>>>,
271}
272
273impl<'t> crate::CMakeParse<'t> for IncludesDestination<'t> {
274    fn matches_type(_: &[u8], keyword: &[u8], tokens: &[Token<'t>]) -> bool {
275        keyword == b"INCLUDES" && tokens.first().map(|x| x.as_bytes()) == Some(b"DESTINATION")
276    }
277
278    fn need_push_keyword(_: &Token<'t>) -> bool {
279        false
280    }
281
282    fn rest<'tv>(tokens: &'tv [Token<'t>]) -> &'tv [Token<'t>] {
283        &tokens[1..]
284    }
285
286    fn parse<'tv>(
287        tokens: &'tv [Token<'t>],
288    ) -> Result<(Self, &'tv [Token<'t>]), crate::CommandParseError> {
289        crate::CMakeParse::parse(tokens).map(|(dirs, tokens)| (Self { dirs }, tokens))
290    }
291}
292
293#[cfg(test)]
294mod tests {
295    use super::*;
296    use crate::command::common::FileMatchKind;
297    use crate::doc::cmake_parse::tests::{quoted_token, quoted_tokens_vec, token, tokens_vec};
298    use crate::*;
299    use pretty_assertions::assert_eq;
300
301    #[test]
302    fn install() {
303        let src = include_bytes!("../../../../../fixture/commands/project/install");
304        let cmakelists = parse_cmakelists(src).unwrap();
305        let doc = Doc::from(cmakelists);
306        assert_eq!(
307            doc.commands(),
308            Ok(vec![
309                Command::Install(Box::new(Install::Files(FilesInstall {
310                    files: tokens_vec([b"${LIBXML2_HDRS}"]),
311                    kind: InstallKind::Destination(token(
312                        b"${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml"
313                    )),
314                    permissions: None,
315                    configurations: None,
316                    component: Some(token(b"development")),
317                    rename: None,
318                    optional: false,
319                    exclude_from_all: false,
320                }))),
321                Command::Install(Box::new(Install::Targets(TargetsInstall {
322                    targets: tokens_vec([b"LibXml2"]),
323                    export: Some(token(b"LibXml2")),
324                    runtime_dependency: None,
325                    output_artifacts: Some(vec![
326                        OutputArtifactTargets {
327                            kind: Some(ArtifactKindTargets::Archive),
328                            destination: Some(token(b"${CMAKE_INSTALL_LIBDIR}")),
329                            permissions: None,
330                            configurations: None,
331                            component: Some(token(b"development")),
332                            namelink_component: None,
333                            optional: false,
334                            exclude_from_all: false,
335                            namelink: None
336                        },
337                        OutputArtifactTargets {
338                            kind: Some(ArtifactKindTargets::Library),
339                            destination: Some(token(b"${CMAKE_INSTALL_LIBDIR}")),
340                            permissions: None,
341                            configurations: None,
342                            component: Some(token(b"runtime")),
343                            namelink_component: Some(token(b"development")),
344                            optional: false,
345                            exclude_from_all: false,
346                            namelink: None
347                        },
348                        OutputArtifactTargets {
349                            kind: Some(ArtifactKindTargets::Runtime),
350                            destination: Some(token(b"${CMAKE_INSTALL_BINDIR}")),
351                            permissions: None,
352                            configurations: None,
353                            component: Some(token(b"runtime")),
354                            namelink_component: None,
355                            optional: false,
356                            exclude_from_all: false,
357                            namelink: None
358                        },
359                    ]),
360                    includes: Some(IncludesDestination {
361                        dirs: Some(tokens_vec([b"qqq"]))
362                    }),
363                }))),
364                Command::Install(Box::new(Install::Programs(FilesInstall {
365                    files: tokens_vec([b"$<TARGET_PDB_FILE:LibXml2>"]),
366                    kind: InstallKind::Type(InstallKindType::Sbin),
367                    permissions: None,
368                    configurations: Some(tokens_vec([b"Debug", b"RelWithDebInfo"])),
369                    component: Some(token(b"debug")),
370                    rename: None,
371                    optional: false,
372                    exclude_from_all: false,
373                }))),
374                Command::Install(Box::new(Install::Targets(TargetsInstall {
375                    targets: tokens_vec([b"mylib"]),
376                    export: None,
377                    runtime_dependency: None,
378                    output_artifacts: Some(vec![OutputArtifactTargets {
379                        kind: Some(ArtifactKindTargets::PublicHeader),
380                        destination: Some(token(b"${CMAKE_INSTALL_INCLUDEDIR}/myproj")),
381                        permissions: None,
382                        configurations: None,
383                        component: None,
384                        namelink_component: None,
385                        optional: false,
386                        exclude_from_all: false,
387                        namelink: None
388                    },]),
389                    includes: None,
390                }))),
391                Command::Install(Box::new(Install::Targets(TargetsInstall {
392                    targets: tokens_vec([b"mylib"]),
393                    export: None,
394                    runtime_dependency: None,
395                    output_artifacts: Some(vec![
396                        OutputArtifactTargets {
397                            kind: Some(ArtifactKindTargets::Library),
398                            destination: None,
399                            permissions: None,
400                            configurations: None,
401                            component: Some(token(b"Libraries")),
402                            namelink_component: Some(token(b"Development")),
403                            optional: false,
404                            exclude_from_all: false,
405                            namelink: None
406                        },
407                        OutputArtifactTargets {
408                            kind: Some(ArtifactKindTargets::PublicHeader),
409                            destination: None,
410                            permissions: None,
411                            configurations: None,
412                            component: Some(token(b"Development")),
413                            namelink_component: None,
414                            optional: false,
415                            exclude_from_all: false,
416                            namelink: None
417                        },
418                    ]),
419                    includes: None,
420                }))),
421                Command::Install(Box::new(Install::Targets(TargetsInstall {
422                    targets: tokens_vec([b"myExe", b"mySharedLib", b"myStaticLib"]),
423                    export: None,
424                    runtime_dependency: None,
425                    output_artifacts: Some(vec![
426                        OutputArtifactTargets {
427                            kind: Some(ArtifactKindTargets::Runtime),
428                            destination: Some(token(b"bin")),
429                            permissions: None,
430                            configurations: None,
431                            component: None,
432                            namelink_component: None,
433                            optional: false,
434                            exclude_from_all: false,
435                            namelink: None
436                        },
437                        OutputArtifactTargets {
438                            kind: Some(ArtifactKindTargets::Library),
439                            destination: Some(token(b"lib")),
440                            permissions: None,
441                            configurations: None,
442                            component: None,
443                            namelink_component: None,
444                            optional: false,
445                            exclude_from_all: false,
446                            namelink: None
447                        },
448                        OutputArtifactTargets {
449                            kind: Some(ArtifactKindTargets::Archive),
450                            destination: Some(token(b"lib/static")),
451                            permissions: None,
452                            configurations: None,
453                            component: None,
454                            namelink_component: None,
455                            optional: false,
456                            exclude_from_all: false,
457                            namelink: None
458                        },
459                    ]),
460                    includes: None,
461                }))),
462                Command::Install(Box::new(Install::Targets(TargetsInstall {
463                    targets: tokens_vec([b"mySharedLib"]),
464                    export: None,
465                    runtime_dependency: None,
466                    output_artifacts: Some(vec![OutputArtifactTargets {
467                        kind: None,
468                        destination: Some(token(b"/some/full/path")),
469                        permissions: None,
470                        configurations: None,
471                        component: None,
472                        namelink_component: None,
473                        optional: false,
474                        exclude_from_all: false,
475                        namelink: None
476                    },]),
477                    includes: None,
478                }))),
479                Command::Install(Box::new(Install::ImportedRuntimeArtifacts(
480                    ImportedRuntimeArtifactsInstall {
481                        imported_runtime_artifacts: tokens_vec([b"${TBB_IMPORTED_TARGETS}"]),
482                        runtime_dependency_set: Some(RuntimeDependencySet {
483                            set_name: token(b"set-name"),
484                        },),
485                        output_artifacts: Some(vec![
486                            OutputArtifactImportedRuntimeArtifacts {
487                                kind: Some(ArtifactKindImportedRuntimeArtifacts::Library),
488                                destination: Some(token(b"${CMAKE_INSTALL_LIBDIR}")),
489                                permissions: None,
490                                configurations: None,
491                                component: None,
492                                optional: false,
493                                exclude_from_all: false,
494                            },
495                            OutputArtifactImportedRuntimeArtifacts {
496                                kind: Some(ArtifactKindImportedRuntimeArtifacts::Runtime),
497                                destination: Some(token(b"${CMAKE_INSTALL_BINDIR}")),
498                                permissions: None,
499                                configurations: None,
500                                component: None,
501                                optional: false,
502                                exclude_from_all: false,
503                            },
504                        ]),
505                    }
506                ))),
507                Command::Install(Box::new(Install::Directory(DirectoryInstall {
508                    dirs: tokens_vec([b"src/"]),
509                    kind: InstallKind::Destination(token(b"doc/myproj")),
510                    file_permissions: None,
511                    directory_permissions: None,
512                    use_source_permissions: false,
513                    optional: false,
514                    message_never: false,
515                    configurations: None,
516                    component: None,
517                    files_matching: true,
518                    file_matches: Some(vec![FileMatch {
519                        kind: Some(FileMatchKind::Pattern(quoted_token(b"*.png"),),),
520                        exclude: false,
521                        permissions: None,
522                    },],),
523                }))),
524                Command::Install(Box::new(Install::Directory(DirectoryInstall {
525                    dirs: tokens_vec([b"icons", b"scripts/"]),
526                    kind: InstallKind::Destination(token(b"share/myproj")),
527                    file_permissions: None,
528                    directory_permissions: None,
529                    use_source_permissions: false,
530                    optional: false,
531                    message_never: false,
532                    configurations: None,
533                    component: None,
534                    files_matching: false,
535                    file_matches: Some(vec![
536                        FileMatch {
537                            kind: Some(FileMatchKind::Pattern(quoted_token(b"CVS"),),),
538                            exclude: true,
539                            permissions: None,
540                        },
541                        FileMatch {
542                            kind: Some(FileMatchKind::Pattern(quoted_token(b"scripts/*"),),),
543                            exclude: false,
544                            permissions: Some(vec![
545                                Permission::OwnerExecute,
546                                Permission::OwnerWrite,
547                                Permission::OwnerRead,
548                                Permission::GroupExecute,
549                                Permission::GroupRead,
550                            ]),
551                        },
552                    ],),
553                }))),
554                Command::Install(Box::new(Install::Code(ScriptInstall {
555                    scripts: vec![
556                        ScriptKind::Code(token(
557                            b"message(STATUS \"HERE: ${CMAKE_INSTALL_PREFIX}\")"
558                        )),
559                        ScriptKind::Script(token(
560                            b"message(STATUS \"HERE: ${CMAKE_INSTALL_PREFIX}\")"
561                        )),
562                    ],
563                    component: Some(ScriptComponent::Component(token(b"qqq"))),
564                    exclude_from_all: false,
565                }))),
566                Command::Install(Box::new(Install::Script(ScriptInstall {
567                    scripts: vec![
568                        ScriptKind::Script(token(
569                            b"message(STATUS \"HERE: ${CMAKE_INSTALL_PREFIX}\")"
570                        )),
571                        ScriptKind::Code(token(
572                            b"message(STATUS \"HERE: ${CMAKE_INSTALL_PREFIX}\")"
573                        )),
574                    ],
575                    component: Some(ScriptComponent::AllComponents),
576                    exclude_from_all: true,
577                }))),
578                Command::Install(Box::new(Install::Export(ExportInstall {
579                    export_name: token(b"myproj"),
580                    destination: token(b"lib/myproj"),
581                    namespace: Some(token(b"mp_")),
582                    file: None,
583                    permissions: None,
584                    configurations: None,
585                    cxx_modules_directory: None,
586                    export_link_interface_libraries: false,
587                    component: None,
588                    exclude_from_all: false
589                }))),
590                Command::Install(Box::new(Install::ExportAndroidMk(ExportInstall {
591                    export_name: token(b"myproj"),
592                    destination: token(b"share/ndk-modules"),
593                    namespace: None,
594                    file: None,
595                    permissions: None,
596                    configurations: None,
597                    cxx_modules_directory: None,
598                    export_link_interface_libraries: false,
599                    component: None,
600                    exclude_from_all: false
601                }))),
602                Command::Install(Box::new(Install::RuntimeDependencySet(
603                    RuntimeDependencySetInstall {
604                        set_name: token(b"myset"),
605                        runtime_dependency_sets: None,
606                        pre_include_regexes: Some(quoted_tokens_vec([b"dep[134]"])),
607                        pre_exclude_regexes: Some(quoted_tokens_vec([b".*"])),
608                        post_include_regexes: Some(quoted_tokens_vec([b"dep[13]"])),
609                        post_exclude_regexes: Some(quoted_tokens_vec([b"dep[34]"])),
610                        post_include_files: None,
611                        post_exclude_files: None,
612                        directories: Some(quoted_tokens_vec([b"$<TARGET_FILE_DIR:dep1>"])),
613                    }
614                ))),
615                Command::Install(Box::new(Install::RuntimeDependencySet(
616                    RuntimeDependencySetInstall {
617                        set_name: token(b"myset"),
618                        runtime_dependency_sets: Some(vec![
619                            Dependency {
620                                kind: Some(DependencyKind::Runtime),
621                                destination: Some(token(b"yyy/bin")),
622                                permissions: None,
623                                configurations: None,
624                                component: None,
625                                namelink_component: None,
626                                optional: false,
627                                exclude_from_all: false,
628                            },
629                            Dependency {
630                                kind: Some(DependencyKind::Library),
631                                destination: Some(token(b"yyy/lib")),
632                                permissions: None,
633                                configurations: None,
634                                component: None,
635                                namelink_component: None,
636                                optional: false,
637                                exclude_from_all: false,
638                            },
639                        ]),
640                        pre_include_regexes: Some(quoted_tokens_vec([b"dep[134]"])),
641                        pre_exclude_regexes: Some(quoted_tokens_vec([b".*"])),
642                        post_include_regexes: None,
643                        post_exclude_regexes: None,
644                        post_include_files: None,
645                        post_exclude_files: None,
646                        directories: Some(quoted_tokens_vec([b"$<TARGET_FILE_DIR:dep1>"])),
647                    }
648                ))),
649                Command::Install(Box::new(Install::RuntimeDependencySet(
650                    RuntimeDependencySetInstall {
651                        set_name: token(b"myset"),
652                        runtime_dependency_sets: Some(vec![Dependency {
653                            kind: None,
654                            destination: Some(token(b"zzz")),
655                            permissions: None,
656                            configurations: None,
657                            component: None,
658                            namelink_component: None,
659                            optional: false,
660                            exclude_from_all: false,
661                        },]),
662                        pre_include_regexes: Some(quoted_tokens_vec([b"dep[134]"])),
663                        pre_exclude_regexes: Some(quoted_tokens_vec([b".*"])),
664                        post_include_regexes: None,
665                        post_exclude_regexes: None,
666                        post_include_files: None,
667                        post_exclude_files: None,
668                        directories: Some(quoted_tokens_vec([b"$<TARGET_FILE_DIR:dep1>"])),
669                    }
670                ))),
671            ])
672        )
673    }
674}