File: FindXUL.cmake

package info (click to toggle)
openscenegraph 2.8.3-5
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 33,968 kB
  • ctags: 30,935
  • sloc: cpp: 287,169; ansic: 9,050; sh: 654; yacc: 548; objc: 374; makefile: 264; lex: 151; perl: 119
file content (235 lines) | stat: -rw-r--r-- 7,211 bytes parent folder | download
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
# Locate XUL
# This module defines
# XUL_LIBRARIES
# XUL_FOUND, if false, do not try to link to gdal
# XUL_INCLUDE_DIR, where to find the headers
#
# $XUL_DIR is an environment variable that would
# correspond to the ./configure --prefix=$XUL_DIR
#
# Created by Robert Osfield.

#use pkg-config to find various modues
INCLUDE(FindPkgConfig OPTIONAL)

IF(PKG_CONFIG_FOUND)

    INCLUDE(FindPkgConfig)

    pkg_check_modules(XULRUNNER_XPCOM xulrunner-xpcom<=1.8.9)
    pkg_check_modules(XULRUNNER_JS xulrunner-js)
    pkg_check_modules(XULRUNNER_NSPR xulrunner-nspr)
    pkg_check_modules(XULRUNNER_NSS xulrunner-nss)

ENDIF(PKG_CONFIG_FOUND)

# Added check to make sure that nsIBaseWindow.h is available, as it's not a standard part the of 1.8.x SDK
FIND_PATH(NSIBASEWINDOW_INCLUDE_DIR widget/nsIBaseWindow.h
    PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
    $ENV{OSG_DIR}/include/xulrunner
    $ENV{OSG_DIR}/include
    $ENV{OSG_DIR}/xulrunner
    $ENV{OSG_DIR}
    $ENV{OSGDIR}/include/xulrunner
    $ENV{OSGDIR}/include
    $ENV{OSGDIR}/xulrunner
    $ENV{OSGDIR}
    $ENV{OSG_ROOT}/include/xulrunner
    $ENV{OSG_ROOT}/include
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local/include/xulrunner
    /usr/local/include
    /usr/include/xulrunner
    /usr/include
    /sw/include/xulrunner # Fink
    /sw/include # Fink
    /opt/local/include/xulrunner # DarwinPorts
    /opt/local/include # DarwinPorts
    /opt/csw/include/xulrunner # Blastwave
    /opt/csw/include # Blastwave
    /opt/include/xulrunner
    /opt/include
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
    /usr/freeware/include/xulrunner
    /usr/freeware/include
)

FIND_PATH(XUL_INCLUDE_DIR nsEmbedAPI.h
    PATHS ${XULRUNNER_XPCOM_INCLUDE_DIRS}
    $ENV{OSG_DIR}/include/xulrunner
    $ENV{OSG_DIR}/include
    $ENV{OSG_DIR}/xulrunner
    $ENV{OSG_DIR}
    $ENV{OSGDIR}/include/xulrunner
    $ENV{OSGDIR}/include
    $ENV{OSGDIR}/xulrunner
    $ENV{OSGDIR}
    $ENV{OSG_ROOT}/include/xulrunner
    $ENV{OSG_ROOT}/include
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local/include/xulrunner
    /usr/local/include
    /usr/include/xulrunner
    /usr/include
    /sw/include/xulrunner # Fink
    /sw/include # Fink
    /opt/local/include/xulrunner # DarwinPorts
    /opt/local/include # DarwinPorts
    /opt/csw/include/xulrunner # Blastwave
    /opt/csw/include # Blastwave
    /opt/include/xulrunner
    /opt/include
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/xulrunner
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
    /usr/freeware/include/xulrunner
    /usr/freeware/include
)

FIND_PATH(NSPR_INCLUDE_DIR prtypes.h
    PATHS ${XULRUNNER_NSPR_INCLUDE_DIRS}
    $ENV{OSG_DIR}/include/nspr
    $ENV{OSG_DIR}/include
    $ENV{OSG_DIR}/nspr
    $ENV{OSG_DIR}
    $ENV{OSGDIR}/include/nspr
    $ENV{OSGDIR}/include
    $ENV{OSGDIR}/nspr
    $ENV{OSGDIR}
    $ENV{OSG_ROOT}/include/nspr
    $ENV{OSG_ROOT}/include
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local/include/nspr
    /usr/local/include
    /usr/include/nspr
    /usr/include
    /sw/include/nspr # Fink
    /sw/include # Fink
    /opt/local/include/nspr # DarwinPorts
    /opt/local/include # DarwinPorts
    /opt/csw/include/nspr # Blastwave
    /opt/csw/include # Blastwave
    /opt/include/nspr
    /opt/include
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/nspr
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
    /usr/freeware/include/nspr
    /usr/freeware/include
)

