Commit Graph

78 Commits

Author SHA1 Message Date
Bartosz Kosiorek
cb33befe2d Modules: Update documentation formatting 2019-04-08 14:55:56 +02:00
Kitware Robot
df4ed1e9ff Help: Convert remaining modules to block-style comments 2018-10-22 11:09:34 -04:00
Arnaud Gelas
de348a9638 GenerateExportHeader: Add support for C projects
Previously only C++ projects were supported.

Fixes: #16967
2018-03-08 10:05:14 -05:00
Kyle Edwards
f4082b0e9b GenerateExportHeader: add INCLUDE_GUARD_NAME option
Fixes #16968.
2018-01-23 10:42:47 -05:00
Ben Boeckel
9eb05b48cd GenerateExportHeader: always fill in _EXPORT macros
The `_EXPORT` and `_NO_EXPORT` macros should always be made properly
because the `<LANG>_VISIBILITY_PRESET` properties are controlled
independently of this module.

One case where this breaks compatibility is where a project was setting
`USE_COMPILER_HIDDEN_VISIBILITY=OFF` and then marking a symbol used
outside of the library with `_NO_EXPORT` which is a contridiction.
2017-03-16 15:11:03 -04:00
Daniel Pfeifer
d6877e6c40 Don't include CMakeParseArguments
The cmake_parse_arguments command is builtin with version 3.5.
The CMakeParseArguments module is empty and exists for backwards
compatibility with CMake 3.4 and lower.

Remove the includes of CMakeParseArguments from CMake's modules.
The modules are always used with the current version of CMake.

Leave the includes in the tests, as the tests may be run with an older
version of CMake.
2017-01-11 13:14:57 +01:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Brad King
152bbe5068 Modules: Fix typos in name of CMAKE_COMPILER_IS_GNUCC variable
It is not called `CMAKE_COMPILER_IS_GNUC` (without last `C`).

Closes: #16297
2016-09-14 10:12:30 -04:00
Brad King
0cbaaf2dc3 GenerateExportHeader: Fix add_compiler_export_flags regression
The mechanical conversion in commit 5d0d980d (Use string(APPEND) in
Modules, 2016-07-28) accidentally introduced use of

  string(APPEND ... PARENT_SCOPE)

Split that into the string(APPEND) and set(PARENT_SCOPE) pieces.
2016-09-01 15:33:49 -04:00
Daniel Pfeifer
5d0d980d99 Use string(APPEND) in Modules
Automate with:

