code:
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
set(CMAKE_Fortran_COMPILER_VERSION "@CMAKE_Fortran_COMPILER_VERSION@")
set(CMAKE_Fortran_COMPILER_WRAPPER "@CMAKE_Fortran_COMPILER_WRAPPER@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_SIMULATE_ID "@CMAKE_Fortran_SIMULATE_ID@")
set(CMAKE_Fortran_COMPILER_FRONTEND_VARIANT "@CMAKE_Fortran_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_Fortran_SIMULATE_VERSION "@CMAKE_Fortran_SIMULATE_VERSION@")
@_SET_CMAKE_Fortran_XL_CPP@
@_SET_CMAKE_Fortran_COMPILER_ARCHITECTURE_ID@
@_SET_CMAKE_Fortran_COMPILER_SYSROOT@
@SET_MSVC_Fortran_ARCHITECTURE_ID@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_Fortran_COMPILER_AR "@CMAKE_Fortran_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_Fortran_COMPILER_LINKER "@CMAKE_Fortran_COMPILER_LINKER@")
set(CMAKE_Fortran_COMPILER_LINKER_ID "@CMAKE_Fortran_COMPILER_LINKER_ID@")
set(CMAKE_Fortran_COMPILER_LINKER_VERSION @CMAKE_Fortran_COMPILER_LINKER_VERSION@)
set(CMAKE_Fortran_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_Fortran_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_Fortran_COMPILER_RANLIB "@CMAKE_Fortran_COMPILER_RANLIB@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
set(CMAKE_Fortran_COMPILER_LOADED 1)
set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@)
set(CMAKE_Fortran_ABI_COMPILED @CMAKE_Fortran_ABI_COMPILED@)

set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")

set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)

set(CMAKE_Fortran_COMPILER_ID_RUN 1)
set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;fpp;FPP;f77;F77;f90;F90;for;For;FOR;f95;F95;f03;F03;f08;F08@CMAKE_Fortran_VENDOR_SOURCE_FILE_EXTENSIONS@)
set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_Fortran_LINKER_PREFERENCE 20)
set(CMAKE_Fortran_LINKER_DEPFILE_SUPPORTED @CMAKE_Fortran_LINKER_DEPFILE_SUPPORTED@)
if(UNIX)
  set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
else()
  set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
endif()

# Save compiler ABI information.
set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")

if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
  set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_Fortran_COMPILER_ABI)
  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
endif()

if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
endif()

@CMAKE_Fortran_COMPILER_CUSTOM_CODE@
@CMAKE_Fortran_SYSROOT_FLAG_CODE@
@CMAKE_Fortran_OSX_DEPLOYMENT_TARGET_FLAG_CODE@

set(CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")


code:
      PROGRAM CMakeFortranCompilerABI
#if 0
! Address Size
#endif
#if defined(_LP64)
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_IA64)
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_X64)
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_AMD64)
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__x86_64__)
        PRINT *, 'INFO:sizeof_dptr[8]'

#elif defined(_ILP32)
        PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(_M_IX86)
        PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__i386__)
        PRINT *, 'INFO:sizeof_dptr[4]'

#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
        PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8
        PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 4
        PRINT *, 'INFO:sizeof_dptr[4]'
#endif

#if 0
! Application Binary Interface
#endif
#if defined(__ELF__)
        PRINT *, 'INFO:abi[ELF]'
#endif
        PRINT *, 'ABI Detection'
      END

repo_name: lazytadpole/codenamesilverfish

license: mit


code:
program CMakeFortranCompilerABI

implicit none

integer :: i(1) = 0
where (i==0) i=1
if (any(i/=1)) stop 1
! showing Fortran 90 syntax is OK

#if 0
! Address Size
#endif
#if defined(_LP64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_IA64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_X64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_AMD64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__x86_64__)
PRINT *, 'INFO:sizeof_dptr[8]'

#elif defined(_ILP32)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(_M_IX86)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__i386__)
PRINT *, 'INFO:sizeof_dptr[4]'

#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 8
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ == 4
PRINT *, 'INFO:sizeof_dptr[4]'
#endif

#if 0
! Application Binary Interface
#endif
#if defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
PRINT *, 'ABI Detection'
end program


code:
      PROGRAM CMakeFortranCompilerId
#if 0
! Identify the compiler
#endif
#if defined(_MSC_VER)
       PRINT *, 'INFO:simulate[MSVC]'
# if _MSC_VER >= 1900
       PRINT *, 'INFO:simulate_version[019.00]'
# elif _MSC_VER >= 1800
       PRINT *, 'INFO:simulate_version[018.00]'
# elif _MSC_VER >= 1700
       PRINT *, 'INFO:simulate_version[017.00]'
# elif _MSC_VER >= 1600
       PRINT *, 'INFO:simulate_version[016.00]'
# elif _MSC_VER >= 1500
       PRINT *, 'INFO:simulate_version[015.00]'
# elif _MSC_VER >= 1400
       PRINT *, 'INFO:simulate_version[014.00]'
# elif _MSC_VER >= 1310
       PRINT *, 'INFO:simulate_version[013.01]'
# else
       PRINT *, 'INFO:simulate_version[013.00]'
# endif
#endif
#if defined(__INTEL_LLVM_COMPILER)
        PRINT *, 'INFO:compiler[IntelLLVM]'
! __INTEL_LLVM_COMPILER = VVVVRP prior to 2021.2.0, VVVVRRPP for 2021.2.0 and
! later.  Look for 6 digit vs. 8 digit version number to decide encoding.
! VVVV is no smaller than the current year when a version is released.
# if __INTEL_LLVM_COMPILER < 1000000
#  define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/100)
#  define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/10 % 10)
#  define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER    % 10)
# else
#  define COMPILER_VERSION_MAJOR DEC(__INTEL_LLVM_COMPILER/10000)
#  define COMPILER_VERSION_MINOR DEC(__INTEL_LLVM_COMPILER/100 % 100)
#  define COMPILER_VERSION_PATCH DEC(__INTEL_LLVM_COMPILER     % 100)
# endif
#elif defined(__INTEL_COMPILER) && __INTEL_COMPILER == 201900
        PRINT *, 'INFO:compiler[IntelLLVM]'
! ifx 2021.1 forgot to define __INTEL_LLVM_COMPILER.
! Instead it defines __INTEL_COMPILER == 201900.
# define COMPILER_VERSION_MAJOR DEC(2021)
# define COMPILER_VERSION_MINOR DEC(1)
# define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
        PRINT *, 'INFO:compiler[Intel]'
! __INTEL_COMPILER = VRP prior to 2021, and then VVVV for 2021 and later.
# if __INTEL_COMPILER < 2021
#  define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER/100)
#  define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER/10 % 10)
#  if defined(__INTEL_COMPILER_UPDATE)
#   define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER_UPDATE)
#  else
#   define COMPILER_VERSION_PATCH DEC(__INTEL_COMPILER   % 10)
#  endif
# else
#  define COMPILER_VERSION_MAJOR DEC(__INTEL_COMPILER)
#  define COMPILER_VERSION_MINOR DEC(__INTEL_COMPILER_UPDATE)
!  The third version component from --version is an update index,
!  but no macro is provided for it.
#  define COMPILER_VERSION_PATCH DEC(0)
# endif
# if defined(__INTEL_COMPILER_BUILD_DATE)
#  define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
#elif defined(__SUNPRO_F95)
        PRINT *, 'INFO:compiler[SunPro]'
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F95>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F95>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F95    & 0xF)
#elif defined(__SUNPRO_F90)
        PRINT *, 'INFO:compiler[SunPro]'
# define COMPILER_VERSION_MAJOR HEX(__SUNPRO_F90>>8)
# define COMPILER_VERSION_MINOR HEX(__SUNPRO_F90>>4 & 0xF)
# define COMPILER_VERSION_PATCH HEX(__SUNPRO_F90    & 0xF)
#elif defined(_CRAYFTN)
        PRINT *, 'INFO:compiler[Cray]'
# define COMPILER_VERSION_MAJOR DEC(_RELEASE_MAJOR)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
# if defined(_RELEASE_PATCHLEVEL)
#  define COMPILER_VERSION_PATCH DEC(_RELEASE_PATCHLEVEL)
# endif
#elif defined(__G95__)
        PRINT *, 'INFO:compiler[G95]'
# define COMPILER_VERSION_MAJOR DEC(__G95__)
# define COMPILER_VERSION_MINOR DEC(__G95_MINOR__)
#elif defined(__PATHSCALE__)
        PRINT *, 'INFO:compiler[PathScale]'
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__ABSOFT__)
        PRINT *, 'INFO:compiler[Absoft]'
#elif defined(__LCC__) && (defined(__GNUC__) || defined(__GNUG__) || defined(__MCST__))
        PRINT *, 'INFO:compiler[LCC]'
# define COMPILER_VERSION_MAJOR DEC(1)
# define COMPILER_VERSION_MINOR DEC(__LCC__ - 100)
# if defined(__LCC_MINOR__)
#  define COMPILER_VERSION_PATCH DEC(__LCC_MINOR__)
# endif
#elif defined(__GNUC__)
        PRINT *, 'INFO:compiler[GNU]'
# define COMPILER_VERSION_MAJOR DEC(__GNUC__)
# define COMPILER_VERSION_MINOR DEC(__GNUC_MINOR__)
# if defined(__GNUC_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__GNUC_PATCHLEVEL__)
# endif
#elif defined(__IBMC__)
# if defined(__COMPILER_VER__)
        PRINT *, 'INFO:compiler[zOS]'
# elif __IBMC__ >= 800
        PRINT *, 'INFO:compiler[XL]'
#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
# else
        PRINT *, 'INFO:compiler[VisualAge]'
#  define COMPILER_VERSION_MAJOR DEC(__IBMC__/100)
#  define COMPILER_VERSION_MINOR DEC(__IBMC__/10 % 10)
#  define COMPILER_VERSION_PATCH DEC(__IBMC__    % 10)
# endif
#elif defined(__NVCOMPILER) || defined(__NVCOMPILER_LLVM__)
        PRINT *, 'INFO:compiler[NVHPC]'
# if defined(__NVCOMPILER_MAJOR__)
#  define COMPILER_VERSION_MAJOR DEC(__NVCOMPILER_MAJOR__)
# else
#  define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# endif
# if defined(__NVCOMPILER_MINOR__)
#  define COMPILER_VERSION_MINOR DEC(__NVCOMPILER_MINOR__)
# else
#  define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# endif
# if defined(__NVCOMPILER_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__NVCOMPILER_PATCHLEVEL__)
# elif defined(__PGIC_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PGI)
        PRINT *, 'INFO:compiler[PGI]'
# define COMPILER_VERSION_MAJOR DEC(__PGIC__)
# define COMPILER_VERSION_MINOR DEC(__PGIC_MINOR__)
# if defined(__PGIC_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__FLANG)
        PRINT *, 'INFO:compiler[Flang]'
# define COMPILER_VERSION_MAJOR DEC(__FLANG_MAJOR__)
# define COMPILER_VERSION_MINOR DEC(__FLANG_MINOR__)
# if defined(__FLANG_PATCHLEVEL__)
#  define COMPILER_VERSION_PATCH DEC(__FLANG_PATCHLEVEL__)
# endif
#elif defined(__flang__)
        PRINT *, 'INFO:compiler[LLVMFlang]'
# define COMPILER_VERSION_MAJOR DEC(__flang_major__)
# define COMPILER_VERSION_MINOR DEC(__flang_minor__)
# if defined(__flang_patchlevel__)
#  define COMPILER_VERSION_PATCH DEC(__flang_patchlevel__)
# endif
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
        PRINT *, 'INFO:compiler[VisualAge]'
#elif defined(__hpux) || defined(__hpux__)
        PRINT *, 'INFO:compiler[HP]'
#elif defined(NAGFOR)
        PRINT *, 'INFO:compiler[NAG]'
#define COMPILER_VERSION_MAJOR DEC(__NAG_COMPILER_RELEASE/10)
#define COMPILER_VERSION_MINOR DEC(__NAG_COMPILER_RELEASE % 10)
#define COMPILER_VERSION_PATCH DEC(__NAG_COMPILER_BUILD)
#elif defined(__FUJITSU)
        PRINT *, 'INFO:compiler[Fujitsu]'
