summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.h
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Constify many getters of cmGlobalGenerator.Nicolas Despres2011-10-021-16/+16
|
* Add const versions of some getters.Nicolas Despres2011-10-021-0/+1
|
* Move automoc processing from add_executable/library to cmGlobalGeneratorAlex Neundorf2011-08-151-0/+2
| | | | | | | Now automoc is enabled by setting the AUTOMOC target property to true, instead of using the AUTOMOC keyword in add_executable() or add_library() Alex
* RunSingleCommand: Replace verbose boolean with enumJohan Björk2011-07-281-2/+3
| | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* Merge topic 'recursive-CMAKE_USER_MAKE_RULES_OVERRIDE'Brad King2011-01-261-1/+4
|\ | | | | | | | | c83a834 try_compile: Allow only languages loaded in caller (#11469)
| * try_compile: Allow only languages loaded in caller (#11469)Brad King2011-01-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | During a try_compile cmGlobalGenerator::EnableLanguage uses results from the outer project. Reject attempts to enable languages in the test project that are not "ready" in the outer project. Mark a language as "ready" when all its information has been loaded and we are ready to generate build rules. This also avoids infinite recursion introduced by commit 295b5b60 (Honor CMAKE_USER_MAKE_RULES_OVERRIDE in try_compile, 2010-06-29) for projects that set CMAKE_USER_MAKE_RULES_OVERRIDE to a file that uses try_compile. The file is loaded along with the information for a given langauge so the language is not yet "ready".
* | Remove unused GLOBAL_TARGET generation codeBrad King2010-12-131-2/+1
| | | | | | | | | | | | Remove a boolean parameter of cmGlobalGenerator::CreateGlobalTarget that is never set to true anymore. Remove global target "consolidation" loop because no global targets exist before it runs anymore.
* | Merge branch 'vs-target-dependencies' into imported-target-dependenciesBrad King2010-11-191-1/+2
|\ \
| * | Record edge type in global dependency graphBrad King2010-11-181-1/+2
| | | | | | | | | | | | Each inter-target dependency may be a 'link' or 'util' dependency.
* | | Don't disable colors in the CodeBlocks generator and minor cleanup.Alex Neundorf2010-11-111-1/+0
| | | | | | | | | | | | | | | | | | | | | Since now the only users of SetToolSupportsColor() are gone, this method is removed too. Alex
* | | Remove trailing whitespaceAlex Neundorf2010-11-111-22/+22
|/ / | | | | | | Alex
* | Merge topic 'vs-project-groups'Brad King2010-09-081-0/+3
|\ \ | | | | | | | | | | | | e6ac0aa Add FOLDER target property, for IDEs (#3796)
| * | Add FOLDER target property, for IDEs (#3796)David Cole2010-09-031-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This work was started from a patch by Thomas Schiffer. Thanks, Thomas! See the newly added documentation of the FOLDER target property for details. Also added global properties, USE_FOLDERS and PREDEFINED_TARGETS_FOLDER. See new docs here, too. By default, the FOLDER target property is used to organize targets into folders in IDEs that have support for such organization. This commit adds "solution folder" support to the Visual Studio generators. Currently works with versions 7 through 10. Also, use the new FOLDER property in the ExternalProject test and in the CMake project itself.
* | Merge topic 'vs-utility-depends'Brad King2010-08-311-0/+2
|\ \ | | | | | | | | | | | | | | | | | | | | | a99f620 Fix unused parameter warning in VS 7.1 generator 79a88c3 Refactor VS <= 7.1 utility-depends workaround 325bdb2 Factor out duplicate VS target dependency code 6bea843 Factor out global generator ComputeTargetDepends method
| * | Factor out global generator ComputeTargetDepends methodBrad King2010-08-241-0/+2
| |/ | | | | | | | | Put the global dependency analysis in its own method so individual generators can hook into this point.
* | Restore GetTargetDirectDepends const returnBrad King2010-08-251-1/+1
|/ | | | | The returned set should never be modified. Restore 'const' correctness unnecessarily removed by commit 6903d2df (remove const, 2008-01-30).
* Fix rule hash persistence file generationBrad King2010-02-121-0/+2
| | | | | | | | | | | | | | | | | | | | | We store custom command rule hashes in CMakeFiles/CMakeRuleHashes.txt persistently across CMake runs. When the rule hash changes we delete the custom command output file and write a new hash into the persistence file. This functionality was first added by the commit 'Introduce "rule hashes" to help rebuild files when rules change.' (2008-06-02). However, the implementation in cmGlobalGenerator::CheckRuleHashes kept the file open for read when attempting to rewrite a new file. On Windows filesystems this prevented the new version of the file from being written! This caused the first set of rule hashes to be used forever within a build tree, meaning that all custom commands whose rules changed would be rebuilt every time CMake regenerated the build tree. In this commit we address the problem by splitting the read and write operations into separate methods. This ensures that the input stream is closed before the output stream opens the file.
* Fix issue #2336 - honor the -C arg to ctest. Honor it for all stages of ↵David Cole2009-12-041-0/+4
| | | | running -D dashboards from the command line and running ctest_configure, ctest_build and ctest_test commands in -S scripts. Also, allow a script to change it by setting the CTEST_CONFIGURATION_TYPE variable: allows for multiple configuration build/test cycles within one script. Add a new signature for the cmake command build_command that accepts CONFIGURATION as one argument. The original build_command signature is still there, but now marked as deprecated in the documentation. Of course... also add CTestConfig tests to verify that -C is honored for -D dashboards and -S scripts.
* Avoid non-root copies of root-only targetsBrad King2009-10-061-0/+1
| | | | | | | | | | | | | | In cmGlobalGenerator::GetTargetSets we collect targets from all local generators in a tree or subtree corresponding to a project() command. Some targets, such as ALL_BUILD, are duplicated in each subdirectory with a project() command. For such targets we should keep only the copy for the top-most (root) local generator. Previously this filtering was done in each VS IDE generator, but it is easier to do it in one place when the targets are first encountered. This also fixes bad ALL_BUILD dependencies generated for VS 7.0 because the cmGlobalVisualStudio7Generator::WriteTargetDepends method was not filtering out duplicates. Now we avoid duplicates from the start.
* Cleanup cmGlobalGenerator::GetTargetSets methodBrad King2009-10-011-7/+5
| | | | | | This commit cleans up the declaration, definition, and invocations of the GetTargetSets method and related code. There is no change in function except to make the method virtual.
* Convert CMake to OSI-approved BSD LicenseBrad King2009-09-281-14/+9
| | | | | | | This converts the CMake license to a pure 3-clause OSI-approved BSD License. We drop the previous license clause requiring modified versions to be plainly marked. We also update the CMake copyright to cover the full development time range.
* No /fast targets in try_compile project modeBrad King2009-08-041-1/+1
| | | | | | | | The try_compile command builds the cmTryCompileExec executable using the cmTryCompileExec/fast target with Makefile generators in order to save time since dependencies are not needed. However, in project mode the command builds an entire source tree that may have dependencies. Therefore we can use the /fast target approach only in one-source mode.
* Fix recursive try_compile callsBrad King2009-08-031-1/+1
| | | | | | | | When building an entire source tree with try_compile instead of just a single source file, it is possible that the CMakeLists.txt file in the try-compiled project invokes try_compile. This commit fixes propagation of language-initialization results from the outer-most project into any number of try-compile levels.
* ENH: make sure GUIDs for filters are cachedBill Hoffman2009-07-171-1/+3
|
* BUG: Fix Xcode linker languageBrad King2009-07-101-3/+3
| | | | | | | | | | Xcode does not seem to support direct requests for using the linker for a particular language. It always infers the linker using the languages in the source files. When no user source files compile with target's linker language we add one to help Xcode pick the linker. A typical use case is when a C executable links to a C++ archive. The executable has no C++ source files but we need to use the C++ linker.
* ENH: Generate a central list of target directoriesBrad King2009-03-091-2/+2
| | | | | | | | This generalizes the previous CMakeFiles/LabelFiles.txt created at the top of the build tree to a CMakeFiles/TargetDirectories.txt file. It lists the target support directories for all targets in the project. Labels can still be loaded by looking for Labels.txt files in each target directory.