Commit Graph

53 Commits

Author SHA1 Message Date
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 180538c706 Source: Stabilize include order
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.
2016-04-29 13:58:31 -04:00
Brad King 32d569af9a cmake-gui: Teach --install make destination directory (#16064)
Ensure the destination directory exists before creating symlinks in it.
2016-04-15 13:23:41 -04:00
Brad King bd5bf762c8 Merge topic 'cmake-gui-osx-install-command-line'
d2cf92ec cmake-gui: Change --install to use /usr/local/bin by default (#15627)
2015-06-25 10:39:19 -04:00
Brad King d2cf92ec26 cmake-gui: Change --install to use /usr/local/bin by default (#15627)
In commit v3.3.0-rc1~49^2~2 (cmake-gui: Add --install option to add
command-line tools on OS X, 2015-05-19) the option default was set to
/usr/bin because that is where the old command line install dialog
placed the symlinks.  A better default is /usr/local/bin because it is
meant for locally installed software rather than Apple-installed tools.
Also, as of OS X El Capitan, special privileges are required even for
root to modify /usr/bin but not /usr/local/bin.
2015-06-24 08:57:50 -04:00
Brad King 2c54622ff5 Merge topic 'cmake-gui-osx-install-command-line'
e462ef74 Help: Add notes for topic 'cmake-gui-osx-install-command-line'
8ea2db26 cmake-gui: Replace command-line install dialog with information box
438ce4a0 cmake-gui: Add --install option to add command-line tools on OS X
41477d5c cmake-gui: Drop undocumented and unused --mac-install option
2015-05-21 09:03:50 -04:00
Brad King 8ea2db2639 cmake-gui: Replace command-line install dialog with information box
The QMacInstallDialog infrastructure no longer works on modern OS X
versions.  Drop it and replace the dialog with a simple info box that
explains to the user how to run 'cmake-gui --install' to add symlinks.
Also suggest simply modifying the PATH.

This approach is similar to the Xcode 'xcode-select --install' method
of installing Xcode Command Line Tools.
2015-05-21 08:59:32 -04:00
Brad King 438ce4a0fb cmake-gui: Add --install option to add command-line tools on OS X
On OS X add an "--install[=/path/to/bin]" option (defaulting to
/usr/bin) that installs symbolic links into the given directory.
This will help OS X users make the tools available on the command
line even when they sit inside a CMake.app bundle.
2015-05-21 08:59:31 -04:00
Brad King 41477d5c07 cmake-gui: Drop undocumented and unused --mac-install option
This option was once used by our OS X package installer to create
symlinks at install time.  Since switching to the DragNDrop installer
we no longer use this option.
2015-05-19 09:39:16 -04:00
Stephen Kelly 57bdc1a2f7 cmState: Compute and store directory components.
There is no need to duplicate these in all cmLocalGenerators.

Rename the symbols according to current conventions.

Add explicit calls to Set{Source,Binary}Directory with empty strings
in order to trigger the population of the components containers with
the current working directory in cmLocalGenerator.  Having
directories set to empty is a special case in CMake, which is relied
on for the `if(CMAKE_BINARY_DIR)` condition at the end of
CMakeDetermineSystem.cmake.
2015-05-16 08:11:33 +02:00
Stephen Kelly 421eadb45b Remove use of cmsys_stl.
It is not needed.
2015-02-05 20:44:25 +01:00
Brad King 5a21cbc96b Merge topic 'unicode-vs-projects'
ee8cef87 Encoding: If configured, write Visual Studio project files as UTF-8.
91fd99b8 Encoding: Provide option to configure CMake to use UTF-8 encoding.
2014-03-17 09:49:54 -04:00
Clinton Stimpson 91fd99b865 Encoding: Provide option to configure CMake to use UTF-8 encoding. 2014-03-14 08:48:18 -06:00
Clinton Stimpson c34216cf8a cmake-gui: Fix compile with Qt5 using UTF-8 internal encoding.
Because we already call [to|from]Local8Bit() with C strings where we are supposed to,
we do not need to specify UTF-8 encoding when converting C strings to QString.
2014-03-12 20:48:46 -06:00
Clinton Stimpson 649789a736 Unicode: cmake-gui encoding now matches KWSys encoding.
A UTF-8 QTextCodec is used with QString when KWSys is
configured to treat strings as UTF-8.
This means QString::toLocal8Bit() will convert to UTF-8.
2014-03-10 21:08:43 -06:00
Clinton Stimpson a1e542f195 Use Encoding::CommandLineArguments for main() functions. 2014-01-04 10:43:12 -07:00
Brad King d1526f825e Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources.
Teach it to compute the locations of cmake, ctest, cpack, ccmake, and
cmake-gui executables, and the location of CMAKE_ROOT.  Provide this
information from static cmSystemTools::Get<resource>() methods.
Refactor code that needs these locations to use the new APIs.

Teach FindCMakeResources to use the OS X system API to lookup the
executable location.  When running from the CMake build tree itself,
leave a file in the tree that FindCMakeResources can use to read the
location of the source tree.  This avoids the need to compile the source
tree location into a binary that may be installed and used without the
source tree.

Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build
tree next to "cmake" and the other tools, as is already done in the
install tree for the application bundle.  This ensures a consistent set
of executables are available in one directory.
2013-11-12 08:23:35 -05:00
Brad King 9b212ad01a Make --help-* options available from all command-line tools
Make the standard --help-* options available from all command-line
tools.  Drop options that are no longer supported:

  --copyright, --help-full, --help-html, --help-man,
  --help-compatcommands, --help-custom-modules

De-duplicate Help/manual/*.1.rst help options by using an
OPTIONS_HELP.txt file included from each manual.
2013-10-16 16:24:51 -04:00
Brad King 0c39a757da Drop the 'Full' field from cmDocumentationEntry
We need only 'Brief' for usage documentation.  We no longer have builtin
'Full' documentation, which is now in Help/*/*.rst files.
2013-10-16 09:22:37 -04:00
Brad King 87cc62cab9 Drop "full" documentation output types
We will no longer support full documentation generation from executables
and will instead generate documentation with other tools.  Disable (with
a warning left behind) the command-line options:

 --copyright
 --help-compatcommands
 --help-full
 --help-html
 --help-man

Drop supporting code.  Drop manual sections generation from executables.
Remove internal documentation construction APIs.  Drop unused sections
See Also, Author, Copyright, Compat Commands, Custom Modules.
2013-10-15 14:12:49 -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
Clinton Stimpson ecfc53da7e cmake-gui: Fix code to respect current locale.
This means non-ascii characters now work correctly on systems that
have a non-ascii 8 bit encoding as the current locale.
2012-07-06 13:26:39 -06:00
Eric NOULARD c6a0169442 CPack begin the implementation of --help-command* and --help-variables*
This modifications set tries to keep the unified doc for cmake/ctest/cpack
while introducing tool specific documentation separated.
Some documentation sections for CMake do not fit well to CPack.
2012-01-22 11:42:49 +01:00
Clinton Stimpson 0476715b87 Fix regression to allow specifying a CMakeCache.txt file on the command line. 2010-11-01 09:40:25 -06:00
Clinton Stimpson 45d7200a73 Fix for fix to bug #9975 2010-05-19 15:40:48 -06:00
Clinton Stimpson 1df3f58317 BUG: Fix Bug #9975 when softlinks are used. 2010-05-05 06:49:24 -06:00
Clinton Stimpson 691d8784a7 BUG: Fix bug #9894. Make higher resolution CMake icon available as an application icon. On Mac, the higher resolution one is used in the dock. 2009-12-11 00:35:33 -05:00
Clinton Stimpson 0b8837814a ENH: Move SetErrorMode around calls to generate and configure instead of setting it for the whole application. 2009-10-26 13:18:15 -04: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
Clinton Stimpson ecfca5d0a8 fix issue 9346. add binary directory to window title to make it easier to deal with multiple cmake-gui instances 2009-09-22 18:29:35 -04:00
Clinton Stimpson 8289d0ed6e BUG: Don't let Qt suppress error dialogs. Add call to SetErrorMode(0);
See #9258.
2009-07-14 19:34:50 -04:00
Brad King 98c51ff6dc ENH: Overhaul CMake version numbering
This moves the version numbers into an isolated configured header so
that not all of CMake needs to rebuild when the version changes.

Previously we had spaces, dashes and/or the word 'patch' randomly chosen
before the patch number.  Now we always report version numbers in the
traditional format "<major>.<minor>.<patch>[-rc<rc>]".

We still use odd minor numbers for development versions.  Now we also
use the CCYYMMDD date as the patch number of development versions, thus
allowing tests for exact CMake versions.
2009-03-05 15:17:07 -05:00
Bill Hoffman 71577b1d00 BUG: make sure the gui still runs... 2009-02-21 14:38:35 -05:00
Bill Hoffman 9cd850c4c7 BUG: make sure an x server is not required for the build 2009-02-21 14:23:32 -05:00
Bill Hoffman 45ce11a075 ENH: install the mac application bundle into /Applications directly with no enclosing folder 2008-04-04 16:02:50 -04:00
Clinton Stimpson 2edb9c4e32 ENH: Prevent loading standard qt plugins at runtime (which we dont' care about).
This can cause problems if a Mac bundle doesn't contain the plugins.
2008-03-14 15:18:04 -04:00
Bill Hoffman 4a9517a688 ENH: add mac install symlink option to dialog 2008-02-19 14:06:10 -05:00
Clinton Stimpson df3169273a ENH: Add shortcut to start search/filter.
A bit of cleanup.
      Disable tab navigation in cache variable list.
      Enable home/end keys.

BUG:  Ensure currently edited values are saved before doing configure.
2008-02-14 18:18:10 -05:00
Bill Hoffman 3fa087c8ab ENH: fix make edit_cache for cmake-gui 2008-02-12 09:49:42 -05:00
Clinton Stimpson 45cf2ade08 COMP: Fix build with Qt 4.2.
BUG:  Fix new editors stealing focus while typing search text.
ENH:  Look for translation in data dir, not bin dir.
2008-02-08 10:42:14 -05:00
Clinton Stimpson 2f327a13a3 ENH: Update some strings to match program name. 2008-02-06 15:10:32 -05:00
Clinton Stimpson 0cb622a28b BUG: On Mac OS X, give the CMake library the correct path to the cmake
exectuables.  Fixes #6286.
2008-02-06 14:45:32 -05:00
Clinton Stimpson f1b334ca7a ENH: Show version number in window title. 2008-02-01 11:48:00 -05:00
Clinton Stimpson 41ad9d20df ENH: Use translation file if it exists for the locale.
Consolidate some strings.

      More responsive interrupting.  Prompt user if they try to close during
      configure, and allow them to close.
2008-02-01 10:41:29 -05:00
Brad King 9f61e2a235 ENH: Centralized and globalized computation of CMake program locations. This eliminates startup paths that failed to produce this information. 2007-12-13 17:56:50 -05:00
Clinton Stimpson 86126dc41f ENH: Add handling of --help and related arguments. 2007-11-27 01:04:02 -05:00
Clinton Stimpson 47c53e867f ENH: support specifying build or source directory at command line. 2007-11-13 00:33:22 -05:00
Clinton Stimpson 1e91100599 ENH: Disable menu/buttons when doing configure.
Also disable generate until configure is done.
      Save more settings (last 10 binary directories, exit after generate,
                          last generator)
      Some UI tweaks for better layout.
      Support drag & drop of CMakeLists.txt/CMakeCache.txt files.
2007-11-06 19:25:43 -05:00
Clinton Stimpson cfa723d457 ENH: Prompt user for generator when there is none.
Many minor improvements, bug fixes, and style fixes.
2007-11-05 13:20:54 -05:00
Bill Hoffman c27953b62f ENH: remove qt warnings from qt with MS compiler 2007-11-03 12:50:02 -04:00