2016-07-05 01:30:06 +02:00
|
|
|
set(CMAKE_SYSTEM_NAME Darwin)
|
|
|
|
|
|
|
|
# replace with your path to OSXCross toolchain
|
2017-08-19 01:27:09 +02:00
|
|
|
set(OSXCROSS_PATH "$ENV{LIBSUPERDERPY_OSXCROSS_ROOT}" CACHE PATH "Path to OSXCross toolchain" )
|
|
|
|
set(OSXCROSS_SDK_VERSION "$ENV{LIBSUPERDERPY_OSXCROSS_SDK_VERSION}" CACHE STRING "Version of Xcode SDK used to build the toolchain")
|
2018-08-10 07:58:25 +02:00
|
|
|
set(CMAKE_OSX_SYSROOT "${OSXCROSS_PATH}/SDK/MacOSX${OSXCROSS_SDK_VERSION}.sdk")
|
2017-08-19 01:27:09 +02:00
|
|
|
|
|
|
|
message( STATUS "Selected OSXCross toolchain: ${OSXCROSS_PATH}, SDK version: ${OSXCROSS_SDK_VERSION}" )
|
|
|
|
if(NOT EXISTS "${OSXCROSS_PATH}")
|
|
|
|
message( FATAL_ERROR "Invalid OSXCROSS_PATH!")
|
|
|
|
endif()
|
|
|
|
if(NOT EXISTS "${OSXCROSS_PATH}/SDK/MacOSX${OSXCROSS_SDK_VERSION}.sdk")
|
|
|
|
message( FATAL_ERROR "Invalid OSXCROSS_SDK_VERSION! Make sure ${OSXCROSS_PATH}/SDK/MacOSX\${OSXCROSS_SDK_VERSION}.sdk/ directory exists.")
|
|
|
|
endif()
|
2016-07-05 01:30:06 +02:00
|
|
|
|
|
|
|
set(CMAKE_C_COMPILER ${OSXCROSS_PATH}/bin/o64-clang)
|
|
|
|
set(CMAKE_CXX_COMPILER ${OSXCROSS_PATH}/bin/o64-clang++)
|
2017-08-04 10:30:37 +02:00
|
|
|
set(CMAKE_LINKER ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-ld)
|
|
|
|
set(CMAKE_AR ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-ar)
|
2018-11-29 04:37:08 +01:00
|
|
|
set(CMAKE_RANLIB ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-ranlib)
|
|
|
|
set(CMAKE_STRIP ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-strip)
|
|
|
|
set(CMAKE_NM ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-nm)
|
|
|
|
set(CMAKE_INSTALL_NAME_TOOL ${OSXCROSS_PATH}/bin/x86_64-apple-darwin15-install_name_tool)
|
2016-07-05 01:30:06 +02:00
|
|
|
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
|
|
|
|
2017-09-25 00:40:04 +02:00
|
|
|
set(CMAKE_PREFIX_PATH ${OSXCROSS_PATH}/local)
|
|
|
|
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${CMAKE_PREFIX_PATH}/lib ${OSXCROSS_PATH}/macports/pkgs/opt/local/lib ${OSXCROSS_PATH}/SDK/MacOSX${OSXCROSS_SDK_VERSION}.sdk/usr/lib)
|
|
|
|
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} ${CMAKE_PREFIX_PATH}/include ${OSXCROSS_PATH}/macports/pkgs/opt/local/include ${OSXCROSS_PATH}/SDK/MacOSX${OSXCROSS_SDK_VERSION}.sdk/usr/include)
|
2017-08-24 21:09:07 +02:00
|
|
|
|
|
|
|
# Do a no-op access on the CMAKE_TOOLCHAIN_FILE variable so that CMake will not issue a warning on it being unused.
|
|
|
|
if (CMAKE_TOOLCHAIN_FILE)
|
|
|
|
endif()
|