CMake macOS Xcode Environment

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:



Having multiple directories under /Library/Developer/CommandLineTools/SDKs and /Applications/ is fine, CMake can select the appropriate one. The user can select the SDK:

xcode-select --switch

but often this is not necessary.