summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
Commit message (Collapse)AuthorAgeFilesLines
* find_library: Fix repeat call after changing directory content (#15293)Brad King2014-12-085-0/+25
| | | | | | | | | | | | | We use cmGlobalGenerator::GetDirectoryContent to avoid repeating directory listings. However, GetDirectoryContent loads content from disk at most once. This breaks find_library calls that occur when disk content has changed since preceding find_library calls. Teach cmGlobalGenerator::GetDirectoryContent to save the directory modification time when content is loaded and re-load content if it changes. Create a RunCMake.find_library test with a case covering this.
* Merge topic 'try_compile-link-flags'Brad King2014-12-084-0/+86
|\ | | | | | | | | | | 88eb5824 try_compile: Pass linker flags into test project (#14066) a4f9b6f0 CMakeDetermineCompilerABI: Use normal linker flags in ABI project
| * try_compile: Pass linker flags into test project (#14066)Brad King2014-12-034-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | Copy CMAKE_EXE_LINKER_FLAGS into the test project generated by try_compile, just like we already copy CMAKE_<LANG>_FLAGS. Add CMake Policy CMP0056 to activate this behavior in a compatible way, but do not warn by default when the policy is not set since it will affect all try_compile calls. Extend the RunCMake.try_compile test with a case covering this behavior for each policy setting.
* | Merge topic 'cached-regex-clear-fixed'Brad King2014-12-045-0/+116
|\ \ | |/ |/| | | | | | | ceecd790 cmMakefile: store the number of last matches in a CMake var 7878d061 test: add a test for clearing regex results
| * test: add a test for clearing regex resultsBen Boeckel2014-12-035-0/+116
| |
* | Merge topic 'file-LOCK-command'Brad King2014-12-0345-0/+196
|\ \ | | | | | | | | | | | | | | | | | | 93017828 Help: Add notes for topic 'file-LOCK-command' e6db4c5a file: Add LOCK subcommand to do file and directory locking 05d6531c cmSystemTools: Add StringToInt helper
| * | file: Add LOCK subcommand to do file and directory lockingRuslan Baratov2014-12-0345-0/+196
| |/ | | | | | | | | | | | | | | | | Provide options to fail without blocking or to block up to a timeout. Provide options to specify the scope containing the lock so it can be released automatically at the end of a function, file, or process. Extend the RunCMake.file test with cases covering the file(LOCK) command usage and error cases.
* | continue: Add a new CMake language command for loop continuation (#14013)Gregor Jasny2014-12-0119-0/+100
|/ | | | | Inspired-by: Doug Barbieri Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Merge topic 'target-sources-error-conditions'Brad King2014-12-0112-1/+35
|\ | | | | | | | | | | | | 8a75c7ef Help: Document the export limitation of INTERFACE_SOURCES. e1348056 Export: Disallow export of targets with INTERFACE_SOURCES bb5905bb cmTarget: Don't allow relative paths in INTERFACE_SOURCES
| * Export: Disallow export of targets with INTERFACE_SOURCESStephen Kelly2014-11-297-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can be allowed in the next release, but it needs to have some features present and tested such as * Ensuring that relative paths do not appear in the generated property. * Ensuring that paths to the source or build directories do not appear. * Generating a check in the file for CMake 3.1 or later so that the resulting property will be consumed. * Ensuring that any referenced targets are part of an export set and generating a check for them. * INSTALL_INTERFACE and BUILD_INTERFACE content. All of these checks are already done for INTERFACE_INCLUDE_DIRECTORIES, but it is too late to add them for INTERFACE_SOURCES for CMake 3.1. As the checks introduce some new error conditions, it is better to disallow exporting fully for this case and introduce proper error conditions later instead of policies.
| * cmTarget: Don't allow relative paths in INTERFACE_SOURCESStephen Kelly2014-11-296-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Follow the pattern of checks that are made for INTERFACE_INCLUDE_DIRECTORIES. Existence is already checked by cmSourceFile::GetFullPath. Add a check to disallow relative paths in source directories. Otherwise code such as target_sources(lib1 INTERFACE foo.cpp) would fail if consumed by a target in a different directory. Unlike the INTERFACE_INCLUDE_DIRECTORIES behavior, we don't care whether the entry comes from an IMPORTED target or not. In the include directories case, the directory for a non-imported target might not exist yet but might be created. In the sources case, a file which does not yet exist in the filesystem must be explicitly marked with the GENERATED property. Adjust existing tests and add a new test for the error.
| * Merge branch 'revert-definition-map-lookup' into releasev3.1.0-rc1Brad King2014-10-245-0/+266
| |\
* | \ Merge topic 'break-command-strictness'Brad King2014-11-2621-0/+73
|\ \ \ | | | | | | | | | | | | | | | | | | | | d54617d0 break: Add policy CMP0055 to check calls strictly bae604d9 Track nested loop levels in CMake language with a stack of counters
| * | | break: Add policy CMP0055 to check calls strictlyGregor Jasny2014-11-2521-0/+73
| | | | | | | | | | | | | | | | | | | | | | | | Reject break() without loop scope or any arguments. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* | | | Merge topic 'return-test-foreach'Brad King2014-11-265-0/+18
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | d124c411 return: Add test for returning inside a foreach loop
| * | | | return: Add test for returning inside a foreach loopGregor Jasny2014-11-255-0/+18
| |/ / / | | | | | | | | | | | | Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* | | | Merge topic 'WCDH-multi-file'Brad King2014-11-2610-0/+57
|\ \ \ \ | |/ / / |/| | | | | | | | | | | 4cf5179c WCDH: Make it possible to generate multiple files.
| * | | WCDH: Make it possible to generate multiple files.Stephen Kelly2014-11-2410-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | Extend the write_compiler_detection_header interface to allow specifying a location for supplementary files, and getting the list of resulting files as a variable.
* | | | Merge topic 'file-GENERATE-rerun'Brad King2014-11-254-0/+38
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | 26e98c34 file(GENERATE): Re-run cmake when appropriate.
| * | | | file(GENERATE): Re-run cmake when appropriate.Stephen Kelly2014-11-184-0/+38
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-run if the input file changes or if the output file is removed. This only works with the Makefile generators currently. The limitation of the Ninja generator is tracked as issue #15256. The IDE generators will need larger refactoring as they currently rely on being able to determine the depends and output files at the start of generate-time, which is too early for the file(GENERATE) case.
* | | | Add an option for explicit BYPRODUCTS of custom commands (#14963)Brad King2014-11-148-0/+14
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common idiom in CMake-based build systems is to have custom commands that generate files not listed explicitly as outputs so that these files do not have to be newer than the inputs. The file modification times of such "byproducts" are updated only when their content changes. Then other build rules can depend on the byproducts explicitly so that their dependents rebuild when the content of the original byproducts really does change. This "undeclared byproduct" approach is necessary for Makefile, VS, and Xcode build tools because if a byproduct were listed as an output of a rule then the rule would always rerun when the input is newer than the byproduct but the byproduct may never be updated. Ninja solves this problem by offering a 'restat' feature to check whether an output was really modified after running a rule and tracking the fact that it is up to date separately from its timestamp. However, Ninja also stats all dependencies up front and will only restat files that are listed as outputs of rules with the 'restat' option enabled. Therefore an undeclared byproduct that does not exist at the start of the build will be considered missing and the build will fail even if other dependencies would cause the byproduct to be available before its dependents build. CMake works around this limitation by adding 'phony' build rules for custom command dependencies in the build tree that do not have any explicit specification of what produces them. This is not optimal because it prevents Ninja from reporting an error when an input to a rule really is missing. A better approach is to allow projects to explicitly specify the byproducts of their custom commands so that no phony rules are needed for them. In order to work with the non-Ninja generators, the byproducts must be known separately from the outputs. Add a new "BYPRODUCTS" option to the add_custom_command and add_custom_target commands to specify byproducts explicitly. Teach the Ninja generator to specify byproducts as outputs of the custom commands. In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets that link, the byproducts must be specified as outputs of the link rule that runs the commands. Activate 'restat' for such rules so that Ninja knows it needs to check the byproducts, but not for link rules that have no byproducts.
* | | Add USES_TERMINAL option for custom commandsPeter Collingbourne2014-11-148-0/+14
| | | | | | | | | | | | | | | | | | Teach the add_custom_command and add_custom_target commands a new USES_TERMINAL option. Use it to tell the generator to give the command direct access to the terminal if possible.
* | | Tests: Test add_custom_command and add_custom_target error casesBrad King2014-11-1429-0/+85
| | | | | | | | | | | | | | | Add RunCMake.add_custom_command and RunCMake.add_custom_target tests to cover the error messages for these commands.
* | | file(GENERATE): Evaluate early to allow generating source filesStephen Kelly2014-11-1214-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The evaluation files must be known before cmTargetTraceDependencies attempts to find them, but we must actually generate the files after cmTargetTraceDependencies, as that can add to target SOURCES. The limitation is that the generated output name must not depend on the SOURCES of a target if the generated file is used by that target. Mark the output files as GENERATED so that trace dependencies does not expect them to already exist in the filesystem. Move the invokation of ForceLinkerLanguage in the Generate logic to after the generated file names are known. ForceLinkerLanguage tries to determine the sources of a target (in order to determine an already-known language) and otherwise fails to get information about the generated file. Test that the output of file(GENERATE) can be used as a target source file and that accessing the target SOURCES in the name of the output file is an error. Accessing the TARGET_OBJECTS would be a similar error if it was legal to use that generator expression in this context. That is not currently possible and is a different error condition, so test the current error output as a reminder to change the expected output if that becomes possible in the future. Test that generated rule files resulting from cmTargetTraceDependencies appear in the SOURCES generated in the output file.
* | | file(GENERATE): Use permissions of input file if present.Stephen Kelly2014-11-045-0/+28
| | |
* | | ExternalProject: Add unit testsDaniele E. Domenichelli2014-11-035-0/+87
| | |
* | | Merge topic 'fix-configure_file-COPYONLY'Brad King2014-11-033-0/+13
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1531df2b configure_file: Warn about unknown arguments 4abbb140 Qt4: Fix configure_file call to use COPYONLY, not COPY_ONLY bd7ba8e2 KWSys: Fix configure_file call to use COPYONLY, not COPY_ONLY e9282782 Help: Fix configure_file call to use COPYONLY, not COPY_ONLY
| * | | configure_file: Warn about unknown argumentsBrad King2014-10-313-0/+13
| |/ / | | | | | | | | | | | | | | | | | | Extend the RunCMake.configure_file test with a case covering possible common typos of the COPYONLY option. Reported-by: Iosif Neitzke <iosif.neitzke@gmail.com>
* | | Merge topic 'ExternalProject_CMAKE_CACHE_DEFAULT_ARGS'Brad King2014-10-316-0/+80
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 609037f4 ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGS 98cdb658 ExternalProject: Add CMAKE_CACHE_DEFAULT_ARGS arguments 36cf8a1e Tests/Tutorial: Fix when USE_MYMATH is OFF
| * | | ExternalProject: Add unit tests for CMAKE_CACHE_DEFAULT_ARGSDaniele E. Domenichelli2014-10-316-0/+80
| | | |
* | | | Merge topic 'fix--D-command-line-parsing'Brad King2014-10-306-0/+15
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | aee7e4a0 cmCacheManager: parse -D flags more strictly 368e8de4 Tests: test -D parsing on the command line
| * | | cmCacheManager: parse -D flags more strictlyBen Boeckel2014-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of: -DCACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG:BOOL=TRUE the variable is parsed out as: CACHE_VARS=-DEXTERNAL_PROJECT_CMAKE_ARG because the parser allows '=' in the variable name. Disallow such a name on the command line.
| * | | Tests: test -D parsing on the command lineBen Boeckel2014-10-206-0/+15
| |/ /
* | | Merge topic 'revert-definition-map-lookup'Brad King2014-10-275-0/+266
|\ \ \ | |/ / |/| / | |/ | | | | | | | | d1b62185 Merge branch 'parent-scope-tests' into variable-pull-failure 5f414cef Revert "cmDefinitions: Don't store parent lookups" e0c0b1ac test: add a test for PARENT_SCOPE with multiple scopes 064c415d test: add test for PARENT_SCOPE behavior
| * Merge branch 'parent-scope-tests' into variable-pull-failureBen Boeckel2014-10-245-0/+266
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * parent-scope-tests: test: add a test for PARENT_SCOPE with multiple scopes test: add test for PARENT_SCOPE behavior Conflicts: Tests/RunCMake/set/RunCMakeTest.cmake
| | * test: add a test for PARENT_SCOPE with multiple scopesBen Boeckel2014-10-243-0/+249
| | | | | | | | | | | | See the comment in the test for what is being tested here.
| | * test: add test for PARENT_SCOPE behaviorBen Boeckel2014-10-243-0/+17
| | | | | | | | | | | | Test code courtesy of Alex Merry <alex.merry@kde.org>.
* | | FPHSA: fix when requested or found version is exactly 0Rolf Eike Beer2014-10-074-0/+8
| | | | | | | | | | | | | | | Until now it was checked with "if(VAR)", which will be false in case "0" is the content of the variable.
* | | FPHSA: when EXACT version match is requested only compare the components givenRolf Eike Beer2014-10-0721-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Given that you have a foobar that identifies itself as 1.2.3 from now on a find_package(foobar 1.2 EXACT) will succeed, as 1.2.3 will now be considered as being 1.2. Until now this was only the case for version 1.2.0.
* | | Merge topic 'ninja-compiler-change'Brad King2014-09-241-1/+1
|\ \ \ | | | | | | | | | | | | | | | | 6120fca8 Ninja: Prevent compilers to be silently modified
| * | | Ninja: Prevent compilers to be silently modifiedSylvain Joubert2014-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike with Unix Makefiles generator modifying compiler paths was not protected with Ninja generator. It was possible to modify them in the cache without the expected effect on the generated solution. Also activate corresponding tests with Ninja.
* | | | Tests: Fix CMP0054 warningsBrad King2014-09-164-5/+5
|/ / / | | | | | | | | | | | | Hack the CMP0054 warning locally to be an error and run the test suite. Resolve CMP0054 in Tests/* code as appropriate for each case.
* | | Merge topic 'vs-generator-platform'Brad King2014-09-1513-1/+60
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be6a555d Tests: Test setting a generator platform in a toolchain file d506fee8 Tests: Use -A option to pass generator platform selection 11c9ddd6 ExternalProject: Use -A option to pass generator platform 29bd843e CTest: Use -A option to pass generator platform selection eb7d8156 cmake: Add -A option to specify a generator platform
| * | | Tests: Test setting a generator platform in a toolchain fileBrad King2014-09-159-0/+50
| | | | | | | | | | | | | | | | | | | | Teach the RunCMake.GeneratorPlatform test to cover setting CMAKE_GENERATOR_PLATFORM in a file loaded by CMAKE_TOOLCHAIN_FILE.
| * | | cmake: Add -A option to specify a generator platformBrad King2014-09-155-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Define the 'cmake -A' option to set CMAKE_GENERATOR_PLATFORM without having to spell out the whole variable name. We choose the name '-A' for "platform" because '-P' is already taken, and in the common use case the "platform" is actually an architecture (e.g. x64). Teach the RunCMake test infrastructure to use -A to pass the generator platform. Extend the RunCMake.GeneratorPlatform test with a case to verify that the -A option cannot be repeated.
* | | | Merge topic 'if-sanity'Brad King2014-09-1526-0/+436
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 858d5a0b Fix if() checks of CMAKE_SYSTEM_NAME on Cygwin e177e7af FPHSA: Avoid if() dereferencing of quoted variable 425acc52 cmcurl: Use if(DEFINED) to simplify conditions cede5cbd libarchive: Avoid depending on if() to dereference a quoted variable 2d97178b FindGTK2: Avoid depending on if() to dereference a quoted variable 0b12815d Modules/Test*.cmake: Use if(DEFINED) to simplify conditions 188a1f23 If: Introduce policy CMP0054 - don't dereference quoted variables in if() b900c1cc If: Extract cmConditionEvaluator from if() implementation
| * | | If: Introduce policy CMP0054 - don't dereference quoted variables in if()Nils Gladitz2014-09-1126-0/+436
| | | |
* | | | Tests: Add generator platform supportBrad King2014-09-104-5/+8
| | | | | | | | | | | | | | | | | | | | Propagate CMAKE_GENERATOR_PLATFORM through the test hierarchy so that all tests can build with the selected generator platform, if any.
* | | | VS: Implement CMAKE_GENERATOR_PLATFORM for VS >= 8Brad King2014-09-053-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For VS generator names that do not specify the platform name, read CMAKE_GENERATOR_PLATFORM to get it. Extend the RunCMake.GeneratorPlatform test with a case covering use of the x64 platform when the test generator is a Visual Studio generator whose name does not specify a platform.
* | | | CMake: Add CMAKE_GENERATOR_PLATFORM optionBrad King2014-09-059-0/+35
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reject the option by default. It will be implemented on a per-generator basis. Pass the setting into try_compile project generation. Add cache entry CMAKE_GENERATOR_PLATFORM and associated variable documentation to hold the value persistently. Add a RunCMake.GeneratorPlatform test to cover basic use cases for the option. Verify that CMAKE_GENERATOR_PLATFORM is empty by default, and that it is rejected when the generator does not support a user setting.