I don’t understand how the CMAKE_SYSTEM_PREFIX_PATH
is set under macOS. On my system (Catalina) the currently selected SDK is:
$ xcrun --show-sdk-path
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk
but printing the values of CMAKE_SYSTEM_PREFIX_PATH
with this simple CMakeLists:
project(test)
foreach(dir ${CMAKE_SYSTEM_PREFIX_PATH})
message(${dir})
endforeach()
the first folder is
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr
and there’s no value related to /Library/Developer/CommandLineTools
. My environment is clean from any reference to /Applications/Xcode.app
:
$ env
GIT_PS1_SHOWDIRTYSTATE=true
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/jl/gvl_b75d51lb46slt_nhznrm0000gn/T/
SSH_CLIENT=10.32.0.17 41134 22
OLDPWD=/Users/herduser
SSH_TTY=/dev/ttys000
GIT_EDITOR=vim
USER=herduser
LD_LIBRARY_PATH=/HERD/software/install//CMAKE_3.19.6/lib:
PATH=/HERD/software/install//CMAKE_3.19.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
PWD=/Users/herduser/test.build
PS1=[`date +%H:%M` \u@\h \W\[\e[35;1m\]$(__git_ps1 " (%s)")\[\e[0m\]]\$
GIT_PS1_SHOWUNTRACKEDFILES=true
SHLVL=1
HOME=/Users/herduser
GIT_PS1_SHOWSTASHSTATE=true
LOGNAME=herduser
GIT_PS1_SHOWUPSTREAM=auto
SSH_CONNECTION=10.32.0.17 41134 10.25.128.169 22
_=/usr/bin/env
so I think I’m not polluting any CMake variable. I didn’t find any useful info here so I’d need some help with this.
Using CMake 3.19.6 on macOS 10.15.4 with the following developer tools:
$ system_profiler SPDeveloperToolsDataType
Developer:
Developer Tools:
Version: 12.4 (12D4e)
Location: /Applications/Xcode.app
Applications:
Xcode: 12.4 (17801)
Instruments: 12.4 (64543.2)
SDKs:
iOS:
14,4: (18D46)
iOS Simulator:
14,4: (18D46)
macOS:
11,1: (20C63)
20,2:
tvOS:
14,3: (18K559)
tvOS Simulator:
14,3: (18K559)
watchOS:
7,2: (18S561)
watchOS Simulator:
7,2: (18S561)
Developer Tools:
Version: 11.7 (11E801a)
Location: /Applications/Xcode_11.7.app
Applications:
Xcode: 11.7 (16142)
Instruments: 11.7 (64535.78)
SDKs:
iOS:
13,7: (17H22)
iOS Simulator:
13,7: (17H22)
macOS:
10.15.6: (19G68)
19,0:
tvOS:
13,4: (17L255)
tvOS Simulator:
13,4: (17L255)
watchOS:
6,2: (17T255)
watchOS Simulator:
6,2: (17T255)