summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Auxiliary/CMakeLists.txt2
-rw-r--r--Auxiliary/cmake-help.vim21
-rw-r--r--Auxiliary/vim/cmake.vim.in91
-rwxr-xr-xAuxiliary/vim/extract-upper-case.pl141
-rw-r--r--Auxiliary/vim/indent/cmake.vim (renamed from Auxiliary/cmake-indent.vim)10
-rw-r--r--Auxiliary/vim/syntax/cmake.vim (renamed from Auxiliary/cmake-syntax.vim)11
-rw-r--r--Help/release/dev/vim-cmake-syntax.rst11
-rw-r--r--Source/CMakeLists.txt5
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx6
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx13
-rw-r--r--Source/CPack/cmCPackGenerator.cxx3
-rw-r--r--Source/CPack/cmCPackRPMGenerator.cxx13
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx3
-rw-r--r--Source/CTest/cmCTestCVS.cxx5
-rw-r--r--Source/CTest/cmCTestCoverageHandler.cxx9
-rw-r--r--Source/CTest/cmCTestLaunch.cxx9
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx37
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx3
-rw-r--r--Source/CTest/cmCTestP4.cxx3
-rw-r--r--Source/CTest/cmCTestRunTest.cxx6
-rw-r--r--Source/CTest/cmCTestSVN.cxx9
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx22
-rw-r--r--Source/CTest/cmCTestUploadCommand.cxx13
-rw-r--r--Source/CTest/cmParseBlanketJSCoverage.cxx3
-rw-r--r--Source/CTest/cmParseMumpsCoverage.cxx19
-rw-r--r--Source/CTest/cmProcess.cxx6
-rw-r--r--Source/CursesDialog/cmCursesBoolWidget.cxx3
-rw-r--r--Source/CursesDialog/cmCursesCacheEntryComposite.cxx3
-rw-r--r--Source/CursesDialog/cmCursesOptionsWidget.cxx45
-rw-r--r--Source/CursesDialog/cmCursesStringWidget.cxx8
-rw-r--r--Source/cmArchiveWrite.cxx9
-rw-r--r--Source/cmArchiveWrite.h14
-rw-r--r--Source/cmCLocaleEnvironmentScope.cxx1
-rw-r--r--Source/cmCLocaleEnvironmentScope.h5
-rw-r--r--Source/cmCPackPropertiesGenerator.cxx7
-rw-r--r--Source/cmCPackPropertiesGenerator.h8
-rw-r--r--Source/cmCTest.cxx11
-rw-r--r--Source/cmCacheManager.cxx9
-rw-r--r--Source/cmCacheManager.h10
-rw-r--r--Source/cmCommandArgumentParserHelper.cxx14
-rw-r--r--Source/cmCommands.h2
-rw-r--r--Source/cmCommonTargetGenerator.cxx10
-rw-r--r--Source/cmCommonTargetGenerator.h8
-rw-r--r--Source/cmComputeComponentGraph.h3
-rw-r--r--Source/cmComputeLinkDepends.cxx9
-rw-r--r--Source/cmComputeLinkDepends.h9
-rw-r--r--Source/cmComputeLinkInformation.cxx12
-rw-r--r--Source/cmComputeLinkInformation.h10
-rw-r--r--Source/cmComputeTargetDepends.cxx11
-rw-r--r--Source/cmComputeTargetDepends.h9
-rw-r--r--Source/cmCryptoHash.cxx24
-rw-r--r--Source/cmDependsFortran.cxx3
-rw-r--r--Source/cmDocumentation.cxx3
-rw-r--r--Source/cmELF.cxx27
-rw-r--r--Source/cmExportBuildFileGenerator.cxx7
-rw-r--r--Source/cmExprParserHelper.cxx5
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx43
-rw-r--r--Source/cmFileLockPool.cxx5
-rw-r--r--Source/cmFileTimeComparison.cxx27
-rw-r--r--Source/cmFortranParserImpl.cxx50
-rw-r--r--Source/cmGeneratorExpression.cxx3
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx23
-rw-r--r--Source/cmGeneratorExpressionNode.cxx6
-rw-r--r--Source/cmGeneratorTarget.cxx83
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx9
-rw-r--r--Source/cmInstallExportGenerator.cxx3
-rw-r--r--Source/cmListFileCache.cxx10
-rw-r--r--Source/cmLocalGenerator.cxx29
-rw-r--r--Source/cmMakefile.cxx167
-rw-r--r--Source/cmNewLineStyle.cxx15
-rw-r--r--Source/cmQtAutoGeneratorInitializer.cxx3
-rw-r--r--Source/cmSourceFile.cxx3
-rw-r--r--Source/cmState.cxx18
-rw-r--r--Source/cmSystemTools.cxx26
-rw-r--r--Source/cmTarget.cxx41
-rw-r--r--Source/cmUuid.cxx9
-rw-r--r--Source/cmake.cxx20
-rw-r--r--Source/cmakemain.cxx9
-rw-r--r--Source/cmcmd.cxx19
-rwxr-xr-xUtilities/Scripts/update-vim-syntax.bash24
-rw-r--r--Utilities/cmlibarchive/libarchive/xxhash.c5
82 files changed, 845 insertions, 580 deletions
diff --git a/Auxiliary/CMakeLists.txt b/Auxiliary/CMakeLists.txt
index c003b28..8eb74b7 100644
--- a/Auxiliary/CMakeLists.txt
+++ b/Auxiliary/CMakeLists.txt
@@ -1,4 +1,4 @@
-install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${CMAKE_DATA_DIR}/editors/vim)
+install(DIRECTORY vim/indent vim/syntax DESTINATION ${CMAKE_DATA_DIR}/editors/vim)
install(FILES cmake-mode.el DESTINATION ${CMAKE_DATA_DIR}/editors/emacs)
install(FILES cmake.m4 DESTINATION share/aclocal)
add_subdirectory (bash-completion)
diff --git a/Auxiliary/cmake-help.vim b/Auxiliary/cmake-help.vim
deleted file mode 100644
index 17cfa83..0000000
--- a/Auxiliary/cmake-help.vim
+++ /dev/null
@@ -1,21 +0,0 @@
-nmap ,hc :call OpenCmakeHelp()<CR>
-
-function! OpenCmakeHelp()
- let s = getline( '.' )
- let i = col( '.' ) - 1
- while i > 0 && strpart( s, i, 1 ) =~ '[A-Za-z0-9_]'
- let i = i - 1
- endwhile
- while i < col('$') && strpart( s, i, 1 ) !~ '[A-Za-z0-9_]'
- let i = i + 1
- endwhile
- let start = match( s, '[A-Za-z0-9_]\+', i )
- let end = matchend( s, '[A-Za-z0-9_]\+', i )
- let ident = strpart( s, start, end - start )
- execute "vertical new"
- execute "%!cmake --help-command ".ident
- set nomodified
- set readonly
-endfunction
-
-autocmd BufRead,BufNewFile *.cmake,CMakeLists.txt,*.cmake.in nmap <F1> :call OpenCmakeHelp()<CR>
diff --git a/Auxiliary/vim/cmake.vim.in b/Auxiliary/vim/cmake.vim.in
new file mode 100644
index 0000000..89ece66
--- /dev/null
+++ b/Auxiliary/vim/cmake.vim.in
@@ -0,0 +1,91 @@
+" vim: set nowrap:
+" Vim syntax file
+" Language: CMake
+" Author: Andy Cedilnik <andy.cedilnik@kitware.com>, Nicholas Hutchinson <nshutchinson@gmail.com>, Patrick Boettcher <patrick.boettcher@posteo.de>
+" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
+" Last Change: $Date$
+" Version: $Revision$
+"
+" Licence: The CMake license applies to this file. See
+" https://cmake.org/licensing
+" This implies that distribution with Vim is allowed
+
+if exists("b:current_syntax")
+ finish
+endif
+
+syn match cmakeEscaped /\(\\\\\|\\"\|\\n\|\\t\)/ contained
+syn region cmakeComment start="#" end="$" contains=cmakeTodo,@Spell
+syn region cmakeLuaComment start="\[\z(=*\)\[" end="\]\z1\]" contains=cmakeTodo,@Spell
+syn region cmakeGeneratorExpression start=/$</ end=/>/
+ \ contained oneline contains=CONTAINED,cmakeTodo,cmakeVariable,cmakeProperty,cmakeGeneratorExpressions
+syn region cmakeRegistry start=/\[/ end=/]/
+ \ contained oneline contains=CONTAINED,cmakeTodo,cmakeEscaped
+syn region cmakeVariableValue start=/\${/ end=/}/
+ \ contained oneline contains=CONTAINED,cmakeTodo,cmakeVariable
+syn region cmakeEnvironment start=/\$ENV{/ end=/}/
+ \ contained oneline contains=CONTAINED,cmakeTodo
+syn region cmakeString start=/"/ end=/"/
+ \ contains=CONTAINED,cmakeTodo
+syn region cmakeArguments start=/(/ end=/)/
+ \ contains=ALLBUT,cmakeArguments,cmakeTodo
+
+syn case match
+syn keyword cmakeProperty
+ \ ABSTRACT ADDITIONAL_MAKE_CLEAN_FILES ADVANCED ALIASED_TARGET ALLOW_DUPLICATE_CUSTOM_TARGETS ANDROID_ANT_ADDITIONAL_OPTIONS ANDROID_API ANDROID_API_MIN ANDROID_ARCH ANDROID_ASSETS_DIRECTORIES ANDROID_GUI ANDROID_JAR_DEPENDENCIES ANDROID_JAR_DIRECTORIES ANDROID_JAVA_SOURCE_DIR ANDROID_NATIVE_LIB_DEPENDENCIES ANDROID_NATIVE_LIB_DIRECTORIES ANDROID_PROCESS_MAX ANDROID_PROGUARD ANDROID_PROGUARD_CONFIG_PATH ANDROID_SECURE_PROPS_PATH ANDROID_SKIP_ANT_STEP ANDROID_STL_TYPE ARCHIVE_OUTPUT_DIRECTORY ARCHIVE_OUTPUT_DIRECTORY_DEBUG ARCHIVE_OUTPUT_DIRECTORY_RELEASE ARCHIVE_OUTPUT_NAME ARCHIVE_OUTPUT_NAME_DEBUG ARCHIVE_OUTPUT_NAME_RELEASE ATTACHED_FILES ATTACHED_FILES_ON_FAIL AUTOGEN_TARGETS_FOLDER AUTOGEN_TARGET_DEPENDS AUTOMOC AUTOMOC_MOC_OPTIONS AUTOMOC_TARGETS_FOLDER AUTORCC AUTORCC_OPTIONS AUTOUIC AUTOUIC_OPTIONS BINARY_DIR BUILD_WITH_INSTALL_RPATH BUNDLE BUNDLE_EXTENSION CACHE_VARIABLES CLEAN_NO_CUSTOM CMAKE_CONFIGURE_DEPENDS CMAKE_CXX_KNOWN_FEATURES CMAKE_C_KNOWN_FEATURES COMPATIBLE_INTERFACE_BOOL COMPATIBLE_INTERFACE_NUMBER_MAX COMPATIBLE_INTERFACE_NUMBER_MIN COMPATIBLE_INTERFACE_STRING COMPILE_DEFINITIONS COMPILE_DEFINITIONS_DEBUG COMPILE_DEFINITIONS_RELEASE COMPILE_FEATURES COMPILE_FLAGS COMPILE_OPTIONS COMPILE_PDB_NAME COMPILE_PDB_NAME_DEBUG COMPILE_PDB_NAME_RELEASE COMPILE_PDB_OUTPUT_DIRECTORY COMPILE_PDB_OUTPUT_DIRECTORY_DEBUG COMPILE_PDB_OUTPUT_DIRECTORY_RELEASE COST CPACK_DESKTOP_SHORTCUTS CPACK_NEVER_OVERWRITE CPACK_PERMANENT CPACK_STARTUP_SHORTCUTS CPACK_START_MENU_SHORTCUTS CPACK_WIX_ACL CROSSCOMPILING_EMULATOR CXX_EXTENSIONS CXX_STANDARD CXX_STANDARD_REQUIRED C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED DEBUG_CONFIGURATIONS DEBUG_POSTFIX DEFINE_SYMBOL DEFINITIONS DEPENDS DISABLED_FEATURES ECLIPSE_EXTRA_NATURES ENABLED_FEATURES ENABLED_LANGUAGES ENABLE_EXPORTS ENVIRONMENT EXCLUDE_FROM_ALL EXCLUDE_FROM_DEFAULT_BUILD EXCLUDE_FROM_DEFAULT_BUILD_DEBUG EXCLUDE_FROM_DEFAULT_BUILD_RELEASE EXPORT_NAME EXTERNAL_OBJECT EchoString FAIL_REGULAR_EXPRESSION FIND_LIBRARY_USE_LIB64_PATHS FIND_LIBRARY_USE_OPENBSD_VERSIONING FOLDER FRAMEWORK FRAMEWORK_VERSION Fortran_FORMAT Fortran_MODULE_DIRECTORY GENERATED GENERATOR_FILE_NAME GLOBAL_DEPENDS_DEBUG_MODE GLOBAL_DEPENDS_NO_CYCLES GNUtoMS HAS_CXX HEADER_FILE_ONLY HELPSTRING IMPLICIT_DEPENDS_INCLUDE_TRANSFORM IMPORTED IMPORTED_CONFIGURATIONS IMPORTED_IMPLIB IMPORTED_IMPLIB_DEBUG IMPORTED_IMPLIB_RELEASE IMPORTED_LINK_DEPENDENT_LIBRARIES IMPORTED_LINK_DEPENDENT_LIBRARIES_DEBUG IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_LANGUAGES IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE IMPORTED_LINK_INTERFACE_LIBRARIES IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE IMPORTED_LINK_INTERFACE_MULTIPLICITY IMPORTED_LINK_INTERFACE_MULTIPLICITY_DEBUG IMPORTED_LINK_INTERFACE_MULTIPLICITY_RELEASE IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE IMPORTED_NO_SONAME IMPORTED_NO_SONAME_DEBUG IMPORTED_NO_SONAME_RELEASE IMPORTED_SONAME IMPORTED_SONAME_DEBUG IMPORTED_SONAME_RELEASE IMPORT_PREFIX IMPORT_SUFFIX INCLUDE_DIRECTORIES INCLUDE_REGULAR_EXPRESSION INSTALL_NAME_DIR INSTALL_RPATH INSTALL_RPATH_USE_LINK_PATH INTERFACE_AUTOUIC_OPTIONS INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES INTERFACE_COMPILE_OPTIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_LINK_LIBRARIES INTERFACE_POSITION_INDEPENDENT_CODE INTERFACE_SOURCES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES INTERPROCEDURAL_OPTIMIZATION INTERPROCEDURAL_OPTIMIZATION_DEBUG INTERPROCEDURAL_OPTIMIZATION_RELEASE IN_TRY_COMPILE JOB_POOLS JOB_POOL_COMPILE JOB_POOL_LINK KEEP_EXTENSION LABELS LANGUAGE LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_DEBUG LIBRARY_OUTPUT_DIRECTORY_RELEASE LIBRARY_OUTPUT_NAME LIBRARY_OUTPUT_NAME_DEBUG LIBRARY_OUTPUT_NAME_RELEASE LINKER_LANGUAGE LINK_DEPENDS LINK_DEPENDS_NO_SHARED LINK_DIRECTORIES LINK_FLAGS LINK_FLAGS_DEBUG LINK_FLAGS_RELEASE LINK_INTERFACE_LIBRARIES LINK_INTERFACE_LIBRARIES_DEBUG LINK_INTERFACE_LIBRARIES_RELEASE LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_DEBUG LINK_INTERFACE_MULTIPLICITY_RELEASE LINK_LIBRARIES LINK_SEARCH_END_STATIC LINK_SEARCH_START_STATIC LISTFILE_STACK LOCATION LOCATION_DEBUG LOCATION_RELEASE MACOSX_BUNDLE MACOSX_BUNDLE_INFO_PLIST MACOSX_FRAMEWORK_INFO_PLIST MACOSX_PACKAGE_LOCATION MACOSX_RPATH MACROS MAP_IMPORTED_CONFIG_DEBUG MAP_IMPORTED_CONFIG_RELEASE MEASUREMENT MODIFIED NAME NO_SONAME NO_SYSTEM_FROM_IMPORTED OBJECT_DEPENDS OBJECT_OUTPUTS OSX_ARCHITECTURES OSX_ARCHITECTURES_DEBUG OSX_ARCHITECTURES_RELEASE OUTPUT_NAME OUTPUT_NAME_DEBUG OUTPUT_NAME_RELEASE PACKAGES_FOUND PACKAGES_NOT_FOUND PARENT_DIRECTORY PASS_REGULAR_EXPRESSION PDB_NAME PDB_NAME_DEBUG PDB_NAME_RELEASE PDB_OUTPUT_DIRECTORY PDB_OUTPUT_DIRECTORY_DEBUG PDB_OUTPUT_DIRECTORY_RELEASE POSITION_INDEPENDENT_CODE POST_INSTALL_SCRIPT PREDEFINED_TARGETS_FOLDER PREFIX PRE_INSTALL_SCRIPT PRIVATE_HEADER PROCESSORS PROJECT_LABEL PUBLIC_HEADER REPORT_UNDEFINED_PROPERTIES REQUIRED_FILES RESOURCE RESOURCE_LOCK RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK RULE_MESSAGES RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_DEBUG RUNTIME_OUTPUT_DIRECTORY_RELEASE RUNTIME_OUTPUT_NAME RUNTIME_OUTPUT_NAME_DEBUG RUNTIME_OUTPUT_NAME_RELEASE RUN_SERIAL SKIP_BUILD_RPATH SKIP_RETURN_CODE SOURCES SOURCE_DIR SOVERSION STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_DEBUG STATIC_LIBRARY_FLAGS_RELEASE STRINGS SUFFIX SYMBOLIC TARGET_ARCHIVES_MAY_BE_SHARED_LIBS TARGET_MESSAGES TARGET_SUPPORTS_SHARED_LIBS TEST_INCLUDE_FILE TIMEOUT TYPE USE_FOLDERS VALUE VARIABLES VERSION VISIBILITY_INLINES_HIDDEN VS_DEPLOYMENT_CONTENT VS_DEPLOYMENT_LOCATION VS_DESKTOP_EXTENSIONS_VERSION VS_DOTNET_REFERENCES VS_DOTNET_TARGET_FRAMEWORK_VERSION VS_GLOBAL_KEYWORD VS_GLOBAL_PROJECT_TYPES VS_GLOBAL_ROOTNAMESPACE VS_IOT_EXTENSIONS_VERSION VS_IOT_STARTUP_TASK VS_KEYWORD VS_MOBILE_EXTENSIONS_VERSION VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER VS_SHADER_ENTRYPOINT VS_SHADER_FLAGS VS_SHADER_MODEL VS_SHADER_TYPE VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES VS_XAML_TYPE WILL_FAIL WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS WORKING_DIRECTORY WRAP_EXCLUDE XCODE_EXPLICIT_FILE_TYPE XCODE_LAST_KNOWN_FILE_TYPE XCTEST
+ \ contained
+
+syn keyword cmakeVariable
+@VARIABLE_LIST@
+ \ contained
+
+syn keyword cmakeModule
+@MODULES@
+ \ contained
+
+@KEYWORDS@
+
+syn keyword cmakeGeneratorExpressions
+@GENERATOR_EXPRESSIONS@
+ \ contained
+
+syn case ignore
+syn keyword cmakeCommand
+@COMMAND_LIST@
+ \ nextgroup=cmakeArguments
+syn keyword cmakeCommandConditional
+@CONDITIONALS@
+ \ nextgroup=cmakeArguments
+syn keyword cmakeCommandRepeat
+@LOOPS@
+ \ nextgroup=cmakeArguments
+syn keyword cmakeCommandDeprecated
+@DEPRECATED@
+ \ nextgroup=cmakeArguments
+syn case match
+
+syn keyword cmakeTodo
+ \ TODO FIXME XXX
+ \ contained
+
+hi def link cmakeCommand Function
+hi def link cmakeCommandConditional Conditional
+hi def link cmakeCommandDeprecated WarningMsg
+hi def link cmakeCommandRepeat Repeat
+hi def link cmakeComment Comment
+hi def link cmakeEnvironment Special
+hi def link cmakeEscaped Special
+hi def link cmakeGeneratorExpression WarningMsg
+hi def link cmakeGeneratorExpressions ModeMsg
+hi def link cmakeLuaComment Comment
+hi def link cmakeModule Include
+hi def link cmakeProperty Constant
+hi def link cmakeRegistry Underlined
+hi def link cmakeString String
+hi def link cmakeTodo TODO
+hi def link cmakeVariable Identifier
+hi def link cmakeVariableValue Type
+
+@KEYWORDS_HIGHLIGHT@
+
+let b:current_syntax = "cmake"
diff --git a/Auxiliary/vim/extract-upper-case.pl b/Auxiliary/vim/extract-upper-case.pl
new file mode 100755
index 0000000..e945d52
--- /dev/null
+++ b/Auxiliary/vim/extract-upper-case.pl
@@ -0,0 +1,141 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+my @variables;
+my @commands;
+my @properties;
+my @modules;
+my %keywords; # command => keyword-list
+
+# unwanted upper-cases
+my %unwanted = map { $_ => 1 } qw(VS CXX IDE NOTFOUND NO_ DFOO DBAR);
+ # cannot remove ALL - exists for add_custom_command
+
+# control-statements
+my %conditional = map { $_ => 1 } qw(if else elseif endif);
+my %loop = map { $_ => 1 } qw(foreach while endforeach endwhile);
+
+# decrecated
+my %deprecated = map { $_ => 1 } qw(build_name exec_program export_library_dependencies install_files install_programs install_targets link_libraries make_directory output_required_files remove subdir_depends subdirs use_mangled_mesa utility_source variable_requires write_file);
+
+# add some (popular) modules
+push @modules, "ExternalProject";
+
+# variables
+open(CMAKE, "cmake --help-variable-list|") or die "could not run cmake";
+while (<CMAKE>) {
+ chomp;
+ push @variables, $_;
+}
+close(CMAKE);
+
+# transform all variables in a hash - to be able to use exists later on
+my %variables = map { $_ => 1 } @variables;
+
+# commands
+open(CMAKE, "cmake --help-command-list|");
+while (my $cmd = <CMAKE>) {
+ chomp $cmd;
+
+ push @commands, $cmd;
+}
+close(CMAKE);
+
+# now generate a keyword-list per command
+foreach my $cmd (@commands) {
+ my @word = extract_upper("cmake --help-command $cmd|");
+
+ next if scalar @word == 0;
+
+ $keywords{$cmd} = [ sort keys %{ { map { $_ => 1 } @word } } ];
+}
+
+# and now for modules
+foreach my $mod (@modules) {
+ my @word = extract_upper("cmake --help-module $mod|");
+
+ next if scalar @word == 0;
+
+ $keywords{$mod} = [ sort keys %{ { map { $_ => 1 } @word } } ];
+}
+
+# and now for generator-expressions
+my @generator_expr = extract_upper("cmake --help-manual cmake-generator-expressions |");
+
+# properties
+open(CMAKE, "cmake --help-property-list|");
+while (<CMAKE>) {
+ chomp;
+ push @properties, $_;
+}
+close(CMAKE);
+
+# generate cmake.vim
+open(IN, "<cmake.vim.in") or die "could not read cmake.vim.in";
+open(OUT, ">syntax/cmake.vim") or die "could not write to syntax/cmake.vim";
+
+my @keyword_hi;
+
+while(<IN>)
+{
+ if (m/\@([A-Z0-9_]+)\@/) { # match for @SOMETHING@
+ if ($1 eq "COMMAND_LIST") {
+ # do not include "special" commands in this list
+ my @tmp = grep { ! exists $conditional{$_} and
+ ! exists $loop{$_} and
+ ! exists $deprecated{$_} } @commands;
+ print OUT " " x 12 , "\\ ", join(" ", @tmp), "\n";
+ } elsif ($1 eq "VARIABLE_LIST") {
+ print OUT " " x 12 , "\\ ", join(" ", @variables), "\n";
+ } elsif ($1 eq "MODULES") {
+ print OUT " " x 12 , "\\ ", join("\n", @modules), "\n";
+ } elsif ($1 eq "GENERATOR_EXPRESSIONS") {
+ print OUT " " x 12 , "\\ ", join(" ", @generator_expr), "\n";
+ } elsif ($1 eq "CONDITIONALS") {
+ print OUT " " x 12 , "\\ ", join(" ", sort keys %conditional), "\n";
+ } elsif ($1 eq "LOOPS") {
+ print OUT " " x 12 , "\\ ", join(" ", sort keys %loop), "\n";
+ } elsif ($1 eq "DEPRECATED") {
+ print OUT " " x 12 , "\\ ", join(" ", sort keys %deprecated), "\n";
+ } elsif ($1 eq "KEYWORDS") {
+ foreach my $k (sort keys %keywords) {
+ print OUT "syn keyword cmakeKW$k\n";
+ print OUT " " x 12, "\\ ", join(" ", @{$keywords{$k}}), "\n";
+ print OUT " " x 12, "\\ contained\n";
+ print OUT "\n";
+ push @keyword_hi, "hi def link cmakeKW$k ModeMsg";
+ }
+ } elsif ($1 eq "KEYWORDS_HIGHLIGHT") {
+ print OUT join("\n", @keyword_hi), "\n";
+ } else {
+ print "ERROR do not know how to replace $1\n";
+ }
+ } else {
+ print OUT $_;
+ }
+}
+close(IN);
+close(OUT);
+
+sub extract_upper
+{
+ my $input = shift;
+ my @word;
+
+ open(KW, $input);
+ while (<KW>) {
+
+ foreach my $w (m/\b([A-Z_]{2,})\b/g) {
+ next
+ if exists $variables{$w} or # skip if it is a variable
+ exists $unwanted{$w}; # skip if not wanted
+
+ push @word, $w;
+ }
+ }
+ close(KW);
+
+ return @word;
+}
diff --git a/Auxiliary/cmake-indent.vim b/Auxiliary/vim/indent/cmake.vim
index fa088e4..76aff64 100644
--- a/Auxiliary/cmake-indent.vim
+++ b/Auxiliary/vim/indent/cmake.vim
@@ -1,13 +1,3 @@
-" =============================================================================
-"
-" Program: CMake - Cross-Platform Makefile Generator
-" Module: $RCSfile$
-" Language: VIM
-" Date: $Date$
-" Version: $Revision$
-"
-" =============================================================================
-
" Vim indent file
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
diff --git a/Auxiliary/cmake-syntax.vim b/Auxiliary/vim/syntax/cmake.vim
index 9ffc1e8..715676d 100644
--- a/Auxiliary/cmake-syntax.vim
+++ b/Auxiliary/vim/syntax/cmake.vim
@@ -36,7 +36,7 @@ syn keyword cmakeProperty
\ contained
syn keyword cmakeVariable
- \ <PROJECT-NAME>_BINARY_DIR <PROJECT-NAME>_SOURCE_DIR <PROJECT-NAME>_VERSION <PROJECT-NAME>_VERSION_MAJOR <PROJECT-NAME>_VERSION_MINOR <PROJECT-NAME>_VERSION_PATCH <PROJECT-NAME>_VERSION_TWEAK APPLE BORLAND BUILD_SHARED_LIBS CMAKE_<CONFIG>_POSTFIX CMAKE_<LANG>_ARCHIVE_APPEND CMAKE_<LANG>_ARCHIVE_CREATE CMAKE_<LANG>_ARCHIVE_FINISH CMAKE_<LANG>_COMPILER CMAKE_<LANG>_COMPILER_ABI CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN CMAKE_<LANG>_COMPILER_ID CMAKE_<LANG>_COMPILER_LAUNCHER CMAKE_<LANG>_COMPILER_LOADED CMAKE_<LANG>_COMPILER_TARGET CMAKE_<LANG>_COMPILER_VERSION CMAKE_<LANG>_COMPILE_OBJECT CMAKE_<LANG>_CREATE_SHARED_LIBRARY CMAKE_<LANG>_CREATE_SHARED_MODULE CMAKE_<LANG>_CREATE_STATIC_LIBRARY CMAKE_<LANG>_FLAGS CMAKE_<LANG>_FLAGS_DEBUG CMAKE_<LANG>_FLAGS_MINSIZEREL CMAKE_<LANG>_FLAGS_RELEASE CMAKE_<LANG>_FLAGS_RELWITHDEBINFO CMAKE_<LANG>_GHS_KERNEL_FLAGS_DEBUG CMAKE_<LANG>_GHS_KERNEL_FLAGS_MINSIZEREL CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELEASE CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO CMAKE_<LANG>_IGNORE_EXTENSIONS CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE CMAKE_<LANG>_LIBRARY_ARCHITECTURE CMAKE_<LANG>_LINKER_PREFERENCE CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES CMAKE_<LANG>_LINK_EXECUTABLE CMAKE_<LANG>_OUTPUT_EXTENSION CMAKE_<LANG>_PLATFORM_ID CMAKE_<LANG>_SIMULATE_ID CMAKE_<LANG>_SIMULATE_VERSION CMAKE_<LANG>_SIZEOF_DATA_PTR CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS CMAKE_<LANG>_VISIBILITY_PRESET CMAKE_ABSOLUTE_DESTINATION_FILES CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS CMAKE_ANDROID_API CMAKE_ANDROID_API_MIN CMAKE_ANDROID_ARCH CMAKE_ANDROID_ASSETS_DIRECTORIES CMAKE_ANDROID_GUI CMAKE_ANDROID_JAR_DEPENDENCIES CMAKE_ANDROID_JAR_DIRECTORIES CMAKE_ANDROID_JAVA_SOURCE_DIR CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES CMAKE_ANDROID_PROCESS_MAX CMAKE_ANDROID_PROGUARD CMAKE_ANDROID_PROGUARD_CONFIG_PATH CMAKE_ANDROID_SECURE_PROPS_PATH CMAKE_ANDROID_SKIP_ANT_STEP CMAKE_ANDROID_STL_TYPE CMAKE_APPBUNDLE_PATH CMAKE_AR CMAKE_ARCHIVE_OUTPUT_DIRECTORY CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> CMAKE_ARGC CMAKE_ARGV0 CMAKE_AUTOMOC CMAKE_AUTOMOC_MOC_OPTIONS CMAKE_AUTOMOC_RELAXED_MODE CMAKE_AUTORCC CMAKE_AUTORCC_OPTIONS CMAKE_AUTOUIC CMAKE_AUTOUIC_OPTIONS CMAKE_BACKWARDS_COMPATIBILITY CMAKE_BINARY_DIR CMAKE_BUILD_TOOL CMAKE_BUILD_TYPE CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_CACHEFILE_DIR CMAKE_CACHE_MAJOR_VERSION CMAKE_CACHE_MINOR_VERSION CMAKE_CACHE_PATCH_VERSION CMAKE_CFG_INTDIR CMAKE_CL_64 CMAKE_COLOR_MAKEFILE CMAKE_COMMAND CMAKE_COMPILER_2005 CMAKE_COMPILER_IS_GNU<LANG> CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> CMAKE_CONFIGURATION_TYPES CMAKE_CROSSCOMPILING CMAKE_CROSSCOMPILING_EMULATOR CMAKE_CMAKE_COMMAND CMAKE_CPACK_COMMAND CMAKE_CTEST_COMMAND CMAKE_CURRENT_BINARY_DIR CMAKE_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE CMAKE_CURRENT_LIST_LINE CMAKE_CURRENT_SOURCE_DIR CMAKE_CXX_COMPILE_FEATURES CMAKE_CXX_EXTENSIONS CMAKE_CXX_STANDARD CMAKE_CXX_STANDARD_REQUIRED CMAKE_C_COMPILE_FEATURES CMAKE_C_EXTENSIONS CMAKE_C_STANDARD CMAKE_C_STANDARD_REQUIRED CMAKE_DEBUG_POSTFIX CMAKE_DEBUG_TARGET_PROPERTIES CMAKE_DISABLE_FIND_PACKAGE_<PackageName> CMAKE_DL_LIBS CMAKE_EDIT_COMMAND CMAKE_ENABLE_EXPORTS CMAKE_ERROR_DEPRECATED CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_EXECUTABLE_SUFFIX CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS_<CONFIG> CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_EXTRA_GENERATOR CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES CMAKE_FIND_APPBUNDLE CMAKE_FIND_FRAMEWORK CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_NO_INSTALL_PREFIX CMAKE_FIND_PACKAGE_NAME CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_WARN_NO_MODULE CMAKE_FIND_ROOT_PATH CMAKE_FIND_ROOT_PATH_MODE_INCLUDE CMAKE_FIND_ROOT_PATH_MODE_LIBRARY CMAKE_FIND_ROOT_PATH_MODE_PACKAGE CMAKE_FIND_ROOT_PATH_MODE_PROGRAM CMAKE_FRAMEWORK_PATH CMAKE_Fortran_FORMAT CMAKE_Fortran_MODDIR_DEFAULT CMAKE_Fortran_MODDIR_FLAG CMAKE_Fortran_MODOUT_FLAG CMAKE_Fortran_MODULE_DIRECTORY CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GNUtoMS CMAKE_HOME_DIRECTORY CMAKE_HOST_APPLE CMAKE_HOST_SYSTEM CMAKE_HOST_SYSTEM_NAME CMAKE_HOST_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_UNIX CMAKE_HOST_WIN32 CMAKE_IGNORE_PATH CMAKE_IMPORT_LIBRARY_PREFIX CMAKE_IMPORT_LIBRARY_SUFFIX CMAKE_INCLUDE_CURRENT_DIR CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE CMAKE_INCLUDE_DIRECTORIES_BEFORE CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE CMAKE_INCLUDE_PATH CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CMAKE_INSTALL_MESSAGE CMAKE_INSTALL_NAME_DIR CMAKE_INSTALL_PREFIX CMAKE_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INTERNAL_PLATFORM_ABI CMAKE_IOS_INSTALL_COMBINED CMAKE_JOB_POOL_COMPILE CMAKE_JOB_POOL_LINK CMAKE_LIBRARY_ARCHITECTURE CMAKE_LIBRARY_ARCHITECTURE_REGEX CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> CMAKE_LIBRARY_PATH CMAKE_LIBRARY_PATH_FLAG CMAKE_LINK_DEF_FILE_FLAG CMAKE_LINK_DEPENDS_NO_SHARED CMAKE_LINK_INTERFACE_LIBRARIES CMAKE_LINK_LIBRARY_FILE_FLAG CMAKE_LINK_LIBRARY_FLAG CMAKE_LINK_LIBRARY_SUFFIX CMAKE_LINK_SEARCH_END_STATIC CMAKE_LINK_SEARCH_START_STATIC CMAKE_MACOSX_BUNDLE CMAKE_MACOSX_RPATH CMAKE_MAJOR_VERSION CMAKE_MAKE_PROGRAM CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> CMAKE_MATCH_COUNT CMAKE_MFC_FLAG CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_MINOR_VERSION CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS_<CONFIG> CMAKE_MODULE_PATH CMAKE_NOT_USING_CONFIG_FLAGS CMAKE_NO_BUILTIN_CHRPATH CMAKE_NO_SYSTEM_FROM_IMPORTED CMAKE_OBJECT_PATH_MAX CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT CMAKE_PARENT_LIST_FILE CMAKE_PATCH_VERSION CMAKE_PDB_OUTPUT_DIRECTORY CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> CMAKE_POLICY_DEFAULT_CMP<NNNN> CMAKE_POLICY_WARNING_CMP<NNNN> CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH CMAKE_PROGRAM_PATH CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE CMAKE_PROJECT_NAME CMAKE_RANLIB CMAKE_ROOT CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> CMAKE_SCRIPT_MODE_FILE CMAKE_SHARED_LIBRARY_PREFIX CMAKE_SHARED_LIBRARY_SUFFIX CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS_<CONFIG> CMAKE_SHARED_MODULE_PREFIX CMAKE_SHARED_MODULE_SUFFIX CMAKE_SIZEOF_VOID_P CMAKE_SKIP_BUILD_RPATH CMAKE_SKIP_INSTALL_ALL_DEPENDENCY CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RULES CMAKE_SKIP_RPATH CMAKE_SOURCE_DIR CMAKE_STAGING_PREFIX CMAKE_STANDARD_LIBRARIES CMAKE_STATIC_LIBRARY_PREFIX CMAKE_STATIC_LIBRARY_SUFFIX CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS_<CONFIG> CMAKE_SYSROOT CMAKE_SYSTEM CMAKE_SYSTEM_APPBUNDLE_PATH CMAKE_SYSTEM_FRAMEWORK_PATH CMAKE_SYSTEM_IGNORE_PATH CMAKE_SYSTEM_INCLUDE_PATH CMAKE_SYSTEM_LIBRARY_PATH CMAKE_SYSTEM_NAME CMAKE_SYSTEM_PREFIX_PATH CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_PROGRAM_PATH CMAKE_SYSTEM_VERSION CMAKE_TOOLCHAIN_FILE CMAKE_TRY_COMPILE_CONFIGURATION CMAKE_TWEAK_VERSION CMAKE_USER_MAKE_RULES_OVERRIDE CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG> CMAKE_USE_RELATIVE_PATHS CMAKE_VERBOSE_MAKEFILE CMAKE_VERSION CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_VS_DEVENV_COMMAND CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD CMAKE_VS_INTEL_Fortran_PROJECT_VERSION CMAKE_VS_MSBUILD_COMMAND CMAKE_VS_MSDEV_COMMAND CMAKE_VS_NsightTegra_VERSION CMAKE_VS_PLATFORM_NAME CMAKE_VS_PLATFORM_TOOLSET CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION CMAKE_WARN_DEPRECATED CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_WIN32_EXECUTABLE CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS CMAKE_XCODE_ATTRIBUTE_<an-attribute> CMAKE_XCODE_PLATFORM_TOOLSET CPACK_ABSOLUTE_DESTINATION_FILES CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CPACK_INCLUDE_TOPLEVEL_DIRECTORY CPACK_INSTALL_SCRIPT CPACK_PACKAGING_INSTALL_PREFIX CPACK_SET_DESTDIR CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CTEST_BINARY_DIRECTORY CTEST_BUILD_COMMAND CTEST_BUILD_NAME CTEST_BZR_COMMAND CTEST_BZR_UPDATE_OPTIONS CTEST_CHANGE_ID CTEST_CHECKOUT_COMMAND CTEST_CONFIGURATION_TYPE CTEST_CONFIGURE_COMMAND CTEST_COVERAGE_COMMAND CTEST_COVERAGE_EXTRA_FLAGS CTEST_CURL_OPTIONS CTEST_CUSTOM_COVERAGE_EXCLUDE CTEST_CUSTOM_ERROR_EXCEPTION CTEST_CUSTOM_ERROR_MATCH CTEST_CUSTOM_ERROR_POST_CONTEXT CTEST_CUSTOM_ERROR_PRE_CONTEXT CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MEMCHECK_IGNORE CTEST_CUSTOM_POST_MEMCHECK CTEST_CUSTOM_POST_TEST CTEST_CUSTOM_PRE_MEMCHECK CTEST_CUSTOM_PRE_TEST CTEST_CUSTOM_TEST_IGNORE CTEST_CUSTOM_WARNING_EXCEPTION CTEST_CUSTOM_WARNING_MATCH CTEST_CVS_CHECKOUT CTEST_CVS_COMMAND CTEST_CVS_UPDATE_OPTIONS CTEST_DROP_LOCATION CTEST_DROP_METHOD CTEST_DROP_SITE CTEST_DROP_SITE_CDASH CTEST_DROP_SITE_PASSWORD CTEST_DROP_SITE_USER CTEST_EXTRA_COVERAGE_GLOB CTEST_GIT_COMMAND CTEST_GIT_UPDATE_CUSTOM CTEST_GIT_UPDATE_OPTIONS CTEST_HG_COMMAND CTEST_HG_UPDATE_OPTIONS CTEST_MEMORYCHECK_COMMAND CTEST_MEMORYCHECK_COMMAND_OPTIONS CTEST_MEMORYCHECK_SANITIZER_OPTIONS CTEST_MEMORYCHECK_SUPPRESSIONS_FILE CTEST_MEMORYCHECK_TYPE CTEST_NIGHTLY_START_TIME CTEST_P4_CLIENT CTEST_P4_COMMAND CTEST_P4_OPTIONS CTEST_P4_UPDATE_OPTIONS CTEST_SCP_COMMAND CTEST_SITE CTEST_SOURCE_DIRECTORY CTEST_SVN_COMMAND CTEST_SVN_OPTIONS CTEST_SVN_UPDATE_OPTIONS CTEST_TEST_LOAD CTEST_TEST_TIMEOUT CTEST_TRIGGER_SITE CTEST_UPDATE_COMMAND CTEST_UPDATE_OPTIONS CTEST_UPDATE_VERSION_ONLY CTEST_USE_LAUNCHERS CYGWIN ENV EXECUTABLE_OUTPUT_PATH GHS-MULTI LIBRARY_OUTPUT_PATH MINGW MSVC MSVC10 MSVC11 MSVC12 MSVC14 MSVC60 MSVC70 MSVC71 MSVC80 MSVC90 MSVC_IDE MSVC_VERSION PROJECT_BINARY_DIR PROJECT_NAME PROJECT_SOURCE_DIR PROJECT_VERSION PROJECT_VERSION_MAJOR PROJECT_VERSION_MINOR PROJECT_VERSION_PATCH PROJECT_VERSION_TWEAK UNIX WIN32 WINCE WINDOWS_PHONE WINDOWS_STORE XCODE_VERSION
+ \ <PROJECT-NAME>_BINARY_DIR <PROJECT-NAME>_SOURCE_DIR <PROJECT-NAME>_VERSION <PROJECT-NAME>_VERSION_MAJOR <PROJECT-NAME>_VERSION_MINOR <PROJECT-NAME>_VERSION_PATCH <PROJECT-NAME>_VERSION_TWEAK APPLE BORLAND BUILD_SHARED_LIBS CMAKE_<CONFIG>_POSTFIX CMAKE_<LANG>_ARCHIVE_APPEND CMAKE_<LANG>_ARCHIVE_CREATE CMAKE_<LANG>_ARCHIVE_FINISH CMAKE_<LANG>_COMPILER CMAKE_<LANG>_COMPILER_ABI CMAKE_<LANG>_COMPILER_EXTERNAL_TOOLCHAIN CMAKE_<LANG>_COMPILER_ID CMAKE_<LANG>_COMPILER_LAUNCHER CMAKE_<LANG>_COMPILER_LOADED CMAKE_<LANG>_COMPILER_TARGET CMAKE_<LANG>_COMPILER_VERSION CMAKE_<LANG>_COMPILE_OBJECT CMAKE_<LANG>_CREATE_SHARED_LIBRARY CMAKE_<LANG>_CREATE_SHARED_MODULE CMAKE_<LANG>_CREATE_STATIC_LIBRARY CMAKE_<LANG>_FLAGS CMAKE_<LANG>_FLAGS_DEBUG CMAKE_<LANG>_FLAGS_MINSIZEREL CMAKE_<LANG>_FLAGS_RELEASE CMAKE_<LANG>_FLAGS_RELWITHDEBINFO CMAKE_<LANG>_GHS_KERNEL_FLAGS_DEBUG CMAKE_<LANG>_GHS_KERNEL_FLAGS_MINSIZEREL CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELEASE CMAKE_<LANG>_GHS_KERNEL_FLAGS_RELWITHDEBINFO CMAKE_<LANG>_IGNORE_EXTENSIONS CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES CMAKE_<LANG>_IMPLICIT_LINK_LIBRARIES CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE CMAKE_<LANG>_LIBRARY_ARCHITECTURE CMAKE_<LANG>_LINKER_PREFERENCE CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES CMAKE_<LANG>_LINK_EXECUTABLE CMAKE_<LANG>_OUTPUT_EXTENSION CMAKE_<LANG>_PLATFORM_ID CMAKE_<LANG>_SIMULATE_ID CMAKE_<LANG>_SIMULATE_VERSION CMAKE_<LANG>_SIZEOF_DATA_PTR CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS CMAKE_<LANG>_VISIBILITY_PRESET CMAKE_ABSOLUTE_DESTINATION_FILES CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS CMAKE_ANDROID_API CMAKE_ANDROID_API_MIN CMAKE_ANDROID_ARCH CMAKE_ANDROID_ASSETS_DIRECTORIES CMAKE_ANDROID_GUI CMAKE_ANDROID_JAR_DEPENDENCIES CMAKE_ANDROID_JAR_DIRECTORIES CMAKE_ANDROID_JAVA_SOURCE_DIR CMAKE_ANDROID_NATIVE_LIB_DEPENDENCIES CMAKE_ANDROID_NATIVE_LIB_DIRECTORIES CMAKE_ANDROID_PROCESS_MAX CMAKE_ANDROID_PROGUARD CMAKE_ANDROID_PROGUARD_CONFIG_PATH CMAKE_ANDROID_SECURE_PROPS_PATH CMAKE_ANDROID_SKIP_ANT_STEP CMAKE_ANDROID_STL_TYPE CMAKE_APPBUNDLE_PATH CMAKE_AR CMAKE_ARCHIVE_OUTPUT_DIRECTORY CMAKE_ARCHIVE_OUTPUT_DIRECTORY_<CONFIG> CMAKE_ARGC CMAKE_ARGV0 CMAKE_AUTOMOC CMAKE_AUTOMOC_MOC_OPTIONS CMAKE_AUTOMOC_RELAXED_MODE CMAKE_AUTORCC CMAKE_AUTORCC_OPTIONS CMAKE_AUTOUIC CMAKE_AUTOUIC_OPTIONS CMAKE_BACKWARDS_COMPATIBILITY CMAKE_BINARY_DIR CMAKE_BUILD_TOOL CMAKE_BUILD_TYPE CMAKE_BUILD_WITH_INSTALL_RPATH CMAKE_CACHEFILE_DIR CMAKE_CACHE_MAJOR_VERSION CMAKE_CACHE_MINOR_VERSION CMAKE_CACHE_PATCH_VERSION CMAKE_CFG_INTDIR CMAKE_CL_64 CMAKE_COLOR_MAKEFILE CMAKE_COMMAND CMAKE_COMPILER_2005 CMAKE_COMPILER_IS_GNU<LANG> CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_<CONFIG> CMAKE_CONFIGURATION_TYPES CMAKE_CROSSCOMPILING CMAKE_CROSSCOMPILING_EMULATOR CMAKE_CTEST_COMMAND CMAKE_CURRENT_BINARY_DIR CMAKE_CURRENT_LIST_DIR CMAKE_CURRENT_LIST_FILE CMAKE_CURRENT_LIST_LINE CMAKE_CURRENT_SOURCE_DIR CMAKE_CXX_COMPILE_FEATURES CMAKE_CXX_EXTENSIONS CMAKE_CXX_STANDARD CMAKE_CXX_STANDARD_REQUIRED CMAKE_C_COMPILE_FEATURES CMAKE_C_EXTENSIONS CMAKE_C_STANDARD CMAKE_C_STANDARD_REQUIRED CMAKE_DEBUG_POSTFIX CMAKE_DEBUG_TARGET_PROPERTIES CMAKE_DISABLE_FIND_PACKAGE_<PackageName> CMAKE_DL_LIBS CMAKE_EDIT_COMMAND CMAKE_ENABLE_EXPORTS CMAKE_ERROR_DEPRECATED CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_EXECUTABLE_SUFFIX CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS_<CONFIG> CMAKE_EXPORT_COMPILE_COMMANDS CMAKE_EXPORT_NO_PACKAGE_REGISTRY CMAKE_EXTRA_GENERATOR CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES CMAKE_FIND_APPBUNDLE CMAKE_FIND_FRAMEWORK CMAKE_FIND_LIBRARY_PREFIXES CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_NO_INSTALL_PREFIX CMAKE_FIND_PACKAGE_NAME CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY CMAKE_FIND_PACKAGE_WARN_NO_MODULE CMAKE_FIND_ROOT_PATH CMAKE_FIND_ROOT_PATH_MODE_INCLUDE CMAKE_FIND_ROOT_PATH_MODE_LIBRARY CMAKE_FIND_ROOT_PATH_MODE_PACKAGE CMAKE_FIND_ROOT_PATH_MODE_PROGRAM CMAKE_FRAMEWORK_PATH CMAKE_Fortran_FORMAT CMAKE_Fortran_MODDIR_DEFAULT CMAKE_Fortran_MODDIR_FLAG CMAKE_Fortran_MODOUT_FLAG CMAKE_Fortran_MODULE_DIRECTORY CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET CMAKE_GNUtoMS CMAKE_HOME_DIRECTORY CMAKE_HOST_APPLE CMAKE_HOST_SYSTEM CMAKE_HOST_SYSTEM_NAME CMAKE_HOST_SYSTEM_PROCESSOR CMAKE_HOST_SYSTEM_VERSION CMAKE_HOST_UNIX CMAKE_HOST_WIN32 CMAKE_IGNORE_PATH CMAKE_IMPORT_LIBRARY_PREFIX CMAKE_IMPORT_LIBRARY_SUFFIX CMAKE_INCLUDE_CURRENT_DIR CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE CMAKE_INCLUDE_DIRECTORIES_BEFORE CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE CMAKE_INCLUDE_PATH CMAKE_INSTALL_DEFAULT_COMPONENT_NAME CMAKE_INSTALL_MESSAGE CMAKE_INSTALL_NAME_DIR CMAKE_INSTALL_PREFIX CMAKE_INSTALL_RPATH CMAKE_INSTALL_RPATH_USE_LINK_PATH CMAKE_INTERNAL_PLATFORM_ABI CMAKE_IOS_INSTALL_COMBINED CMAKE_JOB_POOL_COMPILE CMAKE_JOB_POOL_LINK CMAKE_LIBRARY_ARCHITECTURE CMAKE_LIBRARY_ARCHITECTURE_REGEX CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY_<CONFIG> CMAKE_LIBRARY_PATH CMAKE_LIBRARY_PATH_FLAG CMAKE_LINK_DEF_FILE_FLAG CMAKE_LINK_DEPENDS_NO_SHARED CMAKE_LINK_INTERFACE_LIBRARIES CMAKE_LINK_LIBRARY_FILE_FLAG CMAKE_LINK_LIBRARY_FLAG CMAKE_LINK_LIBRARY_SUFFIX CMAKE_LINK_SEARCH_END_STATIC CMAKE_LINK_SEARCH_START_STATIC CMAKE_MACOSX_BUNDLE CMAKE_MACOSX_RPATH CMAKE_MAJOR_VERSION CMAKE_MAKE_PROGRAM CMAKE_MAP_IMPORTED_CONFIG_<CONFIG> CMAKE_MATCH_COUNT CMAKE_MFC_FLAG CMAKE_MINIMUM_REQUIRED_VERSION CMAKE_MINOR_VERSION CMAKE_MODULE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS_<CONFIG> CMAKE_MODULE_PATH CMAKE_NOT_USING_CONFIG_FLAGS CMAKE_NO_BUILTIN_CHRPATH CMAKE_NO_SYSTEM_FROM_IMPORTED CMAKE_OBJECT_PATH_MAX CMAKE_OSX_ARCHITECTURES CMAKE_OSX_DEPLOYMENT_TARGET CMAKE_OSX_SYSROOT CMAKE_PARENT_LIST_FILE CMAKE_PATCH_VERSION CMAKE_PDB_OUTPUT_DIRECTORY CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> CMAKE_POLICY_DEFAULT_CMP<NNNN> CMAKE_POLICY_WARNING_CMP<NNNN> CMAKE_POSITION_INDEPENDENT_CODE CMAKE_PREFIX_PATH CMAKE_PROGRAM_PATH CMAKE_PROJECT_<PROJECT-NAME>_INCLUDE CMAKE_PROJECT_NAME CMAKE_RANLIB CMAKE_ROOT CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_RUNTIME_OUTPUT_DIRECTORY_<CONFIG> CMAKE_SCRIPT_MODE_FILE CMAKE_SHARED_LIBRARY_PREFIX CMAKE_SHARED_LIBRARY_SUFFIX CMAKE_SHARED_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS_<CONFIG> CMAKE_SHARED_MODULE_PREFIX CMAKE_SHARED_MODULE_SUFFIX CMAKE_SIZEOF_VOID_P CMAKE_SKIP_BUILD_RPATH CMAKE_SKIP_INSTALL_ALL_DEPENDENCY CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RULES CMAKE_SKIP_RPATH CMAKE_SOURCE_DIR CMAKE_STAGING_PREFIX CMAKE_STANDARD_LIBRARIES CMAKE_STATIC_LIBRARY_PREFIX CMAKE_STATIC_LIBRARY_SUFFIX CMAKE_STATIC_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS_<CONFIG> CMAKE_SYSROOT CMAKE_SYSTEM CMAKE_SYSTEM_APPBUNDLE_PATH CMAKE_SYSTEM_FRAMEWORK_PATH CMAKE_SYSTEM_IGNORE_PATH CMAKE_SYSTEM_INCLUDE_PATH CMAKE_SYSTEM_LIBRARY_PATH CMAKE_SYSTEM_NAME CMAKE_SYSTEM_PREFIX_PATH CMAKE_SYSTEM_PROCESSOR CMAKE_SYSTEM_PROGRAM_PATH CMAKE_SYSTEM_VERSION CMAKE_TOOLCHAIN_FILE CMAKE_TRY_COMPILE_CONFIGURATION CMAKE_TWEAK_VERSION CMAKE_USER_MAKE_RULES_OVERRIDE CMAKE_USER_MAKE_RULES_OVERRIDE_<LANG> CMAKE_USE_RELATIVE_PATHS CMAKE_VERBOSE_MAKEFILE CMAKE_VERSION CMAKE_VISIBILITY_INLINES_HIDDEN CMAKE_VS_DEVENV_COMMAND CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD CMAKE_VS_INTEL_Fortran_PROJECT_VERSION CMAKE_VS_MSBUILD_COMMAND CMAKE_VS_MSDEV_COMMAND CMAKE_VS_NsightTegra_VERSION CMAKE_VS_PLATFORM_NAME CMAKE_VS_PLATFORM_TOOLSET CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION CMAKE_WARN_DEPRECATED CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CMAKE_WIN32_EXECUTABLE CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS CMAKE_XCODE_ATTRIBUTE_<an-attribute> CMAKE_XCODE_PLATFORM_TOOLSET CPACK_ABSOLUTE_DESTINATION_FILES CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION CPACK_INCLUDE_TOPLEVEL_DIRECTORY CPACK_INSTALL_SCRIPT CPACK_PACKAGING_INSTALL_PREFIX CPACK_SET_DESTDIR CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION CTEST_BINARY_DIRECTORY CTEST_BUILD_COMMAND CTEST_BUILD_NAME CTEST_BZR_COMMAND CTEST_BZR_UPDATE_OPTIONS CTEST_CHANGE_ID CTEST_CHECKOUT_COMMAND CTEST_CONFIGURATION_TYPE CTEST_CONFIGURE_COMMAND CTEST_COVERAGE_COMMAND CTEST_COVERAGE_EXTRA_FLAGS CTEST_CURL_OPTIONS CTEST_CUSTOM_COVERAGE_EXCLUDE CTEST_CUSTOM_ERROR_EXCEPTION CTEST_CUSTOM_ERROR_MATCH CTEST_CUSTOM_ERROR_POST_CONTEXT CTEST_CUSTOM_ERROR_PRE_CONTEXT CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE CTEST_CUSTOM_MEMCHECK_IGNORE CTEST_CUSTOM_POST_MEMCHECK CTEST_CUSTOM_POST_TEST CTEST_CUSTOM_PRE_MEMCHECK CTEST_CUSTOM_PRE_TEST CTEST_CUSTOM_TEST_IGNORE CTEST_CUSTOM_WARNING_EXCEPTION CTEST_CUSTOM_WARNING_MATCH CTEST_CVS_CHECKOUT CTEST_CVS_COMMAND CTEST_CVS_UPDATE_OPTIONS CTEST_DROP_LOCATION CTEST_DROP_METHOD CTEST_DROP_SITE CTEST_DROP_SITE_CDASH CTEST_DROP_SITE_PASSWORD CTEST_DROP_SITE_USER CTEST_EXTRA_COVERAGE_GLOB CTEST_GIT_COMMAND CTEST_GIT_UPDATE_CUSTOM CTEST_GIT_UPDATE_OPTIONS CTEST_HG_COMMAND CTEST_HG_UPDATE_OPTIONS CTEST_MEMORYCHECK_COMMAND CTEST_MEMORYCHECK_COMMAND_OPTIONS CTEST_MEMORYCHECK_SANITIZER_OPTIONS CTEST_MEMORYCHECK_SUPPRESSIONS_FILE CTEST_MEMORYCHECK_TYPE CTEST_NIGHTLY_START_TIME CTEST_P4_CLIENT CTEST_P4_COMMAND CTEST_P4_OPTIONS CTEST_P4_UPDATE_OPTIONS CTEST_SCP_COMMAND CTEST_SITE CTEST_SOURCE_DIRECTORY CTEST_SVN_COMMAND CTEST_SVN_OPTIONS CTEST_SVN_UPDATE_OPTIONS CTEST_TEST_LOAD CTEST_TEST_TIMEOUT CTEST_TRIGGER_SITE CTEST_UPDATE_COMMAND CTEST_UPDATE_OPTIONS CTEST_UPDATE_VERSION_ONLY CTEST_USE_LAUNCHERS CYGWIN ENV EXECUTABLE_OUTPUT_PATH GHS-MULTI LIBRARY_OUTPUT_PATH MINGW MSVC MSVC10 MSVC11 MSVC12 MSVC14 MSVC60 MSVC70 MSVC71 MSVC80 MSVC90 MSVC_IDE MSVC_VERSION PROJECT_BINARY_DIR PROJECT_NAME PROJECT_SOURCE_DIR PROJECT_VERSION PROJECT_VERSION_MAJOR PROJECT_VERSION_MINOR PROJECT_VERSION_PATCH PROJECT_VERSION_TWEAK UNIX WIN32 WINCE WINDOWS_PHONE WINDOWS_STORE XCODE_VERSION
\ contained
syn keyword cmakeModule
@@ -60,7 +60,7 @@ syn keyword cmakeKWadd_custom_target
\ contained
syn keyword cmakeKWadd_definitions
- \ COMPILE_DEFINITIONS DBAR DFOO
+ \ COMPILE_DEFINITIONS
\ contained
syn keyword cmakeKWadd_dependencies
@@ -319,10 +319,6 @@ syn keyword cmakeKWremove
\ REMOVE_ITEM VALUE VAR
\ contained
-syn keyword cmakeKWremove_definitions
- \ DBAR DFOO
- \ contained
-
syn keyword cmakeKWseparate_arguments
\ MSDN UNIX_COMMAND VARIABLE WINDOWS WINDOWS_COMMAND _COMMAND
\ contained
@@ -451,7 +447,7 @@ hi def link cmakeComment Comment
hi def link cmakeEnvironment Special
hi def link cmakeEscaped Special
hi def link cmakeGeneratorExpression WarningMsg
-hi def link cmakeGeneratorExpressions Keyword
+hi def link cmakeGeneratorExpressions ModeMsg
hi def link cmakeLuaComment Comment
hi def link cmakeModule Include
hi def link cmakeProperty Constant
@@ -530,7 +526,6 @@ hi def link cmakeKWmessage ModeMsg
hi def link cmakeKWoption ModeMsg
hi def link cmakeKWproject ModeMsg
hi def link cmakeKWremove ModeMsg
-hi def link cmakeKWremove_definitions ModeMsg
hi def link cmakeKWseparate_arguments ModeMsg
hi def link cmakeKWset ModeMsg
hi def link cmakeKWset_directory_properties ModeMsg
diff --git a/Help/release/dev/vim-cmake-syntax.rst b/Help/release/dev/vim-cmake-syntax.rst
new file mode 100644
index 0000000..1757f9c
--- /dev/null
+++ b/Help/release/dev/vim-cmake-syntax.rst
@@ -0,0 +1,11 @@
+vim-cmake-syntax
+----------------
+
+* Vim support files ``indent/cmake.vim`` and ``syntax/cmake.vim``
+ from the `vim-cmake-syntax`_ project are now distributed with CMake.
+
+* Vim support files ``cmake-indent.vim``, ``cmake-syntax.vim``, and
+ ``cmake-help.vim`` have been removed in favor of the files now provided
+ from the `vim-cmake-syntax`_ project.
+
+.. _`vim-cmake-syntax`: https://github.com/pboettch/vim-cmake-syntax
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index b68675d..e63bf5a 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -45,9 +45,12 @@ endif()
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
-# ensure Unicode friendly APIs are used on Windows
if(WIN32)
+ # ensure Unicode friendly APIs are used on Windows
add_definitions(-DUNICODE -D_UNICODE)
+
+ # minimize windows.h content
+ add_definitions(-DWIN32_LEAN_AND_MEAN)
endif()
# configure the .dox.in file
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index ca31b76..aabc839 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 6)
-set(CMake_VERSION_PATCH 20160818)
+set(CMake_VERSION_PATCH 20160824)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 9120a2f..0d3725d 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -231,10 +231,8 @@ int cmCPackArchiveGenerator::PackageFiles()
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- else {
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
- }
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 3edc430..1f3ac51 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -242,15 +242,11 @@ int cmCPackDebGenerator::PackageFiles()
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- else {
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
- }
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
- else {
- return PackageComponentsAllInOne("");
- }
+ return PackageComponentsAllInOne("");
}
int cmCPackDebGenerator::createDeb()
@@ -694,9 +690,8 @@ std::string cmCPackDebGenerator::GetComponentInstallDirNameSuffix(
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
if (CM_NULLPTR != GetOption(groupVar)) {
return std::string(GetOption(groupVar));
- } else {
- return componentName;
}
+ return componentName;
}
// The following code is taken from OpenBSD ar:
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 58a2243..96c218c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -67,7 +67,8 @@ int cmCPackGenerator::PrepareNames()
cmCPackLog::LOG_ERROR, "CPACK_SET_DESTDIR is set to ON but the '"
<< Name << "' generator does NOT support it." << std::endl);
return 0;
- } else if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
+ }
+ if (SETDESTDIR_SHOULD_NOT_BE_USED == SupportsSetDestdir()) {
cmCPackLogger(cmCPackLog::LOG_WARNING,
"CPACK_SET_DESTDIR is set to ON but it is "
<< "usually a bad idea to do that with '" << Name
diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx
index 2568d17..5d81a49 100644
--- a/Source/CPack/cmCPackRPMGenerator.cxx
+++ b/Source/CPack/cmCPackRPMGenerator.cxx
@@ -215,15 +215,11 @@ int cmCPackRPMGenerator::PackageFiles()
// There will be 1 package for each component group
// however one may require to ignore component group and
// in this case you'll get 1 package for each component.
- else {
- return PackageComponents(componentPackageMethod ==
- ONE_PACKAGE_PER_COMPONENT);
- }
+ return PackageComponents(componentPackageMethod ==
+ ONE_PACKAGE_PER_COMPONENT);
}
// CASE 3 : NON COMPONENT package.
- else {
- return PackageComponentsAllInOne("");
- }
+ return PackageComponentsAllInOne("");
}
bool cmCPackRPMGenerator::SupportsComponentInstallation() const
@@ -247,7 +243,6 @@ std::string cmCPackRPMGenerator::GetComponentInstallDirNameSuffix(
"CPACK_COMPONENT_" + cmSystemTools::UpperCase(componentName) + "_GROUP";
if (CM_NULLPTR != GetOption(groupVar)) {
return std::string(GetOption(groupVar));
- } else {
- return componentName;
}
+ return componentName;
}
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index f96ef6d..230e8c5 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -532,9 +532,8 @@ public:
if (this->FTC->FileTimeCompare(l.c_str(), r.c_str(), &result) &&
result != 0) {
return result < 0;
- } else {
- return l < r;
}
+ return l < r;
}
private:
diff --git a/Source/CTest/cmCTestCVS.cxx b/Source/CTest/cmCTestCVS.cxx
index 37bdf9a..fb96308 100644
--- a/Source/CTest/cmCTestCVS.cxx
+++ b/Source/CTest/cmCTestCVS.cxx
@@ -216,10 +216,9 @@ std::string cmCTestCVS::ComputeBranchFlag(std::string const& dir)
std::string flag = "-r";
flag += tagLine.substr(1);
return flag;
- } else {
- // Use the default branch.
- return "-b";
}
+ // Use the default branch.
+ return "-b";
}
void cmCTestCVS::LoadRevisions(std::string const& file, const char* branchFlag,
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx
index 3f37f2a..dd6eb3a 100644
--- a/Source/CTest/cmCTestCoverageHandler.cxx
+++ b/Source/CTest/cmCTestCoverageHandler.cxx
@@ -763,12 +763,11 @@ int cmCTestCoverageHandler::HandleMumpsCoverage(
this->Quiet);
cov.ReadCoverageFile(coverageFile.c_str());
return static_cast<int>(cont->TotalCoverage.size());
- } else {
- cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
- " Cannot find GTM coverage file: " << coverageFile
- << std::endl,
- this->Quiet);
}
+ cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+ " Cannot find GTM coverage file: " << coverageFile
+ << std::endl,
+ this->Quiet);
cmParseCacheCoverage ccov(*cont, this->CTest);
coverageFile = this->CTest->GetBinaryDir() + "/cache_coverage.cmcov";
if (cmSystemTools::FileExists(coverageFile.c_str())) {
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 3eed79e..fedcb1f 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -126,12 +126,11 @@ bool cmCTestLaunch::ParseArguments(int argc, const char* const* argv)
this->HandleRealArg(this->RealArgV[i]);
}
return true;
- } else {
- this->RealArgC = 0;
- this->RealArgV = CM_NULLPTR;
- std::cerr << "No launch/command separator ('--') found!\n";
- return false;
}
+ this->RealArgC = 0;
+ this->RealArgV = CM_NULLPTR;
+ std::cerr << "No launch/command separator ('--') found!\n";
+ return false;
}
void cmCTestLaunch::HandleRealArg(const char* arg)
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index a06c351..7d0715f 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -638,27 +638,24 @@ bool cmCTestMemCheckHandler::ProcessMemCheckOutput(const std::string& str,
std::string& log,
std::vector<int>& results)
{
- if (this->MemoryTesterStyle == cmCTestMemCheckHandler::VALGRIND) {
- return this->ProcessMemCheckValgrindOutput(str, log, results);
- } else if (this->MemoryTesterStyle == cmCTestMemCheckHandler::PURIFY) {
- return this->ProcessMemCheckPurifyOutput(str, log, results);
- } else if (this->MemoryTesterStyle ==
- cmCTestMemCheckHandler::ADDRESS_SANITIZER ||
- this->MemoryTesterStyle ==
- cmCTestMemCheckHandler::THREAD_SANITIZER ||
- this->MemoryTesterStyle ==
- cmCTestMemCheckHandler::MEMORY_SANITIZER ||
- this->MemoryTesterStyle == cmCTestMemCheckHandler::UB_SANITIZER) {
- return this->ProcessMemCheckSanitizerOutput(str, log, results);
- } else if (this->MemoryTesterStyle ==
- cmCTestMemCheckHandler::BOUNDS_CHECKER) {
- return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
- } else {
- log.append("\nMemory checking style used was: ");
- log.append("None that I know");
- log = str;
+ switch (this->MemoryTesterStyle) {
+ case cmCTestMemCheckHandler::VALGRIND:
+ return this->ProcessMemCheckValgrindOutput(str, log, results);
+ case cmCTestMemCheckHandler::PURIFY:
+ return this->ProcessMemCheckPurifyOutput(str, log, results);
+ case cmCTestMemCheckHandler::ADDRESS_SANITIZER:
+ case cmCTestMemCheckHandler::THREAD_SANITIZER:
+ case cmCTestMemCheckHandler::MEMORY_SANITIZER:
+ case cmCTestMemCheckHandler::UB_SANITIZER:
+ return this->ProcessMemCheckSanitizerOutput(str, log, results);
+ case cmCTestMemCheckHandler::BOUNDS_CHECKER:
+ return this->ProcessMemCheckBoundsCheckerOutput(str, log, results);
+ default:
+ log.append("\nMemory checking style used was: ");
+ log.append("None that I know");
+ log = str;
+ return true;
}
- return true;
}
std::vector<int>::size_type cmCTestMemCheckHandler::FindOrAddWarning(
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index a4e0b95..2632870 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -824,9 +824,8 @@ bool cmCTestMultiProcessHandler::CheckCycles()
<< this->Properties[root]->Name
<< "\".\nPlease fix the cycle and run ctest again.\n");
return false;
- } else {
- s.push(*d);
}
+ s.push(*d);
}
}
}
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index d4a32f1..82422a3 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -373,9 +373,8 @@ std::string cmCTestP4::GetWorkingRevision()
if (rev.empty()) {
return "0";
- } else {
- return rev;
}
+ return rev;
}
void cmCTestP4::NoteOldRevision()
diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 9e3802a..49acbbf 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -54,7 +54,8 @@ bool cmCTestRunTest::CheckOutput()
if (p == cmsysProcess_Pipe_None) {
// Process has terminated and all output read.
return false;
- } else if (p == cmsysProcess_Pipe_STDOUT) {
+ }
+ if (p == cmsysProcess_Pipe_STDOUT) {
// Store this line of output.
cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->GetIndex()
<< ": " << line << std::endl);
@@ -82,8 +83,7 @@ bool cmCTestRunTest::CheckOutput()
}
}
}
- } else // if(p == cmsysProcess_Pipe_Timeout)
- {
+ } else { // if(p == cmsysProcess_Pipe_Timeout)
break;
}
}
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 06f838c..bee8296 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -80,11 +80,11 @@ static bool cmCTestSVNPathStarts(std::string const& p1, std::string const& p2)
// Does path p1 start with path p2?
if (p1.size() == p2.size()) {
return p1 == p2;
- } else if (p1.size() > p2.size() && p1[p2.size()] == '/') {
+ }
+ if (p1.size() > p2.size() && p1[p2.size()] == '/') {
return strncmp(p1.c_str(), p2.c_str(), p2.size()) == 0;
- } else {
- return false;
}
+ return false;
}
std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
@@ -295,9 +295,8 @@ bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
if (strcmp(parameters[0], "update") == 0) {
return RunUpdateCommand(&args[0], out, err);
- } else {
- return RunChild(&args[0], out, err);
}
+ return RunChild(&args[0], out, err);
}
class cmCTestSVN::LogParser : public cmCTestVC::OutputLogger,
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index b932277..3ce0317 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -284,14 +284,13 @@ inline int GetNextNumber(std::string const& in, int& val,
}
pos = pos2 + 1;
return 1;
+ }
+ if (in.size() - pos == 0) {
+ val = -1;
} else {
- if (in.size() - pos == 0) {
- val = -1;
- } else {
- val = atoi(in.substr(pos, in.size() - pos).c_str());
- }
- return 0;
+ val = atoi(in.substr(pos, in.size() - pos).c_str());
}
+ return 0;
}
// get the next number in a string with numbers separated by ,
@@ -311,14 +310,13 @@ inline int GetNextRealNumber(std::string const& in, double& val,
}
pos = pos2 + 1;
return 1;
+ }
+ if (in.size() - pos == 0) {
+ val = -1;
} else {
- if (in.size() - pos == 0) {
- val = -1;
- } else {
- val = atof(in.substr(pos, in.size() - pos).c_str());
- }
- return 0;
+ val = atof(in.substr(pos, in.size() - pos).c_str());
}
+ return 0;
}
cmCTestTestHandler::cmCTestTestHandler()
diff --git a/Source/CTest/cmCTestUploadCommand.cxx b/Source/CTest/cmCTestUploadCommand.cxx
index 7393d21..016b32b 100644
--- a/Source/CTest/cmCTestUploadCommand.cxx
+++ b/Source/CTest/cmCTestUploadCommand.cxx
@@ -49,14 +49,13 @@ bool cmCTestUploadCommand::CheckArgumentValue(std::string const& arg)
if (cmSystemTools::FileExists(arg.c_str())) {
this->Files.insert(arg);
return true;
- } else {
- std::ostringstream e;
- e << "File \"" << arg << "\" does not exist. Cannot submit "
- << "a non-existent file.";
- this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
- this->ArgumentDoing = ArgumentDoingError;
- return false;
}
+ std::ostringstream e;
+ e << "File \"" << arg << "\" does not exist. Cannot submit "
+ << "a non-existent file.";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ this->ArgumentDoing = ArgumentDoingError;
+ return false;
}
// Look for other arguments.
diff --git a/Source/CTest/cmParseBlanketJSCoverage.cxx b/Source/CTest/cmParseBlanketJSCoverage.cxx
index fa539e4..976a92d 100644
--- a/Source/CTest/cmParseBlanketJSCoverage.cxx
+++ b/Source/CTest/cmParseBlanketJSCoverage.cxx
@@ -42,9 +42,8 @@ public:
std::string foundFileName =
line.substr(begIndex + 3, endIndex - (begIndex + 4));
return foundFileName;
- } else {
- return line.substr(begIndex, line.npos);
}
+ return line.substr(begIndex, line.npos);
}
bool ParseFile(std::string const& file)
{
diff --git a/Source/CTest/cmParseMumpsCoverage.cxx b/Source/CTest/cmParseMumpsCoverage.cxx
index d786d79..af01496 100644
--- a/Source/CTest/cmParseMumpsCoverage.cxx
+++ b/Source/CTest/cmParseMumpsCoverage.cxx
@@ -128,16 +128,15 @@ bool cmParseMumpsCoverage::FindMumpsFile(std::string const& routine,
if (i != this->RoutineToDirectory.end()) {
filepath = i->second;
return true;
- } else {
- // try some alternate names
- const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
- for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
- std::string routine2 = routine + tryname[k];
- i = this->RoutineToDirectory.find(routine2);
- if (i != this->RoutineToDirectory.end()) {
- filepath = i->second;
- return true;
- }
+ }
+ // try some alternate names
+ const char* tryname[] = { "GUX", "GTM", "ONT", CM_NULLPTR };
+ for (int k = 0; tryname[k] != CM_NULLPTR; k++) {
+ std::string routine2 = routine + tryname[k];
+ i = this->RoutineToDirectory.find(routine2);
+ if (i != this->RoutineToDirectory.end()) {
+ filepath = i->second;
+ return true;
}
}
return false;
diff --git a/Source/CTest/cmProcess.cxx b/Source/CTest/cmProcess.cxx
index 92fe642..30cd102 100644
--- a/Source/CTest/cmProcess.cxx
+++ b/Source/CTest/cmProcess.cxx
@@ -124,10 +124,10 @@ int cmProcess::GetNextOutputLine(std::string& line, double timeout)
int p = cmsysProcess_WaitForData(this->Process, &data, &length, &timeout);
if (p == cmsysProcess_Pipe_Timeout) {
return cmsysProcess_Pipe_Timeout;
- } else if (p == cmsysProcess_Pipe_STDOUT) {
+ }
+ if (p == cmsysProcess_Pipe_STDOUT) {
this->Output.insert(this->Output.end(), data, data + length);
- } else // p == cmsysProcess_Pipe_None
- {
+ } else { // p == cmsysProcess_Pipe_None
// The process will provide no more data.
break;
}
diff --git a/Source/CursesDialog/cmCursesBoolWidget.cxx b/Source/CursesDialog/cmCursesBoolWidget.cxx
index 068bcdc..99f7dcc 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.cxx
+++ b/Source/CursesDialog/cmCursesBoolWidget.cxx
@@ -40,9 +40,8 @@ bool cmCursesBoolWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
touchwin(w);
wrefresh(w);
return true;
- } else {
- return false;
}
+ return false;
}
void cmCursesBoolWidget::SetValueAsBool(bool value)
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index ea12756..462cb6e 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -110,7 +110,6 @@ const char* cmCursesCacheEntryComposite::GetValue()
{
if (this->Label) {
return this->Label->GetValue();
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.cxx b/Source/CursesDialog/cmCursesOptionsWidget.cxx
index 5892e53..9a88aef 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.cxx
+++ b/Source/CursesDialog/cmCursesOptionsWidget.cxx
@@ -13,10 +13,7 @@
#include "cmCursesMainForm.h"
-inline int ctrl(int z)
-{
- return (z & 037);
-}
+#define ctrl(z) ((z)&037)
cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
int top)
@@ -34,25 +31,27 @@ cmCursesOptionsWidget::cmCursesOptionsWidget(int width, int height, int left,
bool cmCursesOptionsWidget::HandleInput(int& key, cmCursesMainForm* /*fm*/,
WINDOW* w)
{
-
- // 10 == enter
- if (key == 10 || key == KEY_ENTER) {
- this->NextOption();
- touchwin(w);
- wrefresh(w);
- return true;
- } else if (key == KEY_LEFT || key == ctrl('b')) {
- touchwin(w);
- wrefresh(w);
- this->PreviousOption();
- return true;
- } else if (key == KEY_RIGHT || key == ctrl('f')) {
- this->NextOption();
- touchwin(w);
- wrefresh(w);
- return true;
- } else {
- return false;
+ switch (key) {
+ case 10: // 10 == enter
+ case KEY_ENTER:
+ this->NextOption();
+ touchwin(w);
+ wrefresh(w);
+ return true;
+ case KEY_LEFT:
+ case ctrl('b'):
+ touchwin(w);
+ wrefresh(w);
+ this->PreviousOption();
+ return true;
+ case KEY_RIGHT:
+ case ctrl('f'):
+ this->NextOption();
+ touchwin(w);
+ wrefresh(w);
+ return true;
+ default:
+ return false;
}
}
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index c16de23..db98a00 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -94,10 +94,9 @@ bool cmCursesStringWidget::HandleInput(int& key, cmCursesMainForm* fm,
// quit
if (key == 'q') {
return false;
- } else {
- key = getch();
- continue;
}
+ key = getch();
+ continue;
}
// If resize occurred during edit, move out of edit mode
@@ -207,7 +206,6 @@ bool cmCursesStringWidget::PrintKeys()
curses_move(y - 3, 0);
printw(fmt_s, "Editing option, press [enter] to leave edit.");
return true;
- } else {
- return false;
}
+ return false;
}
diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx
index 3da4f28..8869040 100644
--- a/Source/cmArchiveWrite.cxx
+++ b/Source/cmArchiveWrite.cxx
@@ -16,7 +16,11 @@
#include "cm_get_date.h"
#include <cm_libarchive.h>
#include <cmsys/Directory.hxx>
+#include <cmsys/Encoding.hxx>
#include <cmsys/FStream.hxx>
+#include <iostream>
+#include <string.h>
+#include <time.h>
#ifndef __LA_SSIZE_T
#define __LA_SSIZE_T la_ssize_t
@@ -71,9 +75,8 @@ struct cmArchiveWrite::Callback
if (self->Stream.write(static_cast<const char*>(b),
static_cast<std::streamsize>(n))) {
return static_cast<__LA_SSIZE_T>(n);
- } else {
- return static_cast<__LA_SSIZE_T>(-1);
}
+ return static_cast<__LA_SSIZE_T>(-1);
}
};
@@ -268,7 +271,7 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix)
}
if (this->PermissionsMask.IsSet()) {
- mode_t perm = archive_entry_perm(e);
+ int perm = archive_entry_perm(e);
archive_entry_set_perm(e, perm & this->PermissionsMask.Get());
}
diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h
index f847d09..120453b 100644
--- a/Source/cmArchiveWrite.h
+++ b/Source/cmArchiveWrite.h
@@ -12,7 +12,11 @@
#ifndef cmArchiveWrite_h
#define cmArchiveWrite_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
+
+#include <iosfwd>
+#include <stddef.h>
+#include <string>
#if !defined(CMAKE_BUILD_WITH_CMAKE)
#error "cmArchiveWrite not allowed during bootstrap build!"
@@ -94,7 +98,7 @@ public:
void SetMTime(std::string const& t) { this->MTime = t; }
//! Sets the permissions of the added files/folders
- void SetPermissions(mode_t permissions_)
+ void SetPermissions(int permissions_)
{
this->Permissions.Set(permissions_);
}
@@ -107,7 +111,7 @@ public:
//! The permissions will be copied from the existing file
//! or folder. The mask will then be applied to unset
//! some of them
- void SetPermissionsMask(mode_t permissionsMask_)
+ void SetPermissionsMask(int permissionsMask_)
{
this->PermissionsMask.Set(permissionsMask_);
}
@@ -177,8 +181,8 @@ private:
//!@}
//! Permissions on files/folders
- cmArchiveWriteOptional<mode_t> Permissions;
- cmArchiveWriteOptional<mode_t> PermissionsMask;
+ cmArchiveWriteOptional<int> Permissions;
+ cmArchiveWriteOptional<int> PermissionsMask;
};
#endif
diff --git a/Source/cmCLocaleEnvironmentScope.cxx b/Source/cmCLocaleEnvironmentScope.cxx
index e4c74ec..e38f531 100644
--- a/Source/cmCLocaleEnvironmentScope.cxx
+++ b/Source/cmCLocaleEnvironmentScope.cxx
@@ -15,6 +15,7 @@
#include "cmSystemTools.h"
#include <sstream>
+#include <utility>
cmCLocaleEnvironmentScope::cmCLocaleEnvironmentScope()
{
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
index b011741..572beaf 100644
--- a/Source/cmCLocaleEnvironmentScope.h
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -13,7 +13,10 @@
#ifndef cmCLocaleEnvironmentScope_h
#define cmCLocaleEnvironmentScope_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
+
+#include <map>
+#include <string>
class cmCLocaleEnvironmentScope
{
diff --git a/Source/cmCPackPropertiesGenerator.cxx b/Source/cmCPackPropertiesGenerator.cxx
index af01c7d..ae6b0a1 100644
--- a/Source/cmCPackPropertiesGenerator.cxx
+++ b/Source/cmCPackPropertiesGenerator.cxx
@@ -1,8 +1,13 @@
#include "cmCPackPropertiesGenerator.h"
-#include "cmLocalGenerator.h"
+#include "cmGeneratorExpression.h"
+#include "cmInstalledFile.h"
#include "cmOutputConverter.h"
+#include <map>
+#include <ostream>
+#include <utility>
+
cmCPackPropertiesGenerator::cmCPackPropertiesGenerator(
cmLocalGenerator* lg, cmInstalledFile const& installedFile,
std::vector<std::string> const& configurations)
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index 4d092f6..77018b0 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -12,9 +12,15 @@
#ifndef cmCPackPropertiesGenerator_h
#define cmCPackPropertiesGenerator_h
-#include "cmInstalledFile.h"
+#include <cmConfigure.h> // IWYU pragma: keep
+
#include "cmScriptGenerator.h"
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+class cmInstalledFile;
class cmLocalGenerator;
/** \class cmCPackPropertiesGenerator
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 8a856a8..b4ddc3e 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -781,13 +781,12 @@ bool cmCTest::SetTest(const char* ttype, bool report)
if (p != PartCount) {
this->Parts[p].Enable();
return true;
- } else {
- if (report) {
- cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \""
- << ttype << "\" yet..." << std::endl);
- }
- return false;
}
+ if (report) {
+ cmCTestLog(this, ERROR_MESSAGE, "Don't know about test \""
+ << ttype << "\" yet..." << std::endl);
+ }
+ return false;
}
void cmCTest::Finalize()
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index bdd7303..39d96b4 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -16,10 +16,12 @@
#include "cmVersion.h"
#include "cmake.h"
-#include <cmsys/Directory.hxx>
+#include <algorithm>
#include <cmsys/FStream.hxx>
#include <cmsys/Glob.hxx>
-#include <cmsys/RegularExpression.hxx>
+#include <sstream>
+#include <stdio.h>
+#include <string.h>
cmCacheManager::cmCacheManager()
{
@@ -574,7 +576,8 @@ const char* cmCacheManager::CacheEntry::GetProperty(
{
if (prop == "TYPE") {
return cmState::CacheEntryTypeToString(this->Type);
- } else if (prop == "VALUE") {
+ }
+ if (prop == "VALUE") {
return this->Value.c_str();
}
return this->Properties.GetPropertyValue(prop);
diff --git a/Source/cmCacheManager.h b/Source/cmCacheManager.h
index 14e0f0a..3e32cf0 100644
--- a/Source/cmCacheManager.h
+++ b/Source/cmCacheManager.h
@@ -12,13 +12,19 @@
#ifndef cmCacheManager_h
#define cmCacheManager_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include "cmPropertyMap.h"
#include "cmState.h"
+#include <iosfwd>
+#include <map>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
class cmake;
-class cmMarkAsAdvancedCommand;
/** \class cmCacheManager
* \brief Control class for cmake's cache
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 42fb105..68111a0 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -75,9 +75,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
if (cmSystemTools::GetEnv(var, str)) {
if (this->EscapeQuotes) {
return this->AddString(cmSystemTools::EscapeQuotes(str.c_str()));
- } else {
- return this->AddString(str);
}
+ return this->AddString(str);
}
return this->EmptyVariable;
}
@@ -86,9 +85,8 @@ char* cmCommandArgumentParserHelper::ExpandSpecialVariable(const char* key,
this->Makefile->GetState()->GetInitializedCacheValue(var)) {
if (this->EscapeQuotes) {
return this->AddString(cmSystemTools::EscapeQuotes(c));
- } else {
- return this->AddString(c);
}
+ return this->AddString(c);
}
return this->EmptyVariable;
}
@@ -162,7 +160,8 @@ char* cmCommandArgumentParserHelper::CombineUnions(char* in1, char* in2)
{
if (!in1) {
return in2;
- } else if (!in2) {
+ }
+ if (!in2) {
return in1;
}
size_t len = strlen(in1) + strlen(in2) + 1;
@@ -282,10 +281,9 @@ int cmCommandArgumentParserHelper::LexInput(char* buf, int maxlen)
this->CurrentLine++;
}
return (1);
- } else {
- buf[0] = '\n';
- return (0);
}
+ buf[0] = '\n';
+ return (0);
}
void cmCommandArgumentParserHelper::Error(const char* str)
diff --git a/Source/cmCommands.h b/Source/cmCommands.h
index d0f1ab7..034c9c7 100644
--- a/Source/cmCommands.h
+++ b/Source/cmCommands.h
@@ -12,7 +12,7 @@
#ifndef cmCommands_h
#define cmCommands_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include <vector>
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index 7ad18f0..6167e2c 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -11,13 +11,21 @@
============================================================================*/
#include "cmCommonTargetGenerator.h"
+#include <algorithm>
+#include <cmConfigure.h>
+#include <set>
+#include <sstream>
+#include <utility>
+
+#include "cmAlgorithms.h"
#include "cmComputeLinkInformation.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalCommonGenerator.h"
#include "cmLocalCommonGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmSourceFile.h"
-#include "cmSystemTools.h"
+#include "cmState.h"
cmCommonTargetGenerator::cmCommonTargetGenerator(cmGeneratorTarget* gt)
: GeneratorTarget(gt)
diff --git a/Source/cmCommonTargetGenerator.h b/Source/cmCommonTargetGenerator.h
index 0bafde9..d3f9d64 100644
--- a/Source/cmCommonTargetGenerator.h
+++ b/Source/cmCommonTargetGenerator.h
@@ -12,9 +12,13 @@
#ifndef cmCommonTargetGenerator_h
#define cmCommonTargetGenerator_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
-#include "cmLocalGenerator.h"
+#include "cmOutputConverter.h"
+
+#include <map>
+#include <string>
+#include <vector>
class cmGeneratorTarget;
class cmGlobalCommonGenerator;
diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h
index fb95f9a..cc468d9 100644
--- a/Source/cmComputeComponentGraph.h
+++ b/Source/cmComputeComponentGraph.h
@@ -12,11 +12,12 @@
#ifndef cmComputeComponentGraph_h
#define cmComputeComponentGraph_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include "cmGraphAdjacencyList.h"
#include <stack>
+#include <vector>
/** \class cmComputeComponentGraph
* \brief Analyze a graph to determine strongly connected components.
diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx
index fffb77d..98405cf 100644
--- a/Source/cmComputeLinkDepends.cxx
+++ b/Source/cmComputeLinkDepends.cxx
@@ -13,13 +13,22 @@
#include "cmAlgorithms.h"
#include "cmComputeComponentGraph.h"
+#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmState.h"
+#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmake.h"
+#include <algorithm>
#include <assert.h>
+#include <iterator>
+#include <sstream>
+#include <stdio.h>
+#include <string.h>
+#include <utility>
/*
diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h
index 4a33aff..7cd4140 100644
--- a/Source/cmComputeLinkDepends.h
+++ b/Source/cmComputeLinkDepends.h
@@ -12,17 +12,22 @@
#ifndef cmComputeLinkDepends_h
#define cmComputeLinkDepends_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include "cmGraphAdjacencyList.h"
#include "cmLinkItem.h"
+#include "cmTargetLinkLibraryType.h"
+#include <map>
#include <queue>
+#include <set>
+#include <string>
+#include <vector>
class cmComputeComponentGraph;
+class cmGeneratorTarget;
class cmGlobalGenerator;
class cmMakefile;
-class cmGeneratorTarget;
class cmake;
/** \class cmComputeLinkDepends
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 7db5df3..82877f3 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -11,19 +11,25 @@
============================================================================*/
#include "cmComputeLinkInformation.h"
-#include "cmComputeLinkDepends.h"
-#include "cmOrderDirectories.h"
-
#include "cmAlgorithms.h"
+#include "cmComputeLinkDepends.h"
#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmOrderDirectories.h"
#include "cmOutputConverter.h"
+#include "cmPolicies.h"
#include "cmState.h"
+#include "cmSystemTools.h"
+#include "cmTarget.h"
#include "cmake.h"
+#include <algorithm>
#include <ctype.h>
+#include <sstream>
+#include <string.h>
+#include <utility>
//#define CM_COMPUTE_LINK_INFO_DEBUG
diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h
index 023c781..7a67567 100644
--- a/Source/cmComputeLinkInformation.h
+++ b/Source/cmComputeLinkInformation.h
@@ -12,15 +12,19 @@
#ifndef cmComputeLinkInformation_h
#define cmComputeLinkInformation_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include <cmsys/RegularExpression.hxx>
+#include <iosfwd>
+#include <set>
+#include <string>
+#include <vector>
-class cmake;
+class cmGeneratorTarget;
class cmGlobalGenerator;
class cmMakefile;
-class cmGeneratorTarget;
class cmOrderDirectories;
+class cmake;
/** \class cmComputeLinkInformation
* \brief Compute link information for a target in one configuration.
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index ff7eb0b..dd07300 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -12,18 +12,25 @@
#include "cmComputeTargetDepends.h"
#include "cmComputeComponentGraph.h"
+#include "cmGeneratorTarget.h"
#include "cmGlobalGenerator.h"
+#include "cmLinkItem.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include "cmPolicies.h"
#include "cmSourceFile.h"
#include "cmState.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmTargetDepend.h"
#include "cmake.h"
-#include <algorithm>
-
#include <assert.h>
+#include <sstream>
+#include <stdio.h>
+#include <utility>
+
+class cmListFileBacktrace;
/*
diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h
index 9e51d4d..587ac66 100644
--- a/Source/cmComputeTargetDepends.h
+++ b/Source/cmComputeTargetDepends.h
@@ -12,16 +12,19 @@
#ifndef cmComputeTargetDepends_h
#define cmComputeTargetDepends_h
-#include "cmStandardIncludes.h"
+#include <cmConfigure.h> // IWYU pragma: keep
#include "cmGraphAdjacencyList.h"
-#include <stack>
+#include <map>
+#include <set>
+#include <string>
+#include <vector>
class cmComputeComponentGraph;
+class cmGeneratorTarget;
class cmGlobalGenerator;
class cmLinkItem;
-class cmGeneratorTarget;
class cmTargetDependSet;
/** \class cmComputeTargetDepends
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 9bd07a3..8e2d87e 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -19,19 +19,23 @@ CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
{
if (strcmp(algo, "MD5") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
- } else if (strcmp(algo, "SHA1") == 0) {
+ }
+ if (strcmp(algo, "SHA1") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
- } else if (strcmp(algo, "SHA224") == 0) {
+ }
+ if (strcmp(algo, "SHA224") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
- } else if (strcmp(algo, "SHA256") == 0) {
+ }
+ if (strcmp(algo, "SHA256") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
- } else if (strcmp(algo, "SHA384") == 0) {
+ }
+ if (strcmp(algo, "SHA384") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
- } else if (strcmp(algo, "SHA512") == 0) {
+ }
+ if (strcmp(algo, "SHA512") == 0) {
return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
- } else {
- return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
}
+ return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
}
bool cmCryptoHash::IntFromHexDigit(char input, char& output)
@@ -39,10 +43,12 @@ bool cmCryptoHash::IntFromHexDigit(char input, char& output)
if (input >= '0' && input <= '9') {
output = char(input - '0');
return true;
- } else if (input >= 'a' && input <= 'f') {
+ }
+ if (input >= 'a' && input <= 'f') {
output = char(input - 'a' + 0xA);
return true;
- } else if (input >= 'A' && input <= 'F') {
+ }
+ if (input >= 'A' && input <= 'F') {
output = char(input - 'A' + 0xA);
return true;
}
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx
index d1521f0..5c863f0 100644
--- a/Source/cmDependsFortran.cxx
+++ b/Source/cmDependsFortran.cxx
@@ -521,7 +521,8 @@ bool cmDependsFortran::CopyModule(const std::vector<std::string>& args)
}
}
return true;
- } else if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
+ }
+ if (cmSystemTools::FileExists(mod_lower.c_str(), true)) {
if (cmDependsFortran::ModulesDiffer(mod_lower.c_str(), stamp.c_str(),
compilerId.c_str())) {
if (!cmSystemTools::CopyFileAlways(mod_lower, stamp)) {
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index 919a45e..5516cf1 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -719,9 +719,8 @@ const char* cmDocumentation::GetNameString() const
{
if (!this->NameString.empty()) {
return this->NameString.c_str();
- } else {
- return "CMake";
}
+ return "CMake";
}
bool cmDocumentation::IsOption(const char* arg) const
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index c687e2f..150593b 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -832,45 +832,40 @@ cmELF::FileType cmELF::GetFileType() const
{
if (this->Valid()) {
return this->Internal->GetFileType();
- } else {
- return FileTypeInvalid;
}
+ return FileTypeInvalid;
}
unsigned int cmELF::GetNumberOfSections() const
{
if (this->Valid()) {
return this->Internal->GetNumberOfSections();
- } else {
- return 0;
}
+ return 0;
}
unsigned int cmELF::GetDynamicEntryCount() const
{
if (this->Valid()) {
return this->Internal->GetDynamicEntryCount();
- } else {
- return 0;
}
+ return 0;
}
unsigned long cmELF::GetDynamicEntryPosition(int index) const
{
if (this->Valid()) {
return this->Internal->GetDynamicEntryPosition(index);
- } else {
- return 0;
}
+ return 0;
}
bool cmELF::ReadBytes(unsigned long pos, unsigned long size, char* buf) const
{
if (this->Valid()) {
return this->Internal->ReadBytes(pos, size, buf);
- } else {
- return false;
}
+ return false;
}
bool cmELF::GetSOName(std::string& soname)
@@ -878,9 +873,8 @@ bool cmELF::GetSOName(std::string& soname)
if (StringEntry const* se = this->GetSOName()) {
soname = se->Value;
return true;
- } else {
- return false;
}
+ return false;
}
cmELF::StringEntry const* cmELF::GetSOName()
@@ -888,9 +882,8 @@ cmELF::StringEntry const* cmELF::GetSOName()
if (this->Valid() &&
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary) {
return this->Internal->GetSOName();
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
cmELF::StringEntry const* cmELF::GetRPath()
@@ -899,9 +892,8 @@ cmELF::StringEntry const* cmELF::GetRPath()
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRPath();
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
cmELF::StringEntry const* cmELF::GetRunPath()
@@ -910,9 +902,8 @@ cmELF::StringEntry const* cmELF::GetRunPath()
(this->Internal->GetFileType() == cmELF::FileTypeExecutable ||
this->Internal->GetFileType() == cmELF::FileTypeSharedLibrary)) {
return this->Internal->GetRunPath();
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
void cmELF::PrintInfo(std::ostream& os) const
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index a53d285..390477a 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -211,11 +211,10 @@ void cmExportBuildFileGenerator::HandleMissingTarget(
link_libs += missingTarget;
missingTargets.push_back(missingTarget);
return;
- } else {
- // We are not appending, so all exported targets should be
- // known here. This is probably user-error.
- this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
}
+ // We are not appending, so all exported targets should be
+ // known here. This is probably user-error.
+ this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
}
// Assume the target will be exported by another command.
// Append it with the export namespace.
diff --git a/Source/cmExprParserHelper.cxx b/Source/cmExprParserHelper.cxx
index 0771a4e..1a101ab 100644
--- a/Source/cmExprParserHelper.cxx
+++ b/Source/cmExprParserHelper.cxx
@@ -81,10 +81,9 @@ int cmExprParserHelper::LexInput(char* buf, int maxlen)
this->CurrentLine++;
}
return (1);
- } else {
- buf[0] = '\n';
- return (0);
}
+ buf[0] = '\n';
+ return (0);
}
void cmExprParserHelper::Error(const char* str)
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index 0ded17a..559974e 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -124,11 +124,10 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
if (start + 1 < splitted.size()) {
it->InsertPath(splitted, start + 1, fileName);
return;
- } else {
- // last part of splitted
- it->files.push_back(fileName);
- return;
}
+ // last part of splitted
+ it->files.push_back(fileName);
+ return;
}
}
// Not found in folders, thus insert
@@ -138,12 +137,11 @@ void Tree::InsertPath(const std::vector<std::string>& splitted,
newFolder.InsertPath(splitted, start + 1, fileName);
folders.push_back(newFolder);
return;
- } else {
- // last part of splitted
- newFolder.files.push_back(fileName);
- folders.push_back(newFolder);
- return;
}
+ // last part of splitted
+ newFolder.files.push_back(fileName);
+ folders.push_back(newFolder);
+ return;
}
void Tree::BuildVirtualFolder(cmXMLWriter& xml) const
@@ -717,21 +715,22 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
// Translate the cmake target type into the CodeBlocks target type id
int cmExtraCodeBlocksGenerator::GetCBTargetType(cmGeneratorTarget* target)
{
- if (target->GetType() == cmState::EXECUTABLE) {
- if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) ||
- (target->GetPropertyAsBool("MACOSX_BUNDLE"))) {
- return 0;
- } else {
+ switch (target->GetType()) {
+ case cmState::EXECUTABLE:
+ if ((target->GetPropertyAsBool("WIN32_EXECUTABLE")) ||
+ (target->GetPropertyAsBool("MACOSX_BUNDLE"))) {
+ return 0;
+ }
return 1;
- }
- } else if ((target->GetType() == cmState::STATIC_LIBRARY) ||
- (target->GetType() == cmState::OBJECT_LIBRARY)) {
- return 2;
- } else if ((target->GetType() == cmState::SHARED_LIBRARY) ||
- (target->GetType() == cmState::MODULE_LIBRARY)) {
- return 3;
+ case cmState::STATIC_LIBRARY:
+ case cmState::OBJECT_LIBRARY:
+ return 2;
+ case cmState::SHARED_LIBRARY:
+ case cmState::MODULE_LIBRARY:
+ return 3;
+ default:
+ return 4;
}
- return 4;
}
// Create the command line for building the given target using the selected
diff --git a/Source/cmFileLockPool.cxx b/Source/cmFileLockPool.cxx
index 7c51459..5521ac4 100644
--- a/Source/cmFileLockPool.cxx
+++ b/Source/cmFileLockPool.cxx
@@ -140,10 +140,9 @@ cmFileLockResult cmFileLockPool::ScopePool::Lock(const std::string& filename,
if (result.IsOk()) {
this->Locks.push_back(lock);
return cmFileLockResult::MakeOk();
- } else {
- delete lock;
- return result;
}
+ delete lock;
+ return result;
}
cmFileLockResult cmFileLockPool::ScopePool::Release(
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 9d63505..1360b44 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -140,11 +140,14 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
// Compare using nanosecond resolution.
if (s1->st_mtim.tv_sec < s2->st_mtim.tv_sec) {
return -1;
- } else if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
+ }
+ if (s1->st_mtim.tv_sec > s2->st_mtim.tv_sec) {
return 1;
- } else if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
+ }
+ if (s1->st_mtim.tv_nsec < s2->st_mtim.tv_nsec) {
return -1;
- } else if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
+ }
+ if (s1->st_mtim.tv_nsec > s2->st_mtim.tv_nsec) {
return 1;
}
#elif CMake_STAT_HAS_ST_MTIMESPEC
@@ -185,11 +188,11 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
long long t2 = s2->st_mtim.tv_sec * bil + s2->st_mtim.tv_nsec;
if (t1 < t2) {
return (t2 - t1) >= bil;
- } else if (t2 < t1) {
+ }
+ if (t2 < t1) {
return (t1 - t2) >= bil;
- } else {
- return false;
}
+ return false;
#elif CMake_STAT_HAS_ST_MTIMESPEC
// Times are integers in units of 1ns.
long long bil = 1000000000;
@@ -240,11 +243,10 @@ bool cmFileTimeComparisonInternal::FileTimeCompare(const char* f1,
// Compare the two modification times.
*result = this->Compare(&s1, &s2);
return true;
- } else {
- // No comparison available. Default to the same time.
- *result = 0;
- return false;
}
+ // No comparison available. Default to the same time.
+ *result = 0;
+ return false;
}
bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
@@ -256,8 +258,7 @@ bool cmFileTimeComparisonInternal::FileTimesDiffer(const char* f1,
if (this->Stat(f1, &s1) && this->Stat(f2, &s2)) {
// Compare the two modification times.
return this->TimesDiffer(&s1, &s2);
- } else {
- // No comparison available. Default to different times.
- return true;
}
+ // No comparison available. Default to different times.
+ return true;
}
diff --git a/Source/cmFortranParserImpl.cxx b/Source/cmFortranParserImpl.cxx
index 7d04898..30a33b4 100644
--- a/Source/cmFortranParserImpl.cxx
+++ b/Source/cmFortranParserImpl.cxx
@@ -22,29 +22,27 @@ bool cmFortranParser_s::FindIncludeFile(const char* dir,
if (cmSystemTools::FileIsFullPath(includeName)) {
fileName = includeName;
return cmSystemTools::FileExists(fileName.c_str(), true);
- } else {
- // Check for the file in the directory containing the including
- // file.
- std::string fullName = dir;
+ }
+ // Check for the file in the directory containing the including
+ // file.
+ std::string fullName = dir;
+ fullName += "/";
+ fullName += includeName;
+ if (cmSystemTools::FileExists(fullName.c_str(), true)) {
+ fileName = fullName;
+ return true;
+ }
+
+ // Search the include path for the file.
+ for (std::vector<std::string>::const_iterator i = this->IncludePath.begin();
+ i != this->IncludePath.end(); ++i) {
+ fullName = *i;
fullName += "/";
fullName += includeName;
if (cmSystemTools::FileExists(fullName.c_str(), true)) {
fileName = fullName;
return true;
}
-
- // Search the include path for the file.
- for (std::vector<std::string>::const_iterator i =
- this->IncludePath.begin();
- i != this->IncludePath.end(); ++i) {
- fullName = *i;
- fullName += "/";
- fullName += includeName;
- if (cmSystemTools::FileExists(fullName.c_str(), true)) {
- fileName = fullName;
- return true;
- }
- }
}
return false;
}
@@ -88,9 +86,8 @@ bool cmFortranParser_FilePush(cmFortranParser* parser, const char* fname)
cmFortran_yy_switch_to_buffer(buffer, parser->Scanner);
parser->FileStack.push(f);
return 1;
- } else {
- return 0;
}
+ return 0;
}
bool cmFortranParser_FilePop(cmFortranParser* parser)
@@ -99,15 +96,14 @@ bool cmFortranParser_FilePop(cmFortranParser* parser)
// to the next one on the stack.
if (parser->FileStack.empty()) {
return 0;
- } else {
- cmFortranFile f = parser->FileStack.top();
- parser->FileStack.pop();
- fclose(f.File);
- YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner);
- cmFortran_yy_delete_buffer(current, parser->Scanner);
- cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
- return 1;
}
+ cmFortranFile f = parser->FileStack.top();
+ parser->FileStack.pop();
+ fclose(f.File);
+ YY_BUFFER_STATE current = cmFortranLexer_GetCurrentBuffer(parser->Scanner);
+ cmFortran_yy_delete_buffer(current, parser->Scanner);
+ cmFortran_yy_switch_to_buffer(f.Buffer, parser->Scanner);
+ return 1;
}
int cmFortranParser_Input(cmFortranParser* parser, char* buffer,
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 983bfb4..6cd6439 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -352,7 +352,8 @@ std::string cmGeneratorExpression::Preprocess(const std::string& input,
{
if (context == StripAllGeneratorExpressions) {
return stripAllGeneratorExpressions(input);
- } else if (context == BuildInterface || context == InstallInterface) {
+ }
+ if (context == BuildInterface || context == InstallInterface) {
return stripExportInterface(input, context, resolveRelative);
}
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index 66437eb..b4b74c5 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -154,20 +154,19 @@ std::string GeneratorExpressionContent::EvaluateParameters(
node, identifier, context, dagChecker, pit);
parameters.push_back(lastParam);
return std::string();
- } else {
- std::string parameter;
- std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
- pit->begin();
- const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator
- end = pit->end();
- for (; it != end; ++it) {
- parameter += (*it)->Evaluate(context, dagChecker);
- if (context->HadError) {
- return std::string();
- }
+ }
+ std::string parameter;
+ std::vector<cmGeneratorExpressionEvaluator*>::const_iterator it =
+ pit->begin();
+ const std::vector<cmGeneratorExpressionEvaluator*>::const_iterator end =
+ pit->end();
+ for (; it != end; ++it) {
+ parameter += (*it)->Evaluate(context, dagChecker);
+ if (context->HadError) {
+ return std::string();
}
- parameters.push_back(parameter);
}
+ parameters.push_back(parameter);
}
}
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index 86fbd44..12cf980 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -92,7 +92,8 @@ static const struct ZeroNode installInterfaceNode;
for (; it != end; ++it) { \
if (*it == #FAILURE_VALUE) { \
return #FAILURE_VALUE; \
- } else if (*it != #SUCCESS_VALUE) { \
+ } \
+ if (*it != #SUCCESS_VALUE) { \
reportError(context, content->GetOriginalExpression(), \
"Parameters to $<" #OP \
"> must resolve to either '0' or '1'."); \
@@ -790,7 +791,8 @@ static const struct CompileLanguageNode : public cmGeneratorExpressionNode
"$<COMPILE_LANGUAGE:...> may not be used with Visual Studio "
"generators.");
return std::string();
- } else if (genName.find("Xcode") != std::string::npos) {
+ }
+ if (genName.find("Xcode") != std::string::npos) {
if (dagChecker && (dagChecker->EvaluatingCompileDefinitions() ||
dagChecker->EvaluatingIncludeDirectories())) {
reportError(
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 308051b..8bd3b82 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -361,10 +361,9 @@ const char* cmGeneratorTarget::GetOutputTargetType(bool implib) const
if (implib) {
// A DLL import library is treated as an archive target.
return "ARCHIVE";
- } else {
- // A DLL shared library is treated as a runtime target.
- return "RUNTIME";
}
+ // A DLL shared library is treated as a runtime target.
+ return "RUNTIME";
} else {
// For non-DLL platforms shared libraries are treated as
// library targets.
@@ -1324,26 +1323,23 @@ std::string cmGeneratorTarget::GetSOName(const std::string& config) const
// The imported library has no builtin soname so the name
// searched at runtime will be just the filename.
return cmSystemTools::GetFilenameName(info->Location);
- } else {
- // Use the soname given if any.
- if (info->SOName.find("@rpath/") == 0) {
- return info->SOName.substr(6);
- }
- return info->SOName;
}
- } else {
- return "";
+ // Use the soname given if any.
+ if (info->SOName.find("@rpath/") == 0) {
+ return info->SOName.substr(6);
+ }
+ return info->SOName;
}
- } else {
- // Compute the soname that will be built.
- std::string name;
- std::string soName;
- std::string realName;
- std::string impName;
- std::string pdbName;
- this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
- return soName;
+ return "";
}
+ // Compute the soname that will be built.
+ std::string name;
+ std::string soName;
+ std::string realName;
+ std::string impName;
+ std::string pdbName;
+ this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
+ return soName;
}
std::string cmGeneratorTarget::GetAppBundleDirectory(const std::string& config,
@@ -1418,9 +1414,8 @@ std::string cmGeneratorTarget::GetFullName(const std::string& config,
{
if (this->IsImported()) {
return this->GetFullNameImported(config, implib);
- } else {
- return this->GetFullNameInternal(config, implib);
}
+ return this->GetFullNameInternal(config, implib);
}
std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
@@ -1444,9 +1439,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForBuildTree(
}
dir += "/";
return dir;
- } else {
- return "";
}
+ return "";
}
std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
@@ -1468,9 +1462,8 @@ std::string cmGeneratorTarget::GetInstallNameDirForInstallTree() const
}
}
return dir;
- } else {
- return "";
}
+ return "";
}
cmListFileBacktrace cmGeneratorTarget::GetBacktrace() const
@@ -1516,9 +1509,8 @@ const char* cmGeneratorTarget::GetExportMacro() const
this->ExportMacro = cmSystemTools::MakeCidentifier(in);
}
return this->ExportMacro.c_str();
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
class cmTargetCollectLinkLanguages
@@ -1642,7 +1634,8 @@ public:
{
if (this->Preferred.empty()) {
return "";
- } else if (this->Preferred.size() > 1) {
+ }
+ if (this->Preferred.size() > 1) {
std::ostringstream e;
e << "Target " << this->Target->GetName()
<< " contains multiple languages with the highest linker preference"
@@ -2723,9 +2716,8 @@ std::string cmGeneratorTarget::GetFullPath(const std::string& config,
{
if (this->IsImported()) {
return this->Target->ImportedGetFullPath(config, implib);
- } else {
- return this->NormalGetFullPath(config, implib, realname);
}
+ return this->NormalGetFullPath(config, implib, realname);
}
std::string cmGeneratorTarget::NormalGetFullPath(const std::string& config,
@@ -2770,16 +2762,15 @@ std::string cmGeneratorTarget::NormalGetRealName(
std::string pdbName;
this->GetExecutableNames(name, realName, impName, pdbName, config);
return realName;
- } else {
- // Compute the real name that will be built.
- std::string name;
- std::string soName;
- std::string realName;
- std::string impName;
- std::string pdbName;
- this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
- return realName;
}
+ // Compute the real name that will be built.
+ std::string name;
+ std::string soName;
+ std::string realName;
+ std::string impName;
+ std::string pdbName;
+ this->GetLibraryNames(name, soName, realName, impName, pdbName, config);
+ return realName;
}
void cmGeneratorTarget::GetLibraryNames(std::string& name, std::string& soName,
@@ -3587,9 +3578,8 @@ std::pair<bool, const char*> consistentNumberProperty(const char* lhs,
if (t == NumberMaxType) {
return std::make_pair(true, std::max(lnum, rnum) == lnum ? lhs : rhs);
- } else {
- return std::make_pair(true, std::min(lnum, rnum) == lnum ? lhs : rhs);
}
+ return std::make_pair(true, std::min(lnum, rnum) == lnum ? lhs : rhs);
}
template <>
@@ -3906,11 +3896,11 @@ std::string cmGeneratorTarget::GetFrameworkVersion() const
if (const char* fversion = this->GetProperty("FRAMEWORK_VERSION")) {
return fversion;
- } else if (const char* tversion = this->GetProperty("VERSION")) {
+ }
+ if (const char* tversion = this->GetProperty("VERSION")) {
return tversion;
- } else {
- return "A";
}
+ return "A";
}
void cmGeneratorTarget::ComputeVersionedName(std::string& vName,
@@ -4169,7 +4159,8 @@ std::string cmGeneratorTarget::GetDirectory(const std::string& config,
// Return the directory from which the target is imported.
return cmSystemTools::GetFilenamePath(
this->Target->ImportedGetFullPath(config, implib));
- } else if (OutputInfo const* info = this->GetOutputInfo(config)) {
+ }
+ if (OutputInfo const* info = this->GetOutputInfo(config)) {
// Return the directory in which the target will be built.
return implib ? info->ImpDir : info->OutDir;
}
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 3b8aaa6..2b83479 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -93,12 +93,11 @@ std::string cmGlobalNinjaGenerator::EncodeIdent(const std::string& ident,
names << "ident" << VarNum++;
vars << names.str() << " = " << ident << "\n";
return "$" + names.str();
- } else {
- std::string result = ident;
- cmSystemTools::ReplaceString(result, " ", "$ ");
- cmSystemTools::ReplaceString(result, ":", "$:");
- return result;
}
+ std::string result = ident;
+ cmSystemTools::ReplaceString(result, " ", "$ ");
+ cmSystemTools::ReplaceString(result, ":", "$:");
+ return result;
}
std::string cmGlobalNinjaGenerator::EncodeLiteral(const std::string& lit)
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 0fcd8ba..72c4d1f 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -63,9 +63,8 @@ void cmInstallExportGenerator::ComputeTempDir()
this->TempDir += "/Export";
if (this->Destination.empty()) {
return;
- } else {
- this->TempDir += "/";
}
+ this->TempDir += "/";
// Enforce a maximum length.
bool useMD5 = false;
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx
index 28b3781..1967d2a 100644
--- a/Source/cmListFileCache.cxx
+++ b/Source/cmListFileCache.cxx
@@ -259,10 +259,9 @@ bool cmListFileParser::AddArgument(cmListFileLexer_Token* token,
if (isError) {
this->Makefile->IssueMessage(cmake::FATAL_ERROR, m.str());
return false;
- } else {
- this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
- return true;
}
+ this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, m.str());
+ return true;
}
struct cmListFileBacktrace::Entry : public cmListFileContext
@@ -377,10 +376,9 @@ cmListFileContext const& cmListFileBacktrace::Top() const
{
if (this->Cur) {
return *this->Cur;
- } else {
- static cmListFileContext const empty;
- return empty;
}
+ static cmListFileContext const empty;
+ return empty;
}
void cmListFileBacktrace::PrintTitle(std::ostream& out) const
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index accce49..d8f6bdf 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -626,16 +626,14 @@ std::string cmLocalGenerator::ExpandRuleVariable(
if (variable == "TARGET_VERSION_MAJOR") {
if (replaceValues.TargetVersionMajor) {
return replaceValues.TargetVersionMajor;
- } else {
- return "0";
}
+ return "0";
}
if (variable == "TARGET_VERSION_MINOR") {
if (replaceValues.TargetVersionMinor) {
return replaceValues.TargetVersionMinor;
- } else {
- return "0";
}
+ return "0";
}
if (replaceValues.Target) {
if (variable == "TARGET_BASE") {
@@ -644,9 +642,8 @@ std::string cmLocalGenerator::ExpandRuleVariable(
std::string::size_type pos = targetBase.rfind('.');
if (pos != targetBase.npos) {
return targetBase.substr(0, pos);
- } else {
- return targetBase;
}
+ return targetBase;
}
}
}
@@ -813,9 +810,8 @@ const char* cmLocalGenerator::GetRuleLauncher(cmGeneratorTarget* target,
{
if (target) {
return target->GetProperty(prop);
- } else {
- return this->Makefile->GetProperty(prop);
}
+ return this->Makefile->GetProperty(prop);
}
void cmLocalGenerator::InsertRuleLauncher(std::string& s,
@@ -2365,10 +2361,9 @@ static bool cmLocalGeneratorShortenObjectName(std::string& objName,
// The object name is now short enough.
return true;
- } else {
- // The object name could not be shortened enough.
- return false;
}
+ // The object name could not be shortened enough.
+ return false;
}
bool cmLocalGeneratorCheckObjectName(std::string& objName,
@@ -2382,15 +2377,13 @@ bool cmLocalGeneratorCheckObjectName(std::string& objName,
if (objName.size() > max_obj_len) {
// The current object file name is too long. Try to shorten it.
return cmLocalGeneratorShortenObjectName(objName, max_obj_len);
- } else {
- // The object file name is short enough.
- return true;
}
- } else {
- // The build directory in which the object will be stored is
- // already too deep.
- return false;
+ // The object file name is short enough.
+ return true;
}
+ // The build directory in which the object will be stored is
+ // already too deep.
+ return false;
}
#endif
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ab7de57..28a3ab5 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -813,11 +813,10 @@ cmSourceFile* cmMakefile::AddCustomCommandToOutput(
// The existing custom command is identical. Silently ignore
// the duplicate.
return file;
- } else {
- // The existing custom command is different. We need to
- // generate a rule file for this new command.
- file = CM_NULLPTR;
}
+ // The existing custom command is different. We need to
+ // generate a rule file for this new command.
+ file = CM_NULLPTR;
} else if (!file) {
file = this->CreateSource(main_dependency);
}
@@ -2029,7 +2028,8 @@ void cmMakefile::AddSourceGroup(const std::vector<std::string>& name,
sg->SetGroupRegex(regex);
}
return;
- } else if (i == -1) {
+ }
+ if (i == -1) {
// group does not exist nor belong to any existing group
// add its first component
this->SourceGroups.push_back(cmSourceGroup(name[0].c_str(), regex));
@@ -2817,13 +2817,12 @@ std::string cmMakefile::GetConfigurations(std::vector<std::string>& configs,
cmSystemTools::ExpandListArgument(configTypes, configs);
}
return "";
- } else {
- const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
- if (singleConfig && !buildType.empty()) {
- configs.push_back(buildType);
- }
- return buildType;
}
+ const std::string& buildType = this->GetSafeDefinition("CMAKE_BUILD_TYPE");
+ if (singleConfig && !buildType.empty()) {
+ configs.push_back(buildType);
+ }
+ return buildType;
}
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -3129,9 +3128,8 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const std::string& sourceName,
{
if (cmSourceFile* esf = this->GetSource(sourceName)) {
return esf;
- } else {
- return this->CreateSource(sourceName, generated);
}
+ return this->CreateSource(sourceName, generated);
}
void cmMakefile::EnableLanguage(std::vector<std::string> const& lang,
@@ -3756,69 +3754,67 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
<< "\" because an imported target with the same name already exists.";
msg = e.str();
return false;
- } else {
- // target names must be globally unique
- switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
- case cmPolicies::WARN:
- this->IssueMessage(
- cmake::AUTHOR_WARNING,
- cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
- case cmPolicies::OLD:
- return true;
- case cmPolicies::REQUIRED_IF_USED:
- case cmPolicies::REQUIRED_ALWAYS:
- this->IssueMessage(
- cmake::FATAL_ERROR,
- cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0002));
- return true;
- case cmPolicies::NEW:
- break;
- }
-
- // The conflict is with a non-imported target.
- // Allow this if the user has requested support.
- cmake* cm = this->GetCMakeInstance();
- if (isCustom && existing->GetType() == cmState::UTILITY &&
- this != existing->GetMakefile() &&
- cm->GetState()->GetGlobalPropertyAsBool(
- "ALLOW_DUPLICATE_CUSTOM_TARGETS")) {
+ }
+ // target names must be globally unique
+ switch (this->GetPolicyStatus(cmPolicies::CMP0002)) {
+ case cmPolicies::WARN:
+ this->IssueMessage(cmake::AUTHOR_WARNING,
+ cmPolicies::GetPolicyWarning(cmPolicies::CMP0002));
+ case cmPolicies::OLD:
return true;
- }
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ this->IssueMessage(
+ cmake::FATAL_ERROR,
+ cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0002));
+ return true;
+ case cmPolicies::NEW:
+ break;
+ }
- // Produce an error that tells the user how to work around the
- // problem.
- std::ostringstream e;
- e << "cannot create target \"" << name
- << "\" because another target with the same name already exists. "
- << "The existing target is ";
- switch (existing->GetType()) {
- case cmState::EXECUTABLE:
- e << "an executable ";
- break;
- case cmState::STATIC_LIBRARY:
- e << "a static library ";
- break;
- case cmState::SHARED_LIBRARY:
- e << "a shared library ";
- break;
- case cmState::MODULE_LIBRARY:
- e << "a module library ";
- break;
- case cmState::UTILITY:
- e << "a custom target ";
- break;
- case cmState::INTERFACE_LIBRARY:
- e << "an interface library ";
- break;
- default:
- break;
- }
- e << "created in source directory \""
- << existing->GetMakefile()->GetCurrentSourceDirectory() << "\". "
- << "See documentation for policy CMP0002 for more details.";
- msg = e.str();
- return false;
+ // The conflict is with a non-imported target.
+ // Allow this if the user has requested support.
+ cmake* cm = this->GetCMakeInstance();
+ if (isCustom && existing->GetType() == cmState::UTILITY &&
+ this != existing->GetMakefile() &&
+ cm->GetState()->GetGlobalPropertyAsBool(
+ "ALLOW_DUPLICATE_CUSTOM_TARGETS")) {
+ return true;
+ }
+
+ // Produce an error that tells the user how to work around the
+ // problem.
+ std::ostringstream e;
+ e << "cannot create target \"" << name
+ << "\" because another target with the same name already exists. "
+ << "The existing target is ";
+ switch (existing->GetType()) {
+ case cmState::EXECUTABLE:
+ e << "an executable ";
+ break;
+ case cmState::STATIC_LIBRARY:
+ e << "a static library ";
+ break;
+ case cmState::SHARED_LIBRARY:
+ e << "a shared library ";
+ break;
+ case cmState::MODULE_LIBRARY:
+ e << "a module library ";
+ break;
+ case cmState::UTILITY:
+ e << "a custom target ";
+ break;
+ case cmState::INTERFACE_LIBRARY:
+ e << "an interface library ";
+ break;
+ default:
+ break;
}
+ e << "created in source directory \""
+ << existing->GetMakefile()->GetCurrentSourceDirectory() << "\". "
+ << "See documentation for policy CMP0002 for more details.";
+ msg = e.str();
+ return false;
}
return true;
}
@@ -4246,15 +4242,15 @@ bool cmMakefile::HaveCStandardAvailable(cmTarget const* target,
existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
cmArrayEnd(C_STANDARDS), cmStrCmp("11"))) {
return false;
- } else if (needC99 && existingCStandard &&
- existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
- cmArrayEnd(C_STANDARDS),
- cmStrCmp("99"))) {
+ }
+ if (needC99 && existingCStandard &&
+ existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
+ cmArrayEnd(C_STANDARDS), cmStrCmp("99"))) {
return false;
- } else if (needC90 && existingCStandard &&
- existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
- cmArrayEnd(C_STANDARDS),
- cmStrCmp("90"))) {
+ }
+ if (needC90 && existingCStandard &&
+ existingCIt < std::find_if(cmArrayBegin(C_STANDARDS),
+ cmArrayEnd(C_STANDARDS), cmStrCmp("90"))) {
return false;
}
return true;
@@ -4332,10 +4328,11 @@ bool cmMakefile::HaveCxxStandardAvailable(cmTarget const* target,
cmArrayEnd(CXX_STANDARDS),
cmStrCmp("11"))) {
return false;
- } else if (needCxx98 &&
- existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
- cmArrayEnd(CXX_STANDARDS),
- cmStrCmp("98"))) {
+ }
+ if (needCxx98 &&
+ existingCxxIt < std::find_if(cmArrayBegin(CXX_STANDARDS),
+ cmArrayEnd(CXX_STANDARDS),
+ cmStrCmp("98"))) {
return false;
}
return true;
diff --git a/Source/cmNewLineStyle.cxx b/Source/cmNewLineStyle.cxx
index c03f60d..d64993a 100644
--- a/Source/cmNewLineStyle.cxx
+++ b/Source/cmNewLineStyle.cxx
@@ -34,19 +34,18 @@ bool cmNewLineStyle::ReadFromArguments(const std::vector<std::string>& args,
if (eol == "LF" || eol == "UNIX") {
NewLineStyle = LF;
return true;
- } else if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
+ }
+ if (eol == "CRLF" || eol == "WIN32" || eol == "DOS") {
NewLineStyle = CRLF;
return true;
- } else {
- errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
- "CRLF, UNIX, DOS, and WIN32 are supported";
- return false;
}
- } else {
- errorString = "NEWLINE_STYLE must set a style: "
- "LF, CRLF, UNIX, DOS, or WIN32";
+ errorString = "NEWLINE_STYLE sets an unknown style, only LF, "
+ "CRLF, UNIX, DOS, and WIN32 are supported";
return false;
}
+ errorString = "NEWLINE_STYLE must set a style: "
+ "LF, CRLF, UNIX, DOS, or WIN32";
+ return false;
}
}
return true;
diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 28bd992..f1da4d5 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -347,7 +347,8 @@ static std::string GetRccExecutable(cmGeneratorTarget const* target)
return std::string();
}
return qt5Rcc->ImportedGetLocation("");
- } else if (strcmp(qtVersion, "4") == 0) {
+ }
+ if (strcmp(qtVersion, "4") == 0) {
cmGeneratorTarget* qt4Rcc = lg->FindGeneratorTargetToUse("Qt4::rcc");
if (!qt4Rcc) {
cmSystemTools::Error("Qt4::rcc target not found ", targetName.c_str());
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index 04727b2..5869a01 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -295,9 +295,8 @@ const char* cmSourceFile::GetProperty(const std::string& prop) const
if (prop == "LOCATION") {
if (this->FullPath.empty()) {
return CM_NULLPTR;
- } else {
- return this->FullPath.c_str();
}
+ return this->FullPath.c_str();
}
const char* retVal = this->Properties.GetPropertyValue(prop);
diff --git a/Source/cmState.cxx b/Source/cmState.cxx
index d4eb90a..073c239 100644
--- a/Source/cmState.cxx
+++ b/Source/cmState.cxx
@@ -1702,7 +1702,8 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
return parent.GetDirectory().GetCurrentSource();
}
return "";
- } else if (prop == "LISTFILE_STACK") {
+ }
+ if (prop == "LISTFILE_STACK") {
std::vector<std::string> listFiles;
cmState::Snapshot snp = this->Snapshot_;
while (snp.IsValid()) {
@@ -1712,10 +1713,12 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
std::reverse(listFiles.begin(), listFiles.end());
output = cmJoin(listFiles, ";");
return output.c_str();
- } else if (prop == "CACHE_VARIABLES") {
+ }
+ if (prop == "CACHE_VARIABLES") {
output = cmJoin(this->Snapshot_.State->GetCacheEntryKeys(), ";");
return output.c_str();
- } else if (prop == "VARIABLES") {
+ }
+ if (prop == "VARIABLES") {
std::vector<std::string> res = this->Snapshot_.ClosureKeys();
std::vector<std::string> cacheKeys =
this->Snapshot_.State->GetCacheEntryKeys();
@@ -1723,13 +1726,16 @@ const char* cmState::Directory::GetProperty(const std::string& prop,
std::sort(res.begin(), res.end());
output = cmJoin(res, ";");
return output.c_str();
- } else if (prop == "INCLUDE_DIRECTORIES") {
+ }
+ if (prop == "INCLUDE_DIRECTORIES") {
output = cmJoin(this->GetIncludeDirectoriesEntries(), ";");
return output.c_str();
- } else if (prop == "COMPILE_OPTIONS") {
+ }
+ if (prop == "COMPILE_OPTIONS") {
output = cmJoin(this->GetCompileOptionsEntries(), ";");
return output.c_str();
- } else if (prop == "COMPILE_DEFINITIONS") {
+ }
+ if (prop == "COMPILE_DEFINITIONS") {
output = cmJoin(this->GetCompileDefinitionsEntries(), ";");
return output.c_str();
}
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index f19f0f6..21a50cb 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -333,9 +333,8 @@ void cmSystemTools::Message(const char* m1, const char* title)
(*s_MessageCallback)(m1, title, s_DisableMessages,
s_MessageCallbackClientData);
return;
- } else {
- std::cerr << m1 << std::endl << std::flush;
}
+ std::cerr << m1 << std::endl << std::flush;
}
void cmSystemTools::ReportLastSystemError(const char* msg)
@@ -1688,7 +1687,8 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
if (pipe == cmsysProcess_Pipe_Timeout) {
// Timeout has been exceeded.
return pipe;
- } else if (pipe == cmsysProcess_Pipe_STDOUT) {
+ }
+ if (pipe == cmsysProcess_Pipe_STDOUT) {
// Append to the stdout buffer.
std::vector<char>::size_type size = out.size();
out.insert(out.end(), data, data + length);
@@ -1704,13 +1704,13 @@ int cmSystemTools::WaitForLine(cmsysProcess* process, std::string& line,
line.append(&out[0], outiter - out.begin());
out.erase(out.begin(), out.end());
return cmsysProcess_Pipe_STDOUT;
- } else if (!err.empty()) {
+ }
+ if (!err.empty()) {
line.append(&err[0], erriter - err.begin());
err.erase(err.begin(), err.end());
return cmsysProcess_Pipe_STDERR;
- } else {
- return cmsysProcess_Pipe_None;
}
+ return cmsysProcess_Pipe_None;
}
}
}
@@ -2218,13 +2218,12 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
// The new rpath is empty and there is no rpath anyway so it is
// okay.
return true;
- } else {
- if (emsg) {
- *emsg = "No valid ELF RPATH or RUNPATH entry exists in the file; ";
- *emsg += elf.GetErrorMessage();
- }
- return false;
}
+ if (emsg) {
+ *emsg = "No valid ELF RPATH or RUNPATH entry exists in the file; ";
+ *emsg += elf.GetErrorMessage();
+ }
+ return false;
}
for (int i = 0; i < se_count; ++i) {
@@ -2382,7 +2381,8 @@ bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
if (lhs < rhs) {
// lhs < rhs, so true if operation is LESS
return (op & cmSystemTools::OP_LESS) != 0;
- } else if (lhs > rhs) {
+ }
+ if (lhs > rhs) {
// lhs > rhs, so true if operation is GREATER
return (op & cmSystemTools::OP_GREATER) != 0;
}
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 5681885..ed04d2f 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -774,12 +774,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
<< prop << "\" is not allowed.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
- } else if (prop == "NAME") {
+ }
+ if (prop == "NAME") {
std::ostringstream e;
e << "NAME property is read-only\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
- } else if (prop == "INCLUDE_DIRECTORIES") {
+ }
+ if (prop == "INCLUDE_DIRECTORIES") {
this->Internal->IncludeDirectoriesEntries.clear();
this->Internal->IncludeDirectoriesBacktraces.clear();
if (value) {
@@ -856,12 +858,14 @@ void cmTarget::AppendProperty(const std::string& prop, const char* value,
<< prop << "\" is not allowed.";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
- } else if (prop == "NAME") {
+ }
+ if (prop == "NAME") {
std::ostringstream e;
e << "NAME property is read-only\n";
this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
- } else if (prop == "INCLUDE_DIRECTORIES") {
+ }
+ if (prop == "INCLUDE_DIRECTORIES") {
if (value && *value) {
this->Internal->IncludeDirectoriesEntries.push_back(value);
cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
@@ -1230,9 +1234,10 @@ const char* cmTarget::GetProperty(const std::string& prop,
return output.c_str();
}
// the type property returns what type the target is
- else if (prop == propTYPE) {
+ if (prop == propTYPE) {
return cmState::GetTargetTypeName(this->GetType());
- } else if (prop == propINCLUDE_DIRECTORIES) {
+ }
+ if (prop == propINCLUDE_DIRECTORIES) {
if (this->Internal->IncludeDirectoriesEntries.empty()) {
return CM_NULLPTR;
}
@@ -1240,7 +1245,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
static std::string output;
output = cmJoin(this->Internal->IncludeDirectoriesEntries, ";");
return output.c_str();
- } else if (prop == propCOMPILE_FEATURES) {
+ }
+ if (prop == propCOMPILE_FEATURES) {
if (this->Internal->CompileFeaturesEntries.empty()) {
return CM_NULLPTR;
}
@@ -1248,7 +1254,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
static std::string output;
output = cmJoin(this->Internal->CompileFeaturesEntries, ";");
return output.c_str();
- } else if (prop == propCOMPILE_OPTIONS) {
+ }
+ if (prop == propCOMPILE_OPTIONS) {
if (this->Internal->CompileOptionsEntries.empty()) {
return CM_NULLPTR;
}
@@ -1256,7 +1263,8 @@ const char* cmTarget::GetProperty(const std::string& prop,
static std::string output;
output = cmJoin(this->Internal->CompileOptionsEntries, ";");
return output.c_str();
- } else if (prop == propCOMPILE_DEFINITIONS) {
+ }
+ if (prop == propCOMPILE_DEFINITIONS) {
if (this->Internal->CompileDefinitionsEntries.empty()) {
return CM_NULLPTR;
}
@@ -1264,15 +1272,20 @@ const char* cmTarget::GetProperty(const std::string& prop,
static std::string output;
output = cmJoin(this->Internal->CompileDefinitionsEntries, ";");
return output.c_str();
- } else if (prop == propIMPORTED) {
+ }
+ if (prop == propIMPORTED) {
return this->IsImported() ? "TRUE" : "FALSE";
- } else if (prop == propNAME) {
+ }
+ if (prop == propNAME) {
return this->GetName().c_str();
- } else if (prop == propBINARY_DIR) {
+ }
+ if (prop == propBINARY_DIR) {
return this->GetMakefile()->GetCurrentBinaryDirectory();
- } else if (prop == propSOURCE_DIR) {
+ }
+ if (prop == propSOURCE_DIR) {
return this->GetMakefile()->GetCurrentSourceDirectory();
- } else if (prop == propSOURCES) {
+ }
+ if (prop == propSOURCES) {
if (this->Internal->SourceEntries.empty()) {
return CM_NULLPTR;
}
diff --git a/Source/cmUuid.cxx b/Source/cmUuid.cxx
index 7bfc109..b072964 100644
--- a/Source/cmUuid.cxx
+++ b/Source/cmUuid.cxx
@@ -180,13 +180,14 @@ bool cmUuid::IntFromHexDigit(char input, char& output) const
if (input >= '0' && input <= '9') {
output = char(input - '0');
return true;
- } else if (input >= 'a' && input <= 'f') {
+ }
+ if (input >= 'a' && input <= 'f') {
output = char(input - 'a' + 0xA);
return true;
- } else if (input >= 'A' && input <= 'F') {
+ }
+ if (input >= 'A' && input <= 'F') {
output = char(input - 'A' + 0xA);
return true;
- } else {
- return false;
}
+ return false;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 9e338e8..74c3f71 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1513,9 +1513,8 @@ int cmake::Run(const std::vector<std::string>& args, bool noconfigure)
if (this->GetWorkingMode() != NORMAL_MODE) {
if (cmSystemTools::GetErrorOccuredFlag()) {
return -1;
- } else {
- return 0;
}
+ return 0;
}
// If MAKEFLAGS are given in the environment, remove the environment
@@ -2063,11 +2062,10 @@ cmInstalledFile* cmake::GetOrCreateInstalledFile(cmMakefile* mf,
if (i != this->InstalledFiles.end()) {
cmInstalledFile& file = i->second;
return &file;
- } else {
- cmInstalledFile& file = this->InstalledFiles[name];
- file.SetName(mf, name);
- return &file;
}
+ cmInstalledFile& file = this->InstalledFiles[name];
+ file.SetName(mf, name);
+ return &file;
}
cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
@@ -2078,9 +2076,8 @@ cmInstalledFile const* cmake::GetInstalledFile(const std::string& name) const
if (i != this->InstalledFiles.end()) {
cmInstalledFile const& file = i->second;
return &file;
- } else {
- return CM_NULLPTR;
}
+ return CM_NULLPTR;
}
int cmake::GetSystemInformation(std::vector<std::string>& args)
@@ -2253,11 +2250,10 @@ static bool cmakeCheckStampFile(const char* stampName)
std::cout << "CMake does not need to re-run because " << stampName
<< " is up-to-date.\n";
return true;
- } else {
- cmSystemTools::RemoveFile(stampTemp);
- cmSystemTools::Error("Cannot restore timestamp ", stampName);
- return false;
}
+ cmSystemTools::RemoveFile(stampTemp);
+ cmSystemTools::Error("Cannot restore timestamp ", stampName);
+ return false;
}
static bool cmakeCheckStampList(const char* stampList)
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 8731b2b..1505d00 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -163,7 +163,8 @@ int main(int ac, char const* const* av)
if (ac > 1) {
if (strcmp(av[1], "--build") == 0) {
return do_build(ac, av);
- } else if (strcmp(av[1], "-E") == 0) {
+ }
+ if (strcmp(av[1], "-E") == 0) {
return do_command(ac, av);
}
}
@@ -237,7 +238,8 @@ int do_cmake(int ac, char const* const* av)
"Use cmake-gui or ccmake for an interactive dialog.\n";
/* clang-format on */
return 1;
- } else if (strcmp(av[i], "--system-information") == 0) {
+ }
+ if (strcmp(av[i], "--system-information") == 0) {
sysinfo = true;
} else if (strcmp(av[i], "-N") == 0) {
view_only = true;
@@ -313,9 +315,8 @@ int do_cmake(int ac, char const* const* av)
// interpret negative return values as errors.
if (res != 0) {
return 1;
- } else {
- return 0;
}
+ return 0;
}
static int do_build(int ac, char const* const* av)
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index be023b1..f25c085 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -262,7 +262,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
// run include what you use command and then run the compile
// command. This is an internal undocumented option and should
// only be used by CMake itself when running iwyu.
- else if (args[1] == "__run_iwyu") {
+ if (args[1] == "__run_iwyu") {
if (args.size() < 3) {
std::cerr << "__run_iwyu Usage: -E __run_iwyu [--iwyu=/path/iwyu]"
" [--tidy=/path/tidy] -- compile command\n";
@@ -393,13 +393,13 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
}
// Echo string
- else if (args[1] == "echo") {
+ if (args[1] == "echo") {
std::cout << cmJoin(cmMakeRange(args).advance(2), " ") << std::endl;
return 0;
}
// Echo string no new line
- else if (args[1] == "echo_append") {
+ if (args[1] == "echo_append") {
std::cout << cmJoin(cmMakeRange(args).advance(2), " ");
return 0;
}
@@ -851,7 +851,8 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
cmSystemTools::Error("Can not use compression flags with format: ",
format.c_str());
return 1;
- } else if (nCompress > 1) {
+ }
+ if (nCompress > 1) {
cmSystemTools::Error("Can only compress a tar file one way; "
"at most one flag of z, j, or J may be used");
return 1;
@@ -995,12 +996,12 @@ static void cmcmdProgressReport(std::string const& dir, std::string const& num)
int count = 0;
if (!progFile) {
return;
- } else {
- if (1 != fscanf(progFile, "%i", &count)) {
- cmSystemTools::Message("Could not read from progress file.");
- }
- fclose(progFile);
}
+ if (1 != fscanf(progFile, "%i", &count)) {
+ cmSystemTools::Message("Could not read from progress file.");
+ }
+ fclose(progFile);
+
const char* last = num.c_str();
for (const char* c = last;; ++c) {
if (*c == ',' || *c == '\0') {
diff --git a/Utilities/Scripts/update-vim-syntax.bash b/Utilities/Scripts/update-vim-syntax.bash
new file mode 100755
index 0000000..bb14683
--- /dev/null
+++ b/Utilities/Scripts/update-vim-syntax.bash
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -e
+set -x
+shopt -s dotglob
+
+readonly name="vim-cmake-syntax"
+readonly ownership="vim-cmake-syntax upstream <kwrobot@kitware.com>"
+readonly subtree="Auxiliary/vim"
+readonly repo="https://github.com/pboettch/vim-cmake-syntax.git"
+readonly tag="master"
+readonly shortlog=true
+readonly paths="
+ indent
+ syntax
+ cmake.vim.in
+ extract-upper-case.pl
+"
+
+extract_source () {
+ git_archive
+}
+
+. "${BASH_SOURCE%/*}/update-third-party.bash"
diff --git a/Utilities/cmlibarchive/libarchive/xxhash.c b/Utilities/cmlibarchive/libarchive/xxhash.c
index d7f8e96..262fecb 100644
--- a/Utilities/cmlibarchive/libarchive/xxhash.c
+++ b/Utilities/cmlibarchive/libarchive/xxhash.c
@@ -29,12 +29,13 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You can contact the author at :
- xxHash source repository : http://code.google.com/p/xxhash/
*/
-#include <stdlib.h>
-#include <string.h>
#include "archive_platform.h"
#include "archive_xxhash.h"
+#include <stdlib.h>
+#include <string.h>
+
#ifdef HAVE_LIBLZ4
/***************************************