# if defined(__FRT_major__)
#   define COMPILER_VERSION_MAJOR DEC(__FRT_major__)
#   define COMPILER_VERSION_MINOR DEC(__FRT_minor__)
#   define COMPILER_VERSION_PATCH DEC(__FRT_patchlevel__)
# elif defined(__FRT_version__)
        PRINT *, 'INFO:compiler_version['//__FRT_version__//']'
# endif
#else
        PRINT *, 'INFO:compiler[]'
#endif
#if defined(__CRAYXT_COMPUTE_LINUX_TARGET)
        PRINT *, 'INFO:compiler_wrapper[CrayPrgEnv]'
#endif

#if 0
! Identify the platform
#endif
#if defined(__linux) || defined(__linux__) || defined(linux)
        PRINT *, 'INFO:platform[Linux]'
#elif defined(__CYGWIN__)
        PRINT *, 'INFO:platform[Cygwin]'
#elif defined(__MINGW32__)
        PRINT *, 'INFO:platform[MinGW]'
#elif defined(__APPLE__)
        PRINT *, 'INFO:platform[Darwin]'
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
        PRINT *, 'INFO:platform[Windows]'
#elif defined(__FreeBSD__) || defined(__FreeBSD)
        PRINT *, 'INFO:platform[FreeBSD]'
#elif defined(__NetBSD__) || defined(__NetBSD)
        PRINT *, 'INFO:platform[NetBSD]'
#elif defined(__OpenBSD__) || defined(__OPENBSD)
        PRINT *, 'INFO:platform[OpenBSD]'
#elif defined(__sun) || defined(sun)
        PRINT *, 'INFO:platform[SunOS]'
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
        PRINT *, 'INFO:platform[AIX]'
#elif defined(__hpux) || defined(__hpux__)
        PRINT *, 'INFO:platform[HP-UX]'
#elif defined(__HAIKU__)
        PRINT *, 'INFO:platform[Haiku]'
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
        PRINT *, 'INFO:platform[BeOS]'
#elif defined(__QNX__) || defined(__QNXNTO__)
        PRINT *, 'INFO:platform[QNX]'
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
        PRINT *, 'INFO:platform[Tru64]'
#elif defined(__riscos) || defined(__riscos__)
        PRINT *, 'INFO:platform[RISCos]'
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
        PRINT *, 'INFO:platform[SINIX]'
#elif defined(__UNIX_SV__)
        PRINT *, 'INFO:platform[UNIX_SV]'
#elif defined(__bsdos__)
        PRINT *, 'INFO:platform[BSDOS]'
#elif defined(_MPRAS) || defined(MPRAS)
        PRINT *, 'INFO:platform[MP-RAS]'
#elif defined(__osf) || defined(__osf__)
        PRINT *, 'INFO:platform[OSF1]'
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
        PRINT *, 'INFO:platform[SCO_SV]'
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
        PRINT *, 'INFO:platform[ULTRIX]'
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
        PRINT *, 'INFO:platform[Xenix]'
#else
        PRINT *, 'INFO:platform[]'
#endif
#if defined(_MSC_VER)
# if defined(_M_IA64)
        PRINT *, 'INFO:arch[IA64]'
# elif defined(_M_X64) || defined(_M_AMD64)
        PRINT *, 'INFO:arch[x64]'
# elif defined(_M_IX86)
        PRINT *, 'INFO:arch[X86]'
# endif
#endif

#if 0
! Encode compiler version digits
#endif
#define DEC_8(n) (((n) / 10000000) % 10)
#define DEC_7(n) (((n) / 1000000)  % 10)
#define DEC_6(n) (((n) / 100000)   % 10)
#define DEC_5(n) (((n) / 10000)    % 10)
#define DEC_4(n) (((n) / 1000)     % 10)
#define DEC_3(n) (((n) / 100)      % 10)
#define DEC_2(n) (((n) / 10)       % 10)
#define DEC_1(n) (((n)    )        % 10)
#define HEX_8(n) ((n)>>28 & 0xF)
#define HEX_7(n) ((n)>>24 & 0xF)
#define HEX_6(n) ((n)>>20 & 0xF)
#define HEX_5(n) ((n)>>16 & 0xF)
#define HEX_4(n) ((n)>>12 & 0xF)
#define HEX_3(n) ((n)>>8  & 0xF)
#define HEX_2(n) ((n)>>4  & 0xF)
#define HEX_1(n) ((n)     & 0xF)
@CMAKE_Fortran_COMPILER_ID_VERSION_INFO@

      END


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(CMakeLanguageInformation)

# This file sets the basic flags for the Fortran language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.

set(_INCLUDED_FILE 0)

# Load compiler-specific information.
if(CMAKE_Fortran_COMPILER_ID)
  include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
endif()

set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME "${CMAKE_Fortran_COMPILER}" NAME_WE)
# since the gnu compiler has several names force g++
if(CMAKE_COMPILER_IS_GNUG77)
  set(CMAKE_BASE_NAME g77)
endif()
if(CMAKE_Fortran_COMPILER_ID)
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
          RESULT_VARIABLE _INCLUDED_FILE)
endif ()

# load any compiler-wrapper specific information
if (CMAKE_Fortran_COMPILER_WRAPPER)
  __cmake_include_compiler_wrapper(Fortran)
endif ()

# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included.  Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
if (NOT _INCLUDED_FILE)
  include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif ()

if(CMAKE_Fortran_SIZEOF_DATA_PTR)
  foreach(f IN LISTS CMAKE_Fortran_ABI_FILES)
    include(${f})
  endforeach()
  unset(CMAKE_Fortran_ABI_FILES)
endif()

# This should be included before the _INIT variables are
# used to initialize the cache.  Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.

if(CMAKE_USER_MAKE_RULES_OVERRIDE)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
endif()

if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
endif()

if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
  set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
endif()

if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
  set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif()
if(NOT CMAKE_Fortran_LINK_OPTIONS_PIE)
  set(CMAKE_Fortran_LINK_OPTIONS_PIE ${CMAKE_C_LINK_OPTIONS_PIE})
endif()
if(NOT CMAKE_Fortran_LINK_OPTIONS_NO_PIE)
  set(CMAKE_Fortran_LINK_OPTIONS_NO_PIE ${CMAKE_C_LINK_OPTIONS_NO_PIE})
endif()

if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
  set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
endif()

# Create a set of shared library variable specific to Fortran
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
  set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
  set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
  set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
  set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
  set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif()

if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
  set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
  set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
endif()

# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
if(NOT CMAKE_MODULE_EXISTS)
  set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
  set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
endif()

# repeat for modules
if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
  set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
endif()

if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
  set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
endif()

if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
  set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
endif()

if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
  set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
endif()

if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
  set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
  set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
endif()

if(NOT CMAKE_INCLUDE_FLAG_Fortran)
  set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
endif()

if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
  if(NOT DEFINED CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG)
    set(CMAKE_Fortran_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
  endif()
  if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
    set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
  endif()
endif()

set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")

set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")

cmake_initialize_per_config_variable(CMAKE_Fortran_FLAGS "Flags used by the Fortran compiler")

if(NOT CMAKE_Fortran_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_Fortran_COMPILER_LAUNCHER})
  set(CMAKE_Fortran_COMPILER_LAUNCHER "$ENV{CMAKE_Fortran_COMPILER_LAUNCHER}"
    CACHE STRING "Compiler launcher for Fortran.")
endif()

include(CMakeCommonLanguageInclude)

# now define the following rule variables
# CMAKE_Fortran_CREATE_SHARED_LIBRARY
# CMAKE_Fortran_CREATE_SHARED_MODULE
# CMAKE_Fortran_COMPILE_OBJECT
# CMAKE_Fortran_LINK_EXECUTABLE

# create a Fortran shared library
if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
  set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
      "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif()

# create a Fortran shared module just copy the shared library rule
if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
  set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
endif()

# Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
  set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
  set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
  set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()

# compile a Fortran file into an object file
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
if(NOT CMAKE_Fortran_COMPILE_OBJECT)
  set(CMAKE_Fortran_COMPILE_OBJECT
    "<CMAKE_Fortran_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -c <SOURCE> -o <OBJECT>")
endif()

# link a fortran program
if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
  set(CMAKE_Fortran_LINK_EXECUTABLE
    "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()

if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
  set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
    CACHE STRING "Libraries linked by default with all Fortran applications.")
  mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
endif()

# set this variable so we can avoid loading this more than once.
set(CMAKE_Fortran_INFORMATION_LOADED 1)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include(CMakeInitializeConfigs)

set(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
set(CMAKE_INCLUDE_FLAG_C "-I")       # -I
set(CMAKE_LIBRARY_PATH_FLAG "-L")
set(CMAKE_LIBRARY_PATH_TERMINATOR "")  # for the Digital Mars D compiler the link paths have to be terminated with a "/"
set(CMAKE_LINK_LIBRARY_FLAG "-l")

set(CMAKE_LINK_LIBRARY_SUFFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")          # .so
set(CMAKE_EXECUTABLE_SUFFIX "")          # .exe
set(CMAKE_DL_LIBS "dl")

set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")

# Define feature "DEFAULT" as supported. This special feature generates the
# default option to link a library
# This feature is intended to be used in LINK_LIBRARY_OVERRIDE and
# LINK_LIBRARY_OVERRIDE_<LIBRARY> target properties
set(CMAKE_LINK_LIBRARY_USING_DEFAULT_SUPPORTED TRUE)

if(NOT DEFINED CMAKE_AUTOGEN_ORIGIN_DEPENDS)
  set(CMAKE_AUTOGEN_ORIGIN_DEPENDS ON)
endif()
if(NOT DEFINED CMAKE_AUTOMOC_COMPILER_PREDEFINES)
  set(CMAKE_AUTOMOC_COMPILER_PREDEFINES ON)
endif()
if(NOT DEFINED CMAKE_AUTOMOC_PATH_PREFIX)
  set(CMAKE_AUTOMOC_PATH_PREFIX OFF)
endif()
if(NOT DEFINED CMAKE_AUTOMOC_MACRO_NAMES)
  set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE" "Q_NAMESPACE_EXPORT")
endif()

# basically all general purpose OSs support shared libs
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)

set (CMAKE_SKIP_RPATH "NO" CACHE BOOL
     "If set, runtime paths are not added when using shared libraries.")
set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
     "If set, runtime paths are not added when installing shared libraries, but are added when building.")

set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")

if(DEFINED ENV{CMAKE_COLOR_DIAGNOSTICS} AND NOT DEFINED CACHE{CMAKE_COLOR_DIAGNOSTICS})
  set(CMAKE_COLOR_DIAGNOSTICS $ENV{CMAKE_COLOR_DIAGNOSTICS} CACHE BOOL "Enable colored diagnostics throughout.")
endif()

if(CMAKE_GENERATOR MATCHES "Make")
  if(NOT DEFINED CMAKE_COLOR_DIAGNOSTICS)
    set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL "Enable/Disable color output during build.")
  endif()
  mark_as_advanced(CMAKE_COLOR_MAKEFILE)

  if(DEFINED CMAKE_RULE_MESSAGES)
    set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
  endif()
  if(DEFINED CMAKE_TARGET_MESSAGES)
    set_property(GLOBAL PROPERTY TARGET_MESSAGES ${CMAKE_TARGET_MESSAGES})
  endif()
endif()

if(NOT DEFINED CMAKE_EXPORT_COMPILE_COMMANDS AND CMAKE_GENERATOR MATCHES "Ninja|Unix Makefiles")
  set(CMAKE_EXPORT_COMPILE_COMMANDS "$ENV{CMAKE_EXPORT_COMPILE_COMMANDS}"
    CACHE BOOL "Enable/Disable output of compile commands during generation."
    )
  mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
endif()

