You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.9 KiB

  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2007 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCoreTryCompile_h
  14. #define cmCoreTryCompile_h
  15. #include "cmCommand.h"
  16. /** \class cmCoreTryCompile
  17. * \brief Base class for cmTryCompileCommand and cmTryRunCommand
  18. *
  19. * cmCoreTryCompile implements the functionality to build a program.
  20. * It is the base class for cmTryCompileCommand and cmTryRunCommand.
  21. */
  22. class cmCoreTryCompile : public cmCommand
  23. {
  24. public:
  25. protected:
  26. /**
  27. * This is the core code for try compile. It is here so that other
  28. * commands, such as TryRun can access the same logic without
  29. * duplication.
  30. */
  31. int TryCompileCode(std::vector<std::string> const& argv);
  32. /**
  33. * This deletes all the files created by TryCompileCode.
  34. * This way we do not have to rely on the timing and
  35. * dependencies of makefiles.
  36. */
  37. void CleanupFiles(const char* binDir);
  38. /**
  39. * This tries to find the (executable) file created by
  40. TryCompileCode. The result is stored in OutputFile. If nothing is found,
  41. the error message is stored in FindErrorMessage.
  42. */
  43. void FindOutputFile(const char* targetName);
  44. cmTypeMacro(cmCoreTryCompile, cmCommand);
  45. std::string BinaryDirectory;
  46. std::string OutputFile;
  47. std::string FindErrorMessage;
  48. bool SrcFileSignature;
  49. };
  50. #endif