Commit Graph

880 Commits

Author SHA1 Message Date
Brad King 2c3b8a1cd8 Merge branch 'fix-repeat-pkg-config' into release 2016-03-21 09:08:25 -04:00
Ben Boeckel 6f4f905483 FindPkgConfig: set correctly named variables in cache (#15903)
The fix in commit v3.5.0-rc1~27^2 (FindPkgConfig: set standard variables
in the cache, 2016-01-20) added the wrong variable name to the cache.
The test was only testing that the cache variable existed, not that it
also had the correct value.  Update the test to ensure that the cache
value matches the local variable value.

Reported-by: Bernd Lörwald
2016-03-21 08:58:12 -04:00
Ruslan Baratov e3fc2899c8 Fix iOS combined feature for single architecture targets
If list of valid target architectures is empty for given SDK then there will
be no VALID_ARCHS build setting returned by Xcode. Return "" (empty string)
explicitly in this case. This may happens if CMAKE_IOS_INSTALL_COMBINED is ON
but only one architecture used in target.
2016-03-15 10:09:50 -04:00
Brad King ef10f5259a Merge branch 'fix-static-private-non-target-depends' into release 2016-02-17 14:03:11 -05:00
Brad King 87f44b7525 Fix export of STATIC library PRIVATE non-target dependencies
In commit v3.5.0-rc1~43^2 (Fix export of STATIC library PRIVATE
dependencies with CMP0022 NEW, 2016-01-15) we taught
target_link_libraries to generate `$<LINK_ONLY:$<TARGET_NAME:dep>>` in
INTERFACE_LINK_LIBRARIES instead of `$<LINK_ONLY:dep>` so that `dep` can
be recognized as a target name and updated during export.  However, this
approach does not work when `dep` is just a plain library name and not a
target because `$<TARGET_NAME:...>` requires the name of a reachable
target.

Since we do not know during target_link_libraries whether the name will
correspond to a reachable target or not, we cannot inject the
`$<TARGET_NAME:...>` expression.  Revert this change and solve the
original problem instead by teaching the export logic to recognize and
update target names directly in `$<LINK_ONLY:...>` expressions.

Reported-by: Ben Boeckel <ben.boeckel@kitware.com>
2016-02-17 14:01:11 -05:00
Brad King 229a5bc903 Merge branch 'fix-cmake_parse_arguments-expansion' into release 2016-02-12 11:25:36 -05:00
Dimitar Yordanov c8c45a2c4e cmake_parse_arguments: Restore ;-list argument flattening
The re-implementation in commit v3.5.0-rc1~116^2~1 (CMakeParseArguments:
replace by native cmake_parse_arguments command, 2015-12-05) introduced
a regression when parsing the ARGN arguments with cmake_parse_arguments.
The original implementation used

    foreach(currentArg ${ARGN})

to iterate over input arguments.  This flattened ;-lists within the
arguments whether they were quoted or not.  Fix our new implementation
to preserve this behavior and add a test case to cover it.

Signed-off-by: Dimitar Yordanov <dimitar.yordanov@sap.com>
Signed-off-by: Matthias Maennich <matthias.maennich@sap.com>
2016-02-12 11:19:40 -05:00
Brad King 656bf0da2c Merge branch 'fix-install-EXPORT-crash' into release 2016-02-08 10:46:42 -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
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
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 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 666487a402 Merge topic 'fix-pkg_search_module-cache'
40249bcc FindPkgConfig: set standard variables in the cache
2016-01-22 09:25:27 -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
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
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 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 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
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
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 a680211ca7 Merge topic 'ios-universal'
565d080a Xcode: Add support for combined install on iOS
34f5ef56 iOS: Fix App Bundle layout
2015-12-11 09:47:18 -05:00
Ruslan Baratov 565d080a9a Xcode: Add support for combined install on iOS
This patch solves the problem of installing both: Device and Simulator
libraries on iOS. Before only one of them was installed.

If the IOS_INSTALL_COMBINED property is set on a target, a
special install hook will be activated which builds the corresponding
target and combines both at the install location.

The original patch was contributed by Ruslan Baratov, and polished by
Gregor Jasny.
2015-12-10 22:36:12 +01:00
Bartosz Kosiorek 7984ac5e58 cmake: Teach -E make_directory to support multiple input directories 2015-12-10 09:07:38 -05:00
Brad King dc873f6eef Merge topic 'cmake-E-copy-multiple-inputs'
bc35087d cmake: Teach -E copy_directory to support multiple input directories
98be140f cmake: Refine -E copy[_if_different] documentation
93cc80ae cmake: Refine -E copy_if_different implementation indentation
0903812b cmake: Refine -E chdir documentation
2015-12-09 08:36:56 -05:00
Domen Vrankar 27e6f74f29 CPack: Added tests for package name and group controll fields 2015-12-07 20:15:49 +01:00
Bartosz Kosiorek bc35087da3 cmake: Teach -E copy_directory to support multiple input directories 2015-12-07 10:51:27 -05:00
Bartosz Kosiorek 384ae5514e cmake: Teach -E copy[_if_different] to support multiple files (#15703)
If multiple input files are provided then the destination must be a
directory.  If only one input file is provided then destination may be
either a file or directory.
2015-12-04 10:26:34 -05:00
Bartosz Kosiorek 0be5020bf8 cmake: Improve '-E' help message formatting 2015-12-04 10:12:02 -05:00
Bartosz Kosiorek e76ee2c006 iOS: Fix framework resource directory layout (#15848)
A typical iOS application bundle (also Framework Bundle) contains the
application executable and any resources used by the application (for
instance, the application icon, other images, and localized content) in
the top-level bundle directory.  The same rule applies to Framework
Bundles.
2015-12-03 08:52:09 -05:00
Michael Scott aac633d5e5 Explicitly enable deprecated warnings by default.
Explicitly enable deprecated warnings by default, via the
cmake::GetSuppressDeprecatedWarnings method, which signals
suppression is turned off unless the CMake variables are set
as required.

Add tests and update the documentation for the new
functionality.
2015-12-01 10:22:51 -05:00
Michael Scott e8974b62d7 Modify dev warning options to affect deprecated warnings.
Change the '-Wdev' and '-Wno-dev' options to also enable and
suppress the deprecated warnings output, via the
'CMAKE_WARN_DEPRECATED' CMake variable, by default. This
action does not happen if the user specifies a deprecated
warning message option.

Add tests and update the documentation for the new
functionality.
2015-12-01 10:22:45 -05:00
Michael Scott da688bcb3b Add -W options to control deprecated warning messages.
Add 'deprecated' warning options type, to allow setting
CMAKE_WARN_DEPRECATED via the -W '-Wdeprecated' and
'-Wno-deprecated' options.

Add tests for new options and updated documentation.
2015-12-01 10:21:57 -05:00
Michael Scott 07388f83b6 Refactor the -W options parser to be generic.
Refactor the -Wdev and -Wno-dev options parser to use a generic -W
parser that follows the GCC pattern, excluding support for
-Werror=TYPE and -Wno-error=TYPE formats for now.
2015-12-01 09:40:43 -05:00
Michael Scott 246b0bfbfd Explicitly enable author (dev) warnings by default.
Explicitly enable author warnings by default, via the
cmake::GetSuppressDevWarnings method, which signals suppression
is turned off unless the CMake variables are set as required.

Add test cases for author and deprecated messages displayed by
default.
2015-12-01 09:35:53 -05:00
Michael Scott deec3a3f06 Make message suppression more consistent.
Make the message suppression more consistent, by adding a check
for the message related CMake variables in cmake::IssueMessage,
which allows callers of IssueMessage other than the message
command to behave as expected. Also added a check for
CMAKE_SUPPRESS_DEVELOPER_WARNINGS in the message command to
mirror the deprecated message type behaviour.

Added a 'force' flag to the cmake::IssueMessage method, to
make the message suppression consistent, when setting the
message related CMake variables directly in a CMake file.

Expand message command tests to cover the AUTHOR_WARNING message
type as well.
2015-11-30 15:00:08 -05:00
Michael Scott aa427a4239 Tests: Revise message in RunCMake.CommandLine -Wdev case
Use more prose-like capitalization.
2015-11-30 15:00:08 -05:00
Brad King 99533c8e34 Merge topic 'fix-find_package-version-file-error-stack'
62126b67 Merge branch 'test-cmake_policy-unmatched' into fix-find_package-version-file-error-stack
2e28c619 cmState: Skip variable scope snapshots to avoid call stack duplicates
b219ff94 Tests: Add case for package version file unmatched policy scope
2015-11-25 09:21:49 -05:00
Brad King 2b24fbf48c Merge topic 'test-cmake_policy-unmatched'
378185fb Tests: Add case for unmatched cmake_policy({PUSH,POP})
2015-11-25 09:21:45 -05:00
Brad King 62126b67e0 Merge branch 'test-cmake_policy-unmatched' into fix-find_package-version-file-error-stack 2015-11-24 14:09:54 -05:00
Brad King b219ff94ac Tests: Add case for package version file unmatched policy scope 2015-11-24 14:01:21 -05:00
Brad King 378185fb7f Tests: Add case for unmatched cmake_policy({PUSH,POP}) 2015-11-24 09:30:16 -05:00
Brad King db7457452c Merge topic 'test-add_subdirectory-in-function'
010c5959 Tests: Add case for add_subdirectory inside a function
2015-11-24 09:26:37 -05:00