unset(CMAKE_XCODE_ATTRIBUTE_INSTALL_PATH)

set(MACOSX_BUNDLE_GUI_IDENTIFIER "in.ioshack")
set(CMAKE_MACOSX_BUNDLE YES)
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "")

set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")

set(CMAKE_OSX_SYSROOT "$ENV{PLATFORM_NAME}")
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "$ENV{PLATFORM_NAME}")
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "$ENV{EFFECTIVE_PLATFORM_NAME}")
set(CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET "$ENV{IPHONEOS_DEPLOYMENT_TARGET}")

set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphoneos*] "$ENV{ARCHS}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphoneos*] "$ENV{ARCHS}")

# Set iPhoneSimulator architectures
set(CMAKE_XCODE_ATTRIBUTE_ARCHS[sdk=iphonesimulator*] "$ENV{ARCHS}")
set(CMAKE_XCODE_ATTRIBUTE_VALID_ARCHS[sdk=iphonesimulator*] "$ENV{ARCHS}")

set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE[sdk=iphone*] "YES")
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE "\$(BITCODE_GENERATION_MODE_\$(CONFIGURATION))")
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE_Debug "marker")
set(CMAKE_XCODE_ATTRIBUTE_BITCODE_GENERATION_MODE_Release "bitcode")

set(CMAKE_CXX_FLAGS "-std=c++11 -Wno-shorten-64-to-32")
