1. 08 Nov, 2016 1 commit
  2. 30 Oct, 2016 1 commit
  3. 26 Oct, 2016 1 commit
  4. 19 Oct, 2016 3 commits
  5. 27 Sep, 2016 1 commit
    • Brad King's avatar
      Simplify CMake per-source license notices · 86578ecc
      Brad King authored
      Per-source copyright/license notice headers that spell out copyright holder
      names and years are hard to maintain and often out-of-date or plain wrong.
      Precise contributor information is already maintained automatically by the
      version control tool.  Ultimately it is the receiver of a file who is
      responsible for determining its licensing status, and per-source notices are
      merely a convenience.  Therefore it is simpler and more accurate for
      each source to have a generic notice of the license name and references to
      more detailed information on copyright holders and full license terms.
      
      Our `Copyright.txt` file now contains a list of Contributors whose names
      appeared source-level copyright notices.  It also references version control
      history for more precise information.  Therefore we no longer need to spell
      out the list of Contributors in each source file notice.
      
      Replace CMake per-source copyright/license notice headers with a short
      description of the license and links to `Copyright.txt` and online information
      available from "https://cmake.org/licensing".  The online URL also handles
      cases of modules being copied out of our source into other projects, so we
      can drop our notices about replacing links with full license text.
      
      Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
      of the replacements mechanically.  Manually fix up shebang lines and trailing
      newlines in a few files.  Manually update the notices in a few files that the
      script does not handle.
      86578ecc
  6. 16 Sep, 2016 1 commit
  7. 29 Jun, 2016 1 commit
    • Brad King's avatar
      try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG> · d582c23a
      Brad King authored
      In the `try_compile` source file signature we propagate the caller's
      value of `CMAKE_<LANG>_FLAGS` into the test project.  Extend this to
      propagate `CMAKE_<LANG>_FLAGS_<CONFIG>` too instead of always using the
      default value in the test project.  This will be useful, for example, to
      allow the MSVC runtime library to be changed (e.g. `-MDd` => `-MTd`).
      However, some projects may currently depend on this not being done,
      so we need to activate the behavior using a policy.
      
      This change was originally made by commit v3.6.0-rc1~160^2 (try_compile:
      Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11) but without the
      policy and so had to be reverted during the 3.6 release candidate cycle.
      
      Fixes #16174.
      d582c23a
  8. 28 Jun, 2016 2 commits
    • Brad King's avatar
      Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes" · 943fe6e3
      Brad King authored
      Revert commit v3.6.0-rc1~160^2 (try_compile: Honor
      CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11).  The behavior it
      introduced can break projects that depend on the lack of such behavior.
      We will have to introduce a policy or other mechanism to enable the
      behavior in a compatible way.  Simply revert it for now.
      
      See issue #16174.
      943fe6e3
    • Daniel Pfeifer's avatar
      use CM_NULLPTR · 1d6909a2
      Daniel Pfeifer authored
      1d6909a2
  9. 25 May, 2016 2 commits
    • Brad King's avatar
      try_compile: Optionally forward custom platform variables to test project · d256ba07
      Brad King authored
      Add a `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` variable to specify a list
      of custom variables to be forwarded to a `try_compile` test project.
      This will be useful for platform information modules or toolchain files
      to forward some platform-specific set of variables from the host project
      (perhaps set in its cache) to the test project so that it can build the
      same way.
      d256ba07
    • Brad King's avatar
      cmCoreTryCompile: Refactor forwarding of variables to test project · fb4791b3
      Brad King authored
      De-duplicate the logic that constructs the cmake `-D` flag used to pass
      variables into the test project cache.  Also subsume variables that were
      propagated by generating `set()` commands in the project and pass them
      as cache entries instead.
      fb4791b3
  10. 16 May, 2016 1 commit
    • Kitware Robot's avatar
      Revise C++ coding style using clang-format · d9fd2f54
      Kitware Robot authored
      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.
      d9fd2f54
  11. 06 May, 2016 1 commit
    • 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 <<
            "...\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){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
      comments.
      64b55203
  12. 29 Apr, 2016 2 commits
    • 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
          IncludeCategories:
            - 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>
      e1c77472
    • Brad King's avatar
      Source: Stabilize include order · 180538c7
      Brad King authored
      Each source file has a logical first include file.  Include it in an
      isolated block so that tools that sort includes do not move them.
      180538c7
  13. 11 Apr, 2016 2 commits
  14. 19 Feb, 2016 1 commit
    • Brad King's avatar
      try_compile: Add option to control type of target · 7f1bd9fe
      Brad King authored
      Create a `CMAKE_TRY_COMPILE_TARGET_TYPE` option to specify use
      of `add_library(... STATIC ...)` for the generated test project.
      This will be useful for cross-compiling toolchains that cannot
      link a binary without custom flags or scripts.
      7f1bd9fe
  15. 18 Oct, 2015 1 commit
  16. 14 Oct, 2015 2 commits
  17. 24 Sep, 2015 1 commit
    • Brad King's avatar
      cmCoreTryCompile: Fix internal argument vector construction · 710bde43
      Brad King authored
      In TryCompileCode we construct an internal argv[] vector that needs to
      have a fake argv[0] so our internal cmake command line looks like a real
      command line.  Fix construction of the fake argv[0] when try_compile is
      called without the CMAKE_FLAGS argument.  Otherwise the first internal
      -DVAR=val argument that we use to pass information like
      CMAKE_OSX_SYSROOT is ignored.
      710bde43
  18. 21 Sep, 2015 1 commit
  19. 14 Aug, 2015 1 commit
  20. 27 Jul, 2015 1 commit
  21. 06 Jun, 2015 1 commit
  22. 14 May, 2015 1 commit
  23. 04 May, 2015 1 commit
  24. 13 Apr, 2015 1 commit
  25. 10 Mar, 2015 1 commit
  26. 20 Feb, 2015 2 commits
  27. 17 Feb, 2015 1 commit
  28. 10 Feb, 2015 1 commit
    • Brad King's avatar
      try_compile: Use shorter test executable name with consistent length · f3e9eeed
      Brad King authored
      Since commit v2.8.8~176^2 (try_compile: Use random executable file name,
      2012-02-13) the length of the test executable name in generated
      try_compile projects has been longer and unpredictable.  With Visual
      Studio on windows, the tools try to create paths like:
      
       CMakeFiles/CMakeTmp/$tgt.dir/Debug/$tgt.tlog/$tgt.lastbuildstate
      
      With the target name repeated up to 3 times, we must make it short and
      of consistent length to avoid overrunning the 260 character limit
      imposed by VS tools.
      f3e9eeed
  29. 09 Feb, 2015 1 commit
  30. 26 Jan, 2015 1 commit
    • Matt McCormick's avatar
      try_run: Add support for LINK_LIBRARIES option. · e2b1f058
      Matt McCormick authored
      Most functionality is already implemented in Source/cmCoreTryCompile.{h,cxx}.
      Document and improve argument parsing.
      
      This functionality is already being used by a number of modules, like
      CheckCSourceCompiles.cmake, but it is not documented.
      e2b1f058
  31. 18 Jan, 2015 2 commits