Browse Source

Separate compilation for commands included in cmBootstrapCommands2

Daniel Pfeifer 9 years ago
parent
commit
608afd4f62

+ 88 - 0
Source/CMakeLists.txt

@@ -416,6 +416,8 @@ set(SRCS
   cmCMakePolicyCommand.h
   cmCommandArgumentsHelper.cxx
   cmCommandArgumentsHelper.h
+  cmConditionEvaluator.cxx
+  cmConditionEvaluator.h
   cmConfigureFileCommand.cxx
   cmConfigureFileCommand.h
   cmContinueCommand.cxx
@@ -446,6 +448,8 @@ set(SRCS
   cmExecProgramCommand.h
   cmExecuteProcessCommand.cxx
   cmExecuteProcessCommand.h
+  cmExpandedCommandArgument.cxx
+  cmExpandedCommandArgument.h
   cmFileCommand.cxx
   cmFileCommand.h
   cmFindBase.cxx
@@ -466,12 +470,96 @@ set(SRCS
   cmForEachCommand.h
   cmFunctionCommand.cxx
   cmFunctionCommand.h
+  cmGetCMakePropertyCommand.cxx
+  cmGetCMakePropertyCommand.h
+  cmGetDirectoryPropertyCommand.cxx
+  cmGetDirectoryPropertyCommand.h
+  cmGetFilenameComponentCommand.cxx
+  cmGetFilenameComponentCommand.h
+  cmGetPropertyCommand.cxx
+  cmGetPropertyCommand.h
+  cmGetSourceFilePropertyCommand.cxx
+  cmGetSourceFilePropertyCommand.h
+  cmGetTargetPropertyCommand.cxx
+  cmGetTargetPropertyCommand.h
+  cmGetTestPropertyCommand.cxx
+  cmGetTestPropertyCommand.h
+  cmHexFileConverter.cxx
+  cmHexFileConverter.h
+  cmIfCommand.cxx
+  cmIfCommand.h
+  cmIncludeCommand.cxx
+  cmIncludeCommand.h
+  cmIncludeDirectoryCommand.cxx
+  cmIncludeDirectoryCommand.h
+  cmIncludeRegularExpressionCommand.cxx
+  cmIncludeRegularExpressionCommand.h
+  cmInstallCommand.cxx
+  cmInstallCommand.h
+  cmInstallCommandArguments.cxx
+  cmInstallCommandArguments.h
+  cmInstallFilesCommand.cxx
+  cmInstallFilesCommand.h
+  cmInstallTargetsCommand.cxx
+  cmInstallTargetsCommand.h
+  cmLinkDirectoriesCommand.cxx
+  cmLinkDirectoriesCommand.h
+  cmListCommand.cxx
+  cmListCommand.h
+  cmMacroCommand.cxx
+  cmMacroCommand.h
+  cmMakeDirectoryCommand.cxx
+  cmMakeDirectoryCommand.h
+  cmMarkAsAdvancedCommand.cxx
+  cmMarkAsAdvancedCommand.h
+  cmMathCommand.cxx
+  cmMathCommand.h
+  cmMessageCommand.cxx
+  cmMessageCommand.h
+  cmOptionCommand.cxx
+  cmOptionCommand.h
   cmParseArgumentsCommand.cxx
   cmParseArgumentsCommand.h
   cmPathLabel.cxx
   cmPathLabel.h
+  cmProjectCommand.cxx
+  cmProjectCommand.h
+  cmReturnCommand.cxx
+  cmReturnCommand.h
   cmSearchPath.cxx
   cmSearchPath.h
+  cmSeparateArgumentsCommand.cxx
+  cmSeparateArgumentsCommand.h
+  cmSetCommand.cxx
+  cmSetCommand.h
+  cmSetDirectoryPropertiesCommand.cxx
+  cmSetDirectoryPropertiesCommand.h
+  cmSetPropertyCommand.cxx
+  cmSetPropertyCommand.h
+  cmSetSourceFilesPropertiesCommand.cxx
+  cmSetSourceFilesPropertiesCommand.h
+  cmSetTargetPropertiesCommand.cxx
+  cmSetTargetPropertiesCommand.h
+  cmSetTestsPropertiesCommand.cxx
+  cmSetTestsPropertiesCommand.h
+  cmSiteNameCommand.cxx
+  cmSiteNameCommand.h
+  cmStringCommand.cxx
+  cmStringCommand.h
+  cmSubdirCommand.cxx
+  cmSubdirCommand.h
+  cmTargetLinkLibrariesCommand.cxx
+  cmTargetLinkLibrariesCommand.h
+  cmTimestamp.cxx
+  cmTimestamp.h
+  cmTryCompileCommand.cxx
+  cmTryCompileCommand.h
+  cmTryRunCommand.cxx
+  cmTryRunCommand.h
+  cmUnsetCommand.cxx
+  cmUnsetCommand.h
+  cmWhileCommand.cxx
+  cmWhileCommand.h
 
   cm_auto_ptr.hxx
   cm_get_date.h

+ 44 - 44
Source/cmBootstrapCommands2.cxx

@@ -5,50 +5,50 @@
 // This is sort of a boot strapping approach since you would
 // like to have CMake to build CMake.
 #include "cmCommands.h"
-#include "cmConditionEvaluator.cxx"
-#include "cmExpandedCommandArgument.cxx"
-#include "cmGetCMakePropertyCommand.cxx"
-#include "cmGetDirectoryPropertyCommand.cxx"
-#include "cmGetFilenameComponentCommand.cxx"
-#include "cmGetPropertyCommand.cxx"
-#include "cmGetSourceFilePropertyCommand.cxx"
-#include "cmGetTargetPropertyCommand.cxx"
-#include "cmGetTestPropertyCommand.cxx"
-#include "cmHexFileConverter.cxx"
-#include "cmIfCommand.cxx"
-#include "cmIncludeCommand.cxx"
-#include "cmIncludeDirectoryCommand.cxx"
-#include "cmIncludeRegularExpressionCommand.cxx"
-#include "cmInstallCommand.cxx"
-#include "cmInstallCommandArguments.cxx"
-#include "cmInstallFilesCommand.cxx"
-#include "cmInstallTargetsCommand.cxx"
-#include "cmLinkDirectoriesCommand.cxx"
-#include "cmListCommand.cxx"
-#include "cmMacroCommand.cxx"
-#include "cmMakeDirectoryCommand.cxx"
-#include "cmMarkAsAdvancedCommand.cxx"
-#include "cmMathCommand.cxx"
-#include "cmMessageCommand.cxx"
-#include "cmOptionCommand.cxx"
-#include "cmProjectCommand.cxx"
-#include "cmReturnCommand.cxx"
-#include "cmSeparateArgumentsCommand.cxx"
-#include "cmSetCommand.cxx"
-#include "cmSetDirectoryPropertiesCommand.cxx"
-#include "cmSetPropertyCommand.cxx"
-#include "cmSetSourceFilesPropertiesCommand.cxx"
-#include "cmSetTargetPropertiesCommand.cxx"
-#include "cmSetTestsPropertiesCommand.cxx"
-#include "cmSiteNameCommand.cxx"
-#include "cmStringCommand.cxx"
-#include "cmSubdirCommand.cxx"
-#include "cmTargetLinkLibrariesCommand.cxx"
-#include "cmTimestamp.cxx"
-#include "cmTryCompileCommand.cxx"
-#include "cmTryRunCommand.cxx"
-#include "cmUnsetCommand.cxx"
-#include "cmWhileCommand.cxx"
+#include "cmConditionEvaluator.h"
+#include "cmExpandedCommandArgument.h"
+#include "cmGetCMakePropertyCommand.h"
+#include "cmGetDirectoryPropertyCommand.h"
+#include "cmGetFilenameComponentCommand.h"
+#include "cmGetPropertyCommand.h"
+#include "cmGetSourceFilePropertyCommand.h"
+#include "cmGetTargetPropertyCommand.h"
+#include "cmGetTestPropertyCommand.h"
+#include "cmHexFileConverter.h"
+#include "cmIfCommand.h"
+#include "cmIncludeCommand.h"
+#include "cmIncludeDirectoryCommand.h"
+#include "cmIncludeRegularExpressionCommand.h"
+#include "cmInstallCommand.h"
+#include "cmInstallCommandArguments.h"
+#include "cmInstallFilesCommand.h"
+#include "cmInstallTargetsCommand.h"
+#include "cmLinkDirectoriesCommand.h"
+#include "cmListCommand.h"
+#include "cmMacroCommand.h"
+#include "cmMakeDirectoryCommand.h"
+#include "cmMarkAsAdvancedCommand.h"
+#include "cmMathCommand.h"
+#include "cmMessageCommand.h"
+#include "cmOptionCommand.h"
+#include "cmProjectCommand.h"
+#include "cmReturnCommand.h"
+#include "cmSeparateArgumentsCommand.h"
+#include "cmSetCommand.h"
+#include "cmSetDirectoryPropertiesCommand.h"
+#include "cmSetPropertyCommand.h"
+#include "cmSetSourceFilesPropertiesCommand.h"
+#include "cmSetTargetPropertiesCommand.h"
+#include "cmSetTestsPropertiesCommand.h"
+#include "cmSiteNameCommand.h"
+#include "cmStringCommand.h"
+#include "cmSubdirCommand.h"
+#include "cmTargetLinkLibrariesCommand.h"
+#include "cmTimestamp.h"
+#include "cmTryCompileCommand.h"
+#include "cmTryRunCommand.h"
+#include "cmUnsetCommand.h"
+#include "cmWhileCommand.h"
 
 void GetBootstrapCommands2(std::vector<cmCommand*>& commands)
 {

+ 1 - 0
Source/cmGetCMakePropertyCommand.cxx

@@ -4,6 +4,7 @@
 
 #include "cmAlgorithms.h"
 #include "cmGlobalGenerator.h"
+#include "cmState.h"
 #include "cmStateTypes.h"
 #include "cmake.h"
 

+ 2 - 0
Source/cmGetDirectoryPropertyCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmGetDirectoryPropertyCommand.h"
 
+#include "cmGlobalGenerator.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // cmGetDirectoryPropertyCommand

+ 2 - 0
Source/cmHexFileConverter.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmHexFileConverter.h"
 
+#include "cmSystemTools.h"
+
 #include <stdio.h>
 #include <string.h>
 

+ 1 - 0
Source/cmIfCommand.cxx

@@ -4,6 +4,7 @@
 
 #include "cmOutputConverter.h"
 #include "cmStringCommand.h"
+#include "cmSystemTools.h"
 
 #include "cmConditionEvaluator.h"
 

+ 3 - 0
Source/cmIncludeCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmIncludeCommand.h"
 
+#include "cmGlobalGenerator.h"
+#include "cmSystemTools.h"
+
 // cmIncludeCommand
 bool cmIncludeCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)

+ 2 - 0
Source/cmIncludeDirectoryCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmIncludeDirectoryCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmIncludeDirectoryCommand
 bool cmIncludeDirectoryCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 2 - 0
Source/cmInstallCommand.cxx

@@ -3,12 +3,14 @@
 #include "cmInstallCommand.h"
 
 #include "cmExportSet.h"
+#include "cmGlobalGenerator.h"
 #include "cmInstallCommandArguments.h"
 #include "cmInstallDirectoryGenerator.h"
 #include "cmInstallExportGenerator.h"
 #include "cmInstallFilesGenerator.h"
 #include "cmInstallScriptGenerator.h"
 #include "cmInstallTargetGenerator.h"
+#include "cmSystemTools.h"
 #include "cmTargetExport.h"
 
 #include <cmsys/Glob.hxx>

+ 2 - 0
Source/cmInstallFilesCommand.cxx

@@ -2,7 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmInstallFilesCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmInstallFilesGenerator.h"
+#include "cmSystemTools.h"
 
 // cmExecutableCommand
 bool cmInstallFilesCommand::InitialPass(std::vector<std::string> const& args,

+ 2 - 0
Source/cmInstallTargetsCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmInstallTargetsCommand.h"
 
+#include "cmGlobalGenerator.h"
+
 // cmExecutableCommand
 bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)

+ 2 - 0
Source/cmLinkDirectoriesCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmLinkDirectoriesCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmLinkDirectoriesCommand
 bool cmLinkDirectoriesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 1 - 0
Source/cmListCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmListCommand.h"
 
 #include "cmAlgorithms.h"
+#include "cmSystemTools.h"
 #include <cmsys/RegularExpression.hxx>
 #include <cmsys/SystemTools.hxx>
 

+ 2 - 0
Source/cmMacroCommand.cxx

@@ -3,6 +3,8 @@
 #include "cmMacroCommand.h"
 
 #include "cmAlgorithms.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
 #include "cmake.h"
 
 // define the class for macro commands

+ 2 - 0
Source/cmMakeDirectoryCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmMakeDirectoryCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmMakeDirectoryCommand
 bool cmMakeDirectoryCommand::InitialPass(std::vector<std::string> const& args,
                                          cmExecutionStatus&)

+ 3 - 0
Source/cmMarkAsAdvancedCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmMarkAsAdvancedCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmMarkAsAdvancedCommand
 bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args,
                                           cmExecutionStatus&)

+ 1 - 0
Source/cmMessageCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmMessageCommand.h"
 
 #include "cmMessenger.h"
+#include "cmSystemTools.h"
 
 // cmLibraryCommand
 bool cmMessageCommand::InitialPass(std::vector<std::string> const& args,

+ 3 - 0
Source/cmOptionCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmOptionCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmOptionCommand
 bool cmOptionCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)

+ 2 - 0
Source/cmProjectCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmProjectCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmProjectCommand
 bool cmProjectCommand::InitialPass(std::vector<std::string> const& args,
                                    cmExecutionStatus&)

+ 2 - 0
Source/cmReturnCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmReturnCommand.h"
 
+#include "cmExecutionStatus.h"
+
 // cmReturnCommand
 bool cmReturnCommand::InitialPass(std::vector<std::string> const&,
                                   cmExecutionStatus& status)

+ 2 - 0
Source/cmSeparateArgumentsCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSeparateArgumentsCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmSeparateArgumentsCommand
 bool cmSeparateArgumentsCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)

+ 3 - 0
Source/cmSetCommand.cxx

@@ -2,6 +2,9 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSetCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
+
 // cmSetCommand
 bool cmSetCommand::InitialPass(std::vector<std::string> const& args,
                                cmExecutionStatus&)

+ 4 - 0
Source/cmSetPropertyCommand.cxx

@@ -2,9 +2,13 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSetPropertyCommand.h"
 
+#include "cmGlobalGenerator.h"
 #include "cmSetSourceFilesPropertiesCommand.h"
 #include "cmSetTargetPropertiesCommand.h"
 #include "cmSetTestsPropertiesCommand.h"
+#include "cmSourceFile.h"
+#include "cmState.h"
+#include "cmTest.h"
 
 cmSetPropertyCommand::cmSetPropertyCommand()
 {

+ 1 - 0
Source/cmSetSourceFilesPropertiesCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmSetSourceFilesPropertiesCommand.h"
 
 #include "cmSourceFile.h"
+#include "cmSystemTools.h"
 
 // cmSetSourceFilesPropertiesCommand
 bool cmSetSourceFilesPropertiesCommand::InitialPass(

+ 2 - 0
Source/cmSiteNameCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSiteNameCommand.h"
 
+#include "cmSystemTools.h"
+
 #include <cmsys/RegularExpression.hxx>
 
 // cmSiteNameCommand

+ 1 - 0
Source/cmStringCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmStringCommand.h"
 
 #include "cmCryptoHash.h"
+#include "cmSystemTools.h"
 
 #include <cmsys/RegularExpression.hxx>
 #include <cmsys/SystemTools.hxx>

+ 2 - 0
Source/cmSubdirCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmSubdirCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmSubdirCommand
 bool cmSubdirCommand::InitialPass(std::vector<std::string> const& args,
                                   cmExecutionStatus&)

+ 3 - 0
Source/cmTargetLinkLibrariesCommand.cxx

@@ -3,6 +3,9 @@
 #include "cmTargetLinkLibrariesCommand.h"
 
 #include "cmGeneratorExpression.h"
+#include "cmGlobalGenerator.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
 
 const char* cmTargetLinkLibrariesCommand::LinkLibraryTypeNames[3] = {
   "general", "debug", "optimized"

+ 2 - 0
Source/cmTimestamp.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmTimestamp.h"
 
+#include "cmSystemTools.h"
+
 #include <cstdlib>
 #include <cstring>
 #include <sstream>

+ 3 - 0
Source/cmTryRunCommand.cxx

@@ -2,7 +2,10 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmTryRunCommand.h"
 
+#include "cmState.h"
+#include "cmSystemTools.h"
 #include "cmTryCompileCommand.h"
+
 #include <cmsys/FStream.hxx>
 
 // cmTryRunCommand

+ 2 - 0
Source/cmUnsetCommand.cxx

@@ -2,6 +2,8 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmUnsetCommand.h"
 
+#include "cmSystemTools.h"
+
 // cmUnsetCommand
 bool cmUnsetCommand::InitialPass(std::vector<std::string> const& args,
                                  cmExecutionStatus&)

+ 1 - 0
Source/cmWhileCommand.cxx

@@ -3,6 +3,7 @@
 #include "cmWhileCommand.h"
 
 #include "cmConditionEvaluator.h"
+#include "cmSystemTools.h"
 
 cmWhileFunctionBlocker::cmWhileFunctionBlocker(cmMakefile* mf)
   : Makefile(mf)

+ 44 - 6
bootstrap

@@ -368,6 +368,50 @@ CMAKE_CXX_SOURCES="\
   cmParseArgumentsCommand \
   cmPathLabel \
   cmSearchPath \
+  cmConditionEvaluator \
+  cmExpandedCommandArgument \
+  cmGetCMakePropertyCommand \
+  cmGetDirectoryPropertyCommand \
+  cmGetFilenameComponentCommand \
+  cmGetPropertyCommand \
+  cmGetSourceFilePropertyCommand \
+  cmGetTargetPropertyCommand \
+  cmGetTestPropertyCommand \
+  cmHexFileConverter \
+  cmIfCommand \
+  cmIncludeCommand \
+  cmIncludeDirectoryCommand \
+  cmIncludeRegularExpressionCommand \
+  cmInstallCommand \
+  cmInstallCommandArguments \
+  cmInstallFilesCommand \
+  cmInstallTargetsCommand \
+  cmLinkDirectoriesCommand \
+  cmListCommand \
+  cmMacroCommand \
+  cmMakeDirectoryCommand \
+  cmMarkAsAdvancedCommand \
+  cmMathCommand \
+  cmMessageCommand \
+  cmOptionCommand \
+  cmProjectCommand \
+  cmReturnCommand \
+  cmSeparateArgumentsCommand \
+  cmSetCommand \
+  cmSetDirectoryPropertiesCommand \
+  cmSetPropertyCommand \
+  cmSetSourceFilesPropertiesCommand \
+  cmSetTargetPropertiesCommand \
+  cmSetTestsPropertiesCommand \
+  cmSiteNameCommand \
+  cmStringCommand \
+  cmSubdirCommand \
+  cmTargetLinkLibrariesCommand \
+  cmTimestamp \
+  cmTryCompileCommand \
+  cmTryRunCommand \
+  cmUnsetCommand \
+  cmWhileCommand \
 "
 
 if ${cmake_system_mingw}; then
@@ -1363,12 +1407,6 @@ for a in ${CMAKE_CXX_SOURCES} ${CMAKE_C_SOURCES} ${KWSYS_CXX_SOURCES} ${KWSYS_C_
   objs="${objs} ${a}.o"
 done
 
-# Generate dependencies for cmBootstrapCommands1.cxx
-for file in `grep "#include.*cm[^.]*.cxx" "${cmake_source_dir}/Source/cmBootstrapCommands2.cxx" | sed "s/.* \"\(.*\)\"/\1/"`; do
-  cmBootstrapCommands2Deps="${cmBootstrapCommands2Deps} `cmake_escape "${cmake_source_dir}/Source/$file"`"
-done
-cmBootstrapCommands2Deps=`echo $cmBootstrapCommands2Deps`
-
 if [ "x${cmake_ansi_cxx_flags}" != "x" ]; then
   cmake_cxx_flags="${cmake_ansi_cxx_flags} ${cmake_cxx_flags}"
 fi