Force SDK version / C++ library on Mac.

This commit is contained in:
James Turner 2015-02-08 13:46:09 +00:00
parent 148640be34
commit f711306085

View File

@ -4,6 +4,9 @@ include (CheckIncludeFile)
include (CheckCXXSourceCompiles)
include (CheckCXXCompilerFlag)
# set this before project()
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
project(SimGear)
# read 'version' file into a variable (stripping any newlines or spaces)
@ -161,6 +164,12 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT)
if(APPLE)
find_library(COCOA_LIBRARY Cocoa)
# force libstdc++, not libc++
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
list(APPEND CMAKE_CXX_FLAGS "-stdlib=libstdc++")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-stdlib=libstdc++")
list(APPEND CMAKE_SHARED_LINKER_FLAGS "-stdlib=libstdc++")
endif()
# Somehow this only works if included before searching for Boost...