Commit Graph

41 Commits

Author SHA1 Message Date
Stephen Kelly 72f43fa13d cmLocalGenerator: Remove CreateCustomTargetsAndCommands method.
It loops over cmGeneratorTargets, but at the point it is called, there are no
cmGeneratorTargets.  This must be dead code.
2015-07-27 21:57:29 +02:00
Stephen Kelly 3b880a0741 cmLocalGenerator: Require a valid cmState::Snapshot in the ctor.
Refactor the local generator creation API to accept a
cmState::Snapshot.  Adjust MakeLocalGenerator to use the 'current'
snapshot in cases where there is no parent.  Create the snapshot
for subdirectories in cmMakefile::AddSubdirectory.

This means that snapshots are now created at the point of extending the tree,
as appropriate, and independently of the cmLocalGenerator and cmMakefile they
represent the state for.
2015-05-27 09:18:32 -04:00
Stephen Kelly 34c9ee2ed7 cmLocalGenerator: Require a global generator in the constructor.
Port generator factory methods to pass it.
2015-05-14 20:36:27 +02:00
Stephen Kelly a48aebcb67 cmLocalGenerator: Require a parent in the constructor.
Pass the parent though cmGlobalGenerator::CreateLocalGenerator.

This will make it easy to initialize state scopes independent of
cmMakefile.
2015-04-28 07:50:52 +02:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Stephen Kelly 2a6bd96c13 Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
Commit 08cb4fa4 (Process generator expressions in the
INCLUDE_DIRECTORIES property, 2012-09-18) contained an incorrect
assumption that CMAKE_BUILD_TYPE was set on the makefile for each
generated configuration in multi-config generators. Fix that by making
the GetIncludeDirectories API depend on the config.
2012-10-17 16:24:14 -04: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
Brad King 01e979acef VS: Add CMakeLists.txt re-run rules at start of generation
Since commit 328c0f65 (Simplify cmVisualStudio10TargetGenerator source
classification, 2012-03-19) the VS 10 generator uses the
cmGeneratorTarget source classification instead of directly getting the
list of source files from the target.  This accidentally dropped the
CMakeLists.txt files from generated projects because they are added too
late for cmGeneratorTarget.

All generator-specific source files must be added to targets prior to
cmGeneratorTarget construction.  Refactor addition of the CMakeLists.txt
files with CMake re-run custom commands to take place before normal
generation begins, and therefore early enough to be included in the
cmGeneratorTarget classification.
2012-03-28 14:07:51 -04:00
Brad King c403f27a2d Add $<TARGET_OBJECTS:...> expression to use an object library
For now do not allow an OBJECT library to reference other object
libraries.  Teach cmTarget::ComputeLinkImplementation to include the
languages of object libraries used by a target.
2012-03-16 10:12:15 -04:00
Brad King d57047de33 Pre-compute object file names before VS project generation
Implement cmGlobalGenerator::ComputeTargetObjects in the VS generator
to pre-compute all the object file names.  Use the results during
generation instead of re-computing it later.
2012-03-09 15:16:02 -05:00
Brad King 51b67366ed Merge branch 'cleanup-object-file-names' into object-library 2012-03-09 15:15:37 -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
Stephen Kelly 9106b564ae Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories.

All callers of GetIncludeDirectories should go through the local generator
object.

Only the local generator calls cmTarget::GetIncludeDirectories directly.
2012-02-22 06:31:50 -05:00
Brad King b38c2929b0 Create a static library's output dir for VS 6
VS 6 forgets to create the output directory for a static library if it
differs from the intermediate files directory.  We work around this VS
bug by creating a pre-link event on the library target to make the
directory.
2009-10-28 12:19:15 -04:00
Brad King 51ba120844 Remove unused members of local VS 6 generator
The commit "Use target dependency closure for VS 6 solutions" removed
use of the CreatedProjectNames list, so we remove it.
2009-09-30 16:03:09 -04: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 5129c23cba ENH: Refactor VS 6 build event generation
In cmLocalVisualStudio6Generator we generate pre-build, pre-link, and
post-build events into project files.  This refactors the generation
code for the three event types into a private EventWriter class to avoid
duplicate code.
2009-06-16 11:57:18 -04:00
Brad King 6066e92ba2 BUG: cmTarget instances should not be copied. Removed pass-by-value arguments from cmLocalVisualStudio7Generator::WriteGroup and cmLocalVisualStudio6Generator::WriteGroup. Updated cmTarget to make this easier to find. 2008-01-29 17:30:34 -05: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
Brad King c6092b7e5e BUG: Fixed passing of configuration names to GetRealDependency and ConstructScript. Added GetConfigName helper method to do this. 2007-08-10 13:02:59 -04:00
Brad King ea874415d9 ENH: Moved GetTargetDirectory method up to cmLocalGenerator. This provides a common interface to something that was implemented in most local generators anyway. 2007-08-01 15:25:40 -04:00
Brad King dfb79bea23 STYLE: Removed unused reference to cmMakeDepend. 2007-06-11 12:40:41 -04:00
Alexander Neundorf 8245f437b6 BUG: fix problem for non-C/CXX languages with Visual Studio, the
dependencies for the custom commands added for java were not handled
correctly. Needs more work.

