Commit Graph

15215 Commits

Author SHA1 Message Date
Brad King 0c55729c13 VS: Add CMAKE_VS_(DEVENV|MSBUILD|MSDEV)_COMMAND variables
Since commit 5f5c92b9 (VS: Add internal APIs to find MSBuild,
devenv/VCExpress, and msdev, 2013-11-13) the VS generators have
known how to lookup the locations of their build tools directly.
Expose this information to CMake language code by defining new
variables to hold the paths to these tools.
2013-12-04 11:05:05 -05:00
Brad King 558c74d0ab VS: Switch to internal CMAKE_MAKE_PROGRAM lookup by generators
Drop the "Modules/CMakeVS*FindMake.cmake" files.  Override the
cmGlobalGenerator::FindMakeProgram method for VS generators to use their
internal APIs to locate the build tool.  Set the CMAKE_MAKE_PROGRAM as a
normal variable for use by project code, but do not cache it.  This will
allow CMake and CTest to select the proper tool at build time.
2013-11-18 11:30:50 -05:00
Brad King 4d1d7725f3 ctest: Teach --build-options to allow zero options
The --build-options option consumes all following arguments until either
--build-target or --test-command.  Fix the logic to allow this to be
zero options.
2013-11-18 11:30:49 -05:00
Brad King 96966b5c80 ctest: Make the --build-makeprogram optional for --build-and-test
GenerateBuildCommand now knows how to lookup CMAKE_MAKE_PROGRAM or
choose a generator-provided default build tool.  Therefore the
--build-makeprogram can now be optional and simply override the
default selection when provided.

