Commit Graph

4277 Commits

Author SHA1 Message Date
Brad King 88e1c54a7c Merge topic 'use-string-append'
7a649111 Use string(APPEND) in Tests
5d0d980d Use string(APPEND) in Modules
2016-08-01 14:59:50 -04:00
Brad King 2711c35a8d Merge topic 'app-framework-bundle-extension'
f951d0ad Add tests for BUNDLE_EXTENSION
c63380b1 Update documentation about bundle extensions
134d5c1f Honor BUNDLE_EXTENSION also for Frameworks (#14742)
2b909c08 Honor BUNDLE_EXTENSION also for App Bundles (#16148)
2016-08-01 14:59:44 -04:00
Brad King 8427b8e11c Merge topic 'aliased-target-properties'
ea647533 Do not report ALIASED_TARGET as always set (#15783)
2016-08-01 14:59:41 -04:00
Daniel Pfeifer 7a649111cd Use string(APPEND) in Tests
Automate with:

find Tests -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:43:04 +02:00
Brad King d504999d86 Merge topic 'tests-hide-ldd-check-errors'
d6a6024e Tests: Hide errors from `ldd --help` output check
2016-07-22 09:17:53 -04:00
Brad King 1fc340f0d4 Merge topic 'windows-export-all-fix-objlib'
13a6ff31 VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
2016-07-22 09:17:48 -04:00
Brad King 19ccd35473 Merge topic 'revert-autogen-subdirs'
5e55d87b Autogen: Revert changes to generate moc/rcc in subdirectories
2016-07-22 09:17:28 -04:00
Gregor Jasny f951d0adb4 Add tests for BUNDLE_EXTENSION 2016-07-21 23:18:56 -07:00
Brad King d6a6024e9e Tests: Hide errors from `ldd --help` output check
If `--help` is not a valid option then it may print content to stderr,
so we need to capture that.
2016-07-21 15:39:05 -04:00
Brad King 13a6ff31be VS: Fix WINDOWS_EXPORT_ALL_SYMBOLS for object libraries
Teach Visual Studio generators to include object files from object
libraries in the list of objects whose symbols are to be exported.
The Makefile and Ninja generators already did this.  Update the
test to cover this case.

Reported-by: Bertrand Bellenot <Bertrand.Bellenot@cern.ch>
2016-07-21 11:05:22 -04:00
Brad King 5e55d87bdc Autogen: Revert changes to generate moc/rcc in subdirectories
Revert these commits:

* v3.6.0-rc1~134^2
  Tests: QtAutogen: Same source name in different directories test, 2016-04-13
* v3.6.0-rc1~134^2~1
  Autogen: Generate qrc_NAME.cpp files in subdirectories, 2016-04-19
* v3.6.0-rc1~134^2~2
  Autogen: Generate not included moc files in subdirectories, 2016-04-19

They regress existing builds that depend on the paths/symbols generated
previously.  Another approach will be needed to solve the name collision
problem they were intended to solve.  Leave the error diagnostics for
the colliding cases that were added in the same topic as the above
commits because they provide a useful early failure in relevant cases.

Fixes #16209.
2016-07-21 09:27:19 -04:00
Brad King 1296a0eada Ninja: Fix inter-target order-only dependencies of custom commands
Custom command dependencies are followed for each target's source files
and add their transitive closure to the corresponding target.  This
means that when a custom command in one target has a dependency on a
custom command in another target, both will appear in the dependent
target's sources.  For the Makefile, VS IDE, and Xcode generators this
is not a problem because each target gets its own independent build
system that is evaluated in target dependency order.  By the time the
dependent target is built the custom command that belongs to one of its
dependencies will already have been brought up to date.

For the Ninja generator we need to generate a monolithic build system
covering all targets so we can have only one copy of a custom command.
This means that we need to reconcile the target-level ordering
dependencies from its appearance in multiple targets to include only the
least-dependent common set.  This is done by computing the set
intersection of the dependencies of all the targets containing a custom
command.  However, we previously included only the direct dependencies
so any target-level dependency not directly added to all targets into
which a custom command propagates was discarded.

Fix this by computing the transitive closure of dependencies for each
target and then intersecting those sets.  That will get the common set
of dependencies.  Also add a test to cover a case in which the
incorrectly dropped target ordering dependencies would fail.
2016-07-20 13:12:24 -04:00
Gregor Jasny ea6475334a Do not report ALIASED_TARGET as always set (#15783)
The cmGetPropertyCommand::StoreResult expects NULL for unset
properties. Make ALIASED_TARGET align with that expectation.

Additional corrections to the unit tests are necessary because
get_property removes variables for unset properties (in contrast
to get_target_property which stores a -NOTFOUND value).
2016-07-16 11:09:18 -07:00
Brad King c8e59d2dfa Merge topic 'toolchain-flag-init'
8a98cf64 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
37d15c39 MSVC: Set all CMAKE_*_LINKER_FLAGS_INIT directly
55c884ed Embarcadero: Set all CMAKE_*_LINKER_FLAGS_INIT directly
aec3c79a Strip CMAKE_*_LINKER_FLAGS[_<CONFIG>] initializer whitespace
2016-07-15 09:04:30 -04:00
Brad King 8a98cf6432 Honor CMAKE_*_LINKER_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_EXE_LINKER_FLAGS_INIT "...")

to

    string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.
2016-07-14 15:47:32 -04:00
Brad King f5c19a9dcc Merge topic 'no-implicit-link-clang-rt'
35322226 CMakeParseImplicitLinkInfo: Exclude libclang_rt libraries
2016-07-14 09:23:35 -04:00
Brad King 53df6d5995 Merge topic 'findicu'
0e9e6aa8 Tests: Run clang-format on FindICU test code
2016-07-13 10:01:47 -04:00
Brad King 0e9e6aa85d Tests: Run clang-format on FindICU test code 2016-07-13 10:01:02 -04:00
Brad King 291e41855c Merge topic 'findicu'
e3bff7b3 Help: Add notes for topic 'findicu'
4a63be15 FindICU: New module
2016-07-13 09:26:55 -04:00
Brad King 40f24f0ec2 Merge topic 'windows-export-all-from-exe'
9da725cb Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports
2005b960 Makefile: Factor out WINDOWS_EXPORT_ALL_SYMBOLS helper
2016-07-13 09:26:33 -04:00
Brad King 43875ca59c Merge topic 'cmake-spelling'
56608618 Fix typos.
2016-07-13 09:26:30 -04:00
Roger Leigh 4a63be15dd FindICU: New module 2016-07-13 09:15:16 -04:00
Brad King 353222262a CMakeParseImplicitLinkInfo: Exclude libclang_rt libraries
These libraries are used for Clang runtime analysis support with
flags like `-fsanitize=memory` and are not actually implicitly
linked libraries.

Fixes #16194.
2016-07-11 16:30:02 -04:00
Brad King 507aa256e5 Merge topic 'tiff-typo'
7959d518 FindTIFF: Correct variable names in unit test
2016-07-11 09:56:17 -04:00
Yury Zhuravlev 9da725cb00 Windows: Honor WINDOWS_EXPORT_ALL_SYMBOLS for executables with exports
For executables with ENABLE_EXPORTS set, export all symbols when
instructed to do so by WINDOWS_EXPORT_ALL_SYMBOLS.
2016-07-11 09:41:04 -04:00
Roger Leigh 7959d51847 FindTIFF: Correct variable names in unit test 2016-07-10 18:16:16 +00:00
Felix Geyer 566086187f Fix typos. 2016-07-10 11:05:56 +02:00
Brad King 4786ec515f Source: Remove long-unused .cvsignore file 2016-07-08 13:36:38 -04:00
Brad King a66004bee0 Honor CMAKE_<LANG>_FLAGS[_<CONFIG>]_INIT set in toolchain files
Document these variables.

Change our convention for setting these variables from:

    set(CMAKE_C_FLAGS_INIT "...")

to

    string(APPEND CMAKE_C_FLAGS_INIT " ...")

so that any value previously set by a toolchain file will be used.

Automate the conversion with:

    sed -i 's/set *(\(CMAKE_\(C\|CXX\|Fortran\|RC\|ASM\|${[^}]\+}\)_FLAGS\(_[^_]\+\)\?_INIT \+"\)/string(APPEND \1 /' \
      Modules/Compiler/*.cmake Modules/Platform/*.cmake

and follow up with some manual fixes (e.g. to cases that already
meant to append).  Also revert the automated changes to contexts
that are not protected from running multiple times.
2016-07-06 10:13:31 -04:00
Brad King d582c23a47 try_compile: Add policy CMP0066 to honor CMAKE_<LANG>_FLAGS_<CONFIG>
In the `try_compile` source file signature we propagate the caller's
value of `CMAKE_<LANG>_FLAGS` into the test project.  Extend this to
propagate `CMAKE_<LANG>_FLAGS_<CONFIG>` too instead of always using the
default value in the test project.  This will be useful, for example, to
allow the MSVC runtime library to be changed (e.g. `-MDd` => `-MTd`).
However, some projects may currently depend on this not being done,
so we need to activate the behavior using a policy.

This change was originally made by commit v3.6.0-rc1~160^2 (try_compile:
Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11) but without the
policy and so had to be reverted during the 3.6 release candidate cycle.

Fixes #16174.
2016-06-29 09:11:02 -04:00
Brad King 8d79375818 Merge topic 'GenerateExportHeader-custom-content'
a9252441 Tests: Run clang-format on GenerateExportHeader code
2016-06-29 09:10:29 -04:00
Brad King a9252441b3 Tests: Run clang-format on GenerateExportHeader code 2016-06-29 09:09:54 -04:00
Brad King cb93dc048f Merge topic 'GenerateExportHeader-custom-content'
843402b0 GenerateExportHeader: Add option to specify custom content
2016-06-29 09:07:33 -04:00
Brad King db4ba61f39 Merge topic 'revert-try_compile-config-flags'
943fe6e3 Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"
2016-06-29 09:07:28 -04:00
Brad King e34c5543fa Merge branch 'revert-try_compile-config-flags' into release 2016-06-28 15:09:44 -04:00
Brad King 943fe6e3b4 Revert "try_compile: Honor CMAKE_<LANG>_FLAGS_<CONFIG> changes"
Revert commit v3.6.0-rc1~160^2 (try_compile: Honor
CMAKE_<LANG>_FLAGS_<CONFIG> changes, 2016-04-11).  The behavior it
introduced can break projects that depend on the lack of such behavior.
We will have to introduce a policy or other mechanism to enable the
behavior in a compatible way.  Simply revert it for now.

See issue #16174.
2016-06-28 15:03:45 -04:00
Brad King 843402b04a GenerateExportHeader: Add option to specify custom content 2016-06-28 09:43:52 -04:00
Brad King 1b021a64f8 Merge topic 'ninja-no-rsp-for-rc'
15b3f6f0 ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
2016-06-28 09:06:34 -04:00
Ben Boeckel 15b3f6f0f1 ninja, rc: ignore CMAKE_NINJA_FORCE_RESPONSE_FILE for RC files
In commit v3.6.0-rc1~174^2 (Ninja: Honor CMAKE_NINJA_FORCE_RESPONSE_FILE
for compile rules, 2016-04-06), Ninja learned to look for
`CMAKE_NINJA_FORCE_RESPONSE_FILE` in the current scope or the
environment in order to force response file usage for all compilation
rules.

However, on Windows, the RC compiler goes through cmcldeps which does a
`replace(output, output + ".dep.obj")` on the command line. However,
with a response file (which we name `output + ".rsp"`), the response
file path is replaced instead causing the compiler to (correctly)
complain that the response file `output + ".dep.obj.rsp"` does not
exist.

What needs to happen is for cmcldeps to look through the response file,
replace *its* contents and place it in the `output + ".dep.obj.rsp"`
file.

Also add a test which actually compiles an RC file into a library and
executable for all generators on Windows and additionally test
`CMAKE_NINJA_FORCE_RESPONSE_FILE` for Ninja generators.

Fixes #16167.
2016-06-27 14:34:06 -04:00
Brad King c2c2a2f4c7 Merge topic 'vs-tool-override'
ed05f11d VS: Add a VS_TOOL_OVERRIDE source file property
2016-06-23 08:59:29 -04:00
Brad King 015876fa81 Merge topic 'vs-sdk-refs'
35a6cac2 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
2016-06-23 08:59:26 -04:00
Brad King f101d4eff3 Merge topic 'xcode-bundle-extension'
e36e5a26 Xcode: Properly handle BUNDLE_EXTENSION
2016-06-23 08:59:23 -04:00
Gilles Khouzam 35a6cac2d3 VS: Add VS_SDK_REFERENCES target property to reference external SDKs
Allow one to specify external SDK references such as
`Microsoft.AdMediatorWindows81, Version=1.0`.
2016-06-22 08:34:12 -04:00
Gilles Khouzam ed05f11dd2 VS: Add a VS_TOOL_OVERRIDE source file property
This property allow to specify a specific Visual Studio tool for a
source file overriding the default tool behavior.  For example, a
`.resw` file being processed as a `PriResource` file.  This has the
advantage of being able to teach CMake to process new file types without
code modifications.
2016-06-20 10:46:14 -04:00
Brad King 74fde78311 Merge topic 'cmake-trace-source'
e63151ff cmake: Add an option to control what files needs to be traced
2016-06-20 09:56:06 -04:00
Brad King e2d700bd97 Merge topic 'cpack-deb-test-fixes'
6107fab4 CPack/Deb: Fix test to actually test the preinst script
302391ba CPack/Deb: Fix tests for SELinux-enabled systems
2016-06-20 09:56:01 -04:00
Domen Vrankar 6107fab467 CPack/Deb: Fix test to actually test the preinst script
The test regex variable name was invalid and did not test preinst
script.

Reported-by: Patrick <mail6543210@yahoo.com.tw>
2016-06-20 09:29:11 -04:00
Domen Vrankar 302391bae6 CPack/Deb: Fix tests for SELinux-enabled systems
Suggested-by: Patrick <mail6543210@yahoo.com.tw>
2016-06-20 09:29:11 -04:00
Gregor Jasny e36e5a2680 Xcode: Properly handle BUNDLE_EXTENSION 2016-06-18 23:23:32 +02:00
Alex Turbov e63151ff54 cmake: Add an option to control what files needs to be traced
Even in relatively small projects using `--trace` (and `--trace-expand`)
may produce a lot of output.  When developing a custom module usually
one is interested in output of only a few particular modules.

Add a `--trace-source=<file>` option to enable tracing only a subset of
source files.  The final output would be only from requested modules,
ignoring anything else not matched to given filename(s).
2016-06-17 11:46:23 -04:00