1
/*=========================================================================
3
Program: CMake - Cross-Platform Makefile Generator
4
Module: $RCSfile: cmCoreTryCompile.cxx,v $
6
Date: $Date: 2009-02-04 16:44:17 $
7
Version: $Revision: 1.7.2.3 $
9
Copyright (c) 2007 Kitware, Inc., Insight Consortium. All rights reserved.
10
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12
This software is distributed WITHOUT ANY WARRANTY; without even
13
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14
PURPOSE. See the above copyright notices for more information.
16
=========================================================================*/
1
/*============================================================================
2
CMake - Cross Platform Makefile Generator
3
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5
Distributed under the OSI-approved BSD License (the "License");
6
see accompanying file Copyright.txt for details.
8
This software is distributed WITHOUT ANY WARRANTY; without even the
9
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
See the License for more information.
11
============================================================================*/
17
12
#include "cmCoreTryCompile.h"
19
14
#include "cmCacheManager.h"
251
245
flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_ARCHITECTURES");
252
246
cmakeFlags.push_back(flag);
248
/* on APPLE also pass CMAKE_OSX_SYSROOT to the try_compile */
249
if(this->Makefile->GetDefinition("CMAKE_OSX_SYSROOT")!=0)
251
std::string flag="-DCMAKE_OSX_SYSROOT=";
252
flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_SYSROOT");
253
cmakeFlags.push_back(flag);
255
/* on APPLE also pass CMAKE_OSX_DEPLOYMENT_TARGET to the try_compile */
256
if(this->Makefile->GetDefinition("CMAKE_OSX_DEPLOYMENT_TARGET")!=0)
258
std::string flag="-DCMAKE_OSX_DEPLOYMENT_TARGET=";
259
flag += this->Makefile->GetSafeDefinition("CMAKE_OSX_DEPLOYMENT_TARGET");
260
cmakeFlags.push_back(flag);
255
263
fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str());
305
314
if (this->SrcFileSignature)
307
316
this->FindOutputFile(targetName);
308
318
if ((res==0) && (copyFile.size()))
310
if(!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
320
if(this->OutputFile.empty() ||
321
!cmSystemTools::CopyFileAlways(this->OutputFile.c_str(),
311
322
copyFile.c_str()))
313
324
cmOStringStream emsg;
314
325
emsg << "Could not COPY_FILE.\n"
315
326
<< " OutputFile: '" << this->OutputFile.c_str() << "'\n"
316
327
<< " copyFile: '" << copyFile.c_str() << "'\n";
329
if (this->FindErrorMessage.size())
332
emsg << this->FindErrorMessage.c_str() << "\n";
317
335
cmSystemTools::Error(emsg.str().c_str());