-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
executable file
·1111 lines (1010 loc) · 55.1 KB
/
CMakeLists.txt
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
# CMakeLists
#
# CMake configuration for generating build system of Open BEAGLE
# Copyright (C) 2009-2012
#
# Christian Gagne <[email protected]>
# Marc-Andre Gardner <[email protected]>
# Felix-Antoine Fortin <[email protected]>
# Francois-Michel De Rainville <[email protected]>
#
# Date: 01/08/2012
# Minimal CMake version
cmake_minimum_required(VERSION 2.6)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/")
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
# Set project variables
project(OpenBEAGLE C CXX)
set(BEAGLE_PACKAGE OpenBEAGLE)
set(BEAGLE_VERSION 4.1.0)
if(APPLE)
option(BEAGLE_CREATE_DMG "Do you want to create a pkg package for Open BEAGLE?" OFF)
elseif(WIN32)
option(BEAGLE_CREATE_WIN32_SETUP "Do you want to create a setup program for Open BEAGLE (NSIS needed)?" OFF)
elseif(UNIX)
option(BEAGLE_CREATE_UNIX_BIN "Do you want to create Unix universal binaries files for Open BEAGLE?" OFF)
option(BEAGLE_CREATE_DEB "Do you want to create a DEB package for Open BEAGLE?" OFF)
option(BEAGLE_CREATE_RPM "Do you want to create a RPM package for Open BEAGLE (rpmbuild needed)?" OFF)
endif(APPLE)
# Define whether we build static or shared libs
if(NOT DEFINED LIBRARY_TYPE)
message(STATUS "Building static library (default)")
option(BUILD_STATIC_LIB "Build a static library?" ON)
elseif(LIBRARY_TYPE MATCHES "shared")
message(STATUS "Building a shared library")
option(BUILD_STATIC_LIB "Build a static library?" OFF)
else(NOT DEFINED LIBRARY_TYPE)
message(STATUS "Building a static library (default)")
option(BUILD_STATIC_LIB "Build a static library?" ON)
endif(NOT DEFINED LIBRARY_TYPE)
if(BUILD_STATIC_LIB)
set(BEAGLE_LIBRARY_TYPE "STATIC")
else(BUILD_STATIC_LIB)
set(BEAGLE_LIBRARY_TYPE "SHARED")
endif(BUILD_STATIC_LIB)
# C++0x new headers option
if(NOT DEFINED BEAGLE_USE_C0x)
option(BEAGLE_USE_C0x "Use C++0x new headers?" OFF)
endif(NOT DEFINED BEAGLE_USE_C0x)
# Build examples option
if(NOT DEFINED BEAGLE_BUILD_EXAMPLES)
option(BEAGLE_BUILD_EXAMPLES "Build Open BEAGLE examples?" ON)
endif(NOT DEFINED BEAGLE_BUILD_EXAMPLES)
message(STATUS "Include CMake macros...")
# Files to include for testing
include(CheckIncludeFiles)
include(CheckFunctionExists)
include(CheckSymbolExists)
include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
# Others macros to include
include(CMakeMacros/PerformTest.cmake)
include(CMakeMacros/AllFilesInOne.cmake)
include(CMakeMacros/MoveConfigFiles.cmake)
message(STATUS "Begin configuration tests...")
# Check for some headers
check_include_files(inttypes.h BEAGLE_HAVE_INTTYPES_H)
check_include_files(stdint.h BEAGLE_HAVE_STDINT_H)
check_include_files(stdlib.h BEAGLE_HAVE_STDLIB_H)
check_include_files(unistd.h BEAGLE_HAVE_UNISTD_H)
# Check for /dev/urandom
if(EXISTS /dev/urandom)
message(STATUS "/dev/urandom found")
set(BEAGLE_HAVE_DEV_URANDOM 1)
endif(EXISTS /dev/urandom)
# Directory and extension used to find test files
if(NOT DEFINED CMAKE_DIR_TEST)
set(CMAKE_DIR_TEST CMakeTestCode)
endif(NOT DEFINED CMAKE_DIR_TEST)
if(NOT DEFINED CMAKE_TEST_SUFFIX)
set(CMAKE_TEST_SUFFIX ".cmake.cpp")
endif(NOT DEFINED CMAKE_TEST_SUFFIX)
# Check for built-in bool type
PerformTest(CXX_HAVE_BOOL)
if(CXX_HAVE_BOOL)
message(STATUS "Chas built-in bool type")
set(BEAGLE_HAVE_BOOL 1)
endif(CXX_HAVE_BOOL)
# Check for built-in long long type
PerformTest(CXX_HAVE_LONG_LONG)
if(CXX_HAVE_LONG_LONG)
message(STATUS "Chas built-in long long type")
set(BEAGLE_HAVE_LONG_LONG 1)
endif(CXX_HAVE_LONG_LONG)
# Check for templates
PerformTest(CXX_HAVE_TEMPLATES)
if(CXX_HAVE_TEMPLATES)
message(STATUS "Csupports templates")
else(CXX_HAVE_TEMPLATES)
message(SEND_ERROR "!! Sorry, templates support needed")
endif(CXX_HAVE_TEMPLATES)
# Check for built-in template scoped argument matching
PerformTest(CXX_HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING)
if(CXX_HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING)
message(STATUS "Csupports template scoped argument matching")
else(CXX_HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING)
message(SEND_ERROR "!! Sorry, template scoped argument matching support needed")
endif(CXX_HAVE_TEMPLATE_SCOPED_ARGUMENT_MATCHING)
# Check for default template parameters
PerformTest(CXX_HAVE_DEFAULT_TEMPLATE_PARAMETERS)
if(CXX_HAVE_DEFAULT_TEMPLATE_PARAMETERS)
message(STATUS "Csupports default template parameters")
else(CXX_HAVE_DEFAULT_TEMPLATE_PARAMETERS)
message(SEND_ERROR "!! Sorry, default template parameters support needed")
endif(CXX_HAVE_DEFAULT_TEMPLATE_PARAMETERS)
# Check for typename
PerformTest(CXX_HAVE_TYPENAME)
if(CXX_HAVE_TYPENAME)
message(STATUS "Chas typename qualifier")
else(CXX_HAVE_TYPENAME)
message(SEND_ERROR "!! Sorry, typename qualifier needed")
endif(CXX_HAVE_TYPENAME)
# Check for built-in exception handling
PerformTest(CXX_HAVE_EXCEPTIONS)
if(CXX_HAVE_EXCEPTIONS)
message(STATUS "Csupports exception handling")
else(CXX_HAVE_EXCEPTIONS)
message(SEND_ERROR "!! Sorry, support for exception handling needed")
endif(CXX_HAVE_EXCEPTIONS)
# Check for namespaces support
PerformTest(CXX_HAVE_NAMESPACES)
if(CXX_HAVE_NAMESPACES)
message(STATUS "Csupports namespaces")
else(CXX_HAVE_NAMESPACES)
message(SEND_ERROR "!! Sorry, namespaces support needed")
endif(CXX_HAVE_NAMESPACES)
# Check for hash_map Ctemplate
PerformTest(HASHMAP_STD)
PerformTest(HASHMAP_GNUCXX)
PerformTest(HASHMAP_STDEXT)
if(HASHMAP_STD)
message(STATUS "std::hash_map found")
set(BEAGLE_HAVE_STD_HASHMAP 1)
endif(HASHMAP_STD)
if(HASHMAP_GNUCXX)
message(STATUS "__gnu_cxx::hash_map found")
set(BEAGLE_HAVE_GNUCXX_HASHMAP false)
message(STATUS "__gnu_cxx::hash_map will not be enabled since some segfault occurs while using it.")
option(BEAGLE_HAVE_GNUCXX_HASHMAP "Enable __gnu_cxx::hash_map anyway?" OFF)
endif(HASHMAP_GNUCXX)
if(HASHMAP_STDEXT)
message(STATUS "stdext::hash_map found")
set(BEAGLE_HAVE_STDEXT_HASHMAP 1)
endif(HASHMAP_STDEXT)
if(NOT DEFINED HASHMAP_STD AND NOT DEFINED HASHMAP_GNUCXX AND NOT DEFINED HASHMAP_STDEXT)
message(STATUS "no hash_map found")
endif(NOT DEFINED HASHMAP_STD AND NOT DEFINED HASHMAP_GNUCXX AND NOT DEFINED HASHMAP_STDEXT)
# Check for hash_set Ctemplate
PerformTest(HASHSET_STD)
PerformTest(HASHSET_GNUCXX)
PerformTest(HASHSET_STDEXT)
if(HASHSET_STD)
message(STATUS "std::hash_set found")
set(BEAGLE_HAVE_STD_HASHSET 1)
endif(HASHSET_STD)
if(HASHSET_GNUCXX)
message(STATUS "__gnu_cxx::hash_set found")
set(BEAGLE_HAVE_GNUCXX_HASHSET false)
message(STATUS "__gnu_cxx::hash_set will not be enabled since some segfault occurs while using it.")
option(BEAGLE_HAVE_GNUCXX_HASHSET "Enable __gnu_cxx::hash_set anyway?" OFF)
endif(HASHSET_GNUCXX)
if(HASHSET_STDEXT)
message(STATUS "stdext::hash_set found")
set(BEAGLE_HAVE_STDEXT_HASHSET 1)
endif(HASHSET_STDEXT)
if(NOT DEFINED HASHSET_STD AND NOT DEFINED HASHSET_GNUCXX AND NOT DEFINED HASHSET_STDEXT)
message(STATUS "no hash_set found")
endif(NOT DEFINED HASHSET_STD AND NOT DEFINED HASHSET_GNUCXX AND NOT DEFINED HASHSET_STDEXT)
# Check for C++0x new hash headers on GCC
if(BEAGLE_USE_C0x)
check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_C0X)
if(COMPILER_SUPPORTS_C0X)
set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X)
endif(BEAGLE_USE_C0x)
PerformTest(CXX_HAVE_UNORDERED_MAP)
PerformTest(CXX_HAVE_UNORDERED_SET)
if(CXX_HAVE_UNORDERED_MAP AND CXX_HAVE_UNORDERED_SET)
message(STATUS "compiler supports C++0x hash tables")
set(BEAGLE_HAVE_UNORDERED_MAP true)
set(BEAGLE_HAVE_UNORDERED_SET true)
endif(CXX_HAVE_UNORDERED_MAP AND CXX_HAVE_UNORDERED_SET)
PerformTest(CXX_HAVE_UNORDERED_MAP_TR1)
PerformTest(CXX_HAVE_UNORDERED_SET_TR1)
if(CXX_HAVE_UNORDERED_MAP_TR1)
message(STATUS "found std::tr1::unordered_map")
set(BEAGLE_HAVE_STDTR1_UNORDEREDMAP true)
endif(CXX_HAVE_UNORDERED_MAP_TR1)
if(CXX_HAVE_UNORDERED_SET_TR1)
message(STATUS "found std::tr1::unordered_set")
set(BEAGLE_HAVE_STDTR1_UNORDEREDSET true)
endif(CXX_HAVE_UNORDERED_SET_TR1)
# Check for const_cast
PerformTest(CXX_HAVE_CONST_CAST)
if(CXX_HAVE_CONST_CAST)
message(STATUS "compiler supports const_cast<>")
set(BEAGLE_HAVE_CONST_CAST 1)
else(CXX_HAVE_CONST_CAST)
message(STATUS "const_cast<> not supported")
endif(CXX_HAVE_CONST_CAST)
# Check for dynamic_cast
PerformTest(CXX_HAVE_DYN_CAST)
if(CXX_HAVE_DYN_CAST)
message(STATUS "compiler supports dynamic_cast<>")
set(BEAGLE_HAVE_DYNAMIC_CAST 1)
else(CXX_HAVE_DYN_CAST)
message(STATUS "dynamic_cast<> not supported")
endif(CXX_HAVE_DYN_CAST)
# Check for static_cast
PerformTest(CXX_HAVE_STATIC_CAST)
if(CXX_HAVE_STATIC_CAST)
message(STATUS "compiler supports static_cast<>")
set(BEAGLE_HAVE_STATIC_CAST 1)
else(CXX_HAVE_STATIC_CAST)
message(STATUS "static_cast<> not supported")
endif(CXX_HAVE_STATIC_CAST)
# Check for reinterpret_cast
PerformTest(CXX_HAVE_REINTERPRET_CAST)
if(CXX_HAVE_REINTERPRET_CAST)
message(STATUS "compiler supports reinterpret_cast<>")
set(BEAGLE_HAVE_REINTERPRET_CAST 1)
else(CXX_HAVE_REINTERPRET_CAST)
message(STATUS "reinterpret_cast<> not supported")
endif(CXX_HAVE_REINTERPRET_CAST)
# Check for isfinite
PerformTest(CXX_HAVE_ISFINITE)
if(CXX_HAVE_ISFINITE)
message(STATUS "compiler supports isfinite()")
set(BEAGLE_HAVE_ISFINITE 1)
else(CXX_HAVE_ISFINITE)
message(STATUS "isfinite() not supported by the compiler")
endif(CXX_HAVE_ISFINITE)
# Check for numeric limits
PerformTest(CXX_HAVE_NUMERIC_LIMITS)
if(CXX_HAVE_NUMERIC_LIMITS)
message(STATUS "compiler defines numeric limits")
set(BEAGLE_HAVE_NUMERIC_LIMITS 1)
else(CXX_HAVE_NUMERIC_LIMITS)
message(STATUS "compiler does not define numeric limits")
endif(CXX_HAVE_NUMERIC_LIMITS)
# Check for Run-time Type Identification
PerformTest(CXX_HAVE_RTTI)
if(CXX_HAVE_RTTI)
message(STATUS "compiler supports Run-Time Type Identification")
set(BEAGLE_HAVE_RTTI 1)
else(CXX_HAVE_RTTI)
message(STATUS "Run-Time Type Identification not supported")
endif(CXX_HAVE_RTTI)
# Check for stringstream support
PerformTest(CXX_HAVE_SSTREAM)
if(CXX_HAVE_SSTREAM)
message(STATUS "compiler has stringstream")
set(BEAGLE_HAVE_SSTREAM 1)
else(CXX_HAVE_SSTREAM)
message(SEND_ERROR "!! Sorry, no sstream found. If you are using gcc less or equal to 2.95.2, see http://gcc.gnu.org/faq.html#2.95sstream to patch your compiler")
endif(CXX_HAVE_SSTREAM)
# Define build mode
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
message(STATUS "Building in release mode (default)...")
set(CMAKE_BUILD_TYPE "RELEASE")
set(BEAGLE_NDEBUG true)
else(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE)
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
message(STATUS "Building in debug mode...")
set(BEAGLE_NDEBUG false)
elseif(NOT CMAKE_BUILD_TYPE STREQUAL "MINSIZEREL" AND NOT CMAKE_BUILD_TYPE STREQUAL "RELEASE" AND NOT CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")
message(STATUS "## Warning: unhandled build mode ${CMAKE_BUILD_TYPE}, will build in release mode")
set(CMAKE_BUILD_TYPE "RELEASE" FORCE)
set(BEAGLE_NDEBUG true)
else(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(BEAGLE_NDEBUG true)
endif(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
endif(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(BEAGLE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
# Fast compilation option
if(NOT DEFINED CMAKE_FAST_COMPILATION)
option(CMAKE_FAST_COMPILATION "Do you want to active fast compilation mode?" OFF)
endif(NOT DEFINED CMAKE_FAST_COMPILATION)
# Check for PACC
find_package(PACC)
# Check for zlib
find_package(ZLIB)
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIR})
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/gzstream.h DESTINATION include)
set(BEAGLE_HAVE_LIBZ 1)
else(ZLIB_FOUND)
message(STATUS "Cannot find the zlib library")
endif(ZLIB_FOUND)
# Allow to disable all annoying Visual Cwarnings
if(MSVC)
option(BEAGLE_MSVC_NOWARNINGS "Disable MS Visual Studio compilation warnings?" ON)
endif(MSVC)
if(BEAGLE_MSVC_NOWARNINGS)
message(STATUS "MS Visual Studio compilation warnings disabled")
add_definitions(/w)
endif(BEAGLE_MSVC_NOWARNINGS)
# Use the fixed FindMPI modified to work under OS X
find_package(MPI)
if(MPI_FOUND)
message(STATUS "MPI found")
set(BEAGLE_HAVE_MPI 1)
if(NOT DEFINED BEAGLE_NO_HPC OR NOT DEFINED BEAGLE_NO_ISLAND)
include_directories("${MPI_INCLUDE_PATH}")
find_program(MPI_INFO NAMES ompi_info)
mark_as_advanced(MPI_INFO)
if(MPI_INFO)
exec_program(${MPI_INFO} OUTPUT_VARIABLE MPI_INFO_LIST)
string(REGEX MATCHALL "exceptions: yes" MPI_EXCEPTIONS "${MPI_INFO_LIST}")
string(REGEX MATCHALL "mpi: yes, progress: (yes|no)" MPI_THREADS "${MPI_INFO_LIST}")
if(NOT MPI_EXCEPTIONS)
message(STATUS "!! The current MPI installed version doesn't support Cexceptions. HPC and Island won't be compiled.")
option(BEAGLE_NO_HPC "Disable Open Beagle HPC?" ON)
option(BEAGLE_NO_ISLAND "Disable Open BEAGLE Island?" ON)
endif(NOT MPI_EXCEPTIONS)
if(NOT MPI_THREADS)
message(STATUS "!! The current MPI installed version doesn't support Cmulti-threads. HPC and Island won't be compiled.")
option(BEAGLE_NO_HPC "Disable Open Beagle HPC?" ON)
option(BEAGLE_NO_ISLAND "Disable Open BEAGLE Island?" ON)
endif(NOT MPI_THREADS)
endif(MPI_INFO)
if(MPI_THREADS AND MPI_EXCEPTIONS)
option(BEAGLE_NO_HPC "Disable Open Beagle HPC?" OFF)
option(BEAGLE_NO_ISLAND "Disable Open BEAGLE Island?" OFF)
endif(MPI_THREADS AND MPI_EXCEPTIONS)
endif(NOT DEFINED BEAGLE_NO_HPC OR NOT DEFINED BEAGLE_NO_ISLAND)
else(MPI_FOUND)
message(STATUS "MPI not found")
message(STATUS "!! Open BEAGLE HPC relies on MPI, and thus will not be enabled.")
option(BEAGLE_NO_HPC "Disable Open BEAGLE HPC?" ON)
option(BEAGLE_NO_ISLAND "Disable Open BEAGLE Island?" ON)
endif(MPI_FOUND)
# Check for OpenMP
# BEAGLE_OMP_MODE = DYNAMIC | STATIC | NONE (default = NONE)
# FindOpenMP macro is not available in all configurations, so we try to use the "official" package
find_package(OpenMP QUIET)
mark_as_advanced(OpenMP_DIR)
# If CMake fails to locate FindOpenMP, we use our own macro
if(OpenMP_DIR MATCHES OpenMP_DIR-NOTFOUND)
include(CMakeMacros/FindOpenMP.cmake)
endif(OpenMP_DIR MATCHES OpenMP_DIR-NOTFOUND)
if(OPENMP_FOUND)
message(STATUS "OpenMP found")
if(NOT DEFINED BEAGLE_OMP_MODE)
message(STATUS "If you want to enable OpenMP, set BEAGLE_OMP_MODE to STATIC or DYNAMIC, depending in which mode scheduler should work.")
set(BEAGLE_OMP_MODE "NONE" CACHE STRING "OpenMP scheduler modes : NONE (do not use OpenMP at all), STATIC (reproducible results), DYNAMIC (non-reproducible results)")
endif(NOT DEFINED BEAGLE_OMP_MODE)
string(TOUPPER ${BEAGLE_OMP_MODE} BEAGLE_OMP_MODE)
if(BEAGLE_OMP_MODE MATCHES "NONE")
message(STATUS "OpenMP is not enabled, set BEAGLE_OMP_MODE to STATIC | DYNAMIC to enable it.")
set(BEAGLE_USE_OMP_R False)
set(BEAGLE_USE_OMP_NR False)
elseif(BEAGLE_OMP_MODE MATCHES "STATIC")
message(STATUS "OpenMP enabled, scheduler set to static mode.")
set(BEAGLE_USE_OMP_R True)
set(BEAGLE_USE_OMP_NR False)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
elseif(BEAGLE_OMP_MODE MATCHES "DYNAMIC")
message(STATUS "OpenMP enabled, scheduler set to dynamic mode.")
set(BEAGLE_USE_OMP_NR True)
set(BEAGLE_USE_OMP_R False)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else(BEAGLE_OMP_MODE MATCHES "NONE")
message(STATUS "Invalid value for BEAGLE_OMP_MODE : NONE | STATIC | DYNAMIC expected, but found ${BEAGLE_OMP_MODE}; OpenMP is disabled.")
set(BEAGLE_OMP_MODE "NONE" CACHE STRING "OpenMP scheduler modes : NONE (do not use OpenMP at all), STATIC (reproducible results), DYNAMIC (non-reproducible results)")
set(BEAGLE_USE_OMP_R False)
set(BEAGLE_USE_OMP_NR False)
endif(BEAGLE_OMP_MODE MATCHES "NONE")
if(NOT BEAGLE_OMP_MODE MATCHES "NONE")
set(BEAGLE_HAVE_OPENMP 1)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
message(STATUS "Compiling with GNU, parallel version of STL algorithms will be used if they are available.")
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION)
if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
message(STATUS "GCC ${CMAKE_CXX_COMPILER_VERSION} found, enabling parallel STL")
set(CMAKE_REQUIRED_FLAGS "-L${PACC_LIB_FOUND_DIR} -I${PACC_INCLUDE_FOUND_DIR} -fopenmp -D_GLIBCXX_PARALLEL")
set(CMAKE_REQUIRED_LIBRARIES "pacc")
message(STATUS "Check if PACC has been compiled with parallel STL...")
PerformTest(PACC_HAVE_PARALLEL_STL)
if(NOT PACC_HAVE_PARALLEL_STL)
message("!! Warning : your PACC library has not been compiled with parallel version of STL, forced to disable parallel STL for beagle too...")
else(NOT PACC_HAVE_PARALLEL_STL)
message(STATUS "PACC parallel STL ok...")
add_definitions(-D_GLIBCXX_PARALLEL)
endif(NOT PACC_HAVE_PARALLEL_STL)
set(CMAKE_REQUIRED_FLAGS) # Unset modified CMake variables
else(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
message(STATUS "Parallel STL requires GCC >= 4.3, you are using ${CMAKE_CXX_COMPILER_VERSION}")
endif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif(NOT BEAGLE_OMP_MODE MATCHES "NONE")
mark_as_advanced(BEAGLE_USE_OMP_R BEAGLE_USE_OMP_NR)
else(OPENMP_FOUND)
message(STATUS "OpenMP not found")
endif(OPENMP_FOUND)
# Look for threads libraries
message(STATUS "++ Looking for threads libraries...")
include(FindThreads)
if(CMAKE_USE_WIN32_THREADS_INIT)
# Windows environment
message(STATUS "++ Using Windows threads..." ${CMAKE_THREAD_LIBS_INIT})
set(PACC_THREADS_WIN32 true)
elseif(CMAKE_USE_PTHREADS_INIT OR CMAKE_HP_PTHREADS_INIT)
# POSIX environment
message(STATUS "++ Using POSIX threads..." ${CMAKE_THREAD_LIBS_INIT})
set(PACC_THREADS_POSIX true)
else(CMAKE_USE_WIN32_THREADS_INIT)
# Non-supported environment
message(SEND_ERROR "## Cannot find any thread library!")
endif(CMAKE_USE_WIN32_THREADS_INIT)
# Generate Beagle/config.hpp file
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/config.hpp.in" "${CMAKE_CURRENT_BINARY_DIR}/include/Beagle/config.hpp")
# Glob src
file(GLOB BEAGLE_CORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/*.cpp")
file(GLOB BEAGLE_EC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC/*.cpp")
file(GLOB BEAGLE_BITSTR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr/*.cpp")
file(GLOB BEAGLE_FLTVEC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec/*.cpp")
file(GLOB BEAGLE_INTVEC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec/*.cpp")
file(GLOB BEAGLE_ES_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES/*.cpp")
file(GLOB BEAGLE_SAES_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES/*.cpp")
file(GLOB BEAGLE_CMA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA/*.cpp")
file(GLOB BEAGLE_EMO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO/*.cpp")
file(GLOB BEAGLE_GP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP/*.cpp")
file(GLOB BEAGLE_STGP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP/*.cpp")
file(GLOB BEAGLE_HPC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC/*.cpp")
file(GLOB BEAGLE_ISLAND_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island/*.cpp")
file(GLOB BEAGLE_LINGP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP/*.cpp")
file(GLOB BEAGLE_MASTER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master/*.cpp")
# Glob headers
file(GLOB BEAGLE_CORE_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/*.hpp")
file(GLOB BEAGLE_EC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC/*.hpp")
file(GLOB BEAGLE_BITSTR_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr/*.hpp")
file(GLOB BEAGLE_FLTVEC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec/*.hpp")
file(GLOB BEAGLE_INTVEC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec/*.hpp")
file(GLOB BEAGLE_ES_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES/*.hpp")
file(GLOB BEAGLE_SAES_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES/*.hpp")
file(GLOB BEAGLE_CMA_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA/*.hpp")
file(GLOB BEAGLE_EMO_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO/*.hpp")
file(GLOB BEAGLE_GP_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP/*.hpp")
file(GLOB BEAGLE_STGP_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP/*.hpp")
file(GLOB BEAGLE_HPC_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC/*.hpp")
file(GLOB BEAGLE_ISLAND_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island/*.hpp")
file(GLOB BEAGLE_LINGP_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP/*.hpp")
file(GLOB BEAGLE_MASTER_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master/*.hpp")
# Remove OpenMP files if OpenMP it no used
if(NOT BEAGLE_USE_OMP_NR AND NOT BEAGLE_USE_OMP_R)
list(REMOVE_ITEM BEAGLE_CORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/OpenMP.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/RandomizerMulti.cpp")
list(REMOVE_ITEM BEAGLE_CORE_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/OpenMP.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/RandomizerMulti.hpp")
endif(NOT BEAGLE_USE_OMP_NR AND NOT BEAGLE_USE_OMP_R)
# Fast compilation switch
if(CMAKE_FAST_COMPILATION)
message(STATUS "Using fast compilation mode...")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/libBeagle-Core.cpp" ${BEAGLE_CORE_SRC})
set(BEAGLE_CORE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/libBeagle-Core.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC/libBeagle-EC.cpp" ${BEAGLE_EC_SRC})
set(BEAGLE_EC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC/libBeagle-EC.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr/libBeagle-BitStr.cpp" ${BEAGLE_BITSTR_SRC})
set(BEAGLE_BITSTR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr/libBeagle-BitStr.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec/libBeagle-FltVec.cpp" ${BEAGLE_FLTVEC_SRC})
set(BEAGLE_FLTVEC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec/libBeagle-FltVec.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec/libBeagle-IntVec.cpp" ${BEAGLE_INTVEC_SRC})
set(BEAGLE_INTVEC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec/libBeagle-IntVec.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES/libBeagle-ES.cpp" ${BEAGLE_ES_SRC})
set(BEAGLE_ES_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES/libBeagle-ES.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES/libBeagle-SAES.cpp" ${BEAGLE_SAES_SRC})
set(BEAGLE_SAES_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES/libBeagle-SAES.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA/libBeagle-CMA.cpp" ${BEAGLE_CMA_SRC})
set(BEAGLE_CMA_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA/libBeagle-CMA.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO/libBeagle-EMO.cpp" ${BEAGLE_EMO_SRC})
set(BEAGLE_EMO_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO/libBeagle-EMO.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP/libBeagle-GP.cpp" ${BEAGLE_GP_SRC})
set(BEAGLE_GP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP/libBeagle-GP.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP/libBeagle-STGP.cpp" ${BEAGLE_STGP_SRC})
set(BEAGLE_STGP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP/libBeagle-STGP.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC/libBeagle-HPC.cpp" ${BEAGLE_HPC_SRC})
set(BEAGLE_HPC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC/libBeagle-HPC.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island/libBeagle-Island.cpp" ${BEAGLE_ISLAND_SRC})
set(BEAGLE_ISLAND_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island/libBeagle-Island.cpp")
AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP/libBeagle-LinGP.cpp" ${BEAGLE_LINGP_SRC})
set(BEAGLE_LINGP_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP/libBeagle-LinGP.cpp")
#AllFilesInOne("${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master/libBeagle-Master.cpp" ${BEAGLE_MASTER_SRC})
#set(BEAGLE_MASTER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master/libBeagle-Master.cpp")
message(STATUS "Include files generated...")
else(CMAKE_FAST_COMPILATION)
message(STATUS "Using normal compilation mode...")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core/libBeagle-Core.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC/libBeagle-EC.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr/libBeagle-BitStr.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec/libBeagle-FltVec.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA/libBeagle-CMA.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec/libBeagle-IntVec.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES/libBeagle-ES.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES/libBeagle-SAES.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO/libBeagle-EMO.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP/libBeagle-GP.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP/libBeagle-STGP.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC/libBeagle-HPC.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island/libBeagle-Island.cpp")
file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP/libBeagle-LinGP.cpp")
#file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master/libBeagle-Master.cpp")
endif(CMAKE_FAST_COMPILATION)
# Include headers required
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}/include")
# Create Beagle-Core library target
add_library(Beagle-Core ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_CORE_SRC})
target_link_libraries(Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-Core ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
# Do we want to use C++0x?
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-Core PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-Core PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-Core PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_CORE_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/beagle" false)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/Beagle/config.hpp DESTINATION include/Beagle)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Core.hpp DESTINATION include/Beagle)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/macros.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_CORE_HEADERS} DESTINATION include/Beagle/Core)
install(TARGETS Beagle-Core DESTINATION lib)
# Create Beagle-EC library target
add_library(Beagle-EC ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_EC_SRC})
target_link_libraries(Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-EC ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-EC PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-EC PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-EC PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_EC_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/EC" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EC.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_EC_HEADERS} DESTINATION include/Beagle/EC)
install(TARGETS Beagle-EC DESTINATION lib)
# Create Beagle-BitStr library target
add_library(Beagle-BitStr ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_BITSTR_SRC})
target_link_libraries(Beagle-BitStr Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-BitStr ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-BitStr PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-BitStr PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-BitStr PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_BITSTR_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/BitStr" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/BitStr.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_BITSTR_HEADERS} DESTINATION include/Beagle/BitStr)
install(TARGETS Beagle-BitStr DESTINATION lib)
# Create Beagle-FltVec library target
add_library(Beagle-FltVec ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_FLTVEC_SRC})
target_link_libraries(Beagle-FltVec Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-FltVec ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-FltVec PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-FltVec PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-FltVec PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_FLTVEC_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/FltVec" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/FltVec.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_FLTVEC_HEADERS} DESTINATION include/Beagle/FltVec)
install(TARGETS Beagle-FltVec DESTINATION lib)
# Create Beagle-IntVec library target
add_library(Beagle-IntVec ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_INTVEC_SRC})
target_link_libraries(Beagle-IntVec Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-IntVec ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-IntVec PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-IntVec PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-IntVec PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_INTVEC_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/IntVec" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/IntVec.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_INTVEC_HEADERS} DESTINATION include/Beagle/IntVec)
install(TARGETS Beagle-IntVec DESTINATION lib)
# Create Beagle-ES library target
add_library(Beagle-ES ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_ES_SRC})
target_link_libraries(Beagle-ES Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-ES ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-ES PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-ES PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-ES PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_ES_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/ES" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/ES.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_ES_HEADERS} DESTINATION include/Beagle/ES)
install(TARGETS Beagle-ES DESTINATION lib)
# Create Beagle-SAES library target
add_library(Beagle-SAES ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_SAES_SRC})
target_link_libraries(Beagle-SAES Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-SAES ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-SAES PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-SAES PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-SAES PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_SAES_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/SAES" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/SAES.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_SAES_HEADERS} DESTINATION include/Beagle/SAES)
install(TARGETS Beagle-SAES DESTINATION lib)
# Create Beagle-EMO library target
add_library(Beagle-EMO ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_EMO_SRC})
target_link_libraries(Beagle-EMO Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-EMO ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-EMO PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-EMO PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-EMO PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_EMO_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/EMO" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/EMO.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_EMO_HEADERS} DESTINATION include/Beagle/EMO)
install(TARGETS Beagle-EMO DESTINATION lib)
# Create Beagle-CMA library target
add_library(Beagle-CMA ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_CMA_SRC})
target_link_libraries(Beagle-CMA Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-CMA ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-CMA PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-CMA PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-CMA PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_CMA_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/CMA" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/CMA.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_CMA_HEADERS} DESTINATION include/Beagle/CMA)
install(TARGETS Beagle-CMA DESTINATION lib)
# Create Beagle-GP library target
add_library(Beagle-GP ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_GP_SRC})
target_link_libraries(Beagle-GP Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-GP ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-GP PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-GP PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-GP PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_GP_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/GP" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/GP.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_GP_HEADERS} DESTINATION include/Beagle/GP)
install(TARGETS Beagle-GP DESTINATION lib)
# Create Beagle-STGP library target
add_library(Beagle-STGP ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_STGP_SRC})
target_link_libraries(Beagle-STGP Beagle-GP Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-STGP ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-STGP PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-STGP PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-STGP PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_STGP_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/STGP" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/STGP.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_STGP_HEADERS} DESTINATION include/Beagle/STGP)
install(TARGETS Beagle-STGP DESTINATION lib)
# Create Beagle-HPC library target
if(NOT BEAGLE_NO_HPC)
if(MPI_FOUND)
# Create Beagle-HPC library target
add_library(Beagle-HPC ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_HPC_SRC})
target_link_libraries(Beagle-HPC Beagle-EC Beagle-Core pacc ${MPI_LIBRARIES})
set_target_properties(Beagle-HPC PROPERTIES LINK_FLAGS ${MPI_LINK_FLAGS})
if(ZLIB_FOUND)
target_link_libraries(Beagle-HPC ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-HPC PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-HPC PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-HPC PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_HPC_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/HPC" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/HPC.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_HPC_HEADERS} DESTINATION include/Beagle/HPC)
install(TARGETS Beagle-HPC DESTINATION lib)
#if(CMAKE_FAST_COMPILATION)
# add_library(Beagle-HPC ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_HPC_SRC} ${MPI_INCLUDE_PATH})
#else(CMAKE_FAST_COMPILATION)
# add_library(Beagle-HPC ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_HPC_SRC} ${BEAGLE_HPC_HEADERS})
#endif(CMAKE_FAST_COMPILATION)
#add_dependencies(Beagle-HPC Beagle)
#set_target_properties(Beagle-HPC PROPERTIES LINK_FLAGS ${MPI_LINK_FLAGS})
#target_link_libraries(Beagle-HPC Beagle ${MPI_LIBRARIES})
else(MPI_FOUND)
message(SEND_ERROR "!! Sorry, no MPI found. Open Beagle HPC needs MPI, to compile without HPC, compile with BEAGLE_NO_HPC")
endif(MPI_FOUND)
endif(NOT BEAGLE_NO_HPC)
# Create Beagle-Island library target
if(NOT BEAGLE_NO_ISLAND)
if(MPI_FOUND)
add_library(Beagle-Island ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_ISLAND_SRC})
target_link_libraries(Beagle-Island Beagle-EC Beagle-Core pacc ${MPI_LIBRARIES})
set_target_properties(Beagle-Island PROPERTIES LINK_FLAGS ${MPI_LINK_FLAGS})
if(ZLIB_FOUND)
target_link_libraries(Beagle-Island ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-Island PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-Island PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-Island PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_ISLAND_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/Island" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Island.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_ISLAND_HEADERS} DESTINATION include/Beagle/Island)
install(TARGETS Beagle-Island DESTINATION lib)
else(MPI_FOUND)
message(SEND_ERROR "!! Sorry, no MPI found. Open Beagle Island needs MPI, to compile without Island, compile with BEAGLE_NO_ISLAND")
endif(MPI_FOUND)
endif(NOT BEAGLE_NO_ISLAND)
# Create Beagle-LinGP library target
add_library(Beagle-LinGP ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_LINGP_SRC})
target_link_libraries(Beagle-LinGP Beagle-EC Beagle-Core pacc)
if(ZLIB_FOUND)
target_link_libraries(Beagle-LinGP ${ZLIB_LIBRARY})
endif(ZLIB_FOUND)
if(BUILD_STATIC_LIB)
set_target_properties(Beagle-LinGP PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
else(BUILD_STATIC_LIB)
set_target_properties(Beagle-LinGP PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
endif(BUILD_STATIC_LIB)
if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
set_target_properties(Beagle-LinGP PROPERTIES COMPILE_FLAGS "-std=c++0x")
endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
MoveConfigFiles("${BEAGLE_LINGP_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/LinGP" false)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/LinGP.hpp DESTINATION include/Beagle)
install(FILES ${BEAGLE_LINGP_HEADERS} DESTINATION include/Beagle/LinGP)
install(TARGETS Beagle-LinGP DESTINATION lib)
# Create Beagle-Master library target
#add_library(Beagle-Master ${BEAGLE_LIBRARY_TYPE} ${BEAGLE_MASTER_SRC})
#target_link_libraries(Beagle-Master Beagle-GP Beagle-EC Beagle-Core pacc)
#if(ZLIB_FOUND)
# target_link_libraries(Beagle-Master ${ZLIB_LIBRARY})
#endif(ZLIB_FOUND)
#if(BUILD_STATIC_LIB)
# set_target_properties(Beagle-Master PROPERTIES VERSION ${BEAGLE_VERSION} ARCHIVE_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
#else(BUILD_STATIC_LIB)
# set_target_properties(Beagle-Master PROPERTIES VERSION ${BEAGLE_VERSION} LIBRARY_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/lib")
#endif(BUILD_STATIC_LIB)
#if(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
# set_target_properties(Beagle-Master PROPERTIES COMPILE_FLAGS "-std=c++0x")
#endif(COMPILER_SUPPORTS_C0X AND BEAGLE_USE_C0x)
#MoveConfigFiles("${BEAGLE_MASTER_HEADERS}" "${BEAGLE_OUTPUT_DIR}/include/Beagle/Master" false)
#install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle/Master.hpp DESTINATION include/Beagle)
#install(FILES ${BEAGLE_MASTER_HEADERS} DESTINATION include/Beagle/Master)
#install(TARGETS Beagle-Master DESTINATION lib)
if(BEAGLE_BUILD_EXAMPLES)
message(STATUS "Will build Open BEAGLE examples, you can avoid it if you want by setting BEAGLE_BUILD_EXAMPLES to false")
# ant example
file(GLOB ANT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/ant/*.cpp")
file(GLOB ANT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/ant/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/examples/ant/*.xml" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/ant/*.trail" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/ant/ReadMe.txt")
add_executable(ant ${ANT_SRC})
add_dependencies(ant Beagle-GP Beagle-EC Beagle-Core)
target_link_libraries(ant Beagle-GP Beagle-EC Beagle-Core pacc)
set_target_properties(ant PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/ant")
MoveConfigFiles("${ANT_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/ant" false)
install(TARGETS ant DESTINATION bin/ant)
install(FILES ${ANT_DATA} DESTINATION bin/ant)
# knapsack example
file(GLOB KNAPSACK_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/knapsack/*.cpp")
file(GLOB KNAPSACK_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/knapsack/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/knapsack/ReadMe.txt")
add_executable(knapsack ${KNAPSACK_SRC})
add_dependencies(knapsack Beagle-EMO Beagle-BitStr Beagle-EC Beagle-Core)
target_link_libraries(knapsack Beagle-EMO Beagle-BitStr Beagle-EC Beagle-Core pacc)
set_target_properties(knapsack PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/knapsack")
MoveConfigFiles("${KNAPSACK_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/knapsack" false)
install(TARGETS knapsack DESTINATION bin/knapsack)
install(FILES ${KNAPSACK_DATA} DESTINATION bin/knapsack)
# knapsack-hpc example
if(NOT BEAGLE_NO_HPC)
file(GLOB KNAPSACK_HPC_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/knapsack-hpc/*.cpp")
file(GLOB KNAPSACK_HPC_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/knapsack-hpc/*.conf")
add_executable(knapsack-hpc ${KNAPSACK_HPC_SRC})
add_dependencies(knapsack-hpc Beagle-HPC Beagle-EMO Beagle-BitStr Beagle-EC Beagle-Core)
target_link_libraries(knapsack-hpc Beagle-HPC Beagle-EMO Beagle-BitStr Beagle-EC Beagle-Core pacc)
set_target_properties(knapsack-hpc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/knapsack-hpc")
MoveConfigFiles("${KNAPSACK_HPC_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/knapsack-hpc" false)
install(TARGETS knapsack-hpc DESTINATION bin/knapsack-hpc)
install(FILES ${KNAPSACK_HPC_DATA} DESTINATION bin/knapsack-hpc)
endif(NOT BEAGLE_NO_HPC)
# maxfct example
file(GLOB MAXFCT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfct/*.cpp")
file(GLOB MAXFCT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfct/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfct/ReadMe.txt")
add_executable(maxfct ${MAXFCT_SRC})
add_dependencies(maxfct Beagle-BitStr Beagle-EC Beagle-Core)
target_link_libraries(maxfct Beagle-BitStr Beagle-EC Beagle-Core pacc)
set_target_properties(maxfct PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/maxfct")
MoveConfigFiles("${MAXFCT_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/maxfct" false)
install(TARGETS maxfct DESTINATION bin/maxfct)
install(FILES ${MAXFCT_DATA} DESTINATION bin/maxfct)
# # maxfctes example
# file(GLOB MAXFCTES_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctes/*.cpp")
# file(GLOB MAXFCTES_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctes/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctes/ReadMe.txt")
# add_executable(maxfctes ${MAXFCTES_SRC})
# add_dependencies(maxfctes Beagle-ES Beagle-EC Beagle-Core)
# target_link_libraries(maxfctes Beagle-ES Beagle-EC Beagle-Core pacc)
# set_target_properties(maxfctes PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/maxfctes")
# MoveConfigFiles("${MAXFCTES_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/maxfctes" false)
# install(TARGETS maxfctes DESTINATION bin/maxfctes)
# install(FILES ${MAXFCTES_DATA} DESTINATION bin/maxfctes)
# maxfctfloat example
file(GLOB MAXFCTFLOAT_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctfloat/*.cpp")
file(GLOB MAXFCTFLOAT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctfloat/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/maxfctfloat/ReadMe.txt")
add_executable(maxfctfloat ${MAXFCTFLOAT_SRC})
add_dependencies(maxfctfloat Beagle-CMA Beagle-FltVec Beagle-EC Beagle-Core)
target_link_libraries(maxfctfloat Beagle-CMA Beagle-FltVec Beagle-EC Beagle-Core pacc)
set_target_properties(maxfctfloat PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/maxfctfloat")
MoveConfigFiles("${MAXFCTFLOAT_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/maxfctfloat" false)
install(TARGETS maxfctfloat DESTINATION bin/maxfctfloat)
install(FILES ${MAXFCTFLOAT_DATA} DESTINATION bin/maxfctfloat)
# multiplexer example
file(GLOB MULTIPLEXER_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/multiplexer/*.cpp")
file(GLOB MULTIPLEXER_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/multiplexer/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/multiplexer/ReadMe.txt")
add_executable(multiplexer ${MULTIPLEXER_SRC})
add_dependencies(multiplexer Beagle-GP Beagle-EC Beagle-Core)
target_link_libraries(multiplexer Beagle-GP Beagle-EC Beagle-Core pacc)
set_target_properties(multiplexer PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/multiplexer")
MoveConfigFiles("${MULTIPLEXER_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/multiplexer" false)
install(TARGETS multiplexer DESTINATION bin/multiplexer)
install(FILES ${MULTIPLEXER_DATA} DESTINATION bin/multiplexer)
# onemax example
file(GLOB ONEMAX_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/onemax/*.cpp")
file(GLOB ONEMAX_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/onemax/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/onemax/ReadMe.txt")
add_executable(onemax ${ONEMAX_SRC})
add_dependencies(onemax Beagle-BitStr Beagle-EC Beagle-Core)
target_link_libraries(onemax Beagle-BitStr Beagle-EC Beagle-Core pacc)
set_target_properties(onemax PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/onemax")
MoveConfigFiles("${ONEMAX_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/onemax" false)
install(TARGETS onemax DESTINATION bin/onemax)
install(FILES ${ONEMAX_DATA} DESTINATION bin/onemax)
# parity example
set(PARITY_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/ParityEvalOp.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/ParityMain.cpp")
set(PARITY_FAST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/ParityFastEvalOp.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/ParityFastMain.cpp")
file(GLOB PARITY_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/parity/ReadMe.txt")
add_executable(parity ${PARITY_SRC})
add_dependencies(parity Beagle-STGP Beagle-GP Beagle-EC Beagle-Core)
target_link_libraries(parity Beagle-STGP Beagle-GP Beagle-EC Beagle-Core pacc)
add_executable(parity-fast ${PARITY_FAST_SRC})
add_dependencies(parity-fast Beagle-STGP Beagle-GP Beagle-EC Beagle-Core)
target_link_libraries(parity-fast Beagle-STGP Beagle-GP Beagle-EC Beagle-Core pacc)
set_target_properties(parity parity-fast PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${BEAGLE_OUTPUT_DIR}/bin/parity")
MoveConfigFiles("${PARITY_DATA}" "${BEAGLE_OUTPUT_DIR}/bin/parity" false)
install(TARGETS parity parity-fast DESTINATION bin/parity)
install(FILES ${PARITY_DATA} DESTINATION bin/parity)
# spambase example
file(GLOB SPAMBASE_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/spambase/*.cpp")
file(GLOB SPAMBASE_DATA "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/spambase/*.conf" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/spambase/spambase.data" "${CMAKE_CURRENT_SOURCE_DIR}/src/Beagle-Examples/spambase/ReadMe.txt")