# GetDefaultWindowsPrefixBase
#
# Compute the base directory for CMAKE_INSTALL_PREFIX based on:
#  - is this 32-bit or 64-bit Windows
#  - is this 32-bit or 64-bit CMake running
#  - what architecture targets will be built
#
function(GetDefaultWindowsPrefixBase var)

  # Try to guess what architecture targets will end up being built as,
  # even if CMAKE_SIZEOF_VOID_P is not computed yet... We need to know
  # the architecture of the targets being built to choose the right
  # default value for CMAKE_INSTALL_PREFIX.
  #
  if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
    set(arch_hint "x64")
  elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "x64")
    set(arch_hint "x64")
  elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM64")
    set(arch_hint "ARM64")
  elseif("${CMAKE_GENERATOR}" MATCHES "ARM")
    set(arch_hint "ARM")
  elseif("${CMAKE_GENERATOR_PLATFORM}" MATCHES "ARM")
    set(arch_hint "ARM")
  elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
    set(arch_hint "x64")
  elseif("$ENV{LIB}" MATCHES "(amd64|ia64)")
    set(arch_hint "x64")
  endif()

  if(NOT arch_hint)
    set(arch_hint "x86")
  endif()

  # default env in a 64-bit app on Win64:
  # ProgramFiles=C:\Program Files
  # ProgramFiles(x86)=C:\Program Files (x86)
  # ProgramW6432=C:\Program Files
  #
  # default env in a 32-bit app on Win64:
  # ProgramFiles=C:\Program Files (x86)
  # ProgramFiles(x86)=C:\Program Files (x86)
  # ProgramW6432=C:\Program Files
  #
  # default env in a 32-bit app on Win32:
  # ProgramFiles=C:\Program Files
  # ProgramFiles(x86) NOT DEFINED
  # ProgramW6432 NOT DEFINED

  # By default, use the ProgramFiles env var as the base value of
  # CMAKE_INSTALL_PREFIX:
  #
  set(_PREFIX_ENV_VAR "ProgramFiles")

  if ("$ENV{ProgramW6432}" STREQUAL "")
    # running on 32-bit Windows
    # must be a 32-bit CMake, too...
    #message("guess: this is a 32-bit CMake running on 32-bit Windows")
  else()
    # running on 64-bit Windows
    if ("$ENV{ProgramW6432}" STREQUAL "$ENV{ProgramFiles}")
      # 64-bit CMake
      #message("guess: this is a 64-bit CMake running on 64-bit Windows")
      if(NOT "${arch_hint}" STREQUAL "x64")
      # building 32-bit targets
        set(_PREFIX_ENV_VAR "ProgramFiles(x86)")
      endif()
    else()
      # 32-bit CMake
      #message("guess: this is a 32-bit CMake running on 64-bit Windows")
      if("${arch_hint}" STREQUAL "x64")
      # building 64-bit targets
        set(_PREFIX_ENV_VAR "ProgramW6432")
      endif()
    endif()
  endif()

  #if("${arch_hint}" STREQUAL "x64")
  #  message("guess: you are building a 64-bit app")
  #else()
  #  message("guess: you are building a 32-bit app")
  #endif()

  if(NOT "$ENV{${_PREFIX_ENV_VAR}}" STREQUAL "")
    file(TO_CMAKE_PATH "$ENV{${_PREFIX_ENV_VAR}}" _base)
  elseif(NOT "$ENV{SystemDrive}" STREQUAL "")
    set(_base "$ENV{SystemDrive}/Program Files")
  else()
    set(_base "C:/Program Files")
  endif()

  set(${var} "${_base}" PARENT_SCOPE)
endfunction()

# Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
# was initialized by the block below.  This is useful for user
# projects to change the default prefix while still allowing the
# command line to override it.
if(NOT DEFINED CMAKE_INSTALL_PREFIX AND
   NOT DEFINED ENV{CMAKE_INSTALL_PREFIX})
  set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()

if(DEFINED ENV{CMAKE_INSTALL_PREFIX})
  set(CMAKE_INSTALL_PREFIX "$ENV{CMAKE_INSTALL_PREFIX}"
    CACHE PATH "Install path prefix, prepended onto install directories.")
else()
  # If CMAKE_INSTALL_PREFIX env variable is not set,
  # choose a default install prefix for this platform.
  if(CMAKE_HOST_UNIX)
    set(CMAKE_INSTALL_PREFIX "/usr/local"
      CACHE PATH "Install path prefix, prepended onto install directories.")
  else()
    GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
    set(CMAKE_INSTALL_PREFIX
      "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
      CACHE PATH "Install path prefix, prepended onto install directories.")
    set(CMAKE_GENERIC_PROGRAM_FILES)
  endif()
endif()

# Set a variable which will be used as component name in install() commands
# where no COMPONENT has been given:
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")

mark_as_advanced(
  CMAKE_SKIP_RPATH
  CMAKE_SKIP_INSTALL_RPATH
  CMAKE_VERBOSE_MAKEFILE
)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
CMakeGraphVizOptions
--------------------

The builtin Graphviz support of CMake.

Generating Graphviz files
^^^^^^^^^^^^^^^^^^^^^^^^^

CMake can generate `Graphviz <https://www.graphviz.org/>`_ files showing the
dependencies between the targets in a project, as well as external libraries
which are linked against.

When running CMake with the ``--graphviz=foo.dot`` option, it produces:

* a ``foo.dot`` file, showing all dependencies in the project
* a ``foo.dot.<target>`` file for each target, showing on which other targets
  it depends
* a ``foo.dot.<target>.dependers`` file for each target, showing which other
  targets depend on it

Those .dot files can be converted to images using the *dot* command from the
Graphviz package:

.. code-block:: shell

  dot -Tpng -o foo.png foo.dot

.. versionadded:: 3.10
  The different dependency types ``PUBLIC``, ``INTERFACE`` and ``PRIVATE``
  are represented as solid, dashed and dotted edges.

Variables specific to the Graphviz support
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The resulting graphs can be huge.  The look and content of the generated graphs
can be controlled using the file ``CMakeGraphVizOptions.cmake``.  This file is
first searched in :variable:`CMAKE_BINARY_DIR`, and then in
:variable:`CMAKE_SOURCE_DIR`.  If found, the variables set in it are used to
adjust options for the generated Graphviz files.

.. variable:: GRAPHVIZ_GRAPH_NAME

 The graph name.

 * Mandatory: NO
 * Default: value of :variable:`CMAKE_PROJECT_NAME`

.. variable:: GRAPHVIZ_GRAPH_HEADER

 The header written at the top of the Graphviz files.

 * Mandatory: NO
 * Default: "node [ fontsize = "12" ];"

.. variable:: GRAPHVIZ_NODE_PREFIX

 The prefix for each node in the Graphviz files.

 * Mandatory: NO
 * Default: "node"

.. variable:: GRAPHVIZ_EXECUTABLES

 Set to FALSE to exclude executables from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_STATIC_LIBS

 Set to FALSE to exclude static libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_SHARED_LIBS

 Set to FALSE to exclude shared libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_MODULE_LIBS

 Set to FALSE to exclude module libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_INTERFACE_LIBS

 Set to FALSE to exclude interface libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_OBJECT_LIBS

 Set to FALSE to exclude object libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_UNKNOWN_LIBS

 Set to FALSE to exclude unknown libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_EXTERNAL_LIBS

 Set to FALSE to exclude external libraries from the generated graphs.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_CUSTOM_TARGETS

 Set to TRUE to include custom targets in the generated graphs.

 * Mandatory: NO
 * Default: FALSE

.. variable:: GRAPHVIZ_IGNORE_TARGETS

 A list of regular expressions for names of targets to exclude from the
 generated graphs.

 * Mandatory: NO
 * Default: empty

.. variable:: GRAPHVIZ_GENERATE_PER_TARGET

 Set to FALSE to not generate per-target graphs ``foo.dot.<target>``.

 * Mandatory: NO
 * Default: TRUE

.. variable:: GRAPHVIZ_GENERATE_DEPENDERS

 Set to FALSE to not generate depender graphs ``foo.dot.<target>.dependers``.

 * Mandatory: NO
 * Default: TRUE
#]=======================================================================]


code:
set(CMAKE_HIP_COMPILER "@CMAKE_HIP_COMPILER@")
set(CMAKE_HIP_HOST_COMPILER "@CMAKE_HIP_HOST_COMPILER@")
set(CMAKE_HIP_HOST_LINK_LAUNCHER "@CMAKE_HIP_HOST_LINK_LAUNCHER@")
set(CMAKE_HIP_COMPILER_ID "@CMAKE_HIP_COMPILER_ID@")
set(CMAKE_HIP_COMPILER_VERSION "@CMAKE_HIP_COMPILER_VERSION@")
set(CMAKE_HIP_STANDARD_COMPUTED_DEFAULT "@CMAKE_HIP_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_HIP_EXTENSIONS_COMPUTED_DEFAULT@")
set(CMAKE_HIP_COMPILE_FEATURES "@CMAKE_HIP_COMPILE_FEATURES@")
set(CMAKE_HIP98_COMPILE_FEATURES "@CMAKE_HIP03_COMPILE_FEATURES@")
set(CMAKE_HIP11_COMPILE_FEATURES "@CMAKE_HIP11_COMPILE_FEATURES@")
set(CMAKE_HIP14_COMPILE_FEATURES "@CMAKE_HIP14_COMPILE_FEATURES@")
set(CMAKE_HIP17_COMPILE_FEATURES "@CMAKE_HIP17_COMPILE_FEATURES@")
set(CMAKE_HIP20_COMPILE_FEATURES "@CMAKE_HIP20_COMPILE_FEATURES@")
set(CMAKE_HIP23_COMPILE_FEATURES "@CMAKE_HIP23_COMPILE_FEATURES@")

set(CMAKE_HIP_PLATFORM_ID "@CMAKE_HIP_PLATFORM_ID@")
set(CMAKE_HIP_SIMULATE_ID "@CMAKE_HIP_SIMULATE_ID@")
set(CMAKE_HIP_COMPILER_FRONTEND_VARIANT "@CMAKE_HIP_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_HIP_SIMULATE_VERSION "@CMAKE_HIP_SIMULATE_VERSION@")
@SET_MSVC_HIP_ARCHITECTURE_ID@
@_SET_CMAKE_HIP_COMPILER_SYSROOT@
set(CMAKE_HIP_COMPILER_ROCM_ROOT "@CMAKE_HIP_COMPILER_ROCM_ROOT@")
set(CMAKE_HIP_COMPILER_ROCM_LIB "@CMAKE_HIP_COMPILER_ROCM_LIB@")

set(CMAKE_HIP_COMPILER_ENV_VAR "HIPCXX")

set(CMAKE_HIP_COMPILER_LOADED 1)
set(CMAKE_HIP_COMPILER_ID_RUN 1)
set(CMAKE_HIP_SOURCE_FILE_EXTENSIONS hip)
set(CMAKE_HIP_LINKER_PREFERENCE 90)
set(CMAKE_HIP_LINKER_PREFERENCE_PROPAGATES 1)
set(CMAKE_HIP_LINKER_DEPFILE_SUPPORTED @CMAKE_HIP_LINKER_DEPFILE_SUPPORTED@)

set(CMAKE_HIP_SIZEOF_DATA_PTR "@CMAKE_HIP_SIZEOF_DATA_PTR@")
set(CMAKE_HIP_COMPILER_ABI "@CMAKE_HIP_COMPILER_ABI@")
set(CMAKE_HIP_LIBRARY_ARCHITECTURE "@CMAKE_HIP_LIBRARY_ARCHITECTURE@")

if(CMAKE_HIP_SIZEOF_DATA_PTR)
  set(CMAKE_SIZEOF_VOID_P "${CMAKE_HIP_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_HIP_COMPILER_ABI)
  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_HIP_COMPILER_ABI}")
endif()

if(CMAKE_HIP_LIBRARY_ARCHITECTURE)
  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_HIP_LIBRARY_ARCHITECTURE@")
endif()

set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_ROOT "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_ROOT@")
set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_LIBRARY_ROOT "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_LIBRARY_ROOT@")
set(CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION "@CMAKE_HIP_COMPILER_CUDA_TOOLKIT_VERSION@")
set(CMAKE_HIP_COMPILER_CUDA_LIBRARY_ROOT "@CMAKE_HIP_COMPILER_CUDA_LIBRARY_ROOT@")

