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.
04e708d8 Remove use of include <cmsys/IOStream.hxx> from KWSys
e8585f45 Remove use of include <cmsys/stl/*> and cmsys_stl::*
6db713c0 Remove use of include <cmsys/ios/*> and cmsys_ios::*
Refactoring in commit 6ed9c7e0 (cmState: Host buildsystem properties for
directories, 2015-07-18) broke include_directories(BEFORE). Fix it and
add a test case.
This property was added by commit v2.8.9~204^2~2 (Support building
shared libraries or modules without soname, 2012-04-22). A test for
using the property on MODULE libraries was added by commit
v2.8.9~204^2~1 (Test NO_SONAME property, 2012-04-23). Add such a test
for SHARED libraries too.
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.
da98b896 Tests: In CTestTest2 skip the kwsys.testProcess-10 test that leaks
129640f2 CTestCustom: Ignore kwsys.testProcess-10 for MemCheck as KWSys does
d0915bc8 Merge branch 'upstream-kwsys' into update-kwsys
1feafc64 KWSys 2015-07-30 (f63febb7)
This test intentionally leaks memory so KWSys excludes it from MemCheck.
However, when CTestTest2 runs under our own MemCheck then valgrind may
recursively check tests run by ctest_test() calls in our test.cmake
script. Teach these calls to exluce testProcess-10 too. Also read
the KWSys CTestCustom.cmake file so ctest_memcheck() will ignore the
test too.
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.
The actual file timestamp dependency is known to not work on
Visual Studio or Xcode generators. Tolerate such failure for
these generators (Tests/CustomCommand already covers using
OBJECT_DEPENDS to pull a custom command into a target, and
that still works with these generators).
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.
Extend the Nsight Tegra project generator to add bunch of properties
with the backing variables to fine-tune the generated projects.
Add target properties that map to all "Configuration" PropertyGroups for
each configuration:
* ANDROID_ARCH
* ANDROID_STL_TYPE
Add target properties that map to the AntBuild section of vcxproj files:
* ANDROID_ANT_ADDITIONAL_OPTIONS
* ANDROID_ASSETS_DIRECTORIES
* ANDROID_JAR_DEPENDENCIES
* ANDROID_JAR_DIRECTORIES
* ANDROID_JAVA_SOURCE_DIR
* ANDROID_NATIVE_LIB_DEPENDENCIES
* ANDROID_NATIVE_LIB_DIRECTORIES
* ANDROID_PROCESS_MAX
* ANDROID_PROGUARD
* ANDROID_PROGUARD_CONFIG_PATH
* ANDROID_SECURE_PROPS_PATH
* ANDROID_SKIP_ANT_STEP
Reviewed-by: Dmitry Polyanitsa <dpolyanitsa@nvidia.com>
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.
Commit v3.3.0-rc1~196^2~7 (cmake: Simplify command clean up
loop., 2015-04-12) introduced a bug that built-in commands which
were renamed no longer had their original name restored when
cleanup is performed between configure runs. Check for that
and restore the commands with their original name.
Extend the complex test for this. That test is run by ctest with
the --build-two-config command line option.
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>
Since commit v3.3.0-rc1~397^2 (Check*CompilerFlag: Refactor method used
to pass flags, 2015-02-24) these check modules pass the flags to the
compiler front-end during linking as well as during compilation. This
breaks checks for flags like '-x c++' that are meant only for the
compilation step. Revert the change and add a test covering a
compiler-only flag.
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).
Create target property WINDOWS_EXPORT_ALL_SYMBOLS to automatically
generate a module definition file from MS-compatible .obj files and give
it to the linker in order to export all symbols from the .dll part of a
SHARED library.
In commit v3.3.0-rc1~352^2~3 (Genex: Allow COMPILE_LANGUAGE when
processing compile definitions, 2015-03-04) the name of the variable
used to pass preprocessor definitions to the Fortran dependency scanner
was changed to be per-language, but the actual dependency scanning code
was not updated accordingly. Update the code and add a test case.
Reported-by: Radovan Bast <radovan.bast@gmail.com>
Add a TestLoad setting to CTest that can be set via a new --test-load
command-line option, CTEST_TEST_LOAD variable, or TEST_LOAD option to
the ctest_test command. Teach cmCTestMultiProcessHandler to measure
the CPU load and avoid starting tests that may take more than the
spare load currently available. The expression
<current_load> + <test_processors> <= <max-load>
must be true to start a new test.
Co-Author: Zack Galbreath <zack.galbreath@kitware.com>
If a Windows resource (.rc) source file is included in a STATIC library,
the VS "link" tool will process the compiled ".res" file and needs to know
the target architecture. Without it, we may get a LNK4068 warning and
possibly a LNK1112 error. Add /machine: to the default static library
flags to give the link tool the information it needs.
Since commit v3.3.0-rc1~62^2~5 (cmTarget: Store only cmListFileContext
for CMP0023 handling, 2015-05-18) a call to target_link_libraries on a
target that was defined in another (non-ancestor) directory crashes
because no execution context is left active. Fix this by getting the
execution context from the actual cmMakefile where the current
target_link_libraries call takes place. Test this by verifying that
such calls correctly produce an error diagnostic instead of crashing.
When writing export files, correctly encode property values that contain
characters special to the CMake language parser. We must ensure that
they parse correctly when loaded on the consuming side.
Reported-by: Dan Liew <dan@su-root.co.uk>
The fix in commit v3.2.3~3^2 (Fix assertion failure on unmatched foreach
in function, 2015-05-18) broke handling of unmatched non-loop blocks
because it assumed all function blockers removed during error unwinding
were for loops, essentially switching the set of mishandled cases.
The purpose of the loop block push/pop operations is to define a scope
matching the lifetime of the loop function blockers. Since our function
blockers already have the proper lifetime, simply move the push/pop
operations to their constructor/destructor.
Extend the RunCMake.Syntax test with a case covering this.
Since Qt 5.4.2, it is necessary to compile against Qt 5 with -fPIC
and not -fPIE when using GCC 5. Not doing so results in a hanging
test in this case, so use the PIC flag directly instead.
In commit v3.2.0-rc1~480^2 (QtAutogen: Regenerate qrc files if their input
changes, 2014-09-17) the "cmake -E cmake_autogen" rule was switched from
always running to running as a custom command with dependencies if rcc
is enabled. This is not correct because automoc always needs to re-run.
Switch back to always running the command.
8bcec4d2 Help: Add notes for topic 'GNUInstallDirs-special-prefixes'
c8bd37ec GNUInstallDirs: Add special cases for certain prefixes
5f30f175 GNUInstallDirs: Add test cases
Teach the module to handle SYSCONFDIR and LOCALSTATEDIR properly if
CMAKE_INSTALL_PREFIX is set to `/` or `/usr` -- i.e. as expected by GNU
Coding Standard (i.e. set SYSCONFDIR to `/etc` and `LOCALSTATEDIR` to
`/var`). Also if CMAKE_INSTALL_PREFIX is set to /opt/pkg, `SYSCONFDIR`
must be set to `/etc/opt/pkg` and `LOCALSTATEDIR` to `/var/opt/pkg`
according to FHS.
Add a RunCMake.GNUInstallDirs test with cases covering various install
prefixes. Hard-code the architecture information. Tolerate all
platform-specific LIBDIR values.
Currently the root prefix is not handled well, but verify the current
behavior in the test anyway. This can be addressed with a future
change.
Inspired-by: Alex Turbov <i.zaufi@gmail.com>
Move PARTIALLY_RELOCATABLE_WARNING test to the new common CPack test
script structure to have all tests in one place as well as additional
benefit of having some more checks done during test execution.
Create a <LANG>_COMPILER_LAUNCHER target property (initialized by a
CMAKE_<LANG>_COMPILER_LAUNCHER variable) to specify a compiler launcher
tool. This will supersede the CMAKE_<LANG>_COMPILER_ARG1 approach to
using such tools. The old approach set CMAKE_<LANG>_COMPILER to the
launcher tool while the new approach leaves this variable set to the
actual compiler.
Implement this property for Makefile and Ninja generators. It cannot be
implemented for VS or Xcode generators as the IDE build tools offer no
such hooks.
The VS >= 10 generators need to parse the .sln file from the build
directory to locate targets in subdirectories. This occurs after we
change the working directory to the build tree. If a relative directory
other than "." was given then we would change to it and also refer to
the .sln file location with it. Fix this by converting the build tree
to a full path always. This will also give a more informative error
message when the directory does not exist.
Make RETURN_VALUE report -1 if the update command failed as the
documentation claims. Also avoid reporting a ctest script-level failure
if the update command fails because we still correctly administered the
update step.
Use the KWSys Process "MergeOutput" option to give each test child
process the same pipe for both stdout and stderr. This allows natural
merging of stdout and stderr together instead of merging on arbitrary
buffered read boundaries as before.
The CMAKE_FRAMEWORK_PATH and CMAKE_APPBUNDLE_PATH cache variables are
supposed to be used to generate the extra paths passed to pkg-config,
but instead the CMAKE_PREFIX_PATH variable is used.
This bug was introduced by the refactor in commit v3.1.0-rc1~747^2~1.
The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN were first
merged in commit v2.8.12~322 (Merge topic 'VISIBILITY_PRESET-property',
2013-06-05) but worked only for shared libraries and executables with
exports. Prior to commit v3.0.0-rc1~581^2 (GenerateExportHeader:
Deprecate add_compiler_export_flags function., 2013-09-02) the
add_compiler_export_flags function was used to add visibility flags to
all targets.
The visibility flags are useful for sources in all target types because
they may be later linked into shared libraries or executables with
exports. Introduce policy CMP0063 to enable them for all target types
while preserving compatibility with existing projects that do not expect
this.
Enable languages only in the individual test case. Enable the test
everywhere except Visual Studio generators (which do not implement the
properties) and just set fake flags as needed to activate relevant code
paths. Drop unneeded CMAKE_SUPPRESS_REGENERATION which seems to have
been copied from an unrelated test when this test was created.
Add an ExternalData_NO_SYMLINKS to enable use of copies instead of
symlinks to populate the real data files behind a DATA{} reference.
This will be useful on UNIX-like systems when the underlying filesystem
does not actually support symbolic links.
Suggested-by: Matt McCormick <matt.mccormick@kitware.com>
The 'ctest --launch' command must be placed before the IWYU launcher on
the compiler command line. Extend the RunCMake.IncludeWhatYouUse test
to cover this case. The Ninja generator already does it correctly.
This reverts commit f85db2f323.
Discussion by the QtCreator community at
https://bugreports.qt.io/browse/QTCREATORBUG-13695
raises concerns about this particular approach to working with CMake
projects using QtCreator. Also, the functionality and design of the QBS
extra generator was never discussed on the CMake mailing list or with
QtCreator developers. There may be better ways to make the two tools
work together.
In order to avoid committing to long-term support of this generator
prior to such discussion taking place, revert it from CMake for now.
We may restore this or use an alternative design based on results of
such discussion.
Create a <LANG>_INCLUDE_WHAT_YOU_USE target property (initialized by a
CMAKE_<LANG>_INCLUDE_WHAT_YOU_USE variable) to specify an IWYU command
line to be run along with the compiler.
Add an internal "cmake -E __run_iwyu" mode to wrap the compiler call.
Run a given include-what-you-use command line with the compiler options
and report a warning if it finds anything. Then run the real compiler.
Co-Author: Brad King <brad.king@kitware.com>