-
Notifications
You must be signed in to change notification settings - Fork 65
/
CMakeCheckLibraryExists.class.st
108 lines (82 loc) · 2.35 KB
/
CMakeCheckLibraryExists.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
"
A CMakeCheckLibraryExists is a CMake Command in the CheckLibraryExists Module
http://cmake.org/Wiki/CMake:How_To_Write_Platform_Checks
Module
INCLUDE (CheckLibraryExists)
Usage
CHECK_LIBRARY_EXISTS(library function location variable)
Example
CHECK_LIBRARY_EXISTS(volmgt volmgt_running """" HAVE_VOLMGT)
Checks whether the given library exists and contains the given function. This is done by linking a small program which uses the function and links to the library. In the location parameter an additional link directory (-Ldir) can be given if required.
example:
CHECK_LIBRARY_EXISTS (dl dlopen """" HAVE_LIBDL)
IF (HAVE_LIBDL)
CONFIG_DEFINE(HAVE_LIBDL)
ENDIF (HAVE_LIBDL)
"
Class {
#name : #CMakeCheckLibraryExists,
#superclass : #CMakeTemplate,
#instVars : [
'library',
'function',
'location',
'variable'
],
#category : #'CMakeVMMakerSqueak-CMakeTemplates'
}
{ #category : #accessing }
CMakeCheckLibraryExists >> function [
^ function
]
{ #category : #accessing }
CMakeCheckLibraryExists >> function: anObject [
function := anObject
]
{ #category : #'initialize-release' }
CMakeCheckLibraryExists >> initialize [
library:='library'.
function:='function'.
location:='-L/location'.
variable:='HAVE_LIBRARY'.
content:='
CHECK_LIBRARY_EXISTS (', library, ' ', function, ' "', location ,'" ', variable ,')
IF (', variable, ')
CONFIG_DEFINE(', variable, ')
ENDIF (', variable, ')'
]
{ #category : #accessing }
CMakeCheckLibraryExists >> library [
^ library
]
{ #category : #accessing }
CMakeCheckLibraryExists >> library: anObject [
library := anObject
]
{ #category : #accessing }
CMakeCheckLibraryExists >> library: lString function: fString location: locString variable: vString [
library:= lString.
function:=fString.
location:=locString.
variable:=vString.
content:=' check_library_exists(', library, ' ', function, ' "', location ,'" ', variable ,')
IF (', variable, ')
config_define(', variable, ')
ENDIF (', variable, ')'
]
{ #category : #accessing }
CMakeCheckLibraryExists >> location [
^ location
]
{ #category : #accessing }
CMakeCheckLibraryExists >> location: anObject [
location := anObject
]
{ #category : #accessing }
CMakeCheckLibraryExists >> variable [
^ variable
]
{ #category : #accessing }
CMakeCheckLibraryExists >> variable: anObject [
variable := anObject
]