Commit Graph

14 Commits

Author SHA1 Message Date
Kitware Robot d9fd2f5402 Revise C++ coding style using clang-format
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.
2016-05-16 16:05:19 -04:00
Brad King e1c7747253 Format include directive blocks and ordering with clang-format
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 <daniel@pfeifer-mail.de>
2016-04-29 13:58:54 -04:00
Clinton Stimpson 50e261ddb6 OSX: Warn when attempting to change runtime paths on OS X 10.5
Even though 10.5 supports @rpath, the support is not complete
enough for CMake.  For instance, install_name_tool doesn't support
adding and removing rpaths.

Also modifying BundleUtilities test to remove an undesirable cmake
generated runtime path.  The intent was to build with the install
rpath as is done with the other cases in this test.
2014-10-10 10:17:27 -04:00
Stephen Kelly a247911a88 Tests: Don't read the LOCATION property from build targets. 2013-11-19 18:07:27 +01:00
Clinton Stimpson 373faae5e1 Refactor how bundles and frameworks are supported.
Make handling of directory separators consistent between
non-bundle and bundle code.

Remove xcode specific flag from cmTarget when getting install_name.

Add (more) consistent convenience functions in cmTarget to get
directories inside of bundles and frameworks to add files to.

This refactor also fixes bug #12263 where frameworks
had the wrong install name when SKIP_BUILD_RPATH.

Also make install_name for frameworks consistent between Makefile
and Xcode generator.
2013-05-23 10:42:49 -04:00
Kitware Robot 9db3116226 Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block
termination commands to have arguments matching the command starting the
block.  This is no longer the preferred style.

Run the following shell code:

for c in else endif endforeach endfunction endmacro endwhile; do
    echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
egrep -z -v 'Tests/CMakeTests/While-Endwhile-' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Clinton Stimpson 98d20316bd Fix BundleUtilities test failure with space in build path. 2012-01-20 22:02:01 -07:00
Clinton Stimpson 36d66416f4 Fix new BundleUtilities test failure on Mac 10.4.x 2012-01-20 06:59:17 -07:00
Clinton Stimpson 0d96decdd0 GetPrerequisites: Add test for @rpath support. 2012-01-19 22:03:06 -07:00
Clinton Stimpson e17135e882 BundleUtilities: Add rpath to loadable modules in test. 2011-06-02 09:08:49 -06:00
Clinton Stimpson 8064044c94 BundleUtilities: Print reason for not loading module.so 2011-06-01 10:59:34 -06:00
Clinton Stimpson fa4dc08a1a BundleUtilities: Fix issues with custom target DEPENDS in test (#12034) 2011-05-31 15:33:39 -04:00
Clinton Stimpson e40b79e79f BundleUtilities: Fix test when using xcode (#12034) 2011-05-31 13:12:58 -04:00
Clinton Stimpson 7ac7b437b8 BundleUtilities: Work w/ non .app exes on Mac (#12034)
Also add a test of BundleUtilities including an exe,
some shared libs, a plugin, and a framework-style lib.

This test presently runs (and this functionality works)
on Linux, Mac and Windows.

For now, the framework-style lib is built as a plain old
shared lib because there is another yet-unresolved issue
with local frameworks without rpaths on the Mac.
2011-05-27 16:11:43 -04:00