Commit Graph

96 Commits

Author SHA1 Message Date
Daniel Pfeifer 1d6909a287 use CM_NULLPTR 2016-06-28 09:02:26 -04: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
Brad King 0ac18d40c8 Remove `//------...` horizontal separator comments
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.
2016-05-09 09:41:43 -04:00
Stephen Kelly 780bff5279 cmake: Store hardcoded lists of sources and headers
Don't duplicate this in each cmMakefile.
2015-10-27 07:44:22 +01:00
Stephen Kelly 74d565e0e9 Remove unused cmLocalGenerator include. 2015-10-05 20:59:56 +02:00
Stephen Kelly 5181fae264 cmPropertyMap: Remove chaining logic.
The chaining logic doesn't belong to the container, and the
CMakeInstance pointer doesn't need to be in cmPropertyMap.

Size goes from 56 to 48 bytes with GNU libstdc++-5.1.
2015-06-07 09:29:31 +02:00
Stephen Kelly 7c0aa672fe cmPropertyMap: Remove scope parameter from API where not used. 2015-06-07 09:29:30 +02:00
Stephen Kelly a0836ed978 Port to cmMakefile::GetGlobalGenerator. 2015-05-03 11:42:00 +02:00
Stephen Kelly 54d6a9187f cmMakefile: Rename GetCurrent{Output,Binary}Directory.
Match names used in CMake code.
2015-04-21 00:12:52 +02:00
Stephen Kelly 55d80d0a85 cmMakefile: Rename GetCurrent{,Source}Directory.
Match the names used in cmake code.
2015-04-21 00:12:52 +02:00
Brad King b4f62b875b Merge topic 'fix-autouic-regression'
9a673737 QtAutoUic: Add a test for the regression in the parent commit.
7c585699 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings
2015-01-12 08:57:52 -05:00
Justin Borodinsky 7c58569930 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings
The "." in the extension was dropped by commit v3.1.0-rc1~556^2~2
(cmSourceFile: Cache the isUiFile check, 2014-02-08) by mistake.  This
caused the options to not be set.
2015-01-11 15:11:18 -05:00
Stephen Kelly 931e055d8c Port all cmOStringStream to std::ostringstream.
All compilers hosting CMake support the std class.
2015-01-11 17:06:03 +01:00
Nils Gladitz cc1139cc30 strings: Remove redundant calls to std::string::c_str()
Replacements were detected and performed by the clang tool
remove-cstr-calls on a linux build.
2014-10-15 14:54:05 +02:00
Ben Boeckel 7b8a990424 perf: Cache the language property string 2014-04-28 21:43:39 -04:00
Ben Boeckel 10baf00f3d cmSourceFile: Cache the isUiFile check
The filename extension call is expensive, so cache the .ui check.
2014-04-28 21:43:39 -04:00
Stephen Kelly bf98cc252f Genex: Evaluate TARGET_OBJECTS as a normal expression. 2014-03-31 23:18:44 +02:00
Stephen Kelly 21c573f682 Remove some c_str() calls.
Use the clang RemoveCStrCalls tool to automatically migrate the
code. This was only run on linux, so does not have any positive or
negative effect on other platforms.
2014-03-11 15:03:50 +01:00
Ben Boeckel ce5114354c stringapi: Use strings for the languages 2014-03-08 13:05:30 -05:00
Ben Boeckel 971eb4d56e stringapi: Use strings for TryFullPath 2014-03-08 13:05:30 -05:00
Ben Boeckel 310ef08fed stringapi: Use strings for source names 2014-03-08 13:05:29 -05:00
Ben Boeckel ec97ed7d0c stringapi: Use strings for property names
Property names are always generated by CMake and should never be NULL.
2014-03-08 13:05:28 -05:00
Stephen Kelly e68a3eadff cmSourceFile: Use a const cmMakefile. 2014-01-22 15:16:40 +01:00
Stephen Kelly 84218e1870 Add automatic uic invocation for Qt.
The source files are already processed by cmQtAutomoc to look for
moc includes, so extend that to also look for ui_ includes and
find corresponding .ui files to process.

This replaces the need to invoke qt4_wrap_ui().

