The enums just introduce unfamiliar names and don't provide value.
The order of arguments is reversed, as that is the result of the
cmOutputConverter::ConvertToRelativePath
overload which accepts the RelativeRoot enum.
Add SOURCE_DIR and BINARY_DIR directory properties that return the
absolute paths to the corresponding directories. These correspond
to the target properties of the same names that we already have.
Maintain in the directory state the list of target names added to be
built. These are normal, non-imported targets (but do include INTERFACE
libraries).
Enable the initial handshake of the client to complete the connection
to the server.
The handshake sets the protocol version that client and server will
use to talk to each other. The only way to change this is to quit the
server and start over.
CMake specific information is also set during the initial handshake.
Since cmake so far never had to change basic information about any project
while running, it was decided to keep this information static and
require a restart of the cmake server to change any of these.
Adds a bare-bones cmake-server implementation and makes it possible
to start that with "cmake -E server".
Communication happens via stdin/stdout for now.
Protocol is based on Json objects surrounded by magic strings
("[== CMake Server ==[" and "]== CMake Server ==]"), which simplifies
Json parsing significantly.
This patch also defines an interface used to implement different
versions of the protocol spoken by the server, but does not include
any protocol implementaiton.
3fab1fef cmNinjaNormalTargetGenerator: make sure comments match parameter names
7b94a7ad cmCommandArgumentsHelper: simplify boolean expression
782fcbb9 Use CM_NULLPTR
809ca6c8 Use braces around statements
516f8edb Avoid else after return
d9f5d3c5 Remove redundant get() call on smart pointer
3fda1094 Mark overridden functions with CM_OVERRIDE
I otherwise get:
Expected stderr to match:
expect-err> CMake Error at AppendNotOutput.cmake:1 \(add_custom_command\):
expect-err> add_custom_command given APPEND option with output.*
expect-err> which is not already a custom command output.
expect-err> Call Stack \(most recent call first\):
expect-err> CMakeLists.txt:3 \(include\)
Actual stderr:
actual-err> CMake Error at AppendNotOutput.cmake:1 (add_custom_command):
actual-err> add_custom_command given APPEND option with output
actual-err> "/home/stephen/dev/src/cmake/with
actual-err> space/Tests/RunCMake/add_custom_command/AppendNotOutput-build/out" which is
actual-err> not already a custom command output.
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
Using a specific line for paths is a style already used elsewhere for
the same reason, such as CMP0041 output.
Split the ConvertToRelativePath funtion into ConvertToRelativePath and
ForceToRelativePath. Both functions take the local path as a string
rather than a vector of path segments. Reimplement the old interface on
top of the two new functions for interface compatibility.
9353d991 cmTarget: Remove unused support for partial construction
fa3897b2 cmGlobalGenerator: Refactor global target construction
916d8445 cmGlobalGenerator: Split CreateDefaultGlobalTargets implementation
Refactoring in commit v2.8.10~58^2~2 (Ninja: move -LIBPATH behind -link
option, 2012-09-26) added arguments to cmLocalGenerator::GetTargetFlags
and updated the call sites. However, in the cmake::FindPackage and
cmLocalGenerator::AddBuildTargetRule call sites it added the new
arguments in the wrong order. The latter was never used and has been
removed. The former remains buggy and prints out compiler flags instead
of the link framework/library search paths. Fix its argument order.
Avoid using partially-constructed cmTarget instances. Collect the
information about how to construct each target in a separate structure
and then actually create each cmTarget with full construction.
Ninja does not support PRE_INSTALL_SCRIPT properties and does not
perform the relink required by installation without help from some other
mechanism, so error out if it would be required.
Issue: #13934, #16304
Add `CMAKE_FIND_PACKAGE_SORT_{ORDER,DIRECTION}` variables to specify
sort order and direction.
When multiple package with the same name have been found in the same
location sorting option can be used to force a specific version to be
loaded (e.g. libA_1.12.0 instead of libA_1.1.0). Currently sorting by
NAME and by NATURAL order have been implemented.
Natural ordering makes use of the `strverscmp(3)` ordering.
7a2e114d cmTarget: Inline SetType method at only remaining call site
00e78c19 cmTarget: Construct with basic information up front
9d11bd50 Avoid requiring default cmTarget constructor for map indexing
d97513d8 cmTarget: Add method to get a copy adapted for a directory
The `std::map<>` index operator requires a default constructor on the
value type. Avoid requiring a default constructor on `cmTarget` just
for this purpose.
The change in commit 32f756c8 (CursesDialog: include what you use,
2016-09-01) revealed that an ancient workaround for compiling with GCC
on Solaris has not had an effect in a long time and is now incorrect.
Drop it.
Look for VS or Xcode project files at the top of the build tree.
If present, enable an "Open Project" button to open them through
the OS desktop services.
Add options to the `install()` and `export()` commands to export the
targets we build into Android.mk files that reference them as prebuilt
libraries with associated usage requirements (compile definitions,
include directories, link libraries). This will allow CMake-built
projects to be imported into projects using the Android NDK build
system.
Closes: #15562
Add support for natural string order by comparing non-numerical
character directly and numerical number by firstly collecting contiguous
digits. The order is defined by the `strverscmp(3)` manual [1].
[1] http://man7.org/linux/man-pages/man3/strverscmp.3.html
Inspired-by: Pierluigi Taddei <pierluigi.taddei@gmail.com>
Before the change the list of externals was queried only
before the svn update.
With the change the list is queried both before and after.
This should also be more accurate since the list of externals might
change during the update.
Introduce cmake::ReportCapabilitiesJson which returns a the Json object
that is serialized in cmake::ReportCapabilities.
This allows to re-use the information in cmake-server.
Since we support adding arbitrary flags to the link line via
`target_link_libraries` the project/user may add their own RPATH flags
(typically for system library locations). Re-order the link line to
place our generated RPATH entries before the libraries so that they also
come before flag-specified entries. Otherwise our in-build-tree RPATH
entries may not be preferred by the dynamic loader and we could collide
with libraries in the system directories.
Closes: #16293
cc6b948e cmGeneratorTarget: factor out common part of AddSources commands
52052ef8 cmGeneratorTarget: use erase-unique instead of reinitialization
3b362230 cmGeneratorTarget: don't clear container in destructor
Since commit 059c230d (VS: Explicitly default to v100 toolset in Visual
Studio 2010, 2016-07-21) the VS 2010 generator now correctly defaults to
the v100 toolset instead of no toolset. However, this broke our logic
for defaulting to the `Windows7.1SDK` toolset for 64-bit builds on VS
2010 Express. Fix the logic by ignoring the `v100` default in the case.
The `ARGC`/`ARGV#` variables in function scope hold the original
arguments with no ;-list flattening. Add a way for functions to
cleanly parse arguments that may contain `;`. This also avoids
extra copying of the arguments.
Co-Author: Brad King <brad.king@kitware.com>
Teach the lexer to match and return specific Fortran keywords as tokens.
Update the parser to use these instead of always using a WORD token and
then checking the text. This avoids extra string comparisons and will
allow more grammar productions to be unambiguously added later for
additional Fortran statements.
Our Fortran grammar is a bare minimum to extract dependencies.
Other statement syntax can be ignored, so simply skip to the
end of unrecognized statements. This allows some of our existing
productions to be dropped.
d28da906 cmFortranParser: Inject a newline at end-of-file when missing
8c65a501 cmFortranParser: Revise indentation style to match rest of CMake
f70c71c5 cmFortranLexer: Update to flex 2.6
e11cd31f Fortran: Warn when dependency scanning fails to parse a source file
bdc679a8 VS15: Add Visual Studio 15 generator
a8936656 VS: Update v140 flag tables from VS 15 MSBuild files
21346d3f Features: Record features for VS 15 Preview 4
Call the generator "Visual Studio 15" without any year because the
preview version of VS 15 does not provide a year in the product name.
Copy cmGlobalVisualStudio14Generator to cmGlobalVisualStudio15Generator
and update version numbers accordingly. Add the VS15 enumeration value.
Note that we do not need to add a MSVC15 variable or v150 toolset
because Visual Studio 15 comes with an updated version of the v140
toolset and remains ABI-compatible.
Teach tests VSExternalInclude, RunCMake.GeneratorPlatform, and
RunCMake.GeneratorToolset to treat VS 15 as they do VS 10-14.
Closes: #16143
When exporting from a project (with install(EXPORT ...)), the
`<PROJECT>Targets.cmake` file contains logic for computing the
`_IMPORT_PREFIX` from its own location. This `_IMPORT_PREFIX` is then
used in the `<PROJECT>Targets-<config>.cmake` file to generate the
`IMPORTED_LOCATION_<CONFIG>`. The generation unconditionally appends a
"/" to `_IMPORT_PREFIX` before appending the rest of the path. If
`_IMPORT_PREFIX` is "/", then the `IMPORTED_LOCATION_<CONFIG>`
properties all start with exactly two leading slashes ("//").
Exactly two leading slashes is a special case in POSIX file paths, such
that its interpretation is left up to the implementation. This means
that changing the path prefix from "/" to "//" should not be allowed.
Since references to `_IMPORT_PREFIX` are always followed by a "/",
simply check the value to replace "/" with "".
Since commit 14a8d61f (cmMakefile: Port nested error logic away from
cmExecutionStatus) we fail to continue processing function and macro
bodies after non-fatal errors. A non-fatal error should not stop
foreach loops, macro bodies, nested bodies, or the outer script.
Add a test covering these cases, and revert the change to fix them.
Also revert commit 2af853de (cmMakefile: Simplify IssueMessage
implementation) because the assertion it added (which was removed by the
above commit and is restored by reverting it) is incorrect. We do have
code paths that call cmMakefile::IssueMessage with an empty execution
stack, such as in CheckForUnusedVariables's LogUnused call.
Our parser grammar expects all statements to end in an `EOSTMT` token
such as a newline. Ensure that the last statement in a file can be
parsed even if it is missing a newline.
Revise the documented modifications we need to make to the
flex-generated source file according to the needs of the new version.
Also drop the duplicate copyright notice block from the generated file.
We expect to handle all relevant statements and ignore those that we do
not understand. Warn if this process ever fails. Otherwise dependency
information may be silently left out.
Commit 17bbf6af (CPackWIX: Implement new CPACK_WIX_SKIP_PROGRAM_FOLDER
feature) generates GUIDs for most but not all components
when the feature is active.
Generate the remaining GUIDs as well.
Co-Author: Nils Gladitz <nilsgladitz@gmail.com>
Run cmparseMSBuildXML.py on cl.xml, lib.xml, link.xml, and masm.xml to
generate our flag tables:
python cmparseMSBuildXML.py -x ".../Common7/IDE/VC/VCTargets/1033/cl.xml" > cmVS14CLFlagTable.h
python cmparseMSBuildXML.py -x ".../Common7/IDE/VC/VCTargets/1033/lib.xml" > cmVS14LibFlagTable.h
python cmparseMSBuildXML.py -x ".../Common7/IDE/VC/VCTargets/1033/link.xml" > cmVS14LinkFlagTable.h
python cmparseMSBuildXML.py -x ".../Common7/IDE/VC/VCTargets/BuildCustomizations/masm.xml" > cmVS14MASMFlagTable.h
Manually integrate the changes with those we've made since earlier
import to add the new flag mappings.