set(CMAKE_HIP_ARCHITECTURES_ALL "@CMAKE_HIP_ARCHITECTURES_ALL@")
set(CMAKE_HIP_ARCHITECTURES_ALL_MAJOR "@CMAKE_HIP_ARCHITECTURES_ALL_MAJOR@")
set(CMAKE_HIP_ARCHITECTURES_NATIVE "@CMAKE_HIP_ARCHITECTURES_NATIVE@")

set(CMAKE_HIP_CUDA_TOOLKIT_INCLUDE_DIRECTORIES "@CMAKE_HIP_CUDA_TOOLKIT_INCLUDE_DIRECTORIES@")

set(CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_HIP_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_HIP_HOST_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")

set(CMAKE_HIP_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_HIP_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_HIP_IMPLICIT_LINK_LIBRARIES "@CMAKE_HIP_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_HIP_IMPLICIT_LINK_DIRECTORIES "@CMAKE_HIP_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_HIP_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_HIP_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")

set(CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT "@CMAKE_HIP_RUNTIME_LIBRARY_DEFAULT@")

set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_HIP_COMPILER_AR "@CMAKE_HIP_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_HIP_COMPILER_RANLIB "@CMAKE_HIP_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
set(CMAKE_HIP_COMPILER_LINKER "@CMAKE_HIP_COMPILER_LINKER@")
set(CMAKE_HIP_COMPILER_LINKER_ID "@CMAKE_HIP_COMPILER_LINKER_ID@")
set(CMAKE_HIP_COMPILER_LINKER_VERSION @CMAKE_HIP_COMPILER_LINKER_VERSION@)
set(CMAKE_HIP_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_HIP_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")


code:
#if !defined(__HIP__) && !defined(__NVCC__)
#  error "A C or C++ compiler has been selected for HIP"
#endif

#include "CMakeCompilerABI.h"

#if defined(__NVCC__)
#  include "CMakeCompilerCUDAArch.h"
#endif

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_sizeof_dptr[argc];
#if defined(ABI_ID)
  require += info_abi[argc];
#endif
  static_cast<void>(argv);

#if defined(__NVCC__)
  if (!cmakeCompilerCUDAArch()) {
    // Convince the compiler that the non-zero return value depends
    // on the info strings so they are not optimized out.
    return require ? -1 : 1;
  }
  return 0;
#else
  return require;
#endif
}


code:
#if !defined(__HIP__) && !defined(__NVCC__)
# error "A C or C++ compiler has been selected for HIP"
#endif

@CMAKE_HIP_COMPILER_ID_CONTENT@

/* Construct the string literal in pieces to prevent the source from
   getting matched.  Store it in a pointer rather than an array
   because some compilers will just produce instructions to fill the
   array rather than assigning a pointer to a static array.  */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif

@CMAKE_HIP_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_HIP_COMPILER_ID_ERROR_FOR_TEST@

const char* info_language_standard_default = "INFO" ":" "standard_default["
#if __cplusplus > 202002L
  "23"
#elif __cplusplus > 201703L
  "20"
#elif __cplusplus >= 201703L
  "17"
#elif __cplusplus >= 201402L
  "14"
#elif __cplusplus >= 201103L
  "11"
#else
  "98"
#endif
"]";

const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__)
  "ON"
#else
  "OFF"
#endif
"]";

/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
  require += info_version[argc];
#endif
#ifdef SIMULATE_ID
  require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
  require += info_simulate_version[argc];
#endif
  require += info_language_standard_default[argc];
  require += info_language_extensions_default[argc];
  (void)argv;
  return require;
}


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

if(UNIX)
  set(CMAKE_HIP_OUTPUT_EXTENSION .o)
else()
  set(CMAKE_HIP_OUTPUT_EXTENSION .obj)
endif()
set(CMAKE_INCLUDE_FLAG_HIP "-I")

# Set implicit links early so compiler-specific modules can use them.
set(__IMPLICIT_LINKS)
foreach(dir ${CMAKE_HIP_HOST_IMPLICIT_LINK_DIRECTORIES})
  string(APPEND __IMPLICIT_LINKS " -L\"${dir}\"")
endforeach()
foreach(lib ${CMAKE_HIP_HOST_IMPLICIT_LINK_LIBRARIES})
  if(${lib} MATCHES "/")
    string(APPEND __IMPLICIT_LINKS " \"${lib}\"")
  else()
    string(APPEND __IMPLICIT_LINKS " -l${lib}")
  endif()
endforeach()

# Load compiler-specific information.
if(CMAKE_HIP_COMPILER_ID)
  include(Compiler/${CMAKE_HIP_COMPILER_ID}-HIP OPTIONAL)
endif()

# load the system- and compiler specific files
if(CMAKE_HIP_COMPILER_ID)
  # load a hardware specific file, mostly useful for embedded compilers
  if(CMAKE_SYSTEM_PROCESSOR)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_HIP_COMPILER_ID}-HIP-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
  endif()
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_HIP_COMPILER_ID}-HIP OPTIONAL)
endif()

if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG)
  set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
endif()

if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP)
  set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif()

if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_HIP_FLAG)
  set(CMAKE_SHARED_LIBRARY_RPATH_LINK_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif()

if(NOT DEFINED CMAKE_EXE_EXPORTS_HIP_FLAG)
  set(CMAKE_EXE_EXPORTS_HIP_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_HIP_FLAG)
  set(CMAKE_SHARED_LIBRARY_SONAME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
endif()

if(NOT CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG)
  set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG})
endif()

if(NOT CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG_SEP)
  set(CMAKE_EXECUTABLE_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP})
endif()

if(NOT CMAKE_EXECUTABLE_RPATH_LINK_HIP_FLAG)
  set(CMAKE_EXECUTABLE_RPATH_LINK_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_HIP_FLAG})
endif()

if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_HIP_WITH_RUNTIME_PATH)
  set(CMAKE_SHARED_LIBRARY_LINK_HIP_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
endif()

# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
if(NOT CMAKE_MODULE_EXISTS)
  set(CMAKE_SHARED_MODULE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_HIP_FLAGS})
  set(CMAKE_SHARED_MODULE_CREATE_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS})
endif()

if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
  if(NOT DEFINED CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG)
    set(CMAKE_HIP_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
  endif()
  if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
    set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
  endif()
endif()

# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache
set(CMAKE_HIP_FLAGS_INIT "$ENV{HIPFLAGS} ${CMAKE_HIP_FLAGS_INIT}")

cmake_initialize_per_config_variable(CMAKE_HIP_FLAGS "Flags used by the HIP compiler")

if(CMAKE_HIP_STANDARD_LIBRARIES_INIT)
  set(CMAKE_HIP_STANDARD_LIBRARIES "${CMAKE_HIP_STANDARD_LIBRARIES_INIT}"
    CACHE STRING "Libraries linked by default with all HIP applications.")
  mark_as_advanced(CMAKE_HIP_STANDARD_LIBRARIES)
endif()

if(NOT CMAKE_HIP_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_HIP_COMPILER_LAUNCHER})
  set(CMAKE_HIP_COMPILER_LAUNCHER "$ENV{CMAKE_HIP_COMPILER_LAUNCHER}"
    CACHE STRING "Compiler launcher for HIP.")
endif()

include(CMakeCommonLanguageInclude)

# now define the following rules:
# CMAKE_HIP_CREATE_SHARED_LIBRARY
# CMAKE_HIP_CREATE_SHARED_MODULE
# CMAKE_HIP_COMPILE_OBJECT
# CMAKE_HIP_LINK_EXECUTABLE

