File: SORT.cmake

package info (click to toggle)
cmake 4.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 152,456 kB
  • sloc: ansic: 403,896; cpp: 303,920; sh: 4,105; python: 3,583; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 111; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (114 lines) | stat: -rw-r--r-- 3,470 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
set(source_unsorted
        c/B.h
        a/c.h
        B/a.h
        )

## Test with default options
set(expected
        B/a.h
        a/c.h
        c/B.h
        )
set(list ${source_unsorted})
list(SORT list)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE SENSITIVE ORDER ASCENDING COMPARE STRING)")
endif ()


## Test CASE INSENSITIVE ORDER ASCENDING COMPARE STRING
set(expected
        a/c.h
        B/a.h
        c/B.h
        )
set(list ${source_unsorted})
list(SORT list CASE INSENSITIVE ORDER ASCENDING COMPARE STRING)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE INSENSITIVE ORDER ASCENDING COMPARE STRING)")
endif ()

## Test CASE INSENSITIVE ORDER DESCENDING COMPARE STRING
set(expected
        c/B.h
        B/a.h
        a/c.h
        )
set(list ${source_unsorted})
list(SORT list CASE INSENSITIVE ORDER DESCENDING COMPARE STRING)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE INSENSITIVE ORDER DESCENDING COMPARE STRING)")
endif ()

## Test CASE SENSITIVE ORDER ASCENDING COMPARE STRING
set(expected
        B/a.h
        a/c.h
        c/B.h
        )
set(list ${source_unsorted})
list(SORT list CASE SENSITIVE ORDER ASCENDING COMPARE STRING)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE SENSITIVE ORDER ASCENDING COMPARE STRING)")
endif ()

## Test CASE SENSITIVE ORDER DESCENDING COMPARE STRING
set(expected
        c/B.h
        a/c.h
        B/a.h
        )
set(list ${source_unsorted})
list(SORT list CASE SENSITIVE ORDER DESCENDING COMPARE STRING)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE SENSITIVE ORDER DESCENDING COMPARE STRING)")
endif ()

## Test CASE INSENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME
set(expected
        B/a.h
        c/B.h
        a/c.h
        )
set(list ${source_unsorted})
list(SORT list CASE INSENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE INSENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME)")
endif ()

## Test CASE INSENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME
set(expected
        a/c.h
        c/B.h
        B/a.h
        )
set(list ${source_unsorted})
list(SORT list CASE INSENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE INSENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME)")
endif ()

## Test CASE SENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME
set(expected
        c/B.h
        B/a.h
        a/c.h
        )
set(list ${source_unsorted})
list(SORT list CASE SENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE SENSITIVE ORDER ASCENDING COMPARE FILE_BASENAME)")
endif ()

## Test CASE SENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME
set(expected
        a/c.h
        B/a.h
        c/B.h
        )
set(list ${source_unsorted})
list(SORT list CASE SENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME)
if (NOT expected STREQUAL list)
    message(FATAL_ERROR "wrong sort result with command list(SORT list CASE SENSITIVE ORDER DESCENDING COMPARE FILE_BASENAME)")
endif ()