When macOS or Xcode upgrades, CMake build directories often need to be refreshed. If the user has set custom environment variables concerning Xcode, they may need to be updated as well. Here are some important variables to check if problems occur after upgrading macOS or Xcode.
For a simple CMake project on macOS, CMakeCache.txt might include:
- environment variable
MACOSX_DEPLOYMENT_TARGEThelps set CMAKE_OSX_DEPLOYMENT_TARGET
- Environment variable
SDKROOThelps set CMAKE_OSX_SYSROOT
Having multiple directories under
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs is fine, CMake can select the appropriate one.
The user can
select the SDK:
but often this is not necessary.