diff options
author | Brad King <brad.king@kitware.com> | 2012-09-24 18:44:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2012-09-24 18:44:07 (GMT) |
commit | df928646bae077d0b827116f93a64062e8bd1731 (patch) | |
tree | bac0e9791916c98c96d72c6c813b4876f7ad3aae /Modules/CMakeDetermineCompilerId.cmake | |
parent | e7e613efbf1da45a2a9e51d11a4022589d79c642 (diff) | |
download | CMake-df928646bae077d0b827116f93a64062e8bd1731.zip CMake-df928646bae077d0b827116f93a64062e8bd1731.tar.gz CMake-df928646bae077d0b827116f93a64062e8bd1731.tar.bz2 |
OS X: Ignore MACOSX_DEPLOYMENT_TARGET during Xcode compiler id
Xcode honors this environment variable if the project file does not set
it. Hide it from Xcode while building the compiler id project.
Diffstat (limited to 'Modules/CMakeDetermineCompilerId.cmake')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 8e38399..906a5e7 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -185,12 +185,20 @@ Id flags: ${testflags} endif() configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-${v}.pbxproj.in ${id_dir}/CompilerId${lang}.${ext}/project.pbxproj @ONLY IMMEDIATE) + unset(_ENV_MACOSX_DEPLOYMENT_TARGET) + if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) + set(_ENV_MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}") + set(ENV{MACOSX_DEPLOYMENT_TARGET} "") + endif() execute_process(COMMAND xcodebuild WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT ) + if(DEFINED _ENV_MACOSX_DEPLOYMENT_TARGET) + set(ENV{MACOSX_DEPLOYMENT_TARGET} "${_ENV_MACOSX_DEPLOYMENT_TARGET}") + endif() # Match the link line from xcodebuild output of the form # Ld ... |