cmake_minimum_required(VERSION 3.1) cmake_policy(SET CMP0025 NEW) set(OSX_BUILD True) set(OSX True) set(SCOL_INSTALL_PREFIX "OSX") if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" CACHE STRING "OSX SDK ROOT" FORCE) else() #linux cross build set(CMAKE_SYSTEM_NAME Darwin) set(CMAKE_SYSTEM_VERSION 1) set(CMAKE_OSX_SYSROOT "/workspace/scol-svn/xcode_build/SDKs/MacOSX15.1.sdk" CACHE STRING "OSX SDK ROOT" FORCE) if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64") # For x86_64 architecture set(CMAKE_C_COMPILER /workspace/scol-svn/xcode_build/cctools/x86_64-apple-darwin/bin/x86_64-apple-darwin11-clang) set(CMAKE_CXX_COMPILER /workspace/scol-svn/xcode_build/cctools/x86_64-apple-darwin/bin/x86_64-apple-darwin11-clang++) set(CMAKE_LINKER /workspace/scol-svn/xcode_build/cctools/x86_64-apple-darwin/bin/x86_64-apple-darwin11-ld) set(CMAKE_AR /workspace/scol-svn/xcode_build/cctools/x86_64-apple-darwin/bin/x86_64-apple-darwin11-ar) elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64") # For arm64 architecture set(CMAKE_C_COMPILER /workspace/scol-svn/xcode_build/cctools/arm64-apple-darwin/bin/arm64-apple-darwin11-clang) set(CMAKE_CXX_COMPILER /workspace/scol-svn/xcode_build/cctools/arm64-apple-darwin/bin/arm64-apple-darwin11-clang++) set(CMAKE_LINKER /workspace/scol-svn/xcode_build/cctools/arm64-apple-darwin/bin/arm64-apple-darwin11-ld) set(CMAKE_AR /workspace/scol-svn/xcode_build/cctools/arm64-apple-darwin/bin/arm64-apple-darwin11-ar) endif() endif() set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_FIND_LIBRARY_SUFFIXES ".tbd" ".dylib" ".so" ".a") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "OSX TARGET" FORCE) set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM TBKGN2PNBB CACHE STRING "") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "Mac Developer" CACHE STRING "") set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_REQUIRED NO) set(CMAKE_FIND_FRAMEWORK "LAST") set(CMAKE_FIND_APPBUNDLE "LAST") set(CMAKE_CXX_FLAGS "-stdlib=libc++ -isysroot${CMAKE_OSX_SYSROOT}" CACHE STRING "" FORCE) set(CMAKE_C_FLAGS "-isysroot${CMAKE_OSX_SYSROOT}" CACHE STRING "" FORCE) set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") #set(LIBRARY_OUTPUT_PATH_ROOT "${CMAKE_BINARY_DIR}") add_definitions(-DOSX)