As the ui files are not likely to be part of the SOURCES of the
target, store the options associated with them separately in the
cmMakefile for querying during the autogen run.
2013-10-24 12:30:38 +02:00
Brad King 399e9c46d8 Drop builtin property documentation
Drop all DefineProperty calls for non-chained properties.  Drop the
documentation from the chained ones.  The documentation for all
properties is now in Help/prop_*/*.rst files.
2013-10-16 09:22:36 -04:00
Andreas Mohr ddac8d3d2d Fix spelling and typos (affecting binary data / module messages) 2013-05-07 08:39:19 -04:00
Andreas Mohr 965de974b2 Documentation: Correct typos and grammar 2012-11-07 13:51:50 -05: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 5c0c635a09 Fortran: Add support for free- and fixed-form flags
Define a "Fortran_FORMAT" target and source file property.  Initialize
the target property from a "CMAKE_Fortran_FORMAT" variable.  Interpret
values "FIXED" and "FREE" to indicate the source file format.  Append
corresponding flags to the compiler command line.
2011-08-31 10:24:43 -04:00
Alex Neundorf 9dbba1b464 Fix #12342: Add APPEND_STRING option to set_property()
set_property() has APPEND, which creates a list. E.g. when
appending to COMPILE_FLAGS a string is needed, not a list.
With the APPEND_STRING option the value is append as string,
not as list.

Alex
2011-07-15 20:57:33 +02:00
Brad King 64d997a78c Merge topic 'fix-11295-support-plugin-bundles-on-mac'
cabc407 CFBundle Test: Add PATHS for finding Rez (#11295)
5457b82 Add support for CFBundle targets on the Mac (#11295)
2011-02-22 14:30:58 -05:00
Brad King cc6ba3abff Merge topic 'missing-file-dir-issue-11677'
7af41c3 Test that missing source mentions directory (#11677)
9cefce0 Report directory with missing source file (#11677)
2011-01-19 14:02:44 -05:00
Brad King 668ce6b1e8 Combine duplicate COMPILE_DEFINITIONS disclaimer 2011-01-17 07:55:48 -05:00
Brad King 9cefce09f6 Report directory with missing source file (#11677)
Previously the error message for code like

  add_executable(myexe does_not_exist/mysrc.c)

mentioned only that "mysrc.c" is not found.  Report the directory too.
2011-01-15 08:00:11 -05:00
Richard Bateman 5457b8254c Add support for CFBundle targets on the Mac (#11295)
This commit enables building, for example, plugin bundles
to be loaded by web browsers.
2011-01-11 12:54:44 -05:00
Bill Hoffman afbfb7ac1d Add more documentation for LANGUAGE property.
Make it clear that if you set the language on a file, it will be compiled.
2010-12-20 15:46:11 -05:00
Brad King a6b5ead62f Report missing source files with context of target
Previously we reported only the CMakeLists.txt file in the directory
that adds the target.
2010-09-13 16:17:20 -04:00
Alex Neundorf 71812d0b5e -fix typos in docs, patch from Michael Wild
Alex
2010-04-09 21:40:59 +02:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
This converts the CMake license to a pure 3-clause OSI-approved BSD
License.  We drop the previous license clause requiring modified
versions to be plainly marked.  We also update the CMake copyright to
cover the full development time range.
2009-09-28 11:43:28 -04:00
Brad King f74b876a58 ENH: Clarify COMPILE_DEFINITIONS separator in docs
The COMPILE_DEFINITIONS properties are semicolon-separated lists.
Make this clear in the documentation.  See issue #9199.
2009-06-24 09:36:29 -04:00
Brad King 4085454658 ENH: Support preprocessor def values in VS6
The add_definitions() command and COMPILE_DEFINITIONS dir/tgt/src
properties support preprocessor definitions with values.  Previously
values were not supported in the VS6 generator even though the native
tool supports them.  It is only values with spaces that VS6 does not
support.  This enables support and instead complains only for values
with spaces.  See issue #8779.
2009-03-23 14:48:09 -04:00
Brad King 921f3a1ac2 BUG: Do not automatically set HEADER_FILE_ONLY
Long ago the native build system generators needed HEADER_FILE_ONLY to
be set on header files to stop them from building.  The modern
generators correctly handle headers without the help of this property.
This removes automatic setting of the property so that it can be used
reliably as an indicator of project author intention.  It fixes VS IDE
project files to show header files normally instead of excluded (broken
by the fix for issue #7845).
2009-03-16 14:30:24 -04:00
Brad King 13f9bb646d ENH: Define target and source property LABELS
This creates a new LABELS property for targets and source files.  We
write the labels of each target and its source files in target-specific
locations in the build tree for future use.
2009-02-10 08:50:21 -05:00
Brad King 85961d44c3 ENH: Improve docs of OBJECT_DEPENDS property
Specify exactly what the value of the property should contain and the
resulting behavior.  Note alternatives for a common out-dated usage.
2008-09-22 09:42:27 -04:00
Brad King 73d5fd31ab ENH: Catch missing source files specified by full path earlier.
- Revert previous change to trust user-provided full paths.
  - Instead trust them only far enough to determine the source language
    but still check for existence for non-generated sources.
2008-05-27 13:10:09 -04:00
Brad King 3344ce9197 ENH: In cmSourceFile::GetLanguage use the file extension (if not ambiguous) to determine the language without requiring the source file to exist. 2008-04-29 14:17:42 -04:00
Brad King 19aafdb355 ENH: Add context information when a source file cannot be found. 2008-04-29 14:17:35 -04:00
Brad King b69cfaf412 BUG: Trust user-provided source file full paths. 2008-04-25 15:30:58 -04:00
Ken Martin 16f1cc9b59 ENH: support unset of properties 2008-04-01 14:22:09 -04:00
Brad King 9ed4266306 ENH: Cleanup impl of PUBLIC_HEADER, PRIVATE_HEADER, and RESOURCE properties 2008-02-18 16:38:34 -05:00