Commit Graph

62 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
24b2a36778 Merge topic 'test-watcom-workaround'
47c29885 Tests: Fix RunCMake.BuildDepends filesystem delay for Watcom WMake
26790ad9 Tests: Add workaround to Wrapping test for Watcom failure
2016-05-02 09:24:23 -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
Brad King
26790ad93b Tests: Add workaround to Wrapping test for Watcom failure
The Watcom tools do not seem to like our wrapFLTK executable
to mix C and C++ sources.  Work around this by using C++ for
both sources.
2016-04-28 10:20:40 -04:00
Brad King
f98ae28e3d Tests: Cover fltk_wrap_ui on an executable that links libraries
CMake 3.4 may crash on this case.  The problem seems to have been
fixed since then, but keep it working by adding a test case now.

Reported-by: Gonzalo Garramuño <ggarra13@gmail.com>
2016-01-21 13:42:46 -05:00
Stephen Kelly
a247911a88 Tests: Don't read the LOCATION property from build targets. 2013-11-19 18:07:27 +01:00
Daniele E. Domenichelli
15610bb5b1 Drop use of configure_file IMMEDIATE option
Since commit 7d47c693 (Drop compatibility with CMake < 2.4, 2013-10-08)
we no longer need to use the configure_file IMMEDIATE option to support
compatibility modes less than 2.0.
2013-11-13 10:12:17 -05:00
Stephen Kelly
325214900b Fix casing of 'Qt' in docs, comments and user-visible strings.
QT (cue-tea) is Apple QuickTime.
Qt (cute) is the C++ framework.
2012-08-28 11:24:55 +02: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
Kitware Robot
77543bde41 Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands.  Later command
names became case-insensitive.  Now the preferred style is lower-case.

Run the following shell code:

cmake --help-command-list |
grep -v "cmake version" |
while read c; do
    echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g'
done >convert.sed &&
git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' |
egrep -z -v '^(Utilities/cm|Source/kwsys/)' |
xargs -0 sed -i -f convert.sed &&
rm convert.sed
2012-08-13 14:19:16 -04:00
Kitware Robot
7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
Ken Martin
ce8810c4e7 ENH: preclean some warnings 2008-03-25 11:27:18 -04:00
Brad King
17c8e898ab BUG: Fixed fake generation of files to behave more like fluid. 2007-11-10 17:31:50 -05:00
Bill Hoffman
dcf21dd90b ENH: remove findqt3 from cmake's cmakelist files 2007-11-02 10:46:03 -04:00
Ken Martin
62b368f3d5 ENH: removed old VTK tests 2006-12-12 13:59:09 -05:00
Bill Hoffman
fb8a239f94 ENH: make sure it is qt3 before running test 2006-11-22 14:22:43 -05:00
Bill Hoffman
651fecee5b ENH: make sure findqt3 finds qt3 and not qt4 2006-11-22 13:30:59 -05:00
Brad King
c32b8c196d COMP: More fixes for non-ANSI C compilers. 2006-06-03 09:48:39 -04:00
Brad King
9af54c440d COMP: Fix for non-ANSI C compilers. 2006-06-03 09:42:14 -04:00
Brad King
e1c110d244 BUG: Custom commands should actually generate the files they claim to generate. 2006-06-02 12:19:16 -04:00
Bill Hoffman
a91947039a ENH: for all custom commands that can not be given to a target, add them to all targets in the current makefile 2006-01-09 14:40:31 -05:00
Bill Hoffman
9d0f86d7d0 BUG: force EXECUABLE and LIBRARY output paths so bad cache entries do not fail tests 2006-01-02 15:01:43 -05:00
Brad King
a9c2ff474e COMP: Need target-level dependency from wrapper targets on Wrap executable target. 2005-11-17 16:49:48 -05:00
Bill Hoffman
34170ed52e ENH: more qt changes 2005-09-12 09:32:21 -04:00
Bill Hoffman
afbc9b7b07 ENH: clean up the find qt stuff some 2005-09-09 21:51:23 -04:00
Ken Martin
e1870805b4 ENH: change to work with new FLTK command 2005-06-10 10:09:39 -04:00
Ken Martin
d053034aa4 ENH: no longer test ITK command 2005-06-09 11:23:22 -04:00
Ken Martin
25314c428a ENH: remove bad add target commands 2005-06-08 16:39:56 -04:00
Ken Martin
859b517518 ENH: remove requirements on 1.2 2005-06-08 14:11:25 -04:00
Ken Martin
1dfe02fb86 ENH: removed old command 2005-06-02 15:09:34 -04:00
Brad King
db10dc0f1e BUG: Do not add Qt wrapping test unless QT is found and QT_UIC_EXECUTABLE is found. 2005-03-16 09:55:08 -05:00
Brad King
4931afd89d ENH: Adding cleaning of custom command outputs during "make clean". 2005-02-09 11:40:01 -05:00
Andy Cedilnik
15cdf406d6 BUG: Fix dependency to input file for QT_WRAP_CPP. Bug #421 - QT_WRAP_CPP 2004-01-05 11:13:50 -05:00
Andy Cedilnik
8102451c01 ENH: Better testing 2003-09-24 17:51:13 -04:00
Andy Cedilnik
5d203a92f3 ENH: More verbose test 2003-08-07 14:37:35 -04:00
Andy Cedilnik
8a0e3c103b ENH: Make it work for QT 2.3 non commercial on windows 2003-08-01 19:13:38 -04:00
Andy Cedilnik
3e8f596c81 ENH: Add more debug 2003-08-01 18:52:57 -04:00
Andy Cedilnik
ae2020333a ERR: Only link qt to qt executable 2003-08-01 09:18:43 -04:00
Andy Cedilnik
0f79c4aca9 ERR: Attempt to fix wrapping on Windows 2003-07-31 08:50:21 -04:00
Andy Cedilnik
4b5a63d8a2 ENH: Fix problem on HP. Whay should K&R be default? 2003-07-31 08:33:01 -04:00
Andy Cedilnik
2760bf9fa1 ENH: Really test uic and perform configured uic test 2003-07-30 13:28:32 -04:00
Andy Cedilnik
36e6b85f70 ENH: Add executable for wrapping test, so that make stage actually passes 2003-07-30 13:11:04 -04:00
Bill Hoffman
27a3c00533 for unix add x11 and pthreads for qt 2003-07-25 12:50:30 -04:00
Bill Hoffman
8d8ae14a8e minor fix 2003-06-04 10:46:18 -04:00
Andy Cedilnik
4ecc0d9f15 If display is not set, do not attempt to run application 2003-04-02 09:01:33 -05:00
Ken Martin
ee46e410ce now uses SET instead of SOURCE_LIST command 2002-12-12 08:42:33 -05:00
Franck Bettinger
5e6b29717e added include of FindQT.cmake 2002-09-12 13:20:05 -04:00
Franck Bettinger
6b9d82f41d corrected test for QTWrapUI 2002-09-12 11:37:16 -04:00
Franck Bettinger
4be9fce5fe added test for QTWrapUI 2002-09-11 16:41:46 -04:00
Franck Bettinger
3f047aabaf test for QTWarpUI 2002-09-11 16:41:11 -04:00