# create a shared library
if(NOT CMAKE_HIP_CREATE_SHARED_LIBRARY)
  set(CMAKE_HIP_CREATE_SHARED_LIBRARY
      "<CMAKE_HIP_COMPILER> <CMAKE_SHARED_LIBRARY_HIP_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_HIP_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif()

# create a shared module copy the shared library rule by default
if(NOT CMAKE_HIP_CREATE_SHARED_MODULE)
  set(CMAKE_HIP_CREATE_SHARED_MODULE ${CMAKE_HIP_CREATE_SHARED_LIBRARY})
endif()

# Create a static archive incrementally for large object file counts.
if(NOT DEFINED CMAKE_HIP_ARCHIVE_CREATE)
  set(CMAKE_HIP_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_HIP_ARCHIVE_APPEND)
  set(CMAKE_HIP_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_HIP_ARCHIVE_FINISH)
  set(CMAKE_HIP_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()

# compile a HIP file into an object file
if(NOT CMAKE_HIP_COMPILE_OBJECT)
  set(CMAKE_HIP_COMPILE_OBJECT
    "<CMAKE_HIP_COMPILER> ${_CMAKE_HIP_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> ${_CMAKE_COMPILE_AS_HIP_FLAG} -c <SOURCE>")
endif()

# compile a cu file into an executable
if(NOT CMAKE_HIP_LINK_EXECUTABLE)
  set(CMAKE_HIP_LINK_EXECUTABLE
    "<CMAKE_HIP_COMPILER> <FLAGS> <CMAKE_HIP_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()

set(CMAKE_HIP_INFORMATION_LOADED 1)

# Load the file and find the relevant HIP runtime.
if(NOT DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
  set(hip-lang_DIR "${CMAKE_HIP_COMPILER_ROCM_LIB}/cmake/hip-lang")
  find_package(hip-lang CONFIG QUIET NO_DEFAULT_PATH REQUIRED)
endif()
if(DEFINED _CMAKE_HIP_DEVICE_RUNTIME_TARGET)
  list(APPEND CMAKE_HIP_RUNTIME_LIBRARIES_STATIC ${_CMAKE_HIP_DEVICE_RUNTIME_TARGET})
  list(APPEND CMAKE_HIP_RUNTIME_LIBRARIES_SHARED ${_CMAKE_HIP_DEVICE_RUNTIME_TARGET})
endif()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

cmake_policy(PUSH)
cmake_policy(SET CMP0057 NEW) # if IN_LIST
cmake_policy(SET CMP0054 NEW)

# Function to print messages of this module
function(_ios_install_combined_message)
  message(STATUS "[iOS combined] " ${ARGN})
endfunction()

# Get build settings for the current target/config/SDK by running
# `xcodebuild -sdk ... -showBuildSettings` and parsing it's output
function(_ios_install_combined_get_build_setting sdk variable resultvar)
  if("${sdk}" STREQUAL "")
    message(FATAL_ERROR "`sdk` is empty")
  endif()

  if("${variable}" STREQUAL "")
    message(FATAL_ERROR "`variable` is empty")
  endif()

  if("${resultvar}" STREQUAL "")
    message(FATAL_ERROR "`resultvar` is empty")
  endif()

  set(
      cmd
      xcodebuild -showBuildSettings
      -sdk "${sdk}"
      -target "${CURRENT_TARGET}"
      -config "${CURRENT_CONFIG}"
  )

  execute_process(
      COMMAND ${cmd}
      WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
      RESULT_VARIABLE result
      OUTPUT_VARIABLE output
  )

  if(NOT result EQUAL 0)
    message(FATAL_ERROR "Command failed (${result}): ${cmd}")
  endif()

  if(NOT output MATCHES " ${variable} = ([^\n]*)")
    if("${variable}" STREQUAL "VALID_ARCHS")
      # VALID_ARCHS may be unset by user for given SDK
      # (e.g. for build without simulator).
      set("${resultvar}" "" PARENT_SCOPE)
      return()
    else()
      message(FATAL_ERROR "${variable} not found.")
    endif()
  endif()

  set("${resultvar}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
endfunction()

# Get architectures of given SDK (iphonesimulator/iphoneos)
function(_ios_install_combined_get_valid_archs sdk resultvar)
  cmake_policy(PUSH)
  cmake_policy(SET CMP0007 NEW)

  if("${resultvar}" STREQUAL "")
    message(FATAL_ERROR "`resultvar` is empty")
  endif()

  _ios_install_combined_get_build_setting("${sdk}" "VALID_ARCHS" valid_archs)

  separate_arguments(valid_archs)
  list(REMOVE_ITEM valid_archs "") # remove empty elements
  list(REMOVE_DUPLICATES valid_archs)

  string(REPLACE ";" " " printable "${valid_archs}")
  _ios_install_combined_message("Architectures (${sdk}): ${printable}")

  set("${resultvar}" "${valid_archs}" PARENT_SCOPE)

  cmake_policy(POP)
endfunction()

# Make both arch lists a disjoint set by preferring the current SDK
# (starting with Xcode 12 arm64 is available as device and simulator arch on iOS)
function(_ios_install_combined_prune_common_archs corr_sdk corr_archs_var this_archs_var)
  list(REMOVE_ITEM ${corr_archs_var} ${${this_archs_var}})

  string(REPLACE ";" " " printable "${${corr_archs_var}}")
  _ios_install_combined_message("Architectures (${corr_sdk}) after pruning: ${printable}")

  set("${corr_archs_var}" "${${corr_archs_var}}" PARENT_SCOPE)
endfunction()

# Final target can contain more architectures that specified by SDK. This
# function will run 'lipo -info' and parse output. Result will be returned
# as a CMake list.
function(_ios_install_combined_get_real_archs filename resultvar)
  set(cmd "${_lipo_path}" -info "${filename}")
  execute_process(
      COMMAND ${cmd}
      RESULT_VARIABLE result
      OUTPUT_VARIABLE output
      ERROR_VARIABLE output
      OUTPUT_STRIP_TRAILING_WHITESPACE
      ERROR_STRIP_TRAILING_WHITESPACE
  )
  if(NOT result EQUAL 0)
    message(
        FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
    )
  endif()

  if(NOT output MATCHES "(Architectures in the fat file: [^\n]+ are|Non-fat file: [^\n]+ is architecture): ([^\n]*)")
    message(FATAL_ERROR "Could not detect architecture from: ${output}")
  endif()

  separate_arguments(CMAKE_MATCH_2)
  set(${resultvar} ${CMAKE_MATCH_2} PARENT_SCOPE)
endfunction()

# Run build command for the given SDK
function(_ios_install_combined_build sdk)
  if("${sdk}" STREQUAL "")
    message(FATAL_ERROR "`sdk` is empty")
  endif()

  _ios_install_combined_message("Build `${CURRENT_TARGET}` for `${sdk}`")

  execute_process(
      COMMAND
      "${CMAKE_COMMAND}"
      --build
      .
      --target "${CURRENT_TARGET}"
      --config ${CURRENT_CONFIG}
      --
      -sdk "${sdk}"
      WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
      RESULT_VARIABLE result
  )

  if(NOT result EQUAL 0)
    message(FATAL_ERROR "Build failed")
  endif()
endfunction()

# Remove given architecture from file. This step needed only in rare cases
# when target was built in "unusual" way. Emit warning message.
function(_ios_install_combined_remove_arch lib arch)
  _ios_install_combined_message(
    "Warning! Unexpected architecture `${arch}` detected and will be removed "
    "from file `${lib}`")
  set(cmd "${_lipo_path}" -remove ${arch} -output ${lib} ${lib})
  execute_process(
      COMMAND ${cmd}
      RESULT_VARIABLE result
      OUTPUT_VARIABLE output
      ERROR_VARIABLE output
      OUTPUT_STRIP_TRAILING_WHITESPACE
      ERROR_STRIP_TRAILING_WHITESPACE
  )
  if(NOT result EQUAL 0)
    message(
        FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
    )
  endif()
endfunction()

# Check that 'lib' contains only 'archs' architectures (remove others).
function(_ios_install_combined_keep_archs lib archs)
  _ios_install_combined_get_real_archs("${lib}" real_archs)
  set(archs_to_remove ${real_archs})
  list(REMOVE_ITEM archs_to_remove ${archs})
  foreach(x ${archs_to_remove})
    _ios_install_combined_remove_arch("${lib}" "${x}")
  endforeach()
endfunction()

function(_ios_install_combined_detect_associated_sdk corr_sdk_var)
  if("${PLATFORM_NAME}" STREQUAL "")
    message(FATAL_ERROR "PLATFORM_NAME should not be empty")
  endif()

  set(all_platforms "$ENV{SUPPORTED_PLATFORMS}")
  if("${SUPPORTED_PLATFORMS}" STREQUAL "")
    _ios_install_combined_get_build_setting(
      ${PLATFORM_NAME} SUPPORTED_PLATFORMS all_platforms)
    if("${all_platforms}" STREQUAL "")
      message(FATAL_ERROR
        "SUPPORTED_PLATFORMS not set as an environment variable nor "
        "able to be determined from project")
    endif()
  endif()

  separate_arguments(all_platforms)
  if(NOT PLATFORM_NAME IN_LIST all_platforms)
    message(FATAL_ERROR "`${PLATFORM_NAME}` not found in `${all_platforms}`")
  endif()

  list(REMOVE_ITEM all_platforms "" "${PLATFORM_NAME}")
  list(LENGTH all_platforms all_platforms_length)
  if(NOT all_platforms_length EQUAL 1)
    message(FATAL_ERROR "Expected one element: ${all_platforms}")
  endif()

  set(${corr_sdk_var} "${all_platforms}" PARENT_SCOPE)
endfunction()

# Create combined binary for the given target.
#
# Preconditions:
#  * Target already installed at ${destination}
#    for the ${PLATFORM_NAME} platform
#
# This function will:
#  * Run build for the lacking platform, i.e. opposite to the ${PLATFORM_NAME}
#  * Fuse both libraries by running lipo
function(ios_install_combined target destination)
  if("${target}" STREQUAL "")
    message(FATAL_ERROR "`target` is empty")
  endif()

  if("${destination}" STREQUAL "")
    message(FATAL_ERROR "`destination` is empty")
  endif()

  if(NOT IS_ABSOLUTE "${destination}")
    message(FATAL_ERROR "`destination` is not absolute: ${destination}")
  endif()

  if(IS_DIRECTORY "${destination}" OR IS_SYMLINK "${destination}")
    message(FATAL_ERROR "`destination` is no regular file: ${destination}")
  endif()

  if("${CMAKE_BINARY_DIR}" STREQUAL "")
    message(FATAL_ERROR "`CMAKE_BINARY_DIR` is empty")
  endif()

  if(NOT IS_DIRECTORY "${CMAKE_BINARY_DIR}")
    message(FATAL_ERROR "Is not a directory: ${CMAKE_BINARY_DIR}")
  endif()

  if("${CMAKE_INSTALL_CONFIG_NAME}" STREQUAL "")
    message(FATAL_ERROR "CMAKE_INSTALL_CONFIG_NAME is empty")
  endif()

  set(cmd xcrun -f lipo)

  # Do not merge OUTPUT_VARIABLE and ERROR_VARIABLE since latter may contain
  # some diagnostic information even for the successful run.
  execute_process(
      COMMAND ${cmd}
      RESULT_VARIABLE result
      OUTPUT_VARIABLE output
      ERROR_VARIABLE error_output
      OUTPUT_STRIP_TRAILING_WHITESPACE
      ERROR_STRIP_TRAILING_WHITESPACE
  )
  if(NOT result EQUAL 0)
    message(
        FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}\nOutput(error):\n${error_output}"
    )
  endif()
  set(_lipo_path ${output})
  list(LENGTH _lipo_path len)
  if(NOT len EQUAL 1)
    message(FATAL_ERROR "Unexpected xcrun output: ${_lipo_path}")
  endif()
  if(NOT EXISTS "${_lipo_path}")
    message(FATAL_ERROR "File not found: ${_lipo_path}")
  endif()

  set(CURRENT_CONFIG "${CMAKE_INSTALL_CONFIG_NAME}")
  set(CURRENT_TARGET "${target}")

  _ios_install_combined_message("Target: ${CURRENT_TARGET}")
  _ios_install_combined_message("Config: ${CURRENT_CONFIG}")
  _ios_install_combined_message("Destination: ${destination}")

  # Get SDKs
  _ios_install_combined_detect_associated_sdk(corr_sdk)

  # Get architectures of the target
  _ios_install_combined_get_valid_archs("${PLATFORM_NAME}" this_valid_archs)
  _ios_install_combined_get_valid_archs("${corr_sdk}" corr_valid_archs)
  _ios_install_combined_prune_common_archs("${corr_sdk}" corr_valid_archs this_valid_archs)

  # Return if there are no valid architectures for the SDK.
  # (note that library already installed)
  if("${corr_valid_archs}" STREQUAL "")
    _ios_install_combined_message(
        "No architectures detected for `${corr_sdk}` (skip)"
    )
    return()
  endif()

  # Trigger build of corresponding target
  _ios_install_combined_build("${corr_sdk}")

  # Get location of the library in build directory
  _ios_install_combined_get_build_setting(
    "${corr_sdk}" "CONFIGURATION_BUILD_DIR" corr_build_dir)
  _ios_install_combined_get_build_setting(
    "${corr_sdk}" "EXECUTABLE_PATH" corr_executable_path)
  set(corr "${corr_build_dir}/${corr_executable_path}")

  _ios_install_combined_keep_archs("${corr}" "${corr_valid_archs}")
  _ios_install_combined_keep_archs("${destination}" "${this_valid_archs}")

  _ios_install_combined_message("Current: ${destination}")
  _ios_install_combined_message("Corresponding: ${corr}")

  set(cmd "${_lipo_path}" -create ${corr} ${destination} -output ${destination})

  execute_process(
      COMMAND ${cmd}
      WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
      RESULT_VARIABLE result
  )

  if(NOT result EQUAL 0)
    message(FATAL_ERROR "Command failed: ${cmd}")
  endif()

  _ios_install_combined_message("Install done: ${destination}")
endfunction()

cmake_policy(POP)


code:
set(CMAKE_ISPC_COMPILER "@CMAKE_ISPC_COMPILER@")
set(CMAKE_ISPC_COMPILER_ARG1 "@CMAKE_ISPC_COMPILER_ARG1@")
set(CMAKE_ISPC_COMPILER_ID "@CMAKE_ISPC_COMPILER_ID@")
set(CMAKE_ISPC_COMPILER_VERSION "@CMAKE_ISPC_COMPILER_VERSION@")
set(CMAKE_ISPC_COMPILER_VERSION_INTERNAL "@CMAKE_ISPC_COMPILER_VERSION_INTERNAL@")

set(CMAKE_ISPC_PLATFORM_ID "@CMAKE_ISPC_PLATFORM_ID@")
set(CMAKE_ISPC_SIMULATE_ID "@CMAKE_ISPC_SIMULATE_ID@")
set(CMAKE_ISPC_COMPILER_FRONTEND_VARIANT "@CMAKE_ISPC_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_ISPC_SIMULATE_VERSION "@CMAKE_ISPC_SIMULATE_VERSION@")

set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_ISPC_COMPILER_AR "@CMAKE_ISPC_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_ISPC_COMPILER_RANLIB "@CMAKE_ISPC_COMPILER_RANLIB@")

set(CMAKE_ISPC_COMPILER_LOADED 1)
set(CMAKE_ISPC_COMPILER_WORKS @CMAKE_ISPC_COMPILER_WORKS@)
set(CMAKE_ISPC_ABI_COMPILED @CMAKE_ISPC_ABI_COMPILED@)

set(CMAKE_ISPC_COMPILER_ENV_VAR "ISPC")

set(CMAKE_ISPC_COMPILER_ID_RUN 1)
set(CMAKE_ISPC_SOURCE_FILE_EXTENSIONS ispc)
set(CMAKE_ISPC_IGNORE_EXTENSIONS o;O)

set(CMAKE_ISPC_LINKER_PREFERENCE 0)
set(CMAKE_ISPC_LINKER_PREFERENCE_PROPAGATES 0)

@CMAKE_ISPC_COMPILER_CUSTOM_CODE@


code:
export void ispcCompilerABI() {

#if defined(__GNU__) && defined(__ELF__) && defined(__ARM_EABI__)
  print("INFO:abi[ELF ARMEABI]");
  static char const info_abi[] =
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEB__)
  print("INFO:abi[ELF ARM]");
#elif defined(__GNU__) && defined(__ELF__) && defined(__ARMEL__)
  print("INFO:abi[ELF ARM]");

#elif defined(__linux__) && defined(__ELF__) && defined(__amd64__) &&         \
  defined(__ILP32__)
print("INFO:abi[ELF X32]");

#elif defined(__ELF__)
print("INFO:abi[ELF]");
#endif

}


code:
export void ispcCompilerId() {

// Identify the compiler
#if defined(ISPC)
  print("INFO:compiler[Intel]");
#endif

// Identify the platform
#if defined(__linux) || defined(__linux__) || defined(linux)
  print("INFO:platform[Linux]");
#elif defined(__CYGWIN__)
  print("INFO:platform[Cygwin]");
#elif defined(__MINGW32__)
  print("INFO:platform[MinGW]");
#elif defined(__APPLE__)
  print("INFO:platform[Darwin]");
#elif defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
  print("INFO:platform[Windows]");
#elif defined(__FreeBSD__) || defined(__FreeBSD)
  print("INFO:platform[FreeBSD]");
#elif defined(__NetBSD__) || defined(__NetBSD)
  print("INFO:platform[NetBSD]");
#elif defined(__OpenBSD__) || defined(__OPENBSD)
  print("INFO:platform[OpenBSD]");
#elif defined(__sun) || defined(sun)
  print("INFO:platform[SunOS]");
#elif defined(_AIX) || defined(__AIX) || defined(__AIX__) || defined(__aix) || defined(__aix__)
  print("INFO:platform[AIX]");
#elif defined(__hpux) || defined(__hpux__)
  print("INFO:platform[HP-UX]");
#elif defined(__HAIKU__)
  print("INFO:platform[Haiku]");
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
  print("INFO:platform[BeOS]");
#elif defined(__QNX__) || defined(__QNXNTO__)
  print("INFO:platform[QNX]");
#elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
  print("INFO:platform[Tru64]");
#elif defined(__riscos) || defined(__riscos__)
  print("INFO:platform[RISCos]");
#elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
  print("INFO:platform[SINIX]");
#elif defined(__UNIX_SV__)
  print("INFO:platform[UNIX_SV]");
#elif defined(__bsdos__)
  print("INFO:platform[BSDOS]");
#elif defined(_MPRAS) || defined(MPRAS)
  print("INFO:platform[MP-RAS]");
#elif defined(__osf) || defined(__osf__)
  print("INFO:platform[OSF1]");
#elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
  print("INFO:platform[SCO_SV]");
#elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
  print("INFO:platform[ULTRIX]");
#elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
  print("INFO:platform[Xenix]");
#else
  print("INFO:platform[]");
#endif

}


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

if(UNIX)
  set(CMAKE_ISPC_OUTPUT_EXTENSION .o)
else()
  set(CMAKE_ISPC_OUTPUT_EXTENSION .obj)
endif()
set(CMAKE_INCLUDE_FLAG_ISPC "-I")

# Load compiler-specific information.
if(CMAKE_ISPC_COMPILER_ID)
  include(Compiler/${CMAKE_ISPC_COMPILER_ID}-ISPC OPTIONAL)
endif()

# load the system- and compiler specific files
if(CMAKE_ISPC_COMPILER_ID)
  # load a hardware specific file, mostly useful for embedded compilers
  if(CMAKE_SYSTEM_PROCESSOR)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ISPC_COMPILER_ID}-ISPC-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
  endif()
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_ISPC_COMPILER_ID}-ISPC OPTIONAL)
endif()

# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache
set(CMAKE_ISPC_FLAGS_INIT "$ENV{ISPCFLAGS} ${CMAKE_ISPC_FLAGS_INIT}")

cmake_initialize_per_config_variable(CMAKE_ISPC_FLAGS "Flags used by the ISPC compiler")

if(CMAKE_ISPC_STANDARD_LIBRARIES_INIT)
  set(CMAKE_ISPC_STANDARD_LIBRARIES "${CMAKE_ISPC_STANDARD_LIBRARIES_INIT}"
    CACHE STRING "Libraries linked by default with all ISPC applications.")
  mark_as_advanced(CMAKE_ISPC_STANDARD_LIBRARIES)
endif()

if(NOT CMAKE_ISPC_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_ISPC_COMPILER_LAUNCHER})
  set(CMAKE_ISPC_COMPILER_LAUNCHER "$ENV{CMAKE_ISPC_COMPILER_LAUNCHER}"
    CACHE STRING "Compiler launcher for ISPC.")
