diff options
-rw-r--r-- | Modules/CMakeGenericSystem.cmake | 102 | ||||
-rw-r--r-- | Modules/FindCUDA.cmake | 25 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 4 | ||||
-rw-r--r-- | Source/cmELF.cxx | 3 | ||||
-rw-r--r-- | Source/cmExportCommand.cxx | 12 | ||||
-rw-r--r-- | Source/cmFileCommand.cxx | 103 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio8Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 20 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 38 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio6Generator.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 36 | ||||
-rw-r--r-- | Source/cmMakefile.h | 6 | ||||
-rw-r--r-- | Source/cmSystemTools.cxx | 15 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 13 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 2 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Utilities/cmbzip2/bzlib_private.h | 3 | ||||
-rw-r--r-- | Utilities/cmcurl/setup.h | 4 | ||||
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_check_magic.c | 2 | ||||
-rwxr-xr-x | bootstrap | 2 |
20 files changed, 227 insertions, 172 deletions
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 7d2d8cd..b5d3072 100644 --- a/Modules/CMakeGenericSystem.cmake +++ b/Modules/CMakeGenericSystem.cmake @@ -52,6 +52,94 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles") ENDIF(DEFINED CMAKE_RULE_MESSAGES) ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + +# GetDefaultWindowsPrefixBase +# +# Compute the base directory for CMAKE_INSTALL_PREFIX based on: +# - is this 32-bit or 64-bit Windows +# - is this 32-bit or 64-bit CMake running +# - what architecture targets will be built +# +function(GetDefaultWindowsPrefixBase var) + + # Try to guess what architecture targets will end up being built as, + # even if CMAKE_SIZEOF_VOID_P is not computed yet... We need to know + # the architecture of the targets being built to choose the right + # default value for CMAKE_INSTALL_PREFIX. + # + if("${CMAKE_GENERATOR}" MATCHES "Win64") + set(arch_hint "x64") + elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8") + set(arch_hint "x64") + elseif("$ENV{LIB}" MATCHES "(amd64|ia64)") + set(arch_hint "x64") + endif() + + if(NOT arch_hint) + set(arch_hint "x86") + endif() + + # default env in a 64-bit app on Win64: + # ProgramFiles=C:\Program Files + # ProgramFiles(x86)=C:\Program Files (x86) + # ProgramW6432=C:\Program Files + # + # default env in a 32-bit app on Win64: + # ProgramFiles=C:\Program Files (x86) + # ProgramFiles(x86)=C:\Program Files (x86) + # ProgramW6432=C:\Program Files + # + # default env in a 32-bit app on Win32: + # ProgramFiles=C:\Program Files + # ProgramFiles(x86) NOT DEFINED + # ProgramW6432 NOT DEFINED + + # By default, use the ProgramFiles env var as the base value of + # CMAKE_INSTALL_PREFIX: + # + set(_PREFIX_ENV_VAR "ProgramFiles") + + if ("$ENV{ProgramW6432}" STREQUAL "") + # running on 32-bit Windows + # must be a 32-bit CMake, too... + #message("guess: this is a 32-bit CMake running on 32-bit Windows") + else() + # running on 64-bit Windows + if ("$ENV{ProgramW6432}" STREQUAL "$ENV{ProgramFiles}") + # 64-bit CMake + #message("guess: this is a 64-bit CMake running on 64-bit Windows") + if(NOT "${arch_hint}" STREQUAL "x64") + # building 32-bit targets + set(_PREFIX_ENV_VAR "ProgramFiles(x86)") + endif() + else() + # 32-bit CMake + #message("guess: this is a 32-bit CMake running on 64-bit Windows") + if("${arch_hint}" STREQUAL "x64") + # building 64-bit targets + set(_PREFIX_ENV_VAR "ProgramW6432") + endif() + endif() + endif() + + #if("${arch_hint}" STREQUAL "x64") + # message("guess: you are building a 64-bit app") + #else() + # message("guess: you are building a 32-bit app") + #endif() + + if(NOT "$ENV{${_PREFIX_ENV_VAR}}" STREQUAL "") + file(TO_CMAKE_PATH "$ENV{${_PREFIX_ENV_VAR}}" _base) + elseif(NOT "$ENV{SystemDrive}" STREQUAL "") + set(_base "$ENV{SystemDrive}/Program Files") + else() + set(_base "C:/Program Files") + endif() + + set(${var} "${_base}" PARENT_SCOPE) +endfunction() + + # Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX # was initialized by the block below. This is useful for user # projects to change the default prefix while still allowing the @@ -65,23 +153,11 @@ IF(CMAKE_HOST_UNIX) SET(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Install path prefix, prepended onto install directories.") ELSE(CMAKE_HOST_UNIX) - IF("$ENV{ProgramFiles}" MATCHES "^$") - IF("$ENV{SystemDrive}" MATCHES "^$") - SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files") - ELSE("$ENV{SystemDrive}" MATCHES "^$") - SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files") - ENDIF("$ENV{SystemDrive}" MATCHES "^$") - ELSE("$ENV{ProgramFiles}" MATCHES "^$") - SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}") - ENDIF("$ENV{ProgramFiles}" MATCHES "^$") + GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) SET(CMAKE_INSTALL_PREFIX "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}" CACHE PATH "Install path prefix, prepended onto install directories.") SET(CMAKE_GENERIC_PROGRAM_FILES) - - # Make sure the prefix uses forward slashes. - STRING(REGEX REPLACE "\\\\" "/" - CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") ENDIF(CMAKE_HOST_UNIX) MARK_AS_ADVANCED( diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index d9b9d54..dad5709 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -514,11 +514,19 @@ set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE}) macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc) if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(_cuda_64bit_lib_dir "${CUDA_TOOLKIT_ROOT_DIR}/lib64") + # CUDA 3.2+ on Windows moved the library directoryies, so we need the new + # and old paths. + set(_cuda_64bit_lib_dir + "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64" + "${CUDA_TOOLKIT_ROOT_DIR}/lib64" + ) endif() + # CUDA 3.2+ on Windows moved the library directories, so we need to new + # (lib/Win32) and the old path (lib). find_library(${_var} NAMES ${_names} PATHS ${_cuda_64bit_lib_dir} + "${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32" "${CUDA_TOOLKIT_ROOT_DIR}/lib" ENV CUDA_LIB_PATH DOC ${_doc} @@ -578,9 +586,20 @@ macro(FIND_CUDA_HELPER_LIBS _name) mark_as_advanced(CUDA_${_name}_LIBRARY) endmacro(FIND_CUDA_HELPER_LIBS) +####################### +# Disable emulation for v3.1 onward +if(CUDA_VERSION VERSION_GREATER "3.0") + if(CUDA_BUILD_EMULATION) + message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.") + endif() +endif() + # Search for cufft and cublas libraries. -find_cuda_helper_libs(cufftemu) -find_cuda_helper_libs(cublasemu) +if(CUDA_VERSION VERSION_LESS "3.1") + # Emulation libraries aren't available in version 3.1 onward. + find_cuda_helper_libs(cufftemu) + find_cuda_helper_libs(cublasemu) +endif() find_cuda_helper_libs(cufft) find_cuda_helper_libs(cublas) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index dcdc8e1..2e05883 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -490,10 +490,6 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command) return 0; } - // call this so that the information is cached up front - // and not the first time EndTest is called. - this->ShouldCompressTestOutput(); - if ( this->ProduceXML ) { // Verify "Testing" directory exists: diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index c198727..1158fc0 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -687,7 +687,8 @@ cmELFInternalImpl<Types>::GetDynamicSectionString(int tag) // The value has been read successfully. Report it. se.Position = static_cast<unsigned long>(strtab.sh_offset + first); se.Size = last - first; - se.IndexInSection = static_cast<int>(di - this->DynamicSectionEntries.begin()); + se.IndexInSection = + static_cast<int>(di - this->DynamicSectionEntries.begin()); return &se; } } diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 48c5c6e..cb614d4 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -152,11 +152,10 @@ bool cmExportCommand ebfg.SetCommand(this); // Compute the set of configurations exported. - if(const char* types = - this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + std::vector<std::string> configurationTypes; + this->Makefile->GetConfigurations(configurationTypes); + if(!configurationTypes.empty()) { - std::vector<std::string> configurationTypes; - cmSystemTools::ExpandListArgument(types, configurationTypes); for(std::vector<std::string>::const_iterator ci = configurationTypes.begin(); ci != configurationTypes.end(); ++ci) @@ -164,11 +163,6 @@ bool cmExportCommand ebfg.AddConfiguration(ci->c_str()); } } - else if(const char* config = - this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) - { - ebfg.AddConfiguration(config); - } else { ebfg.AddConfiguration(""); diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 133c1a1..8ebd41f 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2571,8 +2571,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> std::vector<std::string>::const_iterator i = args.begin(); if(args.size() < 3) { - this->SetError("FILE(DOWNLOAD url file) must be called with " - "at least three arguments."); + this->SetError("DOWNLOAD must be called with at least three arguments."); return false; } ++i; // Get rid of subcommand @@ -2598,8 +2597,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> } else { - this->SetError("FILE(DOWNLOAD url file TIMEOUT time) missing " - "time for TIMEOUT."); + this->SetError("DOWNLOAD missing time for TIMEOUT."); return false; } } @@ -2608,8 +2606,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> ++i; if( i == args.end()) { - this->SetError("FILE(DOWNLOAD url file LOG VAR) missing " - "VAR for LOG."); + this->SetError("DOWNLOAD missing VAR for LOG."); return false; } verboseLog = *i; @@ -2619,8 +2616,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> ++i; if( i == args.end()) { - this->SetError("FILE(DOWNLOAD url file STATUS VAR) missing " - "VAR for STATUS."); + this->SetError("DOWNLOAD missing VAR for STATUS."); return false; } statusVar = *i; @@ -2630,8 +2626,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> ++i; if( i == args.end()) { - this->SetError("FILE(DOWNLOAD url file EXPECTED_MD5 sum) missing " - "sum value for EXPECTED_MD5."); + this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5."); return false; } expectedMD5sum = cmSystemTools::LowerCase(*i); @@ -2654,8 +2649,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5)) { - this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on " - "pre-existing file"); + this->SetError("DOWNLOAD cannot compute MD5 sum on pre-existing file"); return false; } @@ -2665,7 +2659,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (expectedMD5sum == actualMD5sum) { this->Makefile->DisplayStatus( - "FILE(DOWNLOAD ) returning early: file already exists with " + "FILE(DOWNLOAD) returning early: file already exists with " "expected MD5 sum", -1); if(statusVar.size()) @@ -2698,8 +2692,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> std::ofstream fout(file.c_str(), std::ios::binary); if(!fout) { - this->SetError("FILE(DOWNLOAD url file TIMEOUT time) can not open " - "file for write."); + this->SetError("DOWNLOAD cannot open file for write."); return false; } @@ -2708,8 +2701,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> curl = ::curl_easy_init(); if(!curl) { - this->SetError("FILE(DOWNLOAD ) error " - "initializing curl."); + this->SetError("DOWNLOAD error initializing curl."); return false; } @@ -2718,9 +2710,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> ::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set url: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set url: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2728,10 +2720,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> cmFileCommandWriteMemoryCallback); if (res != CURLE_OK) { - std::string errstring = - "FILE(DOWNLOAD ) error; cannot set write function: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set write function: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2739,10 +2730,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> cmFileCommandCurlDebugCallback); if (res != CURLE_OK) { - std::string errstring = - "FILE(DOWNLOAD ) error; cannot set debug function: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set debug function: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2752,27 +2742,27 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set write data: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set write data: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set debug data: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set debug data: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set follow-redirect option: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set follow-redirect option: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2782,9 +2772,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set verbose: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set verbose: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } } @@ -2795,9 +2785,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set timeout: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set timeout: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } } @@ -2815,9 +2805,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> CURLOPT_NOPROGRESS, 0); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set noprogress value: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set noprogress value: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2825,9 +2815,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> CURLOPT_PROGRESSFUNCTION, cmFileCommandCurlProgressCallback); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress function: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set progress function: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } @@ -2835,9 +2825,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> CURLOPT_PROGRESSDATA, reinterpret_cast<void*>(&helper)); if (res != CURLE_OK) { - std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress data: "; - errstring += ::curl_easy_strerror(res); - this->SetError(errstring.c_str()); + std::string e = "DOWNLOAD cannot set progress data: "; + e += ::curl_easy_strerror(res); + this->SetError(e.c_str()); return false; } } @@ -2871,8 +2861,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5)) { - this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on " - "downloaded file"); + this->SetError("DOWNLOAD cannot compute MD5 sum on downloaded file"); return false; } @@ -2882,8 +2871,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> if (expectedMD5sum != actualMD5sum) { cmOStringStream oss; - oss << "FILE(DOWNLOAD ) error; expected and actual MD5 sums differ" - << std::endl + oss << "DOWNLOAD MD5 mismatch" << std::endl << " for file: [" << file << "]" << std::endl << " expected MD5 sum: [" << expectedMD5sum << "]" << std::endl << " actual MD5 sum: [" << actualMD5sum << "]" << std::endl @@ -2913,8 +2901,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> return true; #else - this->SetError("FILE(DOWNLOAD ) " - "not supported in bootstrap cmake "); + this->SetError("DOWNLOAD not supported by bootstrap cmake."); return false; #endif } diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c5c9d5c..7c65c32 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -260,8 +260,8 @@ cmGlobalVisualStudio8Generator for(std::vector<std::string>::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|" - << this->GetPlatformName() << "\n"; + fout << "\t\t" << *i << "|" << this->GetPlatformName() + << " = " << *i << "|" << this->GetPlatformName() << "\n"; } fout << "\tEndGlobalSection\n"; } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 537a88f..c63b403 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -722,26 +722,10 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen) // Select the current set of configuration types. this->CurrentConfigurationTypes.clear(); - if(this->XcodeVersion > 20) - { - if(const char* types = - this->CurrentMakefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(types, - this->CurrentConfigurationTypes); - } - } + this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes); if(this->CurrentConfigurationTypes.empty()) { - if(const char* buildType = - this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE")) - { - this->CurrentConfigurationTypes.push_back(buildType); - } - else - { - this->CurrentConfigurationTypes.push_back(""); - } + this->CurrentConfigurationTypes.push_back(""); } } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index bac0223..5bffd52 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -278,16 +278,8 @@ void cmLocalGenerator::GenerateTestFiles() // Compute the set of configurations. std::vector<std::string> configurationTypes; - if(const char* types = - this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(types, configurationTypes); - } - const char* config = 0; - if(configurationTypes.empty()) - { - config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); - } + const char* config = + this->Makefile->GetConfigurations(configurationTypes, false); std::string file = this->Makefile->GetStartOutputDirectory(); file += "/"; @@ -383,16 +375,8 @@ void cmLocalGenerator::GenerateInstallRules() // Compute the set of configurations. std::vector<std::string> configurationTypes; - if(const char* types = - this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(types, configurationTypes); - } - const char* config = 0; - if(configurationTypes.empty()) - { - config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"); - } + const char* config = + this->Makefile->GetConfigurations(configurationTypes, false); // Choose a default install configuration. const char* default_config = config; @@ -546,19 +530,7 @@ void cmLocalGenerator::GenerateTargetManifest() { // Collect the set of configuration types. std::vector<std::string> configNames; - if(const char* configurationTypes = - this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(configurationTypes, configNames); - } - else if(const char* buildType = - this->Makefile->GetDefinition("CMAKE_BUILD_TYPE")) - { - if(*buildType) - { - configNames.push_back(buildType); - } - } + this->Makefile->GetConfigurations(configNames); // Add our targets to the manifest for each configuration. cmTargets& targets = this->Makefile->GetTargets(); diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 539816d..01fcafd 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1304,7 +1304,8 @@ void cmLocalVisualStudio6Generator optionsRelease); this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel, optionsMinSizeRel); - this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptionsRelWithDebInfo, + this->ComputeLinkOptions(target, "RelWithDebInfo", + extraLinkOptionsRelWithDebInfo, optionsRelWithDebInfo); } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8eece6b..c64053a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1436,16 +1436,7 @@ void cmMakefile::InitializeFromParent() this->SetProperty("COMPILE_DEFINITIONS", parent->GetProperty("COMPILE_DEFINITIONS")); std::vector<std::string> configs; - if(const char* configTypes = - this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(configTypes, configs); - } - else if(const char* buildType = - this->GetDefinition("CMAKE_BUILD_TYPE")) - { - configs.push_back(buildType); - } + this->GetConfigurations(configs); for(std::vector<std::string>::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { @@ -2367,6 +2358,31 @@ void cmMakefile::AddDefaultDefinitions() cmake::GetCMakeFilesDirectory()); } +//---------------------------------------------------------------------------- +const char* +cmMakefile::GetConfigurations(std::vector<std::string>& configs, + bool single) const +{ + if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig()) + { + if(const char* configTypes = + this->GetDefinition("CMAKE_CONFIGURATION_TYPES")) + { + cmSystemTools::ExpandListArgument(configTypes, configs); + } + return 0; + } + else + { + const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE"); + if(single && buildType && *buildType) + { + configs.push_back(buildType); + } + return buildType; + } +} + #if defined(CMAKE_BUILD_WITH_CMAKE) /** * Find a source group whose regular expression matches the filename diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h index 4fae7ee..8b8a3f8 100644 --- a/Source/cmMakefile.h +++ b/Source/cmMakefile.h @@ -309,7 +309,11 @@ public: { return this->ProjectName.c_str(); } - + + /** Get the configurations to be generated. */ + const char* GetConfigurations(std::vector<std::string>& configs, + bool single = true) const; + /** * Set the name of the library. */ diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 8378922..7bc89a4 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1176,7 +1176,8 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out) // Should be efficient enough on most system: const int bufferSize = 4096; char buffer[bufferSize]; - unsigned char const* buffer_uc = reinterpret_cast<unsigned char const*>(buffer); + unsigned char const* buffer_uc = + reinterpret_cast<unsigned char const*>(buffer); // This copy loop is very sensitive on certain platforms with // slightly broken stream libraries (like HPUX). Normally, it is // incorrect to not check the error condition on the fin.read() @@ -1931,12 +1932,20 @@ bool extract_tar(const char* outFileName, bool verbose, } if(extract) { + r = archive_write_disk_set_options(ext, ARCHIVE_EXTRACT_TIME); + if (r != ARCHIVE_OK) + { + cmSystemTools::Error( + "Problem with archive_write_disk_set_options(): ", + archive_error_string(ext)); + } + r = archive_write_header(ext, entry); if (r != ARCHIVE_OK) { cmSystemTools::Error("Problem with archive_write_header(): ", - archive_error_string(a)); - cmSystemTools::Error("Curren file:", + archive_error_string(ext)); + cmSystemTools::Error("Current file:", archive_entry_pathname(entry)); } else diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 9611912..591b0d1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1040,18 +1040,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) // Collect the set of configuration types. std::vector<std::string> configNames; - if(const char* configurationTypes = - mf->GetDefinition("CMAKE_CONFIGURATION_TYPES")) - { - cmSystemTools::ExpandListArgument(configurationTypes, configNames); - } - else if(const char* buildType = mf->GetDefinition("CMAKE_BUILD_TYPE")) - { - if(*buildType) - { - configNames.push_back(buildType); - } - } + mf->GetConfigurations(configNames); // Setup per-configuration property default values. const char* configProps[] = { diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index cce79ef..99c8b27 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) SET(KWSYS_DATE_STAMP_MONTH 09) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 13) +SET(KWSYS_DATE_STAMP_DAY 14) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8e8d0ca..eb86a34 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1630,7 +1630,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF() IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode") - INCLUDE(FindJava) + find_package(Java QUIET) IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH) FIND_FILE(JNI_H jni.h diff --git a/Utilities/cmbzip2/bzlib_private.h b/Utilities/cmbzip2/bzlib_private.h index 147dbb8..02a667f 100644 --- a/Utilities/cmbzip2/bzlib_private.h +++ b/Utilities/cmbzip2/bzlib_private.h @@ -47,6 +47,9 @@ /* warning C4127: conditional expression is constant*/ # pragma warning(disable:4127) #endif +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wcast-align" +#endif /*-- General stuff. --*/ diff --git a/Utilities/cmcurl/setup.h b/Utilities/cmcurl/setup.h index c49e63d..e302f35 100644 --- a/Utilities/cmcurl/setup.h +++ b/Utilities/cmcurl/setup.h @@ -42,6 +42,10 @@ #define WIN32 #endif +#if defined(__clang__) +# pragma clang diagnostic ignored "-Wcast-align" +#endif + /* * Include configuration script results or hand-crafted * configuration file for platforms which lack config tool. diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c index a9177d7..e9dbe51 100644 --- a/Utilities/cmlibarchive/libarchive/archive_check_magic.c +++ b/Utilities/cmlibarchive/libarchive/archive_check_magic.c @@ -69,7 +69,7 @@ diediedie(void) /* Cause a breakpoint exception */ DebugBreak(); #endif - *(char *)0 = 1; /* Deliberately segfault and force a coredump. */ + *(char *)1 = 1; /* Deliberately segfault and force a coredump. */ _exit(1); /* If that didn't work, just exit with an error. */ } @@ -839,7 +839,7 @@ mkdir "${cmake_bootstrap_dir}/${TMPFILE}" cd "${cmake_bootstrap_dir}/${TMPFILE}" echo ' test: test.c - "'"${cmake_c_compiler}"'" -o test test.c + "'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c '>"Makefile" echo ' #include <stdio.h> |