The CXX compiler identification is unknown: xcode
The error you have with the SDK can usually be solved by clearing the CMake build cache and adding the following to your CMakeLists.txt
before project():
SET(MACOSX_DEPLOYMENT_TARGET ${DARWIN_MAJOR_SDK_VERSION}.${DARWIN_MINOR_SDK_VERSION})SET(CMAKE_CXX_FLAGS "--sysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}")MESSAGE("Setting MACOSX_DEPLOYMENT_TARGET to '${MACOSX_DEPLOYMENT_TARGET}'.")
If you find that doesn't solve the issue then you should check the version of Xcode is current and has the SDK installed you are specifying. Generally Homebrew and Macports CMake both should have the latest stable build of Xcode installed.