endif()

include(CMakeCommonLanguageInclude)

# now define the following rules:
# CMAKE_ISPC_COMPILE_OBJECT

# Create a static archive incrementally for large object file counts.
if(NOT DEFINED CMAKE_ISPC_ARCHIVE_CREATE)
  set(CMAKE_ISPC_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_ISPC_ARCHIVE_APPEND)
  set(CMAKE_ISPC_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_ISPC_ARCHIVE_FINISH)
  set(CMAKE_ISPC_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()

if(NOT CMAKE_ISPC_COMPILE_OBJECT)
  set(CMAKE_ISPC_COMPILE_OBJECT
    "<CMAKE_ISPC_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> --emit-obj <SOURCE> -h <ISPC_HEADER>")
endif()

set(CMAKE_ISPC_INFORMATION_LOADED 1)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

# This module is purposely no longer documented.  It does nothing useful.

# This macro used to load build settings from another project that
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
  if("${SETTINGS_FILE}" STREQUAL "")
    message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
  endif()
endmacro()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

include_guard(GLOBAL)

# Initializes `<_PREFIX>_<CONFIG>` variables from the corresponding
# `<_PREFIX>_<CONFIG>_INIT`, for the configurations currently used.
function(cmake_initialize_per_config_variable _PREFIX _DOCSTRING)
  string(STRIP "${${_PREFIX}_INIT}" _INIT)
  set("${_PREFIX}" "${_INIT}"
    CACHE STRING "${_DOCSTRING} during all build types.")
  mark_as_advanced("${_PREFIX}")

  if (NOT CMAKE_NOT_USING_CONFIG_FLAGS)
    set(_CONFIGS Debug Release MinSizeRel RelWithDebInfo)

    get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
    if (_GENERATOR_IS_MULTI_CONFIG)
      list(APPEND _CONFIGS ${CMAKE_CONFIGURATION_TYPES})
    else()
      if (NOT CMAKE_NO_BUILD_TYPE)
        set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE_INIT}" CACHE STRING
          "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel ...")
      endif()
      list(APPEND _CONFIGS ${CMAKE_BUILD_TYPE})
    endif()

    list(REMOVE_DUPLICATES _CONFIGS)
    foreach(_BUILD_TYPE IN LISTS _CONFIGS)
      if (NOT "${_BUILD_TYPE}" STREQUAL "")
        string(TOUPPER "${_BUILD_TYPE}" _BUILD_TYPE)
        string(STRIP "${${_PREFIX}_${_BUILD_TYPE}_INIT}" _INIT)
        set("${_PREFIX}_${_BUILD_TYPE}" "${_INIT}"
          CACHE STRING "${_DOCSTRING} during ${_BUILD_TYPE} builds.")
        mark_as_advanced("${_PREFIX}_${_BUILD_TYPE}")
      endif()
    endforeach()
  endif()
endfunction()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

set (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
     "Program used to build from makefiles.")
mark_as_advanced(CMAKE_MAKE_PROGRAM)


code:
set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
set(CMAKE_Java_RUNTIME  "@CMAKE_Java_RUNTIME@")
set(CMAKE_Java_ARCHIVE  "@CMAKE_Java_ARCHIVE@")
set(CMAKE_Java_COMPILER_LOADED 1)

set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
set(CMAKE_Java_LINKER_PREFERENCE 40)
set(CMAKE_Java_OUTPUT_EXTENSION .class)
set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

# This should be included before the _INIT variables are
# used to initialize the cache.  Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.

if(CMAKE_USER_MAKE_RULES_OVERRIDE)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
endif()

if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
endif()

# this is a place holder if java needed flags for javac they would go here.
if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
#  if(WIN32)
#    set(class_files_mask "*.class")
#  else()
    set(class_files_mask ".")
#  endif()

  set(CMAKE_Java_CREATE_STATIC_LIBRARY
      "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
    # "${class_files_mask}" should really be "<OBJECTS>" but compiling a *.java
    # file can create more than one *.class file...
endif()

# compile a Java file into an object file
if(NOT CMAKE_Java_COMPILE_OBJECT)
  set(CMAKE_Java_COMPILE_OBJECT
    "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
endif()

# set java include flag option and the separator for multiple include paths
set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
if(WIN32 AND NOT CYGWIN)
  set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
else()
  set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
endif()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

# This file contains common code blocks used by all the language information
# files

# load any compiler-wrapper specific information
macro(__cmake_include_compiler_wrapper lang)
  set(_INCLUDED_WRAPPER_FILE 0)
  if (CMAKE_${lang}_COMPILER_ID)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  endif()
  if (NOT _INCLUDED_WRAPPER_FILE)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
  endif ()

  # No platform - wrapper - lang information so maybe there's just wrapper - lang information
  if(NOT _INCLUDED_WRAPPER_FILE)
    if (CMAKE_${lang}_COMPILER_ID)
      include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${CMAKE_${lang}_COMPILER_ID}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
    endif()
    if (NOT _INCLUDED_WRAPPER_FILE)
      include(Compiler/${CMAKE_${lang}_COMPILER_WRAPPER}-${lang} OPTIONAL RESULT_VARIABLE _INCLUDED_WRAPPER_FILE)
    endif ()
  endif ()
endmacro ()


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

find_program(CMAKE_MAKE_PROGRAM make
  REGISTRY_VIEW 32
  PATHS
      # Typical install path for 32-bit MSYS2 (https://repo.msys2.org/distrib/msys2-i686-latest.sfx.exe)
      "C:/msys32/usr"
      # Typical install path for MINGW32 (https://sourceforge.net/projects/mingw)
      "C:/mingw/msys"
      # Git for Windows 32-bit (https://gitforwindows.org/)
      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GitForWindows;InstallPath]/usr")

mark_as_advanced(CMAKE_MAKE_PROGRAM)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
  c:/MinGW/bin /MinGW/bin
  "[HKEY_CURRENT_USER\\Software\\CodeBlocks;Path]/MinGW/bin"
  )

mark_as_advanced(CMAKE_MAKE_PROGRAM)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
     "Program used to build from makefiles.")
mark_as_advanced(CMAKE_MAKE_PROGRAM)


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

find_program(CMAKE_MAKE_PROGRAM
  NAMES ninja-build ninja samu
  NAMES_PER_DIR
  DOC "Program used to build from build.ninja files.")
mark_as_advanced(CMAKE_MAKE_PROGRAM)


