diff options
-rw-r--r-- | CTestCustom.cmake.in | 2 | ||||
-rw-r--r-- | Modules/ExternalProject.cmake | 24 | ||||
-rw-r--r-- | Modules/FindGTest.cmake | 12 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmExportCommand.cxx | 15 | ||||
-rw-r--r-- | Source/cmGeneratorExpressionEvaluationFile.cxx | 15 | ||||
-rw-r--r-- | Source/cmIDEFlagTable.h | 1 | ||||
-rw-r--r-- | Source/cmIDEOptions.cxx | 80 | ||||
-rw-r--r-- | Source/cmIDEOptions.h | 2 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 19 | ||||
-rw-r--r-- | Source/cmVS11CLFlagTable.h | 9 | ||||
-rw-r--r-- | Source/cmVS12CLFlagTable.h | 9 | ||||
-rw-r--r-- | Utilities/Sphinx/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Utilities/Sphinx/apply_qthelp_css_workaround.cmake | 15 |
14 files changed, 130 insertions, 79 deletions
diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 6010b64..2407da6 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -44,7 +44,7 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "warning.*directory name.*CMake-Xcode.*/bin/.*does not exist.*" "stl_deque.h:1051" "(Lexer|Parser).*warning.*conversion.*may (alter its value|change the sign)" - "(Lexer|Parser).*warning.*statement is unreachable" + "(Lexer|Parser).*warning.*(statement is unreachable|will never be executed)" "PGC-W-0095-Type cast required for this conversion.*ProcessUNIX.c" "[Qq]t([Cc]ore|[Gg]ui).*warning.*conversion.*may alter its value" "warning:.*is.*very unsafe.*consider using.*" diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake index e490e69..0f651e9 100644 --- a/Modules/ExternalProject.cmake +++ b/Modules/ExternalProject.cmake @@ -16,6 +16,7 @@ # [LIST_SEPARATOR sep] # Sep to be replaced by ; in cmd lines # [TMP_DIR dir] # Directory to store temporary files # [STAMP_DIR dir] # Directory to store step timestamps +# [EXCLUDE_FROM_ALL 1] # The "all" target does not depend on this # #--Download step-------------- # [DOWNLOAD_NAME fname] # File name to store (if not end of URL) # [DOWNLOAD_DIR dir] # Directory to store downloaded files @@ -119,6 +120,7 @@ # [DEPENDERS steps...] # Steps that depend on this step # [DEPENDS files...] # Files on which this step depends # [ALWAYS 1] # No stamp file, step always runs +# [EXCLUDE_FROM_MAIN 1] # Main target does not depend on this step # [WORKING_DIRECTORY dir] # Working directory for command # [LOG 1] # Wrap step in script to log output # ) @@ -1192,14 +1194,17 @@ function(ExternalProject_Add_Step name step) set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") _ep_get_step_stampfile(${name} ${step} stamp_file) - add_custom_command(APPEND - OUTPUT ${complete_stamp_file} - DEPENDS ${stamp_file} - ) - _ep_parse_arguments(ExternalProject_Add_Step ${name} _EP_${step}_ "${ARGN}") + get_property(exclude_from_main TARGET ${name} PROPERTY _EP_${step}_EXCLUDE_FROM_MAIN) + if(NOT exclude_from_main) + add_custom_command(APPEND + OUTPUT ${complete_stamp_file} + DEPENDS ${stamp_file} + ) + endif() + # Steps depending on this step. get_property(dependers TARGET ${name} PROPERTY _EP_${step}_DEPENDERS) foreach(depender IN LISTS dependers) @@ -1909,6 +1914,9 @@ function(ExternalProject_Add name) set(cmf_dir ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles) set(complete_stamp_file "${cmf_dir}${cfgdir}/${name}-complete") + # The "ALL" option to add_custom_target just tells it to not set the + # EXCLUDE_FROM_ALL target property. Later, if the EXCLUDE_FROM_ALL + # argument was passed, we explicitly set it for the target. add_custom_target(${name} ALL DEPENDS ${complete_stamp_file}) set_property(TARGET ${name} PROPERTY _EP_IS_EXTERNAL_PROJECT 1) _ep_parse_arguments(ExternalProject_Add ${name} _EP_ "${ARGN}") @@ -1916,6 +1924,12 @@ function(ExternalProject_Add name) _ep_get_step_stampfile(${name} "done" done_stamp_file) _ep_get_step_stampfile(${name} "install" install_stamp_file) + # Set the EXCLUDE_FROM_ALL target property if required. + get_property(exclude_from_all TARGET ${name} PROPERTY _EP_EXCLUDE_FROM_ALL) + if(exclude_from_all) + set_property(TARGET ${name} PROPERTY EXCLUDE_FROM_ALL TRUE) + endif() + # The 'complete' step depends on all other steps and creates a # 'done' mark. A dependent external project's 'configure' step # depends on the 'done' mark so that it rebuilds when this project diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake index aa3c235..c4f911d 100644 --- a/Modules/FindGTest.cmake +++ b/Modules/FindGTest.cmake @@ -115,11 +115,19 @@ function(GTEST_ADD_TESTS executable extra_args) # obtain sources used for building that executable get_property(ARGN TARGET ${executable} PROPERTY SOURCES) endif() + set(gtest_case_name_regex ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*") foreach(source ${ARGN}) file(READ "${source}" contents) - string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) + string(REGEX MATCHALL "TEST_?[FP]?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents}) foreach(hit ${found_tests}) - string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit}) + string(REGEX MATCH "TEST_?[FP]?" test_type ${hit}) + + # Parameterized tests have a different signature for the filter + if(${test_type} STREQUAL "TEST_P") + string(REGEX REPLACE ${gtest_case_name_regex} "*/\\1.\\2/*" test_name ${hit}) + else() + string(REGEX REPLACE ${gtest_case_name_regex} "\\1.\\2" test_name ${hit}) + endif() add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args}) endforeach() endforeach() diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index aec1b18..7b9db16 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140402) +set(CMake_VERSION_PATCH 20140403) #set(CMake_VERSION_RC 1) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index dcb77ba..2536ada 100644 --- a/Source/cmExportCommand.cxx +++ b/Source/cmExportCommand.cxx @@ -223,18 +223,15 @@ bool cmExportCommand // Compute the set of configurations exported. std::vector<std::string> configurationTypes; this->Makefile->GetConfigurations(configurationTypes); - if(!configurationTypes.empty()) + if(configurationTypes.empty()) { - for(std::vector<std::string>::const_iterator - ci = configurationTypes.begin(); - ci != configurationTypes.end(); ++ci) - { - ebfg->AddConfiguration(*ci); - } + configurationTypes.push_back(""); } - else + for(std::vector<std::string>::const_iterator + ci = configurationTypes.begin(); + ci != configurationTypes.end(); ++ci) { - ebfg->AddConfiguration(""); + ebfg->AddConfiguration(*ci); } if (this->ExportSet) { diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx index d41285d..95a946a 100644 --- a/Source/cmGeneratorExpressionEvaluationFile.cxx +++ b/Source/cmGeneratorExpressionEvaluationFile.cxx @@ -135,18 +135,15 @@ void cmGeneratorExpressionEvaluationFile::Generate() if (allConfigs.empty()) { - this->Generate("", inputExpression.get(), outputFiles); + allConfigs.push_back(""); } - else + for(std::vector<std::string>::const_iterator li = allConfigs.begin(); + li != allConfigs.end(); ++li) { - for(std::vector<std::string>::const_iterator li = allConfigs.begin(); - li != allConfigs.end(); ++li) + this->Generate(*li, inputExpression.get(), outputFiles); + if(cmSystemTools::GetFatalErrorOccured()) { - this->Generate(*li, inputExpression.get(), outputFiles); - if(cmSystemTools::GetFatalErrorOccured()) - { - return; - } + return; } } } diff --git a/Source/cmIDEFlagTable.h b/Source/cmIDEFlagTable.h index e372c0a..d9a045d 100644 --- a/Source/cmIDEFlagTable.h +++ b/Source/cmIDEFlagTable.h @@ -31,6 +31,7 @@ struct cmIDEFlagTable // old value with semicolons (e.g. // /NODEFAULTLIB: => // IgnoreDefaultLibraryNames) + UserFollowing = (1<<5), // expect value in following argument UserValueIgnored = UserValue | UserIgnored, UserValueRequired = UserValue | UserRequired diff --git a/Source/cmIDEOptions.cxx b/Source/cmIDEOptions.cxx index e03223f..1f3c066 100644 --- a/Source/cmIDEOptions.cxx +++ b/Source/cmIDEOptions.cxx @@ -19,6 +19,7 @@ cmIDEOptions::cmIDEOptions() this->DoingDefine = false; this->AllowDefine = true; this->AllowSlash = false; + this->DoingFollowing = 0; for(int i=0; i < FlagTableCount; ++i) { this->FlagTable[i] = 0; @@ -41,6 +42,14 @@ void cmIDEOptions::HandleFlag(const char* flag) return; } + // If the last option expected a following value, this is it. + if(this->DoingFollowing) + { + this->FlagMapUpdate(this->DoingFollowing, flag); + this->DoingFollowing = 0; + return; + } + // Look for known arguments. if(flag[0] == '-' || (this->AllowSlash && flag[0] == '/')) { @@ -99,40 +108,22 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, (!(entry->special & cmIDEFlagTable::UserRequired) || static_cast<int>(strlen(flag+1)) > n)) { - if(entry->special & cmIDEFlagTable::UserIgnored) - { - // Ignore the user-specified value. - this->FlagMap[entry->IDEName] = entry->value; - } - else if(entry->special & cmIDEFlagTable::SemicolonAppendable) - { - const char *new_value = flag+1+n; - - std::map<std::string,std::string>::iterator itr; - itr = this->FlagMap.find(entry->IDEName); - if(itr != this->FlagMap.end()) - { - // Append to old value (if present) with semicolons; - itr->second += ";"; - itr->second += new_value; - } - else - { - this->FlagMap[entry->IDEName] = new_value; - } - } - else - { - // Use the user-specified value. - this->FlagMap[entry->IDEName] = flag+1+n; - } + this->FlagMapUpdate(entry, flag+n+1); entry_found = true; } } else if(strcmp(flag+1, entry->commandFlag) == 0) { - // This flag table entry provides a fixed value. - this->FlagMap[entry->IDEName] = entry->value; + if(entry->special & cmIDEFlagTable::UserFollowing) + { + // This flag expects a value in the following argument. + this->DoingFollowing = entry; + } + else + { + // This flag table entry provides a fixed value. + this->FlagMap[entry->IDEName] = entry->value; + } entry_found = true; } @@ -151,6 +142,37 @@ bool cmIDEOptions::CheckFlagTable(cmIDEFlagTable const* table, } //---------------------------------------------------------------------------- +void cmIDEOptions::FlagMapUpdate(cmIDEFlagTable const* entry, + const char* new_value) +{ + if(entry->special & cmIDEFlagTable::UserIgnored) + { + // Ignore the user-specified value. + this->FlagMap[entry->IDEName] = entry->value; + } + else if(entry->special & cmIDEFlagTable::SemicolonAppendable) + { + std::map<std::string,std::string>::iterator itr; + itr = this->FlagMap.find(entry->IDEName); + if(itr != this->FlagMap.end()) + { + // Append to old value (if present) with semicolons; + itr->second += ";"; + itr->second += new_value; + } + else + { + this->FlagMap[entry->IDEName] = new_value; + } + } + else + { + // Use the user-specified value. + this->FlagMap[entry->IDEName] = new_value; + } +} + +//---------------------------------------------------------------------------- void cmIDEOptions::AddDefine(const std::string& def) { this->Defines.push_back(def); diff --git a/Source/cmIDEOptions.h b/Source/cmIDEOptions.h index 691893f..e7749ec 100644 --- a/Source/cmIDEOptions.h +++ b/Source/cmIDEOptions.h @@ -51,11 +51,13 @@ protected: bool DoingDefine; bool AllowDefine; bool AllowSlash; + cmIDEFlagTable const* DoingFollowing; enum { FlagTableCount = 16 }; cmIDEFlagTable const* FlagTable[FlagTableCount]; void HandleFlag(const char* flag); bool CheckFlagTable(cmIDEFlagTable const* table, const char* flag, bool& flag_handled); + void FlagMapUpdate(cmIDEFlagTable const* entry, const char* new_value); virtual void StoreUnknownFlag(const char* flag) = 0; }; diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c47147c..9cafed1 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -542,6 +542,10 @@ void cmLocalGenerator::GenerateTargetManifest() // Collect the set of configuration types. std::vector<std::string> configNames; this->Makefile->GetConfigurations(configNames); + if(configNames.empty()) + { + configNames.push_back(""); + } // Add our targets to the manifest for each configuration. cmGeneratorTargetsType targets = this->Makefile->GetGeneratorTargets(); @@ -557,18 +561,11 @@ void cmLocalGenerator::GenerateTargetManifest() { continue; } - if(configNames.empty()) + for(std::vector<std::string>::iterator ci = configNames.begin(); + ci != configNames.end(); ++ci) { - target.GenerateTargetManifest(""); - } - else - { - for(std::vector<std::string>::iterator ci = configNames.begin(); - ci != configNames.end(); ++ci) - { - const char* config = ci->c_str(); - target.GenerateTargetManifest(config); - } + const char* config = ci->c_str(); + target.GenerateTargetManifest(config); } } } diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h index 5ab8ebb..a61ab16 100644 --- a/Source/cmVS11CLFlagTable.h +++ b/Source/cmVS11CLFlagTable.h @@ -248,9 +248,9 @@ static cmVS7FlagTable cmVS11CLFlagTable[] = {"ForcedUsingFiles", "FU", "Forced #using File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, - {"PREfastAdditionalOptions", "analyze:", - "Additional Code Analysis Native options", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, + {"PREfastLog", "analyze:log", + "Code Analysis Log", + "", cmVS7FlagTable::UserFollowing}, {"PREfastAdditionalPlugins", "analyze:plugin", "Additional Code Analysis Native plugins", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, @@ -283,9 +283,6 @@ static cmVS7FlagTable cmVS11CLFlagTable[] = "", cmVS7FlagTable::UserValue}, // Skip [XMLDocumentationFileName] - no command line Switch. // Skip [BrowseInformationFile] - no command line Switch. - {"PREfastLog", "analyze:log ", - "Code Analysis Log", - "", cmVS7FlagTable::UserValue}, // Skip [AdditionalOptions] - no command line Switch. {0,0,0,0,0} }; diff --git a/Source/cmVS12CLFlagTable.h b/Source/cmVS12CLFlagTable.h index 8f51319..0a7916f 100644 --- a/Source/cmVS12CLFlagTable.h +++ b/Source/cmVS12CLFlagTable.h @@ -254,9 +254,9 @@ static cmVS7FlagTable cmVS12CLFlagTable[] = {"ForcedUsingFiles", "FU", "Forced #using File", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, - {"PREfastAdditionalOptions", "analyze:", - "Additional Code Analysis Native options", - "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, + {"PREfastLog", "analyze:log", + "Code Analysis Log", + "", cmVS7FlagTable::UserFollowing}, {"PREfastAdditionalPlugins", "analyze:plugin", "Additional Code Analysis Native plugins", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, @@ -289,9 +289,6 @@ static cmVS7FlagTable cmVS12CLFlagTable[] = "", cmVS7FlagTable::UserValue}, // Skip [XMLDocumentationFileName] - no command line Switch. // Skip [BrowseInformationFile] - no command line Switch. - {"PREfastLog", "analyze:log ", - "Code Analysis Log", - "", cmVS7FlagTable::UserValue}, // Skip [AdditionalOptions] - no command line Switch. {0,0,0,0,0} }; diff --git a/Utilities/Sphinx/CMakeLists.txt b/Utilities/Sphinx/CMakeLists.txt index 51c83ba..4ae4bec 100644 --- a/Utilities/Sphinx/CMakeLists.txt +++ b/Utilities/Sphinx/CMakeLists.txt @@ -75,6 +75,10 @@ if(SPHINX_QTHELP) list(APPEND doc_formats qthelp) set(qthelp_extra_commands + # Workaround for assistant prior to + # https://codereview.qt-project.org/#change,82250 in Qt 4. + COMMAND ${CMAKE_COMMAND} "-DCSS_DIR=${CMAKE_CURRENT_BINARY_DIR}/qthelp/_static" + -P "${CMAKE_CURRENT_SOURCE_DIR}/apply_qthelp_css_workaround.cmake" COMMAND qcollectiongenerator ${CMAKE_CURRENT_BINARY_DIR}/qthelp/CMake.qhcp ) endif() diff --git a/Utilities/Sphinx/apply_qthelp_css_workaround.cmake b/Utilities/Sphinx/apply_qthelp_css_workaround.cmake new file mode 100644 index 0000000..8b74d12 --- /dev/null +++ b/Utilities/Sphinx/apply_qthelp_css_workaround.cmake @@ -0,0 +1,15 @@ + +file(READ "${CSS_DIR}/basic.css" BasicCssContent) + +file(READ "${CSS_DIR}/default.css" DefaultCssContent) +string(REPLACE + "@import url(\"basic.css\")" "${BasicCssContent}" + DefaultCssContent "${DefaultCssContent}" +) + +file(READ "${CSS_DIR}/cmake.css" CMakeCssContent) +string(REPLACE + "@import url(\"default.css\")" "${DefaultCssContent}" + CMakeCssContent "${CMakeCssContent}" +) +file(WRITE "${CSS_DIR}/cmake.css" "${CMakeCssContent}") |