set(OS "@platform_os@") set(CMAKE_SYSTEM_PROCESSOR @host_cpu@) set(CPU "@use_cpu@") set(PLATFORM "@target_platform@") set(APP_RENDER_SYSTEM @app_rendersystem@) set(CMAKE_FIND_ROOT_PATH @CMAKE_FIND_ROOT_PATH@) # set CORE_SYSTEM_NAME and CMAKE_SYSTEM_NAME (sets CMAKE_CROSSCOMPILING) if(OS STREQUAL linux) set(CMAKE_SYSTEM_NAME Linux) set(CORE_SYSTEM_NAME linux) set(CORE_PLATFORM_NAME @target_platform@) if(NOT APP_RENDER_SYSTEM) set(APP_RENDER_SYSTEM gl) endif() elseif(OS STREQUAL android) set(CMAKE_SYSTEM_NAME Android) set(CORE_SYSTEM_NAME android) if(NOT APP_RENDER_SYSTEM) set(APP_RENDER_SYSTEM gles) endif() elseif(OS STREQUAL osx) set(CMAKE_SYSTEM_NAME Darwin) set(CORE_SYSTEM_NAME osx) if(NOT APP_RENDER_SYSTEM) set(APP_RENDER_SYSTEM gl) endif() elseif(OS STREQUAL darwin_embedded) set(CMAKE_SYSTEM_NAME Darwin) set(CORE_SYSTEM_NAME darwin_embedded) if(PLATFORM STREQUAL appletvos) set(CORE_PLATFORM_NAME tvos) else() set(CORE_PLATFORM_NAME ios) endif() if(NOT APP_RENDER_SYSTEM) set(APP_RENDER_SYSTEM gles) endif() endif() if(CMAKE_SYSTEM_NAME STREQUAL Darwin) set(CMAKE_OSX_SYSROOT @use_sdk_path@) list(APPEND CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_SYSROOT} ${CMAKE_OSX_SYSROOT}/usr /usr/X11R6) set(CMAKE_LIBRARY_PATH @CMAKE_FIND_ROOT_PATH@/lib:@use_sdk_path@/lib:/usr/X11R6/lib) set(CMAKE_INCLUDE_PATH @CMAKE_FIND_ROOT_PATH@/include:@use_sdk_path@/include:/usr/X11R6/include) endif() set(CMAKE_SYSTEM_VERSION 1) # specify the cross compiler set(CMAKE_C_COMPILER @CC@) set(CMAKE_CXX_COMPILER @CXX@) set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") set(CMAKE_NM @NM@ CACHE FILEPATH "Nm") set(CMAKE_OBJDUMP @OBJDUMP@ CACHE FILEPATH "Objdump") set(CMAKE_RANLIB @RANLIB@ CACHE FILEPATH "Ranlib") if(NOT "@use_ccache@" STREQUAL "") set(CMAKE_CXX_COMPILER_LAUNCHER @CCACHE@) set(CMAKE_C_COMPILER_LAUNCHER @CCACHE@) endif() # where is the target environment if(NOT "@use_toolchain@" STREQUAL "") list(APPEND CMAKE_FIND_ROOT_PATH @use_toolchain@/sysroot/usr) endif() # add Android directories and tools if(CORE_SYSTEM_NAME STREQUAL android) set(NDKROOT @use_ndk_path@) set(SDKROOT @use_sdk_path@) set(TOOLCHAIN @use_toolchain@) set(HOST @use_host@) list(APPEND CMAKE_LIBRARY_PATH ${TOOLCHAIN}/sysroot/usr/lib/${HOST}/@use_ndk_api@) string(REPLACE ":" ";" SDK_BUILDTOOLS_PATH "@build_tools_path@") endif() set(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@") set(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@") set(CMAKE_C_FLAGS_RELEASE "@platform_cflags_release@ @platform_includes@") set(CMAKE_CXX_FLAGS_RELEASE "@platform_cxxflags_release@ @platform_includes@") set(CMAKE_C_FLAGS_DEBUG "@platform_cflags_debug@ @platform_includes@") set(CMAKE_CXX_FLAGS_DEBUG "@platform_cxxflags_debug@ @platform_includes@") set(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@") set(CMAKE_EXE_LINKER_FLAGS "@platform_ldflags@") set(ENV{CFLAGS} ${CMAKE_C_FLAGS}) set(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}) set(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS}) set(ENV{LDFLAGS} ${CMAKE_EXE_LINKER_FLAGS}) # search for programs in the build host directories set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(CMAKE_FIND_FRAMEWORK LAST) # Binary Addons if(NOT CORE_SYSTEM_NAME STREQUAL linux) set(ADDONS_PREFER_STATIC_LIBS ON) endif() set(KODI_DEPENDSBUILD 1)