-
Notifications
You must be signed in to change notification settings - Fork 10
/
detect_mrsid.opt
587 lines (498 loc) · 19.6 KB
/
detect_mrsid.opt
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
!IF $(MSVC_VER) == 1930
!IFDEF WIN64
MRSID_VER=MrSID_DSDK-9.5.5.5244-win64-vc17
!ELSE
MRSID_VER=MrSID_DSDK-9.5.5.5244-win32-vc17
!ENDIF
!ELSEIF $(MSVC_VER) == 1928
!IFDEF WIN64
MRSID_VER=MrSID_DSDK-9.5.4.5047-win64-vc16
!ELSE
MRSID_VER=MrSID_DSDK-9.5.4.5047-win32-vc16
!ENDIF
!ELSEIF $(MSVC_VER) == 1916
!IFDEF WIN64
MRSID_VER=MrSID_DSDK-9.5.4.4709-win64-vc15
!ELSE
MRSID_VER=MrSID_DSDK-9.5.4.4709-win32-vc15
!ENDIF
!ELSEIF $(MSVC_VER) == 1911
!IFDEF WIN64
MRSID_VER=MrSID_DSDK-9.5.4.4709-win64-vc15
!ELSE
MRSID_VER=MrSID_DSDK-9.5.4.4709-win32-vc15
!ENDIF
!ELSEIF $(MSVC_VER) == 1900
!IFDEF WIN64
MRSID_VER=MrSID_DSDK-9.5.4.4709-win64-vc14
!ELSE
MRSID_VER=MrSID_DSDK-9.5.4.4709-win32-vc14
!ENDIF
!ENDIF
!IFDEF MRSID_VER
MRSID_DIR = $(BASE_DIR)\$(MRSID_SDK)\$(MRSID_VER)
!ENDIF
MRSID_RDLLBUILD = YES
MRSID_LDLLBUILD = YES
#MRSID_SHOW_CONFIG = YES
#!MESSAGE MRSID_DIR
###############################################################################
#
# Initialize some default values.
#
!IFNDEF MRSID_CONFIG
MRSID_CONFIG = Release_md
!ENDIF
!IFNDEF MRSID_JP2
#MRSID_JP2 = NO
!ENDIF
###############################################################################
#
# If MRSID_DIR was specified, then we will try to guess whether it points to a
# lidar or a raster SDK (or both). By the end of this block, we want to end
# up with independent macros MRSID_RASTER_DIR and/or MRSID_LIDAR_DIR. Thence
# MRSID_DIR will be ignored.
#
!IF DEFINED(MRSID_DIR)
# Guard against conflicting configuration.
!IF DEFINED(MRSID_RASTER_DIR) && DEFINED(MRSID_LIDAR_DIR)
!ERROR The MRSID_DIR value is redundant or conflicts with the values of MRSID_RASTER_DIR and MRSID_LIDAR_DIR. Please remove one of these values from the build configuration.
!ENDIF
# If a raster path was not explicitly set, see if MRSID_DIR is one.
!IF !DEFINED(MRSID_RASTER_DIR)
!IF EXIST("$(MRSID_DIR)\Raster_ESDK\include\lt_base.h")
MRSID_RASTER_DIR = $(MRSID_DIR)\Raster_ESDK
!ELSE IF EXIST("$(MRSID_DIR)\Raster_DSDK\include\lt_base.h")
MRSID_RASTER_DIR = $(MRSID_DIR)\Raster_DSDK
!ELSE IF EXIST("$(MRSID_DIR)\include\lt_base.h") || EXIST("$(MRSID_DIR)\include\support\lt_base.h")
MRSID_RASTER_DIR = $(MRSID_DIR)
!ENDIF
!ENDIF
# If a lidar path was not explicitly set, see if MRSID_DIR is one.
!IF !DEFINED(MRSID_LIDAR_DIR) && DEFINED(MRSID_DIR)
!IF EXIST("$(MRSID_DIR)\Lidar_ESDK\include\lidar\Base.h")
MRSID_LIDAR_DIR = $(MRSID_DIR)\Lidar_ESDK
!ELSE IF EXIST("$(MRSID_DIR)\Lidar_DSDK\include\lidar\Base.h")
MRSID_LIDAR_DIR = $(MRSID_DIR)\Lidar_DSDK
!ELSE IF EXIST("$(MRSID_DIR)\include\lidar\Base.h")
MRSID_LIDAR_DIR = $(MRSID_DIR)
!ENDIF
!ENDIF
!ENDIF
# Verify we have at least one kind of SDK. Otherwise, there is nothing to do.
!IF !DEFINED(MRSID_RASTER_DIR) && !DEFINED(MRSID_LIDAR_DIR)
!IF DEFINED(MRSID_DIR)
!ERROR No MrSID SDK was found at $(MRSID_DIR).
!ELSE
#!ERROR You did not specify a path to a MrSID SDK.
!ENDIF
!ENDIF
# Henceforth, we can ignore MRSID_DIR.
###############################################################################
#
# Configure the MrSID Raster SDK.
#
!IF DEFINED(MRSID_RASTER_DIR)
# Initialize some macros to help with paths that have evolved over time.
!IF EXIST("$(MRSID_RASTER_DIR)\include\base")
I_BASE = \base
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\support")
I_SUPP = \support
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\mrsid_readers")
I_SIDR = \mrsid_readers
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\j2k_readers")
I_JP2R = \j2k_readers
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\mrsid_writers")
I_SIDW = \mrsid_writers
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\c_api")
I_CAPI = \c_api
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\metadata")
I_META = \metadata
!ENDIF
#
# Determine the detailed Raster SDK version.
R800 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_types.h"
R701 = "$(MRSID_RASTER_DIR)\include$(I_NITF)\nitf_types.h"
R700 = "$(MRSID_RASTER_DIR)\include$(I_NONE)\lti_referenceCountedObject.h"
R607 = "$(MRSID_RASTER_DIR)\include$(I_CAPI)\ltic_api.h"
R605 = "$(MRSID_RASTER_DIR)\include$(I_META)\lti_metadataTypes.h"
R604 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_imageStage.h"
R506 = "$(MRSID_RASTER_DIR)\include$(I_CAPI)\ltic_api.h"
R415 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_coreStatus.h"
R412 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_types.h"
R411 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_utils.h"
R410 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_geoImageReader.h"
R409 = "$(MRSID_RASTER_DIR)\include$(I_CAPI)\ltic_api.h"
R408 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_coreStatus.h"
R407 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_types.h"
R406 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_pixelData.h"
R405 = "$(MRSID_RASTER_DIR)\include$(I_META)\lti_metadataStatus.h"
R404 = "$(MRSID_RASTER_DIR)\include$(I_SUPP)\lt_platform.h"
R403 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_coreStatus.h"
R402 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_image.h"
R400 = "$(MRSID_RASTER_DIR)\include$(I_BASE)\lti_image.h"
!IF [find "LTIEncodingModification" $(R800) > NUL 2>&1] == 0
MRSID_AUTORVER = 800
!ELSE IF [find "NITFTRELocation" $(R701) > NUL 2>&1] == 0
MRSID_AUTORVER = 701
!ELSE IF EXIST($(R700))
MRSID_AUTORVER = 700
!ELSE IF [find "ltic_getDimsAtMag" $(R607) > NUL 2>&1] == 0
MRSID_AUTORVER = 607
!ELSE IF [find "ENCODING_APPLICATION" $(R605) > NUL 2>&1] == 0
MRSID_AUTORVER = 605
!ELSE IF [find "overrideGeoCoord" $(R604) > NUL 2>&1] == 0
MRSID_AUTORVER = 604
!ELSE IF [find "ltic_openNITFImageFile" $(R506) > NUL 2>&1] == 0
MRSID_AUTORVER = 506
!ELSE IF [find "AllocFailed" $(R415) > NUL 2>&1] == 0
MRSID_AUTORVER = 415
!ELSE IF [find "LTIResampleMethod" $(R412) > NUL 2>&1] == 0
MRSID_AUTORVER = 412
!ELSE IF [find "isSigned" $(R411) > NUL 2>&1] == 0
MRSID_AUTORVER = 411
!ELSE IF EXIST("$(R410)")
MRSID_AUTORVER = 410
!ELSE IF EXIST("$(R409)")
MRSID_AUTORVER = 409
!ELSE IF [find "BBB" $(R408) > NUL 2>&1] == 0
MRSID_AUTORVER = 408
!ELSE IF [find "BadFormatForTag" $(R407) > NUL 2>&1] == 0
MRSID_AUTORVER = 407
!ELSE IF EXIST("$(R405)") && !EXIST("$(R406)")
MRSID_AUTORVER = 406
!ELSE IF [find "BadFormatForTag" $(R405) > NUL 2>&1] == 0
MRSID_AUTORVER = 405
!ELSE IF EXIST("$(R404)") && [find "macintosh" $(R404) > NUL 2>&1] > 0
MRSID_AUTORVER = 404
!ELSE IF [find "DatatypeMismatch" $(R403) > NUL 2>&1] == 0
MRSID_AUTORVER = 403
!ELSE IF [find "getDimsAtMag" $(R402) > NUL 2>&1] == 0
MRSID_AUTORVER = 402
!ELSE IF [find "class LTIImage" $(R400) > NUL 2>&1] == 0
MRSID_AUTORVER = 400 # earliest supported raster SDK (2003)
!ELSE
!ERROR $(MRSID_RASTER_DIR) is not a MrSID Raster SDK.
!ENDIF
#
# Check if this might be an encoding SDK.
!IF EXIST("$(MRSID_RASTER_DIR)\include$(I_SIDW)\lti_mrsidWritersStatus.h")
MRSID_AUTOESDK = YES
!ELSE
MRSID_AUTOESDK = NO
!ENDIF
!IF "$(MRSID_ESDK)" == "YES" && "$(MRSID_AUTOESDK)" != "YES"
!ERROR MrSID Raster SDK found at $(MRSID_RASTER_DIR) is not an ESDK.
!ENDIF
!IF !DEFINED(MRSID_ESDK)
MRSID_ESDK = $(MRSID_AUTOESDK)
!ENDIF
#
# Check if this SDK can write MG4.
!IF EXIST("$(MRSID_RASTER_DIR)\include$(I_SIDW)\MG4ImageWriter.h")
MRSID_AUTOMG4W = YES
!ELSE
MRSID_AUTOMG4W = NO
!ENDIF
!IF "$(MRSID_HAVE_MG4WRITE)" == "YES" && "$(MRSID_AUTOMG4W)" != "YES"
!ERROR MrSID Raster SDK found at $(MRSID_RASTER_DIR) is not an ESDK.
!ENDIF
!IF !DEFINED(MRSID_HAVE_MG4WRITE)
MRSID_HAVE_MG4WRITE = $(MRSID_AUTOMG4W)
!ENDIF
#
# Check if this SDK supports JP2.
!IF EXIST("$(MRSID_RASTER_DIR)\include$(I_JP2R)\J2KImageReader.h") || EXIST("$(MRSID_RASTER_DIR)\include$(I_SIDR)\J2KImageReader.h")
MRSID_AUTOJP2 = YES
!ELSE
MRSID_AUTOJP2 = NO
!ENDIF
!IF "$(MRSID_JP2)" == "YES" && "$(MRSID_AUTOJP2)" != "YES"
!ERROR MrSID Raster SDK found at $(MRSID_RASTER_DIR) does not support JP2.
!ENDIF
!IF !DEFINED(MRSID_JP2)
MRSID_JP2 = $(MRSID_AUTOJP2)
!ENDIF
#
# Validate the Raster SDK version if one was indicated.
!IF DEFINED(MRSID_RVER) && "$(MRSID_RVER)" != "$(MRSID_AUTORVER)"
!ERROR MrSID Raster SDK at $(MRSID_RASTER_DIR) is version $(MRSID_AUTORVER), but you specified $(MRSID_RVER).
!ENDIF
MRSID_RVER = $(MRSID_AUTORVER)
#
# Guess linkage if it was not set explicitly.
!IF !DEFINED(MRSID_RDLLBUILD)
!IF "$(MRSID_ESDK)" == "YES" || $(MRSID_RVER)0 < 8000
MRSID_RDLLBUILD = NO
!ELSE
MRSID_RDLLBUILD = YES
!ENDIF
!ENDIF
!ELSE # MRSID_RASTER_DIR was not defined, so disallow other raster options
!IF DEFINED(MRSID_RVER)
!ERROR MRSID_RVER specified, but no MrSID Raster SDK was found.
!ENDIF
!IF "$(MRSID_ESDK)" == "YES"
!ERROR MRSID_ESDK specified, but no MrSID Raster SDK was found.
!ENDIF
!IF "$(MRSID_JP2)" == "YES"
!ERROR MRSID_JP2 specified, but no MrSID Raster SDK was found.
!ENDIF
!ENDIF # end configuration of Raster SDK
###############################################################################
#
# Configure the MrSID Lidar SDK.
#
!IF DEFINED(MRSID_LIDAR_DIR)
# Determine the detailed Lidar SDK version.
L111 = "$(MRSID_LIDAR_DIR)\include\lidar\Types.h"
L110 = "$(MRSID_LIDAR_DIR)\include\lidar\PointData.h"
L101 = "$(MRSID_LIDAR_DIR)\include\lidar\core_status.h"
L100 = "$(MRSID_LIDAR_DIR)\include\lidar\Mutex.h"
L090 = "$(MRSID_LIDAR_DIR)\include\lidar\IO.h"
L060 = "$(MRSID_LIDAR_DIR)\include\lidar\Base.h"
!IF [find "&Huge(" $(L111) > NUL 2>&1] == 0
MRSID_AUTOLVER = 111
!ELSE IF [find "class PointInfo" $(L110) > NUL 2>&1] == 0
MRSID_AUTOLVER = 110
!ELSE IF [find "UNSUPPORTED_VERSION" $(L101) > NUL 2>&1] == 0
MRSID_AUTOLVER = 101
!ELSE IF EXIST("$(L100)")
MRSID_AUTOLVER = 100
!ELSE IF [find "struct Location" $(L090) > NUL 2>&1] == 0
MRSID_AUTOLVER = 90
!ELSE IF [find "LT_END_LIDAR_NAMESPACE" $(L060) > NUL 2>&1] == 0
MRSID_AUTOLVER = 60
!ENDIF
# Validate the Lidar SDK version if one was indicated.
!IF DEFINED(MRSID_LVER) && "$(MRSID_LVER)" != "$(MRSID_AUTOLVER)"
!ERROR MrSID Lidar SDK at $(MRSID_LIDAR_DIR) is version $(MRSID_AUTOLVER), but you specified $(MRSID_LVER).
!ENDIF
MRSID_LVER = $(MRSID_AUTOLVER)
# Guess linkage if it was not set explicitly.
!IF !DEFINED(MRSID_LDLLBUILD)
!IF $(MRSID_LVER)0 < 1110
MRSID_LDLLBUILD = NO
!ELSE
MRSID_LDLLBUILD = YES
!ENDIF
!ENDIF
!ELSE # MRSID_LIDAR_DIR was not defined, so disallow other lidar options
!IF DEFINED(MRSID_LVER)
!ERROR MRSID_LVER specified, but no MrSID Lidar SDK was found.
!ENDIF
!ENDIF
###############################################################################
#
# Set up the build environment: MRSID_FLAGS, MRSID_INCLUDE, MRSID_LIB
#
#
# MRSID_FLAGS
#
!IF DEFINED(MRSID_RASTER_DIR)
!IF "$(MRSID_JP2)" == "YES"
MRSID_FLAGS = -DMRSID_J2K $(MRSID_FLAGS)
!ENDIF
!IF "$(MRSID_ESDK)" == "YES"
MRSID_FLAGS = -DMRSID_ESDK $(MRSID_FLAGS)
!IF "$(MRSID_HAVE_MG4WRITE)" == "YES"
MRSID_FLAGS = -DMRSID_HAVE_MG4WRITE $(MRSID_FLAGS)
!ENDIF
!ENDIF
MRSID_FLAGS = -DMRSID_RVER=$(MRSID_RVER) $(MRSID_FLAGS)
!ENDIF # end raster flags
!IF DEFINED(MRSID_LIDAR_DIR)
MRSID_FLAGS = -DMRSID_LVER=$(MRSID_LVER) $(MRSID_FLAGS)
!ENDIF # end lidar flags
#
# MRSID_INCLUDE
#
!IF DEFINED(MRSID_RASTER_DIR)
!IF $(MRSID_RVER)0 >= 7000
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include" $(MRSID_INCLUDE)
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\base")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\base" $(MRSID_INCLUDE)
!ENDIF
#!IF EXIST("$(MRSID_RASTER_DIR)\include\c_api")
#MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\c_api" $(MRSID_INCLUDE)
#!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\filters")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\filters" $(MRSID_INCLUDE)
!ENDIF
!IF "$(MRSID_JP2)" == "YES" && EXIST("$(MRSID_RASTER_DIR)\include\j2k_readers")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\j2k_readers" $(MRSID_INCLUDE)
!ENDIF
!IF "$(MRSID_JP2)" == "YES" && "$(MRSID_ESDK)" == "YES" && EXIST("$(MRSID_RASTER_DIR)\include\j2k_writers")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\j2k_writers" $(MRSID_INCLUDE)
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\metadata")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\metadata" $(MRSID_INCLUDE)
!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\mrsid_readers")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\mrsid_readers" $(MRSID_INCLUDE)
!ENDIF
!IF "$(MRSID_ESDK)" == "YES" && EXIST("$(MRSID_RASTER_DIR)\include\mrsid_writers")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\mrsid_writers" $(MRSID_INCLUDE)
!ENDIF
#!IF EXIST("$(MRSID_RASTER_DIR)\include\readers")
#MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\readers" $(MRSID_INCLUDE)
#!ENDIF
!IF EXIST("$(MRSID_RASTER_DIR)\include\support")
MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\support" $(MRSID_INCLUDE)
!ENDIF
#!IF EXIST("$(MRSID_RASTER_DIR)\include\writers")
#MRSID_INCLUDE = -I"$(MRSID_RASTER_DIR)\include\writers" $(MRSID_INCLUDE)
#!ENDIF
!ENDIF # end raster includes
!IF DEFINED(MRSID_LIDAR_DIR)
# lidar include paths
MRSID_INCLUDE = -I"$(MRSID_LIDAR_DIR)\include" $(MRSID_INCLUDE)
!ENDIF # end lidar includes
#
# MRSID_LIB
#
!IF DEFINED(MRSID_RASTER_DIR)
!IF "$(MRSID_RDLLBUILD)" == "YES"
#
# Find and validate the specific DLL and add it to MRSID_LIB
!IF "$(MRSID_ESDK)" == "YES"
!ERROR Cannot link dynamically against the MrSID Raster ESDK. Try linking statically by setting MRSID_RDLLBUILD to NO.
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\lti_dsdk.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\lti_dsdk.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\lti_dsdk.dll"
MRSID_DLL_NAME = lti_dsdk.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.0.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\lti_dsdk.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.0.dll"
MRSID_DLL_NAME = lti_dsdk_9.0.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.1.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\lti_dsdk.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.1.dll"
MRSID_DLL_NAME = lti_dsdk_9.1.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.5.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\lti_dsdk.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\lti_dsdk_9.5.dll"
MRSID_DLL_NAME = lti_dsdk_9.5.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk_dll.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk_dll.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk_dll.dll"
MRSID_DLL_NAME = lti_dsdk_dll.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\Release_md\lti_dsdk_dll.dll")
# sdks 5 and older shipped only one configuration of the dll
!ERROR Found a MrSID Raster DLL under $(MRSID_RASTER_DIR)\lib\Release_md, but specified config was $(MRSID_CONFIG). Try setting MRSID_CONFIG to Release_md.
!ELSE IF $(MRSID_RVER)0 < 4090
# mrsid sdks first had dlls in v4.0.9
!ERROR This version of the MrSID Raster SDK ($(MRSID_RVER)) did not ship with DLLs. Try linking statically by setting MRSID_RDLLBUILD to NO.
!ELSE
!ERROR No suitable MrSID Raster DLL was found in $(MRSID_RASTER_DIR)\lib.
!ENDIF # end DLL search
!ELSE # not building against the DLL; use the static lib(s)
#
# Find and validate the specific DSDK static lib and add it to MRSID_LIB.
!IF $(MRSID_RVER)0 >= 8000
!IF EXIST("$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_esdk.lib")
# v8+ esdk has the dsdk symbols folded into a single lib
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_esdk.lib" $(MRSID_LIB)
!ELSE
# v8+ dsdk can only be linked dynamically
!ERROR Cannot link statically against this version of the MrSID Raster DSDK ($(MRSID_RVER)). Try linking dynamically by setting MRSID_RDLLBUILD to YES.
!ENDIF
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk.dll")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk.lib" $(MRSID_LIB)
MRSID_DLL = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_dsdk.dll"
MRSID_DLL_NAME = lti_dsdk.dll
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_sdk.lib")
# very old sdk indeed
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_sdk.lib" $(MRSID_LIB)
!ELSE
!ERROR No suitable MrSID Raster libs were found in $(MRSID_RASTER_DIR)\lib.
!ENDIF # end DSDK lib search
#
# Find and validate the specific JP2 static lib and add it to MRSID_LIB.
!IF "$(MRSID_JP2)" == "YES"
!IF EXIST("$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\lt_lib_kakadu.lib")
MRSID_LIB = "$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\lt_lib_kakadu.lib" $(MRSID_LIB)
!ELSE IF EXIST("$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\ltikdu.lib")
MRSID_LIB = "$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\ltikdu.lib" $(MRSID_LIB)
!ELSE IF $(MRSID_RVER)0 < 5000
!ERROR This version of the MrSID Raster SDK ($(MRSID_RVER)) does not support JPEG 2000.
!ELSE
!ERROR The library needed for MrSID Raster SDK to support JPEG 2000 is missing.
!ENDIF
!ENDIF # end JP2 lib search
#
# Find and validate the specific ESDK static lib(s) and add to MRSID_LIB.
!IF "$(MRSID_ESDK)" == "YES"
# if we still need to add lti_esdk.lib do that first
!IF $(MRSID_RVER)0 < 8000 && EXIST("$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_esdk.lib")
MRSID_LIB = "$(MRSID_RASTER_DIR)\lib\$(MRSID_CONFIG)\lti_esdk.lib" $(MRSID_LIB)
!ENDIF
!IF EXISTS("$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\cryptlib.lib")
MRSID_LIB = "$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\cryptlib.lib" $(MRSID_LIB)
!ENDIF
!IF EXISTS("$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\xmlparse.lib")
MRSID_LIB = "$(MRSID_RASTER_DIR)\3rd-party\lib\$(MRSID_CONFIG)\xmlparse.lib" $(MRSID_LIB)
!ENDIF
!ENDIF # end ESDK lib search
!ENDIF # end static raster build environment
!ENDIF # end raster libs
#
# Add Lidar libs to MRSID_LIB
!IF DEFINED(MRSID_LIDAR_DIR)
!IF "$(MRSID_LDLLBUILD)" == "YES"
#
# Find and validate the specific DLL and add it to MRSID_LIB
!IF EXIST("$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk.dll")
MRSID_LIB = "$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk.lib" $(MRSID_LIB)
LIDAR_DLL = "$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk.dll"
LIDAR_DLL_NAME = lti_lidar_dsdk.dll
!ELSE IF EXIST("$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk_1.1.dll")
MRSID_LIB = "$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk.lib" $(MRSID_LIB)
LIDAR_DLL = "$(MRSID_LIDAR_DIR)\lib\lti_lidar_dsdk_1.1.dll"
LIDAR_DLL_NAME = lti_lidar_dsdk_1.1.dll
!ELSE IF $(MRSID_LVER)0 < 1110
!ERROR Cannot link dynamically against this version of the MrSID Lidar SDK ($(MRSID_LVER)). Try linking statically by setting MRSID_LDLLBUILD to NO.
!ELSE
!ERROR No suitable MrSID Lidar DLL was found in $(MRSID_LIDAR_DIR)\lib.
!ENDIF
!ELSE # not building against the DLL; use the static lib(s)
#
# Find and validate the specific lidar static lib and add it to MRSID_LIB
!IF EXIST("$(MRSID_LIDAR_DIR)\lib\$(MRSID_CONFIG)\lti_lidar_dsdk.lib")
MRSID_LIB = "$(MRSID_LIDAR_DIR)\lib\$(MRSID_CONFIG)\lti_lidar_dsdk.lib" $(MRSID_LIB)
!ELSE IF $(MRSID_LVER)0 >= 1110
# v8+ dsdk can only be linked dynamically
!ERROR Cannot link statically against this version of the MrSID Lidar DSDK ($(MRSID_LVER)). Try linking dynamically by setting MRSID_LDLLBUILD to YES.
!ELSE
!ERROR No suitable MrSID Lidar libs were found under $(MRSID_LIDAR_DIR)\lib.
!ENDIF
!ENDIF # end static lidar build environment
!ENDIF # end lidar build environment
###############################################################################
#
# Report the configuration summary
#
!IF DEFINED(MRSID_SHOW_CONFIG)
!MESSAGE MRSID_DIR = $(MRSID_DIR)
!MESSAGE MRSID_RASTER_DIR = $(MRSID_RASTER_DIR)
!MESSAGE MRSID_RVER = $(MRSID_RVER)
!MESSAGE MRSID_JP2 = $(MRSID_JP2)
!MESSAGE MRSID_ESDK = $(MRSID_ESDK)
!MESSAGE MRSID_RDLLBUILD = $(MRSID_RDLLBUILD)
!MESSAGE MRSID_LIDAR_DIR = $(MRSID_LIDAR_DIR)
!MESSAGE MRSID_LVER = $(MRSID_LVER)
!MESSAGE MRSID_LDLLBUILD = $(MRSID_LDLLBUILD)
!MESSAGE MRSID_CONFIG = $(MRSID_CONFIG)
!MESSAGE MRSID_FLAGS = $(MRSID_FLAGS)
!MESSAGE MRSID_INCLUDE = $(MRSID_INCLUDE)
!MESSAGE MRSID_LIB = $(MRSID_LIB)
!MESSAGE MRSID_DLL = $(MRSID_DLL)
!MESSAGE LIDAR_DLL = $(LIDAR_DLL)
!ENDIF