Commit Graph

83 Commits

Author SHA1 Message Date
Brad King b6385cabec Escape target flags taken from COMPILE_OPTIONS
Factor appending of individual flags out into an AppendFlagEscape method
in cmLocalGenerator and teach it to use EscapeForShell.  Update all
COMPILE_OPTIONS handling to use AppendFlagEscape.

Override the method in the Xcode generator to use its custom escape
implementation.

Teach the CompileOptions test to add an option that requires escaping
everywhere instead of just with the GNU tools.
2013-06-27 12:57:32 -04:00
Petr Kmoch de8be9ef7d Add projectDir parameter to GenerateBuildCommand
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.
2013-04-12 11:35:35 -04:00
Brad King f980a80495 Xcode: Implement generator toolset selection (#9831, #13802)
Implement generator toolset selection (cmake -T) for Xcode > 2.0 by
adding the GCC_VERSION build setting to project files.
2013-02-07 11:07:48 -05:00
Patrick Gansterer 5170a8800f Make cmGlobalGenerator::GetDocumentation() a static function
Making the function static allows us to call it directly,
without creating and removing an instance of the generator.
2012-11-19 12:54:50 -05:00
Patrick Gansterer e8f841473b Introduce the abstract class cmGlobalGeneratorFactory
This new abstract class allows us move some logic from the
cmGlobalGenerator into its own layer in a next step.
2012-11-19 12:54:30 -05:00
Kitware Robot 7bbaa4283d Remove trailing whitespace from most CMake and C/C++ code
Our Git commit hooks disallow modification or addition of lines with
trailing whitespace.  Wipe out all remnants of trailing whitespace
everywhere except third-party code.

Run the following shell code:

git ls-files -z -- \
 bootstrap doxygen.config '*.readme' \
 '*.c' '*.cmake' '*.cpp' '*.cxx' \
 '*.el' '*.f' '*.f90' '*.h' '*.in' '*.in.l' '*.java' \
 '*.mm' '*.pike' '*.py' '*.txt' '*.vim' |
egrep -z -v '^(Utilities/cm|Source/(kwsys|CursesDialog/form)/)' |
egrep -z -v '^(Modules/CPack\..*\.in)' |
xargs -0 sed -i 's/ \+$//'
2012-08-13 14:18:39 -04:00
David Cole 8045e17119 Pre-compute object file names before Xcode generation 2012-03-19 11:52:40 -04:00
David Cole be01f3b098 Xcode: Re-factor some existing methods into "FromPath" variants
...to avoid depending on cmSourceFile instances. Prep work for supporting
OBJECT_LIBRARY in the Xcode generator.
2012-03-16 14:23:13 -04:00
David Cole 34e4985eed Xcode: Re-factor code into GetObjectsNormalDirectory method
...in preparation for calling it from more than one location.
Required to support OBJECT_LIBRARY targets in Xcode.
2012-03-16 10:05:46 -04:00
Brad King 9c0a00d6dd Rename/constify build-time config placeholder lookup
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.
2012-03-09 15:16:03 -05:00
Brad King 4ae7f3656b Remove unused partial OBJECT_FILES property implementation
Remove partial implementation added by commit ca0230a3 (check in initial
conv library stuff, 2007-02-16) since it was never finished.  It does
not make sense for multi-configuration generators since no specific
build configuration is processed at CMake time.
2012-03-06 13:20:17 -05:00
Brad King 029ab3102e Constify XCode generator getters to match cmGlobalGenerator
Commit 8a0eb78f (Constify many getters of cmGlobalGenerator, 2011-03-26)
added const qualifiers to many cmGlobalGenerator methods.  Fix the
signature of the virtual function overrides in cmGlobalXCodeGenerator to
match.
2011-10-07 08:22:05 -04:00
David Cole 1834f232a7 Xcode: Save object id values in CMakeCache.txt (#11690)
For project and target objects, save their ids in CMakeCache.txt.

Hopefully, that will be enough to allow user settings to be saved
across multiple CMake generate operations. Other object types may
also need their ids saved: if so, more code than this commit
will be necessary...
2011-08-24 18:11:32 -04:00
Brad King 98dc13e513 Merge topic 'xcode-source_groups-folders-issue-10039'
f09ba0f Fix style errors added by parent and grandparent
eeeeca1 XCode: Support target folders on XCode.
59ed84e Xcode: Support multiple level nesting of XCode folders (#10039)
d0a403f CMake: Move tokenize to cmSystemTools
2011-06-08 15:44:44 -04:00
Johan Björk 59ed84e032 Xcode: Support multiple level nesting of XCode folders (#10039) 2011-06-07 10:21:49 -04:00
Brad King 44cdae921d Xcode: Fix parallel build depends with universal binaries (#11844)
A post-build phase of each target invokes the XCODE_DEPEND_HELPER.make
file to erase any targets that link to it.  Narrow the set of targets
tested by each post-build phase to those that depend on the newly
completed target.  This avoids removing files from partially built
unrelated targets that happen to be building in parallel.
2011-06-06 17:44:11 -04:00
Brad King 809ef3086d Xcode: Make generation depend on all input directories
Previously the Xcode generator would rerun CMake only if input file
dependencies in the top-level directory changed.  Teach it to depend on
input files from all directories.  Other generators already do this.

Reported-by: Johan Björk <phb@spotify.com>
2011-01-13 12:07:23 -05:00
David Cole 0b38bb4c53 Fix issue #2336 - honor the -C arg to ctest. Honor it for all stages of 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. 2009-12-04 12:09:01 -05:00
Brad King 96afb12087 Convert CMake to OSI-approved BSD License
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.
2009-09-28 11:43:28 -04:00
Brad King e55bbab88b Teach Xcode generator to set XCODE_VERSION
We set the variable 'XCODE_VERSION' in the CMake language to the Xcode
version string (e.g. "3.1.2").  Platform config files may use it later.
2009-09-23 08:48:39 -04:00
Brad King 61495cdaae Fix Xcode project references to the source tree
Xcode project source file references need to always be relative to the
top of the source tree in order for SCM and debug symbols to work right.
We must even allow the relative paths to cross outside of the top source
or build directories.

For subdirectory project() command Xcode projects we use the source
directory containing the project() command as the top.  Relative paths
are generated accordingly for each subproject.

See issue #8481.
2009-09-22 16:18:31 -04:00
Brad King d4cfb77ffe Remove cmGlobalXCode21Generator subclass
This subclass of cmGlobalXCodeGenerator only provided two virtual method
overrides, and it made construction of the Xcode generator instance
complicated.  This commit removes it and replaces the virtual methods
with tests of the Xcode version.  The change removes duplicate code.
2009-09-19 12:00:09 -04:00
Brad King 76eb733f3a Separate Xcode flag escaping code from defines
Generalize the core Xcode generator preprocessor flag escaping code to
be useful for escaping all flags.
2009-07-29 16:40:07 -04:00
Brad King a232dbe8d2 BUG: Fix Xcode linker language
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.
2009-07-10 16:51:44 -04:00
Brad King 2247153110 BUG: Do not generate "global" Xcode config
Xcode 2.0 and below supported only one configuration, but 2.1 and above
support multiple configurations.  In projects for the latter version we
have been generating a "global" set of buildSettings for each target in
addition to the per-configuration settings.  These global settings are
not used by Xcode 2.1 and above, so we should not generate them.
2009-07-02 14:14:03 -04:00
Brad King 6bd9d5ab8a ENH: Simplify Xcode CreateBuildSettings method
The cmGlobalXCodeGenerator::CreateBuildSettings had the three arguments
productName, productType, and fileType that returned information used by only
one of the call sites.  This change refactors that information into separate
methods named accordingly.
2009-07-02 14:13:46 -04:00
Brad King f33a27abd6 ENH: Generate native Xcode 3.0 and 3.1 projects
CMake previously generated Xcode project files labeled as 2.4-compatible
by recent versions of Xcode (3.0 and 3.1).  It is better to generate
native Xcode 3.0 and 3.1 projects.  In particular, this can improve
build times by using the "Build independent targets in parallel"
feature.

Patch from Doug Gregor.  See issue #9216.
2009-06-29 13:02:05 -04:00
Brad King 921f3a1ac2 BUG: Do not automatically set HEADER_FILE_ONLY
Long ago the native build system generators needed HEADER_FILE_ONLY to
be set on header files to stop them from building.  The modern
generators correctly handle headers without the help of this property.
This removes automatic setting of the property so that it can be used
reliably as an indicator of project author intention.  It fixes VS IDE
project files to show header files normally instead of excluded (broken
by the fix for issue #7845).
2009-03-16 14:30:24 -04:00
Brad King 10dec2eac8 STYLE: Fix line-too-long 2008-10-10 08:11:08 -04:00
Brad King 576167d381 ENH: Put custom target sources in Xcode projects
Source files in custom targets are now placed in the Xcode project for
convenient editing.  See issue #5848.
2008-10-09 11:01:48 -04:00
Brad King 1342965b05 BUG: Fix Xcode reference to Info.plist resource
- Generated Xcode projects for application bundles list the
    CMake-generated Info.plist input file as a resource.
  - The location of the input file was moved by a previous commit,
    but the reference to it as a resource file was not updated.
  - This change moves the file to CMakeFiles/<tgt>.dir/Info.plist
    to give it a more intuitive name in the Xcode project.
  - We also update the reference to point at the correct location.
  - See bug #7277.
2008-07-03 13:28:54 -04:00
Brad King 8262ccfd4e ENH: Create COMPILE_DEFINITIONS property for targets and source files. Create <config>_COMPILE_DEFINITIONS property as per-configuration version. Add Preprocess test to test the feature. Document limitations on Xcode and VS6 generators. 2008-01-14 09:20:58 -05:00
David Cole fa61182de8 ENH: Improvements to the Xcode generator. Build frameworks using native Copy Headers and Copy Bundle Resources phases. Fix bugs: eliminate folders with no names, ensure source files show up in multiple targets, remove empty utility targets from Sources subtrees, ensure that fileRefs only show up once in each grouping folder. 2007-08-14 11:45:15 -04:00
Alexander Neundorf 43de8c8628 ENH: add OPTIONAL keyword to ENABLE_LANGUAGE, so it will be possible to do
something like this:

ENABLE_LANGUAGE(ASM-ATT)
IF(CMAKE_ASM-ATT_COMPILER_WORKS)
  ... do assembler stufff
ELSE(CMAKE_ASM-ATT_COMPILER_WORKS)
  ... fallback to generic C/C++
ENDIF(CMAKE_ASM-ATT_COMPILER_WORKS)

Alex
2007-06-28 09:09:26 -04:00
Bill Hoffman d0f12061c3 ENH: add copy header stuff 2007-05-24 17:06:32 -04:00
Brad King 6c421971b9 BUG: Fixed generation of XCODE_DEPEND_HELPER.make into proper directory. Cleaned up duplicate code created by recent changes. 2007-05-11 13:52:33 -04:00
Alexander Neundorf 362f81981e STYLE: fix line length
Alex
2007-05-10 11:38:23 -04:00
Alexander Neundorf 7f11536704 ENH: now target names can be used in add_custom_command() and
add_custom_target() as COMMAND, and cmake will recognize them and replace
them with the actual output path of these executables. Also the dependency
will be added automatically. Test included.
ENH: moved TraceVSDependencies() to the end of GlobalGenerator::Configure(),
so it is done now in one central place

Alex
2007-05-09 08:25:45 -04:00
Brad King 789a0f8359 ENH: Removed unused variables LibraryOutputPath and ExecutableOutputPath. Each target is asked for its own output directory. This is a step towards bug#2240. 2007-03-08 15:24:01 -05:00
Bill Hoffman ca0230a33e ENH: check in initial conv library stuff 2007-02-16 16:12:17 -05:00
Brad King 87d4d0e039 BUG: cmGlobalGenerator::Build should not always use the /fast target name because dependency checking is often required. It now takes an argument specifying whether to use the /fast target name, and the argument is currently only true for try-compiles. 2006-06-01 15:51:24 -04:00
Bill Hoffman 0883dee7f0 ENH: fix rebuild problem with xcode and universal binaries 2006-05-16 09:54:49 -04:00
Ken Martin 80f71359c1 STYLE: fix line length 2006-05-11 15:39:46 -04:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Bill Hoffman 89e5fc63fe STYLE: fix line lengths 2006-03-10 13:54:57 -05:00
Brad King 93c95f1cc5 BUG: Fixed installation of MacOSX Bundle executables and the corresponding install_name remapping support. Extended the BundleTest test to check that this all works. Part of these fixes required changing the signature of AppendDirectoryForConfig in all generators. It now accepts prefix and suffix strings to deal with whether leading or trailing slashes should be included with the configuration subdirectory. 2006-03-03 12:58:48 -05:00
Andy Cedilnik 07260a6f27 ENH: Cleanup global targets even more and potentially fix Xcode 2006-03-01 08:28:39 -05:00
Andy Cedilnik c4156b4531 COMP: Even more global target fixes 2006-02-24 17:35:35 -05:00
Brad King 586a9427d3 ENH: Created target property INSTALL_NAME_DIR initalized by CMAKE_INSTALL_NAME_DIR specifying the directory portion of the OSX install_name field in shared libraries. This is the OSX equivalent of RPATH. 2006-02-24 13:13:14 -05:00
Brad King 131c4a3a17 COMP: Added missing method decl to header. 2006-02-03 12:03:57 -05:00