@@ -530,220 +530,69 @@ macro(GetGTPinHeaders_legacy TARGET)
530
530
endif ()
531
531
endmacro ()
532
532
533
- macro (GetGTPinLibrary TARGET )
533
+ macro (GetGTPinPackage TARGET )
534
534
if (NOT DEFINED GTPIN_PATH )
535
- set (GTPIN_LIB_PATH "${CMAKE_BINARY_DIR} " )
536
- RequirePythonInterp ()
537
- if (UNIX )
538
- add_custom_target (gtpin_libs ALL
539
- DEPENDS ${GTPIN_LIB_PATH} /GTPIN/libgcc_s.so.1
540
- ${GTPIN_LIB_PATH} /GTPIN/libged.so
541
- ${GTPIN_LIB_PATH} /GTPIN/libgtpin_core.so
542
- ${GTPIN_LIB_PATH} /GTPIN/libgtpin.so
543
- ${GTPIN_LIB_PATH} /GTPIN/libiga_wrapper.so )
544
- add_custom_command (OUTPUT ${GTPIN_LIB_PATH} /GTPIN/libgcc_s.so.1
545
- ${GTPIN_LIB_PATH} /GTPIN/libged.so
546
- ${GTPIN_LIB_PATH} /GTPIN/libgtpin_core.so
547
- ${GTPIN_LIB_PATH} /GTPIN/libgtpin.so
548
- ${GTPIN_LIB_PATH} /GTPIN/libiga_wrapper.so
549
- COMMAND "${PYTHON_EXECUTABLE} " "${PTI_CMAKE_MACRO_DIR} /get_gtpin_libs.py" ${GTPIN_LIB_PATH} ${CMAKE_BINARY_DIR} )
550
- target_link_libraries (${TARGET}
551
- "${GTPIN_LIB_PATH} /GTPIN/libgtpin.so" )
552
- target_link_libraries (${TARGET}
553
- "${GTPIN_LIB_PATH} /GTPIN/libged.so" )
554
- add_dependencies (${TARGET}
555
- gtpin_libs )
556
- elseif (WIN32 )
557
- add_custom_target (gtpin_libs ALL
558
- DEPENDS ${GTPIN_LIB_PATH} /GTPIN/gtpin.lib
559
- ${GTPIN_LIB_PATH} /ged.dll
560
- ${GTPIN_LIB_PATH} /gtpin.dll
561
- ${GTPIN_LIB_PATH} /gtpin_core.dll
562
- ${GTPIN_LIB_PATH} /iga_wrapper.dll )
563
- add_custom_command (OUTPUT ${GTPIN_LIB_PATH} /GTPIN/gtpin.lib
564
- ${GTPIN_LIB_PATH} /ged.dll
565
- ${GTPIN_LIB_PATH} /gtpin.dll
566
- ${GTPIN_LIB_PATH} /gtpin_core.dll
567
- ${GTPIN_LIB_PATH} /iga_wrapper.dll
568
- COMMAND "${PYTHON_EXECUTABLE} " "${PTI_CMAKE_MACRO_DIR} /get_gtpin_libs.py" ${GTPIN_LIB_PATH} ${CMAKE_BINARY_DIR} )
569
- target_link_libraries (${TARGET}
570
- "${GTPIN_LIB_PATH} /GTPIN/gtpin.lib" )
571
- add_dependencies (${TARGET}
572
- gtpin_libs )
573
- else ()
574
- message (FATAL_ERROR "Graphics Technology Pin (GT Pin) path was not specified. Use -DGTPIN_PATH to set it" )
575
- endif ()
576
- endif ()
577
- endmacro ()
578
-
579
- macro (FindGTPinLibrary TARGET )
580
- if (DEFINED GTPIN_PATH )
581
- find_library (GTPIN_LIB_PATH
582
- NAMES gtpin
583
- HINTS "${GTPIN_PATH} /Lib/intel64" )
584
- find_library (GTPIN_GED_LIB_PATH
585
- NAMES ged
586
- HINTS "${GTPIN_PATH} /Lib/intel64" )
587
- if (GTPIN_LIB_PATH AND GTPIN_GED_LIB_PATH )
588
- message (STATUS "Graphics Technology Pin (GT Pin) library path: ${GTPIN_LIB_PATH} & ${GTPIN_GED_LIB_PATH} " )
589
- target_link_libraries (${TARGET}
590
- ${GTPIN_LIB_PATH} )
591
- target_link_libraries (${TARGET}
592
- ${GTPIN_GED_LIB_PATH} )
593
- else ()
594
- message (FATAL_ERROR "Graphics Technology Pin (GT Pin) library was not found at ${GTPIN_PATH} /Lib/intel64" )
535
+ if (NOT DEFINED GTPIN_LINK )
536
+ if (UNIX )
537
+ set (GTPIN_LINK https://downloadmirror.intel.com/793592/external-release-gtpin-3.7-linux.tar.xz )
538
+ elseif (WIN32 )
539
+ set (GTPIN_LINK https://downloadmirror.intel.com/793592/external-release-gtpin-3.7-win.zip )
540
+ else ()
541
+ message (FATAL_ERROR "Graphics Technology Pin (GT Pin) is not supported for the platform" )
542
+ endif ()
595
543
endif ()
544
+ include (FetchContent )
545
+ FetchContent_Declare (
546
+ gtpin_package
547
+ URL ${GTPIN_LINK}
548
+ )
549
+ message (STATUS "Download GTPin package link: ${GTPIN_LINK} " )
550
+ FetchContent_MakeAvailable (gtpin_package )
551
+ set (GTPIN_PATH ${gtpin_package_SOURCE_DIR} )
552
+ message (STATUS "GTPin Technology Pin (GT Pin) unpacked: ${GTPIN_PATH} " )
596
553
else ()
597
- message (STATUS "Graphics Technology Pin (GT Pin) path was not defined - it will be downloaded automatically on build" )
598
- GetGTPinLibrary (${TARGET} )
554
+ if (NOT IS_ABSOLUTE ${GTPIN_PATH} )
555
+ message (FATAL_ERROR "Provided GTPIN_PATH is not an absolute path: ${GTPIN_PATH} " )
556
+ endif ()
599
557
endif ()
600
- endmacro ()
601
-
602
- macro (GetGTPinHeaders TARGET )
603
- if (NOT DEFINED GTPIN_PATH )
604
- set (GTPIN_INC_PATH "${CMAKE_BINARY_DIR} " )
605
- RequirePythonInterp ()
606
-
607
- add_custom_target (gtpin_headers ALL
608
- DEPENDS ${GTPIN_INC_PATH} /GTPIN/api/gt_basic_defs.h
609
- ${GTPIN_INC_PATH} /GTPIN/api/gt_basic_utils.h
610
- ${GTPIN_INC_PATH} /GTPIN/api/gt_gen_procedure.h
611
- ${GTPIN_INC_PATH} /GTPIN/api/gt_gpu_defs.h
612
- ${GTPIN_INC_PATH} /GTPIN/api/gt_hli_function.h
613
- ${GTPIN_INC_PATH} /GTPIN/api/gt_ins_fields.h
614
- ${GTPIN_INC_PATH} /GTPIN/api/gt_knob_defs.h
615
- ${GTPIN_INC_PATH} /GTPIN/api/gt_knob.h
616
- ${GTPIN_INC_PATH} /GTPIN/api/gtpin_api.h
617
- ${GTPIN_INC_PATH} /GTPIN/api/gt_profile_array.h
618
- ${GTPIN_INC_PATH} /GTPIN/api/gt_profile_trace.h
619
- ${GTPIN_INC_PATH} /GTPIN/api/gt_reg.h
620
- ${GTPIN_INC_PATH} /GTPIN/api/igt_cfg.h
621
- ${GTPIN_INC_PATH} /GTPIN/api/igt_core.h
622
- ${GTPIN_INC_PATH} /GTPIN/api/igt_event.h
623
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_arch.h
624
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_coder.h
625
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_procedure.h
626
- ${GTPIN_INC_PATH} /GTPIN/api/igt_hli_library.h
627
- ${GTPIN_INC_PATH} /GTPIN/api/igt_iarg_factory.h
628
- ${GTPIN_INC_PATH} /GTPIN/api/igt_iarg.h
629
- ${GTPIN_INC_PATH} /GTPIN/api/igt_ins_factory.h
630
- ${GTPIN_INC_PATH} /GTPIN/api/igt_ins.h
631
- ${GTPIN_INC_PATH} /GTPIN/api/igt_kernel.h
632
- ${GTPIN_INC_PATH} /GTPIN/api/igt_knob_arg.h
633
- ${GTPIN_INC_PATH} /GTPIN/api/igt_knob_registry.h
634
- ${GTPIN_INC_PATH} /GTPIN/api/igt_memory_mapper.h
635
- ${GTPIN_INC_PATH} /GTPIN/api/igt_profile_buffer.h
636
- ${GTPIN_INC_PATH} /GTPIN/api/igt_reg_allocator.h
637
- ${GTPIN_INC_PATH} /GTPIN/api/igt_tool.h
638
- ${GTPIN_INC_PATH} /GTPIN/api/igt_vreg_factory.h
639
- ${GTPIN_INC_PATH} /GTPIN/api/igt_vreg.h
640
- ${GTPIN_INC_PATH} /GTPIN/api/gt_api_version.h
641
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_basic_types.h
642
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_enumerations.h
643
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_enum_types.h
644
- ${GTPIN_INC_PATH} /GTPIN/ged/ged.h
645
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_ins_field.h )
646
- add_custom_command (OUTPUT ${GTPIN_INC_PATH} /GTPIN/api/gt_basic_defs.h
647
- ${GTPIN_INC_PATH} /GTPIN/api/gt_basic_utils.h
648
- ${GTPIN_INC_PATH} /GTPIN/api/gt_gen_procedure.h
649
- ${GTPIN_INC_PATH} /GTPIN/api/gt_gpu_defs.h
650
- ${GTPIN_INC_PATH} /GTPIN/api/gt_hli_function.h
651
- ${GTPIN_INC_PATH} /GTPIN/api/gt_ins_fields.h
652
- ${GTPIN_INC_PATH} /GTPIN/api/gt_knob_defs.h
653
- ${GTPIN_INC_PATH} /GTPIN/api/gt_knob.h
654
- ${GTPIN_INC_PATH} /GTPIN/api/gtpin_api.h
655
- ${GTPIN_INC_PATH} /GTPIN/api/gt_profile_array.h
656
- ${GTPIN_INC_PATH} /GTPIN/api/gt_profile_trace.h
657
- ${GTPIN_INC_PATH} /GTPIN/api/gt_reg.h
658
- ${GTPIN_INC_PATH} /GTPIN/api/igt_cfg.h
659
- ${GTPIN_INC_PATH} /GTPIN/api/igt_core.h
660
- ${GTPIN_INC_PATH} /GTPIN/api/igt_event.h
661
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_arch.h
662
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_coder.h
663
- ${GTPIN_INC_PATH} /GTPIN/api/igt_gen_procedure.h
664
- ${GTPIN_INC_PATH} /GTPIN/api/igt_hli_library.h
665
- ${GTPIN_INC_PATH} /GTPIN/api/igt_iarg_factory.h
666
- ${GTPIN_INC_PATH} /GTPIN/api/igt_iarg.h
667
- ${GTPIN_INC_PATH} /GTPIN/api/igt_ins_factory.h
668
- ${GTPIN_INC_PATH} /GTPIN/api/igt_ins.h
669
- ${GTPIN_INC_PATH} /GTPIN/api/igt_kernel.h
670
- ${GTPIN_INC_PATH} /GTPIN/api/igt_knob_arg.h
671
- ${GTPIN_INC_PATH} /GTPIN/api/igt_knob_registry.h
672
- ${GTPIN_INC_PATH} /GTPIN/api/igt_memory_mapper.h
673
- ${GTPIN_INC_PATH} /GTPIN/api/igt_profile_buffer.h
674
- ${GTPIN_INC_PATH} /GTPIN/api/igt_reg_allocator.h
675
- ${GTPIN_INC_PATH} /GTPIN/api/igt_tool.h
676
- ${GTPIN_INC_PATH} /GTPIN/api/igt_vreg_factory.h
677
- ${GTPIN_INC_PATH} /GTPIN/api/igt_vreg.h
678
- ${GTPIN_INC_PATH} /GTPIN/api/gt_api_version.h
679
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_basic_types.h
680
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_enumerations.h
681
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_enum_types.h
682
- ${GTPIN_INC_PATH} /GTPIN/ged/ged.h
683
- ${GTPIN_INC_PATH} /GTPIN/ged/ged_ins_field.h
684
- COMMAND "${PYTHON_EXECUTABLE} " "${PTI_CMAKE_MACRO_DIR} /get_gtpin_headers.py" ${GTPIN_INC_PATH} ${CMAKE_BINARY_DIR} )
685
- target_include_directories (${TARGET}
686
- PUBLIC "${GTPIN_INC_PATH} /GTPIN"
687
- PUBLIC "${GTPIN_INC_PATH} /GTPIN/api"
688
- PUBLIC "${GTPIN_INC_PATH} /GTPIN/ged/intel64" )
689
- add_dependencies (${TARGET}
690
- gtpin_headers )
558
+ find_library (GTPIN_LIB_PATH
559
+ NAMES gtpin
560
+ HINTS ${GTPIN_PATH} /Lib/intel64 )
561
+ find_library (GTPIN_GED_LIB_PATH
562
+ NAMES ged
563
+ HINTS ${GTPIN_PATH} /Lib/intel64 )
564
+ find_path (GTPIN_FILE_GTPIN_API_H "gtpin_api.h"
565
+ PATHS ${GTPIN_PATH} /Include/api/ )
566
+ find_path (GTPIN_FILE_GED_H "ged.h"
567
+ PATHS ${GTPIN_PATH} /Include/ged/intel64 )
568
+ if (NOT (GTPIN_LIB_PATH AND GTPIN_GED_LIB_PATH AND GTPIN_FILE_GTPIN_API_H AND GTPIN_FILE_GED_H ))
569
+ message (FATAL_ERROR "Some parts of GTPin package not found: GTPIN_LIB_PATH:${GTPIN_LIB_PATH} ; GTPIN_GED_LIB_PATH:${GTPIN_GED_LIB_PATH} ; GTPIN_FILE_GTPIN_API_H:${GTPIN_FILE_GTPIN_API_H} ; GTPIN_FILE_GED_H:${GTPIN_FILE_GED_H} " )
691
570
endif ()
692
571
endmacro ()
693
572
694
- macro (FindGTPinHeaders TARGET )
695
- if (CMAKE_INCLUDE_PATH )
696
- set (CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH} )
697
- endif ()
698
- if (DEFINED GTPIN_PATH )
699
- message (STATUS "Graphics Technology Pin (GT Pin) include path: ${GTPIN_PATH} /Include, ${GTPIN_PATH} /Include/api, ${GTPIN_PATH} /Include/ged/intel64" )
700
- target_include_directories (${TARGET}
701
- PUBLIC "${GTPIN_PATH} /Include"
702
- PUBLIC "${GTPIN_PATH} /Include/api"
703
- PUBLIC "${GTPIN_PATH} /Include/ged/intel64" )
704
- else ()
705
- message (STATUS "Graphics Technology Pin (GT Pin) path was not defined - it will be downloaded automatically on build" )
706
- GetGTPinHeaders (${TARGET} )
707
- endif ()
708
- set (CMAKE_REQUIRED_INCLUDES )
573
+ macro (FindGTPinLibrary TARGET )
574
+ GetGTPinPackage (${TARGET} )
575
+ target_link_directories (${TARGET}
576
+ PRIVATE ${GTPIN_PATH} /Lib/intel64 )
577
+ target_link_libraries (${TARGET} gtpin ged )
709
578
endmacro ()
710
579
711
- macro (GetGTPinUtil TARGET UTIL )
712
- if (NOT DEFINED GTPIN_PATH )
713
- set (GTPIN_UTIL_PATH "${CMAKE_BINARY_DIR} " )
714
- RequirePythonInterp ()
715
- add_custom_target (gtpin_${UTIL} ALL
716
- DEPENDS "${GTPIN_UTIL_PATH} /GTPIN/utils/${UTIL} .h"
717
- "${GTPIN_UTIL_PATH} /GTPIN/utils/${UTIL} .cpp" )
718
- add_custom_command (OUTPUT "${GTPIN_UTIL_PATH} /GTPIN/utils/${UTIL} .h"
719
- "${GTPIN_UTIL_PATH} /GTPIN/utils/${UTIL} .cpp"
720
- COMMAND "${PYTHON_EXECUTABLE} " "${PTI_CMAKE_MACRO_DIR} /get_gtpin_util.py" ${GTPIN_UTIL_PATH} ${CMAKE_BINARY_DIR} ${UTIL} )
721
- target_sources (${TARGET} PRIVATE
722
- "${GTPIN_UTIL_PATH} /Examples/utils/${UTIL} .cpp" )
723
- target_include_directories (${TARGET}
724
- PUBLIC "${GTPIN_UTIL_PATH} /GTPIN/utils" )
725
- add_dependencies (${TARGET}
726
- gtpin_${UTIL} )
727
- endif ()
580
+ macro (FindGTPinHeaders TARGET )
581
+ GetGTPinPackage (${TARGET} )
582
+ target_include_directories (${TARGET}
583
+ PRIVATE ${GTPIN_PATH} /Include
584
+ PRIVATE ${GTPIN_PATH} /Include/api
585
+ PRIVATE ${GTPIN_PATH} /Include/ged/intel64 )
728
586
endmacro ()
729
587
730
- macro (FindGTPinUtil TARGET UTIL )
731
- if (DEFINED GTPIN_PATH )
732
- find_file (GTPIN_${UTIL}_PATH
733
- NAMES ${UTIL} .cpp
734
- PATHS "${GTPIN_PATH} /Examples/utils" )
735
- if (GTPIN_${UTIL}_PATH )
736
- target_sources (${TARGET} PRIVATE
737
- ${GTPIN_${UTIL}_PATH} )
738
- target_include_directories (${TARGET}
739
- PUBLIC "${GTPIN_PATH} /Examples/utils" )
740
- else ()
741
- message (FATAL_ERROR "Graphics Technology Pin (GT Pin) ${UTIL} was not found at ${GTPIN_PATH} /Examples/utils" )
742
- endif ()
743
- else ()
744
- message (STATUS "Graphics Technology Pin (GT Pin) path was not defined - it will be downloaded automatically on build" )
745
- GetGTPinUtil (${TARGET} ${UTIL} )
588
+ macro (FindGTPinUtils TARGET )
589
+ GetGTPinPackage (${TARGET} )
590
+ if (NOT TARGET gtpintool_utils )
591
+ set (GTPIN_KIT ${GTPIN_PATH} )
592
+ add_subdirectory (${GTPIN_PATH} /Examples ${CMAKE_CURRENT_BINARY_DIR} /gtpin_utils EXCLUDE_FROM_ALL )
746
593
endif ()
594
+ target_include_directories (${TARGET} PRIVATE ${GTPIN_PATH} /Examples/utils )
595
+ target_link_libraries (${TARGET} gtpintool_utils )
747
596
endmacro ()
748
597
749
598
macro (GetLevelZeroHeaders TARGET )
0 commit comments