summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
Commit message (Collapse)AuthorAgeFilesLines
* QtAutogen: Tests: Increase minimum required CMake versionSebastian Holtermann2016-12-074-4/+4
|
* QtAutogen: Tests: Don't use std::auto_ptrSebastian Holtermann2016-12-072-2/+7
|
* QtAutogen: Tests: Don't include CMAKE_CURRENT_BINARY_DIRSebastian Holtermann2016-12-075-7/+3
|
* QtAutogen tests: Pass Qt compiler features to library targetsSebastian Holtermann2016-11-292-1/+7
|
* QtAutogen tests: Move the complex test case to a subdirectorySebastian Holtermann2016-11-2956-83/+88
|
* QtAutogen tests: Extend test description in CMakeLists.txtSebastian Holtermann2016-11-291-6/+14
|
* QtAutogen tests: Move independent sameName test to top list of CMakeLists.txtSebastian Holtermann2016-11-291-3/+4
|
* QtAutogen tests: Rename uiconly target to camel case uicOnlySebastian Holtermann2016-11-294-4/+6
| | | | Also move uicOnly sources to dedicated uicOnlySource directory.
* QtAutogen tests: Rename rcc_empty target to camel case rccEmptySebastian Holtermann2016-11-293-7/+6
|
* QtAutogen tests: Rename rcconly target to camel case rccOnly.Sebastian Holtermann2016-11-293-6/+11
| | | | Also add dedicated rccOnlyRes.qrc file for the rccOnly target.
* QtAutogen: Add test for empty qrc fileSebastian Holtermann2016-09-303-0/+19
|
* Simplify CMake per-source license noticesBrad King2016-09-2714-182/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
* Tests/QtAutogen: Test same moc/qrc source names in different directoriesSebastian Holtermann2016-08-1021-0/+237
|
* Autogen: Revert changes to generate moc/rcc in subdirectoriesBrad King2016-07-2119-218/+0
| | | | | | | | | | | | | | | | | | | Revert these commits: * v3.6.0-rc1~134^2 Tests: QtAutogen: Same source name in different directories test, 2016-04-13 * v3.6.0-rc1~134^2~1 Autogen: Generate qrc_NAME.cpp files in subdirectories, 2016-04-19 * v3.6.0-rc1~134^2~2 Autogen: Generate not included moc files in subdirectories, 2016-04-19 They regress existing builds that depend on the paths/symbols generated previously. Another approach will be needed to solve the name collision problem they were intended to solve. Leave the error diagnostics for the colliding cases that were added in the same topic as the above commits because they provide a useful early failure in relevant cases. Fixes #16209.
* Revise C++ coding style using clang-formatKitware Robot2016-05-1653-859/+830
| | | | | | | | | | | | | Run the `Utilities/Scripts/clang-format.bash` script to update all our C++ code to a new style defined by `.clang-format`. Use `clang-format` version 3.8. * If you reached this commit for a line in `git blame`, re-run the blame operation starting at the parent of this commit to see older history for the content. * See the parent commit for instructions to rebase a change across this style transition commit.
* Format include directive blocks and ordering with clang-formatBrad King2016-04-298-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sort include directives within each block (separated by a blank line) in lexicographic order (except to prioritize `sys/types.h` first). First run `clang-format` with the config file: --- SortIncludes: false ... Commit the result temporarily. Then run `clang-format` again with: --- SortIncludes: true IncludeCategories: - Regex: 'sys/types.h' Priority: -1 ... Commit the result temporarily. Start a new branch and cherry-pick the second commit. Manually resolve conflicts to preserve indentation of re-ordered includes. This cleans up the include ordering without changing any other style. Use the following command to run `clang-format`: $ git ls-files -z -- \ '*.c' '*.cc' '*.cpp' '*.cxx' '*.h' '*.hh' '*.hpp' '*.hxx' | egrep -z -v '(Lexer|Parser|ParserHelper)\.' | egrep -z -v '^Source/cm_sha2' | egrep -z -v '^Source/(kwsys|CursesDialog/form)/' | egrep -z -v '^Utilities/(KW|cm).*/' | egrep -z -v '^Tests/Module/GenerateExportHeader' | egrep -z -v '^Tests/RunCMake/CommandLine/cmake_depends/test_UTF-16LE.h' | xargs -0 clang-format -i This selects source files that do not come from a third-party. Inspired-by: Daniel Pfeifer <daniel@pfeifer-mail.de>
* Tests: QtAutogen: Same source name in different directories testSebastian Holtermann2016-04-2219-0/+234
| | | | | | | The test features multiple .cpp and .qrc files with the same name in different subdirectories. This requires AUTOMOC and AUTORCC to generate files with names that respect the path information of the source files.
* Revert "Automoc: Fix support of files with the same name (#12873)"Brad King2016-02-195-27/+1
| | | | | | | | | | This reverts commit 9beb2744d7685fca9cd5717308d4457dffdefcdc. Our AUTOMOC documentation states that it should be possible to `#include "moc_foo.cpp"` in `foo.cpp`, and this will not work if the file is placed in a different directory. Another solution will need to be found to the original problem. Reported-by: Stephen Kelly <steveire@gmail.com>
* Automoc: Fix support of files with the same name (#12873)Mariusz Pluciński2016-02-165-1/+27
|
* cmGlobalGenerator: Initialize generator targets on construction (#15729)Stephen Kelly2015-09-292-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Ninja generator and Visual Studio generators are special-cased for the QtAutogen feature. In order to reduce the number of custom targets, the Visual Studio generators prefer to create custom commands instead, and in order to create appropriate Ninja files, generated rcc files are listed as byproducts. This requires the use of the GetConfigCommonSourceFiles API of the cmGeneratorTarget for those generators when initializing the autogen target. The initializer method is called from Compute() after the cmGeneratorTarget objects are created, however the initialization of the object directory occurs later in the InitGeneratorTargets method. That means that the resulting object locations are computed incorrectly and cached before the object directory is determined, so the generated buildsystem can not find the object files. The initialization of the object directory was split from the creation of cmGeneratorTarget instances in commit 0e0258c8 (cmGlobalGenerator: Split creation of generator object from initialization., 2015-07-25). The motivation for the split was to do only what is essential to do early in cases where cmGeneratorTargets need to be created at configure-time. That is required for the purpose of implementing policies CMP0024 and CMP0026, and for try_compile(LINK_LIBRARIES). However, the split was not really necessary. Compute the object directory in the cmGeneratorTarget constructor instead. The QtAutogen unit test already tests the use of TARGET_OBJECTS with AUTOMOC, and that test already passes on Ninja. The reason it already passes is that the QtAutogen target also uses the AUTORCC feature, and specifies several qrc files in its SOURCES. Later in the Compute algorithm (after the InitGeneratorTargets call), the rcc files are determined and target->AddSource is called. The AddSource call clears the previously mentioned cache of source files, causing it to be regenerated when next queried, this time taking account of the object directory. Extend the test suite with a new target which does not make use of AUTORCC with qrc files so that the test added alone would break without the fix in this commit.
* Merge topic 'qt-autogen-always-run'Brad King2015-06-237-0/+76
|\ | | | | | | | | | | 2bf22a4b QtAutogen: Add comment explaining why rcc cannot use PRE_BUILD 0e346427 QtAutogen: Always run autogen step even when rcc is enabled (#15608)
| * QtAutogen: Always run autogen step even when rcc is enabled (#15608)Brad King2015-06-197-0/+76
| | | | | | | | | | | | | | | | 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.
* | Tests: Don't hang when running Qt5Autogen built with GCC 5 (#15570).Stephen Kelly2015-06-211-2/+2
|/ | | | | | 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.
* QtAutogen: Process 'rcc --list' stdout and stderr separately (#15523)Brad King2015-04-213-0/+15
| | | | | | | | | | The stderr may have warning messages. We should not treat these lines as resource files. However, we must still recognize error message lines for missing resource files that may be generated. Extend the QtAutogen test to cover a generated resource as the only one listed in a .qrc file. This causes 'rcc --list' to print a warning to stderr that we now intend to ignore.
* QtAutogen: Workaround rcc CRCRLF newlines on Windows (#15459)Brad King2015-04-164-3/+3
| | | | | | | | | The 'rcc --list' operation may print newlines of the form CRCRLF, so strip any trailing CR characters found on each line. Update the Tests/QtAutogen test to use a resource named in a subdirectory. This causes 'rcc --list' to display a blank line and tests that it is correctly filtered out.
* Tests/QtAutogen: Avoid touching files in the source treeBrad King2015-04-164-2/+5
|
* Tests/QtAutogen: Help Qt5Autogen test find Qt5 on WindowsBrad King2015-04-161-0/+8
| | | | Set CMAKE_PREFIX_PATH to tell find_package(Qt5) where to look.
* Tests/QtAutogen: Enable per-config source tests when possibleBrad King2015-04-161-3/+2
| | | | | | | | | | | | | | Pass CMAKE_BUILD_TYPE into the test on generators that use it so that the per-config part of the test can activate as needed. Do not make the per-config part conditional on the Debug configuration because the generator expressions evaluate to empty in other configurations. Skip the per-config source case with the Ninja generator because it does not currently work. cmQtAutoGenerators::InitializeAutogenTarget needs to know the list of source files on a target, but generator expressions in the list cannot be evaluated until after CreateGeneratorTargets has been called. That cannot happen until after Autogen targets have been generated. It is a chicken-and-egg problem.
* Tests/QtAutogen: Require CMake 3.1 to set policies everywhereBrad King2015-04-162-2/+2
| | | | | We want CMP0020 set in the autorcc_depends test. Also the test should now only run when we can support per-config source files.
* Merge topic 'fix-autouic-regression'Brad King2015-01-122-0/+9
|\ | | | | | | | | | | 9a673737 QtAutoUic: Add a test for the regression in the parent commit. 7c585699 QtAutoUic: Restore source file AUTOUIC_OPTIONS settings
| * QtAutoUic: Add a test for the regression in the parent commit.Stephen Kelly2015-01-122-0/+9
| |
* | QtAutogen: Regenerate qrc files if their input changes (#15074)Stephen Kelly2014-10-245-0/+67
|/ | | | | | | | | | | | | | | | | Get dependencies from the output of ``rcc --list`` if using Qt 5. Otherwise process the file in the same way as the qt4_add_resources macro. This does not work for RCC files which are generated. The cmake_autogen build step is implemented as a PRE_BUILD step of the target currently if possible, rather than a standalone custom target. This is to keep the number of (synthesized) custom targets that appear in the UI low, but in some cases it is necessary to fall back to a full custom target. Fall back to a full custom target for the VS builds if autorcc is used.
* Merge topic 'autogen-fixes'Brad King2014-09-226-0/+139
|\ | | | | | | | | | | e3c97a19 QtAutogen: Process all ui files in a source file (#14981). b8877b1d QtAutogen: Add source files to target when only AUTORCC is used.
| * QtAutogen: Process all ui files in a source file (#14981).Stephen Kelly2014-09-185-0/+127
| | | | | | | | | | Use a vector to store a list of matched ui_ includes, instead of overwriting the previous match.
| * QtAutogen: Add source files to target when only AUTORCC is used.Stephen Kelly2014-09-172-0/+12
| | | | | | | | Add missing entry to if condition.
* | cmTarget: Make the source files depend on the config.Stephen Kelly2014-04-027-1/+99
|/ | | | | | | | | | | | | | | | | Disallow the use of config-specific source files with the Visual Studio and Xcode generators. They don't have any way to represent the condition currently. Use the same common-config API in cmQtAutoGenerators. While it accepts config-specific files, it doesn't have to support multiple configurations yet. Loop over the configs in cmTargetTraceDependencies and cmGlobalGenerator::WriteSummary and consume all source files. Loop over the configs in cmComputeTargetDepends and compute the object library dependencies for each config.
* QtAutogen: Fix use of multiple ui files in a single target.Stephen Kelly2014-03-254-1/+66
| | | | | | Don't store a mapping of the directory to the ui file. The directory will be a unique key, allowing only one ui file to be specified. Use the source file name instead as the mapping key.
* QtAutogen: Use the basename for resource files.Stephen Kelly2014-03-253-1/+8
| | | | | | | | | | The rcc tool generates a cpp file with a symbol called qInitResources or called qInitResources_${name}, if the name is passed. The qInitResources symbol clashes if multiple qrc files are used in one target. Always pass the name to ensure that the symbol is unique. This is also the behavior of the qtx_add_resource macros.
* QtAutogen: Fix AUTOGEN depends on custom command output with VS.Stephen Kelly2014-03-103-3/+24
| | | | | | | | Visual Studio is handled as a special case for autogen depends. However, the special handling works only for target dependencies, not file dependencies output by a custom command. Use a PRE_BUILD step only if all depends are targets.
* QtAutogen: Only add source files to the target if AUTORCC is ON.Stephen Kelly2014-02-052-1/+12
| | | | | | | | | | | | The qtx_add_resources() macro adds the resource file to the output list to maintain file-level dependencies. Having the qrc file in a target sources is a precondition for AUTORCC to function. When processing the source files of a target, only add the generated qrc_<file>.cpp to the target sources if AUTORCC is ON. This avoids pre-porting conflict with the macro. Reported-by: Micha Hergarden
* QtAutogen: Make uic work even when the source is in a subdir.Stephen Kelly2014-02-044-2/+2
| | | | | | Modify the includedUis to store the path to the file which includes the ui file. Reuse that path to generate the output file from the uic process.
* QtAutogen: Short-circut some logic when moc is not available.Stephen Kelly2014-01-284-0/+71
| | | | | This is the case when AUTOMOC is false. This prevents creating rules to moc the files in the absense of moc.
* Qt Tests: Remove commented and unneeded line.Stephen Kelly2014-01-041-1/+0
|
* cmQtAutogen: Allow specifying depends for autogen targets.Stephen Kelly2013-11-254-1/+49
| | | | | Test this by generating files with a custom target, which moc requires to be present when it is run.
* Merge topic 'fix-automoc-compile-definitions'Brad King2013-11-051-1/+4
| | | | | a1b9465 Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)
* Add automatic rcc invocation for Qt.Stephen Kelly2013-10-245-9/+55
| | | | | This replaces the need to invoke qt4_add_resources by allowing adding the source .qrc file directly to the target sources.
* Add automatic uic invocation for Qt.Stephen Kelly2013-10-244-0/+44
| | | | | | | | | | | | The source files are already processed by cmQtAutomoc to look for moc includes, so extend that to also look for ui_ includes and find corresponding .ui files to process. This replaces the need to invoke qt4_wrap_ui(). As the ui files are not likely to be part of the SOURCES of the target, store the options associated with them separately in the cmMakefile for querying during the autogen run.
* Run the main executable created in the autogen tests.Stephen Kelly2013-10-242-6/+5
| | | | | | | | | | Don't try to show the windows, which would require a gui capable test machine, and that's not guaranteed. Automatically link to qtmain.a on Windows to avoid a policy warning. Set policy CMP0020 to NEW by increasing the required version. Don't attempt to run the test when using Windows.
* Rename the QtAutomoc tests to QtAutogen.Stephen Kelly2013-10-2436-0/+1632