forked from febiosoftware/FEBioStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindDependencies.cmake
666 lines (595 loc) · 25.3 KB
/
FindDependencies.cmake
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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
# Qt
find_package(${Qt_Version} COMPONENTS Widgets Gui Network OpenGL REQUIRED)
if(Qt_Ver VERSION_EQUAL 6)
find_package(${Qt_Version} COMPONENTS Core5Compat OpenGLWidgets REQUIRED)
endif()
mark_as_advanced(${Qt_Version}_DIR ${Qt_Version}Charts_DIR ${Qt_Version}Core_DIR ${Qt_Version}Gui_DIR ${Qt_Version}Network_DIR ${Qt_Version}OpenGL_DIR
${Qt_Version}Positioning_DIR ${Qt_Version}PrintSupport_DIR ${Qt_Version}QmlModels_DIR ${Qt_Version}Qml_DIR ${Qt_Version}Quick_DIR
${Qt_Version}Widgets_DIR ${Qt_Version}Core5Compat_DIR ${Qt_Version}GuiTools_DIR ${Qt_Version}CoreTools_DIR ${Qt_Version}OpenGLWidgets_DIR
${Qt_Version}WidgetsTools_DIR XKB_INCLUDE_DIR XKB_LIBRARY)
# FEBio
# Find FEBio SDK or git repo automatically
if(WIN32)
set(TEMP_PATHS ${CMAKE_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/../.. $ENV{HOMEPATH}/ $ENV{HOMEPATH}/source/repos $ENV{HOMEPATH}/*)
else()
set(TEMP_PATHS ${CMAKE_SOURCE_DIR}/.. ${CMAKE_SOURCE_DIR}/../.. $ENV{HOME}/ $ENV{HOME}/*)
endif()
find_path(FEBio_SDK FECore/stdafx.h
PATHS ${TEMP_PATHS}
PATH_SUFFIXES FEBio
DOC "Path to the FEBio SDK, or git repo.")
if(NOT FEBio_SDK)
if(WIN32)
set(TEMP_PATHS $ENV{PROGRAMFILES}/* ${CMAKE_SOURCE_DIR}/.. $ENV{HOMEPATH}/* )
elseif(APPLE)
set(TEMP_PATHS /Applications/* ${CMAKE_SOURCE_DIR}/.. $ENV{HOME}/*)
else()
set(TEMP_PATHS ${CMAKE_SOURCE_DIR}/.. $ENV{HOME}/*)
endif()
find_path(FEBio_SDK "include/FECore/stdafx.h"
PATHS ${TEMP_PATHS}
PATH_SUFFIXES sdk
DOC "Path to the FEBio SDK, or git repo.")
endif()
if(NOT FEBio_SDK)
set(FEBio_SDK "" CACHE PATH "Path to the FEBio SDK, or git repo.")
message(FATAL_ERROR "Unable to find path to FEBio SDK or git repo automatically. Please set FEBio_SDK to the path to your FEBio SDK or git repo.")
endif()
# Only update the include and lib directories if the FEBio_SDK path has been changed.
if(NOT OLD_SDK)
set(NEWPATH TRUE)
else()
#cmake_path(CONVERT ${OLD_SDK} TO_CMAKE_PATH_LIST STD_OLD_SDK)
#cmake_path(CONVERT ${FEBio_SDK} TO_CMAKE_PATH_LIST STD_FEBIO_SDK)
#string(COMPARE NOTEQUAL ${STD_FEBIO_SDK} ${STD_OLD_SDK} NEWPATH)
string(COMPARE NOTEQUAL ${FEBio_SDK} ${OLD_SDK} NEWPATH)
endif()
if(NEWPATH)
# Is this the SDK?
string(REGEX MATCH "sdk" IS_SDK ${FEBio_SDK})
set(LIB_SUFFIXES "")
if(IS_SDK)
set(FEBio_INC "${FEBio_SDK}/include" CACHE PATH "Path to FEBio include directory." FORCE)
if(WIN32)
list(APPEND LIB_SUFFIXES "lib" "lib/Release" "vs2017/Release" "vs2017/Debug")
else()
list(APPEND LIB_SUFFIXES "lib")
endif()
else()
set(FEBio_INC ${FEBio_SDK} CACHE PATH "Path to FEBio include directory." FORCE)
if(WIN32)
list(APPEND LIB_SUFFIXES "lib" "lib/Release" "cmbuild/lib/Release" "cmbuild/lib/Debug" "cbuild/lib/Release" "cbuild/lib/Debug" "build/lib/Release" "build/lib/Debug")
else()
list(APPEND LIB_SUFFIXES "cbuild/lib" "cmbuild/lib" "build/lib" "cbuild/Release/lib" "cmbuild/Release/lib" "build/Release/lib" "cbuild/Debug/lib" "cmbuild/Debug/lib" "build/Debug/lib")
endif()
endif()
mark_as_advanced(FEBio_INC)
# Find lib path
find_library(FECORE
NAMES FECore fecore fecore_gcc64 fecore_lnx64
PATHS ${FEBio_SDK}
PATH_SUFFIXES ${LIB_SUFFIXES}
DOC "FEBio library path")
if(FECORE)
get_filename_component(FECORE_TEMP ${FECORE} DIRECTORY)
set(FEBio_LIB_DIR ${FECORE_TEMP} CACHE PATH "Path to the FEBio lib directory." FORCE)
mark_as_advanced(FEBio_LIB_DIR)
unset(FECORE_TEMP)
unset(FECORE CACHE)
else()
set(FEBio_LIB_DIR CACHE PATH "Path to the FEBio lib directory." FORCE)
message(SEND_ERROR "Unable to find FEBio Library path automatically. Set FEBio_LIB_DIR.")
unset(FECORE CACHE)
endif()
endif()
set(OLD_SDK ${FEBio_SDK} CACHE INTERNAL "Old SDK path.")
mark_as_advanced(OLD_SDK)
# Teem
if(WIN32)
find_path(TEEM_INC teem/nrrd.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "include/teem*" "src" "build" "build/include"
DOC "Teem include directory")
find_library(TEEM_LIB teem
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/bin" "src/build/bin" "Release" "Debug"
DOC "Teem library path")
else()
find_path(TEEM_INC teem/nrrd.h
PATHS /opt/hypre* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "include/teem" "build" "build/include" "src"
DOC "Teem include directory")
find_library(TEEM_LIB teem
PATHS /opt/teem* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "build/bin" "build/lib" "src/build/bin" "src/build/lib" "Release" "Debug"
DOC "Teem library path")
endif()
if(TEEM_LIB)
get_filename_component(TEEM_TEMP ${TEEM_LIB} DIRECTORY)
set(TEEM_LIB_DIR ${TEEM_TEMP} CACHE PATH "Path to the Teem lib directory (e.g. /opt/teem/bin)")
unset(TEEM_TEMP)
unset(TEEM_LIB CACHE)
else()
set(TEEM_LIB_DIR CACHE PATH "Path to the Teem lib directory (e.g. /opt/teem/bin)")
unset(TEEM_LIB CACHE)
endif()
# Libtiff
if(WIN32)
find_path(LIBTIFF_INC tiffio.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "src" "build" "build/include"
DOC "LibTiff include directory")
find_library(LIBTIFF_LIB tiff
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "src/build/lib" "Release" "Debug"
DOC "LibTiff library path")
else()
find_path(LIBTIFF_INC tiffio.h
PATHS /opt/hypre* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "build" "build/include" "src"
DOC "LibTiff include directory")
find_library(LIBTIFF_LIB tiff
PATHS /opt/libtiff* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "build/bin" "build/lib" "src/build/bin" "src/build/lib" "Release" "Debug"
DOC "LibTiff library path")
endif()
if(LIBTIFF_LIB)
get_filename_component(LIBTIFF_TEMP ${LIBTIFF_LIB} DIRECTORY)
set(LIBTIFF_LIB_DIR ${LIBTIFF_TEMP} CACHE PATH "Path to the LibTiff lib directory (e.g. /opt/libtiff/lib)")
unset(LIBTIFF_TEMP)
unset(LIBTIFF_LIB CACHE)
else()
set(LIBTIFF_LIB_DIR CACHE PATH "Path to the LibTiff lib directory (e.g. /opt/libtiff/lib)")
unset(LIBTIFF_LIB CACHE)
endif()
if(LIBTIFF_INC AND LIBTIFF_LIB_DIR AND TEEM_INC AND TEEM_LIB_DIR)
option(USE_TEEM "Required for Teem use" ON)
mark_as_advanced(TEEM_INC TEEM_LIB_DIR)
else()
option(USE_TEEM "Required for Teem use" OFF)
mark_as_advanced(CLEAR TEEM_INC TEEM_LIB_DIR)
endif()
# Dicom
if(WIN32)
find_path(DICOM_INC dcmtk/dcmimgle/dcmimage.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "include/dcmtk*" "src" "build" "build/dcmtk"
DOC "Dicom include directory")
find_library(DICOM_LIB dcmimgle
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "src/build/lib" "Release" "Debug"
DOC "Dicom library path")
else()
find_path(DICOM_INC dcmtk/dcmimgle/dcmimage.h
PATHS /opt/hypre* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "include/dcmtk*" "build" "build/include/dcmtk" "src"
DOC "Dicom include directory")
find_library(DICOM_LIB dcmimgle
PATHS /opt/teem* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "build/bin" "build/lib" "src/build/bin" "src/build/lib" "Release" "Debug"
DOC "Dicom library path")
endif()
if(DICOM_LIB)
get_filename_component(DICOM_TEMP ${DICOM_LIB} DIRECTORY)
set(DICOM_LIB_DIR ${DICOM_TEMP} CACHE PATH "Path to the Dicom lib directory (e.g. /opt/dcmtk/lib)")
unset(DICOM_TEMP)
unset(DICOM_LIB CACHE)
else()
set(DICOM_LIB_DIR CACHE PATH "Path to the Dicom lib directory (e.g. /opt/dcmtk/lib)")
unset(DICOM_LIB CACHE)
endif()
if(DICOM_INC AND DICOM_LIB_DIR)
option(USE_DICOM "Required for Dicom use" ON)
mark_as_advanced(DICOM_INC DICOM_LIB_DIR)
else()
option(USE_DICOM "Required for Dicom use" OFF)
mark_as_advanced(CLEAR DICOM_INC DICOM_LIB_DIR)
endif()
# MMG
if(WIN32)
find_path(MMG_INC mmg/mmg3d/libmmg3d.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "include/mmg*" "src" "build" "build/include"
DOC "MMG include directory")
find_library(MMG_LIB mmg3d
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "MMG library path")
else()
find_path(MMG_INC mmg/mmg3d/libmmg3d.h
PATHS /opt/hypre* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "include/mmg" "build" "build/include" "cbuild" "cbuild/include" "src"
DOC "MMG include directory")
find_library(MMG_LIB mmg3d
PATHS /opt/mmg* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "build/lib" "cbuild/lib" "src/build/lib" "src/cbuild/lib" "Release" "Debug"
DOC "MMG library path")
endif()
if(MMG_LIB)
get_filename_component(MMG_TEMP ${MMG_LIB} DIRECTORY)
set(MMG_LIB_DIR ${MMG_TEMP} CACHE PATH "Path to the MMG lib directory (e.g. /opt/mmg/lib)")
unset(MMG_TEMP)
unset(MMG_LIB CACHE)
else()
set(MMG_LIB_DIR CACHE PATH "Path to the MMG lib directory (e.g. /opt/mmg/lib)")
unset(MMG_LIB CACHE)
endif()
if(MMG_INC AND MMG_LIB_DIR)
option(USE_MMG "Required for MMG use" ON)
mark_as_advanced(MMG_INC MMG_LIB_DIR)
else()
option(USE_MMG "Required for MMG use" OFF)
mark_as_advanced(CLEAR MMG_INC MMG_LIB_DIR)
endif()
set(MMG_DBG_LIB_DIR CACHE PATH "Path to the MMG debug lib directory")
mark_as_advanced(MMG_DBG_LIB_DIR)
# TETGEN
if(WIN32)
find_path(TETGEN_INC tetgen.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "include/tetgen*" "src" "build" "build/include"
DOC "TetGen include directory")
find_library(TETGEN_LIB tetgen
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "x64/Release" "x64/Debug"
DOC "TetGen library path")
else()
find_path(TETGEN_INC tetgen.h
PATHS /opt/tetgen* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "include/tetgen*" "src" "build" "build/include"
DOC "TetGen include directory")
find_library(TETGEN_LIB tet
PATHS /opt/tetgen* $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "build" "cbuild" "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "TetGen library path")
endif()
if(TETGEN_LIB)
get_filename_component(TETGEN_TEMP ${TETGEN_LIB} DIRECTORY)
set(TETGEN_LIB_DIR ${TETGEN_TEMP} CACHE PATH "Path to the TET lib directory (e.g. /opt/tetgen/lib)")
unset(TETGEN_TEMP)
unset(TETGEN_LIB CACHE)
else()
set(TETGEN_LIB_DIR "TETGEN_LIB_DIR-NOTFOUND" CACHE PATH "Path to the TET lib directory (e.g. /opt/tetgen/lib)")
unset(TETGEN_LIB CACHE)
endif()
if(TETGEN_INC AND TETGEN_LIB_DIR)
option(USE_TETGEN "Required for adaptive remeshing" ON)
mark_as_advanced(TETGEN_INC TETGEN_LIB_DIR)
else()
option(USE_TETGEN "Required for adaptive remeshing" OFF)
mark_as_advanced(CLEAR TETGEN_INC TETGEN_LIB_DIR)
endif()
set(TETGEN_DBG_LIB_DIR CACHE PATH "Path to the TET debug lib directory")
mark_as_advanced(TETGEN_DBG_LIB_DIR)
# OpenCascade
if(WIN32)
find_path(OCCT_INC gp_Pnt.hxx
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "/opencascade" "include/opencascade" "opencascade/include/opencascade" "build/opencascade" "build/include/opencascade"
DOC "OpenCascade include directory")
find_library(OCCT_LIB TKernel
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "OpenCascade library path")
else()
find_path(OCCT_INC gp_Pnt.hxx
PATHS /opt/opencascade $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "/opencascade" "include/opencascade" "opencascade/include/opencascade" "build/opencascade" "build/include/opencascade"
DOC "OpenCascade include directory")
find_library(OCCT_LIB TKernel
PATHS /opt/opencascade $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "opencascade/lib" "build" "build/lib" "Release" "Debug"
DOC "OpenCascade library path")
endif()
if(OCCT_LIB)
get_filename_component(OCCT_TEMP ${OCCT_LIB} DIRECTORY)
set(OCCT_LIB_DIR ${OCCT_TEMP} CACHE PATH "Path to the OpenCascade lib directory (e.g. /opt/opencascade/lib)")
unset(OCCT_TEMP)
unset(OCCT_LIB CACHE)
else()
set(OCCT_LIB_DIR "OCCT_LIB_DIR-NOTFOUND" CACHE PATH "Path to the OpenCascade lib directory (e.g. /opt/opencascade/lib)")
unset(OCCT_LIB CACHE)
endif()
if(OCCT_INC AND OCCT_LIB_DIR)
mark_as_advanced(OCCT_INC OCCT_LIB_DIR)
else()
mark_as_advanced(CLEAR OCCT_INC OCCT_LIB_DIR)
endif()
set(OCCT_DBG_LIB_DIR CACHE PATH "Path to the OpenCascade debug lib directory")
mark_as_advanced(OCCT_DBG_LIB_DIR)
# NETGEN
if(WIN32)
find_path(NETGEN_INC include/occgeom.hpp
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "netgen/include" "build" "build/include"
DOC "Netgen include directory")
find_library(NETGEN_LIB nglib
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "Netgen library path")
else()
find_path(NETGEN_INC include/occgeom.hpp
PATHS /opt/netgen* $ENV{HOME}/* $ENV{HOME}/*/* /Applications/Netgen.app/Contents/Resources/include
PATH_SUFFIXES "include" "netgen/include" "build" "build/include"
DOC "Netgen include directory")
find_library(NETGEN_LIB nglib
PATHS /opt/netgen* $ENV{HOME}/* $ENV{HOME}/*/* /Applications/Netgen.app/Contents/MacOS
PATH_SUFFIXES "lib" "netgen/lib" "build" "build/lib" "Release" "Debug"
DOC "Netgen library path")
endif()
if(NETGEN_LIB)
get_filename_component(NETGEN_TEMP ${NETGEN_LIB} DIRECTORY)
set(NETGEN_LIB_DIR ${NETGEN_TEMP} CACHE PATH "Path to the Netgen lib directory (e.g. /opt/netgen/lib)")
unset(NETGEN_TEMP)
unset(NETGEN_LIB CACHE)
else()
set(NETGEN_LIB_DIR "NETGEN_LIB_DIR-NOTFOUND" CACHE PATH "Path to the Netgen lib directory (e.g. /opt/netgen/lib)")
unset(NETGEN_LIB CACHE)
endif()
if(NETGEN_INC AND NETGEN_LIB_DIR)
mark_as_advanced(NETGEN_INC NETGEN_LIB_DIR)
else()
mark_as_advanced(CLEAR NETGEN_INC NETGEN_LIB_DIR)
endif()
if(NETGEN_INC AND NETGEN_LIB_DIR AND OCCT_INC AND OCCT_LIB_DIR)
option(CAD_FEATURES "Required for importing and meshing CAD objects" ON)
else()
SET(CAD_FEATURES OFF CACHE BOOL "Required for importing and meshing CAD objects" FORCE)
endif()
set(NETGEN_DBG_LIB_DIR CACHE PATH "Path to the Netgen debug lib directory")
mark_as_advanced(NETGEN_DBG_LIB_DIR)
# LibSSH
if(WIN32)
find_path(SSH_INC libssh/libssh.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "libssh/include" "build" "build/include"
DOC "LibSSH include directory")
find_library(SSH_LIB ssh
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "LibSSH library path")
else()
find_path(SSH_INC libssh/libssh.h
PATHS /opt/libssh /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "libssh/include" "build" "build/include"
DOC "LibSSH include directory")
find_library(SSH_LIB ssh
PATHS /opt/libssh /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "libssh/lib" "build" "build/lib" "Release" "Debug"
DOC "LibSSH library path")
endif()
if(SSH_LIB)
get_filename_component(SSH_TEMP ${SSH_LIB} DIRECTORY)
set(SSH_LIB_DIR ${SSH_TEMP} CACHE PATH "Path to the LibSSH lib directory (e.g. /opt/libssh/lib)")
unset(SSH_TEMP)
unset(SSH_LIB CACHE)
else()
set(SSH_LIB_DIR "SSH_LIB_DIR-NOTFOUND" CACHE PATH "Path to the LibSSH lib directory (e.g. /opt/libssh/lib)")
unset(SSH_LIB CACHE)
endif()
if(SSH_INC AND SSH_LIB_DIR)
option(USE_SSH "Required for running jobs on remote machines." ON)
mark_as_advanced(SSH_INC SSH_LIB_DIR)
else()
option(USE_SSH "Required for running jobs on remote machines." OFF)
mark_as_advanced(CLEAR SSH_INC SSH_LIB_DIR)
endif()
set(SSH_DBG_LIB_DIR CACHE PATH "Path to the LibSSH debug lib directory")
mark_as_advanced(SSH_DBG_LIB_DIR)
# OpenSSL
if(WIN32)
find_path(SSL_INC openssl/aes.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "openssl/include" "build" "build/include"
DOC "OpenSSL include directory")
find_library(SSL_LIB ssl
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "OpenSSL library path")
elseif(APPLE)
find_path(SSL_INC openssl/aes.h
PATHS /opt/openssl /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "openssl/include" "build" "build/include"
DOC "OpenSSL include directory")
find_library(SSL_LIB ssl
PATHS /opt/openssl /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "openssl/lib" "build" "build/lib" "Release" "Debug"
DOC "OpenSSL library path"
NO_DEFAULT_PATH)
else()
find_path(SSL_INC openssl/aes.h
PATHS /opt/openssl /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "openssl/include" "build" "build/include"
DOC "OpenSSL include directory")
find_library(SSL_LIB ssl
PATHS /opt/openssl /usr/local/opt/ $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "openssl/lib" "build" "build/lib" "Release" "Debug"
DOC "OpenSSL library path")
endif()
if(SSL_LIB)
get_filename_component(SSL_TEMP ${SSL_LIB} DIRECTORY)
set(SSL_LIB_DIR ${SSL_TEMP} CACHE PATH "Path to the OpenSSL lib directory (e.g. /opt/openssl/lib)")
unset(SSL_TEMP)
unset(SSL_LIB CACHE)
else()
set(SSL_LIB_DIR "SSL_LIB_DIR-NOTFOUND" CACHE PATH "Path to the OpenSSL lib directory (e.g. /opt/openssl/lib)")
unset(SSL_LIB CACHE)
endif()
if(SSL_INC AND SSL_LIB_DIR AND USE_SSH)
option(USE_SSH "Required for running jobs on remote machines." ON)
mark_as_advanced(SSL_INC SSL_LIB_DIR)
else()
option(USE_SSH "Required for running jobs on remote machines." OFF)
mark_as_advanced(CLEAR SSL_INC SSL_LIB_DIR)
endif()
set(SSL_DBG_LIB_DIR CACHE PATH "Path to the OpenSSL debug lib directory")
mark_as_advanced(SSL_DBG_LIB_DIR)
# QuaZip
if(Qt_Ver VERSION_EQUAL 6)
set(QUAZIP_NAMES quazip1-qt6 quazip6 quazip quazip1-qt6d)
else()
set(QUAZIP_NAMES quazip5 quazip)
endif()
if(WIN32)
find_path(QUAZIP_INC quazip.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "/quazip5" "include/quazip5" "quazip/include/quazip5" "build/quazip5" "build/include/quazip5"
DOC "QuaZip include directory")
find_library(QUAZIP_LIB
NAMES ${QUAZIP_NAMES}
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "QuaZip library path")
elseif(APPLE)
find_path(QUAZIP_INC quazip.h
PATHS /usr/include/* /opt/quazip $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "/quazip" "include/quazip" "quazip/include/quazip" "build/quazip" "build/include/quazip"
DOC "QuaZip include directory")
find_library(QUAZIP_LIB
NAMES ${QUAZIP_NAMES}
PATHS /opt/quazip $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "quazip/lib" "build" "build/lib" "Release" "Debug"
DOC "QuaZip library path")
else()
find_path(QUAZIP_INC quazip.h
PATHS /opt/quazip $ENV{HOME}/* $ENV{HOME}/*/* /usr/local/include/*
PATH_SUFFIXES "/quazip5" "include/quazip5" "quazip/include/quazip5" "build/quazip5" "build/include/quazip5"
DOC "QuaZip include directory")
find_library(QUAZIP_LIB
NAMES ${QUAZIP_NAMES}
PATHS /opt/quazip $ENV{HOME}/* $ENV{HOME}/*/* /usr/local/ /usr/local/*
PATH_SUFFIXES "lib" "lib64" "quazip/lib" "quazip/build/quazip" "build" "build/lib" "Release" "Debug"
DOC "QuaZip library path")
endif()
if(QUAZIP_LIB)
get_filename_component(QUAZIP_NAME ${QUAZIP_LIB} NAME)
get_filename_component(QUAZIP_TEMP ${QUAZIP_LIB} DIRECTORY)
set(QUAZIP_LIB_DIR ${QUAZIP_TEMP} CACHE PATH "Path to the QuaZip lib directory (e.g. /opt/quazip/lib)")
unset(QUAZIP_TEMP)
unset(QUAZIP_LIB CACHE)
else()
set(QUAZIP_LIB_DIR "QUAZIP_LIB_DIR-NOTFOUND" CACHE PATH "Path to the QuaZip lib directory (e.g. /opt/quazip/lib)")
unset(QUAZIP_LIB CACHE)
endif()
if(QUAZIP_INC AND QUAZIP_LIB_DIR)
mark_as_advanced(QUAZIP_INC QUAZIP_LIB_DIR)
else()
mark_as_advanced(CLEAR QUAZIP_INC QUAZIP_LIB_DIR)
endif()
set(QUAZIP_DBG_LIB_DIR CACHE PATH "Path to the QuaZip debug lib directory")
mark_as_advanced(QUAZIP_DBG_LIB_DIR)
# SQLite
if(WIN32)
find_path(SQLITE_INC sqlite3.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "sqlite/include" "build" "build/include"
DOC "SQLite include directory")
find_library(SQLITE_LIB sqlite3
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "SQLite library path")
else()
find_path(SQLITE_INC sqlite3.h
PATHS /opt/sqlite $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "sqlite/include" "build" "build/include"
DOC "SQLite include directory")
find_library(SQLITE_LIB sqlite3
PATHS /opt/sqlite $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "sqlite/lib" "build" "build/lib" "libs" "sqlite/libs" "build" "build/libs" "Release" "Debug"
DOC "SQLite library path")
endif()
if(SQLITE_LIB)
get_filename_component(SQLITE_TEMP ${SQLITE_LIB} DIRECTORY)
set(SQLITE_LIB_DIR ${SQLITE_TEMP} CACHE PATH "Path to the SQLite lib directory (e.g. /opt/sqlite/lib)")
unset(SQLITE_TEMP)
unset(SQLITE_LIB CACHE)
else()
set(SQLITE_LIB_DIR "SQLITE_LIB_DIR-NOTFOUND" CACHE PATH "Path to the SQLite lib directory (e.g. /opt/sqlite/lib)")
unset(SQLITE_LIB CACHE)
endif()
if(SQLITE_INC AND SQLITE_LIB_DIR)
mark_as_advanced(SQLITE_INC SQLITE_LIB_DIR)
else()
mark_as_advanced(CLEAR SQLITE_INC SQLITE_LIB_DIR)
endif()
if(SQLITE_INC AND SQLITE_LIB_DIR AND QUAZIP_INC AND QUAZIP_LIB_DIR)
option(MODEL_REPO "Build code to connect to the Model Repository." ON)
else()
SET(MODEL_REPO OFF CACHE BOOL "Build code to connect to the Model Repository." FORCE)
endif()
set(SQLITE_DBG_LIB_DIR CACHE PATH "Path to the SQLite debug lib directory")
mark_as_advanced(SQLITE_DBG_LIB_DIR)
# FFMPEG
if(WIN32)
find_path(FFMPEG_INC libavformat/libavformat.h
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "include" "ffmpeg/include" "build" "build/include"
DOC "FFMPEG include directory")
find_library(FFMPEG_LIB avformat
PATHS C:/Program\ Files/* $ENV{HOMEPATH}/* $ENV{HOMEPATH}/*/*
PATH_SUFFIXES "build/lib" "cmbuild/lib" "src/build/lib" "src/cmbuild/lib" "Release" "Debug"
DOC "FFMPEG library path")
elseif(APPLE)
find_path(FFMPEG_INC libavformat/avformat.h
PATHS /usr/local/opt/ /opt/ffmpeg $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "include" "ffmpeg/include" "build" "build/include"
DOC "FFMPEG include directory"
NO_DEFAULT_PATH)
find_library(FFMPEG_LIB avformat
PATHS /usr/local/opt/ /opt/ffmpeg $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "ffmpeg/lib" "build" "build/lib" "Release" "Debug"
DOC "FFMPEG library path"
NO_DEFAULT_PATH)
else()
find_path(FFMPEG_INC libavformat/avformat.h
PATHS /usr/include/ /opt/ffmpeg $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "ffmpeg" "ffmpeg/include" "build" "build/include"
DOC "FFMPEG include directory")
find_library(FFMPEG_LIB avformat
PATHS /opt/ffmpeg $ENV{HOME}/* $ENV{HOME}/*/*
PATH_SUFFIXES "lib" "ffmpeg/lib" "build" "build/lib" "Release" "Debug"
DOC "FFMPEG library path")
endif()
if(FFMPEG_LIB)
get_filename_component(FFMPEG_TEMP ${FFMPEG_LIB} DIRECTORY)
set(FFMPEG_LIB_DIR ${FFMPEG_TEMP} CACHE PATH "Path to the FFMPEG lib directory (e.g. /opt/ffmpeg/lib)")
unset(FFMPEG_TEMP)
unset(FFMPEG_LIB CACHE)
else()
set(FFMPEG_LIB_DIR "FFMPEG_LIB_DIR-NOTFOUND" CACHE PATH "Path to the FFMPEG lib directory (e.g. /opt/ffmpeg/lib)")
unset(FFMPEG_LIB CACHE)
endif()
if(FFMPEG_INC AND FFMPEG_LIB_DIR)
option(USE_FFMPEG "Required to export mpeg videos." ON)
mark_as_advanced(FFMPEG_INC FFMPEG_LIB_DIR)
else()
option(USE_FFMPEG "Required to export mpeg videos." OFF)
mark_as_advanced(CLEAR FFMPEG_INC FFMPEG_LIB_DIR)
endif()
set(FFMPEG_DBG_LIB_DIR CACHE PATH "Path to the FFMPEG debug lib directory")
mark_as_advanced(FFMPEG_DBG_LIB_DIR)
# OpenGL
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
# ZLIB
find_package(ZLIB)
if(ZLIB_INCLUDE_DIR AND ZLIB_LIBRARY_RELEASE)
option(USE_ZLIB "Required for reading compressed xplt files" ON)
mark_as_advanced(ZLIB_INCLUDE_DIR ZLIB_LIBRARY_RELEASE)
else()
option(USE_ZLIB "Required for reading compressed xplt files" OFF)
mark_as_advanced(CLEAR ZLIB_INCLUDE_DIR ZLIB_LIBRARY_RELEASE)
endif()
# OpenMP
if(NOT WIN32)
find_package(OpenMP QUIET)
endif()
#ITK
#~ find_package(ITK)
if(DEFINED ITK_USE_FILE)
option(USE_ITK "Required to import most image files." ON)
else()
option(USE_ITK "Required to import most image files." OFF)
endif()
# SITK
find_package(SimpleITK QUIET)