code:
set(CMAKE_OBJC_COMPILER "@CMAKE_OBJC_COMPILER@")
set(CMAKE_OBJC_COMPILER_ARG1 "@CMAKE_OBJC_COMPILER_ARG1@")
set(CMAKE_OBJC_COMPILER_ID "@CMAKE_OBJC_COMPILER_ID@")
set(CMAKE_OBJC_COMPILER_VERSION "@CMAKE_OBJC_COMPILER_VERSION@")
set(CMAKE_OBJC_COMPILER_VERSION_INTERNAL "@CMAKE_OBJC_COMPILER_VERSION_INTERNAL@")
set(CMAKE_OBJC_COMPILER_WRAPPER "@CMAKE_OBJC_COMPILER_WRAPPER@")
set(CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJC_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJC_EXTENSIONS_COMPUTED_DEFAULT@")
set(CMAKE_OBJC_COMPILE_FEATURES "@CMAKE_OBJC_COMPILE_FEATURES@")
set(CMAKE_OBJC90_COMPILE_FEATURES "@CMAKE_OBJC90_COMPILE_FEATURES@")
set(CMAKE_OBJC99_COMPILE_FEATURES "@CMAKE_OBJC99_COMPILE_FEATURES@")
set(CMAKE_OBJC11_COMPILE_FEATURES "@CMAKE_OBJC11_COMPILE_FEATURES@")
set(CMAKE_OBJC17_COMPILE_FEATURES "@CMAKE_OBJC17_COMPILE_FEATURES@")
set(CMAKE_OBJC23_COMPILE_FEATURES "@CMAKE_OBJC23_COMPILE_FEATURES@")

set(CMAKE_OBJC_PLATFORM_ID "@CMAKE_OBJC_PLATFORM_ID@")
set(CMAKE_OBJC_SIMULATE_ID "@CMAKE_OBJC_SIMULATE_ID@")
set(CMAKE_OBJC_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJC_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_OBJC_SIMULATE_VERSION "@CMAKE_OBJC_SIMULATE_VERSION@")
@_SET_CMAKE_OBJC_COMPILER_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_ARCHS@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_OBJC_COMPILER_AR "@CMAKE_OBJC_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_OBJC_COMPILER_RANLIB "@CMAKE_OBJC_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
set(CMAKE_OBJC_COMPILER_LINKER "@CMAKE_OBJC_COMPILER_LINKER@")
set(CMAKE_OBJC_COMPILER_LINKER_ID "@CMAKE_OBJC_COMPILER_LINKER_ID@")
set(CMAKE_OBJC_COMPILER_LINKER_VERSION @CMAKE_OBJC_COMPILER_LINKER_VERSION@)
set(CMAKE_OBJC_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_OBJC_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUOBJC @CMAKE_COMPILER_IS_GNUOBJC@)
set(CMAKE_OBJC_COMPILER_LOADED 1)
set(CMAKE_OBJC_COMPILER_WORKS @CMAKE_OBJC_COMPILER_WORKS@)
set(CMAKE_OBJC_ABI_COMPILED @CMAKE_OBJC_ABI_COMPILED@)

set(CMAKE_OBJC_COMPILER_ENV_VAR "OBJC")

set(CMAKE_OBJC_COMPILER_ID_RUN 1)
set(CMAKE_OBJC_SOURCE_FILE_EXTENSIONS m)
set(CMAKE_OBJC_IGNORE_EXTENSIONS h;H;o;O)
set(CMAKE_OBJC_LINKER_PREFERENCE 5)
set(CMAKE_OBJC_LINKER_DEPFILE_SUPPORTED @CMAKE_OBJC_LINKER_DEPFILE_SUPPORTED@)

foreach (lang C CXX OBJCXX)
  foreach(extension IN LISTS CMAKE_OBJC_SOURCE_FILE_EXTENSIONS)
    if (CMAKE_${lang}_COMPILER_ID_RUN)
      list(REMOVE_ITEM CMAKE_${lang}_SOURCE_FILE_EXTENSIONS ${extension})
    endif()
  endforeach()
endforeach()

# Save compiler ABI information.
set(CMAKE_OBJC_SIZEOF_DATA_PTR "@CMAKE_OBJC_SIZEOF_DATA_PTR@")
set(CMAKE_OBJC_COMPILER_ABI "@CMAKE_OBJC_COMPILER_ABI@")
set(CMAKE_OBJC_BYTE_ORDER "@CMAKE_OBJC_BYTE_ORDER@")
set(CMAKE_OBJC_LIBRARY_ARCHITECTURE "@CMAKE_OBJC_LIBRARY_ARCHITECTURE@")

if(CMAKE_OBJC_SIZEOF_DATA_PTR)
  set(CMAKE_SIZEOF_VOID_P "${CMAKE_OBJC_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_OBJC_COMPILER_ABI)
  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_OBJC_COMPILER_ABI}")
endif()

if(CMAKE_OBJC_LIBRARY_ARCHITECTURE)
  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_OBJC_LIBRARY_ARCHITECTURE@")
endif()

@CMAKE_OBJC_COMPILER_CUSTOM_CODE@
@CMAKE_OBJC_SYSROOT_FLAG_CODE@
@CMAKE_OBJC_OSX_DEPLOYMENT_TARGET_FLAG_CODE@

set(CMAKE_OBJC_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_OBJC_IMPLICIT_LINK_LIBRARIES "@CMAKE_OBJC_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_OBJC_IMPLICIT_LINK_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_OBJC_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_OBJC_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")


code:
#ifdef __cplusplus
# error "A C++ compiler has been selected for Objective-C."
#endif

/*--------------------------------------------------------------------------*/

#include "CMakeCompilerABI.h"

/*--------------------------------------------------------------------------*/

int main(int argc, char *argv[])
{
  int require = 0;
  require += info_sizeof_dptr[argc];
  require += info_byte_order_big_endian[argc];
  require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
  require += info_abi[argc];
#endif
  (void)argv;
  return require;
}


code:
#ifdef __cplusplus
# error "An Objective-C++ compiler has been selected for Objective-C."
#endif

@CMAKE_OBJC_COMPILER_ID_CONTENT@

/* Construct the string literal in pieces to prevent the source from
   getting matched.  Store it in a pointer rather than an array
   because some compilers will just produce instructions to fill the
   array rather than assigning a pointer to a static array.  */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif

#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif

@CMAKE_OBJC_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_OBJC_COMPILER_ID_ERROR_FOR_TEST@

#if !defined(__STDC__)
# if (defined(_MSC_VER) && !defined(__clang__)) \
  || (defined(__ibmxl__) || defined(__IBMC__))
#  define C_VERSION "90"
# else
#  define C_VERSION
# endif
#elif __STDC_VERSION__ > 201710L
# define C_VERSION "23"
#elif __STDC_VERSION__ >= 201710L
# define C_VERSION "17"
#elif __STDC_VERSION__ >= 201000L
# define C_VERSION "11"
#elif __STDC_VERSION__ >= 199901L
# define C_VERSION "99"
#else
# define C_VERSION "90"
#endif
const char* info_language_standard_default =
  "INFO" ":" "standard_default[" C_VERSION "]";

const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__)
  "ON"
#else
  "OFF"
#endif
"]";

/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
  require += info_arch[argc];
#ifdef COMPILER_VERSION_MAJOR
  require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
  require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
  require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
  require += info_simulate_version[argc];
#endif
  require += info_language_standard_default[argc];
  require += info_language_extensions_default[argc];
  (void)argv;
  return require;
}


code:
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

# This file sets the basic flags for the Objective-C language in CMake.
# It also loads the available platform file for the system-compiler
# if it exists.
# It also loads a system - compiler - processor (or target hardware)
# specific file, which is mainly useful for crosscompiling and embedded systems.

include(CMakeLanguageInformation)

# some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file
set(CMAKE_OBJC_OUTPUT_EXTENSION .o)

if(NOT CMAKE_INCLUDE_FLAG_OBJC)
  set(CMAKE_INCLUDE_FLAG_OBJC ${CMAKE_INCLUDE_FLAG_C})
endif()

set(_INCLUDED_FILE 0)

# Load compiler-specific information.
if(CMAKE_OBJC_COMPILER_ID)
  include(Compiler/${CMAKE_OBJC_COMPILER_ID}-OBJC OPTIONAL)
endif()

set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME "${CMAKE_OBJC_COMPILER}" NAME_WE)
if(CMAKE_COMPILER_IS_GNUOBJC)
  set(CMAKE_BASE_NAME gcc)
endif()

# load a hardware specific file, mostly useful for embedded compilers
if(CMAKE_SYSTEM_PROCESSOR)
  if(CMAKE_OBJC_COMPILER_ID)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJC_COMPILER_ID}-OBJC-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
  endif()
  if (NOT _INCLUDED_FILE)
    include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
  endif ()
endif()

