Commit Graph

4053 Commits

Author SHA1 Message Date
Ben Boeckel 326ad9949f Tests: fix GenerateExportHeader directory definitions
There's no need to stringify the values, but instead just pass in
strings. The core problem is that the path may have tokens which are
replaced by the preprocessor which causes an invalid path to be used.
2016-02-12 13:50:32 -05:00
Brad King 778fda1e92 Merge topic 'apple-isystem-gcc'
5b04aa31 Xcode: Disable test for system include dirs
2cae5128 Apple: Enable -isystem for GNU Compiler >= 4 (#15953)
2016-02-09 10:10:18 -05:00
Brad King 3b8c0fbfd7 Merge topic 'install-EXCLUDE_FROM_ALL'
586e56d0 Help: Add notes for topic 'install-EXCLUDE_FROM_ALL'
d321c196 Tests: Add cases for install() command EXCLUDE_FROM_ALL option
18ce97c4 install: Add EXCLUDE_FROM_ALL option (#14921)
2016-02-09 10:10:15 -05:00
Brad King 8aec0f955a Merge topic 'test-ctest_submit-update'
2859d9ef Tests: Extend ctest_submit host lookup failure matching (#15958)
2016-02-09 10:10:13 -05:00
Brad King e509c0e6d4 Merge topic 'fix-install-EXPORT-crash'
a1ad098d Tests: Avoid OS X 10.5 limitation warning in RunCMake.install test
47460f3e install(EXPORT): Fix crash on target in another directory
e86383e1 Tests: Use newer policy settings in RunCMake.install test
2016-02-09 10:10:09 -05:00
Brad King a1ad098dc8 Tests: Avoid OS X 10.5 limitation warning in RunCMake.install test
The EXPORT-OldIFace test case uses install(TARGETS) and so generates a
warning:

 CMake Warning in CMakeLists.txt:
   WARNING: Target "foo" has runtime paths which cannot be changed during
   install.  To change runtime paths, OS X version 10.6 or newer is required.
   Therefore, runtime paths will not be changed when installing.
   CMAKE_BUILD_WITH_INSTALL_RPATH may be used to work around this limitation.

Set CMAKE_BUILD_WITH_INSTALL_RPATH to avoid the warning since we do not
need to run the binaries from the build tree anyway.
2016-02-08 10:44:43 -05:00
Brad King bd15330da1 Merge topic 'test-FortranCInterface-again'
d31d7ffd Tests: Fix Fortran test to run FortranCInterface again
2016-02-08 10:33:07 -05:00
Brad King a7e2021fea Merge topic 'fix-Fortran-module-in-subdir'
c5eb21b6 Fix dependency scanning configuration in subdirectories
2016-02-08 10:33:04 -05:00
Brad King 08e5362004 Merge topic 'error-multiple-targets'
497cad7c cmake: Teach --build to reject multiple --target options
886acd80 Help: Fix reference to `cmake --build` in cmake(1) manual
2016-02-08 10:32:55 -05:00
Orion Poplawski 2859d9ef6b Tests: Extend ctest_submit host lookup failure matching (#15958)
Match this message:

    Could not resolve host: -no-site-; Name or service not known
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
2016-02-08 09:25:21 -05:00
Gregor Jasny 5b04aa31b8 Xcode: Disable test for system include dirs 2016-02-08 12:48:35 +01:00
Sebastian Schuberth 497cad7c88 cmake: Teach --build to reject multiple --target options
Previously we did not clearly document that `--target` is only supported
to be specified once.  Even worse, specifying it multiple times would
silently ignore any previously specified targets and only build the last
target.

Update the documentation to specify this.  Update the implementation to
reject multiple `--target` options to prevent user errors.
2016-02-05 11:48:16 -05:00
Brad King d31d7ffd1e Tests: Fix Fortran test to run FortranCInterface again
Updates to Tests/Fortran by commit v3.2.0-rc1~501^2 (Avoid if() quoted
auto-dereference, 2014-10-14) changed our check

    "${CMAKE_Fortran_COMPILER_ID}" MATCHES "${CMAKE_C_COMPILER_ID}"

to

    CMAKE_Fortran_COMPILER_ID MATCHES CMAKE_C_COMPILER_ID

because CMP0054 warned about the LHS compiler id "MSVC" being expanded.
However, the RHS of if(MATCHES) does not auto-dereference so this check
has returned FALSE since then and the FortranCInterface part of the test
has not been running!

Fix this by using STREQUAL with quoted arguments and setting CMP0054 to
NEW (by requiring 3.1).
2016-02-05 10:49:08 -05:00
Brad King 47460f3e15 install(EXPORT): Fix crash on target in another directory
Refactoring merged by commit v3.5.0-rc1~299 (Merge topic
'use-generator-target', 2015-10-20) in and around
commit v3.5.0-rc1~299^2~13 (cmExportSet: Store a cmGeneratorTarget,
2015-10-17) changed export sets to delay looking up actual targets and
stores only their names.  However, in InstallCommand::HandleExportMode
we need to lookup targets immediately to check them for
EXPORT_LINK_INTERFACE_LIBRARIES.  The check was accidentally made local
to the current directory, so if an export set contains a target from
another directory the lookup fails and CMake crashes.  Fix the check to
look up the target name globally, and tolerate when no target is found
just in case.

Reported-by: Kelly Thompson <kgt@lanl.gov>
2016-02-05 09:45:16 -05:00
Brad King e86383e135 Tests: Use newer policy settings in RunCMake.install test
In particular, avoid CMP0042 warnings on OS X.
2016-02-05 09:44:26 -05:00
Brad King c5eb21b6d1 Fix dependency scanning configuration in subdirectories
Refactoring in commit v3.5.0-rc1~347^2~2 (Set the current dirs on the
snapshot before creating the cmMakefile) accidentally changed the
source and binary directories configured in `cmake -E cmake_depends`
for use during dependency scanning.  This can cause the wrong directory
information to be loaded.  It also breaks Fortran module dependency
scanning for modules provided by targets in subdirectories that do
not have Fortran_MODULE_DIRECTORY set.

Fix the dependency scanning directory configuration and add a test to
cover the Fortran module case in which the breakage was observed.

Reported-by: Kelly Thompson <kgt@lanl.gov>
2016-02-05 09:26:44 -05:00
Brad King d321c196a0 Tests: Add cases for install() command EXCLUDE_FROM_ALL option 2016-02-04 09:47:57 -05:00
Ashley Whetter 0205f882ae list: Add FILTER subcommand (#3986)
Create a `list(FILTER)` command to filter lists by regular expression.
2016-02-03 11:13:17 -05:00
Brad King f8e5e5bb03 Merge topic 'fix-CMAKE_MATCH-self-match'
6ffc4323 cmConditionEvaluator: Fix matching of `CMAKE_MATCH_*` values (#15944)
2016-02-02 08:33:20 -05:00
Brad King 6ffc432367 cmConditionEvaluator: Fix matching of `CMAKE_MATCH_*` values (#15944)
While evaluating `if(MATCHES)` we get a `const char*` pointer to the
string to be matched.  On code like

    if(CMAKE_MATCH_COUNT MATCHES "Y")

the string to be matched may be owned by our own result variables.
We must move the value to our own buffer before clearing them.
Otherwise we risk reading freed storage.
2016-02-01 10:05:10 -05:00
Brad King d257d68138 add_custom_command: Clarify error when TARGET is out of scope (#15681)
The add_custom_command(TARGET) signature only works for targets defined
in the current directory.  Clarify this in the error message when the
target exists but was defined elsewhere.

Inspired-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2016-01-28 10:33:26 -05:00
Brad King 1d9c539cf7 Merge topic 'test-fltk_wrap_ui'
f98ae28e Tests: Cover fltk_wrap_ui on an executable that links libraries
2016-01-22 09:25:36 -05:00
Brad King ddb09ec8f9 Merge topic 'FindPNG-imported-targets'
9b08c623 FindPNG: Create an imported PNG::PNG target (#15911)
2016-01-22 09:25:33 -05:00
Brad King 666487a402 Merge topic 'fix-pkg_search_module-cache'
40249bcc FindPkgConfig: set standard variables in the cache
2016-01-22 09:25:27 -05:00
Sam Thursfield 9b08c62330 FindPNG: Create an imported PNG::PNG target (#15911)
Imported targets are now the recommended way of dealing with external
library dependencies.  Add one for FindPNG and update documentation
accordingly.  Also add a test case activated by CMake_TEST_FindPNG.
2016-01-21 13:58:15 -05:00
Brad King aaf06f2b0f Merge topic 'add-FindXalanC'
f9e45ab9 FindXalanC: New module to find the Apache Xalan-C++ library
2016-01-21 13:55:50 -05:00
Brad King f98ae28e3d Tests: Cover fltk_wrap_ui on an executable that links libraries
CMake 3.4 may crash on this case.  The problem seems to have been
fixed since then, but keep it working by adding a test case now.

Reported-by: Gonzalo Garramuño <ggarra13@gmail.com>
2016-01-21 13:42:46 -05:00
Ben Boeckel 40249bccdf FindPkgConfig: set standard variables in the cache
Fixes a regression introduced when the code was simplified to use the
variable queries.

Fixes #15903.

Reported-by: Bernd Lörwald
2016-01-21 10:38:30 -05:00
Roger Leigh f9e45ab9d4 FindXalanC: New module to find the Apache Xalan-C++ library 2016-01-20 09:33:38 -05:00
Brad King 1787269ef3 cmake: Fix `-E time` argument passing to child
Since this command was introduced in 2002 it has incorrectly constructed
the child process command line by concatenating arguments separated by
spaces with no quoting.  Fix this by passing the command argument vector
directly to RunSingleCommand without an intermediate quoting and
re-parsing step.

Reported-by: Andrey Pokrovskiy <wonder.mice@gmail.com>
2016-01-20 08:55:23 -05:00
Brad King 184be68580 Merge topic 'cache-parse-error-line-number'
77cd74a3 Print line number of cache parse errors (#11109)
2016-01-20 08:33:35 -05:00
Marc Chevrier 18c3714f4f UseJava: Fix create_javah CLASSPATH handling on Windows
Preserve semicolons in the value.
2016-01-19 10:36:11 -05:00
Ashley Whetter 77cd74a3ea Print line number of cache parse errors (#11109)
Track the line number while parsing `CMakeCache.txt` files and include
it in a parse failure error message.
2016-01-19 10:19:42 -05:00
Brad King aea1b03617 Fix export of STATIC library PRIVATE dependencies with CMP0022 NEW
The target_link_libraries command records the PRIVATE dependencies of a
STATIC library in INTERFACE_LINK_LIBRARIES as "$<LINK_ONLY:dep>".  This
hides the target name from export namespacing logic inside a generator
expression.  When user-written generator expressions reference a target
name they must put it inside a "$<TARGET_NAME:dep>" expression to allow
the export logic to rename the target.  In the case that the private
dependency is not already a generator expression, target_link_libraries
must use "$<LINK_ONLY:$<TARGET_NAME:dep>>" to allow the export logic to
rename the target.

Reported-by: Tamás Kenéz <tamas.kenez@gmail.com>
2016-01-15 10:18:53 -05:00
Brad King e5cbec14a5 Tests: Use CMP0022 NEW behavior in some ExportImport cases 2016-01-15 09:56:01 -05:00
Brad King 0ca122fcb3 Tests: Isolate policy changes in ExportImport test
Use cmake_policy(PUSH/POP) to isolate CMP0022 policy changes.
2016-01-15 09:55:26 -05:00
Brad King 9cf6388698 Merge topic 'install-DIRECTORY-genex'
630c8aa8 install: Allow generator expressions in DIRECTORY
2016-01-14 11:42:20 -05:00
Yves Frederix 630c8aa843 install: Allow generator expressions in DIRECTORY
Teach install(DIRECTORY) to support generator expressions in the list
of directories, much like install(FILES) already supports.
2016-01-13 09:02:06 -05:00
Michael Scott 28f2d750ed Add -Werror and -Wno-error command-line options
Expand the -W set of cmake options to include support for the -Werror
and -Wno-error format, which is used to control upgrading and
downgrading warning and error messages. Implement support for these new
formats for the dev and deprecated message types.

Add tests and updated documentation for new options.
2016-01-12 14:02:51 -05:00
Brad King 5112da5c2f Merge topic 'release-windows'
fae47798 Utilities/Release: Configure Windows binary to support Windows XP
083312a8 Utilities/Release: Switch to .msi builder for Windows binary
240b065f Utilities/Release: Optionally load environment on remote build server
a95b4715 Utilities/Release: Add optional remote launcher to ssh calls
2016-01-07 13:28:31 -05:00
Brad King 070f09f91e Merge topic 'xcode-global-attribute-variant'
d8bc26a0 Xcode: Parse variant and genex for CMAKE_XCODE_ATTRIBUTE (#14947)
dc0ddb9e Xcode: Store configuration name along with XcodeObject (#14947)
28f98cee Xcode: Make CMAKE_XCODE_ATTRIBUTE calculation last step (#14947)
28db2268 Xcode: Factor out XCODE_ATTRIBUTE_ variant filter (#14947)
2016-01-07 13:28:28 -05:00
Brad King f7fbe0f681 Merge topic 'xcode-escape-backslash'
ba39d7e9 Xcode: Escape all backslashes in strings (#15328)
2016-01-07 13:28:26 -05:00
Gregor Jasny ba39d7e9d0 Xcode: Escape all backslashes in strings (#15328)
Before this change backslashes in strings were escaped during compile
flags adds via AppendFlag(). But global flags like OTHER_CPLUSPLUSFLAGS
are not added as flags but as plain strings so they were not escaped
properly.

Now the escaping is performed within cmXCodeObject::PrintString() which
ensures that strings are always encoded.
2016-01-07 13:23:24 -05:00
Gregor Jasny d8bc26a065 Xcode: Parse variant and genex for CMAKE_XCODE_ATTRIBUTE (#14947) 2016-01-03 22:31:12 +01:00
James Johnston d5eb7d8565 GenerateExportHeader: Work around buggy std::getline behavior in BCB5. 2015-12-31 17:45:34 +00:00
Brad King 083312a8fd Utilities/Release: Switch to .msi builder for Windows binary
Use a new build machine to produce the Windows binary using the CPack
WiX generator to produce a `.msi` installer.
2015-12-21 09:52:28 -05:00
Matthias Maennich ab8a280857 cmake_parse_arguments: consider duplicate keyword as warning
The behaviour of double specified keywords is rather undefined or at
least not clearly documented. This change introduces a strict check and
emits a warning in case a keyword has been specified more than once.
2015-12-17 10:45:19 -05:00
Matthias Maennich e8b148318f CMakeParseArguments: replace by native cmake_parse_arguments command
Implement a native `cmake_parse_arguments` command that is fully
compatible with the documented behaviour of the previous implementation.
Leave the CMakeParseArguments module empty but existing for
compatibility.
2015-12-17 10:44:28 -05:00
Matthias Maennich cbbdfc2b61 CMakeParseArguments: add a RunCMake test suite 2015-12-17 10:31:04 -05:00
Brad King c952f2b424 Merge topic 'FindGTest-imported-targets'
f0b5ce7f Help: Add notes for topic 'FindGTest-imported-targets'
99afe235 Tests: Add tests for FindGTest
611735e7 FindGTest: Add imported targets and update documentation
2015-12-14 10:00:02 -05:00