Commit Graph

171 Commits

Author SHA1 Message Date
David Cole b3cf739e2c Honor FOLDER on include_external_msproject targets (#11436)
Add FOLDER property usage to the VSExternalInclude test
and inspect results manually to verify behavior.

Thanks to Jens Auer for the bug report.
2010-11-10 09:06:09 -05:00
Brad King dacc47853d Merge topic 'vs-project-groups'
fd3249e New USE_FOLDERS property OFF by default. (#3796)
2010-10-05 15:31:49 -04:00
David Cole fd3249e11a New USE_FOLDERS property OFF by default. (#3796)
Visual Studio Express editions do not support solution folders,
so default behavior should be as if USE_FOLDERS global property
is OFF.

Also, allow folder names to be the same as target names: internally,
use a prefix to distinguish folder GUIDs from target GUIDs. Add
a target and folder with the same name in the ExternalProject
test to exercise this code.

For CMake itself, provide a new option CMAKE_USE_FOLDERS that
defaults to ON so that Visual Studio users get a nicely organized
CMake project. Express edition users will have to turn off the
CMAKE_USE_FOLDERS option in order to build CMake in the VS Express
IDE.
2010-10-02 14:31:02 -04:00
Brad King 28edb70a9e Merge topic 'vs-project-groups'
e6ac0aa Add FOLDER target property, for IDEs (#3796)
2010-09-08 11:08:05 -04:00
David Cole e6ac0aacf6 Add FOLDER target property, for IDEs (#3796)
This work was started from a patch by Thomas Schiffer.
Thanks, Thomas!

See the newly added documentation of the FOLDER target
property for details.

Also added global properties, USE_FOLDERS and
PREDEFINED_TARGETS_FOLDER. See new docs here, too.

By default, the FOLDER target property is used to organize
targets into folders in IDEs that have support for such
organization.

This commit adds "solution folder" support to the Visual
Studio generators. Currently works with versions 7 through
10.

Also, use the new FOLDER property in the ExternalProject
test and in the CMake project itself.
2010-09-03 13:53:22 -04:00
Brad King 79a88c35f8 Refactor VS <= 7.1 utility-depends workaround
Commit 438a7e2f (Fix utility dependencies for static libraries in VS
generators, 2007-04-04) implemented utility-only dependencies between
linkable targets by introducing an intermediate non-linkable target.
We convert a dependency of the form

  foo -> bar

to the form

  foo -> bar_UTILITY -> bar

to prevent foo from including bar on its link line.  Previously we added
the extra "_UTILITY" targets explicitly among the project targets before
dependency analysis was performed.  Now we generate them separately at
the last moment so that cmGlobalGenerator need not be aware of them.
2010-08-24 18:47:56 -04:00
Brad King 325bdb2a92 Factor out duplicate VS target dependency code
Compute VS target dependencies in cmGlobalVisualStudioGenerator when the
main global dependency analysis is done.  Use these results in each of
the VS generators instead of duplicating the analysis.
2010-08-24 18:39:36 -04:00
Bill Hoffman 268448b891 Teach VS generators to set the MACHINE type correctly. 2009-11-20 11:55:28 -05:00
Brad King 7766473d3e Avoid duplicate ZERO_CHECK in VS solutions
The commit "Avoid non-root copies of root-only targets" moved the check
for root-only targets into cmGlobalGenerator::GetTargetSets to avoid
adding multiple ALL_BUILD targets to the "original" target set.  This
approach did not work for ZERO_CHECK targets though because those are
pulled in by dependency analysis.

Instead we eliminate duplicate ZERO_CHECK targets altogether and refer
to a single one from all solution files.  This cleans up VS 10 project
file references to ZERO_CHECK targets anyway.
2009-10-19 10:47:34 -04:00
Brad King 9000b5a4de Avoid non-root copies of root-only targets
In cmGlobalGenerator::GetTargetSets we collect targets from all local
generators in a tree or subtree corresponding to a project() command.
Some targets, such as ALL_BUILD, are duplicated in each subdirectory
with a project() command.  For such targets we should keep only the copy
for the top-most (root) local generator.

Previously this filtering was done in each VS IDE generator, but it is
easier to do it in one place when the targets are first encountered.
This also fixes bad ALL_BUILD dependencies generated for VS 7.0 because
the cmGlobalVisualStudio7Generator::WriteTargetDepends method was not
filtering out duplicates.  Now we avoid duplicates from the start.
2009-10-06 13:30:00 -04:00
Brad King c8ddb6813b Cleanup cmGlobalGenerator::GetTargetSets method
This commit cleans up the declaration, definition, and invocations of
the GetTargetSets method and related code.  There is no change in
function except to make the method virtual.
2009-10-01 10:26:54 -04:00
Brad King 7e5c571cce Move OrderedTargetDependSet into VS superclass
We move cmGlobalVisualStudio7Generator::OrderedTargetDependSet up to
cmGlobalVisualStudioGenerator so it can be re-used for other VS
versions.  See issue #9568.
2009-09-30 16:02:58 -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 3d1c12b802 ENH: remove INCLUDE_EXTERNAL_MSPROJECT name hack, and use target properties instead, fix VXExternalInclude test for VS10 2009-07-14 14:16:46 -04:00
Bill Hoffman 5c4208f50e ENH: only 5 failing tests for VS 10 2009-07-10 09:12:39 -04:00
Brad King 0d83faf3e3 BUG: Fix ALL_BUILD ordering enforcement
The previous change to make ALL_BUILD come first among targets did not
account for comparing the target name against itself.  This led to an
invalid ordering of the target set.  This change fixes it.
2009-01-21 17:24:54 -05:00
Brad King 5b63e31041 ENH: Make ALL_BUILD always the default project
This teaches the VS IDE generators to write ALL_BUILD into solution
files first so that it is always the default active project.  Previously
it was first only if no target name sorted lexicographically earlier.
See issue #8172.
2009-01-21 17:06:57 -05:00
Brad King 00ca96ae7c BUG: Fix VS IDE project order
Our implementation of the feature to pull in dependent targets in VS
solution files for subprojects caused the order of project files in the
solution to be arbitrary (based on pointer value in the representation).
Target ordering in solution files is important to prevent unnecessary
changing of the files and because the VS IDE selects the first project
listed as the default active target.  This change restores lexicographic
order by target name.
2009-01-21 16:39:43 -05:00
Bill Hoffman ecf312ccc8 STYLE: fix line length stuff for KWStyle 2008-10-01 09:04:27 -04:00
Bill Hoffman d2e2ab72bf BUG: fix for 6794 support for LTCG WholeProgramOptimization, which is not available in VS 8 and newer. 2008-08-19 15:07:47 -04:00
Bill Hoffman 10c91ded4f ENH: add support for Intel Fortran Visual studio IDE 2008-04-30 13:26:04 -04:00
Bill Hoffman 852f6018bb ENH: make sure ALL_BUILD only shows up once 2008-02-04 16:05:00 -05:00
Bill Hoffman 22be36f8d5 ENH: make sure global targets are in the right projects 2008-01-30 16:22:51 -05: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 5594ad4885 ENH: Updated exporting and importing of targets to support libraries and configurations.
- Created cmExportFileGenerator hierarchy to implement export file generation
  - Installed exports use per-config import files loaded by a central one.
  - Include soname of shared libraries in import information
  - Renamed PREFIX to NAMESPACE in INSTALL(EXPORT) and EXPORT() commands
  - Move addition of CMAKE_INSTALL_PREFIX to destinations to install generators
  - Import files compute the installation prefix relative to their location when loaded
  - Add mapping of importer configurations to importee configurations
  - Rename IMPORT targets to IMPORTED targets to distinguish from windows import libraries
  - Scope IMPORTED targets within directories to isolate them
  - Place all properties created by import files in the IMPORTED namespace
  - Document INSTALL(EXPORT) and EXPORT() commands.
  - Document IMPORTED signature of add_executable and add_library
  - Enable finding of imported targets in cmComputeLinkDepends
2008-01-28 08:38:36 -05:00
Bill Hoffman a7e1031efe ENH: remove patch as directory change was already fixed 2008-01-15 14:00:52 -05:00
Brad King 9f864879b4 ENH: Renamed cmGlobalVisualStudioGenerator::CallVisualStudioReloadMacro method to CallVisualStudioMacro and added arguments to select which macro to call and optionally pass the solution file name. Added option to call to new StopBuild macro. Updated logic for replacing the macro file in user directories when the distributed version is newer. 2007-11-19 13:44:51 -05:00
Brad King bb1fa4c3f0 BUG: Fix exception handling flag translation to be specific to each VS version. This allows /EHa to be handled correctly for VS 2003. 2007-11-16 11:01:23 -05:00
David Cole 867de7fc67 ENH: Add ability to call Visual Studio macros from CMake. Add a CMake Visual Studio macro to reload a solution file automatically if CMake makes changes to .sln files or .vcproj files. Add code to call the macro automatically for any running Visual Studio instances with the .sln file open at the end of the Visual Studio Generate call. Only call the macro if some .sln or .vcproj file changed during Generate. Also, add handling for REG_EXPAND_SZ type to SystemTools::ReadRegistryValue - returned string has environment variable references expanded. 2007-11-16 07:01:58 -05:00
Ken Martin 6cdf032505 ENH: change to make the documentation class more generic, about halfway there, also provides secitons for Variables now 2007-10-22 12:49:09 -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
Brad King ba7780a3c4 ENH: Fixed INSTALL_FILES and INSTALL_PROGRAMS commands to not create targets. No targets of type cmTarget::INSTALL_FILES or cmTarget::INSTALL_PROGRAMS are created, so we do not need to check for them everywhere anymore. 2007-05-23 15:40:12 -04:00
Alexander Neundorf b37cc6072f COMP: compile fix and remove warning
Alex
2007-05-22 10:42:37 -04:00
Alexander Neundorf 4878c00905 ENH: add the IMPORT keyword to ADD_EXECUTABLE(), which generates an
"imported" executable target. This can then be used e.g. with
ADD_CUSTOM_COMMAND() to generate stuff. It adds a second container for
"imported" targets, and FindTarget() now takes an additional argument bool
useImportedTargets to specify whether you also want to search in the
imported targets or only in the "normal" targets.

Alex
2007-05-22 10:24:59 -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 996f391593 BUG: The ALL_BUILD target should not have any command lines so that it is not always considered out of date. Moved the 'Build all projects' message into the description field instead of an echo in the command field. Moved common implementation of Generate for VS6 and VS7 into the superclass to avoid duplicate code for the ALL_BUILD target. This addresses bug#4556. 2007-04-10 13:09:03 -04:00
Ken Martin 8b0c61c322 ENH: added internal target property for the name of the project file 2007-04-10 09:54:01 -04:00
Brad King 438a7e2fce BUG: Fix utility dependencies for static libraries in VS generators. This addresses bug#4789. 2007-04-04 14:50:35 -04:00
Ken Martin c53b26baf2 ENH: some more cleanup 2007-03-13 15:18:27 -04:00
Brad King fb38af53c0 BUG: Split precompiled header flags into a separate per-global-generator flag map. This is needed because the flag mappings differ across VS IDE versions. This fixes bug#3512 for VS8 where as the previous fix only worked for VS7. 2007-03-12 12:35:11 -04:00
Ken Martin b99129d2d8 ENH: some code cleanup 2007-03-12 10:26:59 -04:00
Brad King 73a5c33f9b BUG: Removed legacy SetupTests method that was causing RUN_TESTS to test twice. 2007-03-05 13:01:02 -05:00
Bill Hoffman b0bc59f709 ENH: commit fix for putting everything in the build on vs 2006-11-09 09:57:23 -05:00
Brad King 8824f7984a BUG: Fixed references to projects outside the build tree and in other locations with spaces in the path. This is needed for out-of-source/out-of-binary subdirectories in the build. 2006-10-09 21:48:48 -04:00
Brad King 9a1d4e92eb BUG: Fix/cleanup custom commands and custom targets. Make empty comment strings work. Fix ZERO_CHECK target always out of date for debugging. Fix Makefile driving of custom commands in a custom target. Fix dependencies on custom targets not in ALL in VS generators. 2006-09-28 16:40:35 -04:00
Brad King 7d2de52c1a ENH: Cleaned up signature of cmMakefile::AddUtilityCommand. It is not valid to have an output from a utility rule and no calls to the method asked for an output anyway. The argument has been removed. 2006-09-28 13:55:26 -04: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
Ken Martin bf0cb4d49a STYLE: fix line length 2006-05-11 11:47:03 -04:00
Brad King bc135b7fc2 BUG: MSVC* variables should be set in IDE generators instead of just NMake. 2006-05-05 20:54:53 -04:00
Bill Hoffman 0005d625a0 ENH: add special windows CMAKE_MSVCIDE_RUN_PATH variable for adding to the path of vs IDE for running custom commands from cmake 2006-04-25 09:38:29 -04:00
Ken Martin 3d96e52261 STYLE: some m_ to this-> cleanup 2006-03-15 11:02:08 -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 c4156b4531 COMP: Even more global target fixes 2006-02-24 17:35:35 -05:00
Andy Cedilnik 07d0e776ad BUG: More fixing of support for global target son visual studio 2006-02-24 16:20:44 -05:00
Andy Cedilnik 0ba40b59c7 COMP: Handle preinstall properly on IDEs 2006-02-24 09:43:23 -05:00
Andy Cedilnik 1ecd48ba67 COMP: Fix for preinstall 2006-02-24 09:32:27 -05:00
Andy Cedilnik 549b77034e COMP: Fixes for visual studio 2006-02-23 13:37:35 -05:00
Brad King c21287552b ENH: Switched order of slash and configuration name in cmGlobalGenerator::AppendDirectoryForConfig method to increase flexibility. 2006-02-19 19:28:53 -05:00
Brad King bd0b829ffb BUG: Fixed generation of VS8 solution file to not be re-written when loaded by VS and to work with msbuild. 2006-02-14 15:35:34 -05:00
Bill Hoffman 347c5f4b46 ENH: add working directory support 2006-02-08 10:58:36 -05:00
Brad King afa8367885 BUG: Fixed cmTarget::GetFullPath to not append the configuration name when only one configuration is built. It now asks the generator what subdirectory if any to use for a given configuration name. 2006-02-03 11:36:11 -05:00
Brad King 22c62c9e65 BUG: Sweeping changes to cleanup computation of target names. This should
fix many bugs related to target names being computed inconsistently.

- Centralized computation of a target's file name to a method in
  cmTarget.  Now that global knowledge is always available the
  *_CMAKE_PATH cache variables are no longer needed.

- Centralized computation of link library command lines and link
  directory search order.

- Moved computation of link directories needed to link CMake targets
  to be after evaluation of linking dependencies.

This also removed alot of duplicate code in which each version had its
own bugs.

This commit is surrounded by the tags

  CMake-TargetNameCentralization1-pre

and

  CMake-TargetNameCentralization1-post

so make the large set of changes easy to identify.
2006-01-13 18:18:32 -05:00
Brad King 1c7075057f ENH: Added support for parallel builds in VS 8. There is now a special target on which all other targets depend that re-runs CMake if any listfiles have been changed. This addresses bug#2512. 2005-12-13 14:21:28 -05:00
Andy Cedilnik 782bef7374 ENH: Add a way for the generated command to include extra flags. This is useful for CTest (or try compile) to add -j2 2005-12-01 11:41:00 -05:00
Brad King f9aef0e422 ENH: Generator now creates a separate intermediate files directory for each target. This is needed for MSVC 8 to support parallel builds. 2005-07-27 13:36:36 -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
Ken Martin 8108786494 ENH: fix for incorrect setting of CONFIZGURATION_TYPES 2005-06-07 12:07:34 -04:00
Brad King 1c6f9716c3 BUG: Added space after /clean to avoid putting it together with the build configuration. This fixes the failure of the complext test on the second run in the same tree. 2005-05-05 10:26:41 -04:00
Andy Cedilnik 61d0a75d11 ENH: Add option to ignore errors. Only works on make 2005-04-29 11:49:18 -04:00
Brad King 48702f8a8d COMP: Converting INSTALL->ALL_BUILD dependency implementation to use the AddUtility method on a target. This significantly simplifies the implementation and removes warnings about hiding virtual functions. 2005-04-29 10:11:24 -04:00
Andy Cedilnik cb3ea2328a ENH: Start working on a method that abstracts generating of build command 2005-04-28 18:18:54 -04:00
Brad King 3b81a43294 ENH: Added dependency from INSTALL target to ALL_BUILD target so that targets build before being installed. 2005-04-28 16:21:28 -04:00
Bill Hoffman 0255dab023 BUG: fix for bug 1702, better error message for GUID missing 2005-04-05 10:22:18 -04:00
Andy Cedilnik 86cebea79a ENH: More ctest changes and move SetupTest to superclass 2005-04-01 15:48:46 -05:00
Ken Martin 791aa6052b ENH: add support for out of source source 2005-03-14 11:29:15 -05:00
Ken Martin 3ff6722934 ENH: cleanup by removing all the olf local generate junk that i not longer needed 2005-03-10 13:39:38 -05:00
Brad King 39af9ee1e4 ENH: Updated implementation of custom commands. Multiple command lines are now supported effectively allowing entire scripts to be written. Also removed extra variable expansions and cleaned up passing of commands through to the generators. The command and individual arguments are now kept separate all the way until the generator writes them out. This cleans up alot of escaping issues. 2005-02-22 10:32:44 -05:00
Ken Martin 4d30cb309c ENH: ctest now uses CMake global generator to do the build part of build-and-test 2005-02-22 09:12:10 -05:00
Bill Hoffman 13865fc4fa ENH: move project map to global generator base 2005-01-21 12:26:32 -05:00
Brad King a5ae290a5b STYLE: Adjusted signature of cmGeneratedFileStream to make copy-if-different more explicity. 2004-11-03 07:51:51 -05:00
Brad King e34207c1f0 COMP: Fix new cmGeneratedFileStream for MSVC. 2004-11-03 07:27:44 -05:00
Bill Hoffman 444dbd3309 BUG: fix external project command for VS 7 and 71 2004-09-15 15:15:46 -04:00
Bill Hoffman e192b45f4b ENH: fix for vs 70 generator 2004-09-15 13:03:19 -04:00
Bill Hoffman 5001eed8a5 ENH: clean up of INCLUDE_EXTERNAL_MSPROJECT contributed by Clinton Stimpson 2004-09-15 12:07:57 -04:00
Bill Hoffman b1f3e10439 BUG: make sure env CC and CXX are not set for VS IDE builds 2004-09-15 11:31:54 -04:00
Bill Hoffman 32fe8caaef bug fixes for external projects 2004-09-14 14:05:40 -04:00
Bill Hoffman d385543865 BUG: fix include external project bug 2004-09-14 09:19:21 -04:00
Bill Hoffman b5bdf2cb0a ENH: add better error reporting for file open failures 2004-09-07 16:55:25 -04:00
Bill Hoffman 731369ef9c ENH: try to initialize all languages at the same time 2004-08-27 08:41:07 -04:00
Bill Hoffman bb32a51825 ENH: change RUN_TESTS to use -C and not -D also use GetRequiredDefinition where needed 2004-08-11 16:57:27 -04:00
Brad King 9b1771aef4 BUG: CMAKE_TRY_COMPILE_CONFIGURATION should be obtained from the cmMakefile instance for the listfile containing the TRY_COMPILE call, not the top level listfile. 2004-08-04 16:33:10 -04:00
Bill Hoffman 1d061ae896 fix include order because of GetCurrentDirectory define and windows.h problem 2004-06-15 08:30:22 -04:00
Bill Hoffman c15adc9221 BUG: fix sub project path problem 2004-06-14 10:28:04 -04:00
Bill Hoffman 70eaddbf8e BUG: make sure global generate is done when cmakelist file chagnes, also make sure guids are stored in the cache so the .sln file does not change every time 2004-05-20 16:29:09 -04:00
Andy Cedilnik 9ac968174e ENH: Handle make install target on Visual Studio 6 and 7 and install templates 2004-04-15 13:09:24 -04:00
Bill Hoffman 7fa36510d5 BUG: fix external projects for vc7 2004-04-14 16:58:13 -04:00
Bill Hoffman ddb815c125 ENH: add new subdirectory exclude from top option 2004-03-09 16:28:44 -05:00
Andy Cedilnik 72d8bd1e41 BUG: Fix Bug #445 - Same library in multiple projects can cause problems 2003-12-18 13:17:36 -05:00
Bill Hoffman 587370e1e2 remove more warnings 2003-11-26 16:15:18 -05:00