2018-03-27 19:02:06 +02:00
|
|
|
#!/usr/bin/env sh
|
2019-09-27 18:50:48 +02:00
|
|
|
|
|
|
|
# When setting variables, use the 'bracket argument' format to allow having \"
|
|
|
|
# inside the string. Which is not supported by quoted arguments
|
|
|
|
# https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#bracket-argument
|
|
|
|
#
|
|
|
|
# bracket_argument ::= bracket_open bracket_content bracket_close
|
|
|
|
# bracket_open ::= '[' '='* '['
|
|
|
|
# bracket_content ::= <any text not containing a bracket_close with
|
|
|
|
# the same number of '=' as the bracket_open>
|
|
|
|
# bracket_close ::= ']' '='* ']'
|
|
|
|
#
|
|
|
|
# I will use [==[value]==] in this file, to not maybe match a case with one '='
|
|
|
|
# I used it for all variables even ones that currently do not need it.
|
|
|
|
|
|
|
|
printf 'SET(CMAKE_SYSTEM_NAME Generic)\n'
|
|
|
|
printf 'SET(CMAKE_SYSTEM_VERSION 1)\n'
|
2018-03-27 19:02:06 +02:00
|
|
|
# specify the cross compiler"
|
2019-09-27 18:50:48 +02:00
|
|
|
printf 'SET(CMAKE_C_COMPILER [==[%s]==] CACHE STRING "")\n' "${CC}"
|
|
|
|
printf 'SET(CMAKE_CXX_COMPILER [==[%s]==] CACHE STRING "")\n' "${CXX}"
|
|
|
|
printf 'SET(CMAKE_LINKER [==[%s]==] CACHE STRING "")\n' "${LINK}"
|
|
|
|
printf 'SET(CMAKE_RANLIB [==[%s]==] CACHE STRING "")\n' "${RANLIB}"
|
2018-03-27 19:02:06 +02:00
|
|
|
# disable linker test
|
2019-09-27 18:50:48 +02:00
|
|
|
printf 'SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)\n'
|
|
|
|
printf 'SET(CMAKE_C_FLAGS [==[%s]==] CACHE STRING "")\n' "${CFLAGS}"
|
|
|
|
printf 'SET(CMAKE_EXE_LINKER_FLAGS [==[%s]==] CACHE STRING "")\n' "${LFLAGS}"
|
2018-03-27 19:02:06 +02:00
|
|
|
# search for programs in the build host directories
|
2019-09-27 18:50:48 +02:00
|
|
|
printf 'SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)\n'
|
2018-03-27 19:02:06 +02:00
|
|
|
# for libraries and headers in the target directories
|
2019-09-27 18:50:48 +02:00
|
|
|
printf 'SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)\n'
|
|
|
|
printf 'SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)\n'
|