From 36e272843154c6ea475fd3c19a39a0d27dbcafa5 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 22 Mar 2006 11:15:35 -0500 Subject: ENH: Cleanup bootstrap even more --- Modules/CheckCSourceCompiles.cmake | 4 +-- Modules/CheckCXXSourceCompiles.cmake | 4 +-- Source/cmBootstrapCommands.cxx | 24 ------------- Source/cmCommands.cxx | 42 +++++++++++++++++----- Source/cmWriteFileCommand.cxx | 3 ++ .../cmxmlrpc/CMake/TryCompileFromSource.cmake | 4 +-- 6 files changed, 42 insertions(+), 39 deletions(-) diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index b08ea0a..6593aea 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -43,14 +43,14 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) IF(${VAR}) SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeOutput.log "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n" APPEND) ELSE(${VAR}) MESSAGE(STATUS "Performing Test ${VAR} - Failed") SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeError.log "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n" APPEND) diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index 2fcf38c..ede2254 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -43,14 +43,14 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) IF(${VAR}) SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n" APPEND) ELSE(${VAR}) MESSAGE(STATUS "Performing Test ${VAR} - Failed") SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${SOURCE}\n" APPEND) diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx index 2216515..c8769f0 100644 --- a/Source/cmBootstrapCommands.cxx +++ b/Source/cmBootstrapCommands.cxx @@ -22,16 +22,12 @@ #include "cmAddCustomCommandCommand.cxx" #include "cmAddCustomTargetCommand.cxx" #include "cmAddDefinitionsCommand.cxx" -#include "cmAddDependenciesCommand.cxx" #include "cmAddExecutableCommand.cxx" #include "cmAddLibraryCommand.cxx" -#include "cmAddSubDirectoryCommand.cxx" #include "cmAddTestCommand.cxx" #include "cmBuildCommand.cxx" -#include "cmBuildNameCommand.cxx" #include "cmCMakeMinimumRequired.cxx" #include "cmConfigureFileCommand.cxx" -#include "cmCreateTestSourceList.cxx" #include "cmElseCommand.cxx" #include "cmEnableTestingCommand.cxx" #include "cmEndForEachCommand.cxx" @@ -47,14 +43,11 @@ #include "cmForEachCommand.cxx" #include "cmGetCMakePropertyCommand.cxx" #include "cmGetFilenameComponentCommand.cxx" -#include "cmGetSourceFilePropertyCommand.cxx" -#include "cmGetTargetPropertyCommand.cxx" #include "cmIfCommand.cxx" #include "cmIncludeCommand.cxx" #include "cmIncludeDirectoryCommand.cxx" #include "cmIncludeRegularExpressionCommand.cxx" #include "cmInstallFilesCommand.cxx" -#include "cmInstallProgramsCommand.cxx" #include "cmInstallTargetsCommand.cxx" #include "cmLinkDirectoriesCommand.cxx" #include "cmMacroCommand.cxx" @@ -63,35 +56,26 @@ #include "cmMessageCommand.cxx" #include "cmOptionCommand.cxx" #include "cmProjectCommand.cxx" -#include "cmRemoveDefinitionsCommand.cxx" -#include "cmSeparateArgumentsCommand.cxx" #include "cmSetCommand.cxx" #include "cmSetSourceFilesPropertiesCommand.cxx" #include "cmSiteNameCommand.cxx" #include "cmStringCommand.cxx" #include "cmSubdirCommand.cxx" -#include "cmSubdirDependsCommand.cxx" #include "cmTargetLinkLibrariesCommand.cxx" #include "cmTryCompileCommand.cxx" #include "cmTryRunCommand.cxx" -#include "cmVariableRequiresCommand.cxx" -#include "cmWriteFileCommand.cxx" void GetBootstrapCommands(std::list& commands) { commands.push_back(new cmAddCustomCommandCommand); commands.push_back(new cmAddCustomTargetCommand); commands.push_back(new cmAddDefinitionsCommand); - commands.push_back(new cmAddDependenciesCommand); commands.push_back(new cmAddExecutableCommand); commands.push_back(new cmAddLibraryCommand); - commands.push_back(new cmAddSubDirectoryCommand); commands.push_back(new cmAddTestCommand); commands.push_back(new cmBuildCommand); - commands.push_back(new cmBuildNameCommand); commands.push_back(new cmCMakeMinimumRequired); commands.push_back(new cmConfigureFileCommand); - commands.push_back(new cmCreateTestSourceList); commands.push_back(new cmElseCommand); commands.push_back(new cmEnableTestingCommand); commands.push_back(new cmEndForEachCommand); @@ -106,14 +90,11 @@ void GetBootstrapCommands(std::list& commands) commands.push_back(new cmForEachCommand); commands.push_back(new cmGetCMakePropertyCommand); commands.push_back(new cmGetFilenameComponentCommand); - commands.push_back(new cmGetSourceFilePropertyCommand); - commands.push_back(new cmGetTargetPropertyCommand); commands.push_back(new cmIfCommand); commands.push_back(new cmIncludeCommand); commands.push_back(new cmIncludeDirectoryCommand); commands.push_back(new cmIncludeRegularExpressionCommand); commands.push_back(new cmInstallFilesCommand); - commands.push_back(new cmInstallProgramsCommand); commands.push_back(new cmInstallTargetsCommand); commands.push_back(new cmLinkDirectoriesCommand); commands.push_back(new cmMacroCommand); @@ -122,17 +103,12 @@ void GetBootstrapCommands(std::list& commands) commands.push_back(new cmMessageCommand); commands.push_back(new cmOptionCommand); commands.push_back(new cmProjectCommand); - commands.push_back(new cmRemoveDefinitionsCommand); - commands.push_back(new cmSeparateArgumentsCommand); commands.push_back(new cmSetCommand); commands.push_back(new cmSetSourceFilesPropertiesCommand); commands.push_back(new cmSiteNameCommand); commands.push_back(new cmStringCommand); commands.push_back(new cmSubdirCommand); - commands.push_back(new cmSubdirDependsCommand); commands.push_back(new cmTargetLinkLibrariesCommand); commands.push_back(new cmTryCompileCommand); commands.push_back(new cmTryRunCommand); - commands.push_back(new cmVariableRequiresCommand); - commands.push_back(new cmWriteFileCommand); } diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index 63f5f4d..2ad50b1 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -16,35 +16,47 @@ =========================================================================*/ #include "cmCommands.h" #if defined(CMAKE_BUILD_WITH_CMAKE) +#include "cmAddDependenciesCommand.cxx" +#include "cmAddSubDirectoryCommand.cxx" #include "cmAuxSourceDirectoryCommand.cxx" +#include "cmBuildNameCommand.cxx" +#include "cmCreateTestSourceList.cxx" +#include "cmEnableLanguageCommand.cxx" #include "cmEndWhileCommand.cxx" #include "cmExecuteProcessCommand.cxx" #include "cmExportLibraryDependencies.cxx" -#include "cmEnableLanguageCommand.cxx" #include "cmFLTKWrapUICommand.cxx" #include "cmGetDirectoryPropertyCommand.cxx" +#include "cmGetSourceFilePropertyCommand.cxx" +#include "cmGetTargetPropertyCommand.cxx" #include "cmGetTestPropertyCommand.cxx" #include "cmIncludeExternalMSProjectCommand.cxx" #include "cmInstallCommand.cxx" +#include "cmInstallProgramsCommand.cxx" #include "cmLinkLibrariesCommand.cxx" #include "cmListCommand.cxx" #include "cmLoadCacheCommand.cxx" #include "cmMathCommand.cxx" #include "cmOutputRequiredFilesCommand.cxx" +#include "cmQTWrapCPPCommand.cxx" +#include "cmQTWrapUICommand.cxx" #include "cmRemoveCommand.cxx" +#include "cmRemoveDefinitionsCommand.cxx" +#include "cmSeparateArgumentsCommand.cxx" #include "cmSetDirectoryPropertiesCommand.cxx" #include "cmSetTargetPropertiesCommand.cxx" #include "cmSetTestsPropertiesCommand.cxx" #include "cmSourceGroupCommand.cxx" +#include "cmSubdirDependsCommand.cxx" +#include "cmUseMangledMesaCommand.cxx" +#include "cmUtilitySourceCommand.cxx" #include "cmVTKMakeInstantiatorCommand.cxx" #include "cmVTKWrapJavaCommand.cxx" #include "cmVTKWrapPythonCommand.cxx" #include "cmVTKWrapTclCommand.cxx" -#include "cmQTWrapCPPCommand.cxx" -#include "cmQTWrapUICommand.cxx" -#include "cmUseMangledMesaCommand.cxx" -#include "cmUtilitySourceCommand.cxx" +#include "cmVariableRequiresCommand.cxx" #include "cmWhileCommand.cxx" +#include "cmWriteFileCommand.cxx" // This one must be last because it includes windows.h and // windows.h #defines GetCurrentDirectory which is a member @@ -59,35 +71,47 @@ void GetPredefinedCommands(std::list& ) { #if defined(CMAKE_BUILD_WITH_CMAKE) + commands.push_back(new cmAddDependenciesCommand); + commands.push_back(new cmAddSubDirectoryCommand); commands.push_back(new cmAuxSourceDirectoryCommand); + commands.push_back(new cmBuildNameCommand); + commands.push_back(new cmCreateTestSourceList); commands.push_back(new cmEnableLanguageCommand); commands.push_back(new cmEndWhileCommand); commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmFLTKWrapUICommand); commands.push_back(new cmGetDirectoryPropertyCommand); + commands.push_back(new cmGetSourceFilePropertyCommand); + commands.push_back(new cmGetTargetPropertyCommand); commands.push_back(new cmGetTestPropertyCommand); commands.push_back(new cmIncludeExternalMSProjectCommand); commands.push_back(new cmInstallCommand); + commands.push_back(new cmInstallProgramsCommand); commands.push_back(new cmLinkLibrariesCommand); commands.push_back(new cmListCommand); commands.push_back(new cmLoadCacheCommand); commands.push_back(new cmLoadCommandCommand); commands.push_back(new cmMathCommand); commands.push_back(new cmOutputRequiredFilesCommand); + commands.push_back(new cmQTWrapCPPCommand); + commands.push_back(new cmQTWrapUICommand); commands.push_back(new cmRemoveCommand); + commands.push_back(new cmRemoveDefinitionsCommand); + commands.push_back(new cmSeparateArgumentsCommand); commands.push_back(new cmSetDirectoryPropertiesCommand); commands.push_back(new cmSetTargetPropertiesCommand); commands.push_back(new cmSetTestsPropertiesCommand); commands.push_back(new cmSourceGroupCommand); + commands.push_back(new cmSubdirDependsCommand); + commands.push_back(new cmUseMangledMesaCommand); + commands.push_back(new cmUtilitySourceCommand); commands.push_back(new cmVTKMakeInstantiatorCommand); commands.push_back(new cmVTKWrapJavaCommand); commands.push_back(new cmVTKWrapPythonCommand); commands.push_back(new cmVTKWrapTclCommand); - commands.push_back(new cmQTWrapCPPCommand); - commands.push_back(new cmQTWrapUICommand); - commands.push_back(new cmUseMangledMesaCommand); - commands.push_back(new cmUtilitySourceCommand); + commands.push_back(new cmVariableRequiresCommand); commands.push_back(new cmWhileCommand); + commands.push_back(new cmWriteFileCommand); #endif } diff --git a/Source/cmWriteFileCommand.cxx b/Source/cmWriteFileCommand.cxx index 9093c04..6cbde0a 100644 --- a/Source/cmWriteFileCommand.cxx +++ b/Source/cmWriteFileCommand.cxx @@ -16,6 +16,9 @@ =========================================================================*/ #include "cmWriteFileCommand.h" +#include +#include + // cmLibraryCommand bool cmWriteFileCommand::InitialPass(std::vector const& args) { diff --git a/Utilities/cmxmlrpc/CMake/TryCompileFromSource.cmake b/Utilities/cmxmlrpc/CMake/TryCompileFromSource.cmake index 606520c..6cf5fac 100644 --- a/Utilities/cmxmlrpc/CMake/TryCompileFromSource.cmake +++ b/Utilities/cmxmlrpc/CMake/TryCompileFromSource.cmake @@ -29,14 +29,14 @@ MACRO(TRY_COMPILE_FROM_SOURCE SOURCE VAR) IF(${VAR}) SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" "${OUTPUT}\n" "Source file was:\n${src}\n" APPEND) ELSE(${VAR}) MESSAGE(STATUS "Performing Test ${VAR} - Failed") SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}") - WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" "${OUTPUT}\n" "Source file was:\n${src}\n" APPEND) -- cgit v0.12