summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
Commit message (Collapse)AuthorAgeFilesLines
* cmLocalGenerator: Require a global generator in the constructor.Stephen Kelly2015-05-141-3/+1
| | | | Port generator factory methods to pass it.
* cmLocalGenerator: Require a parent in the constructor.Stephen Kelly2015-04-281-2/+3
| | | | | | | Pass the parent though cmGlobalGenerator::CreateLocalGenerator. This will make it easy to initialize state scopes independent of cmMakefile.
* Merge topic 'clean-up-cmMakefile'Brad King2015-04-211-17/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8dc3a67c cmMakefile: Out-of-line the directory methods. 0f3c8cfa cmMakefile: Use method abstraction to access directories. b288a997 cmMakefile: Rename SetStart* directory API to SetCurrent*. 932d53bc cmMakefile: Remove redundant method duplication. 32b8f03a cmMakefile: Port users of GetStart* methods to new names. 54d6a918 cmMakefile: Rename GetCurrent{Output,Binary}Directory. 55d80d0a cmMakefile: Rename GetCurrent{,Source}Directory. b23cf06f cmake: Remove redundant start directories. fcf246ac cmMakefile: Populate Home directories on initialize. 8878bea7 cmake: Initialize Home directories on cmake for find-package mode. 044dc815 Use the Home directories from the cmake class where intended. d67e8f24 cmake: Fix directory used to find the cache 1ea085d1 cmMakefile: Initialize dir definitions early. f034bb2f Remove redundant calls to MakeStartDirectoriesCurrent. 3a68c323 cmMakefile: Fix wrong parameter names.
| * cmMakefile: Port users of GetStart* methods to new names.Stephen Kelly2015-04-201-4/+4
| |
| * cmMakefile: Rename GetCurrent{Output,Binary}Directory.Stephen Kelly2015-04-201-11/+11
| | | | | | | | Match names used in CMake code.
| * cmMakefile: Rename GetCurrent{,Source}Directory.Stephen Kelly2015-04-201-2/+2
| | | | | | | | Match the names used in cmake code.
* | cmSystemTools: Teach RunSingleCommand to separate stdout and stderrBrad King2015-04-201-2/+2
|/ | | | | | | Extend the RunSingleCommand signature to capture stdout and stderr separately. Allow both to be captured to the same std::string to preserve existing behavior. Update all call sites to do this so that this refactoring does not introduce functional changes.
* Merge topic 'stable-xcode-projects'Brad King2015-04-201-2/+19
|\ | | | | | | | | | | | | | | | | | | | | | | | | 6693590f Xcode: Refine quoting rules for Strings a6331eb8 Xcode: Let PrintComment decide if the comment is non-empty 6e8952c1 Xcode: PrintComment will prepend a whitespace itself before the comment 4bd2544b Xcode: Do not add whitespace after attribute group opening brace 5cb4c838 Xcode: Properly indent PBXFileReference and PBXBuildFile a723427b Xcode: Remove extra space in PBXProject comment 2fe8bca5 Xcode: Add comment after root object 2e0e205e Xcode: Indent using tabs 7b68c8df Xcode: Sort Xcode objects by Id
| * Xcode: Remove extra space in PBXProject commentGregor Jasny2015-04-171-1/+1
| |
| * Xcode: Add comment after root objectGregor Jasny2015-04-171-1/+2
| |
| * Xcode: Sort Xcode objects by IdGregor Jasny2015-04-171-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this patch series aims to minimize deltas between the CMake Xcode generator and Xcode itself. It was started by the observation that if one makes any change to the project within Xcode (e.g. to see how a variable is called internally) the user cannot diff the CMake project and the one stored by Xcode afterwards. Xcode keeps the objects ordered by the object id. Because cmake stores them into an unordered container at creation time they must be sorted before writing the pbxproj file. I tested this series with Xcode 6.3 and Xcode 3.2. Both show a reduced diff after this series was applied.
* | cmState: Move CacheEntryType enum from cmCacheManager.Stephen Kelly2015-04-131-2/+2
|/
* Add API for cache loading, deleting and saving to the cmake class.Stephen Kelly2015-04-071-1/+1
| | | | | Migrate existing users of the CacheManager API to use the new API. The CacheManager will be going away soon.
* Revert topic 'refactor-cache-api'Brad King2015-04-071-1/+1
| | | | | | This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic.
* Add API for cache loading, deleting and saving to the cmake class.Stephen Kelly2015-04-061-1/+1
| | | | | Migrate existing users of the CacheManager API to use the new API. The CacheManager will be going away soon.
* Xcode: Add file type for Metal shader filesSean James2015-04-011-0/+4
|
* Xcode: Set ARCHS only when CMAKE_OSX_ARCHITECTURES is specified (#14736)Brad King2015-03-271-31/+20
| | | | | | Teach the Xcode generator that ONLY_ACTIVE_ARCH=YES means to use ARCHS, and that the default of ONLY_ACTIVE_ARCH=NO means to use NATIVE_ARCH and ignore ARCHS. In the latter case there is no reason to generate ARCHS.
* cmGlobalXCodeGenerator: Simplify ARCHS list with cmJoinBrad King2015-03-271-10/+2
|
* OS X: Add handling for XCTest bundlesGregor Jasny2015-03-231-2/+10
| | | | | | | | | | An XCTest bundle is a CFBundle with a special product-type and bundle extension. For more information about XCTest visit the Mac Developer library at: http://developer.apple.com/library/mac/documentation/DeveloperTools/Conceptual/testing_with_xcode/ Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Genex: Allow COMPILE_LANGUAGE when processing compile definitions.Stephen Kelly2015-03-091-1/+1
| | | | Issue an error if this is encountered by an IDE generator.
* cmake: Teach --build to honor CMAKE_VERBOSE_MAKEFILE for NinjaGregor Jasny2015-02-261-1/+1
| | | | | | | | | The Ninja build system does not support a in-file verbositiy switch. Instead teach 'cmake --build' to extract the CMAKE_VERBOSE_MAKEFILE setting and pass it as an optional '-v' argument to Ninja. This can serve as a reasonable fallback. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* Xcode: Teach XCODE_ATTRIBUTE target properties about generator expressionsGregor Jasny2015-02-121-1/+4
| | | | Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* cmGlobalXCodeGenerator: Rename variable 'lang' => 'llang'Brad King2015-02-061-7/+7
| | | | | In CreateBuildSettings the variable holds the linker language. Use a more distinctive variable name.
* Xcode: Generate Intel Fortran compiler flags in project filesBrad King2015-02-061-0/+5
|
* Xcode: Refactor generation of per-language compiler flagsBrad King2015-02-061-71/+69
|
* Xcode: Switch to internal CMAKE_MAKE_PROGRAM lookup by generator (#15324)Brad King2015-01-291-1/+13
| | | | | | | | | | | | The "cmakexbuild" wrapper is not needed for Xcode 4 and above, and the path to it may change when CMake moves. Avoid storing a specific path to a build program in CMakeCache.txt and instead compute the value for CMAKE_MAKE_PROGRAM on demand. However, if a user does set the value explicitly then honor it. This does for Xcode what commit v3.0.0-rc1~260^2~4 (VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators, 2013-11-15) did for Visual Studio generators.
* Xcode: Select make program at build timeBrad King2015-01-281-1/+1
| | | | | | | Extend the change made in commit v3.0.0-rc1~260^2~16 (Teach GenerateBuildCommand to find its own make program, 2013-11-13) to have the Xcode generator pick between "xcodebuild" and CMake's own copy of "cmakexbuild" at build time based on the version of Xcode.
* Xcode: Add internal API to find xcodebuildBrad King2015-01-281-0/+31
| | | | | | | | Teach the Xcode generator to compute the location of this tool or the cmakexbuild wrapper. Add internal APIs to get the locations on demand. Use the "cmakexbuild" wrapper for Xcode < 4, and "xcodebuild" for modern Xcode.
* Merge topic 'xcode-target-sort'Brad King2015-01-201-11/+51
|\ | | | | | | | | | | 9e0176e2 Xcode: Sort targets deterministically and with ALL_BUILD first (#15346) c0ff542c Xcode: Fix early termination on per-config source file error
| * Xcode: Sort targets deterministically and with ALL_BUILD first (#15346)Ben Boeckel2015-01-191-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | The default target in XCode is the first one in the file. In commit v3.1.0-rc1~286^2 (cmTarget: use a hash_map for cmTargets typedef, 2014-06-10) the order of the targets stored in cmMakefile was made non-deterministic instead of lexicographic. Teach the Xcode generator to do its own sorting to restore a predictable order. While at it, place ALL_BUILD first (as is done in VS IDE generators) explicitly in the comparison function so that it is the default target even if other targets sort earlier lexicographically (e.g. "AAA").
| * Xcode: Fix early termination on per-config source file errorBrad King2015-01-191-10/+26
| | | | | | | | | | | | | | | | | | In commit v3.1.0-rc1~687^2~4 (cmTarget: Make the source files depend on the config, 2014-02-13) an early termination case was added to the Xcode generator. Fix handling of this case to actually abort all the generation steps. Otherwise some of the later steps are attempted without the preconditions normally established by earlier steps, possibly leading to a crash.
* | Port all cmOStringStream to std::ostringstream.Stephen Kelly2015-01-111-4/+4
| | | | | | | | All compilers hosting CMake support the std class.
* | Xcode: Call IsCFBundleOnApple to decide if bundle is being builtGregor Jasny2014-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | Narrow down the decision if a CFBundle is built to one place. This is a preparation patch to add another target property which, if set, will imply BUNDLE. Having only one function which will have to look at both properties helps to keep code clean. Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
* | Xcode: Fix rebuild with multiple custom command outputs (#15116)Brad King2014-12-051-50/+11
| | | | | | | | | | | | | | | | The Xcode generator uses Makefiles under a run-script build-phase to drive custom commands. Fix the generated makefiles for custom commands with multiple outputs to list all the outputs on the left hand side of the build rule. This is much simpler and more reliable than the old multiple-output-pair infrastructure.
* | Xcode: use a map to look up target pointers (#15201)Ben Boeckel2014-12-021-8/+9
| | | | | | | | | | Use an efficient internal lookup to associate cmTarget and cmXCodeObject instances.
* | Add an option for explicit BYPRODUCTS of custom commands (#14963)Brad King2014-11-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A common idiom in CMake-based build systems is to have custom commands that generate files not listed explicitly as outputs so that these files do not have to be newer than the inputs. The file modification times of such "byproducts" are updated only when their content changes. Then other build rules can depend on the byproducts explicitly so that their dependents rebuild when the content of the original byproducts really does change. This "undeclared byproduct" approach is necessary for Makefile, VS, and Xcode build tools because if a byproduct were listed as an output of a rule then the rule would always rerun when the input is newer than the byproduct but the byproduct may never be updated. Ninja solves this problem by offering a 'restat' feature to check whether an output was really modified after running a rule and tracking the fact that it is up to date separately from its timestamp. However, Ninja also stats all dependencies up front and will only restat files that are listed as outputs of rules with the 'restat' option enabled. Therefore an undeclared byproduct that does not exist at the start of the build will be considered missing and the build will fail even if other dependencies would cause the byproduct to be available before its dependents build. CMake works around this limitation by adding 'phony' build rules for custom command dependencies in the build tree that do not have any explicit specification of what produces them. This is not optimal because it prevents Ninja from reporting an error when an input to a rule really is missing. A better approach is to allow projects to explicitly specify the byproducts of their custom commands so that no phony rules are needed for them. In order to work with the non-Ninja generators, the byproducts must be known separately from the outputs. Add a new "BYPRODUCTS" option to the add_custom_command and add_custom_target commands to specify byproducts explicitly. Teach the Ninja generator to specify byproducts as outputs of the custom commands. In the case of POST_BUILD, PRE_LINK, and PRE_BUILD events on targets that link, the byproducts must be specified as outputs of the link rule that runs the commands. Activate 'restat' for such rules so that Ninja knows it needs to check the byproducts, but not for link rules that have no byproducts.
* | Xcode: Inherit global settings in per-target WARNING_CFLAGS (#15224)Brad King2014-10-311-0/+1
|/ | | | | Allow projects to use CMAKE_CODE_ATTRIBUTE_WARNING_CFLAGS to add their own warning flags and have them used by the targets.
* cmGlobalGenerator: Call SetGeneratorToolset even for empty toolsetBrad King2014-09-051-2/+5
| | | | | | Move handling of an empty toolset name into the implementation of the method. This simplifies the VS 10 implementation of default toolset selection because it has one code path that is always called.
* Merge topic 'xcode-duplicate-file-refs'Brad King2014-09-041-6/+4
|\ | | | | | | | | | | | | d73f8828 Merge branch 'backport-xcode-duplicate-file-refs' into xcode-duplicate-file-refs cf92fe2d Xcode: Generate per-target file references (#15111) e7114226 Xcode: Generate per-target file references (#15111)
| * Xcode: Generate per-target file references (#15111)Brad King2014-09-031-6/+4
| | | | | | | | | | | | | | Xcode requires a separate PBXFileReference for each target source group that references a source file. Xcode 6 now diagnoses re-use of the same PBXFileReference from multiple source groups. Add the referencing target name to our internal map key so we use a per-target reference.
* | Xcode: Reference '.xcassets' folders as assetcatalog (#15125)Brad King2014-09-031-1/+1
| |
* | Xcode: Refactor internal file type extension extractionBrad King2014-09-031-7/+7
|/ | | | Move it earlier so it can be used for directories too.
* Merge topic 'xcode-6-librarian-flags'Brad King2014-07-291-5/+23
|\ | | | | | | | | 608cf814 Xcode: Fix static library creation for Xcode 6 (#15038)
| * Xcode: Fix static library creation for Xcode 6 (#15038)Brad King2014-07-281-5/+23
| | | | | | | | | | | | | | | | | | Xcode 6 introduced an 'OTHER_LIBTOOLFLAGS' setting for the "Other Librarian Flags" of a static library. Now 'OTHER_LDFLAGS' are ignored. Teach the Xcode generator to choose the correct name for the build setting based on the type of target and the version of Xcode. Inspired-by: Jamie Kirkpatrick <jkp@spotify.com>
* | cmTarget: Remove 'head' argument from GetLinkImplementationBrad King2014-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Many of the 'head' arguments added by commit v2.8.11~289^2~1 (Make linking APIs aware of 'head' target, 2013-01-04) turned out not to be needed. The "link implementation" of a target never needs to be computed with anything but itself as the 'head' target (except for CMP0022 OLD behavior because then it is the link interface). Remove the unused 'head' target paths. Add "internal" versions of cmTarget::GetDirectLinkLibraries and GetLinkImplementationLibraries to support the CMP0022 OLD behavior without otherwise exposing the 'head' target option of these methods.
* | Merge topic 'xcode-15-string-apis'Brad King2014-06-061-13/+5
|\ \ | | | | | | | | | | | | 23dc6aa1 Xcode: Fix single-configuration generation for version 1.5
| * | Xcode: Fix single-configuration generation for version 1.5Brad King2014-06-051-13/+5
| | | | | | | | | | | | | | | | | | | | | | | | In commit 84fdc992 (stringapi: Pass configuration names as strings, 2014-02-09) a few code paths for the Xcode 1.5 single-configuration generator were not updated to use an empty configuration name instead of a NULL pointer when no configuration is specified in CMAKE_BUILD_TYPE. Fix them now.
* | | Allow a toolchain file to specify a generator toolsetBrad King2014-06-041-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Delay use of CMAKE_GENERATOR_TOOLSET until the CMakeSystem.cmake file has been configured and loaded during the first project() or enable_language() command. This gives the toolchain file named by CMAKE_TOOLCHAIN_FILE a chance to set CMAKE_GENERATOR_TOOLSET. This point is still early enough to set the generator toolset prior to the initialization of any languages that might use the toolset. The cmake::GeneratorToolset member variable remains an indication of what was specified by the -T option or loaded from the cache. It does not need to be updated based on the toolchain file setting. The cmMakefile::TryCompile can still pass cmake::GeneratorToolset into the inner instance because the try-compiled project will do platform and language initialization using the CMakeSystem module configured for the outer project. Extend the RunCMake.GeneratorToolset test with cases that use a toolchain file to set CMAKE_GENERATOR_TOOLSET.
* | | Xcode: Rename internal variable {Platform => Generator}ToolsetBrad King2014-06-041-5/+5
|/ / | | | | | | The latter matches with CMAKE_GENERATOR_TOOLSET better.
* | Xcode: Add source file property to control file type (#14854)Brad King2014-05-151-6/+21
| | | | | | | | | | | | | | | | | | Add source file properties to control Xcode file type attributes: XCODE_EXPLICIT_FILE_TYPE => explicitFileType XCODE_LAST_KNOWN_FILE_TYPE => lastKnownFileType Add a RunCMake.XcodeProject test to verify generated project content.