summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* 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
|/ /
* | Make platform information files specific to the CMake versionBrad King2012-08-241-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the top of a build tree we configure inside the CMakeFiles directory files such as "CMakeSystem.cmake" and "CMake<lang>Compiler.cmake" to save information detected about the system and compilers in use. The method of detection and the exact results store varies across CMake versions as things improve. This leads to problems when loading files configured by a different version of CMake. Previously we ignored such existing files only if the major.minor part of the CMake version component changed, and depended on the CMakeCache.txt to tell us the last version of CMake that wrote the files. This led to problems if the user deletes the CMakeCache.txt or we add required information to the files in a patch-level release of CMake (still a "feature point" release by modern CMake versioning convention). Ensure that we always have version-consistent platform information files by storing them in a subdirectory named with the CMake version. Every version of CMake will do its own system and compiler identification checks even when a build tree has already been configured by another version of CMake. Stored results will not clobber those from other versions of CMake which may be run again on the same tree in the future. Loaded results will match what the system and language modules expect. Rename the undocumented variable CMAKE_PLATFORM_ROOT_BIN to CMAKE_PLATFORM_INFO_DIR to clarify its purpose. The new variable points at the version-specific directory while the old variable did not.
* | Cleanly enable a language in multiple subdirectoriesBrad King2012-08-221-11/+13
| | | | | | | | | | | | | | When a language is not enabled at the top level of a project but is enabled in multiple disjoint subdirectories we should re-use the CMake<lang>Compiler.cmake file from the first directory. Load the file whenever it exists and is not left from a different version of CMake.
* | Merge topic 'position-independent-targets'David Cole2012-06-121-0/+21
|\ \ | | | | | | | | | | | | | | | | | | 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/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+13
|/ /
* | Factor out custom command .rule file path generationBrad King2012-04-181-0/+15
| | | | | | | | | | | | | | 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-1/+9
| | | | | | | | | | | | | | 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/+47
| | | | | | | | | | | | | | 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.
* | Extract and use the INCLUDE_DIRECTORIES target properties.Stephen Kelly2012-02-221-19/+20
|/ | | | | | | | | Eliminate callers of cmMakefile::GetIncludeDirectories. All callers of GetIncludeDirectories should go through the local generator object. Only the local generator calls cmTarget::GetIncludeDirectories directly.
* Optionally allow IMPORTED targets to be globally visibleBrad King2012-01-251-3/+14
| | | | | | | | | | | | 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.
* Introduce a cmGlobalGenerator::ResolveLanguageCompiler functionPeter Collingbourne2011-10-021-0/+73
| | | | | | It is factored out of cmGlobalUnixMakefileGenerator3::EnableLanguage, and may be used by other generators to resolve CMAKE_*_COMPILER settings.
* Merge topic 'UsingCMakeLikePkgConfig2'David Cole2011-08-251-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 59238dc Fix --find-package mode on Cygwin, where enable_language(RC) is called 98472e4 Require the current cmake version in --find-package mode a6ccf3c Use $(CXXFLAGS) and $(LDFLAGS) in the --find-package test Makefile 4386918 Fix line length 7d69310 Only enable the test when using GNU make 3011149 Make the test harder by always having a space in the include dirs ab57ff6 Make the --find-package test harder 626fc71 Much improved test, should now be executed on all UNIXes ec6982d Disable any STATUS output in --find-package mode e552ae7 Dont check for -isysroot and -mmacosx-version on OSX in --find-package mode e589589 Rename helper macros print_compile_flags() to set_compile_flags_var() aecfc1f Fix test on OpenBSD with BSD make 6bb4ca3 The makefile for the test was kindof wrong fd15b5e Only run the test if we are using a makefile generator under UNIX 9fc87c6 Add a test for the new --find-package mode d3ae0ff Improve documentation for --find-package mode bf07375 Add a cmake.m4 for using cmake in autoconf projects instead of pkgconfig b0e3578 Use the file-utility to test for 64bit if there is no /usr/lib64 53edfb2 Better support for lib64 and Debian multiarch b8fdaa1 Fix copyright notice in new CMakeFindPackageMode.cmake 7690edf Replace cmake::GetScriptMode() with GetWorkingMode() e4f603b Implement find-package mode of cmake a91d662 Add find-package mode, which does nothing yet b976e70 Make clLocalGenerator::GetTargetFlags() public
| * Replace cmake::GetScriptMode() with GetWorkingMode()Alex Neundorf2011-08-091-1/+1
| | | | | | | | | | | | | | GetWorkingMode() returns a new enum WorkingMode, which is one of NORMAL_MODE, SCRIPT_MODE and FIND_PACKAGE_MODE. Alex
* | Fix bootstrap test with automocAlex Neundorf2011-08-171-0/+2
| | | | | | | | Alex
* | Move automoc processing from add_executable/library to cmGlobalGeneratorAlex Neundorf2011-08-151-0/+32
| | | | | | | | | | | | | | 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
* | Remove trailing whitespaceAlex Neundorf2011-08-151-14/+14
| | | | | | | | Alex
* | RunSingleCommand: Replace verbose boolean with enumJohan Björk2011-07-281-3/+3
|/ | | | | No behaviour change, this prepares for adding a flag to skip the merging of output streams.
* Refine unused cache variable warningBrad King2011-03-241-2/+0
| | | | | List all unused variables in one warning. Cleanup implementation to run the check exactly once at the end of generation.