Note that with --build-nocmake we now need to load the cache in order to
make the CMAKE_MAKE_PROGRAM entry available to GenerateBuildCommand.
2013-11-18 11:30:49 -05:00
Brad King 91a021146c Simplify some calls to cmGlobalGenerator::Build
Code paths that look up CMAKE_MAKE_PROGRAM from the cache only to
pass it to Build, which only passes it to GenerateBuildCommand,
no longer need to do so.  GenerateBuildCommand now knows how to
look up CMAKE_MAKE_PROGRAM in the cache when no explicit value
is given, so simply pass 0 now.
2013-11-18 11:30:48 -05:00
Brad King 123a0608df Teach GenerateBuildCommand to find its own make program
Add a cmGlobalGenerator::SelectMakeProgram method to select a
caller-provided make program, the CMAKE_MAKE_PROGRAM cache entry, or a
generator-provided default.  Call it from all implementations of the
GenerateBuildCommand method with the corresponding generator's default,
if any.
2013-11-18 11:30:48 -05:00
Brad King 5f5c92b9a2 VS: Add internal APIs to find MSBuild, devenv/VCExpress, and msdev
Teach the VS generators to compute the locations of these tools directly
from registry entries.  Add internal APIs to get the locations on demand.
2013-11-18 08:26:24 -05:00
Brad King 4ac75fdfe6 Prefer CMAKE_MAKE_PROGRAM over CMAKE_BUILD_TOOL (#14548)
Historically these were both added for the Makefile and Visual Studio
generators, respectively.  Later the VS generators started using the
CMAKE_MAKE_PROGRAM cache entry to find the IDE build tool, and the
CMAKE_BUILD_TOOL was simply set as an alias.

Fix the documentation to explain that CMAKE_MAKE_PROGRAM is the modern
variable and that CMAKE_BUILD_TOOL is the compatibility alias, not the
other way around.  Replace uses of CMAKE_BUILD_TOOL with
CMAKE_MAKE_PROGRAM in CMake-provided modules.  Nothing needs to lookup
CMAKE_BUILD_TOOL in the cache, so simply set it as a normal variable.
2013-11-18 08:26:23 -05:00
Brad King 0a7f17b870 Tests: Remove unused Source/cmaketest.h.in file
This file has not been used since commit 2c2291bb (add new feature to
ctest so that it can cmake, build and run a test executable, 2004-01-07).
2013-11-18 08:26:22 -05:00
Brad King 8904d1410b cmGlobalGenerator: Cleanup GenerateBuildCommand API
All cmGlobalGenerator::GenerateBuildCommand call sites that need to
produce a string now generate "cmake --build" commands.  The remaining
call sites immediately pass the result to cmSystemTools::RunSingleCommand.
Avoid the intermediate string and argument parsing by directly producing a
vector of strings.  Also drop the ignoreErrors argument because no call
sites remain that use it.
2013-11-18 08:26:21 -05:00
Brad King 0814d0a655 cmSystemTools: Add PrintSingleCommand method
Add a method to print a command line for human reference by simply
double-quoting every argument.
2013-11-15 14:40:55 -05:00
Brad King ee6e4ac841 cmSystemTools: Add RunSingleCommand overload for std::vector<std::string> 2013-11-15 14:40:55 -05:00
Brad King 2d072069e2 ctest_build: Use "cmake --build" to launch the native build tool
This avoids requiring cmGlobalGenerator::GenerateBuildCommand to produce
a string so that it can be later refactored to produce a vector with no
quoting or escaping.  It also makes the ctest_build command match what
"ctest -T Build" would run in a build tree configured with the new
build_command() command behavior.  It also ensures that the native build
tool used matches that selected by the configuration of the tree to be
built.
2013-11-15 14:40:04 -05:00
Brad King bca67c710f build_command: Return a "cmake --build" command-line
Re-implement the build_command() command to use "cmake --build" instead
of generating a native build tool invocation directly.  This command
will internally invoke the proper native build tool.

This avoids requiring cmGlobalGenerator::GenerateBuildCommand to produce
a string so that it can be later refactored to produce a vector with no
quoting or escaping.  It will also allow us to later teach CMake to
delay the decision about which build tool to invoke until after the
project build system is generated to disk.  For example, on Visual
Studio 10 and above the preferred command-line tool is MSBuild, but we
need to fall back to devenv if the .sln has Intel Fortran .vfproj files.
2013-11-15 14:38:18 -05:00
Brad King 05923172f9 cmGlobalGenerator: Add method to compute "cmake --build" command line
Create a GenerateCMakeBuildCommand method to generate a command-line
string invoking "cmake --build" for a given target and configuration.
Optionally allow the "-i" make flag and additional native options.
2013-11-14 16:25:31 -05:00
Brad King 1befbfad3d cmGlobalGenerator: Drop unused GenerateBuildCommand implementation
This is a virtual method that is overridden by every generator
subclass.  The base class implementation should never be called,
so replace it with a dummy implementation.
2013-11-14 16:25:31 -05:00
Brad King bd082a29a9 Merge topic 'msvc-encoding'
58e3d49 MSVC: Fix encoding of Visual Studio 10+ project files.
2013-11-14 11:28:19 -05:00
Brad King 15872a3c30 Merge topic 'set_emptyvar_PARENT_SCOPE'
bf755c7 set: Add unit tests for set/unset PARENT_SCOPE
bc280f1 set: Fix handling of empty value with PARENT_SCOPE
20afbd5 set: Handle value-less PARENT_SCOPE explicitly
2013-11-14 11:28:12 -05:00
Clinton Stimpson 58e3d4948d MSVC: Fix encoding of Visual Studio 10+ project files.
Use Windows-1252, which is the same encoding as older
Visual Studio project files.
2013-11-14 11:24:06 -05:00
Kitware Robot becc689127 CMake Nightly Date Stamp 2013-11-14 00:01:10 -05:00
Brad King d592fc48cd Merge topic 'cmake-distribution-config'
06b0dbe OS X: Drop version number from CMake.app bundle name (#11693)
84af42b Configure NSIS-packaged CMake version and install destination
7655029 Configure NSIS-packaged CMake documentation link in Start Menu
2013-11-13 11:36:46 -05:00
Daniele E. Domenichelli bc280f1c81 set: Fix handling of empty value with PARENT_SCOPE
Just as

  set(VAR "")

sets VAR to an empty string in the current scope, the code

  set(VAR "" PARENT_SCOPE)

is documented to set the variable to an empty string in the parent
scope.  Fix the implementation to make it so.
2013-11-13 10:15:56 -05:00
Daniele E. Domenichelli 20afbd5e03 set: Handle value-less PARENT_SCOPE explicitly
The code "set(VAR PARENT_SCOPE)" unsets VAR in the parent scope.
Implement this case explicitly next to where "set(VAR)" is explicitly
handled to unset VAR in the current scope.
2013-11-13 10:14:21 -05:00
Brad King 558a6f1f92 Merge topic 'cmake-copyright-year'
3bade75 Help: Parse Copyright.txt instead of using current year
2bbf6bd Copyright.txt: Add test to check year range
3ee67d0 Copyright.txt: Update year range to end in 2013
621ba1f cmake-gui: Parse Copyright.txt instead of duplicating notice
993b685 bootstrap: Parse Copyright.txt instead of duplicating notice
2013-11-13 09:59:12 -05:00
Brad King 978d796e8d Merge topic 'policy-summary-periods'
49cbca6 CMP0038: Add missing '.' to policy summary line
7390002 CMP0039: Add missing '.' to policy summary line
2013-11-13 09:58:50 -05:00
Brad King 3c4071bec4 Merge topic 'fix-INTERFACE-with-no-SHARED-libs'
64f73b0 add_library: Fix INTERFACE on platforms with no shared libs (#14561)
2013-11-13 09:57:20 -05:00
Brad King 3822f5bcac Merge topic 'wix-custom-arguments'
096591b CPackWiX: Add variables for custom tool extensions and flags
2013-11-13 09:56:30 -05:00
Brad King 11fe43422f Merge topic 'cleanup-edit_cache-target'
684063c Refactor tool selection for edit_cache (#14544)
eaf5b7a cmGlobalGenerator: Do not propagate const through GetCMakeInstance
2013-11-13 09:55:17 -05:00
Kitware Robot 706aab0418 CMake Nightly Date Stamp 2013-11-13 00:01:08 -05:00
Brad King 621ba1fd04 cmake-gui: Parse Copyright.txt instead of duplicating notice
Set the cmake-gui MACOSX_BUNDLE_COPYRIGHT property by parsing the
copyright notice line out of Copyright.txt instead of duplicating it.
2013-11-12 16:35:17 -05:00
Brad King 06b0dbe061 OS X: Drop version number from CMake.app bundle name (#11693)
Always name the application bundle "CMake.app".  Users can rename it
after installation if they wish.  This is the typical approach used by
OS X applications, including Xcode.  It allows CMake to be upgraded
without manually re-running CMake in every build tree to update the path
to CMake.  It also makes the executable location in the CMake build tree
more predicatable.
2013-11-12 15:47:06 -05:00
Nils Gladitz 096591b96a CPackWiX: Add variables for custom tool extensions and flags 2013-11-12 14:10:01 -05:00
Daniele E. Domenichelli 7390002964 CMP0039: Add missing '.' to policy summary line 2013-11-12 11:54:14 -05:00
Stephen Kelly 64f73b0fb6 add_library: Fix INTERFACE on platforms with no shared libs (#14561) 2013-11-12 09:07:10 -05:00
Brad King 684063c036 Refactor tool selection for edit_cache (#14544)
Refactor edit_cache tool selection to ask each global generator for its
preference.  Teach the Ninja generator to always use cmake-gui because
Ninja by design cannot run interactive terminal dialogs like ccmake.
Teach the Makefile generator to use cmake-gui when also using an "extra"
generator whose IDE has no terminal to run ccmake, and otherwise fall
back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
2013-11-12 08:47:19 -05:00
Brad King eaf5b7a776 cmGlobalGenerator: Do not propagate const through GetCMakeInstance
Combine the const and non-const GetCMakeInstance to a const one and
return a pointer to non-const cmake from it.
2013-11-12 08:43:33 -05:00
Brad King d3f7fa22ed Merge topic 'pp-transitive-property-handling'
77a0fd5 Genex: Use a preprocessor foreach to follow transitive properties.
1464933 Genex: Simplify the preprocessor looper for interface properties.
2013-11-12 08:32:13 -05:00
Brad King a4b9adec89 Merge topic 'constify'
dcac9be Make accessors for compile-related information const.
19a8a3c cmTarget: Don't finalize include directories in GetIncludeDirectories.
3305364 cmGlobalGenerator: Rename the FinalizeCompileDefinitions method.
2013-11-12 08:32:08 -05:00
Brad King a1e22f6917 Merge topic 'cmake-internal-locations'
d1526f8 Refactor internal resource location APIs and initialization
2013-11-12 08:31:56 -05:00
Brad King cb4a4686ac Merge topic 'clear-generator-data'
00055ce cmExportSetMap: Override clear() to delete held resources
2013-11-12 08:31:39 -05:00
Brad King d1526f825e Refactor internal resource location APIs and initialization
Rename cmSystemTools::FindExecutableDirectory to FindCMakeResources.
Teach it to compute the locations of cmake, ctest, cpack, ccmake, and
cmake-gui executables, and the location of CMAKE_ROOT.  Provide this
information from static cmSystemTools::Get<resource>() methods.
Refactor code that needs these locations to use the new APIs.

Teach FindCMakeResources to use the OS X system API to lookup the
executable location.  When running from the CMake build tree itself,
leave a file in the tree that FindCMakeResources can use to read the
location of the source tree.  This avoids the need to compile the source
tree location into a binary that may be installed and used without the
source tree.

Teach the QtDialog on OS X to create a "cmake-gui" symlink in the build
tree next to "cmake" and the other tools, as is already done in the
install tree for the application bundle.  This ensures a consistent set
of executables are available in one directory.
2013-11-12 08:23:35 -05:00
Kitware Robot 4a762aa312 CMake Nightly Date Stamp 2013-11-12 00:01:07 -05:00
Kitware Robot 13da9f0024 CMake Nightly Date Stamp 2013-11-11 00:01:11 -05:00
Kitware Robot 6f2ec64504 CMake Nightly Date Stamp 2013-11-10 00:01:08 -05:00
Stephen Kelly 77a0fd5135 Genex: Use a preprocessor foreach to follow transitive properties. 2013-11-09 20:31:35 +01:00
Stephen Kelly 146493363e Genex: Simplify the preprocessor looper for interface properties.
By removing the INTERFACE_ prefix, we can use this in more contexts.
2013-11-09 20:31:35 +01:00
Stephen Kelly dcac9be6aa Make accessors for compile-related information const.
These can be moved to cmGeneratorTarget in CMake 4.0.
2013-11-09 20:30:46 +01:00
Kitware Robot 781467bf42 CMake Nightly Date Stamp 2013-11-09 00:01:10 -05:00
Brad King 2053e0cd51 Merge topic 'tll-target-policies'
596b2a8 Disallow linking to utility targets (#13902).
301bb5c Disallow link-to-self (#13947).
05f5fde Disallow invalid target names (#13140)
2013-11-08 10:33:14 -05:00
Brad King 00055ce76d cmExportSetMap: Override clear() to delete held resources
Replace the std::map<>::clear() method with one that first deletes
the cmExportSet instances held by each map entry, and then clears.
Otherwise the cmGlobalGenerator::ClearGeneratorMembers added by
commit 5cf1120f (cmGlobalGenerator: Refactor member cleanup between
configures, 2013-11-04) leaks the cmExportSet instances.
2013-11-08 09:35:56 -05:00