find Modules -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:41:13 +02:00
Felix Geyer
566086187f Fix typos. 2016-07-10 11:05:56 +02:00
Brad King
843402b04a GenerateExportHeader: Add option to specify custom content 2016-06-28 09:43:52 -04:00
Andreas Schuh
be5a8973c3 GenerateExportHeader: Do not define DEFINE_NO_DEPRECATED (#16022)
Previously we allowed this definition to persist outside our header.
This would cause conflicts across multiple such headers because the name
was always the same.  Fix this by avoiding the definition altogether.
2016-03-17 10:40:24 -04:00
James Johnston
060442c2e8 Embarcadero: Check code using CMAKE_CXX_COMPILER_ID and CMAKE_C_COMPILER_ID.
The CMAKE_CXX_COMPILER_ID and CMAKE_C_COMPILER_ID variables are set to
"Borland" for older versions of the compiler.  Newer CodeGear/Embarcadero
compilers will have those variables set to "Embarcadero".  Search for lines of
code referencing both the variable name and Borland to be sure that they also
refer to Embarcadero.
2015-12-03 21:37:06 +00:00
Tony Kelman
3e2865b467 GenerateExportHeader: Use dllexport/dllimport on Cygwin
Cygwin sits on top of Windows and so can use explicit symbol
export and import markup too.

Co-Author: Yaakov Selkowitz <yselkowitz@cygwin.com>
2015-08-27 10:08:34 -04:00
Daniele E. Domenichelli
a7631fc4e0 Modules: Check for ARGC before using ARGV#
ARGV# could be defined from a parent scope.
2015-02-27 10:59:23 -05:00
Brad King
69fe5920b3 GenerateExportHeader: Avoid if() quoted auto-dereference
When testing CMAKE_CXX_COMPILER_ID values with if(MATCHES),
do not explicitly dereference or quote CMAKE_CXX_COMPILER_ID.
We want if() to auto-dereference the variable and not its value.
2014-09-29 15:53:38 -04:00
Ben Boeckel
5ca1d3d59c GenerateExportHeader: support exporting from OBJECT libraries 2014-07-03 10:23:40 -04:00
Brad King
57ddde524b Update CDash server URL
It is now at open.cdash.org and does not start in "/CDash".
2014-06-24 13:54:52 -04:00
Stephen Kelly
ea78935f62 GenerateExportHeader: Reformat docs. 2014-01-04 11:28:57 +01:00
Kitware Robot
f051814ed0 Convert builtin help to reStructuredText source files
Run the convert-help.bash script to convert documentation:

 ./convert-help.bash "/path/to/CMake-build/bin"

Then remove it.
2013-10-15 14:12:03 -04:00
Stephen Kelly
f973737305 GenerateExportHeader: Port to use message(DEPRECATION) 2013-10-08 18:23:42 +02:00
Stephen Kelly
0f3a66673f GenerateExportHeader: Deprecate add_compiler_export_flags function.
This is made obsolete by the CXX_VISIBILITY_PRESET and
VISIBILITY_INLINES_HIDDEN target properties.
2013-09-02 10:57:55 +02:00
Brad King
6aba976427 Merge topic 'geh-cleanup-identifiers'
7e24997 GenerateExportHeader: Generate only C identifiers as defines
2013-05-24 09:20:20 -04:00
Stephen Kelly
7e24997fed GenerateExportHeader: Generate only C identifiers as defines
The variables in this module are used to configure a header file
with defines whose name depends on the name of the target.

As valid names of targets may be invalid for use as defines, convert
the names of the defines used to C identifiers first. This is already
done in C++ code for the DEFINE_SYMBOL property.

This is not as simple as ensuring that the BASE_NAME is a C identifier,
because most of the define names are configurable, and because use of
a BASE_NAME which is not a C identifier, such as 4square can become a
C identifier by specifying a prefix in the generate_export_header
macro.
2013-05-24 09:09:43 -04:00
Stephen Kelly
7ffef5024a GenerateExportHeader: Allow use of of this macro with MODULEs.
The significant issue with MODULEs is that on Windows, the exported
symbols must be dllexported and they are not imported.

In other export macro implementations this is done by defining an
export macro outside of any ifdef which depends on definitions set
on the command line. However, with cmake we already expect the
DEFINE_SYMBOL to be defined, so the regular EXPORT macro can be
used by such plugins.
2013-05-23 19:24:34 +02:00
Brad King
20d0b37f4a Merge topic 'generate-export-header-warnings'
1e0891e Removed GenerateExportHeader warnings about old compilers
2013-02-25 13:11:29 -05:00
Marcus D. Hanwell
1e0891e28a Removed GenerateExportHeader warnings about old compilers
These warnings tend to flood the dashboard submissions, and it is doing
what it should (degrade gracefully with older compilers).
2013-02-20 11:48:12 -05:00
Stephen Kelly
0ebf332199 Fix GenerateExportHeader documentation #13936
There is no CMAKE_CURRENT_BUILD_DIR. CMAKE_CURRENT_BINARY_DIR is
the correct variable here.
2013-02-20 09:27:48 +01:00
David Cole
ccd502ad44 Merge topic 'improve-generateexportheader'
c28e276 GenerateExportHeader: improve compiler identification
4412fc0 GenerateExportHeader: remove unneeded code
2012-03-02 11:44:58 -05:00
Rolf Eike Beer
c28e276948 GenerateExportHeader: improve compiler identification
Use CMAKE_<LANG>_COMPILER_VERSION instead of calling the compiler. This macro
predates those useful variables. This also fixes the issue that g++ version
detection was not working if C language was not enabled.
2012-02-24 17:48:02 +01:00
Rolf Eike Beer
4412fc0890 GenerateExportHeader: remove unneeded code
These expressions check for command line arguments unsupported by the compiler.
We don't pass any custom flags here anyway so this isn't needed.
2012-02-24 17:13:22 +01:00
Stephen Kelly
40efa4db74 Fix documented function signature to match reality.
The function description is already correct.
2012-02-21 23:54:01 +01:00
Alex Neundorf
54e1f6f5a5 GenerateExportHeader: use double quotes around _gcc_version
The GenerateExportHeaders test was failing on one machine, the version
could not be determined there, so the _gcc_version was empty,
so the first argument to if() was empty, so it complained:
http://open.cdash.org/testDetails.php?test=135623436&build=2016288
Use double quotes to turn the non-existant first argument into an empty
string.

Alex
2012-02-18 20:58:19 +01:00
Michael Wild
9f92cdf24d GenerateExportHeader: Fix wrong use of IS_ABSOLUTE (#12645)
Test content of _GEH_EXPORT_FILE_NAME, not variable name.

Signed-off-by: Michael Wild <themiwi@users.sourceforge.net>
2012-01-02 13:27:07 -05:00
Marcus D. Hanwell
41e2b1d824 Make add_compiler_export_flags a function again.
Making this a macro had unintended issues on (among others) Windows
compilers. Moving it back to being a function using PARENT_SCOPE still
satisfies the use case where we simply want to obtain the extra flags.
2011-09-20 00:16:16 -04:00
Marcus D. Hanwell
6a10deb670 Made ADD_COMPILER_EXPORT_FLAGS into a macro.
It adds to the CMAKE_CXX_FLAGS (as before), or populates the supplied
optional argument with the CXX_FLAGS for symbol import/export.
2011-09-19 16:42:42 -04:00
Marcus D. Hanwell
2d1acfe359 Don't warn when nothing to do in visibility function. 2011-09-19 14:55:19 -04:00
Marcus D. Hanwell
d6795685ae Just code style changes. 2011-09-19 14:04:42 -04:00
David Faure
6a6393c905 Don't use a variable name that might be used in other files.
myDir is also used in the Grantlee config file, so if Grantlee
was found, this call failed.
2011-08-27 09:44:52 +02:00
Stephen Kelly
5ca8c565bc Fix up verbatim code sections of the dox. 2011-08-25 20:39:01 +02:00
Stephen Kelly
75596e62f9 Don't start a line with a dash(-)
That is a special character in cmake dox.
2011-08-25 20:39:00 +02:00
Stephen Kelly
826374a45a Remove blank line at the start of the file.
A blank line excludes the file from documentation processing.
2011-08-25 20:39:00 +02:00
Stephen Kelly
8b9b8e1676 Add documentation about the prefix and no_deprecated options. 2011-08-25 18:56:13 +02:00
Stephen Kelly
51bc63a7cb Fix the feature of using a specific prefix for macros. 2011-08-25 18:51:37 +02:00
Stephen Kelly
3449f6b88c Add quotes in case cmake is installed in a prefix with a space. 2011-08-25 18:30:26 +02:00
Stephen Kelly
e0cc024dc9 Add missing NO_EXPORT macro variant. 2011-08-23 23:26:43 +02:00
Stephen Kelly
1b031d1a3f More consistency in the macro options. 2011-08-23 23:21:29 +02:00
Stephen Kelly
03d60c7d81 Try to make the macros do almost nothing for Watcom. 2011-08-23 20:07:42 +02:00
Stephen Kelly
32eff0caec Test for too-old-intel compilers. 2011-08-23 19:49:39 +02:00