summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-12-04 10:35:04 -0500
committerBrad King <brad.king@kitware.com>2013-12-04 11:05:05 -0500
commit0c55729c133b7b069f27f19d035444032dda75bd (patch)
treeb2043015d51211d1515f272309de3d59ae8fe33a
parent4cce44b6c50a40ee13f423ae311d5db5a66a13f4 (diff)
downloadcmake-0c55729c133b7b069f27f19d035444032dda75bd.tar.gz
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.
-rw-r--r--Help/manual/cmake-variables.7.rst3
-rw-r--r--Help/variable/CMAKE_MAKE_PROGRAM.rst4
-rw-r--r--Help/variable/CMAKE_VS_DEVENV_COMMAND.rst14
-rw-r--r--Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst13
-rw-r--r--Help/variable/CMAKE_VS_MSDEV_COMMAND.rst10
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio10Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio6Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio6Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx8
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h2
11 files changed, 74 insertions, 0 deletions
diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst
index 59e8064432..d1176ad460 100644
--- a/Help/manual/cmake-variables.7.rst
+++ b/Help/manual/cmake-variables.7.rst
@@ -65,7 +65,10 @@ Variables that Provide Information
/variable/CMAKE_TWEAK_VERSION
/variable/CMAKE_VERBOSE_MAKEFILE
/variable/CMAKE_VERSION
+ /variable/CMAKE_VS_DEVENV_COMMAND
/variable/CMAKE_VS_INTEL_Fortran_PROJECT_VERSION
+ /variable/CMAKE_VS_MSBUILD_COMMAND
+ /variable/CMAKE_VS_MSDEV_COMMAND
/variable/CMAKE_VS_PLATFORM_TOOLSET
/variable/CMAKE_XCODE_PLATFORM_TOOLSET
/variable/PROJECT_BINARY_DIR
diff --git a/Help/variable/CMAKE_MAKE_PROGRAM.rst b/Help/variable/CMAKE_MAKE_PROGRAM.rst
index 0c851ad202..97caa8a647 100644
--- a/Help/variable/CMAKE_MAKE_PROGRAM.rst
+++ b/Help/variable/CMAKE_MAKE_PROGRAM.rst
@@ -29,6 +29,10 @@ to configure the project:
* The Visual Studio generators set this to the full path to
``MSBuild.exe`` (VS >= 10), ``devenv.com`` (VS 7,8,9),
``VCExpress.exe`` (VS Express 8,9), or ``msdev.exe`` (VS 6).
+ (See also variables
+ :variable:`CMAKE_VS_MSBUILD_COMMAND`,
+ :variable:`CMAKE_VS_DEVENV_COMMAND`, and
+ :variable:`CMAKE_VS_MSDEV_COMMAND`.)
These generators prefer to lookup the build tool at build time
rather than to store ``CMAKE_MAKE_PROGRAM`` in the CMake cache
diff --git a/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
new file mode 100644
index 0000000000..14cc50ac61
--- /dev/null
+++ b/Help/variable/CMAKE_VS_DEVENV_COMMAND.rst
@@ -0,0 +1,14 @@
+CMAKE_VS_DEVENV_COMMAND
+-----------------------
+
+The generators for :generator:`Visual Studio 7` and above set this
+variable to the ``devenv.com`` command installed with the corresponding
+Visual Studio version. Note that this variable may be empty on
+Visual Studio Express editions because they do not provide this tool.
+
+This variable is not defined by other generators even if ``devenv.com``
+is installed on the computer.
+
+The :variable:`CMAKE_VS_MSBUILD_COMMAND` is also provided for
+:generator:`Visual Studio 10 2010` and above.
+See also the :variable:`CMAKE_MAKE_PROGRAM` variable.
diff --git a/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst
new file mode 100644
index 0000000000..58f2bef4c3
--- /dev/null
+++ b/Help/variable/CMAKE_VS_MSBUILD_COMMAND.rst
@@ -0,0 +1,13 @@
+CMAKE_VS_MSBUILD_COMMAND
+------------------------
+
+The generators for :generator:`Visual Studio 10 2010` and above set this
+variable to the ``MSBuild.exe`` command installed with the corresponding
+Visual Studio version.
+
+This variable is not defined by other generators even if ``MSBuild.exe``
+is installed on the computer.
+
+The :variable:`CMAKE_VS_DEVENV_COMMAND` is also provided for the
+non-Express editions of Visual Studio.
+See also the :variable:`CMAKE_MAKE_PROGRAM` variable.
diff --git a/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst b/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst
new file mode 100644
index 0000000000..718baaf825
--- /dev/null
+++ b/Help/variable/CMAKE_VS_MSDEV_COMMAND.rst
@@ -0,0 +1,10 @@
+CMAKE_VS_MSDEV_COMMAND
+----------------------
+
+The :generator:`Visual Studio 6` generator sets this variable to the
+``msdev.exe`` command installed with Visual Studio 6.
+
+This variable is not defined by other generators even if ``msdev.exe``
+is installed on the computer.
+
+See also the :variable:`CMAKE_MAKE_PROGRAM` variable.
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 29401c6bff..d0fe5d943c 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -256,6 +256,14 @@ std::string cmGlobalVisualStudio10Generator::GetUserMacrosRegKeyBase()
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio10Generator::FindMakeProgram(cmMakefile* mf)
+{
+ this->cmGlobalVisualStudio8Generator::FindMakeProgram(mf);
+ mf->AddDefinition("CMAKE_VS_MSBUILD_COMMAND",
+ this->GetMSBuildCommand().c_str());
+}
+
+//----------------------------------------------------------------------------
std::string const& cmGlobalVisualStudio10Generator::GetMSBuildCommand()
{
if(!this->MSBuildCommandInitialized)
diff --git a/Source/cmGlobalVisualStudio10Generator.h b/Source/cmGlobalVisualStudio10Generator.h
index 66440ea664..976d41fa16 100644
--- a/Source/cmGlobalVisualStudio10Generator.h
+++ b/Source/cmGlobalVisualStudio10Generator.h
@@ -91,6 +91,8 @@ public:
virtual const char* GetToolsVersion() { return "4.0"; }
+ virtual void FindMakeProgram(cmMakefile*);
+
protected:
virtual const char* GetIDEVersion() { return "10.0"; }
diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx
index 8651da7b57..614a79af1d 100644
--- a/Source/cmGlobalVisualStudio6Generator.cxx
+++ b/Source/cmGlobalVisualStudio6Generator.cxx
@@ -78,6 +78,14 @@ void cmGlobalVisualStudio6Generator::GenerateConfigurations(cmMakefile* mf)
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio6Generator::FindMakeProgram(cmMakefile* mf)
+{
+ this->cmGlobalVisualStudioGenerator::FindMakeProgram(mf);
+ mf->AddDefinition("CMAKE_VS_MSDEV_COMMAND",
+ this->GetMSDevCommand().c_str());
+}
+
+//----------------------------------------------------------------------------
std::string const& cmGlobalVisualStudio6Generator::GetMSDevCommand()
{
if(!this->MSDevCommandInitialized)
diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h
index 8fe5792c9f..cb6cb8b5b7 100644
--- a/Source/cmGlobalVisualStudio6Generator.h
+++ b/Source/cmGlobalVisualStudio6Generator.h
@@ -89,6 +89,8 @@ public:
///! What is the configurations directory variable called?
virtual const char* GetCMakeCFGIntDir() const { return "$(IntDir)"; }
+ virtual void FindMakeProgram(cmMakefile*);
+
protected:
virtual const char* GetIDEVersion() { return "6.0"; }
private:
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 3d939f353a..35d7796e9e 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -111,6 +111,14 @@ void cmGlobalVisualStudio7Generator
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio7Generator::FindMakeProgram(cmMakefile* mf)
+{
+ this->cmGlobalVisualStudioGenerator::FindMakeProgram(mf);
+ mf->AddDefinition("CMAKE_VS_DEVENV_COMMAND",
+ this->GetDevEnvCommand().c_str());
+}
+
+//----------------------------------------------------------------------------
std::string const& cmGlobalVisualStudio7Generator::GetDevEnvCommand()
{
if(!this->DevEnvCommandInitialized)
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index c7b008190b..59e74baf11 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -107,6 +107,8 @@ public:
const char* GetIntelProjectVersion();
+ virtual void FindMakeProgram(cmMakefile*);
+
protected:
virtual const char* GetIDEVersion() { return "7.0"; }