Commit Graph

61 Commits

Author SHA1 Message Date
Daniel Pfeifer 7a649111cd Use string(APPEND) in Tests
Automate with:

find Tests -type f -print0 | xargs -0 perl -i -0pe \
's/set\(([a-zA-Z0-9_]+)(\s+)"\$\{\1\}([^"])/string(APPEND \1\2"\3/g'
2016-07-28 00:43:04 +02:00
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
Adrien Destugues 7ebc1cb2ff Haiku: Several fixes to platform module
* Do not define BEOS anymore (this includes workarounds which we don't
  need most of the time in Haiku, so we prefer opt-in IF(HAIKU) in the
  cmake files instead).
* On the other hand, do define UNIX (we are trying to be compliant) and
  HAIKU (there is still a number of things we don't do like the
  average UNIX clone)
* Do not use UnixPaths, as our filesystem hierarchy isn't anything like
  what it expects.
* Do not use -nostart, which the compiler doesn't know about anymore.
  This used to be an Haiku extension to gcc, and is equivalent to
  -shared which is the default gcc option.
* While "dl" functions are provided in libroot, this is always
  implicitly linked so there is no need to tell cmake about it.
* Forcing position-independent code is not needed, so remove it.
* On the other hand, include appropriate linker options for executables
  and shared libraries.
* Support for the two available compilers in Haiku (gcc2 and gcc4) and
  pick the right headers and libraries according to the currently
  selected one.
* With the adoption of the package manager, the directory layout was
  changed. Tell cmake where to look for header files and libraries.
* As we don't define BEOS anymore, enable the workaround we still need
  for HAIKU as well. This is the lack of a libm (it is part of the
  implicitly linked in libroot)

Applied-by: Rolf Eike Beer <eike@sf-mail.de>
2013-10-08 09:54:46 -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
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
Brad King 137e5974bc complex: Remove dynamic loader tests
Everything covered by these tests is now covered by the KWSys
DynamicLoader test and the Plugin test.
2011-12-23 16:16:49 -05:00
Bill Hoffman 5c4208f50e ENH: only 5 failing tests for VS 10 2009-07-10 09:12:39 -04:00
Brad King 430cc2b4b7 ENH: Always imply CLEAN_DIRECT_OUTPUT target prop
This property was left from before CMake always linked using full path
library names for targets it builds.  In order to safely link with
"-lfoo" we needed to avoid having both shared and static libraries in
the build tree for targets that switch on BUILD_SHARED_LIBS.  This meant
cleaning both shared and static names before creating the library, which
led to the creation of CLEAN_DIRECT_OUTPUT to disable the behavior.

