summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge topic 'cleanup-build-commands'Brad King2013-11-191-6/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 4cce44b Help: Document the CMAKE_MAKE_PROGRAM variable in more detail 558c74d VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators 5229f2d Tests: Do not use an explicit make program for VS generators 72dd738 Tests: Fix MFC test heuristic for empty CMAKE_TEST_MAKEPROGRAM fd6076d Tests: Pass CMAKE_MAKE_PROGRAM instead of --build-makeprogram 68031ab Tests: Configure SubProject-Stage2 test more robustly 003d10c Tests: Simplify VSExcludeFromDefaultBuild configuration e47d934 Tests: Simplify VSProjectInSubdir configuration e965cb1 Tests: Simplify CTest.BuildCommand.ProjectInSubdir configuration 72bf255 Tests: Pass --build-options to every test 4d1d772 ctest: Teach --build-options to allow zero options 96966b5 ctest: Make the --build-makeprogram optional for --build-and-test 91a0211 Simplify some calls to cmGlobalGenerator::Build 123a060 Teach GenerateBuildCommand to find its own make program 5f5c92b VS: Add internal APIs to find MSBuild, devenv/VCExpress, and msdev 4ac75fd Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548) ...
| * VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generatorsBrad King2013-11-181-1/+1
| | | | | | | | | | | | | | | | Drop the "Modules/CMakeVS*FindMake.cmake" files. Override the cmGlobalGenerator::FindMakeProgram method for VS generators to use their internal APIs to locate the build tool. Set the CMAKE_MAKE_PROGRAM as a normal variable for use by project code, but do not cache it. This will allow CMake and CTest to select the proper tool at build time.
| * Teach GenerateBuildCommand to find its own make programBrad King2013-11-181-0/+2
| | | | | | | | | | | | | | | | Add a cmGlobalGenerator::SelectMakeProgram method to select a caller-provided make program, the CMAKE_MAKE_PROGRAM cache entry, or a generator-provided default. Call it from all implementations of the GenerateBuildCommand method with the corresponding generator's default, if any.
| * cmGlobalGenerator: Cleanup GenerateBuildCommand APIBrad King2013-11-181-5/+5
| | | | | | | | | | | | | | | | | | All cmGlobalGenerator::GenerateBuildCommand call sites that need to produce a string now generate "cmake --build" commands. The remaining call sites immediately pass the result to cmSystemTools::RunSingleCommand. Avoid the intermediate string and argument parsing by directly producing a vector of strings. Also drop the ignoreErrors argument because no call sites remain that use it.
| * cmGlobalGenerator: Add method to compute "cmake --build" command lineBrad King2013-11-141-0/+7
| | | | | | | | | | | | Create a GenerateCMakeBuildCommand method to generate a command-line string invoking "cmake --build" for a given target and configuration. Optionally allow the "-i" make flag and additional native options.
* | CMP0037: Extend policy to reserved names and custom targetsNils Gladitz2013-11-191-0/+2
|/ | | | | | | | Teach add_custom_target to check the policy too. Extend the policy to disallow reserved target names that we use for builtin targets like "all". Extend the RunCMake.CMP0037 test to cover these cases.
* Refactor tool selection for edit_cache (#14544)Brad King2013-11-121-0/+3
| | | | | | | | | Refactor edit_cache tool selection to ask each global generator for its preference. Teach the Ninja generator to always use cmake-gui because Ninja by design cannot run interactive terminal dialogs like ccmake. Teach the Makefile generator to use cmake-gui when also using an "extra" generator whose IDE has no terminal to run ccmake, and otherwise fall back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
* cmGlobalGenerator: Do not propagate const through GetCMakeInstanceBrad King2013-11-121-2/+1
| | | | | Combine the const and non-const GetCMakeInstance to a const one and return a pointer to non-const cmake from it.
* cmGlobalGenerator: Rename the FinalizeCompileDefinitions method.Stephen Kelly2013-11-071-1/+1
| | | | This will soon also finalize include directories.
* Merge topic 'refactor-autogen-setup'Brad King2013-11-061-1/+3
|\ | | | | | | | | | | | | | | 944277d cmAutogen: Gather tool arguments after creating generator targets. d2f4b1e cmAutogen: Rename method to InitializeAutogenTarget 45735f3 cmAutogen: Move autogen target creation to InitializeMocSourceFile. 20a234d cmAutogen: Extract some helper methods for autogen targets.
| * cmAutogen: Gather tool arguments after creating generator targets.Stephen Kelly2013-11-051-1/+3
| | | | | | | | | | | | | | | | This change causes the GetLinkInterfaceDependentStringProperty method, called in SetupAutoGenerateTarget, after the creation of generator targets. In CMake 4.0, the GetLinkInterfaceDependentStringProperty will move to the cmGeneratorTarget class, and this patch is a necessary prerequisite to that.
* | Merge topic 'clear-generator-data'Brad King2013-11-061-1/+2
|\ \ | |/ |/| | | | | 5cf1120 cmGlobalGenerator: Refactor member cleanup between configures
| * cmGlobalGenerator: Refactor member cleanup between configuresBrad King2013-11-051-1/+2
| | | | | | | | | | | | Factor member cleanup out from cmGlobalGenerator::Configure and the destructor into a dedicated helper to avoid duplication. This fixes clearing of BuildExportSets between configures.
* | Merge topic 'fix-automoc-compile-definitions'Brad King2013-11-051-0/+1
|\ \ | |/ |/| | | | | a1b9465 Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)
| * Automoc: Add directory-level COMPILE_DEFINITIONS to command line (#14535)Stephen Kelly2013-11-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 18412153 (Refactor cmTarget::GetCompileDefinitions..., 2013-06-06) cmQtAutomoc was refactored to get all compile definitions from the target instead of separately asking the target and querying the directory-level COMPILE_DEFINITIONS property value. While the generation process does integrate directory-level COMPILE_DEFINITIONS into the target definitions, this did not happen until after Automoc targets are constructed. Therefore the commit regressed use of directory-level definitions in Automoc targets. Factor the definition finalization logic out from the cmGlobalGenerator::CreateGeneratorTargets method into a new cmGlobalGenerator::FinalizeTargetCompileDefinitions method and call it before constructing Automoc targets. This will place the directory-level definitions into the target in time to use them for the Automoc targets. Extend the QtAutomoc test to cover this case.
* | Merge topic 'vs-generator-names'Brad King2013-10-311-0/+4
|\ \ | | | | | | | | | | | | 29071fe VS: Add version year to generator names
| * | VS: Add version year to generator namesBrad King2013-10-281-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the Visual Studio >= 10 generators to indicate the version year: Visual Studio 10 => Visual Studio 10 2010 Visual Studio 11 => Visual Studio 11 2012 Visual Studio 12 => Visual Stduio 12 2013 Report the names with the year to the list of available generators so that the cmake-gui drop-down shows the years. When selecting a generator from the "-G" option or from an existing CMAKE_GENERATOR cache entry, recognize names without the years for compatibility and map them to the names with years. Update the generator names in the cmake-generators.7 manual.
* | | Merge topic 'use-generator-target'Brad King2013-10-301-0/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 638843a Remove the Location member from cmTarget. 90ef1cf Move GenerateTargetManifest to cmGeneratorTarget. 25f1df3 Split CreateGeneratorTargets into two methods.
| * | | Split CreateGeneratorTargets into two methods.Stephen Kelly2013-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | As the generate-time-related API is moving to cmGeneratorTarget, almost all of generation code needs to be able to access instances of it.
* | | | Merge topic 'Qt-auto-generators'Brad King2013-10-281-1/+1
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9c87d9c Add automatic rcc invocation for Qt. 84218e1 Add automatic uic invocation for Qt. 94a0ca6 Record which files are skipped by automoc. 18fb758 Run the main executable created in the autogen tests. e485ba1 Rename the QtAutomoc tests to QtAutogen. 7ce65c3 Add extra checks for the AUTOMOC target property. 32771fc Update output messages for generic use. f371ab5 Rename RunAutomoc to RunAutogen. 85b3d6e Extract an SetupAutoMocTarget method. ca124a1 Rename the AutomocInfo.cmake file to be more generic. a342c9f Move some makefile definitions up away from moc-specific code. 98632ef Add the AUTOGEN_TARGETS_FOLDER and obsolete AUTOMOC_TARGETS_FOLDER. 63378ba Rename some variables to reflect broader scope. 97f1aa3 Rename method to reflect generic use. 4abb111 Rename local variable to reflect generic use. 03878c9 Move variable set to where it is used. ...
| * | | Rename the cmQtAutomoc class to cmQtAutoGenerators.Stephen Kelly2013-10-241-1/+1
| |/ / | | | | | | | | | It will be extended to process .ui and .qrc files too.
* | | Require CMAKE_<LANG>_COMPILER to be found as a full pathBrad King2013-10-281-0/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All generators now support detection of the full path to the compiler, so require it to be so. This will allow CMake<LANG>Information.cmake and other logic to assume the full path to the compiler tool is available. The Makefile generators already rejected CMAKE_<LANG>_COMPILER values that did not name an existing compiler. Extend this error message to all generators, make it occur as early as possible, and improve the message with advice about how to set the compiler. If the full path to the compiler is not known, finish enabling languages with a fatal error so configuration does not continue. For now, allow the RC language compiler to not be a full path. Later we will need to detect the full path to "rc" under the VS IDE. Add a RunCMake.CompilerNotFound test to cover failure cases. Fix the RunCMake.CompilerChange test EmptyCompiler case to work when configuration does not continue past enable_language.
* | export(): Process the export() command at generate time.Stephen Kelly2013-10-111-13/+9
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | CMP0024: Store the fact of included export in global generator.Stephen Kelly2013-10-101-0/+13
| | | | | | | | | | Storing it in the makefile means that the policy does not trigger when include and export are in differing directories.
* | Add policy CMP0025 for Apple Clang compiler id compatibilityBrad King2013-10-081-0/+2
|/ | | | | | | | | | 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.
* Add the ALIAS target concept for libraries and executables.Stephen Kelly2013-08-021-1/+6
| | | | | | | | | | | | | | | | | * 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 'genex-generate-file'Brad King2013-05-281-0/+11
|\ | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Add projectDir parameter to GenerateBuildCommandPetr Kmoch2013-04-121-3/+4
|/ | | | | | | | 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.
* Ninja: use MinGW generator code in EnableLanguage()Peter Kümmel2013-03-091-0/+1
|
* CMake: Add -T option to choose a generator toolsetBrad King2013-02-071-0/+4
| | | | | | | | | | | | 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 cmGlobalGenerator::GetDocumentation() a static functionPatrick Gansterer2012-11-191-3/+0
| | | | | Making the function static allows us to call it directly, without creating and removing an instance of the generator.
* Merge topic 'AutomocUseTargetProperties' into export-setsAlex Neundorf2012-09-301-2/+3
|\ | | | | | | | | Conflicts: Source/cmGlobalGenerator.h
| * Store cmGeneratorTargets with the makefile.Stephen Kelly2012-09-191-2/+2
| |
* | exports: Add cmExportSetMap classYury G. Kudryashov2012-09-281-7/+3
| | | | | | | | This is a map<string, cmExportSet *> with overloaded operator[] and destructor.
* | exports: Create class cmExportSetYury G. Kudryashov2012-09-281-4/+4
| | | | | | | | | | 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-7/+1
| | | | | | | | | | The constructor was used exactly once. Setting members explicitly makes the code more readable.
* | cmGlobalGenerator.h: some minor coding style fixesAlex Neundorf2012-09-281-6/+5
|/ | | | | | | | - this-> was missing - removed unnecessary semicolons - indented unindented lines Alex
* Merge topic 'position-independent-targets'David Cole2012-06-121-0/+3
|\ | | | | | | | | | | | | bd34963 Refactor generation of shared library flags 55d7aa4 Add platform variable for flags specific to shared libraries 31d7a0f Add platform variables for position independent code flags
| * Refactor generation of shared library flagsStephen Kelly2012-06-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CMAKE_SHARED_LIBRARY_<lang>_FLAGS has flags on various platforms for a variety of purposes that are correlated with shared libraries but not exclusive to them. Refactor generation of these flags to use new purpose-specific platform variables CMAKE_<lang>_COMPILE_OPTIONS_DLL CMAKE_<lang>_COMPILE_OPTIONS_PIC CMAKE_<lang>_COMPILE_OPTIONS_PIE Activate the DLL flags specifically for shared libraries. Add a new POSITION_INDEPENDENT_CODE target property to activate PIC/PIE flags, and default to true for shared libraries to preserve default behavior. Initialize the new property from CMAKE_POSITION_INDEPENDENT_CODE to allow easy global configuration in projects. Although the default behavior is unchanged by this refactoring, the new approach ignores CMAKE_SHARED_LIBRARY_<lang>_FLAGS completely. We must leave it set in case projects reference the value. Furthermore, if a project modifies CMAKE_SHARED_LIBRARY_<lang>_FLAGS it expects the new value to be used. Add policy CMP0018 to handle compatibility with projects that modify this platform variable. Add a PositionIndependentCode test on platforms where we can get meaningful results.
* | Move the EscapeJSON method to a sharable location.Stephen Kelly2012-06-041-0/+2
|/
* Factor out custom command .rule file path generationBrad King2012-04-181-0/+3
| | | | | | | Add cmGlobalGenerator::GenerateRuleFile to compute a generator-specific rule file location. This will allow specific generators to override the location of .rule files without changing the behavior of other generators.
* Rename/constify build-time config placeholder lookupBrad King2012-03-091-1/+1
| | | | | | Rename cmGlobalGenerator::GetCMakeCFG{InitDirectory => IntDir} to have a shorter name without a typo. Add a 'const' qualifier since the method is only for lookup and never needs to modify anything.
* Pre-compute object file names before Makefile generationBrad King2012-03-091-0/+1
| | | | | | | Add a virtual cmGlobalGenerator::ComputeTargetObjects method invoked during cmGeneratorTarget construction. Implement it in the Makefile generator to pre-compute all object file names for each target. Use the results during generation instead of re-computing it later.
* Create a cmGeneratorTarget for each cmTarget during generationBrad King2012-03-091-0/+10
| | | | | | | Construct the instances after the final set of targets is known but before computing inter-target dependencies. This order will allow initialization of cmGeneratorTarget instances to adjust and finalize declared inter-target dependencies.
* Optionally allow IMPORTED targets to be globally visibleBrad King2012-01-251-1/+2
| | | | | | | | | | | | Consider the case motivating commit e01cce28 (Allow add_dependencies() on imported targets, 2010-11-19). An imported target references a file generated at build time by a custom target on which it depends. Had the file been built directly using add_library or add_executable its target name would have been visible globally. Therefore the imported target representing the file should be globally visible also. Teach the IMPORTED signature of add_(executable|library) to accept a new "GLOBAL" option to make the imported target visible globally.
* Fix typo.Nicolas Despres2011-10-231-1/+1
|
* Fix line-too-long style violationsBrad King2011-10-101-3/+4
| | | | | | Commit 8a0eb78f (Constify many getters of cmGlobalGenerator, 2011-03-26) added const qualifiers to many cmGlobalGenerator methods but left the resulting lines beyond our style's limit of 79 characters.
* Introduce a cmGlobalGenerator::ResolveLanguageCompiler functionPeter Collingbourne2011-10-021-0/+7
| | | | | | It is factored out of cmGlobalUnixMakefileGenerator3::EnableLanguage, and may be used by other generators to resolve CMAKE_*_COMPILER settings.