1. 19 Sep, 2016 1 commit
    • Stephen Kelly's avatar
      Convert: Remove last use of START enum value · 495e26ae
      Stephen Kelly authored
      The enums just introduce unfamiliar names and don't provide value.
      The order of arguments is reversed, as that is the result of the
      overload which accepts the RelativeRoot enum.
  2. 13 Sep, 2016 2 commits
  3. 12 Sep, 2016 1 commit
    • Dan Kegel's avatar
      Re-order link line to place RPATH entries before libraries · 9370b697
      Dan Kegel authored and Brad King's avatar Brad King committed
      Since we support adding arbitrary flags to the link line via
      `target_link_libraries` the project/user may add their own RPATH flags
      (typically for system library locations).  Re-order the link line to
      place our generated RPATH entries before the libraries so that they also
      come before flag-specified entries.  Otherwise our in-build-tree RPATH
      entries may not be preferred by the dynamic loader and we could collide
      with libraries in the system directories.
      Closes: #16293
  4. 04 Sep, 2016 1 commit
  5. 03 Sep, 2016 1 commit
  6. 27 Aug, 2016 3 commits
  7. 18 Aug, 2016 1 commit
  8. 16 Aug, 2016 1 commit
  9. 10 Jul, 2016 1 commit
  10. 28 Jun, 2016 1 commit
  11. 20 Jun, 2016 1 commit
  12. 17 Jun, 2016 2 commits
  13. 12 Jun, 2016 1 commit
  14. 10 Jun, 2016 2 commits
  15. 09 Jun, 2016 2 commits
  16. 08 Jun, 2016 1 commit
  17. 02 Jun, 2016 1 commit
  18. 26 May, 2016 1 commit
    • Daniel Pfeifer's avatar
      Remove unnecessary local copies. · 27ead963
      Daniel Pfeifer authored
      Use clang-tidy's performance-unnecessary-copy-initialization checker.
      After applying the fix-its (which turns the copies into const&), revise
      the changes and see whether the copies can be removed entirely by using
      the original instead.
  19. 25 May, 2016 1 commit
    • Daniel Pfeifer's avatar
      Use enums defined in cmOutputConverter using their fully qualified name. · 25d1ef64
      Daniel Pfeifer authored and Brad King's avatar Brad King committed
      Mostly automated:
      values=("RelativeRoot" "NONE" "FULL" "HOME" "START" "HOME_OUTPUT" "START_OUTPUT"
              "FortranFormat" "FortranFormatNone" "FortranFormatFixed" "FortranFormatFree")
      for i in "${values[@]}"; do git grep -l cmLocalGenerator::$i | xargs sed -i "s|cmLocalGenerator::$i|cmOutputConverter::$i|g"; done
  20. 24 May, 2016 2 commits
    • Daniel Pfeifer's avatar
      Improve string find: prefer character overloads. · 5784747d
      Daniel Pfeifer authored
      Apply fix-its from clang-tidy's performance-faster-string-find checker.
      Ignore findings in kwsys.
    • Daniel Pfeifer's avatar
      Use std::replace for replacing chars in strings. · 5cec953e
      Daniel Pfeifer authored
      Find uses of `cmSystemTools::ReplaceString` where both `replace` and
      `with` are string literals with a size of one.
      Automate with:
      git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\2', '\3');|g"
      git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\(.\)\", \"\\\\\\\\\");|std::replace(\1.begin(), \1.end(), '\2', '\\\\\\\\');|g"
      git grep -l ReplaceString | xargs sed -i "s|cmSystemTools::ReplaceString(\([^,]*\), \"\\\\\\\\\", \"\(.\)\");|std::replace(\1.begin(), \1.end(), '\\\\\\\\', '\2');|g"
  21. 16 May, 2016 1 commit
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format · d9fd2f54
      Kitware Robot authored and Brad King's avatar Brad King committed
      Run the `Utilities/Scripts/clang-format.bash` script to update
      all our C++ code to a new style defined by `.clang-format`.
      Use `clang-format` version 3.8.
      * If you reached this commit for a line in `git blame`, re-run the blame
        operation starting at the parent of this commit to see older history
        for the content.
      * See the parent commit for instructions to rebase a change across this
        style transition commit.
  22. 09 May, 2016 1 commit
    • Brad King's avatar
      Remove `//------...` horizontal separator comments · 0ac18d40
      Brad King authored
      Modern editors provide plenty of ways to visually separate functions.
      Drop the explicit comments that previously served this purpose.
      Use the following command to automate the change:
          $ git ls-files -z -- \
              "*.c" "*.cc" "*.cpp" "*.cxx" "*.h" "*.hh" "*.hpp" "*.hxx" |
            egrep -z -v "^Source/cmCommandArgumentLexer\." |
            egrep -z -v "^Source/cmCommandArgumentParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmDependsJavaLexer\." |
            egrep -z -v "^Source/cmDependsJavaParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmExprLexer\." |
            egrep -z -v "^Source/cmExprParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmFortranLexer\." |
            egrep -z -v "^Source/cmFortranParser(\.y|\.cxx|Tokens\.h)" |
            egrep -z -v "^Source/cmListFileLexer\." |
            egrep -z -v "^Source/cm_sha2" |
            egrep -z -v "^Source/(kwsys|CursesDialog/form)/" |
            egrep -z -v "^Utilities/(KW|cm).*/" |
            xargs -0 sed -i '/^\(\/\/---*\|\/\*---*\*\/\)$/ {d;}'
      This avoids modifying third-party sources and generated sources.
  23. 06 May, 2016 2 commits
    • Brad King's avatar
      Isolate formatted streaming blocks with clang-format off/on · 64b55203
      Brad King authored
      The clang-format tool can do a good job formatting most code, but
      well-organized streaming blocks are best left manually formatted.
      Find blocks of the form
          os <<
      using the command
          $ git ls-files -z -- Source |
            egrep -v -z '^Source/kwsys/' |
            xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
              '<<[^\n]*\n(^ *("[^\n]*("|<<|;)$|;)\n){2,}'
      Find blocks of the form
          os << "...\n"
             << "...\n"
             << "...\n";
      using the command
          $ git ls-files -z -- Source |
            egrep -v -z '^Source/kwsys/' |
            xargs -0 pcregrep -M --color=always -B 1 -A 1 -n \
              '<<[^\n]*\n(^ *<<[^\n]*(\\n"|<<|;)$\n){2,}'
      Surround such blocks with the pair
          /* clang-format off */
          /* clang-format on */
      in order to protect them from update by clang-format.  Use the C-style
      `/*...*/` comments instead of C++-style `//...` comments in order to
      prevent them from ever being swallowed by re-formatting of surrounding
    • geoffviola's avatar
      GHS: Shorten long object paths with duplicate source names · 5e428713
      geoffviola authored and Brad King's avatar Brad King committed
      Detect when the resulting object path is too long and compute an
      alternative name using a hash.
  24. 29 Apr, 2016 1 commit
    • Brad King's avatar
      Format include directive blocks and ordering with clang-format · e1c77472
      Brad King authored
      Sort include directives within each block (separated by a blank line) in
      lexicographic order (except to prioritize `sys/types.h` first).  First
      run `clang-format` with the config file:
          SortIncludes: false
      Commit the result temporarily.  Then run `clang-format` again with:
          SortIncludes: true
            - Regex:    'sys/types.h'
              Priority: -1
      Commit the result temporarily.  Start a new branch and cherry-pick the
      second commit.  Manually resolve conflicts to preserve indentation of
      re-ordered includes.  This cleans up the include ordering without
      changing any other style.
      Use the following command to run `clang-format`:
          $ git ls-files -z -- \
              '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' |
            egrep -z -v '(Lexer|Parser|ParserHelper)\.' |
            egrep -z -v '^Source/cm_sha2' |
            egrep -z -v '^Source/(kwsys|CursesDialog/form)/' |
            egrep -z -v '^Utilities/(KW|cm).*/' |
            egrep -z -v '^Tests/Module/GenerateExportHeader' |
            egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' |
            xargs -0 clang-format -i
      This selects source files that do not come from a third-party.
      Inspired-by: Daniel Pfeifer's avatarDaniel Pfeifer <daniel@pfeifer-mail.de>
  25. 15 Apr, 2016 2 commits
    • Brad King's avatar
      cmLocalGenerator: Simplify IssueMessage implementation · da07c506
      Brad King authored
      This method was added by commit v3.4.0-rc1~424^2~6 (cmLocalGenerator:
      Add IssueMessage method, 2015-06-13) in order to reduce callers'
      dependency on cmMakefile.  Currently the implementation of
      cmLocalGenerator::IssueMessage is just a copy of the post-configure code
      path in cmMakefile::IssueMessage.  De-duplicate the implementation by
      simply calling the cmMakefile copy for now.  This will simplify upcoming
      refactoring of backtraces.  The dependency on cmMakefile can be removed
      by future work once that is done.
    • Brad King's avatar
      cmLocalGenerator: Use own IssueMessage method · cc7aed77
      Brad King authored
  26. 01 Apr, 2016 2 commits
    • Brad King's avatar
      Rename local target lookup methods to clarify purpose · 0e44f489
      Brad King authored
      Rename methods:
      * `cmMakefile::Find{ => LocalNonAlias}Target`
      * `cmLocalGenerator::Find{ => LocalNonAlias}GeneratorTarget`
      These names clarify that they are for directory-local target names
      and do not consider alias targets.
    • Brad King's avatar
      Fix lookup of an ALIAS target outside aliased target's directory (#16044) · bc30f8b5
      Brad King authored
      Refactoring in commit v3.5.0-rc1~272^2~11 (cmTarget: Implement ALIAS in
      terms of name mapping, 2015-10-25) accidentally introduced logic that
      assumes ALIAS targets always reference targets in their own directory.
      Fix this and add a test case.
      The configure-step fix is that `cmMakefile::FindTarget` should not consider
      aliases.  The purpose of this method is just to look up targets local to
      a directory.  Since ALIAS and normal targets share a namespace we know a
      locally defined target will never collide with an ALIAS target anyway.
      The method has 3 call sites, and this change is safe for all of them:
      * `cmInstallCommand::HandleTargetsMode`: Rejects aliases before the call.
      * `cmFLTKWrapUICommand::FinalPass`: Should never have considered aliases.
      * `cmMakefile::FindTargetToUse`: Falls back to a global lookup anyway.
      The generate-step fix is that `cmLocalGenerator::FindGeneratorTarget`
      should not consider aliases.  This method is the generate-step
      equivalent to the above.  The method has 2 call sites, and this change
      is safe for both of them:
      * `cmInstallTargetGenerator::Compute`: Never uses an alias target name.
      * `cmLocalGenerator::FindGeneratorTargetToUse`: Falls back to global lookup.
      Reported-by: default avatarMatteo Settenvini <matteo@member.fsf.org>
  27. 09 Mar, 2016 1 commit
    • Brad King's avatar
      Drop Visual Studio 6 generator · b42866a3
      Brad King authored
      This generator has been deprecated since CMake 3.3.  Remove it.
      Update documentation, modules, and tests to drop content specific
      to this generator.
  28. 08 Feb, 2016 1 commit
  29. 04 Feb, 2016 1 commit
    • Nick Lewis's avatar
      install: Add EXCLUDE_FROM_ALL option (#14921) · 18ce97c4
      Nick Lewis authored and Brad King's avatar Brad King committed
      Let us take an example of a project that has some tests in a component
      that need to be installed into a dedicated test package.  The user
      expectation is that the result could be achieved by typing the
          make tests
          make install
          DESTDIR=/testpkgs make install-tests
      However this results in test components in the default installation as
      well as the testpkg.
      Add an EXCLUDE_FROM_ALL option to the install() command to tell it that
      the installation rule should not be included unless its component is
      explicitly specified for installation.
  30. 18 Dec, 2015 1 commit