-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
879 lines (779 loc) · 39.6 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
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2020-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
#============================ end_copyright_notice =============================
cmake_minimum_required (VERSION 3.5)
#################################################################################
# PROJECT
#################################################################################
set (PROJECT_NAME metrics_library)
project (${PROJECT_NAME})
set (LIB igdml)
set (LIB_NAME libigdml)
set (SOME_COMMON_INCLUDES FALSE)
# uncomment for logs during build (during 'make' command)
# set (CMAKE_VERBOSE_MAKEFILE ON)
# instrumentation common settings & macros
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
include (ml_cmake_adapter.cmake NO_POLICY_SCOPE)
else()
include (../instr.cmake NO_POLICY_SCOPE) # windows and others
endif()
# version
set (API_HEADER_LOCATION "${BS_DIR_INC}/common/instrumentation/api/metrics_library_api_1_0.h")
set (MAJOR_NUMBER_REGEX "^#define METRICS_LIBRARY_MAJOR_NUMBER ([0-9]+).*$")
set (MINOR_NUMBER_REGEX "^#define METRICS_LIBRARY_MINOR_NUMBER ([0-9]+).*$")
set (BUILD_NUMBER_REGEX "^#define METRICS_LIBRARY_BUILD_NUMBER ([0-9]+).*$")
set (LIB_MAJOR_VERSION 1)
set (LIB_MINOR_VERSION 0)
set (LIB_BUILD_VERSION 0)
file (STRINGS ${API_HEADER_LOCATION} MAJOR_NUMBER_LINE REGEX ${MAJOR_NUMBER_REGEX})
file (STRINGS ${API_HEADER_LOCATION} MINOR_NUMBER_LINE REGEX ${MINOR_NUMBER_REGEX})
file (STRINGS ${API_HEADER_LOCATION} BUILD_NUMBER_LINE REGEX ${BUILD_NUMBER_REGEX})
if (MAJOR_NUMBER_LINE)
string (REGEX REPLACE ${MAJOR_NUMBER_REGEX} "\\1" LIB_MAJOR_VERSION ${MAJOR_NUMBER_LINE})
else ()
message ("Major number has not been found, so the default one has been used.")
endif ()
if (MINOR_NUMBER_LINE)
string (REGEX REPLACE ${MINOR_NUMBER_REGEX} "\\1" LIB_MINOR_VERSION ${MINOR_NUMBER_LINE})
else ()
message ("Minor number has not been found, so the default one has been used.")
endif ()
if (BUILD_NUMBER_LINE)
string (REGEX REPLACE ${BUILD_NUMBER_REGEX} "\\1" LIB_BUILD_VERSION ${BUILD_NUMBER_LINE})
else ()
message ("Build number has not been found, so the default one has been used.")
endif ()
set (LIB_VERSION ${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION})
#################################################################################
# CONFIGURE C++ STANDARD
#################################################################################
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)
#################################################################################
# MACROS
#################################################################################
macro (ml_add_headers _platform)
# library headers
file (GLOB _LIBRARY_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_LIBRARY_HEADERS})
# generated traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# configuration traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# constants traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# device traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# internal feature headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/internal/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# kernel interface traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# marker traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# override traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# policy traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# tools traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# validation traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/${_platform}/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
endmacro ()
#################################################################################
# SOURCES
#################################################################################
# common sources
set (_SOURCES ${_SOURCES}
# metrics library core
${BS_DIR_INSTRUMENTATION}/metrics_library/.clang-format
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_command_buffer.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_configuration.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_context.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_marker.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_query.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_report.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/ml_ddi_override.hpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_command_buffer.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_configuration.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_context.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_marker.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_query.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_report.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/ml_ddi_override.cpp
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/ml_export.def
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/ml_export.cpp
# debug logs framework
${BS_DIR_INSTRUMENTATION}/utils/common/iu_debug.c
)
# platform dependent
if (${PLATFORM} STREQUAL Windows) # windows
set (_SOURCES ${_SOURCES}
# debug logs framework
${BS_DIR_INSTRUMENTATION}/utils/windows/umd/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/windows/umd/iu_std.cpp
)
# linux files in solution explorer
set (_LINUX_SOURCES_ON_WINDOWS
# debug logs framework
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_std.cpp
)
# linux files will not be being built
set_source_files_properties (
${_LINUX_SOURCES_ON_WINDOWS} PROPERTIES HEADER_FILE_ONLY ON
)
set (_SOURCES ${_SOURCES} ${_LINUX_SOURCES_ON_WINDOWS})
elseif (${PLATFORM} STREQUAL linux)
set (_SOURCES ${_SOURCES}
# debug logs framework
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_std.cpp
)
else()
message("-- Using platform is ${PLATFORM}")
endif ()
set (SOURCES ${_SOURCES})
#################################################################################
# HEADERS
#################################################################################
# metrics library api headers
set (_HEADERS ${_HEADERS}
${API_HEADER_LOCATION}
)
# instrumentation utils common headers
file (GLOB _IU_COMMON_HEADERS
${BS_DIR_INSTRUMENTATION}/utils/common/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_IU_COMMON_HEADERS})
# library headers
file (GLOB _LIBRARY_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_LIBRARY_HEADERS})
# generated ddi headers
file (GLOB_RECURSE _DDI_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_DDI_HEADERS})
# generated library headers
file (GLOB_RECURSE _DDI_LIBRARY_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_DDI_LIBRARY_HEADERS})
# generated gpu commands headers
file (GLOB_RECURSE _COMMANDS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/gpu/*.h
)
set (_HEADERS ${_HEADERS} ${_COMMANDS_HEADERS})
# generated traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# command buffer traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/command_buffer/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# configuration traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# constants traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# context traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/context/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# device traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# example traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/example/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# function log traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/function_log/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# internal feature headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/internal/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# kernel interface traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# marker traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# oa buffer traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/oa_buffer/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# object traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/object/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# override traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# policy traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# query hw counters traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/query/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# tools traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# validation traits headers
file (GLOB _TRAITS_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/*.h
)
set (_HEADERS ${_HEADERS} ${_TRAITS_HEADERS})
# platform dependent
if (${PLATFORM} STREQUAL Windows) # windows
# instrumentation utils headers
file (GLOB _IU_OS_HEADERS
${BS_DIR_INSTRUMENTATION}/utils/windows/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_IU_OS_HEADERS})
ml_add_headers("windows")
# add linux headers to solution explorer
ml_add_headers("linux")
# linux instrumentation utils headers
file (GLOB _IU_LINUX_HEADERS
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/*.h
)
# external
file (GLOB_RECURSE _EXTERNAL_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/external/drm/*.h
)
set (_HEADERS ${_HEADERS} ${_IU_LINUX_HEADERS} ${_EXTERNAL_HEADERS})
elseif (${PLATFORM} STREQUAL "linux") # linux
# instrumentation utils headers
file (GLOB _IU_OS_HEADERS
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/*.h
)
set (_HEADERS ${_HEADERS} ${_IU_OS_HEADERS})
# external
file (GLOB_RECURSE _EXTERNAL_HEADERS
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/external/*.h
)
set (_HEADERS ${_HEADERS} ${_EXTERNAL_HEADERS})
ml_add_headers("linux")
else ()
message("-- Using platform is ${PLATFORM}")
endif ()
set (HEADERS ${_HEADERS})
#################################################################################
# SOURCE GROUPS
#################################################################################
# common
source_group (api ${BS_DIR_INC}/common/instrumentation/api/.*h)
source_group (ddi ${BS_DIR_INSTRUMENTATION}/metrics_library/ddi/.*hpp)
source_group (codegen\\ddi ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/.*cpp)
source_group (codegen\\ddi\\inc ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/inc/.*h)
source_group (codegen\\gpu ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/gpu/.*h)
source_group (codegen\\traits ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/.*h)
source_group (codegen\\library ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/.*)
source_group (codegen\\library\\inc ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/inc/.*h)
source_group (library ${BS_DIR_INSTRUMENTATION}/metrics_library/ml.rc)
source_group (library\\inc ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/.*h)
source_group (traits\\command_buffer ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/command_buffer/.*h)
source_group (traits\\configuration ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/.*h)
source_group (traits\\constants ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/.*h)
source_group (traits\\context ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/context/.*h)
source_group (traits\\device ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device/.*h)
source_group (traits\\example ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/example/.*h)
source_group (traits\\function_log ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/function_log/.*h)
source_group (traits\\internal ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/internal/.*h)
source_group (traits\\kernel_interface ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/.*h)
source_group (traits\\marker ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/.*h)
source_group (traits\\oa_buffer ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/oa_buffer/.*h)
source_group (traits\\objects ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/object/.*h)
source_group (traits\\override ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/.*h)
source_group (traits\\policy ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/.*h)
source_group (traits\\query ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/query/.*h)
source_group (traits\\tools ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/.*h)
source_group (traits\\validation ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/.*h)
# debug logs framework
source_group (iu FILES
${BS_DIR_INSTRUMENTATION}/utils/common/iu_debug.c
${BS_DIR_INSTRUMENTATION}/utils/common/inc/iu_debug.h
${BS_DIR_INSTRUMENTATION}/utils/common/inc/iu_std.h
)
# platform dependent
if (${PLATFORM} STREQUAL Windows) # windows
source_group (codegen\\traits\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/windows/.*h)
source_group (library\\inc\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/windows/.*h)
source_group (traits\\configuration\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/windows/.*h)
source_group (traits\\constants\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/windows/.*h)
source_group (traits\\internal\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/internal/windows/.*h)
source_group (traits\\kernel_interface\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/windows/.*h)
source_group (traits\\marker\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/windows/.*h)
source_group (traits\\override\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/windows/.*h)
source_group (traits\\policy\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/windows/.*h)
source_group (traits\\tools\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/windows/.*h)
source_group (traits\\validation\\windows ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/windows/.*h)
# debug logs framework
source_group (iu\\windows FILES
${BS_DIR_INSTRUMENTATION}/utils/windows/umd/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/windows/umd/iu_std.cpp
${BS_DIR_INSTRUMENTATION}/utils/windows/inc/iu_os.h
)
# add linux headers to solution explorer
source_group (codegen\\traits\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/linux/.*h)
source_group (library\\inc\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/.*)
source_group (library\\inc\\linux\\external\\drm ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/external/drm.*)
source_group (traits\\configuration\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/linux/.*h)
source_group (traits\\constants\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/linux/.*h)
source_group (traits\\device\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device/linux/.*h)
source_group (traits\\kernel_interface\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/linux/.*h)
source_group (traits\\marker\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/linux/.*h)
source_group (traits\\override\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/linux/.*h)
source_group (traits\\policy\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/linux/.*h)
source_group (traits\\tools\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/linux/.*h)
source_group (traits\\validation\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/linux/.*h)
source_group (iu\\linux FILES
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_std.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/iu_os.h
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/iu_i915_perf.h
)
elseif (${PLATFORM} STREQUAL linux) # linux
source_group (codegen\\traits\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits/linux/.*h)
source_group (library\\inc\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/.*)
source_group (library\\inc\\linux\\external\\drm ${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/external/drm/.*)
source_group (traits\\configuration\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration/linux/.*h)
source_group (traits\\constants\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants/linux/.*h)
source_group (traits\\device\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device/linux/.*h)
source_group (traits\\kernel_interface\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface/linux/.*h)
source_group (traits\\marker\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker/linux/.*h)
source_group (traits\\override\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override/linux/.*h)
source_group (traits\\policy\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy/linux/.*h)
source_group (traits\\tools\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools/linux/.*h)
source_group (traits\\validation\\linux ${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation/linux/.*h)
# debug logs framework
source_group (iu\\linux FILES
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_os.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/iu_std.cpp
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/iu_os.h
${BS_DIR_INSTRUMENTATION}/utils/linux/inc/iu_i915_perf.h
)
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# TARGET FLAGS (add_library & link_libraries)
#################################################################################
# add library
add_library (${PROJECT_NAME} SHARED ${HEADERS} ${SOURCES})
# version
set_target_properties (${PROJECT_NAME} PROPERTIES VERSION ${LIB_VERSION} SOVERSION ${LIB_MAJOR_VERSION})
# project specific target settings
if (${PLATFORM} STREQUAL Windows) # windows
instr_target_settings (${PROJECT_NAME})
set_property (TARGET ${PROJECT_NAME} PROPERTY OUTPUT_NAME ${LIB}${ARCH})
set (CMAKE_CXX_STANDARD_LIBRARIES "")
set (CMAKE_C_STANDARD_LIBRARIES "")
set_target_properties (${PROJECT_NAME} PROPERTIES VS_GLOBAL_DriverTargetPlatform Universal)
set_target_properties (${PROJECT_NAME} PROPERTIES VS_PLATFORM_TOOLSET "WindowsApplicationForDrivers10.0")
target_link_libraries (${PROJECT_NAME}
onecoreuap.lib
)
windows_apps_props_universal (${PROJECT_NAME})
elseif (${PLATFORM} STREQUAL linux) # linux
set_property (TARGET ${PROJECT_NAME} PROPERTY OUTPUT_NAME ${LIB})
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# INCLUDES
#################################################################################
set (COMMON_TARGET_INCLUDE_DIRECTORIES
${BS_DIR_INC}/common/instrumentation/api
${BS_DIR_INSTRUMENTATION}/utils/inc
${BS_DIR_INSTRUMENTATION}/utils/common/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/ddi
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/ddi/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/gpu
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/traits
${BS_DIR_INSTRUMENTATION}/metrics_library/codegen/library/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/command_buffer
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/configuration
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/constants
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/context
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/device
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/example
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/function_log
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/internal
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/kernel_interface
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/marker
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/oa_buffer
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/object
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/override
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/policy
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/query
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/tools
${BS_DIR_INSTRUMENTATION}/metrics_library/traits/validation
)
if (${PLATFORM} STREQUAL Windows) # windows
target_include_directories (${PROJECT_NAME} PUBLIC
${COMMON_TARGET_INCLUDE_DIRECTORIES}
${BS_DIR_INSTRUMENTATION}/utils/windows/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/windows
)
elseif (${PLATFORM} STREQUAL linux) # linux
target_include_directories (${PROJECT_NAME} PUBLIC
${COMMON_TARGET_INCLUDE_DIRECTORIES}
${BS_DIR_INSTRUMENTATION}/utils/linux/inc
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux
${BS_DIR_INSTRUMENTATION}/metrics_library/library/inc/linux/external/drm
)
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# COMPILER FLAGS
#################################################################################
if (${PLATFORM} STREQUAL Windows) # windows
bs_set_extra_target_properties (${PROJECT_NAME}
USERMODE_DRIVER
)
set (COMMON_COMPILE_OPTIONS
/Zp8 # struct member alignment - 8 bytes
/bigobj # increase number of sections in .obj
/GR- # run-time type information disabled
/wd4127 # conditional expression is constant
/wd4201 # nonstandard extension used : nameless struct/union
/wd4324 # structure was padded due to alignment specifier
/wd4714 # marked as __forceinline not inlined
)
target_compile_options (
${PROJECT_NAME} PRIVATE
$<$<CONFIG:Release>:
${COMMON_COMPILE_OPTIONS}
/W4 # display warnings level 4
/WX # treat warnings as errors
/Ot # favor fast code
/O2 # favor speed
/GL # whole program optimization
>
$<$<CONFIG:ReleaseInternal>:
${COMMON_COMPILE_OPTIONS}
/W4 # display warnings level 4
/WX # treat warnings as errors
/Ot # favor fast code
/O2 # favor speed
/GL # whole program optimization
>
$<$<CONFIG:Debug>:
${COMMON_COMPILE_OPTIONS}
>
)
elseif (${PLATFORM} STREQUAL linux) # linux
target_compile_options (
${PROJECT_NAME} PRIVATE
-Wall # enables all compiler's warning messages
#-Wfatal-errors # abort compilation on the first error occurred
-Wextra # enables a comprehensive set of warning options, providing a high level of warning coverage for potential issues
-Wno-unknown-pragmas # allow unknown pragmas (such as #pragma region)
-fpack-struct=8 # struct member alignment - 8 bytes
-Wformat # enables format string checking warnings during compilation
-Wformat-security # warns about potentially insecure format string usages
-Werror=format-security # treat format string security warnings as errors
-Wno-sequence-point # disable undefined behavior warning
-Wno-comment # allow multi-line comments
-Ofast # optimize code in the favor of speed
-fstack-protector-strong # enables stack protection for vulnerable functions that contain: An array of any size and type
-Wno-unused-but-set-parameter # disable parameter set but not used warning
)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_definitions (-Wno-extern-c-compat) # disable "empty struct has size 0 in C, size 1 in C++" warning
endif ()
if ("${TARGET_ARCH}" STREQUAL "32")
add_definitions (-m32)
endif ()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "debug")
add_definitions (-D_DEBUG)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "release-internal" OR
"${BUILD_TYPE}" STREQUAL "releaseinternal")
add_definitions (-D_RELEASE_INTERNAL)
elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "release")
add_definitions (-D_RELEASE)
endif ()
if ("${BUILD_TYPE}" STREQUAL "release" OR
"${BUILD_TYPE}" STREQUAL "release-internal" OR
"${BUILD_TYPE}" STREQUAL "releaseinternal")
add_definitions (-Werror) # treat warning as errors
add_definitions (-flto) # enables Link-Time Optimization (LTO)
add_definitions (-fvisibility=hidden) # hide non-exported symbols
add_definitions (-Werror=format-security) # treat format string security warnings as errors
add_definitions (-fPIC) # generates position-independent code during the compilation phase
add_definitions (-fPIE) # generates position-independent executables during the compilation phase
add_definitions (-pie) # produces position-independent executables during the linking phase
endif ()
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# GENERATOR
#################################################################################
if (MSVC AND NOT "$ENV{skipPyProj}" STREQUAL "True")
include_external_msproject ("metrics_library_generator" ${GFX_DEVELOPMENT_DIR}/Tools/MetricsLibraryGenerator/metrics_library_generator.pyproj)
set_target_properties ("metrics_library_generator" PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
set_target_properties ("metrics_library_generator" PROPERTIES EXCLUDE_FROM_ALL TRUE)
endif ()
#################################################################################
# LINKER FLAGS
#################################################################################
if (${PLATFORM} STREQUAL Windows) # windows
# dummy linker flags to override the need to forcefully add them this way
set (CMAKE_SHARED_LINKER_FLAGS_RELEASEINTERNAL "/LTCG /INCREMENTAL:NO /OPT:ICF")
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "/LTCG /INCREMENTAL:NO /OPT:ICF")
set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "")
set (CMAKE_SHARED_LINKER_FLAGS "")
elseif (${PLATFORM} STREQUAL linux) # linux
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,noexecstack")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,relro")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,now")
# to enable x86 build on x64 host
if ("${TARGET_ARCH}" STREQUAL "32")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
endif ()
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# LINK LIBRARIES
#################################################################################
if (${PLATFORM} STREQUAL linux)
set (DRM_LIB_PATH drm)
target_link_libraries (
${PROJECT_NAME} # metrics_library
${DRM_LIB_PATH} # drm
)
endif ()
#################################################################################
# INSTALLER
#################################################################################
if (${PLATFORM} STREQUAL Windows) # windows
install (TARGETS ${PROJECT_NAME} RUNTIME
DESTINATION Release/bin
CONFIGURATIONS Release
)
install (TARGETS ${PROJECT_NAME} RUNTIME
DESTINATION Release-Internal/bin
CONFIGURATIONS ReleaseInternal
)
install (TARGETS ${PROJECT_NAME} RUNTIME
DESTINATION Debug/bin
CONFIGURATIONS Debug
)
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
DESTINATION Release/pdb
CONFIGURATIONS Release
)
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
DESTINATION Release-Internal/pdb
CONFIGURATIONS ReleaseInternal
)
install (FILES $<TARGET_PDB_FILE:${PROJECT_NAME}>
DESTINATION Debug/pdb
CONFIGURATIONS Debug
)
elseif (${PLATFORM} STREQUAL linux) # linux
include (GNUInstallDirs)
if (${TARGET_ARCH} STREQUAL 64)
set (CPACK_PACKAGE_ARCHITECTURE "x86_64")
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set (CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64")
else ()
set (CPACK_PACKAGE_ARCHITECTURE "i386")
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
set (CPACK_RPM_PACKAGE_ARCHITECTURE "i386")
endif ()
# pkg-config
set (PC_FILE ${LIB_NAME}.pc)
set (PC_IN ${PC_FILE}.in)
configure_file (${PC_IN} ${CMAKE_BINARY_DIR}/${PC_FILE} @ONLY)
install (FILES ${CMAKE_BINARY_DIR}/${PC_FILE}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT metrics-library-pkgconfig
)
# header
install (FILES ${API_HEADER_LOCATION}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT metrics-library-devel
)
# library
install (TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT metrics-library
NAMELINK_SKIP
)
install (TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT metrics-library-devel
NAMELINK_ONLY
)
# workaround with 2 symlinks (e.g. libigdml64.so, libigdml.so) in devel package refering to libigdml.so.1 in regular package
ADD_CUSTOM_TARGET(link_target ALL COMMAND ${CMAKE_COMMAND} -E create_symlink "${LIB_NAME}.so.${LIB_MAJOR_VERSION}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIB_NAME}${TARGET_ARCH}.so")
install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIB_NAME}${TARGET_ARCH}.so"
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT metrics-library-devel)
# software package generator
if (LIB_CPACK_GENERATOR)
set (CPACK_GENERATOR ${LIB_CPACK_GENERATOR})
else ()
if (EXISTS "/etc/debian_version")
set (CPACK_GENERATOR "DEB")
elseif (EXISTS "/etc/redhat-release")
set (CPACK_GENERATOR "RPM")
elseif (EXISTS "/etc/os-release")
set (CPACK_GENERATOR "RPM")
else ()
set (CPACK_GENERATOR "TXZ")
endif ()
endif ()
set (CPACK_SET_DESTDIR TRUE)
set (CPACK_PACKAGE_NAME "intel")
set (CPACK_PACKAGE_VERSION ${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_BUILD_VERSION})
set (CPACK_PACKAGE_RELOCATABLE FALSE)
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CMAKE_INSTALL_PREFIX})
set (CPACK_PACKAGE_CONTACT "Intel Corporation")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "intel")
set (CPACK_DEBIAN_PACKAGE_DESCRIPTION "Metrics Library for Intel(R) Graphics Technology")
set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
set (CPACK_RPM_COMPRESSION_TYPE "xz")
set (CPACK_RPM_PACKAGE_AUTOREQ OFF)
set (CPACK_RPM_PACKAGE_DESCRIPTION "Metrics Library for Intel(R) Graphics Technology")
set (CPACK_RPM_PACKAGE_LICENSE "MIT")
if (DEFINED LIB_PACKAGE_RELEASE)
set (CPACK_DEBIAN_PACKAGE_RELEASE ${LIB_PACKAGE_RELEASE})
set (CPACK_RPM_PACKAGE_RELEASE ${LIB_PACKAGE_RELEASE})
else ()
set (CPACK_DEBIAN_PACKAGE_RELEASE 1)
set (CPACK_RPM_PACKAGE_RELEASE 1)
endif ()
set (CPACK_DEBIAN_METRICS-LIBRARY-PKGCONFIG_FILE_NAME "intel-metrics-library-pkgconfig-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
set (CPACK_RPM_METRICS-LIBRARY-PKGCONFIG_FILE_NAME "intel-metrics-library-pkgconfig-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
set (CPACK_ARCHIVE_METRICS-LIBRARY-PKGCONFIG_FILE_NAME "intel-metrics-library-pkgconfig-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}.${CPACK_PACKAGE_ARCHITECTURE}")
set (CPACK_DEBIAN_METRICS-LIBRARY-DEVEL_FILE_NAME "intel-metrics-library-devel-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
set (CPACK_RPM_METRICS-LIBRARY-DEVEL_FILE_NAME "intel-metrics-library-devel-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
set (CPACK_ARCHIVE_METRICS-LIBRARY-DEVEL_FILE_NAME "intel-metrics-library-devel-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}.${CPACK_PACKAGE_ARCHITECTURE}")
set (CPACK_DEBIAN_METRICS-LIBRARY_FILE_NAME "intel-metrics-library-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
set (CPACK_RPM_METRICS-LIBRARY_FILE_NAME "intel-metrics-library-${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
set (CPACK_ARCHIVE_METRICS-LIBRARY_FILE_NAME "intel-metrics-library-${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}.${CPACK_PACKAGE_ARCHITECTURE}")
set(CPACK_DEBIAN_METRICS-LIBRARY-DEVEL_PACKAGE_DEPENDS "intel-metrics-library(=${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE})")
set(CPACK_RPM_METRICS-LIBRARY-DEVEL_PACKAGE_REQUIRES "intel-metrics-library = ${CPACK_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}")
set (CPACK_DEB_COMPONENT_INSTALL ON)
set (CPACK_RPM_COMPONENT_INSTALL ON)
set (CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set (CPACK_COMPONENTS_ALL metrics-library-pkgconfig metrics-library-devel metrics-library)
include (CPack)
else()
message("-- Using platform is ${PLATFORM}")
endif ()
#################################################################################
# CODING STANDARD
#################################################################################
#if (MSVC)
# add_custom_command (TARGET ${PROJECT_NAME}
# PRE_BUILD
# COMMAND ${BS_DIR_INSTRUMENTATION}/metrics_library/CodingStandard.bat NoEdit --path ${BS_DIR_EXTERNAL_COMPONENTS}
# COMMENT "Checking coding standards..."
# )
#endif ()
#################################################################################
# DEBUG
#################################################################################
if (${PLATFORM} STREQUAL Windows) # windows
instr_debug (${PROJECT_NAME})
elseif (${PLATFORM} STREQUAL linux) # linux
message ("INFO: PROJECT_NAME = ${PROJECT_NAME}")
message ("INFO: VERSION = ${LIB_VERSION}")
message ("INFO: BUILD_TYPE = ${CMAKE_BUILD_TYPE}")
message ("INFO: PLATFORM = ${PLATFORM}")
message ("INFO: HOST_ARCH = ${HOST_ARCH}")
message ("INFO: TARGET_ARCH = ${TARGET_ARCH}")
message ("INFO: DUMP_DIR = ${DUMP_DIR}")
message ("INFO: LIB_INSTALL_DIR = ${CMAKE_INSTALL_FULL_LIBDIR}")
message ("INFO: LIBDRM_SRC = ${LIBDRM_SRC}")
message ("INFO: DRM_LIB_PATH = ${DRM_LIB_PATH}")
message ("INFO: BS_DIR_INSTRUMENTATION = ${BS_DIR_INSTRUMENTATION}")
message ("INFO: BS_DIR_INC = ${BS_DIR_INC}")
message ("INFO: BS_DIR_EXTERNAL = ${BS_DIR_EXTERNAL}")
message ("INFO: CMAKE_C_FLAGS = ${CMAKE_C_FLAGS}")
message ("INFO: CMAKE_CXX_FLAGS = ${CMAKE_CXX_FLAGS}")
else()
message("-- Using platform is ${PLATFORM}")
endif ()