diff options
-rw-r--r-- | ChangeLog.manual | 12 | ||||
-rw-r--r-- | Modules/CheckCSourceCompiles.cmake | 8 | ||||
-rw-r--r-- | Modules/CheckCXXSourceCompiles.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 18 | ||||
-rw-r--r-- | Source/cmBootstrapCommands.cxx | 2 | ||||
-rw-r--r-- | Source/cmCommands.cxx | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmLocalGenerator.h | 1 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 20 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 206 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.h | 3 | ||||
-rw-r--r-- | Source/cmMakefileExecutableTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmMakefileLibraryTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmakemain.cxx | 3 | ||||
-rw-r--r-- | Templates/CPack.GenericDescription.txt | 71 | ||||
-rw-r--r-- | Templates/CPack.GenericLicense.txt | 12 | ||||
-rw-r--r-- | Templates/CPack.GenericWelcome.txt | 3 | ||||
-rw-r--r-- | Templates/DLLHeader.dsptemplate | 12 | ||||
-rw-r--r-- | Templates/EXEHeader.dsptemplate | 12 | ||||
-rw-r--r-- | Templates/EXEWinHeader.dsptemplate | 13 |
21 files changed, 237 insertions, 198 deletions
diff --git a/ChangeLog.manual b/ChangeLog.manual index eef126f..081bb38 100644 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,15 @@ +Changes in CMake 2.4.1 + +* Fix check c/cxx source compiles macros to not clobber log files + +* Fix nmake version detection of cl and create correct pdb files + +* Fix msys bootstrap + +* Change color output to be more readable + +* Fix vs6 library naming + Changes in CMake 2.4.0 * CPack beta diff --git a/Modules/CheckCSourceCompiles.cmake b/Modules/CheckCSourceCompiles.cmake index 6593aea..35a4bdc 100644 --- a/Modules/CheckCSourceCompiles.cmake +++ b/Modules/CheckCSourceCompiles.cmake @@ -43,17 +43,17 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) IF(${VAR}) SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeOutput.log + FILE(APPEND ${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) + "Source file was:\n${SOURCE}\n") ELSE(${VAR}) MESSAGE(STATUS "Performing Test ${VAR} - Failed") SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}") - FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeError.log + FILE(APPEND ${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) + "Source file was:\n${SOURCE}\n") ENDIF(${VAR}) ENDIF("${VAR}" MATCHES "^${VAR}$") ENDMACRO(CHECK_C_SOURCE_COMPILES) diff --git a/Modules/CheckCXXSourceCompiles.cmake b/Modules/CheckCXXSourceCompiles.cmake index ede2254..30a97af 100644 --- a/Modules/CheckCXXSourceCompiles.cmake +++ b/Modules/CheckCXXSourceCompiles.cmake @@ -43,17 +43,17 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) IF(${VAR}) SET(${VAR} 1 CACHE INTERNAL "Test ${FUNCTION}") MESSAGE(STATUS "Performing Test ${VAR} - Success") - FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeOutput.log + FILE(APPEND ${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) + "Source file was:\n${SOURCE}\n") ELSE(${VAR}) MESSAGE(STATUS "Performing Test ${VAR} - Failed") SET(${VAR} "" CACHE INTERNAL "Test ${FUNCTION}") - FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + FILE(APPEND ${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) + "Source file was:\n${SOURCE}\n") ENDIF(${VAR}) ENDIF("${VAR}" MATCHES "^${VAR}$") ENDMACRO(CHECK_CXX_SOURCE_COMPILES) diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index 1021f78..5da4721 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -14,7 +14,7 @@ ELSE(CMAKE_VERBOSE_MAKEFILE) ENDIF(CMAKE_VERBOSE_MAKEFILE) # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") + "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /PDB:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") SET(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_LIBRARY}") # create a C shared library @@ -31,18 +31,18 @@ SET(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}") # compile a C++ file into an object file SET(CMAKE_CXX_COMPILE_OBJECT - "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}") + "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}") # compile a C file into an object file SET(CMAKE_C_COMPILE_OBJECT - "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /Fo<OBJECT> -c <SOURCE>${CMAKE_END_TEMP_FILE}") + "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}") SET(CMAKE_C_LINK_EXECUTABLE - "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + "<CMAKE_C_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> /Fd<TARGET_PDB> -link <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") SET(CMAKE_CXX_LINK_EXECUTABLE - "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") + "<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> /Fd<TARGET_PDB> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}") SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) @@ -78,7 +78,7 @@ SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>") # that is automatically copied into try_compile directories # by the global generator. SET(MSVC_IDE 1) -IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") +IF(CMAKE_GENERATOR MATCHES "Makefiles") SET(MSVC_IDE 0) IF(NOT CMAKE_VC_COMPILER_TESTS_RUN) SET(CMAKE_VC_COMPILER_TESTS 1) @@ -116,6 +116,10 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") SET(MSVC71 1) SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0) ENDIF("${compilerVersion}" EQUAL 1310) + IF("${compilerVersion}" EQUAL 1400) + SET(MSVC80 1) + SET(CMAKE_COMPILER_2005 1) + ENDIF("${compilerVersion}" EQUAL 1400) IF("${compilerVersion}" GREATER 1400) SET(MSVC80 1) SET(CMAKE_COMPILER_2005 1) @@ -179,7 +183,7 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles") SET(CMAKE_CL_64 0) ENDIF(CMAKE_COMPILER_RETURN) ENDIF(NOT CMAKE_VC_COMPILER_TESTS_RUN) -ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles") +ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_FORCE_WIN64) SET(CMAKE_CL_64 1) diff --git a/Source/cmBootstrapCommands.cxx b/Source/cmBootstrapCommands.cxx index 7eafd34..a25da04 100644 --- a/Source/cmBootstrapCommands.cxx +++ b/Source/cmBootstrapCommands.cxx @@ -22,6 +22,7 @@ #include "cmAddCustomCommandCommand.cxx" #include "cmAddCustomTargetCommand.cxx" #include "cmAddDefinitionsCommand.cxx" +#include "cmAddDependenciesCommand.cxx" #include "cmAddExecutableCommand.cxx" #include "cmAddLibraryCommand.cxx" #include "cmAddTestCommand.cxx" @@ -71,6 +72,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& 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 cmAddTestCommand); diff --git a/Source/cmCommands.cxx b/Source/cmCommands.cxx index f3bf189..26b098a 100644 --- a/Source/cmCommands.cxx +++ b/Source/cmCommands.cxx @@ -16,7 +16,6 @@ =========================================================================*/ #include "cmCommands.h" #if defined(CMAKE_BUILD_WITH_CMAKE) -#include "cmAddDependenciesCommand.cxx" #include "cmAddSubDirectoryCommand.cxx" #include "cmAuxSourceDirectoryCommand.cxx" #include "cmBuildNameCommand.cxx" @@ -70,7 +69,6 @@ void GetPredefinedCommands(std::list<cmCommand*>& ) { #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); diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 765e720..6ada0d9 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -734,6 +734,14 @@ cmLocalGenerator::ExpandRuleVariable(std::string const& variable, return replaceValues.ObjectsQuoted; } } + if(replaceValues.TargetPDB ) + { + if(variable == "TARGET_PDB") + { + return replaceValues.TargetPDB; + } + } + if(replaceValues.Target) { if(variable == "TARGET_QUOTED") diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h index 4db28f5..ccc9bef 100644 --- a/Source/cmLocalGenerator.h +++ b/Source/cmLocalGenerator.h @@ -192,6 +192,7 @@ public: this->TargetInstallNameDir = 0; this->LinkFlags= 0; } + const char* TargetPDB; const char* Language; const char* Objects; const char* Target; diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 9ae5439..865f5a9 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -876,7 +876,7 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, EchoColor color) { // Choose the color for the text. - const char* prefix = 0; + std::string prefix; if(this->GlobalGenerator->GetToolSupportsColorVT100() && this->Makefile->IsOn("CMAKE_COLOR_MAKEFILE")) { @@ -885,23 +885,23 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, case EchoNormal: break; case EchoDepend: - prefix = CMAKE_VT100_FRONT_MAGENTA CMAKE_VT100_BOLD; + prefix = CMAKE_VT100_FRONT_MAGENTA; break; case EchoBuild: - prefix = CMAKE_VT100_FRONT_GREEN CMAKE_VT100_BOLD; + prefix = CMAKE_VT100_FRONT_GREEN; break; case EchoLink: - prefix = CMAKE_VT100_FRONT_YELLOW CMAKE_VT100_BOLD; + prefix = CMAKE_VT100_FRONT_RED; break; case EchoGenerate: - prefix = CMAKE_VT100_FRONT_BLUE CMAKE_VT100_BOLD; + prefix = CMAKE_VT100_FRONT_BLUE; break; case EchoGlobal: - prefix = CMAKE_VT100_FRONT_CYAN CMAKE_VT100_BOLD; + prefix = CMAKE_VT100_FRONT_CYAN; break; } } - const char* suffix = prefix? CMAKE_VT100_NORMAL : 0; + std::string suffix = prefix.empty()? "" : CMAKE_VT100_NORMAL; // Echo one line at a time. std::string line; @@ -919,15 +919,9 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, { cmd += "\""; } - if(prefix) - { cmd += prefix; - } cmd += line; - if(suffix) - { cmd += suffix; - } if(this->EchoNeedsQuote) { cmd += "\""; diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 7310953..5b4ad7e 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -799,12 +799,45 @@ inline std::string removeQuotes(const std::string& s) return s; } +// Code in blocks surrounded by a test for this definition is needed +// only for compatibility with user project's replacement DSP +// templates. The CMake templates no longer use them. +#define CM_USE_OLD_VS6 void cmLocalVisualStudio6Generator ::WriteDSPHeader(std::ostream& fout, const char *libName, cmTarget &target, std::vector<cmSourceGroup> &) { + // Lookup the library and executable output directories. + std::string libPath; + if(this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) + { + libPath = this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); + } + std::string exePath; + if(this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) + { + exePath = this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); + } + + // Make sure there are trailing slashes. + if(!libPath.empty()) + { + if(libPath[libPath.size()-1] != '/') + { + libPath += "/"; + } + } + if(!exePath.empty()) + { + if(exePath[exePath.size()-1] != '/') + { + exePath += "/"; + } + } + +#ifdef CM_USE_OLD_VS6 std::set<std::string> pathEmitted; // determine the link directories @@ -817,25 +850,8 @@ void cmLocalVisualStudio6Generator std::string libMultiLineDebugOptions; std::string libMultiLineOptimizedOptions; - // suppoirt override in output directory - std::string libPath = ""; - if (this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH")) - { - libPath = this->Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); - } - std::string exePath = ""; - if (this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH")) - { - exePath = this->Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"); - - } if(libPath.size()) { - // make sure there is a trailing slash - if(libPath[libPath.size()-1] != '/') - { - libPath += "/"; - } std::string lpath = this->ConvertToOptionallyRelativeOutputPath(libPath.c_str()); if(lpath.size() == 0) @@ -868,11 +884,6 @@ void cmLocalVisualStudio6Generator } if(exePath.size()) { - // make sure there is a trailing slash - if(exePath[exePath.size()-1] != '/') - { - exePath += "/"; - } std::string lpath = this->ConvertToOptionallyRelativeOutputPath(exePath.c_str()); if(lpath.size() == 0) @@ -1013,13 +1024,13 @@ void cmLocalVisualStudio6Generator } } } +#endif // Get extra linker options for this target type. std::string extraLinkOptions; if(target.GetType() == cmTarget::EXECUTABLE) { - extraLinkOptions = - this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); + extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_EXE_LINKER_FLAGS"); } if(target.GetType() == cmTarget::SHARED_LIBRARY) { @@ -1030,36 +1041,14 @@ void cmLocalVisualStudio6Generator extraLinkOptions = this->Makefile->GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS"); } - // Compute the real name of the target. - std::string outputName = "(OUTPUT_NAME is for libraries and executables only)"; - std::string outputNameDebug = outputName; - std::string outputNameRelease = outputName; - std::string outputNameMinSizeRel = outputName; - std::string outputNameRelWithDebInfo = outputName; - if(target.GetType() == cmTarget::EXECUTABLE || - target.GetType() == cmTarget::STATIC_LIBRARY || - target.GetType() == cmTarget::SHARED_LIBRARY || - target.GetType() == cmTarget::MODULE_LIBRARY) + // Get extra linker options for this target. + if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS")) { - outputName = target.GetFullName(); - outputNameDebug = target.GetFullName("Debug"); - outputNameRelease = target.GetFullName("Release"); - outputNameMinSizeRel = target.GetFullName("MinSizeRel"); - outputNameRelWithDebInfo = target.GetFullName("RelWithDebInfo"); + extraLinkOptions += " "; + extraLinkOptions += targetLinkFlags; } - if(extraLinkOptions.size()) - { - libOptions += " "; - libOptions += extraLinkOptions; - libOptions += " "; - libMultiLineOptions += "# ADD LINK32 "; - libMultiLineOptions += extraLinkOptions; - libMultiLineOptions += " \n"; - libMultiLineOptionsForDebug += "# ADD LINK32 "; - libMultiLineOptionsForDebug += extraLinkOptions; - libMultiLineOptionsForDebug += " \n"; - } + // Get standard libraries for this language. if(target.GetType() >= cmTarget::EXECUTABLE && target.GetType() <= cmTarget::MODULE_LIBRARY) { @@ -1082,29 +1071,63 @@ void cmLocalVisualStudio6Generator if(const char* stdLibs = this->Makefile->GetDefinition(standardLibsVar.c_str())) { - libOptions += " "; - libOptions += stdLibs; - libOptions += " "; - libMultiLineOptions += "# ADD LINK32 "; - libMultiLineOptions += stdLibs; - libMultiLineOptions += " \n"; - libMultiLineOptionsForDebug += "# ADD LINK32 "; - libMultiLineOptionsForDebug += stdLibs; - libMultiLineOptionsForDebug += " \n"; + extraLinkOptions += " "; + extraLinkOptions += stdLibs; } } - if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS")) + + // Compute the real name of the target. + std::string outputName = "(OUTPUT_NAME is for libraries and executables only)"; + std::string outputNameDebug = outputName; + std::string outputNameRelease = outputName; + std::string outputNameMinSizeRel = outputName; + std::string outputNameRelWithDebInfo = outputName; + if(target.GetType() == cmTarget::EXECUTABLE || + target.GetType() == cmTarget::STATIC_LIBRARY || + target.GetType() == cmTarget::SHARED_LIBRARY || + target.GetType() == cmTarget::MODULE_LIBRARY) + { + outputName = target.GetFullName(); + outputNameDebug = target.GetFullName("Debug"); + outputNameRelease = target.GetFullName("Release"); + outputNameMinSizeRel = target.GetFullName("MinSizeRel"); + outputNameRelWithDebInfo = target.GetFullName("RelWithDebInfo"); + } + + // Compute the proper link information for the target. + std::string optionsDebug; + std::string optionsRelease; + std::string optionsMinSizeRel; + std::string optionsRelWithDebInfo; + if(target.GetType() == cmTarget::EXECUTABLE || + target.GetType() == cmTarget::SHARED_LIBRARY || + target.GetType() == cmTarget::MODULE_LIBRARY) + { + this->ComputeLinkOptions(target, "Debug", extraLinkOptions, + optionsDebug); + this->ComputeLinkOptions(target, "Release", extraLinkOptions, + optionsRelease); + this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptions, + optionsMinSizeRel); + this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptions, + optionsRelWithDebInfo); + } + +#ifdef CM_USE_OLD_VS6 + // Compute link information for the target. + if(extraLinkOptions.size()) { libOptions += " "; - libOptions += targetLinkFlags; + libOptions += extraLinkOptions; libOptions += " "; libMultiLineOptions += "# ADD LINK32 "; - libMultiLineOptions += targetLinkFlags; + libMultiLineOptions += extraLinkOptions; libMultiLineOptions += " \n"; libMultiLineOptionsForDebug += "# ADD LINK32 "; - libMultiLineOptionsForDebug += targetLinkFlags; + libMultiLineOptionsForDebug += extraLinkOptions; libMultiLineOptionsForDebug += " \n"; } +#endif // are there any custom rules on the target itself // only if the target is a lib or exe @@ -1160,6 +1183,7 @@ void cmLocalVisualStudio6Generator cmSystemTools::ReplaceString(line, "/nologo", ""); } +#ifdef CM_USE_OLD_VS6 cmSystemTools::ReplaceString(line, "CM_LIBRARIES", libOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_DEBUG_LIBRARIES", @@ -1174,6 +1198,7 @@ void cmLocalVisualStudio6Generator libMultiLineDebugOptions.c_str()); cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIMIZED_LIBRARIES", libMultiLineOptimizedOptions.c_str()); +#endif // Substitute the real output name into the template. cmSystemTools::ReplaceString(line, "OUTPUT_NAME_DEBUG", outputNameDebug.c_str()); @@ -1182,6 +1207,12 @@ void cmLocalVisualStudio6Generator cmSystemTools::ReplaceString(line, "OUTPUT_NAME_RELWITHDEBINFO", outputNameRelWithDebInfo.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_NAME", outputName.c_str()); + // Substitute the proper link information into the template. + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_DEBUG", optionsDebug.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELEASE", optionsRelease.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_MINSIZEREL", optionsMinSizeRel.c_str()); + cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO", optionsRelWithDebInfo.c_str()); + cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", this->IncludeOptions.c_str()); cmSystemTools::ReplaceString(line, "OUTPUT_LIBNAME",libName); @@ -1305,3 +1336,50 @@ void cmLocalVisualStudio6Generator::WriteDSPFooter(std::ostream& fout) fout << line << std::endl; } } + +//----------------------------------------------------------------------------- +void cmLocalVisualStudio6Generator::ComputeLinkOptions(cmTarget& target, + const char* configName, + const std::string extraOptions, + std::string& options) +{ + // Compute the link information for this configuration. + std::vector<cmStdString> linkLibs; + std::vector<cmStdString> linkDirs; + this->ComputeLinkInformation(target, configName, linkLibs, linkDirs); + + // Build the link options code. + for(std::vector<cmStdString>::const_iterator d = linkDirs.begin(); + d != linkDirs.end(); ++d) + { + std::string dir = *d; + if(!dir.empty()) + { + if(dir[dir.size()-1] != '/') + { + dir += "/"; + } + dir += "$(IntDir)"; + options += "# ADD LINK32 /LIBPATH:"; + options += this->ConvertToOptionallyRelativeOutputPath(dir.c_str()); + options += " /LIBPATH:"; + options += this->ConvertToOptionallyRelativeOutputPath(d->c_str()); + options += "\n"; + } + } + for(std::vector<cmStdString>::const_iterator l = linkLibs.begin(); + l != linkLibs.end(); ++l) + { + options += "# ADD LINK32 "; + options += this->ConvertToOptionallyRelativeOutputPath(l->c_str()); + options += "\n"; + } + + // Add extra options if any. + if(!extraOptions.empty()) + { + options += "# ADD LINK32 "; + options += extraOptions; + options += "\n"; + } +} diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h index cfa49ac..f2b4d13 100644 --- a/Source/cmLocalVisualStudio6Generator.h +++ b/Source/cmLocalVisualStudio6Generator.h @@ -94,6 +94,9 @@ private: std::ostream &fout, const char *libName); std::string CreateTargetRules(cmTarget &target, const char *libName); + void ComputeLinkOptions(cmTarget& target, const char* configName, + const std::string extraOptions, + std::string& options); std::string IncludeOptions; std::vector<std::string> Configurations; }; diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 37c664c..f847c3a 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -168,7 +168,12 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) } std::string targetFullPath = outpath + targetName; std::string targetFullPathReal = outpath + targetNameReal; - + std::string targetFullPathPDB = outpath + this->Target->GetName(); + targetFullPathPDB += ".pdb"; + std::string targetOutPathPDB = + this->Convert(targetFullPathPDB.c_str(), + cmLocalGenerator::FULL, + cmLocalGenerator::MAKEFILE); // Convert to the output path to use in constructing commands. std::string targetOutPath = this->Convert(targetFullPath.c_str(), @@ -328,6 +333,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) vars.Language = linkLanguage; vars.Objects = buildObjs.c_str(); vars.Target = targetOutPathReal.c_str(); + vars.TargetPDB = targetOutPathPDB.c_str(); std::string linkString = linklibs.str(); vars.LinkLibraries = linkString.c_str(); vars.Flags = flags.c_str(); diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx index 9140d31..fac4513 100644 --- a/Source/cmMakefileLibraryTargetGenerator.cxx +++ b/Source/cmMakefileLibraryTargetGenerator.cxx @@ -233,12 +233,16 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules outpath += "/"; } std::string targetFullPath = outpath + targetName; + std::string targetFullPathPDB = outpath + this->Target->GetName() + std::string(".pdb"); std::string targetFullPathSO = outpath + targetNameSO; std::string targetFullPathReal = outpath + targetNameReal; std::string targetFullPathImport = outpath + targetNameImport; // Construct the output path version of the names for use in command // arguments. + std::string targetOutPathPDB = + this->Convert(targetFullPathPDB.c_str(),cmLocalGenerator::FULL, + cmLocalGenerator::MAKEFILE); std::string targetOutPath = this->Convert(targetFullPath.c_str(),cmLocalGenerator::START_OUTPUT, cmLocalGenerator::MAKEFILE); @@ -402,6 +406,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules cleanObjs += variableName; cleanObjs += ")"; cmLocalGenerator::RuleVariables vars; + vars.TargetPDB = targetOutPathPDB.c_str(); vars.Language = linkLanguage; vars.Objects = buildObjs.c_str(); std::string objdir = "CMakeFiles/"; diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index aca3d29..f114b73 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -385,8 +385,16 @@ cmMakefileTargetGenerator std::string compileRule = this->Makefile->GetRequiredDefinition(compileRuleVar.c_str()); cmSystemTools::ExpandListArgument(compileRule, commands); + + std::string outpath = this->Makefile->GetStartOutputDirectory(); + outpath += "/"; + outpath += this->Target->GetName(); + outpath += ".pdb"; + outpath = this->Convert(outpath.c_str(), cmLocalGenerator::FULL, + cmLocalGenerator::MAKEFILE); cmLocalGenerator::RuleVariables vars; vars.Language = lang; + vars.TargetPDB = outpath.c_str(); vars.Source = sourceFile.c_str(); vars.Object = relativeObj.c_str(); std::string objdir = this->LocalGenerator->GetHomeRelativeOutputPath(); diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx index f607282..039108d 100644 --- a/Source/cmakemain.cxx +++ b/Source/cmakemain.cxx @@ -78,6 +78,9 @@ static const cmDocumentationEntry cmDocumentationOptions[] = "Process the given cmake file as a script written in the CMake language. " "No configure or generate step is performed and the cache is not" " modified."}, + {"--graphviz=[file]", "Generate graphviz of dependencies.", + "Generate a graphviz input file that will contain all the library and " + "executable dependencies in the project."}, {"--help-command cmd [file]", "Print help for a single command and exit.", "Full documentation specific to the given command is displayed."}, {"--help-command-list [file]", "List available listfile commands and exit.", diff --git a/Templates/CPack.GenericDescription.txt b/Templates/CPack.GenericDescription.txt index 5942271..9ca1802 100644 --- a/Templates/CPack.GenericDescription.txt +++ b/Templates/CPack.GenericDescription.txt @@ -1,70 +1,5 @@ -COMPILING INSTRUCTIONS -====================== +DESCRIPTION +=========== -This project uses the CMake (http://www.cmake.org) cross-platform build system. -To compile this project, you will have to make sure you have CMake installed. -Binary and source distributions of CMake can be found at -http://www.cmake.org/HTML/Download.html. If it exists for your platform, we -highly recommend using a binary distribution. +This is an installer created using CPack (http://www.cmake.org). No additional installation instructions provided. -Once CMake is installed, you are ready to build this project. We highly -recommend reading the documentation on -http://www.cmake.org/HTML/Documentation.html if you are not familiar with this -process. - -Here is a summary of the build: - -* Run one of the CMake user interfaces. -* Change configuration options. -* Compile (make on UNIX, Visual Studio on Windows). - -UNIX/Linux ----------- - -The following instructions only apply to Unix/Linux systems. - -The following example shows how to use this technique to build this project on -multiple architectures. Assume we have a Solaris machine and an IRIX machine -with a shared disk with the source tarball in the home directory. - -On either machine, extract the source tarball: - - tar xvzf paraview-2.0.0.tar.gz - -On the Solaris machine, run - - mkdir paraview-2.0.0-solaris<br> - cd paraview-2.0.0-solaris<br> - ccmake ../paraview-2.0.0<br> - make && make install - -Then on the IRIX machine, run - - mkdir paraview-2.0.0-irix<br> - cd paraview-2.0.0-irix<br> - ccmake ../paraview-2.0.0<br> - make && make install - -It is a very good idea to tell CMake what C and C++ compilers you will be -using. This can prevent many build problems. On most systems you can pass this -information to CMake in the following way: - - env CXX=/your/C++/compiler CC=/your/c/compiler ccmake . - -otherwise you must set CXX and CC in your environment and then run ccmake (or -cmake -i). - -Windows -------- - -The Windows build process uses the CMake GUI CMakeSetup. - -Execute CMakeSetup. This will pop-up a GUI that allows you to tailor the build. -You'll have to tell CMakeSetup where you've placed your source code, and where -to build the object code and dll's. The build directory is typically placed -next to the source directory. - -When CMakeSetup completes you can build the project. If you are using Visual -Studio, start up Visual Studio and load the project file. Then select the -ALL_BUILD project, and build it. If you are using NMake Makefiles, Borland -Makefiles, Mingw, MSYS, or Cygwin, then use the appropriate make command. diff --git a/Templates/CPack.GenericLicense.txt b/Templates/CPack.GenericLicense.txt index 97dccdd..c211bb3 100644 --- a/Templates/CPack.GenericLicense.txt +++ b/Templates/CPack.GenericLicense.txt @@ -1,15 +1,5 @@ LICENSE ======= -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS'' -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +This is an installer created using CPack (http://www.cmake.org). No license provided. -For more information, please contact the vendor of this package. diff --git a/Templates/CPack.GenericWelcome.txt b/Templates/CPack.GenericWelcome.txt index 9dd40ff..5330087 100644 --- a/Templates/CPack.GenericWelcome.txt +++ b/Templates/CPack.GenericWelcome.txt @@ -1,2 +1 @@ -Welcome to installation. This program will guide you through the installation -of this software. +Welcome to installation. This program will guide you through the installation of this software. diff --git a/Templates/DLLHeader.dsptemplate b/Templates/DLLHeader.dsptemplate index 59cbeef..7234a74 100644 --- a/Templates/DLLHeader.dsptemplate +++ b/Templates/DLLHeader.dsptemplate @@ -71,7 +71,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /dll /machine:I386
-# ADD LINK32 CM_OPTIMIZED_LIBRARIES CM_LIBRARIES /nologo /dll /machine:I386 /out:"LIBRARY_OUTPUT_PATHRelease/OUTPUT_NAME_RELEASE"
+# ADD LINK32 /nologo /dll /machine:I386 /out:"LIBRARY_OUTPUT_PATHRelease/OUTPUT_NAME_RELEASE"
+CM_MULTILINE_OPTIONS_RELEASE
CMAKE_CUSTOM_RULE_CODE
@@ -102,9 +103,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept
-CM_MULTILINE_DEBUG_LIBRARIES
-CM_MULTILINE_LIBRARIES_FOR_DEBUG
# ADD LINK32 /nologo /dll /debug /machine:I386 /out:"LIBRARY_OUTPUT_PATHDebug/OUTPUT_NAME_DEBUG" /pdbtype:sept
+CM_MULTILINE_OPTIONS_DEBUG
CMAKE_CUSTOM_RULE_CODE
@@ -137,7 +137,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /dll /machine:I386
-# ADD LINK32 CM_OPTIMIZED_LIBRARIES CM_LIBRARIES /nologo /dll /machine:I386 /out:"LIBRARY_OUTPUT_PATHMinSizeRel/OUTPUT_NAME_MINSIZEREL"
+# ADD LINK32 /nologo /dll /machine:I386 /out:"LIBRARY_OUTPUT_PATHMinSizeRel/OUTPUT_NAME_MINSIZEREL"
+CM_MULTILINE_OPTIONS_MINSIZEREL
CMAKE_CUSTOM_RULE_CODE
@@ -168,7 +169,8 @@ BSC32=bscmake.exe # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /dll /machine:I386 /pdbtype:sept
-# ADD LINK32 CM_OPTIMIZED_LIBRARIES CM_LIBRARIES /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"LIBRARY_OUTPUT_PATHRelWithDebInfo/OUTPUT_NAME_RELWITHDEBINFO"
+# ADD LINK32 /nologo /dll /debug /machine:I386 /pdbtype:sept /out:"LIBRARY_OUTPUT_PATHRelWithDebInfo/OUTPUT_NAME_RELWITHDEBINFO"
+CM_MULTILINE_OPTIONS_RELWITHDEBINFO
CMAKE_CUSTOM_RULE_CODE
diff --git a/Templates/EXEHeader.dsptemplate b/Templates/EXEHeader.dsptemplate index 203e8ec..518ec28 100644 --- a/Templates/EXEHeader.dsptemplate +++ b/Templates/EXEHeader.dsptemplate @@ -70,8 +70,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelease\OUTPUT_NAME_RELEASE"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_RELEASE
CMAKE_CUSTOM_RULE_CODE
@@ -103,8 +102,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHDebug\OUTPUT_NAME_DEBUG"
-CM_MULTILINE_DEBUG_LIBRARIES
-CM_MULTILINE_LIBRARIES_FOR_DEBUG
+CM_MULTILINE_OPTIONS_DEBUG
CMAKE_CUSTOM_RULE_CODE
@@ -133,8 +131,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHMinSizeRel\OUTPUT_NAME_MINSIZEREL"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_MINSIZEREL
CMAKE_CUSTOM_RULE_CODE
@@ -164,8 +161,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:console /debug /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelWithDebInfo\OUTPUT_NAME_RELWITHDEBINFO"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_RELWITHDEBINFO
CMAKE_CUSTOM_RULE_CODE
diff --git a/Templates/EXEWinHeader.dsptemplate b/Templates/EXEWinHeader.dsptemplate index 8a7f7e0..42cc35e 100644 --- a/Templates/EXEWinHeader.dsptemplate +++ b/Templates/EXEWinHeader.dsptemplate @@ -72,8 +72,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelease\OUTPUT_NAME_RELEASE"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_RELEASE
CMAKE_CUSTOM_RULE_CODE
@@ -105,9 +104,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHDebug\OUTPUT_NAME_DEBUG"
-CM_MULTILINE_DEBUG_LIBRARIES
-CM_MULTILINE_LIBRARIES_FOR_DEBUG
-
+CM_MULTILINE_OPTIONS_DEBUG
CMAKE_CUSTOM_RULE_CODE
@@ -136,8 +133,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /nologo /subsystem:windows /machine:I386 /pdbtype:sept /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHMinSizeRel\OUTPUT_NAME_MINSIZEREL"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_MINSIZEREL
CMAKE_CUSTOM_RULE_CODE
@@ -169,8 +165,7 @@ LINK32=link.exe # ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 /IGNORE:4089
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /IGNORE:4089
# ADD LINK32 /out:"EXECUTABLE_OUTPUT_PATHRelWithDebInfo\OUTPUT_NAME_RELWITHDEBINFO"
-CM_MULTILINE_OPTIMIZED_LIBRARIES
-CM_MULTILINE_LIBRARIES
+CM_MULTILINE_OPTIONS_RELWITHDEBINFO
CMAKE_CUSTOM_RULE_CODE
|