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 ============================================================================*/
12 #ifndef cmCoreTryCompile_h
13 #define cmCoreTryCompile_h
15 #include "cmCommand.h"
17 /** \class cmCoreTryCompile
18 * \brief Base class for cmTryCompileCommand and cmTryRunCommand
20 * cmCoreTryCompile implements the functionality to build a program.
21 * It is the base class for cmTryCompileCommand and cmTryRunCommand.
23 class cmCoreTryCompile : public cmCommand
29 * This is the core code for try compile. It is here so that other
30 * commands, such as TryRun can access the same logic without
33 int TryCompileCode(std::vector<std::string> const& argv);
36 * This deletes all the files created by TryCompileCode.
37 * This way we do not have to rely on the timing and
38 * dependencies of makefiles.
40 void CleanupFiles(const char* binDir);
43 * This tries to find the (executable) file created by
44 TryCompileCode. The result is stored in OutputFile. If nothing is found,
45 the error message is stored in FindErrorMessage.
47 void FindOutputFile(const char* targetName);
50 cmTypeMacro(cmCoreTryCompile, cmCommand);
52 std::string BinaryDirectory;
53 std::string OutputFile;
54 std::string FindErrorMessage;
55 bool SrcFileSignature;