summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* export(): Process the export() command at generate time.Stephen Kelly2013-10-111-0/+56
| | | | | | | | | | | | Make the API for adding targets string based so that it can easily use cmGeneratorTarget. Teach the cmIncludeCommand to generate the exported file at configure-time instead if it is to be include()d. The RunCMake.ExportWithoutLanguage test now needs a dummy header.h file as expected error from export() is now reported after the missing file error.
* Merge topic 'apple-clang-id'Brad King2013-10-091-0/+41
|\ | | | | | | | | | | | | 1763c31 Set policy CMP0025 to NEW while building CMake itself aa53ee5 Add policy CMP0025 for Apple Clang compiler id compatibility ab65862 Clang: Add separate "AppleClang" compiler id
| * Add policy CMP0025 for Apple Clang compiler id compatibilityBrad King2013-10-081-0/+41
| | | | | | | | | | | | | | | | | | | | The parent commit introduced a separate "AppleClang" compiler id for Apple's Clang distribution. Add a policy in order to support projects that expect this compiler's id to be just "Clang". When the policy is OLD or not set, map AppleClang back to Clang. Continue to use the AppleClang id internally while enabling the language, but set the CMAKE_<LANG>_COMPILER_ID after project() or enable_language() to the compatible value for use by project code.
* | Merge topic 'INTERFACE_LIBRARY-target-type'Brad King2013-10-081-0/+4
|\ \ | | | | | | | | | | | | | | | | | | ce0c303 install: Teach EXPORT option to handle INTERFACE_LIBRARY targets 435c912 export: Add support for INTERFACE_LIBRARY targets fe73226 Add the INTERFACE_LIBRARY target type.
| * | Add the INTERFACE_LIBRARY target type.Stephen Kelly2013-10-071-0/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This target type only contains INTERFACE_* properties, so it can be used as a structural node. The target-specific commands enforce that they may only be used with the INTERFACE keyword when used with INTERFACE_LIBRARY targets. The old-style target properties matching LINK_INTERFACE_LIBRARIES_<CONFIG> are always ignored for this target type. The name of the INTERFACE_LIBRARY must match a validity generator expression. The validity is similar to that of an ALIAS target, but with the additional restriction that it may not contain double colons. Double colons will carry the meaning of IMPORTED or ALIAS targets in CMake 2.8.13. An ALIAS target may be created for an INTERFACE library. At this point it can not be exported and does not appear in the buildsystem and project files are not created for them. That may be added as a feature in a later commit. The generators need some changes to handle the INTERFACE_LIBRARY targets returned by cmComputeLinkInterface::GetItems. The Ninja generator does not use that API, so it doesn't require changes related to that.
* | Fix resetting the compiler on the command line (#14366).Stephen Kelly2013-08-191-2/+10
|/ | | | | | | | Convert the incoming value to a path in the same way that the already-cached value was converted before comparison. Do the actual comparison only one time, after both values are normalized.
* Add the ALIAS target concept for libraries and executables.Stephen Kelly2013-08-021-2/+24
| | | | | | | | | | | | | | | | | * The ALIAS name must match a validity regex. * Executables and libraries may be aliased. * An ALIAS acts immutable. It can not be used as the lhs of target_link_libraries or other commands. * An ALIAS can be used with add_custom_command, add_custom_target, and add_test in the same way regular targets can. * The target of an ALIAS can be retrieved with the ALIASED_TARGET target property. * An ALIAS does not appear in the generated buildsystem. It is kept separate from cmMakefile::Targets for that reason. * A target may have multiple aliases. * An ALIAS target may not itself have an alias. * An IMPORTED target may not have an alias. * An ALIAS may not be exported or imported.
* Merge topic 'tid-system-argument'Brad King2013-07-161-0/+11
|\ | | | | | | | | | | | | | | | | | | 9cf3547 Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property. 1925cff Add a SYSTEM parameter to target_include_directories (#14180) 286f227 Extend the cmTargetPropCommandBase interface property handling. 83498d4 Store system include directories in the cmTarget. f1fcbe3 Add Target API to determine if an include is a system include. 2679a34 Remove unused variable.
| * Add the INTERFACE_SYSTEM_INCLUDE_DIRECTORIES target property.Stephen Kelly2013-07-161-0/+11
| | | | | | | | | | | | | | | | Unlike other target properties, this does not have a corresponding non-INTERFACE variant. This allows propagation of system attribute on include directories from link dependents.
* | Merge topic 'compile-defs-debugging'Brad King2013-07-151-3/+10
|\ \ | | | | | | | | | | | | | | | | | | | | | d7dd010 Add target property debugging for COMPILE_DEFINITIONS 1841215 Refactor cmTarget::GetCompileDefinitions to use an out-vector, not a string. afc9243 Add an overload of cmIDEOptions::AddDefines taking a vector of strings. d95651e Overload cmLocalGenerator::AppendDefines to add a list.
| * | Add target property debugging for COMPILE_DEFINITIONSStephen Kelly2013-07-121-3/+10
| |/ | | | | | | | | | | | | Use constructs similar to those for COMPILE_OPTIONS. This is a little different because there is a command to remove_definitions(), so we can't populate the equivalent target property until generate-time in cmGlobalGenerator.
* | cmake: On configure error suggest looking at CMake*.log filesBrad King2013-07-091-3/+19
|/ | | | | | | | | | When CMake reports failure to configure a project, especially when the toolchain does not initialize properly, the true reason may be clear from reading the CMakeFiles/CMake(Output|Error).log files. Advise users to look at these files if they exist when configuration fails. Add RunCMake.Configure test to check that the log files are mentioned when configuration fails.
* Add whitespace after colons in error messages.Stephen Kelly2013-06-211-7/+7
|
* Fix indentation.Stephen Kelly2013-05-291-1/+1
|
* Merge topic 'genex-generate-file'Brad King2013-05-281-0/+51
|\ | | | | | | | | b983a58 file: Add GENERATE command to produce files at generate time
| * file: Add GENERATE command to produce files at generate timeStephen Kelly2013-05-241-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to write to a temp file which contains generator expressions, and at generate time, evaluate the generator expressions, and write the result to a file. Because executables on Windows are limited in the length of command line it is possible to use, it is common to write command line arguments to a file instead and specify the file as a source of arguments. This new FILE(GENERATE) subcommand allows the use of generator expressions to create such files so that they can be used with add_custom_command for example.
* | Merge topic 'doc-improvements'Brad King2013-05-161-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7cc2805 Docs: Clarify wording "flag used" => "flag (to|will) be used" 2378a69 Docs: Clarify that CMAKE_*_(PREFIX|SUFFIX) affect filenames 56ca34d Docs: Update description of CMAKE_(BUILD_TYPE|CONFIGURATION_TYPES) 2bab472 VS10: add detailed comment about MIDL processing e619111 Explain distribution of Win9x binary on all Windows versions. 5ca4336 FindwxWidgets: add DOC strings with usual style f57800d Fix spelling and typos (product names) bf019d7 Fix spelling and typos (non-binary) ddac8d3 Fix spelling and typos (affecting binary data / module messages) 86832ce Fix spelling and typos (affecting users)
| * | Fix spelling and typos (affecting binary data / module messages)Andreas Mohr2013-05-071-1/+1
| |/
* | Add projectDir parameter to GenerateBuildCommandPetr Kmoch2013-04-121-5/+7
|/ | | | | | | | Extend the cmGlobalGenerator::GenerateBuildCommand virtual method signature with a "projectDir" parameter specifying the top of the project build tree for which the build command will be generated. Populate it from call sites in cmGlobalGenerator::Build where a fully-generated build tree should be available.
* Merge topic 'fix-automoc-no-qt'Brad King2013-03-131-2/+4
|\ | | | | | | | | | | a223a3b Automoc: Don't create automoc targets if Qt is not used (#13999) 65b5c1e Merge branch 'property-link-depends-no-crash' into fix-automoc-no-qt
| * Automoc: Don't create automoc targets if Qt is not used (#13999)Stephen Kelly2013-03-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 79568f95 (automoc: Add source file to target early to set the linker language, 2013-02-20) changed automoc initialization to a two step process. In the first step, the generated source file was added to the target, which allows the link language to be determined. However, this bypassed the check for the availability of Qt itself. At build-time the automoc file could not be generated because the moc tool was not available to create it. The solution is to only add the automoc file to the target if Qt is found.
* | Ninja: use MinGW generator code in EnableLanguage()Peter Kümmel2013-03-091-0/+32
|/
* automoc: Add source file to target early to set the linker languageStephen Kelly2013-02-221-1/+9
| | | | | | | | | | | | | | | | | Previously, GetIncludeDirectories was called before calling target->AddSourceFile(mocCppSource). Since commit a1c4905f (Use the link information as a source of compile definitions and includes., 2013-02-12), the include directories are determined by the link information. Valid link information requires that the linker language can be determined, which depends on the source files languages and the dependent targets languages. In the case of the no_link_languages target in the unit test, there are no dependencies and the additional source file no_link_languages_automoc.cpp is added to the target at generate-time. That file can be used to determine the linker language, but it must be added to the target before calling GetIncludeDirectories.
* Merge branch 'master' into generator-toolsetBrad King2013-02-071-1/+3
|\ | | | | | | We need the latest Tests/CMakeLists.txt so we can refactor all tests.
| * Merge topic 'clean-include-dirs-debugging'Brad King2013-01-231-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | 6063fef Output include directories as LOG messages, not warnings. aa66748 Specify the target whose includes are being listed. d70204a Only output includes once after the start of 'generate-time' when debugging. 0d46e9a Store includes from the same include_directories call together.
| | * Only output includes once after the start of 'generate-time' when debugging.Stephen Kelly2013-01-211-0/+1
| | | | | | | | | | | | | | | | | | During configure-time, GetIncludeDirectories may be called too, for example if using the export() command. As the content can be different, it should be output each time then.
| * | Merge topic 'automoc-object'Brad King2013-01-231-1/+2
| |\ \ | | |/ | |/| | | | | | | | | | 0e35cac Automoc: add OBJECT library to QtAutomoc test cf3faac Automoc: Fix automoc for OBJECT libraries.
| | * Automoc: Fix automoc for OBJECT libraries.Yury G. Kudryashov2013-01-151-1/+2
| | | | | | | | | | | | | | | | | | | | | Before this patch, add_library(obj OBJECT helper.cpp) add_executable(tgt $<TARGET_OBJECTS:obj>) didn't run automoc on helper.cpp.
* | | CMake: Add -T option to choose a generator toolsetBrad King2013-02-071-0/+14
|/ / | | | | | | | | | | | | | | | | | | | | | | 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_TOOLSET and associated variable documentation to hold the value persistently. Add a RunCMake.GeneratorToolset test to cover basic "-T" option cases. Verify that CMAKE_GENERATOR_TOOLSET is empty without -T, that -T is rejected when the generator doesn't support it, and that two -T options are always rejected.
* | Make the BUILD_INTERFACE of export()ed targets work.Stephen Kelly2013-01-151-13/+1
|/ | | | | The existing BUILD_INTERFACE code is executed at generate time, which is too late for export().
* Add CMAKE_BUILD_INTERFACE_INCLUDES build-variable.Stephen Kelly2013-01-081-0/+17
| | | | | | | | | | | | | | | | | | | | | | This makes set(CMAKE_BUILD_INTERFACE_INCLUDES ON) add the equivalent of set_property(TARGET tgt APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}> ) to every target. If the headers are in CMAKE_CURRENT_SOURCE_DIR, and the generated headers are in CMAKE_CURRENT_BINARY_DIR, this is a convenient way to build a target bar, which depends on foo, just by using target_link_libraries() and adding the INTERFACE_INCLUDE_DIRECTORIES to the INCLUDE_DIRECTORIES of the target being linked. There will be more-convenient porcelain API to consume the property in the future.
* VS11: Allow using folders with the VS11 Express Edition (#13770)David Cole2012-12-031-1/+1
| | | | | | | | Solution folders are supported as read-only in the VS11 Express Edition, so do not prohibit their use just because we detect the express edition (as we did in the VS10 generator). Inspired-by: Paris
* Merge topic 'generator-factory'Brad King2012-11-201-8/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 75ebebc VS: Remove platform specific generator files 8b62080 VS: Remove EnableLanguage from platform-specific generators 5bdf011 VS: Remove GetPlatformName from platform-specific generators 8d42ab4 VS: Fix ArchitectureId of Visual Studio 10 IA64 generator 6f439b3 VS: Remove AddPlatformDefinitions from platform-specific generators 5170a88 Make cmGlobalGenerator::GetDocumentation() a static function 04ff866 Allow a GeneratorFactory handling of more than one generator 984ebc3 Search generator in cmake::ExtraGenerators before in cmake::Generators 30a6950 Add cmGlobalGeneratorFactory::GetGenerators() e8f8414 Introduce the abstract class cmGlobalGeneratorFactory
| * Make cmGlobalGenerator::GetDocumentation() a static functionPatrick Gansterer2012-11-191-8/+0
| | | | | | | | | | Making the function static allows us to call it directly, without creating and removing an instance of the generator.
* | Merge topic 'fix-IMPORTED-GLOBAL-reconfigure'Brad King2012-11-201-0/+1
|\ \ | |/ |/| | | | | 5ff7587 Initialize IMPORTED GLOBAL targets on reconfigure (#13702)
| * Initialize IMPORTED GLOBAL targets on reconfigure (#13702)Brad King2012-11-191-0/+1
| | | | | | | | | | | | | | | | | | Since commit ca39c5cd (Optionally allow IMPORTED targets to be globally visible, 2012-01-25) cmGlobalGenerator has a second member that tracks targets with global scope. We must initialize the new 'ImportedTargets' member wherever the old 'TotalTargets' member is initialized. Without this initialization the ImportedTargets member is left with dangling pointers during a same-process re-configuration.
* | GenEx: Create cmGeneratorTargets for imported targets.Stephen Kelly2012-10-221-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | We're going to need to link to them, and all the linking API is moving to cmGeneratorTarget. Skip imported targets when iterating over cmGeneratorTargets in places where we only want targets we build. The GetGeneratorTargets result now includes IMPORTED targets where it didn't before. The GetTargets result, which was what used to be called in these methods does not include IMPORTED targets. This doesn't relate to any known bugs, but in some future uses of GetGeneratorTargets it will be important, so starting the convention and being deliberate now is a good idea.
* | GenEx: Fix reporting about not-found include directories and libraries.Stephen Kelly2012-10-171-6/+16
| | | | | | | | | | | | This fixes a regression introduced in commit 290e92ad (Move GetIncludeDirectories to cmGeneratorTarget, 2012-09-16) which loops over cmGeneratorTargets before they get created, so the container is empty.
* | Merge topic 'documentation-cleanup'Brad King2012-10-011-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 4ad0233 Remove period at the end of the check message. 50b1ea5 Fix minor typos. 19c3206 Remove unused parameter marker and the unused parameter. 9d462b2 Document that generator expressions can be used in target properties. daf88c3 Fix punctuation in some variables documentation. 3172cde Fix the layout of the generator expression documentation.
| * | Fix minor typos.Stephen Kelly2012-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | nothe -> note than -> that duplicat -> duplicate directory -> directly Wipe wipe -> Wipe
* | | Merge topic 'AutomocUseTargetProperties' into export-setsAlex Neundorf2012-09-301-10/+33
|\ \ \ | |/ / | | | | | | | | | Conflicts: Source/cmGlobalGenerator.h
| * | Append the COMPILE_DEFINITIONS from the Makefile to all targets.Stephen Kelly2012-09-191-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | This way we don't need to check the definitions from the Makefile when generating later, and can more easily add generator expressions. Duplication is not a problem as the definitions are de-duplicated before generating.
| * | Move GetIncludeDirectories to cmGeneratorTarget.Stephen Kelly2012-09-191-6/+6
| | |
| * | Store cmGeneratorTargets with the makefile.Stephen Kelly2012-09-191-4/+8
| | |
* | | exports: cmGlobalGenerator::ExportSets destructor will clear itYury G. Kudryashov2012-09-281-1/+0
| | |
* | | exports: Add cmExportSetMap classYury G. Kudryashov2012-09-281-29/+0
| | | | | | | | | | | | This is a map<string, cmExportSet *> with overloaded operator[] and destructor.
* | | exports: Create class cmExportSetYury G. Kudryashov2012-09-281-22/+14
| | | | | | | | | | | | | | | Replace direct use of 'std::vector<cmTargetExport const*>' with a dedicated class.
* | | exports: Rename cmGlobalGenerator::AddTargetToExport{s,}Yury G. Kudryashov2012-09-281-1/+1
| | | | | | | | | | | | This function adds target to one export, not to several exports.
* | | exports: Remove cmTargetExport constructorYury G. Kudryashov2012-09-281-12/+4
| | | | | | | | | | | | | | | The constructor was used exactly once. Setting members explicitly makes the code more readable.
* | | exports: Move cmTargetExport to a dedicated header fileYury G. Kudryashov2012-09-281-1/+1
|/ /