-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMakeSetProperty.class.st
126 lines (100 loc) · 3.85 KB
/
CMakeSetProperty.class.st
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
115
116
117
118
119
120
121
122
123
124
125
126
"
cmake --help-command set_property
set_property
------------
Set a named property in a given scope.
::
set_property(<GLOBAL |
DIRECTORY [dir] |
TARGET [target1 [target2 ...]] |
SOURCE [src1 [src2 ...]] |
TEST [test1 [test2 ...]] |
CACHE [entry1 [entry2 ...]]>
[APPEND] [APPEND_STRING]
PROPERTY <name> [value1 [value2 ...]])
Set one property on zero or more objects of a scope. The first
argument determines the scope in which the property is set. It must
be one of the following:
GLOBAL scope is unique and does not accept a name.
DIRECTORY scope defaults to the current directory but another
directory (already processed by CMake) may be named by full or
relative path.
TARGET scope may name zero or more existing targets.
SOURCE scope may name zero or more source files. Note that source
file properties are visible only to targets added in the same
directory (CMakeLists.txt).
TEST scope may name zero or more existing tests.
CACHE scope must name zero or more cache existing entries.
The required PROPERTY option is immediately followed by the name of
the property to set. Remaining arguments are used to compose the
property value in the form of a semicolon-separated list. If the
APPEND option is given the list is appended to any existing property
value.If the APPEND_STRING option is given the string is append to any
existing property value as string, i.e. it results in a longer string
and not a list of strings.
"
Class {
#name : #CMakeSetProperty,
#superclass : #CMakeTemplate,
#instVars : [
'scope',
'append',
'appendstring',
'property',
'values'
],
#category : #'CMakeVMMakerSqueak-CMakeTemplates'
}
{ #category : #accessing }
CMakeSetProperty >> append [
^ append
]
{ #category : #accessing }
CMakeSetProperty >> appendstring [
^ appendstring
]
{ #category : #'initialize-release' }
CMakeSetProperty >> initialize [
scope:= '<GLOBAL | DIRECTORY [dir] |TARGET [target1 [target2 ...]] | SOURCE [src1 [src2 ...]] | TEST [test1 [test2 ...]] |CACHE [entry1 [entry2 ...]]>'.
append := ''.
appendstring:=''.
property := '<name>'.
values := OrderedCollection with: '[value1' with: '[value2...' with:']]' .
self content:' set_property(',self scope , ' PROPERTY ', self property , ' ' ,self values,')'
]
{ #category : #accessing }
CMakeSetProperty >> property [
^ property
]
{ #category : #accessing }
CMakeSetProperty >> scope [
^ scope
]
{ #category : #accessing }
CMakeSetProperty >> scope: sString append: aString property: pString values: anOrderedCollection [
scope := sString.
append:= aString. "should this be aBoolean and then force append :=APPEND"
property:= pString.
values:= anOrderedCollection.
self content:' set_property(',self scope , ' ', self append , ' PROPERTY ', self property , ' ' self values,')'
]
{ #category : #accessing }
CMakeSetProperty >> scope: sString appendString: aString property: pString values: anOrderedCollection [
scope := sString.
appendstring:= aString. "should this be aBoolean and then force appendstring:=APPEND_STRING"
property:= pString.
values:= anOrderedCollection.
self content:' set_property(',self scope , ' ', self appendstring , ' PROPERTY ', self property , ' ' self values,')'
]
{ #category : #accessing }
CMakeSetProperty >> scope: sString property: pString values: anOrderedCollection [
scope := sString.
property:= pString.
values:= anOrderedCollection.
self content:' set_property(',self scope , ' PROPERTY ', self property , ' ', self values,')'
]
{ #category : #accessing }
CMakeSetProperty >> values [
self flag:'tty'. "see CMakeListAppend>>elements for inject method to use If I have doublequotes are needed. "
^ String streamContents: [:stream | values asStringOn: stream delimiter: ' ' ]
]