Commit b04f3b9a (Create make rules for INTERFACE_LIBRARY
targets., 2013-08-21) extended the makefile generator to create
build targets for INTERFACE_LIBRARY targets. No other generators
were extended with this feature.
This conflicts with the feature of whitelisting of target properties
read from INTERFACE_LIBRARY targets. The INTERFACE_* properties
of the INTERFACE_LIBRARY may legitimately contain TARGET_PROPERTY
generator expressions for reading properties from the 'head target'.
The 'head target' would be the INTERFACE_LIBRARY itself when creating
the build rules for it, which means that non-whitelisted properties
would be read.
Just enough to reach the BuildMacContentDirectory method and the
NeedRelinkBeforeInstall methods.
In the future, those methods can be moved to cmGeneratorTarget.
Add a cmGlobalGenerator::SelectMakeProgram method to select a
caller-provided make program, the CMAKE_MAKE_PROGRAM cache entry, or a
generator-provided default. Call it from all implementations of the
GenerateBuildCommand method with the corresponding generator's default,
if any.
All cmGlobalGenerator::GenerateBuildCommand call sites that need to
produce a string now generate "cmake --build" commands. The remaining
call sites immediately pass the result to cmSystemTools::RunSingleCommand.
Avoid the intermediate string and argument parsing by directly producing a
vector of strings. Also drop the ignoreErrors argument because no call
sites remain that use it.
Refactor edit_cache tool selection to ask each global generator for its
preference. Teach the Ninja generator to always use cmake-gui because
Ninja by design cannot run interactive terminal dialogs like ccmake.
Teach the Makefile generator to use cmake-gui when also using an "extra"
generator whose IDE has no terminal to run ccmake, and otherwise fall
back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
The result is that the depends of the target are created.
So,
add_library(somelib foo.cpp)
add_library(anotherlib EXCLUDE_FROM_ALL foo.cpp)
add_library(extra EXCLUDE_FROM_ALL foo.cpp)
target_link_libraries(anotherlib extra)
add_library(iface INTERFACE)
target_link_libraries(iface INTERFACE anotherlib)
Executing 'make iface' will result in the anotherlib and extra targets
being made.
Adding a regular executable to the INTERFACE of an INTERFACE_LIBRARY
will not result in the executable being built with 'make iface' because
of the logic in cmComputeTargetDepends::AddTargetDepend.
So far, this is implemented only for the Makefile generator. Other
generators will follow if this feature is possible for them.
Make INTERFACE_LIBRARY targets part of the all target by default.
Test this by building the all target and making the expected library
EXCLUDE_FROM_ALL.
This target type only contains INTERFACE_* properties, so it can be
used as a structural node. The target-specific commands enforce
that they may only be used with the INTERFACE keyword when used
with INTERFACE_LIBRARY targets. The old-style target properties
matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for
this target type.
The name of the INTERFACE_LIBRARY must match a validity generator
expression. The validity is similar to that of an ALIAS target,
but with the additional restriction that it may not contain
double colons. Double colons will carry the meaning of IMPORTED
or ALIAS targets in CMake 2.8.13.
An ALIAS target may be created for an INTERFACE library.
At this point it can not be exported and does not appear in the
buildsystem and project files are not created for them. That may
be added as a feature in a later commit.
The generators need some changes to handle the INTERFACE_LIBRARY
targets returned by cmComputeLinkInterface::GetItems. The Ninja
generator does not use that API, so it doesn't require changes
related to that.
The commits 9db31162 (Remove CMake-language block-end command
arguments, 2012-08-13) and 77543bde (Convert CMake-language
commands to lower case, 2012-08-13) changed most cmake code
to use lowercase commands and no parameters in termination
commands. However, those changes excluded cmake code generated
in c++ by cmake.
Make a similar style change to code generated by cmake.
Extend the cmGlobalGenerator::GenerateBuildCommand virtual method
signature with a "projectDir" parameter specifying the top of the
project build tree for which the build command will be generated.
Populate it from call sites in cmGlobalGenerator::Build where a
fully-generated build tree should be available.
Add cmGeneratorTarget::ObjectDirectory member to hold the value. In
ComputeTargetObjects set the value to the full path to the target object
directory including any necessary placeholder for the configuration
name.
Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked
during cmGeneratorTarget construction. Implement it in the Makefile
generator to pre-compute all object file names for each target. Use
the results during generation instead of re-computing it later.
cdc2b41 Fix CompileCommandOutput test build on Windows
7039d1f Fix CompileCommandOutput test for Make tools not supporting spaces
4268e3d run_compile_commands: Cast istream::get() result to char
c45c60b run_compile_commands: Avoid extra stl vector conversion
7c5be51 run_compile_commands: Avoid shadow in std::map<>::at workaround
169bb05 Provide std::map<>::at for use in run_compile_commands
4e2185c Make std::map usage more portable in language=>flags/defines maps
a7e7a04 Fix run_compile_commands build on Apple GCC 3.3
c9174c0 Fix signed/unsigned comparison in EscapeJSON
8346a28 Only offer the compile command output feature on unix systems
0e6b05f Adds a test for the compile command line output.
5674844 make compile command output optional
fe07b05 implement cxx command output
65c0c24 cache flags and defines
3f064ef refactor flags and defines
Instead of enforcing verbose makefile, now the generated build command
includes "VERBOSE=1" so the output will be verbose when building in
C::B.
Also removed the now unused setForceVerboseMakefiles().
Alex
Some older STL implementations invoke the comparison functor as a const
object, so the function call operator must be 'const' qualified. This
fixes the commit "Fix support for OLD behavior of policy CMP0002" to
compile on older STLs.
The commit "Cleanup make progress rule generation code" introduced a map
from target name to the progress.make file location. Policy CMP0002's
OLD behavior allows duplicate target names in different directories, so
only one ends up with a progress.make file. This commit fixes the map
to order by target name first and build directory second, restoring
support for duplicate target names.
This converts the CMake license to a pure 3-clause OSI-approved BSD
License. We drop the previous license clause requiring modified
versions to be plainly marked. We also update the CMake copyright to
cover the full development time range.
If CMakeDirectoryInformation.cmake is newer than depend.internal the include
directories may have changed, so dependencies need to be scanned again.
Ok by Brad.
Alex
This cleans up the Makefile generator's progress rule code. Instead of
keeping every cmMakefileTargetGenerator instance alive to generate
progress, we keep only the information necessary in a single table.
This approach keeps most of the code in cmGlobalUnixMakefileGenerator3,
thus simplifying its public interface.
This adds the Modules/Platform/OpenVMS.cmake platform file for OpenVMS.
We just use Unix-like rules to work with the GNV compiler front-end.
A problem with process execution currently prevents CMake link scripts
from working, so we avoid using them.
The Compaq compiler's std::unique algorithm followed by deletion of the
extra elements seems to crash. For now we'll accept the duplicate
dependencies on this platform.
App Bundle and Framework directories, symlinks, and Info.plist files we
create during generation are byproducts, not outputs. We should re-run
CMake only when they are missing, not when they are old.
See issue #8465.