Commit Graph

21 Commits

Author SHA1 Message Date
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 1b9e61f214 Add alternative _UTILITY targets to all solutions
In VS 6, 7, and 7.1 solutions we implement

  add_dependencies(myexe mylib) # depend without linking

by creating an intermediate mylib_UTILITY target with dependencies

  myexe -> mylib_UTILITY -> mylib

to avoid linking myexe to mylib.  Previously these extra targets were
only added to the solution files in an ancestor directory of that
defining mylib.  For example, in the project:

  # CMakeLists.txt
  project(TOP)
  add_subdirectory(A)
  add_subdirectory(b)

  # A/CMakeLists.txt
  add_library(mylib ...)

  # B/CMakeLists.txt
  project(B)
  add_executable(myexe ...)
  add_dependencies(myexe mylib)

the solution for TOP would have mylib_UTILITY but the solution for B
would not even though it pulls in mylib through the dependency.  This
commit fixes solutions generated in other directories so that any
solution that has mylib will get mylib_UTILITY also.

See issue #9568.
2009-10-01 10:27:02 -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 09e398fa9f Create VS generator GetRegistryBase method
This method returns the registry key

  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<version>

A protected GetIDEVersion method retrieves the version-specific part of
the key name.
2009-09-16 11:44:08 -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
David Cole 17452105cd BUG: Fix issue #7088 - do not emit error messages when attempts to run Visual Studio macros fail. You can still get the error output as messages if you want using --debug-output from the cmake command line. 2008-07-30 15:26:34 -04:00
Bill Hoffman a131a82811 STYLE: fix warning 2008-04-30 22:17:35 -04:00
Bill Hoffman 10c91ded4f ENH: add support for Intel Fortran Visual studio IDE 2008-04-30 13:26:04 -04:00
David Cole ca2a16c0a2 ENH: Add code to support calling the VS reload macro from Visual Studio 7.1 and 9.0 in addition to 8.0 sp1... Make new macros file with VS 7.1 so that it can be read by 7.1 and later. VS 7.1 does not appear to run the macros while a build is in progress, but does not return any errors either, so for now, the reload macro is not called when using 7.1. If I can figure out how to get 7.1 to execute the macro, I will uncomment the code in cmGlobalVisualStudio71Generator::GetUserMacrosDirectory() to activate executing the macros in VS 7.1, too. 2008-02-15 11:49:58 -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
Brad King 3cf3bb664a ENH: Make static library targets depend on targets to which they "link" for the purpose of build ordering. This makes the build order consistent for static and shared library builds. It is also useful when custom command inputs of one library are generated as custom commands outputs of another. It may be useful in the future for Fortran module dependencies. Implemented for Makefiles, Xcode, and VS 8 and above. Added sample code to do it for VS 7.1 and below, but left it disabled with comments explaining why. Likely it will never be needed on VS 7.1 or below anyway. 2007-12-21 15:04:06 -05:00
Brad King eee575283d STYLE: Fixed line-too-long. COMP: Fixed warnings about lossy conversions. 2007-11-20 11:10:11 -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
David Cole 96bf9b372a ENH: Add more conditions for attempting to call the new Visual Studio macros. Only try to call them if the vsmacros file exists and is registered. Count VS instances again after warning about running instances. If user closed them in response to the warning, it's OK to register the macros now rather than waiting till the next CMake generate. 2007-11-16 13:54:21 -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
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
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
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
Brad King 2c1204e361 ENH: Added cmGlobalVisualStudioGenerator as superclass to all VS global generators. 2007-04-04 11:22:14 -04:00