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 cmCreateTestSourceList_h
13 #define cmCreateTestSourceList_h
15 #include "cmCommand.h"
17 /** \class cmCreateTestSourceList
22 class cmCreateTestSourceList : public cmCommand
26 * This is a virtual constructor for the command.
28 virtual cmCommand* Clone()
30 return new cmCreateTestSourceList;
34 * This is called when the command is first encountered in
35 * the CMakeLists.txt file.
37 virtual bool InitialPass(std::vector<std::string> const& args,
38 cmExecutionStatus &status);
41 * The name of the command as specified in CMakeList.txt.
43 virtual const char* GetName() const {return "create_test_sourcelist";}
46 * Succinct documentation.
48 virtual const char* GetTerseDocumentation() const
50 return "Create a test driver and source list for building test programs.";
56 virtual const char* GetFullDocumentation() const
59 " create_test_sourcelist(sourceListName driverName\n"
60 " test1 test2 test3\n"
61 " EXTRA_INCLUDE include.h\n"
62 " FUNCTION function)\n"
63 "A test driver is a program that links together many small tests into "
64 "a single executable. This is useful when building static executables "
65 "with large libraries to shrink the total required size. "
66 "The list of source files "
67 "needed to build the test driver will be in sourceListName. "
68 "DriverName is the name of the test driver program. The rest of "
69 "the arguments consist of a list of test source files, can be "
70 "semicolon separated. Each test source file should have a function in "
71 "it that is the same name as the file with no extension (foo.cxx "
72 "should have int foo(int, char*[]);) DriverName will be able to "
74 "tests by name on the command line. If EXTRA_INCLUDE is specified, "
75 "then the next argument is included into the generated file. If "
76 "FUNCTION is specified, then the next argument is taken as a function "
77 "name that is passed a pointer to ac and av. This can be used to add "
78 "extra command line processing to each test. The cmake variable "
79 "CMAKE_TESTDRIVER_BEFORE_TESTMAIN can be set to have code that will be "
80 "placed directly before calling the test main function. "
81 "CMAKE_TESTDRIVER_AFTER_TESTMAIN can be set to have code that will be "
82 "placed directly after the call to the test main function.";
85 cmTypeMacro(cmCreateTestSourceList, cmCommand);