# load the system- and compiler specific files
if(CMAKE_OBJC_COMPILER_ID)
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_OBJC_COMPILER_ID}-OBJC
    OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
  include(Platform/${CMAKE_EFFECTIVE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
    OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif ()

# load any compiler-wrapper specific information
if (CMAKE_OBJC_COMPILER_WRAPPER)
  __cmake_include_compiler_wrapper(OBJC)
endif ()

# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included.  Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
if (NOT _INCLUDED_FILE)
  include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif ()

if(CMAKE_OBJC_SIZEOF_DATA_PTR)
  foreach(f IN LISTS CMAKE_OBJC_ABI_FILES)
    include(${f})
  endforeach()
  unset(CMAKE_OBJC_ABI_FILES)
endif()

# This should be included before the _INIT variables are
# used to initialize the cache.  Since the rule variables
# have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can
# be made to those values.

if(CMAKE_USER_MAKE_RULES_OVERRIDE)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
endif()

if(CMAKE_USER_MAKE_RULES_OVERRIDE_OBJC)
  # Save the full path of the file so try_compile can use it.
  include(${CMAKE_USER_MAKE_RULES_OVERRIDE_OBJC} RESULT_VARIABLE _override)
  set(CMAKE_USER_MAKE_RULES_OVERRIDE_OBJC "${_override}")
endif()

if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF")
  if(NOT DEFINED CMAKE_OBJC_LINK_WHAT_YOU_USE_FLAG)
    set(CMAKE_OBJC_LINK_WHAT_YOU_USE_FLAG "LINKER:--no-as-needed")
  endif()
  if(NOT DEFINED CMAKE_LINK_WHAT_YOU_USE_CHECK)
    set(CMAKE_LINK_WHAT_YOU_USE_CHECK ldd -u -r)
  endif()
endif()

# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
if(NOT CMAKE_MODULE_EXISTS)
  set(CMAKE_SHARED_MODULE_OBJC_FLAGS ${CMAKE_SHARED_LIBRARY_OBJC_FLAGS})
  set(CMAKE_SHARED_MODULE_CREATE_OBJC_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS})
endif()

set(CMAKE_OBJC_FLAGS_INIT "$ENV{OBJCFLAGS} ${CMAKE_OBJC_FLAGS_INIT}")

cmake_initialize_per_config_variable(CMAKE_OBJC_FLAGS "Flags used by the Objective-C compiler")

if(CMAKE_OBJC_STANDARD_LIBRARIES_INIT)
  set(CMAKE_OBJC_STANDARD_LIBRARIES "${CMAKE_OBJC_STANDARD_LIBRARIES_INIT}"
    CACHE STRING "Libraries linked by default with all Objective-C applications.")
  mark_as_advanced(CMAKE_OBJC_STANDARD_LIBRARIES)
endif()

if(NOT CMAKE_OBJC_COMPILER_LAUNCHER AND DEFINED ENV{CMAKE_OBJC_COMPILER_LAUNCHER})
  set(CMAKE_OBJC_COMPILER_LAUNCHER "$ENV{CMAKE_OBJC_COMPILER_LAUNCHER}"
    CACHE STRING "Compiler launcher for OBJC.")
endif()

if(NOT CMAKE_OBJC_LINKER_LAUNCHER AND DEFINED ENV{CMAKE_OBJC_LINKER_LAUNCHER})
  set(CMAKE_OBJC_LINKER_LAUNCHER "$ENV{CMAKE_OBJC_LINKER_LAUNCHER}"
    CACHE STRING "Linker launcher for OBJC.")
endif()

include(CMakeCommonLanguageInclude)

# now define the following rule variables

# CMAKE_OBJC_CREATE_SHARED_LIBRARY
# CMAKE_OBJC_CREATE_SHARED_MODULE
# CMAKE_OBJC_COMPILE_OBJECT
# CMAKE_OBJC_LINK_EXECUTABLE

# variables supplied by the generator at use time
# <TARGET>
# <TARGET_BASE> the target without the suffix
# <OBJECTS>
# <OBJECT>
# <LINK_LIBRARIES>
# <FLAGS>
# <LINK_FLAGS>

# Objective-C compiler information
# <CMAKE_OBJC_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS>
# <CMAKE_SHARED_MODULE_CREATE_OBJC_FLAGS>
# <CMAKE_OBJC_LINK_FLAGS>

# Static library tools
# <CMAKE_AR>
# <CMAKE_RANLIB>

# create an Objective-C shared library
if(NOT CMAKE_OBJC_CREATE_SHARED_LIBRARY)
  set(CMAKE_OBJC_CREATE_SHARED_LIBRARY
      "<CMAKE_OBJC_COMPILER> <CMAKE_SHARED_LIBRARY_OBJC_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_OBJC_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
endif()

# create an Objective-C shared module just copy the shared library rule
if(NOT CMAKE_OBJC_CREATE_SHARED_MODULE)
  set(CMAKE_OBJC_CREATE_SHARED_MODULE ${CMAKE_OBJC_CREATE_SHARED_LIBRARY})
endif()

# Create an static archive incrementally for large object file counts.
# If CMAKE_OBJC_CREATE_STATIC_LIBRARY is set it will override these.
if(NOT DEFINED CMAKE_OBJC_ARCHIVE_CREATE)
  set(CMAKE_OBJC_ARCHIVE_CREATE "<CMAKE_AR> qc <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_OBJC_ARCHIVE_APPEND)
  set(CMAKE_OBJC_ARCHIVE_APPEND "<CMAKE_AR> q <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_OBJC_ARCHIVE_FINISH)
  set(CMAKE_OBJC_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()

# compile an Objective-C file into an object file
if(NOT CMAKE_OBJC_COMPILE_OBJECT)
  set(CMAKE_OBJC_COMPILE_OBJECT
    "<CMAKE_OBJC_COMPILER> <DEFINES> <INCLUDES> -x objective-c <FLAGS> -o <OBJECT> -c <SOURCE>")
endif()

if(NOT CMAKE_OBJC_LINK_EXECUTABLE)
  set(CMAKE_OBJC_LINK_EXECUTABLE
    "<CMAKE_OBJC_COMPILER> <FLAGS> <CMAKE_OBJC_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
endif()

if(NOT CMAKE_EXECUTABLE_RUNTIME_OBJC_FLAG)
  set(CMAKE_EXECUTABLE_RUNTIME_OBJC_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_OBJC_FLAG})
endif()

if(NOT CMAKE_EXECUTABLE_RUNTIME_OBJC_FLAG_SEP)
  set(CMAKE_EXECUTABLE_RUNTIME_OBJC_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_OBJC_FLAG_SEP})
endif()

if(NOT CMAKE_EXECUTABLE_RPATH_LINK_OBJC_FLAG)
  set(CMAKE_EXECUTABLE_RPATH_LINK_OBJC_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_OBJC_FLAG})
endif()

set(CMAKE_OBJC_INFORMATION_LOADED 1)


code:
set(CMAKE_OBJCXX_COMPILER "@CMAKE_OBJCXX_COMPILER@")
set(CMAKE_OBJCXX_COMPILER_ARG1 "@CMAKE_OBJCXX_COMPILER_ARG1@")
set(CMAKE_OBJCXX_COMPILER_ID "@CMAKE_OBJCXX_COMPILER_ID@")
set(CMAKE_OBJCXX_COMPILER_VERSION "@CMAKE_OBJCXX_COMPILER_VERSION@")
set(CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL "@CMAKE_OBJCXX_COMPILER_VERSION_INTERNAL@")
set(CMAKE_OBJCXX_COMPILER_WRAPPER "@CMAKE_OBJCXX_COMPILER_WRAPPER@")
set(CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT "@CMAKE_OBJCXX_STANDARD_COMPUTED_DEFAULT@")
set(CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT "@CMAKE_OBJCXX_EXTENSIONS_COMPUTED_DEFAULT@")
set(CMAKE_OBJCXX_COMPILE_FEATURES "@CMAKE_OBJCXX_COMPILE_FEATURES@")
set(CMAKE_OBJCXX98_COMPILE_FEATURES "@CMAKE_OBJCXX98_COMPILE_FEATURES@")
set(CMAKE_OBJCXX11_COMPILE_FEATURES "@CMAKE_OBJCXX11_COMPILE_FEATURES@")
set(CMAKE_OBJCXX14_COMPILE_FEATURES "@CMAKE_OBJCXX14_COMPILE_FEATURES@")
set(CMAKE_OBJCXX17_COMPILE_FEATURES "@CMAKE_OBJCXX17_COMPILE_FEATURES@")
set(CMAKE_OBJCXX20_COMPILE_FEATURES "@CMAKE_OBJCXX20_COMPILE_FEATURES@")
set(CMAKE_OBJCXX23_COMPILE_FEATURES "@CMAKE_OBJCXX23_COMPILE_FEATURES@")

set(CMAKE_OBJCXX_PLATFORM_ID "@CMAKE_OBJCXX_PLATFORM_ID@")
set(CMAKE_OBJCXX_SIMULATE_ID "@CMAKE_OBJCXX_SIMULATE_ID@")
set(CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT "@CMAKE_OBJCXX_COMPILER_FRONTEND_VARIANT@")
set(CMAKE_OBJCXX_SIMULATE_VERSION "@CMAKE_OBJCXX_SIMULATE_VERSION@")
@_SET_CMAKE_OBJCXX_COMPILER_ARCHITECTURE_ID@
@SET_CMAKE_XCODE_ARCHS@
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_OBJCXX_COMPILER_AR "@CMAKE_OBJCXX_COMPILER_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_OBJCXX_COMPILER_RANLIB "@CMAKE_OBJCXX_COMPILER_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_LINKER_LINK "@CMAKE_LINKER_LINK@")
set(CMAKE_LINKER_LLD "@CMAKE_LINKER_LLD@")
set(CMAKE_OBJCXX_COMPILER_LINKER "@CMAKE_OBJCXX_COMPILER_LINKER@")
set(CMAKE_OBJCXX_COMPILER_LINKER_ID "@CMAKE_OBJCXX_COMPILER_LINKER_ID@")
set(CMAKE_OBJCXX_COMPILER_LINKER_VERSION @CMAKE_OBJCXX_COMPILER_LINKER_VERSION@)
set(CMAKE_OBJCXX_COMPILER_LINKER_FRONTEND_VARIANT @CMAKE_OBJCXX_COMPILER_LINKER_FRONTEND_VARIANT@)
set(CMAKE_MT "@CMAKE_MT@")
set(CMAKE_TAPI "@CMAKE_TAPI@")
set(CMAKE_COMPILER_IS_GNUOBJCXX @CMAKE_COMPILER_IS_GNUOBJCXX@)
set(CMAKE_OBJCXX_COMPILER_LOADED 1)
set(CMAKE_OBJCXX_COMPILER_WORKS @CMAKE_OBJCXX_COMPILER_WORKS@)
set(CMAKE_OBJCXX_ABI_COMPILED @CMAKE_OBJCXX_ABI_COMPILED@)

set(CMAKE_OBJCXX_COMPILER_ENV_VAR "OBJCXX")

set(CMAKE_OBJCXX_COMPILER_ID_RUN 1)
set(CMAKE_OBJCXX_SOURCE_FILE_EXTENSIONS M;m;mm)
set(CMAKE_OBJCXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O)

if (CMAKE_OBJC_COMPILER_ID_RUN)
  foreach(extension IN LISTS CMAKE_OBJC_SOURCE_FILE_EXTENSIONS)
    list(REMOVE_ITEM CMAKE_OBJCXX_SOURCE_FILE_EXTENSIONS ${extension})
  endforeach()
endif()

foreach (lang IN ITEMS C CXX OBJC)
  foreach(extension IN LISTS CMAKE_OBJCXX_SOURCE_FILE_EXTENSIONS)
    if (CMAKE_${lang}_COMPILER_ID_RUN)
      list(REMOVE_ITEM CMAKE_${lang}_SOURCE_FILE_EXTENSIONS ${extension})
    endif()
  endforeach()
endforeach()

set(CMAKE_OBJCXX_LINKER_PREFERENCE 25)
set(CMAKE_OBJCXX_LINKER_PREFERENCE_PROPAGATES 1)
set(CMAKE_OBJCXX_LINKER_DEPFILE_SUPPORTED @CMAKE_OBJCXX_LINKER_DEPFILE_SUPPORTED@)

# Save compiler ABI information.
set(CMAKE_OBJCXX_SIZEOF_DATA_PTR "@CMAKE_OBJCXX_SIZEOF_DATA_PTR@")
set(CMAKE_OBJCXX_COMPILER_ABI "@CMAKE_OBJCXX_COMPILER_ABI@")
set(CMAKE_OBJCXX_BYTE_ORDER "@CMAKE_OBJCXX_BYTE_ORDER@")
set(CMAKE_OBJCXX_LIBRARY_ARCHITECTURE "@CMAKE_OBJCXX_LIBRARY_ARCHITECTURE@")

if(CMAKE_OBJCXX_SIZEOF_DATA_PTR)
  set(CMAKE_SIZEOF_VOID_P "${CMAKE_OBJCXX_SIZEOF_DATA_PTR}")
endif()

if(CMAKE_OBJCXX_COMPILER_ABI)
  set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_OBJCXX_COMPILER_ABI}")
endif()

if(CMAKE_OBJCXX_LIBRARY_ARCHITECTURE)
  set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_OBJCXX_LIBRARY_ARCHITECTURE@")
endif()

@CMAKE_OBJCXX_COMPILER_CUSTOM_CODE@
@CMAKE_OBJCXX_SYSROOT_FLAG_CODE@
@CMAKE_OBJCXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@

set(CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES@")
set(CMAKE_OBJCXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_OBJCXX_IMPLICIT_LINK_LIBRARIES@")
set(CMAKE_OBJCXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_OBJCXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_OBJCXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_OBJCXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")


code:
#ifndef __cplusplus
# error "A C compiler has been selected for Objective-C++."
#endif

/*--------------------------------------------------------------------------*/

#include "CMakeCompilerABI.h"

/*--------------------------------------------------------------------------*/

int main(int argc, char *argv[])
{
  int require = 0;
  require += info_sizeof_dptr[argc];
  require += info_byte_order_big_endian[argc];
  require += info_byte_order_little_endian[argc];
#if defined(ABI_ID)
  require += info_abi[argc];
#endif
  (void)argv;
  return require;
}


code:
/* This source file must have a .cpp extension so that all C++ compilers
   recognize the extension without flags.  Borland does not know .cxx for
   example.  */
#ifndef __cplusplus
# error "An Objective-C compiler has been selected for Objective-C++."
#endif

@CMAKE_OBJCXX_COMPILER_ID_CONTENT@

/* Construct the string literal in pieces to prevent the source from
   getting matched.  Store it in a pointer rather than an array
   because some compilers will just produce instructions to fill the
   array rather than assigning a pointer to a static array.  */
char const* info_compiler = "INFO" ":" "compiler[" COMPILER_ID "]";
#ifdef SIMULATE_ID
char const* info_simulate = "INFO" ":" "simulate[" SIMULATE_ID "]";
#endif

#ifdef __QNXNTO__
char const* qnxnto = "INFO" ":" "qnxnto[]";
#endif

@CMAKE_OBJCXX_COMPILER_ID_PLATFORM_CONTENT@
@CMAKE_OBJCXX_COMPILER_ID_ERROR_FOR_TEST@

#if defined(_MSC_VER) && defined(_MSVC_LANG)
#define CXX_STD _MSVC_LANG
#else
#define CXX_STD __cplusplus
#endif

const char* info_language_standard_default = "INFO" ":" "standard_default["
#if CXX_STD > 202002L
  "23"
#elfif CXX_STD > 201703L
  "20"
#elif CXX_STD >= 201703L
  "17"
#elif CXX_STD >= 201402L
  "14"
#elif CXX_STD >= 201103L
  "11"
#else
  "98"
#endif
"]";

const char* info_language_extensions_default = "INFO" ":" "extensions_default["
#if (defined(__clang__) || defined(__GNUC__)) && !defined(__STRICT_ANSI__)
  "ON"
#else
  "OFF"
#endif
"]";

/*--------------------------------------------------------------------------*/

int main(int argc, char* argv[])
{
  int require = 0;
  require += info_compiler[argc];
  require += info_platform[argc];
#ifdef COMPILER_VERSION_MAJOR
  require += info_version[argc];
#endif
#ifdef COMPILER_VERSION_INTERNAL
  require += info_version_internal[argc];
#endif
#ifdef SIMULATE_ID
  require += info_simulate[argc];
#endif
#ifdef SIMULATE_VERSION_MAJOR
  require += info_simulate_version[argc];
#endif
  require += info_language_standard_default[argc];
  require += info_language_extensions_default[argc];
  (void)argv;
  return require;
}