forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSearchInstalledSoftware.cmake
More file actions
1157 lines (1095 loc) · 45.4 KB
/
SearchInstalledSoftware.cmake
File metadata and controls
1157 lines (1095 loc) · 45.4 KB
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
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#---Check for installed packages depending on the build options/components eamnbled -
include(ExternalProject)
include(FindPackageHandleStandardArgs)
set(repository_tarfiles http://service-spi.web.cern.ch/service-spi/external/tarFiles)
#---On MacOSX, try to find frameworks after standard libraries or headers------------
set(CMAKE_FIND_FRAMEWORK LAST)
#---Check for Cocoa/Quartz graphics backend (MacOS X only)
if(cocoa)
if(APPLE)
set(x11 OFF CACHE BOOL "" FORCE)
set(builtin_freetype ON CACHE BOOL "" FORCE)
else()
message(STATUS "Cocoa option can only be enabled on MacOSX platform")
set(cocoa OFF CACHE BOOL "" FORCE)
endif()
endif()
#---Check for Zlib ------------------------------------------------------------------
if(NOT builtin_zlib)
message(STATUS "Looking for ZLib")
find_Package(ZLIB)
if(NOT ZLIB_FOUND)
message(STATUS "Zlib not found. Switching on builtin_zlib option")
set(builtin_zlib ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_zlib)
set(ZLIB_LIBRARY "" CACHE PATH "" FORCE)
endif()
#---Check for Freetype---------------------------------------------------------------
if(NOT builtin_freetype)
message(STATUS "Looking for Freetype")
find_package(Freetype)
if(FREETYPE_FOUND)
set(FREETYPE_INCLUDE_DIR ${FREETYPE_INCLUDE_DIR_freetype2})
else()
message(STATUS "FreeType not found. Switching on builtin_freetype option")
set(builtin_freetype ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_freetype)
set(freetype_version 2.6.1)
message(STATUS "Building freetype version ${freetype_version} included in ROOT itself")
if(WIN32)
if(winrtdebug)
set(freetypeliba objs/freetype261MT_D.lib)
set(freetypebuild "freetype - Win32 Debug Multithreaded")
else()
set(freetypeliba objs/freetype261MT.lib)
set(freetypebuild "freetype - Win32 Release Multithreaded")
endif()
ExternalProject_Add(
FREETYPE
URL ${CMAKE_SOURCE_DIR}/graf2d/freetype/src/freetype-${freetype_version}.tar.gz
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/freetype/src/win32 builds/windows/visualc/.
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND} -E chdir builds/windows/visualc/
nmake -nologo -f freetype.mak CFG=${freetypebuild} NMAKECXXFLAGS=-D_CRT_SECURE_NO_DEPRECATE
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${freetypeliba} ./libs/freetype.lib
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
else()
set(_freetype_cflags -O)
if(ROOT_ARCHITECTURE MATCHES aix)
set(_freetype_zlib --without-zlib)
endif()
ExternalProject_Add(
FREETYPE
URL ${CMAKE_SOURCE_DIR}/graf2d/freetype/src/freetype-${freetype_version}.tar.gz
CONFIGURE_COMMAND ./configure --prefix <INSTALL_DIR> --with-pic
--disable-shared --with-png=no --with-bzip2=no
--with-harfbuzz=no ${_freetype_zlib}
CC=${CMAKE_C_COMPILER} CFLAGS=${_freetype_cflags}
INSTALL_COMMAND ""
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
endif()
ExternalProject_Get_Property(FREETYPE SOURCE_DIR)
set(FREETYPE_INCLUDE_DIR ${SOURCE_DIR}/include)
set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIR})
set(FREETYPE_LIBRARY ${SOURCE_DIR}/objs/.libs/${CMAKE_STATIC_LIBRARY_PREFIX}freetype${CMAKE_STATIC_LIBRARY_SUFFIX})
set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
endif()
#---Check for PCRE-------------------------------------------------------------------
if(NOT builtin_pcre)
message(STATUS "Looking for PCRE")
find_package(PCRE)
if(PCRE_FOUND)
else()
message(STATUS "PCRE not found. Switching on builtin_pcre option")
set(builtin_pcre ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_pcre)
set(pcre_version 8.37)
message(STATUS "Building pcre version ${pcre_version} included in ROOT itself")
if(WIN32)
if(winrtdebug)
set(pcrebuild "libpcre - Win32 Debug")
else()
set(pcrebuild "libpcre - Win32 Release")
endif()
ExternalProject_Add(
PCRE
URL ${CMAKE_SOURCE_DIR}/core/pcre/src/pcre-${pcre_version}.tar.gz
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/core/pcre/src/win32 .
CONFIGURE_COMMAND ""
BUILD_COMMAND ${CMAKE_COMMAND} nmake -nologo -f Makefile.msc
CFG=${pcrebuild} NMCXXFLAGS=${CMAKE_CC_FLAGS}
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different libpcre-8.37.lib <INSTALL_DIR>/lib/pcre.lib
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcre.h <INSTALL_DIR>/include
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcre_scanner.h <INSTALL_DIR>/include
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcre_stringpiece.h <INSTALL_DIR>/include
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcrecpp.h <INSTALL_DIR>/include
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcrecpparg.h <INSTALL_DIR>/include
COMMAND ${CMAKE_COMMAND} -E copy_if_different pcreposix.h <INSTALL_DIR>/include
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
else()
set(_pcre_cflags -O)
ExternalProject_Add(
PCRE
URL ${CMAKE_SOURCE_DIR}/core/pcre/src/pcre-${pcre_version}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND ./configure --prefix <INSTALL_DIR> --with-pic --disable-shared
CC=${CMAKE_C_COMPILER} CFLAGS=${_pcre_cflags}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
endif()
set(PCRE_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
set(PCRE_LIBRARY ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre${CMAKE_STATIC_LIBRARY_SUFFIX})
set(PCRE_LIBRARIES ${PCRE_LIBRARY})
endif()
#---Check for LZMA-------------------------------------------------------------------
if(NOT builtin_lzma)
message(STATUS "Looking for LZMA")
find_package(LZMA)
if(LZMA_FOUND)
else()
message(STATUS "LZMA not found. Switching on builtin_lzma option")
set(builtin_lzma ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_lzma)
set(lzma_version 5.2.1)
message(STATUS "Building LZMA version ${lzma_version} included in ROOT itself")
if(WIN32)
ExternalProject_Add(
LZMA
URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}-win32.tar.gz
#URL_MD5 65693dc257802b6778c28ed53ecca678
PREFIX LZMA
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy lib/liblzma.dll <INSTALL_DIR>/bin
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
install(FILES ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/lib/liblzma.dll DESTINATION ${CMAKE_INSTALL_BINDIR})
set(LZMA_LIBRARIES ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/lib/liblzma.lib)
set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/LZMA/src/LZMA/include)
else()
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(LZMA_CFLAGS "-Wno-format-nonliteral")
set(LZMA_LDFLAGS "-Qunused-arguments")
elseif( CMAKE_CXX_COMPILER_ID STREQUAL Intel)
set(LZMA_CFLAGS "-wd188 -wd181 -wd1292 -wd10006 -wd10156 -wd2259 -wd981 -wd128 -wd3179 -wd2102")
endif()
ExternalProject_Add(
LZMA
URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}.tar.gz
URL_MD5 3e44c766c3fb4f19e348e646fcd5778a
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --libdir <INSTALL_DIR>/lib
--with-pic --disable-shared --quiet
CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} CFLAGS=${LZMA_CFLAGS} LDFLAGS=${LZMA_LDFLAGS}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
set(LZMA_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lzma${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
endif()
endif()
#---Check for LZ4--------------------------------------------------------------------
if(NOT builtin_lz4)
message(STATUS "Looking for LZ4")
find_package(LZ4)
if(LZ4_FOUND)
else()
message(STATUS "LZ4 not found. Switching on builtin_lz4 option")
set(builtin_lz4 ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_lz4)
set(lz4_version r127)
message(STATUS "Building LZ4 version ${lz4_version} included in ROOT itself")
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(LZ4_CFLAGS "-Wno-format-nonliteral")
elseif( CMAKE_CXX_COMPILER_ID STREQUAL Intel)
set(LZ4_CFLAGS "-wd188 -wd181 -wd1292 -wd10006 -wd10156 -wd2259 -wd981 -wd128 -wd3179")
endif()
ExternalProject_Add(
LZ4
URL ${CMAKE_SOURCE_DIR}/core/lz4/src/lz4-${lz4_version}.tar.gz
URL_MD5 5ec580285a5c9bf1e5db3df0fce980b1
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND cd <SOURCE_DIR>/cmake_unofficial && cmake . -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DBUILD_LIBS=1 -DCMAKE_C_FLAGS:STRING=-fPIC -O3
BUILD_COMMAND cd cmake_unofficial && make
INSTALL_COMMAND cd cmake_unofficial && make install
BUILD_IN_SOURCE 1)
set(LZ4_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lz4${CMAKE_STATIC_LIBRARY_SUFFIX})
set(LZ4_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
endif()
#---Check for X11 which is mandatory lib on Unix--------------------------------------
if(x11)
message(STATUS "Looking for X11")
if(X11_X11_INCLUDE_PATH)
set(X11_FIND_QUIETLY 1)
endif()
find_package(X11 REQUIRED)
if(X11_FOUND)
list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
if(NOT X11_FIND_QUIETLY)
message(STATUS "X11_INCLUDE_DIR: ${X11_INCLUDE_DIR}")
message(STATUS "X11_LIBRARIES: ${X11_LIBRARIES}")
endif()
else()
message(FATAL_ERROR "libX11 and X11 headers must be installed.")
endif()
if(X11_Xpm_FOUND)
if(NOT X11_FIND_QUIETLY)
message(STATUS "X11_Xpm_INCLUDE_PATH: ${X11_Xpm_INCLUDE_PATH}")
message(STATUS "X11_Xpm_LIB: ${X11_Xpm_LIB}")
endif()
else()
message(FATAL_ERROR "libXpm and Xpm headers must be installed.")
endif()
if(X11_Xft_FOUND)
if(NOT X11_FIND_QUIETLY)
message(STATUS "X11_Xft_INCLUDE_PATH: ${X11_Xft_INCLUDE_PATH}")
message(STATUS "X11_Xft_LIB: ${X11_Xft_LIB}")
endif()
set(xft ON)
else()
message(FATAL_ERROR "libXft and Xft headers must be installed.")
endif()
if(X11_Xext_FOUND)
if(NOT X11_FIND_QUIETLY)
message(STATUS "X11_Xext_INCLUDE_PATH: ${X11_Xext_INCLUDE_PATH}")
message(STATUS "X11_Xext_LIB: ${X11_Xext_LIB}")
endif()
else()
message(FATAL_ERROR "libXext and Xext headers must be installed.")
endif()
else()
set(xft OFF)
endif()
#---Check for all kind of graphics includes needed by libAfterImage--------------------
if(asimage)
if(NOT x11 AND NOT cocoa)
message(STATUS "Switching off 'asimage' because neither 'x11' nor 'cocoa' are enabled")
set(asimage OFF CACHE BOOL "" FORCE)
endif()
endif()
if(asimage)
set(ASEXTRA_LIBRARIES)
find_Package(GIF)
if(GIF_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${GIF_LIBRARIES})
endif()
find_Package(TIFF)
if(TIFF_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${TIFF_LIBRARIES})
endif()
find_Package(PNG)
if(PNG_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${PNG_LIBRARIES})
list(GET PNG_INCLUDE_DIRS 0 PNG_INCLUDE_DIR)
endif()
find_Package(JPEG)
if(JPEG_FOUND)
set(ASEXTRA_LIBRARIES ${ASEXTRA_LIBRARIES} ${JPEG_LIBRARIES})
endif()
endif()
#---Check for AfterImage---------------------------------------------------------------
if(NOT builtin_afterimage)
message(STATUS "Looking for AfterImage")
find_package(AfterImage)
if(NOT AFTERIMAGE_FOUND)
message(STATUS "AfterImage not found. Switching on builtin_afterimage option")
set(builtin_afterimage ON CACHE BOOL "" FORCE)
endif()
endif()
if(builtin_afterimage)
if(WIN32)
if(winrtdebug)
set(astepbld "libAfterImage - Win32 Debug")
else()
set(astepbld "libAfterImage - Win32 Release")
endif()
ExternalProject_Add(
AFTERIMAGE
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/asimage/src/libAfterImage AFTERIMAGE
INSTALL_DIR ${CMAKE_BINARY_DIR}
BUILD_COMMAND nmake -nologo -f libAfterImage.mak FREETYPEDIRI=-I${FREETYPE_INCLUDE_DIR}
CFG=${astepbld} NMAKECXXFLAGS="${CMAKE_CXX_FLAGS} /wd4244"
INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different libAfterImage.lib <INSTALL_DIR>/lib/.
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
else()
message(STATUS "Building AfterImage library included in ROOT itself")
if(JPEG_FOUND)
set(_jpeginclude --with-jpeg-includes=${JPEG_INCLUDE_DIR})
endif()
if(PNG_FOUND)
set(_pnginclude --with-png-includes=${PNG_PNG_INCLUDE_DIR})
endif()
if(TIFF_FOUND)
set(_tiffinclude --with-tiff-includes=${TIFF_INCLUDE_DIR})
else()
set(_tiffinclude --with-tiff=no)
endif()
if(cocoa)
set(_jpeginclude --without-x --with-builtin-jpeg)
set(_pnginclude --with-builtin-png)
set(_tiffinclude --with-tiff=no)
endif()
if(builtin_freetype)
set(_ttf_include --with-ttf-includes=-I${FREETYPE_INCLUDE_DIR})
set(_after_cflags "${_after_cflags} -DHAVE_FREETYPE_FREETYPE")
endif()
ExternalProject_Add(
AFTERIMAGE
DOWNLOAD_COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/graf2d/asimage/src/libAfterImage AFTERIMAGE
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND ./configure --prefix <INSTALL_DIR> --with-ttf ${_ttf_include} --with-afterbase=no
--without-svg --disable-glx ${_after_mmx}
--with-builtin-ungif --with-jpeg ${_jpeginclude}
--with-png ${_pnginclude} ${_tiffinclude}
CC=${CMAKE_C_COMPILER} CFLAGS=${_after_cflags}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 1)
endif()
if(builtin_freetype)
add_dependencies(AFTERIMAGE FREETYPE)
endif()
ExternalProject_Get_Property(AFTERIMAGE INSTALL_DIR)
set(AFTERIMAGE_INCLUDE_DIR ${INSTALL_DIR}/include/libAfterImage)
set(AFTERIMAGE_LIBRARIES ${INSTALL_DIR}/lib/libAfterImage${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
#---Check for GSL library---------------------------------------------------------------
if(mathmore OR builtin_gsl)
message(STATUS "Looking for GSL")
if(NOT builtin_gsl)
find_package(GSL 1.10)
if(NOT GSL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "GSL package not found and 'mathmore' component if required ('fail-on-missing' enabled). "
"Alternatively, you can enable the option 'builtin_gsl' to build the GSL libraries internally.")
else()
message(STATUS "GSL not found. Set variable GSL_DIR to point to your GSL installation")
message(STATUS " Alternatively, you can also enable the option 'builtin_gsl' to build the GSL libraries internally'")
message(STATUS " For the time being switching OFF 'mathmore' option")
set(mathmore OFF CACHE BOOL "" FORCE)
endif()
endif()
else()
set(gsl_version 2.1)
message(STATUS "Downloading and building GSL version ${gsl_version}")
ExternalProject_Add(
GSL
# http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
URL ${repository_tarfiles}/gsl-${gsl_version}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS}
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
)
set(GSL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
foreach(l gsl gslcblas)
list(APPEND GSL_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}${l}${CMAKE_STATIC_LIBRARY_SUFFIX})
endforeach()
set(mathmore ON CACHE BOOL "" FORCE)
endif()
endif()
#---Check for Python installation-------------------------------------------------------
if(python OR python3)
message(STATUS "Looking for Python")
#---First look for the python interpreter and fix the version of it for the libraries--
if(python3)
find_package(PythonInterp 3.5)
else()
find_package(PythonInterp)
endif()
if(PYTHONINTERP_FOUND)
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;sys.stdout.write(sys.version[:3])"
OUTPUT_VARIABLE PYTHON_VERSION)
message(STATUS "Found Python interpreter version ${PYTHON_VERSION}")
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys;sys.stdout.write(sys.prefix)"
OUTPUT_VARIABLE PYTHON_PREFIX)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${PYTHON_PREFIX})
endif()
set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION})
find_package(PythonLibs)
if(NOT PYTHONLIBS_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "PythonLibs package not found and python component required")
else()
set(python OFF CACHE BOOL "" FORCE)
message(STATUS "Python not found. Switching off python option")
endif()
else()
endif()
find_package(NumPy)
endif()
#---Check for Ruby installation-------------------------------------------------------
if(ruby)
message(STATUS "Looking for Ruby")
find_package(Ruby)
if(NOT RUBY_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Ruby package not found and ruby component required")
else()
set(ruby OFF CACHE BOOL "" FORCE)
message(STATUS "Ruby not found. Switching off ruby option")
endif()
else()
string(REGEX REPLACE "([0-9]+).*$" "\\1" RUBY_MAJOR_VERSION "${RUBY_VERSION}")
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*$" "\\1" RUBY_MINOR_VERSION "${RUBY_VERSION}")
string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" RUBY_PATCH_VERSION "${RUBY_VERSION}")
endif()
endif()
#---Check for OpenGL installation-------------------------------------------------------
if(opengl)
message(STATUS "Looking for OpenGL")
if(APPLE AND NOT cocoa)
find_path(OPENGL_INCLUDE_DIR GL/gl.h PATHS /usr/X11R6/include)
find_library(OPENGL_gl_LIBRARY NAMES GL PATHS /usr/X11R6/lib)
find_library(OPENGL_glu_LIBRARY NAMES GLU PATHS /usr/X11R6/lib)
find_package_handle_standard_args(OpenGL REQUIRED_VARS OPENGL_INCLUDE_DIR OPENGL_gl_LIBRARY OPENGL_glu_LIBRARY)
set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
mark_as_advanced(OPENGL_INCLUDE_DIR OPENGL_glu_LIBRARY OPENGL_gl_LIBRARY)
else()
find_package(OpenGL)
endif()
if(NOT OPENGL_LIBRARIES)
if(fail-on-missing)
message(FATAL_ERROR "OpenGL package (with GLU) not found and opengl option required")
else()
message(STATUS "OpenGL (with GLU) not found. Switching off opengl option")
set(opengl OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Graphviz installation-------------------------------------------------------
if(gviz)
message(STATUS "Looking for Graphviz")
find_package(Graphviz)
if(NOT GRAPHVIZ_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Graphviz package not found and gviz option required")
else()
message(STATUS "Graphviz not found. Switching off gviz option")
set(gviz OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Qt installation-------------------------------------------------------
if(qt OR qtgsi)
message(STATUS "Looking for Qt4")
find_package(Qt4 4.8 COMPONENTS QtCore QtGui)
if(NOT QT4_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Qt4 package not found and qt/qtgsi component required")
else()
message(STATUS "Qt4 not found. Switching off qt/qtgsi option")
set(qt OFF CACHE BOOL "" FORCE)
set(qtgsi OFF CACHE BOOL "" FORCE)
endif()
else()
MATH(EXPR QT_VERSION_NUM "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}")
endif()
endif()
#---Check for Bonjour installation-------------------------------------------------------
if(bonjour)
message(STATUS "Looking for Bonjour")
find_package(Bonjour)
if(NOT BONJOUR_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Bonjour/Avahi libraries not found and Bonjour component required")
else()
message(STATUS "Bonjour not found. Switching off bonjour option")
set(bonjour OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for krb5 Support-----------------------------------------------------------
if(krb5)
message(STATUS "Looking for Kerberos 5")
find_package(Kerberos5)
if(NOT KRB5_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Kerberos 5 libraries not found and they are required")
else()
message(STATUS "Kerberos 5 not found. Switching off krb5 option")
set(krb5 OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
if(krb5 OR afs)
find_library(COMERR_LIBRARY com_err)
if(COMERR_LIBRARY)
set(COMERR_LIBRARIES ${COMERR_LIBRARY})
endif()
mark_as_advanced(COMERR_LIBRARY)
endif()
#---Check for XML Parser Support-----------------------------------------------------------
if(xml)
message(STATUS "Looking for LibXml2")
find_package(LibXml2)
if(NOT LIBXML2_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "LibXml2 libraries not found and they are required (xml option enabled)")
else()
message(STATUS "LibXml2 not found. Switching off xml option")
set(xml OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for OpenSSL------------------------------------------------------------------
if(ssl OR builtin_openssl)
if(builtin_openssl)
set(openssl_version 1.0.2d)
message(STATUS "Downloading and building OpenSSL version ${openssl_version}")
if(APPLE)
set(openssl_config_cmd ./Configure darwin64-x86_64-cc)
else()
set(openssl_config_cmd ./config)
endif()
ExternalProject_Add(
OPENSSL
URL ${repository_tarfiles}/openssl-${openssl_version}.tar.gz
CONFIGURE_COMMAND ${openssl_config_cmd} no-shared --prefix=<INSTALL_DIR>
BUILD_COMMAND make -j1 CC=${CMAKE_C_COMPILER}\ -fPIC
INSTALL_COMMAND make install_sw
BUILD_IN_SOURCE 1
LOG_BUILD 1 LOG_CONFIGURE 1 LOG_DOWNLOAD 1 LOG_INSTALL 1
)
ExternalProject_Get_Property(OPENSSL INSTALL_DIR)
set(OPENSSL_INCLUDE_DIR ${INSTALL_DIR}/include)
set(OPENSSL_LIBRARIES ${INSTALL_DIR}/lib/libssl.a ${INSTALL_DIR}/lib/libcrypto.a)
set(OPENSSL_PREFIX ${INSTALL_DIR})
set(ssl ON CACHE BOOL "" FORCE)
else()
message(STATUS "Looking for OpenSSL")
find_package(OpenSSL)
if(NOT OPENSSL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "OpenSSL libraries not found and they are required (ssl option enabled)")
else()
message(STATUS "OpenSSL not found. Switching off ssl option")
set(ssl OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
endif()
#---Check for Castor-------------------------------------------------------------------
if(castor OR rfio)
message(STATUS "Looking for Castor")
find_package(Castor)
if(NOT CASTOR_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Castor libraries not found and they are required (castor option enabled)")
else()
message(STATUS "Castor not found. Switching off castor/rfio option")
set(castor OFF CACHE BOOL "" FORCE)
set(rfio OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for MySQL-------------------------------------------------------------------
if(mysql)
message(STATUS "Looking for MySQL")
find_package(MySQL)
if(NOT MYSQL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "MySQL libraries not found and they are required (mysql option enabled)")
else()
message(STATUS "MySQL not found. Switching off mysql option")
set(mysql OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Oracle-------------------------------------------------------------------
if(oracle)
message(STATUS "Looking for Oracle")
find_package(Oracle)
if(NOT ORACLE_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Oracle libraries not found and they are required (orable option enabled)")
else()
message(STATUS "Oracle not found. Switching off oracle option")
set(oracle OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for ODBC-------------------------------------------------------------------
if(odbc)
message(STATUS "Looking for ODBC")
find_package(ODBC)
if(NOT ODBC_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "ODBC libraries not found and they are required (odbc option enabled)")
else()
message(STATUS "ODBC not found. Switching off odbc option")
set(odbc OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for PostgreSQL-------------------------------------------------------------------
if(pgsql)
message(STATUS "Looking for PostgreSQL")
find_package(PostgreSQL)
if(NOT POSTGRESQL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "PostgreSQL libraries not found and they are required (pgsql option enabled)")
else()
message(STATUS "PostgreSQL not found. Switching off pgsql option")
set(pgsql OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for SQLite-------------------------------------------------------------------
if(sqlite)
message(STATUS "Looking for SQLite")
find_package(Sqlite)
if(NOT SQLITE_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "SQLite libraries not found and they are required (sqlite option enabled)")
else()
message(STATUS "SQLite not found. Switching off sqlite option")
set(sqlite OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Pythia6-------------------------------------------------------------------
if(pythia6)
message(STATUS "Looking for Pythia6")
find_package(Pythia6 QUIET)
if(NOT PYTHIA6_FOUND AND NOT pythia6_nolink)
if(fail-on-missing)
message(FATAL_ERROR "Pythia6 libraries not found and they are required (pythia6 option enabled)")
else()
message(STATUS "Pythia6 not found. Switching off pythia6 option")
set(pythia6 OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Pythia8-------------------------------------------------------------------
if(pythia8)
message(STATUS "Looking for Pythia8")
find_package(Pythia8)
if(NOT PYTHIA8_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Pythia8 libraries not found and they are required (pythia8 option enabled)")
else()
message(STATUS "Pythia8 not found. Switching off pythia8 option")
set(pythia8 OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for FFTW3-------------------------------------------------------------------
if(fftw3)
if(NOT builtin_fftw3)
message(STATUS "Looking for FFTW3")
find_package(FFTW)
if(NOT FFTW_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "FFTW3 libraries not found and they are required (fftw3 option enabled)")
else()
message(STATUS "FFTW3 not found. Set [environment] variable FFTW_DIR to point to your FFTW3 installation")
message(STATUS " Alternatively, you can also enable the option 'builtin_fftw3' to build FFTW3 internally'")
message(STATUS " For the time being switching OFF 'fftw3' option")
set(fftw3 OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
endif()
if(builtin_fftw3)
set(FFTW_VERSION 3.1.2)
message(STATUS "Downloading and building FFTW version ${FFTW_VERSION}")
ExternalProject_Add(
FFTW3
URL ${repository_tarfiles}/fftw-${FFTW_VERSION}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND ./configure --prefix=<INSTALL_DIR>
BUILD_COMMAND make CFLAGS=-fPIC
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
BUILD_IN_SOURCE 1
)
set(FFTW_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
set(FFTW_LIBRARIES ${CMAKE_BINARY_DIR}/lib/libfftw3.a)
set(fftw3 ON CACHE BOOL "" FORCE)
endif()
#---Check for fitsio-------------------------------------------------------------------
if(fitsio OR builtin_cfitsio)
if(builtin_cfitsio)
set(cfitsio_version 3.280)
string(REPLACE "." "" cfitsio_version_no_dots ${cfitsio_version})
message(STATUS "Downloading and building CFITSIO version ${cfitsio_version}")
ExternalProject_Add(
CFITSIO
# ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz
URL ${repository_tarfiles}/cfitsio${cfitsio_version_no_dots}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
BUILD_IN_SOURCE 1
)
set(CFITSIO_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
set(CFITSIO_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfitsio${CMAKE_STATIC_LIBRARY_SUFFIX})
set(fitsio ON CACHE BOOL "" FORCE)
else()
message(STATUS "Looking for CFITSIO")
find_package(CFITSIO)
if(NOT CFITSIO_FOUND)
message(STATUS "CFITSIO not found. You can enable the option 'builtin_cfitsio' to build the library internally'")
message(STATUS " For the time being switching off 'fitsio' option")
set(fitsio OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check Shadow password support----------------------------------------------------
if(shadowpw)
if(NOT EXISTS /etc/shadow) #---TODO--The test always succeeds because the actual file is protected
if(NOT CMAKE_SYSTEM_NAME MATCHES Linux)
message(STATUS "Support Shadow password not found. Switching off shadowpw option")
set(shadowpw OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Alien support----------------------------------------------------------------
if(alien)
find_package(Alien)
if(NOT ALIEN_FOUND)
message(STATUS "Alien API not found. Set variable ALIEN_DIR to point to your Alien installation")
message(STATUS "For the time being switching OFF 'alien' option")
set(alien OFF CACHE BOOL "" FORCE)
endif()
endif()
#---Monalisa support----------------------------------------------------------------
if(monalisa)
find_package(Monalisa)
if(NOT MONALISA_FOUND)
message(STATUS "Monalisa not found. Set variable MONALISA_DIR to point to your Monalisa installation")
message(STATUS "For the time being switching OFF 'monalisa' option")
set(monalisa OFF CACHE BOOL "" FORCE)
endif()
endif()
#---Check for Xrootd support---------------------------------------------------------
if(xrootd)
if(NOT builtin_xrootd)
message(STATUS "Looking for XROOTD")
find_package(XROOTD)
if(NOT XROOTD_FOUND)
message(STATUS "XROOTD not found. Set environment variable XRDSYS to point to your XROOTD installation")
message(STATUS " Alternatively, you can also enable the option 'builtin_xrootd' to build XROOTD internally'")
message(STATUS " For the time being switching OFF 'xrootd' option")
set(xrootd OFF CACHE BOOL "" FORCE)
else()
set(xrootd_versionnum ${xrdversnum}) # variable used internally
endif()
endif()
endif()
if(builtin_xrootd)
set(xrootd_version 4.2.2)
set(xrootd_versionnum 400020002)
message(STATUS "Downloading and building XROOTD version ${xrootd_version}")
string(REPLACE "-Wall " "" __cxxflags "${CMAKE_CXX_FLAGS}") # Otherwise it produces many warnings
string(REPLACE "-W " "" __cxxflags "${__cxxflags}") # Otherwise it produces many warnings
ExternalProject_Add(
XROOTD
# http://xrootd.org/download/v${xrootd_version}/xrootd-${xrootd_version}.tar.gz
URL ${repository_tarfiles}/xrootd-${xrootd_version}.tar.gz
INSTALL_DIR ${CMAKE_BINARY_DIR}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${__cxxflags}
-DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
-DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
-DENABLE_PYTHON=OFF
LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
)
# We cannot call find_package(XROOTD) becuase the package is not yet built. So, we need to emulate what it defines....
set(_LIBDIR_DEFAULT "lib")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CROSSCOMPILING AND NOT EXISTS "/etc/debian_version")
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
endif()
endif()
set(XROOTD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include/xrootd ${CMAKE_BINARY_DIR}/include/xrootd/private)
set(XROOTD_LIBRARIES ${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/libXrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}
${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/libXrdClient${CMAKE_SHARED_LIBRARY_SUFFIX}
${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/libXrdCl${CMAKE_SHARED_LIBRARY_SUFFIX})
if(xrootd_version VERSION_LESS 4)
list(APPEND XROOTD_LIBRARIES ${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/libXrdMain${CMAKE_SHARED_LIBRARY_SUFFIX})
else()
set(XROOTD_NOMAIN TRUE)
endif()
set(XROOTD_CFLAGS "-DROOTXRDVERS=${xrootd_versionnum}")
install(DIRECTORY ${CMAKE_BINARY_DIR}/${_LIBDIR_DEFAULT}/ DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT libraries
FILES_MATCHING PATTERN "libXrd*")
set(xrootd ON CACHE BOOL "" FORCE)
endif()
if(xrootd AND xrootd_versionnum VERSION_GREATER 300030005)
set(netxng ON)
else()
set(netxng OFF)
endif()
#---Check for cling and llvm --------------------------------------------------------
if(cling)
if(builtin_llvm)
set(LLVM_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/interpreter/llvm/src/include
${CMAKE_BINARY_DIR}/interpreter/llvm/src/include
${CMAKE_SOURCE_DIR}/interpreter/llvm/src/tools/clang/include
${CMAKE_BINARY_DIR}/interpreter/llvm/src/tools/clang/include)
set(LLVM_LIBRARIES clangDriver clangFrontend)
else()
find_package(LLVM REQUIRED) # should define the same variables LLVM_XXXX
endif()
set(CLING_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/interpreter/cling/include)
if(MSVC)
set(CLING_CXXFLAGS "-D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DNOMINMAX -D_XKEYCHECK_H")
else()
set(CLING_CXXFLAGS "-fno-strict-aliasing -Wno-unused-parameter -Wwrite-strings -Wno-long-long -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS")
endif()
if (CMAKE_COMPILER_IS_GNUCXX)
set(CLING_CXXFLAGS "${CLING_CXXFLAGS} -Wno-missing-field-initializers")
endif()
#---These are the libraries that we link ROOT with CLING---------------------------
set(CLING_LIBRARIES clingInterpreter clingMetaProcessor clingUtils)
add_custom_target(CLING)
add_dependencies(CLING ${CLING_LIBRARIES} clang-headers)
endif()
#---Check for gfal-------------------------------------------------------------------
if(gfal)
find_package(GFAL)
if(NOT GFAL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Gfal library not found and is required (gfal option enabled)")
else()
message(STATUS "GFAL library not found. Set variable GFAL_DIR to point to your gfal installation
and the variable SRM_IFCE_DIR to the srm_ifce installation")
message(STATUS "For the time being switching OFF 'gfal' option")
set(gfal OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for dCache-------------------------------------------------------------------
if(dcache)
find_package(DCAP)
if(NOT DCAP_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "dCap library not found and is required (dcache option enabled)")
else()
message(STATUS "dCap library not found. Set variable DCAP_DIR to point to your dCache installation")
message(STATUS "For the time being switching OFF 'dcache' option")
set(dcache OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for Ldap--------------------------------------------------------------------
if(ldap)
find_package(Ldap)
if(NOT LDAP_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "ldap library not found and is required (ldap option enabled)")
else()
message(STATUS "ldap library not found. Set variable LDAP_DIR to point to your ldap installation")
message(STATUS "For the time being switching OFF 'ldap' option")
set(ldap OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for globus--------------------------------------------------------------------
if(globus)
find_package(Globus)
if(NOT GLOBUS_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "globus libraries not found and is required ('globus' option enabled)")
else()
message(STATUS "globus libraries not found. Set environment var GLOBUS_LOCATION or varibale GLOBUS_DIR to point to your globus installation")
message(STATUS "For the time being switching OFF 'globus' option")
set(globus OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for ftgl if needed----------------------------------------------------------
if(NOT builtin_ftgl)
find_package(FTGL)
if(NOT FTGL_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "ftgl library not found and is required ('builtin_ftgl' is OFF). Set varible FTGL_ROOT_DIR to installation location")
else()
message(STATUS "ftgl library not found. Set variable FTGL_ROOT_DIR to point to your installation")
message(STATUS "For the time being switching ON 'builtin_ftgl' option")
set(builtin_ftgl ON CACHE BOOL "" FORCE)
endif()
endif()
endif()
if(builtin_ftgl)
set(FTGL_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/graf3d/ftgl/inc)
set(FTGL_CFLAGS -DBUILTIN_FTGL)
set(FTGL_LIBRARIES FTGL)
endif()
#---Check for chirp--------------------------------------------------------------------
if(chirp)
find_package(chirp)
if(NOT CHIRP_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "chirp library not found and is required (chirp option enabled)")
else()
message(STATUS "chirp library not found. Set variable CHIRP_DIR to point to your chirp installation")
message(STATUS "For the time being switching OFF 'chirp' option")
set(chirp OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for R/Rcpp/RInside--------------------------------------------------------------------
#added search of R packages here to remove multiples searches
if(r)
message(STATUS "Looking for R")
find_package(R COMPONENTS Rcpp RInside)
if(NOT R_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "R installation not found and is required ('r' option enabled)")
else()
message(STATUS "R installation not found. Set variable R_DIR to point to your R installation")
message(STATUS "For the time being switching OFF 'r' option")
set(r OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Check for hdfs--------------------------------------------------------------------
if(hdfs)
find_package(hdfs)
if(NOT HDFS_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "hdfs library not found and is required (hdfs option enabled)")
else()
message(STATUS "hdfs library not found. Set variable HDFS_DIR to point to your hdfs installation")
message(STATUS "For the time being switching OFF 'hdfs' option")
set(hdfs OFF CACHE BOOL "" FORCE)
endif()
endif()