26 lines
912 B
Plaintext
26 lines
912 B
Plaintext
SET(CMAKE_SYSTEM_NAME {host_machine[system]})
|
|
SET(CMAKE_SYSTEM_PROCESSOR {host_machine[cpu_family]})
|
|
|
|
# specify the cross compiler
|
|
SET(CMAKE_C_COMPILER "{toolchain.binaries[CC]}")
|
|
SET(CMAKE_CXX_COMPILER "{toolchain.binaries[CXX]}")
|
|
SET(CMAKE_RC_COMPILER {toolchain.binaries[WINDRES]})
|
|
SET(CMAKE_AR:FILEPATH {toolchain.binaries[AR]})
|
|
SET(CMAKE_RANLIB:FILEPATH {toolchain.binaries[RANLIB]})
|
|
|
|
find_program(CCACHE_FOUND ccache)
|
|
if(CCACHE_FOUND)
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
|
|
endif(CCACHE_FOUND)
|
|
|
|
# where is the target environment
|
|
SET(CMAKE_FIND_ROOT_PATH {toolchain.root_path})
|
|
|
|
# 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)
|
|
|