This fixes a bug where 64 bit builds with /bigobj incorrectly determined
that the object files were not 64 bit. This manifested itself with
printf type functions showing up as undefined because the leading
underscore was being removed and should not be removed.
If a custom command has a SYMBOLIC output (that is never actually
created) then do not mark the custom command build statement as
'restat'. Otherwise other custom commands that depend on the symbolic
output may not always re-run because after running the first custom
command Ninja 'restat' will detect that the output timestamp did not
change and skip its dependents.
This was observed with the ExternalProject BUILD_ALWAYS option where
Ninja would not re-run the 'install' step each time 'build' re-runs.
Changes in commit v3.4.0-rc1~124^2~1 (cmFindProgramCommand: Re-implement
search using more flexible approach, 2015-09-01) did not preserve the
behavior of looking for the given name with no search path at all.
Fix this and add a test case covering finding an absolute path with
no search directories.
In some cases, CMake returned the following error:
-- Checking for module 'foo'
-- Package 'foo' not found
When the actual error returned by pkg-config was:
Package 'bar', required by 'foo', not found
Now, the actual error is forwarded to the user.
-- Checking for module 'foo'
-- Package 'bar', required by 'foo', not found
For the standard case (i.e. the package was indeed not found), the
CMake error was:
-- Checking for module 'foo'
-- Package 'foo' not found
But it now prints:
-- Checking for module 'foo'
-- No package 'foo' found
The associated test was also updated. ${last} refers to the last
CLI argument.
Refactoring in commit v3.4.0-rc1~390^2~1 (cmCTestMultiProcessHandler:
Refactor RUN_SERIAL implementation, 2015-06-01) forgot to update a code
path for cleaning up after a failed RUN_SERIAL test. This causes an
infinite loop after a RUN_SERIAL test fails. Fix it and add a test.
a4bbdc5e cmLocalGenerator: Remove cmGeneratorTargetsType from setter API.
04b6bb16 cmLocalGenerator: Simplify semantic of adding generator targets.
400e3d19 cmLocalGenerator: Don't store imported generator targets
726e461b CMP0063: Split unit test by target type.
Commit v3.4.0-rc1~494^2~4 (cmMakefile: Add API for elseif to create
backtrace., 2015-05-29) removed the use of cmMakefileCall to push/pop
execution context in favor of a new way to create backtraces.
However, a call to cmMakefile::GetExecutionContext is still invoked to
issue a contextual CMP0054 warning through cmConditionEvaluator. As
the elseif is not part of the call stack, this resulted in trying to
access an empty vector.
Avoid the attempt at getting execution context when evaluating elseif by
constructing a context and backtrace on behalf of the cmConditionEvaluator
in all cases.
Use the run_cmake() function to generate the test build tree with
the proper CMake generator and also to verify that it succeeds.
Drop our PreTestError helper as it is no longer needed.
The DEPENDENCIES test case uses install(TARGETS) and so generates a warning:
CMake Warning in CMakeLists.txt:
WARNING: Target "test_prog" 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.
Some commands on Windows do not understand forward slash paths and
require backslashes. In order to help projects generate shell
invocations of such commands, provide a generator expression to convert
paths to the shell-preferred path format for the current generator.
This will allow custom commands to generate paths the same way CMake
does for compiler command invocations.
The changes in commit 47b060ae (CPackDeb: allow empty directories in
component packages, 2015-09-21), commit b58de9fe (CPack: allow packaging
of empty directories, 2015-09-21), and commit b761e90d (CPack: remove
accidental changes, 2015-09-22) regressed packaging of CMake itself.
Revert the changes until they can be revised and rebased on other
changes that make additional fixes.
The changes in commit c96fe0b4 (cmake: Add -W options to control
deprecation warnings and errors, 2015-07-28) fail to account for
-Wdev warnings produced by places in CMake other than message().
This causes a regression in which -Wno-dev fails to suppress such
warnings. Revert the feature until it can be revised accordingly.
2514e426 CMP0026: Use compatibility codepath until configure is finished (#15748)
b98f7712 cmGlobalGenerator: Add API for the configure step being finished.
b5de2bd9 cmLocalGenerator: Simplify condition.
If variable is set to TRUE, values of all variables prefixed with CPACK_
will be escaped so special characters such as dolar sign, quotes or
foreward slash will not be lost. By default variable is treated as set
to FALSE for back compatibility.
The cpack_encode_variables macro is changed into a function to remove
scope pollution. There should be no other effects.
Use it instead of the similar cmMakefile API. It is necessary to
know that the Configure step is completely done, not just that one
particular cmMakefile is finished configuring.
Prior to commit 611220f7 (cmTarget: Use reliable test for CMP0024 and CMP0026
OLD., 2015-07-25), this was determined by checking whether cmGeneratorTargets
exist yet, which happens after the Configure step.
Add ctest command-line options:
--test-output-size-passed <n>
--test-output-size-failed <n>
to set the amount of test output to store in Test.xml as a command-line
dashboard client.
Add documentation and tests for the existing
CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE
CTEST_CUSTOM_MAXIMUM_FAILED_TEST_OUTPUT_SIZE
CTest variables.
e134e53b Add support for *.manifest source files with MSVC tools
da00be63 MSVC: Rewrite manifest file handling with Makefile and Ninja
d488b5c9 Ninja: Always add OBJECT_DIR variable to link rules
6d620f5a VS: Add manifest tool settings to VS 8 and 9 project files
f38625be Tests: Teach RunCMake to tolerate 'Bullseye Testing' lines in test output
1a75a966 Tests: Teach RunCMake to tolerate 'Time Machine' lines in test output
becb14c9 CPack/DEB: test preserve extra config file permissions
7044e8ee CPackDeb: use of libarchive and removal of fakeroot
415405a3 cmArchiveWrite: control user/group, permissions and recursive file adding
4f2ff601 Tests: Make RunCMake.CPack error messages more readable
81b748ae cmGeneratedFileStream: Fix spelling in comment
Classify .manifest sources separately, add dependencies on them, and
pass them to the MS manifest tool to merge with linker-generated
manifest files.
Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
When testing under Bullseye coverage, some tests get lines on stderr of
the form:
... Bullseye Testing Technology ...
Remove such lines from output before matching because they are not
representative of the actual test output.
On some OS X machines some tests get lines on stderr of the form:
... attempting to exclude an item from Time Machine by path ...
produced by the system. Remove such lines from output before matching
because they are not representative of the actual test output.
7a6e5f06 Tests: Cover find_program when the environment duplicate some HINTS
40122975 Merge branch 'fix-bad-search-ordering' into test-search-ordering
02440154 find_*: Fix search order when the environment duplicates some HINTS
Extend the RunCMake.set_property test with cases covering buildsystem
directory properties:
* COMPILE_DEFINITIONS
* COMPILE_OPTIONS
* INCLUDE_DIRECTORIES
Also test a non-buildsystem property to document the equivalence
in behavior.
This is a change in behavior from CMake 3.3, but there is no semantic meaning
to empty entries in buildsystem properties. This also restores behavior to
that of CMake 2.8.10.
Mangling is prevented by using a function instead of a macro for setting
default value of some CPack variables. Function is meant for internal use
in CPack.cmake only.
Old macro is deprecated but kept for backwards compatibility - was
intended for internal use only as it can't be used for CPack after
CPack.cmake script is included.
Patch removes local workarounds that were required by old macro,
fixes default setting of variables that by default inherit value from
another variable that already went through old default setting macro
(e.g. value of CPACK_PACKAGE_INSTALL_REGISTRY_KEY caused error for
wrong escapes if CPACK_PACKAGE_INSTALL_DIRECTORY contained escaped
back slashes) and provides a test for correct escaping of characters.
9cdf6ef4 Swift: Add proper Swift compiler test
1aa29f0d Swift: Remove positive Swift language tests
d778a1c2 Swift: Require Xcode 6.1 and for MacOS X at least SDK 10.10
4da60024 Swift: Fix Compiler-Id detection for Swift 2
874a265c Swift: Make SwiftMix compatible with Swift 2
b9856862 Tests: Cover set_property for buildsystem target properties
407ff47e cmTarget: Fix memory leak when SOURCES property is cleared
cf74fc24 cmTarget: Fix buildsystem property empty value set and append operations
8ea7611b find_program: Optionally consider all names in each directory
fc1990c9 cmFindProgramCommand: Re-implement search using more flexible approach
fdbfc9f6 Tests: Add explicit testing for find_program
907a919b cmSystemTools: Drop unused StringEndsWith method
ed4de3c9 cmFindProgramCommand: Use Names member instead of passing it
bf32b95e cmFindLibraryCommand: Avoid repeating search for the same name
It's relatively complex to determine in advance if a Xcode, SDK,
and Deployment Target configuration is capable of running Swift.
For example the following combinations do not work:
* deployment target < OS X 10.9
* Xcode 6.2 and macosx10.9 SDK
* Xcode 7 Beta 6 and macosx10.10 SDK
Until we found out how to query Xcode for Swift support in a reliable
way, the RunCMake.Swift test cases will be restricted to negative ones.
Extend the RunCMake.set_property test with cases covering buildsystem
target properties:
* COMPILE_DEFINITIONS
* COMPILE_FEATURES
* COMPILE_OPTIONS
* INCLUDE_DIRECTORIES
* LINK_LIBRARIES
* SOURCES
Also test a non-buildsystem property to document the current difference
in behavior. Refactor the existing LINK_LIBRARIES case to the same
more-extensive test as the rest. Use the output generated by CMake 3.3
as the expected output for each test case.
The test case added to RunCMake.set_property by commit 675ef165 (Allow
LINK_SEARCH_{START,END}_STATIC props to have default values, 2015-08-07)
is not a test of the set_property command and so belongs in its own test
case. Create a new RunCMake.LinkStatic test to cover cases related to
static linking.
While at it, simplify the LINK_SEARCH_STATIC test case to enable only C.
When more than one value is given to the NAMES option this command by
default will consider one name at a time and search every directory for
it. Add a NAMES_PER_DIR option to tell this command to consider one
directory at a time and search for all names in it.
Previously this command was tested only implicitly as part of larger
tests. Add a RunCMake.find_program test to cover find_program cases
specifically and independently.
ad262917 Xcode: Add unit test for iOS project install (#12506)
48fe617e Fix installation of iOS targets (#12506)
d2c2319d Replace CMAKE_XCODE_EFFECTIVE_PLATFORMS with call to PlatformIsAppleIos
CPackConfig.cmake file generation from CMake test suite.
Currently it contains only a simple test without special
characters in variable value.
Test is not part of RunCMake/CPack as those tests are
expected to be run for a specified generator.
Currently the CMAKE_XCODE_EFFECTIVE_PLATFORMS property acts only as
a kind of toggle switch to enable iOS project layout features.
But instead of relying on this undocumented property, better detect
the presence of an iOS SDK directly.
Starting with Xcode 7 the OSX and iOS SDKs contain only stub
files for dynamic system libraries. These stub files contain
some meta data and a list of exported sysbols in plain text.
They are handled by the toolchain like regular dylibs.
Refactoring in commit 6ed9c7e0 (cmState: Host buildsystem properties for
directories, 2015-07-18) broke include_directories(BEFORE). Fix it and
add a test case.
Since support for generator expressions was added to OUTPUT_NAME it is
possible for project code to cause recursion in this method by using a
$<TARGET_FILE> genex. Detect and reject such cases.
In the get_filename_component command, add a new BASE_DIR parameter to
use with the ABSOLUTE and REALPATH options. This will be used when
finding an absolute path from a relative path.
Use the CMAKE_LINK_SEARCH_START_STATIC and CMAKE_LINK_SEARCH_END_STATIC
variables to initialize the LINK_SEARCH_START_STATIC and
LINK_SEARCH_END_STATIC target properties respectively.
The change in commit 27252b24 (cmComputeLinkInformation: Simplify
generator object access, 2015-08-02) broke the conditional use of a
target introduced in commit 41abdc17 (cmGeneratorTarget: Move GetSOName
from cmTarget, 2015-08-04). Restore the conditional lookup. Add a test
case that hacks platform information variables to trigger this code
everywhere.
If {ARCHIVE,LIBRARY,RUNTIME}_OUTPUT_DIRECTORY is set with a genex then
do not add the per-config subdirectory on multi-config generators.
This will allow projects to use $<CONFIG> to place the per-config
part of the directory path somewhere other than the end.
d035e968 get_filename_component: Fix bug where CACHE was ignored.
38ed5866 get_filename_component: Added initial tests for PROGRAM component.
772ca69f get_filename_component: Tests now check for proper CACHE usage.
If PROGRAM_ARGS is provided to get_filename_component, fix bug where the
command failed to honor the CACHE argument.
Added test cases to RunCMake.get_filename_component that fail when the
bug is not fixed to prevent regressions.
Signed-off-by: James Johnston <johnstonj.public@codenest.com>
The RunCMake.get_filename_component test now tests basic functionality
of the PROGRAM component argument of get_filename_component.
Signed-off-by: James Johnston <johnstonj.public@codenest.com>
The RunCMake.get_filename_component test was improved to assert that
each test variable outputted by get_filename_component is or is not
a cache variable, as per the particular test.
Signed-off-by: James Johnston <johnstonj.public@codenest.com>
nmake and jom generators no longer warn about missing INCLUDE/LIB
environment variables unless the C/CXX compiler cannot be found. This
is useful if the user does not want to use these generators with the
Visual C++ compiler, or they do not want to enable any language.
Refactoring in commit v3.3.0-rc1~76^2 (cmMakefile: Handle CMP0014 before
configuring the generator, 2015-05-14) accidentally left the file name
"/CMakeLists.txt" in the error message. Remove it and add a test case.
if(TEST TestNameThatExists) will return true if a test with the name
TestNameThatExists has been added with add_test. The syntax is similar
to if(TARGET TargetName). Since use of "TEST" as an argument to if()
could previously be interpreted as a non-keyword argument, add policy
CMP0064 to treat it as a keyword as NEW behavior.
Refactor the -Wdev and -Wno-dev to use a generic -W parser that follows
the GCC pattern. Include support for setting CMAKE_ERROR_DEPRECATED and
CMAKE_WARN_DEPRECATED via the deprecated warning. Add -Werror=dev and
-Wno-error=dev options so that dev warning options are in line with
deprecated warning options. Use a new CMAKE_SUPPRESS_DEVELOPER_ERRORS
internal cache entry to store the above new dev options persistently.
Add tests for new options and updated cmake documentation and release
notes to list new options.
The --trace option is helpful, but sometimes, what you're looking for is
deep under many layers of function calls and figuring out what instance
of the function call you're looking at is tedious to determine (usually
involving patching and message()). Instead, add a --trace-expand option
to trace while expanding commands into what CMake actually sees.
3e6b2ab6 CPack/DEB: component version of PACKAGE_CONTROL_EXTRA
506f6bc0 CPack/DEB: Remove duplicate string(TOUPPER) calls
32e9276a Tests/RunCMake/CPack/DEB: add verifyDebControl
47d1f118 Tests/RunCMake/CPack: found files should be preserved
Add variable CTEST_CHANGE_ID to configure the setting. This allows
CTest clients to give CDash information about what change is being
tested so that CDash can take actions to report the results (e.g. to a
pull request page).
Package file names that are found during validation
should be preserved in FOUND_FILE_${NO} variables
that can be later used in custom VerifyResult scripts.
Move failure cases from the CMake.{If,List,While,GetProperty} tests over
to the RunCMake.{if,list,while,get_property} tests to use the more
modern infrastructure. This also avoids using REGEX_ESCAPE_STRING to
try to regex-match full paths.
Subsume the CTestTestConfigFileInBuildDir test cases into the
RunCMake.ctest_start test as new cases to avoid infrastructure
duplication. This also avoids using REGEX_ESCAPE_STRING to try to
regex-match full paths.
We use a special dedicated structure to store the LINK_LIBRARIES target
property. Do not try to construct a string from a NULL value. Instead
leave the property structure empty when no value is given.
Reported-by: Ghyslain Leclerc <ghleclerc@gmail.com>
8f86407c Windows: Optionally generate DLL module definition files automatically
069aa93b bindexplib: Add support for "/bigobj" format objects
61bbbdcf bindexplib: Fix treatment of some symbols
de70c922 bindexplib: Teach DumpFile to return errors
8ea69dfe bindexplib: Build source as part of CMakeLib
2963cb2a bindexplib: Wrap long lines
4ff09893 bindexplib: Drop code that CMake does not need
7de8276c bindexplib: Add copyright/license notice block
65086ad7 bindexplib: Import original implementation from CERN
d2475bb5 cmListFileBacktrace: Implement in terms of cmState::Snapshot.
238aac23 cmListFile: Remove FilePath member from cmListFileContext.
329098a9 cmMakefile: Set the FilePath on the frame from the cmState.
91158a33 cmMakefile: Create intermediate variables for snapshot frames.
821f91d6 cmMakefile: Create a scoped context for parsing listfiles.
30d44efa cmMakefile: Access the execution list file from the cmState.
6361f680 cmState: Store execution context.
94704d75 cmState: Add GetCallStackParent method.
a8e54460 cmState: Store snapshots for more different types.
dbafb015 cmMakefile: Split CallStack into two pieces.
27ff19a9 cmLinkedTree: Add operator* to the iterator.
Allow the `Swift` language to be enabled with the Xcode generator for
Xcode >= 6.1. Reject it on other generators and with older Xcode
versions. Since Apple is the only vendor implementing the language
right now, the compiler id can be just `Apple`.
Added new USES_TERMINAL option to the ExternalProject_Add_Step
function. This option passes USES_TERMINAL to the underlying
add_custom_command call so that the Ninja console pool is used.
Also, corresponding new USES_TERMINAL_<step> options were added
to the ExternalProject_Add function.
Justification: if using Ninja with a CMake superbuild, it's often
desirable to limit the superbuild to ONE sub-Ninja process at a
time to avoid oversubscribing the CPU. Using the console pool also
makes it easy to monitor the progress of the sub-Ninja process.
Independent USES_TERMINAL_<step> arguments are passed to
ExternalProject_Add instead of one USES_TERMINAL argument that
controls everything. Users may wish to run some steps in parallel
but not others (e.g. parallelize configure but not build).