-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMakeCheckVariableExists.class.st
80 lines (63 loc) · 1.65 KB
/
CMakeCheckVariableExists.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
"
A CMakeCheckVariableExists looks like this:
CHECK_VARIABLE_EXISTS (timezone HAVE_TIMEZONE)
My CMake documentation reads...
- Check if the variable exists.
# CHECK_VARIABLE_EXISTS(VAR VARIABLE)
#
# VAR - the name of the variable
# VARIABLE - variable to store the result
#
# This macro is only for C variables.
#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
# CMAKE_REQUIRED_FLAGS = string of compile command line flags
# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
"
Class {
#name : #CMakeCheckVariableExists,
#superclass : #CMakeTemplate,
#instVars : [
'var',
'variable'
],
#category : #'CMakeVMMakerSqueak-CMakeTemplates'
}
{ #category : #'initialize-release' }
CMakeCheckVariableExists >> initialize [
var:='var'.
variable:= 'HAVE_',(var asUppercase).
content:=' check_variable_exists(', var ,' ', variable,')
IF(', variable ,')
config_define(', variable,')
ENDIF(', variable ,')'
]
{ #category : #accessing }
CMakeCheckVariableExists >> var [
^ var
]
{ #category : #accessing }
CMakeCheckVariableExists >> var: anObject [
var := anObject
]
{ #category : #accessing }
CMakeCheckVariableExists >> var: varString variable: vString [
var := varString.
variable:= vString.
content:='
CHECK_VARIABLE_EXISTS(', var ,' ', variable,')
IF(', variable ,')
CONFIG_DEFINE(', variable,')
ENDIF(', variable ,')'
]
{ #category : #accessing }
CMakeCheckVariableExists >> variable [
^ variable
]
{ #category : #accessing }
CMakeCheckVariableExists >> variable: anObject [
variable := anObject
]