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 cmAuxSourceDirectoryCommand_h
13 #define cmAuxSourceDirectoryCommand_h
15 #include "cmCommand.h"
17 /** \class cmAuxSourceDirectoryCommand
18 * \brief Specify auxiliary source code directories.
20 * cmAuxSourceDirectoryCommand specifies source code directories
21 * that must be built as part of this build process. This directories
22 * are not recursively processed like the SUBDIR command (cmSubdirCommand).
23 * A side effect of this command is to create a subdirectory in the build
24 * directory structure.
26 class cmAuxSourceDirectoryCommand : public cmCommand
30 * This is a virtual constructor for the command.
32 virtual cmCommand* Clone()
34 return new cmAuxSourceDirectoryCommand;
38 * This is called when the command is first encountered in
39 * the CMakeLists.txt file.
41 virtual bool InitialPass(std::vector<std::string> const& args,
42 cmExecutionStatus &status);
45 * The name of the command as specified in CMakeList.txt.
47 virtual const char* GetName() const { return "aux_source_directory";}
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation() const
54 return "Find all source files in a directory.";
60 virtual const char* GetFullDocumentation() const
63 " aux_source_directory(<dir> <variable>)\n"
64 "Collects the names of all the source files in the specified "
65 "directory and stores the list in the <variable> provided. This "
66 "command is intended to be used by projects that use explicit "
67 "template instantiation. Template instantiation files can be "
68 "stored in a \"Templates\" subdirectory and collected automatically "
69 "using this command to avoid manually listing all instantiations.\n"
70 "It is tempting to use this command to avoid writing the list of "
71 "source files for a library or executable target. While this seems "
72 "to work, there is no way for CMake to generate a build system that "
73 "knows when a new source file has been added. Normally the "
74 "generated build system knows when it needs to rerun CMake because "
75 "the CMakeLists.txt file is modified to add a new source. When the "
76 "source is just added to the directory without modifying this file, "
77 "one would have to manually rerun CMake to generate a build system "
78 "incorporating the new file.";
81 cmTypeMacro(cmAuxSourceDirectoryCommand, cmCommand);