Commit Graph

94 Commits

Author SHA1 Message Date
Stephen Kelly 26e23e8463 VS: Port ComputeLongestObjectDirectory to cmGeneratorTarget 2015-10-24 09:19:56 +02:00
Stephen Kelly 01c2698693 VS7: Port to cmGeneratorTarget 2015-10-24 09:19:56 +02:00
Stephen Kelly 12e4790a0b cmGeneratorTarget: Move GetTargetVersion from cmTarget. 2015-10-16 20:24:44 +02:00
Stephen Kelly 7f5ec9f109 cmLocalGenerator: Port GetTargetDirectory to cmGeneratorTarget. 2015-10-15 00:33:12 +02:00
Stephen Kelly ff8ac8ee6a cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
2015-08-28 18:44:39 +02:00
Stephen Kelly 9b6a743b80 cmLocalGenerator: Remove Parent pointer. 2015-08-28 18:44:38 +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
Brad King 2f4bb4e9b0 VS: Do not accumulate configurations globally (#15577)
Drop the VS >= 7 generator's global Configurations member and instead
lookup configurations using cmMakefile::GetConfigurations where needed.
This avoids accumulating all CMAKE_CONFIGURATION_TYPES values ever
encountered by a project() or enable_language() command and allows
the final value to be used in each directory.  We don't officially
support per-directory CMAKE_CONFIGURATION_TYPES values but we certainly
should not generate configurations not in the final value in the top
level directory.
2015-05-21 09:06:49 -04:00
Stephen Kelly e435f875ec VS: Move version information to global generator. 2015-05-19 11:02:33 -04:00
Stephen Kelly b5f093f096 VS: Simplify setting of flag table. 2015-05-19 11:02:33 -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
Brad King 7a526c35f6 VS: Delay getting platform name in local generator
Ask the global generator during generation instead of trying
to store it up front.  Later the global generator may not know
the platform name when it is creating the local generator.
2014-07-17 16:59:53 -04:00
Ben Boeckel 1a1b737c99 stringapi: Use strings for generator names 2014-03-08 13:05:38 -05:00
Ben Boeckel b3bf31a548 stringapi: Miscellaneous char* parameters 2014-03-08 13:05:37 -05:00
Ben Boeckel 84fdc9921c stringapi: Pass configuration names as strings 2014-03-08 13:05:36 -05:00
Ben Boeckel 215b1addf0 stringapi: Take strings in escaping functions 2014-03-08 13:05:35 -05:00
Ben Boeckel c3833c7da4 stringapi: Use strings for VS project names 2014-03-08 13:05:33 -05:00
Ben Boeckel fabf1fbabb stringapi: Use strings in target name 2014-03-08 13:05:31 -05:00
Patrick Gansterer 34969cf15e Fix setting of the entry point symbol for Windows CE (#14088)
Set the EntryPointSymbol only when it has not been set before
and use the correct symbol depending on the usage of Unicode.
2013-08-05 21:24:00 +02:00
Anton Helwart 545fdec4f8 VS: Avoid empty source groups in some cases (#3474)
Teach the WriteGroup method return true if a group or any of its
children have source files.  Have children write their output to a
temporay cmOStringStream.  Add it to the real output only if not empty.
2013-03-08 08:27:12 -05:00
Patrick Gansterer 2118a2016f VS: Support setting correct subsystem and entry point for WinCE
WinCE has only one SubSystem. So the WIN32_EXECUTABLE property
must be handled via the EntryPointSymbol in the vcproj files.
2012-11-26 09:33:28 -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
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 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 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 1be4b6f463 Order VS local generator Version ivar values consistently
Move the Version member to the top cmLocalVisualStudioGenerator class
and set it consistently for instances created by all the global
generator versions.  Use an enumeration type with values scaled by a
factor of 10 so we can handle VS 7.1 without out-of-order numbers.

VS 7.1 support for SuppressStartupBanner was broken by commit 25116a3c
(Fix CMAKE_VERBOSE_MAKEFILE for VS10 vcxproj files, 2011-10-11) because
it assumed comparison of VS version numbers works.  Now it does.
2011-11-14 09:47:31 -05:00
David Cole 39f0fa725e Merge topic 'AutomocForQt'
920a046 QtAutomoc: Eliminate compiler warning
b00463f QtAutomoc test: Pass QT_QMAKE_EXECUTABLE
e78ce44 Fix automoc with VS builds: apply patch from Bill
71165e9 Silence warning in automoc: use long instead of int
1879bcc Fix build: use std::ios::out|ios::trunc instead of std::ios_base::out
678e124 Only enable the automoc test after checking that Qt4 works
71c29d1 Fix bootstrap test with automoc
afb3edc Fix warnings
add30e9 Fix build: non-void function must return a value
7e6d845 Automoc.cmake is not needed anymore
2963d0b Fix logic which decides when to execute automoc test
77a5c6e Add documentation for AUTOMOC, add initialization via CMAKE_AUTOMOC
bf8ef77 Add a test for automoc
d045fd4 Nicer progress message for the automoc target
50cd6ce Move automoc processing from add_executable/library to cmGlobalGenerator
cbaac2a Remove trailing whitespace
c27607b Refactor SetupAutomocTarget() so it can be run after creating the target
24d9b7d Remove trailing whitespace
58b7fe6 Use cout instead of printf()
72caf4d Add the generated automoc.cpp file to the cleaned files
ddb517d Color output when running moc
9303295 Initialize verbose based onb the env.var.
ace1215 Move code for parsing a cpp-file from the big loop to separate function
735a5bb Fix line lengths
83b730c Add AUTOMOC to the add_library() command
126c6ea Add the cmake module required currently for automoc
de91feb Remove the need to check for .h/.cxx during buildtime
d65689a Add actual automoc code from automoc
d1c0a5f Start implementing skeleton for automoc in cmake
a65011b Start work on automoc: add empty cmQtAutomoc class
2011-08-25 15:40:29 -04:00
Alex Neundorf e78ce44b35 Fix automoc with VS builds: apply patch from Bill
This patch moves the creation of VS GUIDs from the final pass
to AddHelperCommands() and should fix the failing automoc tests
with VS.

Alex
2011-08-18 19:35:41 +02:00
David Cole 37d8602cde Merge topic 'intel_fortran_vs2010' into fix-8707-add-vs-globals
Conflicts:
	Source/cmLocalVisualStudio7Generator.h
2011-07-29 10:22:33 -04:00
David Cole df9577259c Add support for Visual Studio project-specific globals (#8707)
Thanks to Pau Garcia i Quiles for the inspiration for the patch.
I've tweaked it a bit compared to what's in the bug tracker: this
commit does not allow empty global variable names.

I also added usage of the new feature to an existing test. Although
it has no effect on the resulting Visual Studio projects, you can
verify that the VSResource test produces a non-empty globals section
in the generated .vcproj(x) files.
2011-07-29 10:04:36 -04:00
Bill Hoffman 6c72d25aee Initial support for Intel Fortran VS2010. 2011-07-08 17:08:43 -04:00
Brad King 9859c64ffc Honor VS_SCC_* properties in Fortran targets (#10237)
Factor out generation of SccProjectName, SccLocalPath, and SccProvider
from cmLocalVisualStudio7Generator::WriteProjectStart and call it from
cmLocalVisualStudio7Generator::WriteProjectStartFortran too.
2011-01-17 15:41:24 -05:00
Brad King 024d05adad Fix use of module .def files for MS tools
We recognize .def source files and map them to the /DEF:<file> option in
the MSVC tools.  Previously this worked only for shared libraries.  This
commit cleans up the implementation and makes it work for executables
too.  See issue #9613.
2009-09-29 16:39:07 -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 e339f3133f ENH: Separate VS flag table type
Move the cmVS7FlagTable type out of the VS generators and rename it to
cmIDEFlagTable.  It will be useful for other generators.
2009-07-29 11:28:55 -04:00
Bill Hoffman b590e1dfae ENH: remove code duplication and use cmVisualStudioGeneratorOptions for all versions of vs 7 and greater. 2009-07-28 14:30:15 -04:00
Bill Hoffman 11d42b3e8f ENH: almost all tests passing in vs 10, commit fixes preprocess and starts vs external project 2009-07-13 16:58:24 -04:00
Bill Hoffman 5c4208f50e ENH: only 5 failing tests for VS 10 2009-07-10 09:12:39 -04:00
Bill Hoffman 7491f52992 ENH: first pass at VS 10, can bootstrap CMake, but many tests still fail 2009-06-25 16:41:57 -04:00
Brad King 764ac9803d ENH: Generalize exe implib dir creation for VS
In VS 7,8,9 executable targets we generate a build event to create the
output directory for the import library in case the executable marks
symbols with dllexport (VS forgets to create this directory).  This
generalizes computation of the custom command line to support future use
with other VS versions.
2009-06-16 11:44:07 -04:00
Brad King f4b3bdc6be BUG: Create an exe's implib output dir for VS
If an executable marks symbols with __declspec(dllexport) then VS
creates an import library for it.  However, it forgets to create the
directory that will contain the import library if it is different from
the location of the executable.  We work around this VS bug by creating
a pre-build event on the executable target to make the directory.
2009-06-15 10:55:21 -04:00
Brad King 4a9dd4aad4 ENH: Refactor VS 7,8,9 build event generation
In cmLocalVisualStudio7Generator 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-12 15:28:48 -04:00
Bill Hoffman 10c91ded4f ENH: add support for Intel Fortran Visual studio IDE 2008-04-30 13:26:04 -04:00
Bill Hoffman 8a83f09637 ENH: fix for bug 3218 dependant projects are written out automatically if they are in the project. Also fix bug 5829, remove hard coded CMAKE_CONFIGURATION_TYPES from vs 7 generator 2008-01-30 12:04:38 -05: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 96fd5909d9 ENH: Implement linking with paths to library files instead of -L and -l separation. See bug #3832
- This is purely an implementation improvement.  No interface has changed.
  - Create cmComputeLinkInformation class
  - Move and re-implement logic from:
      cmLocalGenerator::ComputeLinkInformation
      cmOrderLinkDirectories
  - Link libraries to targets with their full path (if it is known)
  - Dirs specified with link_directories command still added with -L
  - Make link type specific to library names without paths
    (name libfoo.a without path becomes -Wl,-Bstatic -lfoo)
  - Make directory ordering specific to a runtime path computation feature
    (look for conflicting SONAMEs instead of library names)
  - Implement proper rpath support on HP-UX and AIX.
2008-01-22 09:13:04 -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
Bill Hoffman af1230fea0 STYLE: fix line len error 2007-12-09 19:58:33 -05:00
Bill Hoffman 246e964180 BUG: fix for bug 5455, handle nodefaultlib with more than one lib 2007-12-06 08:40:18 -05:00