1use cmake_parser_derive::CMake;
2
3use crate::{
4 doc::command_scope::{CommandScope, ToCommandScope},
5 Token,
6};
7
8#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
12#[cmake(pkg = "crate", untagged)]
13pub enum CMakePath<'t> {
14 Decomposition(CMakePathDecomposition<'t>),
15 Query(CMakePathQuery<'t>),
16 Modification(CMakePathModification<'t>),
17 Generation(CMakePathGeneration<'t>),
18 NativeConversion(CMakePathNativeConversion<'t>),
19 #[cmake(rename = "HASH", transparent)]
20 Hashing(CMakePathHashing<'t>),
21}
22
23impl<'t> ToCommandScope for CMakePath<'t> {
24 fn to_command_scope(&self) -> CommandScope {
25 CommandScope::Scripting
26 }
27}
28
29#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
30#[cmake(pkg = "crate", positional)]
31pub struct CMakePathDecomposition<'t> {
32 #[cmake(rename = "GET", transparent)]
33 pub path_var: Token<'t>,
34 pub component: PathComponent<'t>,
35}
36
37#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
38#[cmake(pkg = "crate", transparent)]
39pub enum PathComponent<'t> {
40 RootName(Token<'t>),
41 RootDirectory(Token<'t>),
42 RootPath(Token<'t>),
43 Filename(Token<'t>),
44 Extension(PathComponentExtension<'t>),
45 Stem(PathComponentStem<'t>),
46 RelativePart(Token<'t>),
47 ParentPath(Token<'t>),
48}
49
50#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
51#[cmake(pkg = "crate", positional)]
52pub struct PathComponentExtension<'t> {
53 pub last_only: bool,
54 pub out_var: Token<'t>,
55}
56
57#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
58#[cmake(pkg = "crate", positional)]
59pub struct PathComponentStem<'t> {
60 pub last_only: bool,
61 pub out_var: Token<'t>,
62}
63
64#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
65#[cmake(pkg = "crate", transparent)]
66pub enum CMakePathQuery<'t> {
67 HasRootName(PathQuery<'t>),
68 HasRootDirectory(PathQuery<'t>),
69 HasRootPath(PathQuery<'t>),
70 HasFilename(PathQuery<'t>),
71 HasExtension(PathQuery<'t>),
72 HasStem(PathQuery<'t>),
73 HasRelativePart(PathQuery<'t>),
74 HasParentPath(PathQuery<'t>),
75 IsAbsolute(PathQuery<'t>),
76 IsRelative(PathQuery<'t>),
77 IsPrefix(PathQueryPrefix<'t>),
78 Compare(PathQueryCompare<'t>),
79}
80
81#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
82#[cmake(pkg = "crate", positional)]
83pub struct PathQuery<'t> {
84 pub path_var: Token<'t>,
85 pub out_var: Token<'t>,
86}
87
88#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
89#[cmake(pkg = "crate", positional)]
90pub struct PathQueryPrefix<'t> {
91 pub path_var: Token<'t>,
92 pub input: Token<'t>,
93 pub normalize: bool,
94 pub out_var: Token<'t>,
95}
96
97#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
98#[cmake(pkg = "crate", positional)]
99pub struct PathQueryCompare<'t> {
100 pub input1: Token<'t>,
101 pub operation: CompareOperation,
102 pub input2: Token<'t>,
103 pub out_var: Token<'t>,
104}
105
106#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
107#[cmake(pkg = "crate")]
108pub enum CompareOperation {
109 Equal,
110 NotEqual,
111}
112
113#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
114#[cmake(pkg = "crate", transparent)]
115pub enum CMakePathModification<'t> {
116 Set(PathModificationSet<'t>),
117 Append(PathModificationAppend<'t>),
118 AppendString(PathModificationAppendString<'t>),
119 RemoveFilename(PathModificationRemoveFilename<'t>),
120 ReplaceFilename(PathModificationReplaceFilename<'t>),
121 RemoveExtension(PathModificationRemoveExtension<'t>),
122 ReplaceExtension(PathModificationReplaceExtension<'t>),
123}
124
125#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
126#[cmake(pkg = "crate", positional)]
127pub struct PathModificationSet<'t> {
128 pub path_var: Token<'t>,
129 pub normalize: bool,
130 pub input: Token<'t>,
131}
132
133#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
134#[cmake(pkg = "crate", default = "inputs")]
135pub struct PathModificationAppend<'t> {
136 #[cmake(positional)]
137 pub path_var: Token<'t>,
138 #[cmake(rename = "")]
139 pub inputs: Option<Vec<Token<'t>>>,
140 #[cmake(rename = "OUTPUT_VARIABLE")]
141 pub out_var: Option<Token<'t>>,
142}
143
144#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
145#[cmake(pkg = "crate", default = "inputs")]
146pub struct PathModificationAppendString<'t> {
147 #[cmake(positional)]
148 pub path_var: Token<'t>,
149 #[cmake(rename = "")]
150 pub inputs: Option<Vec<Token<'t>>>,
151 #[cmake(rename = "OUTPUT_VARIABLE")]
152 pub out_var: Option<Token<'t>>,
153}
154
155#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
156#[cmake(pkg = "crate", positional)]
157pub struct PathModificationRemoveFilename<'t> {
158 pub path_var: Token<'t>,
159 #[cmake(rename = "OUTPUT_VARIABLE", transparent)]
160 pub out_var: Option<Token<'t>>,
161}
162
163#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
164#[cmake(pkg = "crate", positional)]
165pub struct PathModificationReplaceFilename<'t> {
166 pub path_var: Token<'t>,
167 pub input: Token<'t>,
168 #[cmake(rename = "OUTPUT_VARIABLE", transparent)]
169 pub out_var: Option<Token<'t>>,
170}
171
172#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
173#[cmake(pkg = "crate", positional)]
174pub struct PathModificationRemoveExtension<'t> {
175 pub path_var: Token<'t>,
176 pub last_only: bool,
177 #[cmake(rename = "OUTPUT_VARIABLE", transparent)]
178 pub out_var: Option<Token<'t>>,
179}
180
181#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
182#[cmake(pkg = "crate", positional)]
183pub struct PathModificationReplaceExtension<'t> {
184 pub path_var: Token<'t>,
185 pub last_only: bool,
186 pub input: Token<'t>,
187 #[cmake(rename = "OUTPUT_VARIABLE", transparent)]
188 pub out_var: Option<Token<'t>>,
189}
190
191#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
192#[cmake(pkg = "crate", transparent)]
193pub enum CMakePathGeneration<'t> {
194 #[cmake(rename = "NORMAL_PATH")]
195 Normal(PathGenerationNormal<'t>),
196 #[cmake(rename = "RELATIVE_PATH")]
197 Relative(PathGenerationRelative<'t>),
198 #[cmake(rename = "ABSOLUTE_PATH")]
199 Absolute(PathGenerationAbsolute<'t>),
200}
201
202#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
203#[cmake(pkg = "crate", positional)]
204pub struct PathGenerationNormal<'t> {
205 pub path_var: Token<'t>,
206 #[cmake(rename = "OUTPUT_VARIABLE", transparent)]
207 pub out_var: Option<Token<'t>>,
208}
209
210#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
211#[cmake(pkg = "crate")]
212pub struct PathGenerationRelative<'t> {
213 #[cmake(positional)]
214 pub path_var: Token<'t>,
215 #[cmake(rename = "BASE_DIRECTORY")]
216 pub input: Option<Token<'t>>,
217 #[cmake(rename = "OUTPUT_VARIABLE")]
218 pub out_var: Option<Token<'t>>,
219}
220
221#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
222#[cmake(pkg = "crate")]
223pub struct PathGenerationAbsolute<'t> {
224 #[cmake(positional)]
225 pub path_var: Token<'t>,
226 #[cmake(rename = "BASE_DIRECTORY")]
227 pub input: Option<Token<'t>>,
228 pub normalize: bool,
229 #[cmake(rename = "OUTPUT_VARIABLE")]
230 pub out_var: Option<Token<'t>>,
231}
232
233#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
234#[cmake(pkg = "crate", transparent)]
235pub enum CMakePathNativeConversion<'t> {
236 NativePath(NativeConversionPath<'t>),
237 Convert(NativeConversionConvert<'t>),
238}
239
240#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
241#[cmake(pkg = "crate", positional)]
242pub struct NativeConversionPath<'t> {
243 pub path_var: Token<'t>,
244 pub normalize: bool,
245 pub out_var: Option<Token<'t>>,
246}
247
248#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
249#[cmake(pkg = "crate", positional)]
250pub struct NativeConversionConvert<'t> {
251 pub input: Token<'t>,
252 pub to: ConvertToPathList,
253 pub out_var: Token<'t>,
254 pub normalize: bool,
255}
256
257#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
258#[cmake(pkg = "crate")]
259pub enum ConvertToPathList {
260 #[cmake(rename = "TO_CMAKE_PATH_LIST")]
261 CMake,
262 #[cmake(rename = "TO_NATIVE_PATH_LIST")]
263 Native,
264}
265
266#[derive(CMake, Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
267#[cmake(pkg = "crate", positional)]
268pub struct CMakePathHashing<'t> {
269 pub path_var: Token<'t>,
270 pub out_var: Token<'t>,
271}
272
273#[cfg(test)]
274mod tests {
275 use super::*;
276 use crate::doc::cmake_parse::tests::{token, tokens_vec};
277 use crate::*;
278 use pretty_assertions::assert_eq;
279
280 #[test]
281 fn cmake_path() {
282 let src = include_bytes!("../../../../../fixture/commands/scripting/cmake_path");
283 let cmakelists = parse_cmakelists(src).unwrap();
284 let doc = Doc::from(cmakelists);
285 assert_eq!(
286 doc.commands(),
287 Ok(vec![
288 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
290 path_var: token(b"path_var1"),
291 component: PathComponent::RootName(token(b"out_var1")),
292 }))),
293 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
294 path_var: token(b"path_var1"),
295 component: PathComponent::RootDirectory(token(b"out_var1")),
296 }))),
297 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
298 path_var: token(b"path_var1"),
299 component: PathComponent::RootPath(token(b"out_var1")),
300 }))),
301 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
302 path_var: token(b"path_var1"),
303 component: PathComponent::Filename(token(b"out_var1")),
304 }))),
305 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
306 path_var: token(b"path_var1"),
307 component: PathComponent::Extension(PathComponentExtension {
308 last_only: true,
309 out_var: token(b"out_var1"),
310 }),
311 }))),
312 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
313 path_var: token(b"dotPath"),
314 component: PathComponent::Extension(PathComponentExtension {
315 last_only: false,
316 out_var: token(b"dotExt"),
317 }),
318 }))),
319 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
320 path_var: token(b"path_var1"),
321 component: PathComponent::Stem(PathComponentStem {
322 last_only: true,
323 out_var: token(b"out_var1"),
324 }),
325 }))),
326 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
327 path_var: token(b"dotPath"),
328 component: PathComponent::Stem(PathComponentStem {
329 last_only: false,
330 out_var: token(b"dotStem"),
331 }),
332 }))),
333 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
334 path_var: token(b"path_var1"),
335 component: PathComponent::RelativePart(token(b"out_var1")),
336 }))),
337 Command::CMakePath(Box::new(CMakePath::Decomposition(CMakePathDecomposition {
338 path_var: token(b"path_var1"),
339 component: PathComponent::ParentPath(token(b"out_var1")),
340 }))),
341 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasRootName(
343 PathQuery {
344 path_var: token(b"path_var1"),
345 out_var: token(b"out_var1"),
346 }
347 )))),
348 Command::CMakePath(Box::new(CMakePath::Query(
349 CMakePathQuery::HasRootDirectory(PathQuery {
350 path_var: token(b"path_var1"),
351 out_var: token(b"out_var1"),
352 })
353 ))),
354 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasRootPath(
355 PathQuery {
356 path_var: token(b"path_var1"),
357 out_var: token(b"out_var1"),
358 }
359 )))),
360 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasFilename(
361 PathQuery {
362 path_var: token(b"path_var1"),
363 out_var: token(b"out_var1"),
364 }
365 )))),
366 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasExtension(
367 PathQuery {
368 path_var: token(b"path_var1"),
369 out_var: token(b"out_var1"),
370 }
371 )))),
372 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasStem(
373 PathQuery {
374 path_var: token(b"path_var1"),
375 out_var: token(b"out_var1"),
376 }
377 )))),
378 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasRelativePart(
379 PathQuery {
380 path_var: token(b"path_var1"),
381 out_var: token(b"out_var1"),
382 }
383 )))),
384 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::HasParentPath(
385 PathQuery {
386 path_var: token(b"path_var1"),
387 out_var: token(b"out_var1"),
388 }
389 )))),
390 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::IsAbsolute(
391 PathQuery {
392 path_var: token(b"path_var1"),
393 out_var: token(b"out_var1"),
394 }
395 )))),
396 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::IsRelative(
397 PathQuery {
398 path_var: token(b"path_var1"),
399 out_var: token(b"out_var1"),
400 }
401 )))),
402 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::IsPrefix(
403 PathQueryPrefix {
404 path_var: token(b"path_var1"),
405 input: token(b"input1"),
406 normalize: false,
407 out_var: token(b"out_var1"),
408 }
409 )))),
410 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::IsPrefix(
411 PathQueryPrefix {
412 path_var: token(b"path_var1"),
413 input: token(b"input1"),
414 normalize: true,
415 out_var: token(b"out_var1"),
416 }
417 )))),
418 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::Compare(
419 PathQueryCompare {
420 input1: token(b"input1"),
421 operation: CompareOperation::Equal,
422 input2: token(b"input2"),
423 out_var: token(b"out_var1")
424 }
425 )))),
426 Command::CMakePath(Box::new(CMakePath::Query(CMakePathQuery::Compare(
427 PathQueryCompare {
428 input1: token(b"input1"),
429 operation: CompareOperation::NotEqual,
430 input2: token(b"input2"),
431 out_var: token(b"out_var1")
432 }
433 )))),
434 Command::CMakePath(Box::new(CMakePath::Modification(
436 CMakePathModification::Set(PathModificationSet {
437 path_var: token(b"path_var1"),
438 normalize: true,
439 input: token(b"input1"),
440 })
441 ))),
442 Command::CMakePath(Box::new(CMakePath::Modification(
443 CMakePathModification::Set(PathModificationSet {
444 path_var: token(b"path_var1"),
445 normalize: false,
446 input: token(b"input1"),
447 })
448 ))),
449 Command::CMakePath(Box::new(CMakePath::Modification(
450 CMakePathModification::Append(PathModificationAppend {
451 path_var: token(b"path_var1"),
452 inputs: None,
453 out_var: None,
454 })
455 ))),
456 Command::CMakePath(Box::new(CMakePath::Modification(
457 CMakePathModification::Append(PathModificationAppend {
458 path_var: token(b"path_var1"),
459 inputs: Some(tokens_vec([b"input1", b"input2", b"input3"])),
460 out_var: None,
461 })
462 ))),
463 Command::CMakePath(Box::new(CMakePath::Modification(
464 CMakePathModification::Append(PathModificationAppend {
465 path_var: token(b"path_var1"),
466 inputs: Some(tokens_vec([b"input1", b"input2", b"input3"])),
467 out_var: Some(token(b"out_var1")),
468 })
469 ))),
470 Command::CMakePath(Box::new(CMakePath::Modification(
471 CMakePathModification::Append(PathModificationAppend {
472 path_var: token(b"path_var1"),
473 inputs: None,
474 out_var: Some(token(b"out_var1")),
475 })
476 ))),
477 Command::CMakePath(Box::new(CMakePath::Modification(
478 CMakePathModification::AppendString(PathModificationAppendString {
479 path_var: token(b"path_var1"),
480 inputs: None,
481 out_var: None,
482 })
483 ))),
484 Command::CMakePath(Box::new(CMakePath::Modification(
485 CMakePathModification::AppendString(PathModificationAppendString {
486 path_var: token(b"path_var1"),
487 inputs: Some(tokens_vec([b"input1", b"input2", b"input3"])),
488 out_var: None,
489 })
490 ))),
491 Command::CMakePath(Box::new(CMakePath::Modification(
492 CMakePathModification::AppendString(PathModificationAppendString {
493 path_var: token(b"path_var1"),
494 inputs: Some(tokens_vec([b"input1", b"input2", b"input3"])),
495 out_var: Some(token(b"out_var1")),
496 })
497 ))),
498 Command::CMakePath(Box::new(CMakePath::Modification(
499 CMakePathModification::AppendString(PathModificationAppendString {
500 path_var: token(b"path_var1"),
501 inputs: None,
502 out_var: Some(token(b"out_var1")),
503 })
504 ))),
505 Command::CMakePath(Box::new(CMakePath::Modification(
506 CMakePathModification::RemoveFilename(PathModificationRemoveFilename {
507 path_var: token(b"path_var1"),
508 out_var: None,
509 })
510 ))),
511 Command::CMakePath(Box::new(CMakePath::Modification(
512 CMakePathModification::RemoveFilename(PathModificationRemoveFilename {
513 path_var: token(b"path_var1"),
514 out_var: Some(token(b"out_var1")),
515 })
516 ))),
517 Command::CMakePath(Box::new(CMakePath::Modification(
518 CMakePathModification::ReplaceFilename(PathModificationReplaceFilename {
519 path_var: token(b"path_var1"),
520 input: token(b"input1"),
521 out_var: None,
522 })
523 ))),
524 Command::CMakePath(Box::new(CMakePath::Modification(
525 CMakePathModification::ReplaceFilename(PathModificationReplaceFilename {
526 path_var: token(b"path_var1"),
527 input: token(b"input1"),
528 out_var: Some(token(b"out_var1")),
529 })
530 ))),
531 Command::CMakePath(Box::new(CMakePath::Modification(
532 CMakePathModification::RemoveExtension(PathModificationRemoveExtension {
533 path_var: token(b"path_var1"),
534 last_only: false,
535 out_var: None,
536 })
537 ))),
538 Command::CMakePath(Box::new(CMakePath::Modification(
539 CMakePathModification::RemoveExtension(PathModificationRemoveExtension {
540 path_var: token(b"path_var1"),
541 last_only: false,
542 out_var: Some(token(b"out_var1")),
543 })
544 ))),
545 Command::CMakePath(Box::new(CMakePath::Modification(
546 CMakePathModification::RemoveExtension(PathModificationRemoveExtension {
547 path_var: token(b"path_var1"),
548 last_only: true,
549 out_var: None,
550 })
551 ))),
552 Command::CMakePath(Box::new(CMakePath::Modification(
553 CMakePathModification::RemoveExtension(PathModificationRemoveExtension {
554 path_var: token(b"path_var1"),
555 last_only: true,
556 out_var: Some(token(b"out_var1")),
557 })
558 ))),
559 Command::CMakePath(Box::new(CMakePath::Modification(
560 CMakePathModification::ReplaceExtension(PathModificationReplaceExtension {
561 path_var: token(b"path_var1"),
562 last_only: false,
563 input: token(b"input1"),
564 out_var: None,
565 })
566 ))),
567 Command::CMakePath(Box::new(CMakePath::Modification(
568 CMakePathModification::ReplaceExtension(PathModificationReplaceExtension {
569 path_var: token(b"path_var1"),
570 last_only: false,
571 input: token(b"input1"),
572 out_var: Some(token(b"out_var1")),
573 })
574 ))),
575 Command::CMakePath(Box::new(CMakePath::Modification(
576 CMakePathModification::ReplaceExtension(PathModificationReplaceExtension {
577 path_var: token(b"path_var1"),
578 last_only: true,
579 input: token(b"input1"),
580 out_var: None,
581 })
582 ))),
583 Command::CMakePath(Box::new(CMakePath::Modification(
584 CMakePathModification::ReplaceExtension(PathModificationReplaceExtension {
585 path_var: token(b"path_var1"),
586 last_only: true,
587 input: token(b"input1"),
588 out_var: Some(token(b"out_var1")),
589 })
590 ))),
591 Command::CMakePath(Box::new(CMakePath::Generation(
593 CMakePathGeneration::Normal(PathGenerationNormal {
594 path_var: token(b"path_var1"),
595 out_var: None,
596 })
597 ))),
598 Command::CMakePath(Box::new(CMakePath::Generation(
599 CMakePathGeneration::Normal(PathGenerationNormal {
600 path_var: token(b"path_var1"),
601 out_var: Some(token(b"out_var1")),
602 })
603 ))),
604 Command::CMakePath(Box::new(CMakePath::Generation(
605 CMakePathGeneration::Relative(PathGenerationRelative {
606 path_var: token(b"path_var1"),
607 input: None,
608 out_var: None,
609 })
610 ))),
611 Command::CMakePath(Box::new(CMakePath::Generation(
612 CMakePathGeneration::Relative(PathGenerationRelative {
613 path_var: token(b"path_var1"),
614 input: Some(token(b"input1")),
615 out_var: None,
616 })
617 ))),
618 Command::CMakePath(Box::new(CMakePath::Generation(
619 CMakePathGeneration::Relative(PathGenerationRelative {
620 path_var: token(b"path_var1"),
621 input: None,
622 out_var: Some(token(b"out_var1")),
623 })
624 ))),
625 Command::CMakePath(Box::new(CMakePath::Generation(
626 CMakePathGeneration::Relative(PathGenerationRelative {
627 path_var: token(b"path_var1"),
628 input: Some(token(b"input1")),
629 out_var: Some(token(b"out_var1")),
630 })
631 ))),
632 Command::CMakePath(Box::new(CMakePath::Generation(
633 CMakePathGeneration::Absolute(PathGenerationAbsolute {
634 path_var: token(b"path_var1"),
635 input: None,
636 normalize: false,
637 out_var: None,
638 })
639 ))),
640 Command::CMakePath(Box::new(CMakePath::Generation(
641 CMakePathGeneration::Absolute(PathGenerationAbsolute {
642 path_var: token(b"path_var1"),
643 input: Some(token(b"input1")),
644 normalize: false,
645 out_var: None,
646 })
647 ))),
648 Command::CMakePath(Box::new(CMakePath::Generation(
649 CMakePathGeneration::Absolute(PathGenerationAbsolute {
650 path_var: token(b"path_var1"),
651 input: None,
652 normalize: false,
653 out_var: Some(token(b"out_var1")),
654 })
655 ))),
656 Command::CMakePath(Box::new(CMakePath::Generation(
657 CMakePathGeneration::Absolute(PathGenerationAbsolute {
658 path_var: token(b"path_var1"),
659 input: Some(token(b"input1")),
660 normalize: false,
661 out_var: Some(token(b"out_var1")),
662 })
663 ))),
664 Command::CMakePath(Box::new(CMakePath::Generation(
665 CMakePathGeneration::Absolute(PathGenerationAbsolute {
666 path_var: token(b"path_var1"),
667 input: Some(token(b"input1")),
668 normalize: true,
669 out_var: Some(token(b"out_var1")),
670 })
671 ))),
672 Command::CMakePath(Box::new(CMakePath::NativeConversion(
674 CMakePathNativeConversion::NativePath(NativeConversionPath {
675 path_var: token(b"path_var1"),
676 normalize: false,
677 out_var: None,
678 })
679 ))),
680 Command::CMakePath(Box::new(CMakePath::NativeConversion(
681 CMakePathNativeConversion::NativePath(NativeConversionPath {
682 path_var: token(b"path_var1"),
683 normalize: true,
684 out_var: Some(token(b"out_var1")),
685 })
686 ))),
687 Command::CMakePath(Box::new(CMakePath::NativeConversion(
688 CMakePathNativeConversion::Convert(NativeConversionConvert {
689 input: token(b"input1"),
690 to: ConvertToPathList::CMake,
691 out_var: token(b"out_var1"),
692 normalize: false,
693 })
694 ))),
695 Command::CMakePath(Box::new(CMakePath::NativeConversion(
696 CMakePathNativeConversion::Convert(NativeConversionConvert {
697 input: token(b"input1"),
698 to: ConvertToPathList::CMake,
699 out_var: token(b"out_var1"),
700 normalize: true,
701 })
702 ))),
703 Command::CMakePath(Box::new(CMakePath::NativeConversion(
704 CMakePathNativeConversion::Convert(NativeConversionConvert {
705 input: token(b"input1"),
706 to: ConvertToPathList::Native,
707 out_var: token(b"out_var1"),
708 normalize: false,
709 })
710 ))),
711 Command::CMakePath(Box::new(CMakePath::NativeConversion(
712 CMakePathNativeConversion::Convert(NativeConversionConvert {
713 input: token(b"input1"),
714 to: ConvertToPathList::Native,
715 out_var: token(b"out_var1"),
716 normalize: true,
717 })
718 ))),
719 Command::CMakePath(Box::new(CMakePath::Hashing(CMakePathHashing {
721 path_var: token(b"path_var1"),
722 out_var: token(b"out_var1"),
723 }))),
724 ])
725 )
726 }
727}