Alex
2007-05-09 14:41:38 -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
Bill Hoffman ca0230a33e ENH: check in initial conv library stuff 2007-02-16 16:12:17 -05:00
Brad King 87ef95c715 ENH: Made cmLocalVisualStudioGenerator a superclass of cmLocalVisualStudio6Generator. Implemented object file unique naming when multiple sources share the same name. 2006-07-11 13:23:02 -04:00
Brad King 864c0292d5 BUG: VS6 generator now uses ComputeLinkInformation just like all other generators. 2006-04-19 10:34:41 -04:00
Brad King d5719f22c1 ENH: Added support for multiple outputs generated by a single custom command. For Visual Studio generators the native tool provides support. For Xcode and Makefile generators a simple trick is used. The first output is considered primary and has the build rule attached. Other outputs simply depend on the first output with no build rule. During cmake_check_build_system CMake detects when a secondary output is missing and removes the primary output to make sure all outputs are regenerated. This approach always builds the custom command at the right time and only once even during parallel builds. 2006-04-11 11:06:19 -04:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -05:00
Brad King 1b5e3f4136 BUG: Fixed generation of cmake re-run rules. 2006-02-09 18:42:58 -05:00
Brad King c6741363de ENH: Enabled new WORKING_DIRECTORY option to ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET on VS 6 generator. 2006-02-08 12:01:21 -05:00
Bill Hoffman aa47caab2d FIX: apply patch from bug# 1965 2005-07-13 11:21:30 -04:00
Ken Martin 369308ca76 ENH: make LOCATION an computed property of the target and get rid of a bunch of const junk 2005-06-22 09:06:46 -04:00
Brad King 15c7d45ecd BUG: Fixed ordering of multiple commands in a custom target when implemented as custom commands. Also added support to execute pre-build rules first to be consistent with makefile generator. 2005-04-26 11:08:18 -04:00
Ken Martin 345cf04012 ENH: big change that includes immediate subdir support, removing the notion of inherited commands, makefiles no longer read in the parent makefiles but instead inherit thier parent makefiles current settings 2005-03-18 10:41:41 -05:00
Ken Martin ba68f771b3 yikes added new custom command support 2003-06-03 10:30:23 -04:00
Brad King cde384411d Several fixes/improvements:
- Fixed CollapseFullPath to work on relative paths with base paths
    not in the current working directory.
  - INCLUDE command now supports relative paths (using above fix).
  - Added ABSOLUTE option to GET_FILENAME_COMPONENT command to
    unwind symlinks and relative paths.
  - Fixed libName_EXPORTS macro definition to be valid C identifier.
  - Added DEFINE_SYMBOL target propterty for customizing the export symbol.
  - Implemented LINK_FLAGS target propterty for libraries in VC6 and VC7.

Several of these fixes were contributed by Gareth Jones.
2003-02-07 14:04:16 -05:00
Andy Cedilnik ee548d8fd8 Add support for comments on custom commands in visual studio 6 2002-12-10 17:52:45 -05:00
Brad King 1f6a3c67b1 ENH: Added reference to Copyright.txt. Removed old reference to ITK copyright. Changed program name to CMake instead of Insight in source file header. Also removed tabs. 2002-10-23 18:03:27 -04:00
Ken Martin 49aebe6c99 new arch 2002-09-04 15:23:56 -04:00