FIND_PATH(MOZJS_INCLUDE_DIR jsapi.h
    PATHS ${XULRUNNER_JS_INCLUDE_DIRS}
    $ENV{OSG_DIR}/include/mozjs
    $ENV{OSG_DIR}/include
    $ENV{OSG_DIR}/mozjs
    $ENV{OSG_DIR}
    $ENV{OSGDIR}/include/mozjs
    $ENV{OSGDIR}/include
    $ENV{OSGDIR}/mozjs
    $ENV{OSGDIR}
    $ENV{OSG_ROOT}/include/mozjs
    $ENV{OSG_ROOT}/include
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local/include/mozjs
    /usr/local/include
    /usr/include/mozjs
    /usr/include
    /sw/include/mozjs # Fink
    /sw/include # Fink
    /opt/local/include/mozjs # DarwinPorts
    /opt/local/include # DarwinPorts
    /opt/csw/include/mozjs # Blastwave
    /opt/csw/include # Blastwave
    /opt/include/mozjs
    /opt/include
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include/mozjs
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include
    /usr/freeware/include/mozjs
    /usr/freeware/include
)

FIND_PATH(XUL_DIR
    NAMES components/appshell.xpt
    PATHS
    $ENV{OSG_DIR}/lib
    $ENV{OSG_DIR}
    $ENV{OSGDIR}/lib
    $ENV{OSGDIR}
    $ENV{OSG_ROOT}/lib
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local/lib/xulrunner
    /usr/local/lib
    /usr/lib/xulrunner
    /usr/lib
    /sw/lib/xulrunner
    /sw/lib
    /opt/local/lib/xulrunner
    /opt/local/lib
    /opt/csw/lib/xulrunner
    /opt/csw/lib
    /opt/lib/xulrunner
    /opt/lib
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
    /usr/freeware/lib64/xulrunner
    /usr/freeware/lib64
)

MACRO(FIND_XUL_LIBRARY MYLIBRARY MYLIBRARYNAME)

    FIND_LIBRARY(${MYLIBRARY}
        PATHS ${XULRUNNER_XPCOM_LIBRARY_DIRS}
        PATHS ${XULRUNNER_JS_LIBRARY_DIRS}
        PATHS ${XULRUNNER_NSPR_LIBRARY_DIRS}
        PATHS ${XULRUNNER_NSS_LIBRARY_DIRS}
        NAMES ${MYLIBRARYNAME}
        PATHS
        $ENV{OSG_DIR}/lib
        $ENV{OSG_DIR}
        $ENV{OSGDIR}/lib
        $ENV{OSGDIR}
        $ENV{OSG_ROOT}/lib
        ~/Library/Frameworks
        /Library/Frameworks
        /usr/local/lib/xulrunner
        /usr/local/lib
        /usr/lib/xulrunner
        /usr/lib
        /sw/lib/xulrunner
        /sw/lib
        /opt/local/lib/xulrunner
        /opt/local/lib
        /opt/csw/lib/xulrunner
        /opt/csw/lib
        /opt/lib/xulrunner
        /opt/lib
        [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib
        /usr/freeware/lib64/xulrunner
        /usr/freeware/lib64
    )

ENDMACRO(FIND_XUL_LIBRARY LIBRARY LIBRARYNAME)


FIND_XUL_LIBRARY(XUL_LIBRARY xul plds4 plc4 nspr4)
FIND_XUL_LIBRARY(XUL_MOZJS_LIBRARY mozjs)
FIND_XUL_LIBRARY(XUL_XPCOM_LIBRARY xpcom)
FIND_XUL_LIBRARY(XUL_PLUGIN_LIBRARY plds4)
FIND_XUL_LIBRARY(XUL_NSS_LIBRARY nss3)


SET(XUL_FOUND "NO")
IF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)

    SET(XUL_FOUND "YES")
    SET(XUL_LIBRARIES ${XUL_LIBRARY} ${XUL_MOZJS_LIBRARY} ${XUL_XPCOM_LIBRARY} ${XUL_PLUGIN_LIBRARY} ${XUL_NSS_LIBRARY})
    SET(XUL_INCLUDE_DIRS ${XUL_INCLUDE_DIR} ${NSPR_INCLUDE_DIR} ${MOZJS_INCLUDE_DIR})

ENDIF(XUL_LIBRARY AND XUL_INCLUDE_DIR AND NSIBASEWINDOW_INCLUDE_DIR)

# MESSAGE("XUL_INCLUDE_DIR " ${XUL_INCLUDE_DIR})
# MESSAGE("XUL_LIBRARIES " ${XUL_LIBRARIES})