summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2011-06-24 17:32:03 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2011-06-24 17:32:03 -0400
commit4ccf44bcb2ab5bbacb172790f0fa55cba13522a0 (patch)
treefe68cb39f9342d5eef92566ccfa743804b5beea3
parent26607e9ae32ab8e62a94cbf9b93f8653a3a7756a (diff)
parent8555c2b4b768037a37705ef7f2486149ae3cdc13 (diff)
downloadcmake-4ccf44bcb2ab5bbacb172790f0fa55cba13522a0.tar.gz
Merge topic 'use_devenv_forvs2010'
8555c2b Look for VCExpress as a possible build tool as well as devenv. ed0075b Use relative paths for custom command inputs. 38368d5 Revert "With very long file names, VS 2010 was unable to compile files." 8cd66dc Use devenv instead of msbuild for vs2010.
-rw-r--r--Modules/CMakeVS10FindMake.cmake29
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx16
3 files changed, 37 insertions, 11 deletions
diff --git a/Modules/CMakeVS10FindMake.cmake b/Modules/CMakeVS10FindMake.cmake
index af5f3a7d52..388203cabb 100644
--- a/Modules/CMakeVS10FindMake.cmake
+++ b/Modules/CMakeVS10FindMake.cmake
@@ -1,6 +1,6 @@
#=============================================================================
-# Copyright 2009 Kitware, Inc.
+# Copyright 2007-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -12,17 +12,28 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# We use MSBuild as the build tool for VS 10
+# VCExpress does not support cross compiling, which is necessary for Win CE
+SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
+IF(NOT CMAKE_CROSSCOMPILING)
+ SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
+ENDIF(NOT CMAKE_CROSSCOMPILING)
+
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
- NAMES MSBuild
+ NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
HINTS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
- "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
- "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
- "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/"
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup;Dbghelp_path]
+ "$ENV{ProgramFiles}/Microsoft Visual Studio 10.0/Common7/IDE"
+ "$ENV{ProgramFiles}/Microsoft Visual Studio10.0/Common7/IDE"
+ "$ENV{ProgramFiles}/Microsoft Visual Studio 10/Common7/IDE"
+ "$ENV{ProgramFiles}/Microsoft Visual Studio10/Common7/IDE"
+ "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10.0/Common7/IDE"
+ "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10.0/Common7/IDE"
+ "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio 10/Common7/IDE"
+ "$ENV{ProgramFiles} (x86)/Microsoft Visual Studio10/Common7/IDE"
+ "/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/"
+ "/Program Files/Microsoft Visual Studio 10/Common7/IDE/"
)
-
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC10 1)
SET(MSVC_VERSION 1600)
-
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 6c3c1eded2..328a3da630 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -123,7 +123,8 @@ std::string cmGlobalVisualStudio10Generator
cmSystemTools::LowerCase(lowerCaseCommand);
// If makeProgram is devenv, parent class knows how to generate command:
- if (lowerCaseCommand.find("devenv") != std::string::npos)
+ if (lowerCaseCommand.find("devenv") != std::string::npos ||
+ lowerCaseCommand.find("VCExpress") != std::string::npos)
{
return cmGlobalVisualStudio7Generator::GenerateBuildCommand(makeProgram,
projectName, additionalOptions, targetName, config, ignoreErrors, fast);
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2a4ff92109..d710405e42 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -378,7 +378,11 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
this->WriteString("<CustomBuild Include=\"", 2);
- std::string path = sourcePath;
+ // custom command have to use relative paths or they do not
+ // show up in the GUI
+ std::string path = cmSystemTools::RelativePath(
+ this->Makefile->GetCurrentOutputDirectory(),
+ sourcePath.c_str());
this->ConvertToWindowsSlash(path);
(*this->BuildFileStream ) << path << "\">\n";
for(std::vector<std::string>::iterator i = configs->begin();
@@ -619,6 +623,14 @@ WriteGroupSources(const char* name,
const char* filter = sourceGroup.GetFullName();
this->WriteString("<", 2);
std::string path = source;
+ // custom command sources must use relative paths or they will
+ // not show up in the GUI.
+ if(sf->GetCustomCommand())
+ {
+ path = cmSystemTools::RelativePath(
+ this->Makefile->GetCurrentOutputDirectory(),
+ source.c_str());
+ }
this->ConvertToWindowsSlash(path);
(*this->BuildFileStream) << name << " Include=\""
<< path;
@@ -706,6 +718,8 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
bool rc = lang && (strcmp(lang, "RC") == 0);
bool idl = ext == "idl";
std::string sourceFile = (*source)->GetFullPath();
+ // do not use a relative path here because it means that you
+ // can not use as long a path to the file.
this->ConvertToWindowsSlash(sourceFile);
// output the source file
if(header)