*** cmake-2.8.5.orig/Source/cmCoreTryCompile.cxx Fri Jul 8 14:21:45 2011 --- cmake-2.8.5/Source/cmCoreTryCompile.cxx Fri Sep 2 13:30:11 2011 *************** *** 26,31 **** --- 26,32 ---- const char* sourceDirectory = argv[2].c_str(); const char* projectName = 0; const char* targetName = 0; + const char* macosx_bundle=""; int extraArgs = 0; // look for CMAKE_FLAGS and store them *************** *** 280,291 **** flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); cmakeFlags.push_back(flag); } /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", this->BinaryDirectory.c_str()); /* Create the actual executable. */ ! fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str()); fprintf(fout, "TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n"); fclose(fout); --- 281,310 ---- flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET"); cmakeFlags.push_back(flag); } + /* on APPLE also pass CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY to the try_compile */ + if(this->Makefile->GetDefinition("CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY")!=0) + { + std::string flag="-DCMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY="; + flag += this->Makefile->GetSafeDefinition("CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY"); + cmakeFlags.push_back(flag); + } + /* on APPLE also pass MACOSX_BUNDLE_GUI_IDENTIFIER to the try_compile */ + if(this->Makefile->GetDefinition("MACOSX_BUNDLE_GUI_IDENTIFIER")!=0) + { + std::string flag="-DMACOSX_BUNDLE_GUI_IDENTIFIER="; + flag += this->Makefile->GetSafeDefinition("MACOSX_BUNDLE_GUI_IDENTIFIER"); + cmakeFlags.push_back(flag); + } + if(this->Makefile->GetDefinition("CMAKE_TRY_COMPILE_OSX_BUNDLE")!=0) + { + macosx_bundle="MACOSX_BUNDLE "; + } /* Put the executable at a known location (for COPY_FILE). */ fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", this->BinaryDirectory.c_str()); /* Create the actual executable. */ ! fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec %s\"%s\")\n",macosx_bundle,source.c_str()); fprintf(fout, "TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n"); fclose(fout); *************** *** 444,449 **** --- 463,469 ---- searchDirs.push_back(tmp); } searchDirs.push_back("/Debug"); + searchDirs.push_back("/Debug/cmTryCompileExec.app"); searchDirs.push_back("/Development"); for(std::vector::const_iterator it = searchDirs.begin();