-
Notifications
You must be signed in to change notification settings - Fork 68
/
CMakeSetSourceFilesProperties.class.st
84 lines (63 loc) · 2.34 KB
/
CMakeSetSourceFilesProperties.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
"
A CMakeSetSourceFilesProperties looks like this:
TODO: generalize to match the cmake documentation.
SET_SOURCE_FILES_PROPERTIES(file PROPERTIES prop1 value1)
cmake --help-command set_source_files_properties
---------------------------
Source files can have properties that affect how they are built.
::
set_source_files_properties([file1 [file2 [...]]]
PROPERTIES prop1 value1
[prop2 value2 [...]])
Set properties associated with source files using a key/value paired
list. See properties documentation for those known to CMake.
Unrecognized properties are ignored. Source file properties are
visible only to targets added in the same directory (CMakeLists.txt).
"
Class {
#name : #CMakeSetSourceFilesProperties,
#superclass : #CMakeTemplate,
#instVars : [
'files',
'propertiesandvalues'
],
#category : #'CMakeVMMakerSqueak-CMakeTemplates'
}
{ #category : #accessing }
CMakeSetSourceFilesProperties >> files [
self flag:'tty'. "see CMakeListAppend>>elements for inject method to use If I have doublequotes are needed. "
^ String streamContents: [:stream | files asStringOn: stream delimiter: ' ' ]
]
{ #category : #accessing }
CMakeSetSourceFilesProperties >> files: fOrderedCollection propertiesandvalues: pOrderedCollection [
files := fOrderedCollection.
propertiesandvalues := pOrderedCollection.
self content:' set_source_files_properties (', self files, ' ' , 'PROPERTIES ', self propertiesandvalues , ')'
]
{ #category : #'initialize-release' }
CMakeSetSourceFilesProperties >> initialize [
self
initializeFiles;
initializePropertiesAndValues.
self content:' set_source_files_properties (', self files, ' ' , 'PROPERTIES ', self propertiesandvalues , ')'
]
{ #category : #'initialize-release' }
CMakeSetSourceFilesProperties >> initializeFiles [
files:= OrderedCollection new.
files
addLast:('[file1');
addLast:('[file2');
addLast:('[...]]]').
]
{ #category : #'initialize-release' }
CMakeSetSourceFilesProperties >> initializePropertiesAndValues [
propertiesandvalues := OrderedCollection new.
propertiesandvalues
addLast:('prop1 value1');
addLast:('[prop 2 value2');
addLast:('[...]]').
]
{ #category : #accessing }
CMakeSetSourceFilesProperties >> propertiesandvalues [
^ String streamContents: [:stream | propertiesandvalues asStringOn: stream delimiter: ' ' ]
]