Commit Graph

28 Commits

Author SHA1 Message Date
Sebastian Leske 908c74399a Help: Document that the CHECK_* macros create cache variables
Otherwise callers may expect to be able to re-use result variables.
2014-09-11 08:55:26 -04:00
Brad King 4f2fcce4b9 Check*: Allow result variables to contain regex special characters (#14923)
Prior to the existence of the if(DEFINED) condition, many of our Check
modules implemented the condition with a hack that takes advantage of
the auto-dereference behavior of the if() command to detect if a
variable is defined.  The hack has the form:

 if("${VAR} MATCHES "^${VAR}$")

where "${VAR}" is a macro argument reference.  However, this does not
work when the variable named in the macro argument contains characters
that have special meaning in regular expressions, such as '+'.  Run the
command

 git grep -E 'if\("\$\{.*\}" MATCHES "\^\$\{.*\}\$"\)' -- Modules/Check*

to identify lines with this problem.  Use if(NOT DEFINED) instead.
2014-07-31 09:48:41 -04:00
Clinton Stimpson 4c0cc9ab91 Check*.cmake : Add CMAKE_REQUIRED_QUIET flag.
Setting this flag can silence messages from the Check*.cmake modules.
This can be used by Find*.cmake modules when they are in silent mode.
2014-03-29 20:14:23 -06: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 236133e79e Handle targets in the LINK_LIBRARIES of try_compile.
Imported targets are re-exported so that they can be used by the
try_compile generated code with target_link_libraries.

This makes the use of the cmake_expand_imported_targets macro
obsolete. The macro is not able to expand the generator expressions
which may appear in the IMPORTED_LINK_INTERFACE_LIBRARIES content.
Instead it just sees them as 'not a target'.
2013-02-22 08:35:39 -05: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
Alex Neundorf 35c48e1270 Check*.cmake: Expand imported targets in CMAKE_REQUIRED_LIBRARIES
Add the function cmake_expand_imported_targets() to expand imported
targets in a list of libraries into their on-disk file names for a
particular configuration.  Adapt the implementation from KDE's
HANDLE_IMPORTED_TARGETS_IN_CMAKE_REQUIRED_LIBRARIES which has been in
use for over 2 years.  Call the function from all the Check*.cmake
macros to handle imported targets named in CMAKE_REQUIRED_LIBRARIES.

Alex
2012-02-21 15:38:15 -05:00
Alex Neundorf 628f365140 -remove trailing whitespace
Alex
2012-02-21 15:33:31 -05:00
Todd Gamblin 2cde67a781 Modules: Fix spelling 'To distributed' -> 'To distribute' 2010-08-09 08:48:31 -04:00
Brad King 3a666595c9 Convert CMake non-find modules to BSD License
This adds copyright/license notification blocks CMake's non-find
modules.  Most of the modules had no notices at all.  Some had notices
referring to the BSD license already.  This commit normalizes existing
notices and adds missing notices.
2009-09-28 11:46:51 -04:00
Ken Martin 8e9a6beccc ENH: centralized locaiton of CMakeFiles setting 2006-06-14 12:28:32 -04:00
Brad King f0a1da00c1 ENH: Made Check* modules more consistent and well documented. Added CMAKE_REQUIRED_DEFINITIONS option. 2006-02-09 19:23:18 -05:00
Ken Martin d2689c95a1 ENH: some style fixes for the book 2005-12-15 10:41:19 -05:00
Bill Hoffman b7fa820118 ENH: add documentation support for modules 2005-12-14 13:51:08 -05:00
Ken Martin 0a5b9db60b DOC: better documentaiton 2005-11-02 13:51:59 -05:00
Ken Martin c6b011e35e ENH: put cmake files intoa CMakeFiles subdir to clean up bin tree 2005-07-29 09:19:25 -04:00
Brad King c17be8d126 BUG: Message describing variable was using result variable. 2003-10-11 08:12:21 -04:00
Andy Cedilnik 8149dbed29 ENH: Cleanups and add missing CMakeOutput.log and CMakeError.log appending. Close Bug #136 - Verify that all modules that do try compile produce CMakeError.log and CMakeOutput.log 2003-08-08 11:59:07 -04:00
Andy Cedilnik d6ebc123f7 ENH: Extra new line after output 2003-07-17 14:55:45 -04:00
Andy Cedilnik a17587c244 ENH: Replace WRITE_FILE with FILE(WRITE and FILE(APPEND. Replace MAKE_DIRECTORY with FILE(MAKE_DIRECTORY, replace STRING(ASCII things 2003-07-11 14:14:03 -04:00
Andy Cedilnik 668b3f3cea Fix problems with required flags 2003-01-03 20:03:35 -05:00
Andy Cedilnik e720b84d6b Add required flags 2003-01-03 19:23:19 -05:00
Andy Cedilnik c8e546a353 To prevent cmake from breaking up arguments, put quotes around them 2003-01-01 16:25:26 -05:00
Andy Cedilnik 5e48ccac35 Add a way to add custom libraries to the mix. Also add status reporting 2003-01-01 15:02:47 -05:00
Bill Hoffman bd74882d3e ENH: use CMAKE_ROOT and not PROJECT_ for try compile stuff, this allows projects within projects to have different languages 2002-12-17 14:54:25 -05:00
Brad King 7e824e83a9 ENH: Don't repeat check even if answer was no. 2002-12-13 14:58:55 -05:00
Brad King 9a98c16803 ENH: Added CHECK_VARIABLE_EXISTS macro. 2002-11-21 10:11:46 -05:00