| 1 |
// OSRail -- a network enabled railroad operations simulator and utilities |
|---|
| 2 |
// Copyright (C) 2007,2008 Samuel E. Henley sehenley@comcast.net |
|---|
| 3 |
// |
|---|
| 4 |
// This program is free software; you can redistribute it and/or modify |
|---|
| 5 |
// it under the terms of the GNU General Public License as published by |
|---|
| 6 |
// the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 |
// (at your option) any later version. |
|---|
| 8 |
// |
|---|
| 9 |
// This program is distributed in the hope that it will be useful, |
|---|
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 |
// GNU General Public License for more details. |
|---|
| 13 |
// |
|---|
| 14 |
// You should have received a copy of the GNU General Public License along |
|---|
| 15 |
// with this program; if not, write to the Free Software Foundation, Inc., |
|---|
| 16 |
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 US |
|---|
| 17 |
|
|---|
| 18 |
#ifndef cmPreCompiledHeaderCommand_h |
|---|
| 19 |
#define cmPreCompiledHeaderCommand_h |
|---|
| 20 |
|
|---|
| 21 |
#include "cmCommand.h" |
|---|
| 22 |
|
|---|
| 23 |
/// \class cmPreCompiledHeaderCommand |
|---|
| 24 |
/// PreCompiledHeader - setup pre-compiled headers for a target\n |
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
class cmPreCompiledHeaderCommand : public cmCommand |
|---|
| 28 |
{ |
|---|
| 29 |
public: |
|---|
| 30 |
|
|---|
| 31 |
struct Data |
|---|
| 32 |
{ |
|---|
| 33 |
std::string target; |
|---|
| 34 |
std::string generator; |
|---|
| 35 |
std::string directory; |
|---|
| 36 |
std::string header_file; |
|---|
| 37 |
std::string dummy_file; |
|---|
| 38 |
std::string pch_mode; |
|---|
| 39 |
}; |
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
/// clone command? - factory or create command |
|---|
| 44 |
virtual cmCommand* Clone() |
|---|
| 45 |
{ |
|---|
| 46 |
return new cmPreCompiledHeaderCommand; |
|---|
| 47 |
} |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
/// first encounter |
|---|
| 51 |
virtual bool InitialPass( std::vector<std::string> const& args, cmExecutionStatus &status ); |
|---|
| 52 |
|
|---|
| 53 |
/// New 2.8.0 |
|---|
| 54 |
virtual bool HasFinalPass() const { return true; } |
|---|
| 55 |
|
|---|
| 56 |
/// last encounter |
|---|
| 57 |
virtual void FinalPass(); |
|---|
| 58 |
|
|---|
| 59 |
/// command name. |
|---|
| 60 |
virtual const char* GetName() {return "precompiled_header";} |
|---|
| 61 |
|
|---|
| 62 |
/// short documentation. |
|---|
| 63 |
virtual const char* GetTerseDocumentation() |
|---|
| 64 |
{ |
|---|
| 65 |
return "PreCompiledHeader - setup pre-compiled headers for a target";; |
|---|
| 66 |
} |
|---|
| 67 |
|
|---|
| 68 |
/// long documentation. |
|---|
| 69 |
virtual const char* GetFullDocumentation() |
|---|
| 70 |
{ |
|---|
| 71 |
return |
|---|
| 72 |
"PreCompiledHeader - A custom CMake command to \n" |
|---|
| 73 |
"setup precompiled headers on gcc and vc compilers.\n" |
|---|
| 74 |
"The parameters are target, directory, and header file for\n" |
|---|
| 75 |
"gcc and target, directory, header and dummy cpp file for \n" |
|---|
| 76 |
"msvc." |
|---|
| 77 |
; |
|---|
| 78 |
} |
|---|
| 79 |
|
|---|
| 80 |
cmTypeMacro( cmPreCompiledHeaderCommand, cmCommand ); |
|---|
| 81 |
protected: |
|---|
| 82 |
/// command args by target |
|---|
| 83 |
std::map< std::string, Data > arguments; |
|---|
| 84 |
|
|---|
| 85 |
void gccPreCompiledHeader( cmTarget* target, std::string& header_file, std::string& directory ); |
|---|
| 86 |
void vcPreCompiledHeader( std::string& header_file, std::string& dummy_file ); |
|---|
| 87 |
void cbPreCompiledHeader( cmTarget* target, std::string& header_file, std::string& pch_mode ); |
|---|
| 88 |
|
|---|
| 89 |
}; |
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
#endif |
|---|