1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmAuxSourceDirectoryCommand.h,v $
6 Date: $Date: 2008/01/23 15:27:59 $
7 Version: $Revision: 1.16 $
9 Copyright (c) 2002 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 =========================================================================*/
17 #ifndef cmAuxSourceDirectoryCommand_h
18 #define cmAuxSourceDirectoryCommand_h
20 #include "cmCommand.h"
22 /** \class cmAuxSourceDirectoryCommand
23 * \brief Specify auxiliary source code directories.
25 * cmAuxSourceDirectoryCommand specifies source code directories
26 * that must be built as part of this build process. This directories
27 * are not recursively processed like the SUBDIR command (cmSubdirCommand).
28 * A side effect of this command is to create a subdirectory in the build
29 * directory structure.
31 class cmAuxSourceDirectoryCommand
: public cmCommand
35 * This is a virtual constructor for the command.
37 virtual cmCommand
* Clone()
39 return new cmAuxSourceDirectoryCommand
;
43 * This is called when the command is first encountered in
44 * the CMakeLists.txt file.
46 virtual bool InitialPass(std::vector
<std::string
> const& args
,
47 cmExecutionStatus
&status
);
50 * The name of the command as specified in CMakeList.txt.
52 virtual const char* GetName() { return "aux_source_directory";}
55 * Succinct documentation.
57 virtual const char* GetTerseDocumentation()
59 return "Find all source files in a directory.";
65 virtual const char* GetFullDocumentation()
68 " aux_source_directory(<dir> <variable>)\n"
69 "Collects the names of all the source files in the specified "
70 "directory and stores the list in the <variable> provided. This "
71 "command is intended to be used by projects that use explicit "
72 "template instantiation. Template instantiation files can be "
73 "stored in a \"Templates\" subdirectory and collected automatically "
74 "using this command to avoid manually listing all instantiations.\n"
75 "It is tempting to use this command to avoid writing the list of "
76 "source files for a library or executable target. While this seems "
77 "to work, there is no way for CMake to generate a build system that "
78 "knows when a new source file has been added. Normally the "
79 "generated build system knows when it needs to rerun CMake because "
80 "the CMakeLists.txt file is modified to add a new source. When the "
81 "source is just added to the directory without modifying this file, "
82 "one would have to manually rerun CMake to generate a build system "
83 "incorporating the new file.";
86 cmTypeMacro(cmAuxSourceDirectoryCommand
, cmCommand
);