Now that we always link with a full path we do not need to clean old
library names left from an alternate setting of BUILD_SHARED_LIBS.  This
change removes the CLEAN_DIRECT_OUTPUT property and instead uses its
behavior always.  It removes some complexity from cmTarget internally.
2009-05-01 10:38:35 -04:00
Brad King fff812db95 ENH: Add if(TARGET) command
It is useful to be able to test if a target has been created.  Often
targets are created only inside conditions.  Rather than storing the
result of the condition manually for testing by other parts of the
project, it is much easier for the other parts to just test for the
target's existence.  This will also be useful when find-modules start
reporting results with IMPORTED targets and projects want to test if a
certain target is available.
2008-08-20 11:45:16 -04:00
Brad King b459ec9f57 ENH: Updated DEFINE_PROPERTY command to be more extendible and more consistent with new SET_PROPERTY and GET_PROPERTY signatures. 2008-02-14 13:36:23 -05:00
Brad King cf7eeab37a ENH: Testing new target properties RUNTIME_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and ARCHIVE_OUTPUT_DIRECTORY. This is an incremental fix for bug#2240 and bug#4210. 2007-03-12 10:23:06 -04:00
Ken Martin 27379d7b08 ENH: make properties a bit more formal with documentation and chaining 2006-12-07 09:45:32 -05:00
Bill Hoffman 3a32cec969 ENH: merge in changes for beos support 2006-12-04 17:26:41 -05:00
Brad King 97e07dc162 BUG: Test -isystem without affecting other tests. Made separate Library/SystemDir for this purpose. 2006-10-05 12:04:30 -04:00
Brad King c11cf31c9b ENH: Adding SYSTEM option to INCLUDE_DIRECTORIES command. This addresses bug #3462. 2006-10-05 08:55:59 -04:00
Brad King fcd500289b ENH: Renamed NOT_IN_ALL to EXCLUDE_FROM_ALL. 2006-10-02 12:01:20 -04:00
Brad King 1d9f287af7 ENH: Added NOT_IN_ALL option for ADD_LIBRARY and ADD_EXECUTABLE to avoid building the targets by default. 2006-10-02 11:14:00 -04:00
Brad King 16f8da8b14 ENH: Re-enabling .i rule test on MSYS now that it works. 2006-09-28 10:41:19 -04:00
Brad King f785ae9ac3 ENH: Re-enable preprocessing target test but specifically disable it on broken platforms. 2006-09-27 14:27:07 -04:00
Brad King 1ce1c5762b BUG: Disable new test_preprocess target until it is fixed on OSX universal binaries and mingw. 2006-09-24 10:28:47 -04:00
Brad King 13380569f3 ENH: Adding test for running preprocessor rules. 2006-09-23 16:55:16 -04:00
Brad King 07ec25e383 ENH: Added test for linking to a static library that is next to a shared library. See bug#1644 for related changes. 2006-09-15 14:31:24 -04:00
Ken Martin d94deaea1a ENH: removed old commands 2005-06-02 14:56:50 -04:00
Ken Martin f5a81617ec ENH: removed use of ABSTRACT command 2005-06-02 14:10:37 -04:00
Brad King b40219372e ENH: Added full pre-build/pre-link/post-build testing for both library and executable targets. 2005-02-25 09:31:55 -05:00
Andy Cedilnik 2eb42a533e ENH: Remove warnings 2004-04-30 18:21:55 -04:00
Andy Cedilnik 23a154941b ENH: Add test for REMOVE_DEFINITION 2004-04-15 13:59:29 -04:00
Bill Hoffman 62fec9b386 BUG: remove bundle_loader stuff it did not work with spaces in the path and is not needed for this test 2003-08-28 14:58:37 -04:00
Yves Starreveld 2ff4690192 ENH: remove the -flat_namespace and -undefined suppress hacks from
ENH: CMAKE_SHARED_MODULE_CREATE_C_FLAGS
ENH: and fix the complex example to specify a -bundle loader for the
ENH: shared module that it builds.
2003-08-27 20:35:18 -04:00
Bill Hoffman a35d911def ENH: MinGW build now passes all the tests 2003-08-27 16:42:01 -04:00
Bill Hoffman c6d2312619 ENH: add testing for modules and one two config modes for cmaketest 2003-01-15 17:31:22 -05:00
Bill Hoffman b9d5389bca BUG: fix CMAKE_C_FLAGS for visual studio 6, and add a test case 2003-01-13 09:30:48 -05:00
Bill Hoffman 3859417d1a ENH: add target properties 2002-12-20 17:15:45 -05:00
Ken Martin 44a7cd55ff removed all source lists from the system and made them vectors. Also appended _CMAKE_PATH to the end of the automatic cache entries for executables and libraries. Odds of all these changes working are slim but cmake builds and passes all its tests. VTK40 starts building 2002-06-27 15:57:09 -04:00
Ken Martin db4b4533a0 changed CCOMMAND to CMAKE 2002-06-03 13:40:34 -04:00
Bill Hoffman e9e69b7e5e fix borland test 2002-05-03 18:10:49 -04:00
Bill Hoffman 2242006ca1 Debug optimized cache fixes 2002-05-02 15:10:19 -04:00
Sebastien Barre 4988ad93c0 ENH: use target as source if source is empty 2002-04-11 10:11:42 -04:00
Sebastien Barre 9d0a4b8a5f ENH: add a test to check if more than one post-build command can be attached. it fails right now. 2002-04-10 17:33:10 -04:00
Bill Hoffman 8e7e53960e ENH: only check flag on unix 2002-04-10 11:23:30 -04:00
Bill Hoffman 2e70c5094f ENH: check for compile flags and add back c flag to unix generator 2002-04-09 12:24:44 -04:00
Bill Hoffman d6da8ce630 ENH: check for compile flags and add back c flag to unix generator 2002-04-09 12:02:48 -04:00
Bill Hoffman 26ff184cf2 correct exports for windows 2002-04-09 10:19:02 -04:00
Bill Hoffman cd0e978ca1 c not c++ comment 2002-04-09 09:37:37 -04:00
Bill Hoffman 65e3edea04 ENH: use separate vars for creating c++ and c shared libraries and add a test for c libraries 2002-04-08 13:36:18 -04:00
Sebastien Barre b3647fe6d3 ENH: fix tests 2002-03-29 15:02:18 -05:00
Bill Hoffman 3a2b963763 *** empty log message *** 2002-03-29 14:22:42 -05:00
Bill Hoffman 7d76de4403 make sure ; expansion is done in all commands 2002-03-29 14:20:32 -05:00
Bill Hoffman 61697fab50 more tests 2002-03-29 10:07:10 -05:00