summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-11-10 10:12:56 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2006-11-10 10:12:56 -0500
commitc8c3bd7acd88455772f0301062856e0d9622db31 (patch)
treefdec66913bf2cccfe2ad889798cd337fb1b35ab7
parentda21bc79bb50059a658c9f7304852b5a307e92a1 (diff)
downloadcmake-c8c3bd7acd88455772f0301062856e0d9622db31.tar.gz
ENH: merge from main tree fix for vs all build qt and mpi2
-rw-r--r--Modules/FindMPI.cmake4
-rw-r--r--Modules/FindQt4.cmake4
-rw-r--r--Modules/readme.txt3
-rw-r--r--Source/CTest/cmCTestBuildHandler.cxx3
-rw-r--r--Source/cmGlobalGenerator.cxx59
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx11
-rw-r--r--Source/cmGlobalVisualStudio71Generator.h2
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx33
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx4
-rw-r--r--Source/cmGlobalVisualStudio8Generator.h2
-rw-r--r--Source/cmSetTargetPropertiesCommand.h4
-rw-r--r--Source/cmake.cxx1
-rw-r--r--Source/cmake.h1
-rw-r--r--Tests/Complex/CMakeLists.txt11
-rw-r--r--Tests/ComplexOneConfig/CMakeLists.txt11
-rw-r--r--Tests/ComplexRelativePaths/CMakeLists.txt11
18 files changed, 153 insertions, 18 deletions
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index 03f3631e5e..cf39cf6774 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -10,13 +10,15 @@ FIND_PATH(MPI_INCLUDE_PATH mpi.h
/usr/include/mpi
/usr/local/mpi/include
"$ENV{ProgramFiles}/MPICH/SDK/Include"
+ "$ENV{ProgramFiles}/MPICH2/include"
"C:/Program Files/MPICH/SDK/Include"
)
FIND_LIBRARY(MPI_LIBRARY
- NAMES mpi mpich
+ NAMES mpich2 mpi mpich
PATHS /usr/lib /usr/local/lib /usr/local/mpi/lib
"$ENV{ProgramFiles}/MPICH/SDK/Lib"
+ "$ENV{ProgramFiles}/MPICH2/Lib"
"C:/Program Files/MPICH/SDK/Lib"
)
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index 4a401ed2dc..fd0e32202d 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -560,8 +560,8 @@ IF (QT4_QMAKE_FOUND)
ENDIF( NOT QT_QTCORE_LIBRARY_DEBUG AND NOT QT_QTCORE_LIBRARY_RELEASE )
# Set QT_QTASSISTANT_LIBRARY
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
- FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd QtAssistantClient_debug QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_RELEASE NAMES QtAssistantClient QtAssistantClient4 QtAssistant QtAssistant4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
+ FIND_LIBRARY(QT_QTASSISTANT_LIBRARY_DEBUG NAMES QtAssistantClientd QtAssistantClientd4 QtAssistantClient_debug QtAssistant_debug QtAssistantd4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
# Set QT_QTDESIGNER_LIBRARY
FIND_LIBRARY(QT_QTDESIGNER_LIBRARY_RELEASE NAMES QtDesigner QtDesigner4 PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
diff --git a/Modules/readme.txt b/Modules/readme.txt
index 4c31b6b691..2e630116b1 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -15,6 +15,9 @@ XXX_VERSION_YY Expect Version YY if true. Make sure at most one of these is eve
XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
+XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.
+ The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.
+ This should not be a cache entry.
You do not have to provide all of the above variables. You should provide XXX_FOUND under most circumstances. If XXX is a library, then XXX_LIBRARIES, should also be defined, and XXX_INCLUDE_DIRS should usually be defined (I guess libm.a might be an exception)
diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 9bbb4a2597..8b960f5c17 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -833,7 +833,8 @@ void cmCTestBuildHandler::ProcessBuffer(const char* data, int length,
{
// This is not an error or warning.
// So, figure out if this is a post-context line
- if ( this->LastErrorOrWarning != this->ErrorsAndWarnings.end() &&
+ if ( this->ErrorsAndWarnings.size() &&
+ this->LastErrorOrWarning != this->ErrorsAndWarnings.end() &&
this->PostContextCount < this->MaxPostContext )
{
this->PostContextCount ++;
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 6b2b0519c9..662f364bde 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -591,6 +591,30 @@ void cmGlobalGenerator::ClearEnabledLanguages()
this->LanguageEnabled.clear();
}
+bool cmGlobalGenerator::IsDependedOn(const char* project,
+ cmTarget* targetIn)
+{
+ // Get all local gens for this project
+ std::vector<cmLocalGenerator*>* gens = &this->ProjectMap[project];
+ // loop over local gens and get the targets for each one
+ for(unsigned int i = 0; i < gens->size(); ++i)
+ {
+ cmTargets& targets = (*gens)[i]->GetMakefile()->GetTargets();
+ for (cmTargets::iterator l = targets.begin();
+ l != targets.end(); l++)
+ {
+ cmTarget& target = l->second;
+ std::set<cmStdString>::const_iterator i =
+ target.GetUtilities().find(targetIn->GetName());
+ if(i != target.GetUtilities().end())
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
void cmGlobalGenerator::Configure()
{
// Delete any existing cmLocalGenerators
@@ -1395,12 +1419,16 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
singleLine.push_back(this->GetCMakeInstance()->GetCTestCommand());
+ singleLine.push_back("--force-new-ctest-process");
if(cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.')
{
singleLine.push_back("-C");
singleLine.push_back(mf->GetDefinition("CMAKE_CFG_INTDIR"));
}
- singleLine.push_back("--force-new-ctest-process");
+ else // TODO: This is a hack. Should be something to do with the generator
+ {
+ singleLine.push_back("$(ARGS)");
+ }
cpackCommandLines.push_back(singleLine);
(*targets)[this->GetTestTargetName()]
= this->CreateGlobalTarget(this->GetTestTargetName(),
@@ -1464,6 +1492,35 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
//Install
if(this->InstallTargetEnabled)
{
+ if(!cmakeCfgIntDir || !*cmakeCfgIntDir || cmakeCfgIntDir[0] == '.')
+ {
+ std::set<cmStdString>* componentsSet = &this->InstallComponents;
+ cpackCommandLines.erase(cpackCommandLines.begin(),
+ cpackCommandLines.end());
+ depends.erase(depends.begin(), depends.end());
+ cmOStringStream ostr;
+ if ( componentsSet->size() > 0 )
+ {
+ ostr << "Available install components are:";
+ std::set<cmStdString>::iterator it;
+ for (
+ it = componentsSet->begin();
+ it != componentsSet->end();
+ ++ it )
+ {
+ ostr << " \"" << it->c_str() << "\"";
+ }
+ }
+ else
+ {
+ ostr << "Only default component available";
+ }
+ singleLine.push_back(ostr.str().c_str());
+ (*targets)["list_install_components"]
+ = this->CreateGlobalTarget("list_install_components",
+ ostr.str().c_str(),
+ &cpackCommandLines, depends);
+ }
std::string cmd;
cpackCommandLines.erase(cpackCommandLines.begin(),
cpackCommandLines.end());
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index d95a5552ec..90a907e440 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -168,6 +168,9 @@ public:
///! Find a target by name by searching the local generators.
cmTarget* FindTarget(const char* project, const char* name);
+ /** If check to see if the target is linked to by any other
+ target in the project */
+ bool IsDependedOn(const char* project, cmTarget* target);
///! Find a local generator by its startdirectory
cmLocalGenerator* FindLocalGenerator(const char* start_dir);
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 1c2ffe453d..ddddc218fc 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -254,13 +254,16 @@ void cmGlobalVisualStudio71Generator
const cmCustomCommandLines& cmds = cc.GetCommandLines();
std::string project = cmds[0][0];
this->WriteProjectConfigurations(fout, project.c_str(),
- l->second.GetType());
+ true);
}
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
{
+ bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
+ root->GetMakefile()->GetProjectName(),
+ &l->second);
this->WriteProjectConfigurations(fout, si->c_str(),
- l->second.GetType());
+ partOfDefaultBuild);
++si;
}
}
@@ -415,7 +418,7 @@ void cmGlobalVisualStudio71Generator
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio71Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -423,7 +426,7 @@ void cmGlobalVisualStudio71Generator
{
fout << "\t\t{" << guid << "}." << *i
<< ".ActiveCfg = " << *i << "|Win32\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< ".Build.0 = " << *i << "|Win32\n";
diff --git a/Source/cmGlobalVisualStudio71Generator.h b/Source/cmGlobalVisualStudio71Generator.h
index d90c64bac0..d99bc197b9 100644
--- a/Source/cmGlobalVisualStudio71Generator.h
+++ b/Source/cmGlobalVisualStudio71Generator.h
@@ -55,7 +55,7 @@ protected:
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
virtual void WriteExternalProject(std::ostream& fout, const char* name,
const char* path,
const std::vector<std::string>& depends);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index d869d001f5..b2d0cc322c 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -537,13 +537,16 @@ void cmGlobalVisualStudio7Generator
const cmCustomCommandLines& cmds = cc.GetCommandLines();
std::string name = cmds[0][0];
this->WriteProjectConfigurations(fout, name.c_str(),
- l->second.GetType());
+ true);
}
else if ((l->second.GetType() != cmTarget::INSTALL_FILES)
&& (l->second.GetType() != cmTarget::INSTALL_PROGRAMS))
{
+ bool partOfDefaultBuild = this->IsPartOfDefaultBuild(
+ root->GetMakefile()->GetProjectName(),
+ &l->second);
this->WriteProjectConfigurations(fout, si->c_str(),
- l->second.GetType());
+ partOfDefaultBuild);
++si;
}
}
@@ -667,7 +670,7 @@ cmGlobalVisualStudio7Generator
// executables to the libraries it uses are also done here
void cmGlobalVisualStudio7Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -675,7 +678,7 @@ void cmGlobalVisualStudio7Generator
{
fout << "\t\t{" << guid << "}." << *i
<< ".ActiveCfg = " << *i << "|Win32\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< ".Build.0 = " << *i << "|Win32\n";
@@ -799,3 +802,25 @@ cmGlobalVisualStudio7Generator
dir += suffix;
}
}
+
+bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project,
+ cmTarget* target)
+{
+ if(target->GetPropertyAsBool("EXCLUDE_FROM_DEFAULT_BUILD"))
+ {
+ return false;
+ }
+ // if it is a utilitiy target then only make it part of the
+ // default build if another target depends on it
+ int type = target->GetType();
+ if (type == cmTarget::GLOBAL_TARGET)
+ {
+ return false;
+ }
+ if(type == cmTarget::UTILITY)
+ {
+ return this->IsDependedOn(project, target);
+ }
+ // default is to be part of the build
+ return true;
+}
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index 028691db51..1229884540 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -107,7 +107,7 @@ protected:
const char* name, const char* path, cmTarget &t);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
virtual void WriteSLNFooter(std::ostream& fout);
virtual void WriteSLNHeader(std::ostream& fout);
virtual void AddPlatformDefinitions(cmMakefile* mf);
@@ -120,6 +120,8 @@ protected:
std::string ConvertToSolutionPath(const char* path);
+ bool IsPartOfDefaultBuild(const char* project,
+ cmTarget* target);
std::vector<std::string> Configurations;
std::map<cmStdString, cmStdString> GUIDMap;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 176c036a89..6be74b1893 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -228,7 +228,7 @@ cmGlobalVisualStudio8Generator
void
cmGlobalVisualStudio8Generator
::WriteProjectConfigurations(std::ostream& fout, const char* name,
- int targetType)
+ bool partOfDefaultBuild)
{
std::string guid = this->GetGUID(name);
for(std::vector<std::string>::iterator i = this->Configurations.begin();
@@ -237,7 +237,7 @@ cmGlobalVisualStudio8Generator
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".ActiveCfg = "
<< *i << "|" << this->PlatformName << "\n";
- if(targetType != cmTarget::GLOBAL_TARGET)
+ if(partOfDefaultBuild)
{
fout << "\t\t{" << guid << "}." << *i
<< "|" << this->PlatformName << ".Build.0 = "
diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h
index fdc8316104..68a2335613 100644
--- a/Source/cmGlobalVisualStudio8Generator.h
+++ b/Source/cmGlobalVisualStudio8Generator.h
@@ -57,7 +57,7 @@ protected:
virtual void WriteSolutionConfigurations(std::ostream& fout);
virtual void WriteProjectConfigurations(std::ostream& fout,
const char* name,
- int targetType);
+ bool partOfDefaultBuild);
std::string PlatformName; // Win32 or x64
};
#endif
diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h
index cf777a6713..009127f48e 100644
--- a/Source/cmSetTargetPropertiesCommand.h
+++ b/Source/cmSetTargetPropertiesCommand.h
@@ -149,6 +149,10 @@ public:
"installing a target. They are used only when the old "
"INSTALL_TARGETS command is used to install the target. Use the "
"INSTALL command instead."
+ "\n"
+ "The EXCLUDE_FROM_DEFAULT_BUILD property is used by the visual "
+ "studio generators. If it is set to 1 the target will not be "
+ "part of the default build when you select \"Build Solution\"."
;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d7a89c69b1..c98664cc95 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1307,6 +1307,7 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
return 1;
}
+//----------------------------------------------------------------------------
void cmake::GetRegisteredGenerators(std::vector<std::string>& names)
{
for(RegisteredGeneratorsMap::const_iterator i = this->Generators.begin();
diff --git a/Source/cmake.h b/Source/cmake.h
index a870676b09..d5a7b3b7d9 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -284,6 +284,7 @@ class cmake
// Do we want debug output during the cmake run.
bool GetDebugOutput() { return this->DebugOutput; }
void DebugOutputOn() { this->DebugOutput = true;}
+
protected:
typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
typedef std::map<cmStdString,
diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt
index 5a28e56793..deb0800e1e 100644
--- a/Tests/Complex/CMakeLists.txt
+++ b/Tests/Complex/CMakeLists.txt
@@ -53,6 +53,17 @@ ENDMACRO(TEST_VAR_ARG)
TEST_VAR_ARG(1 2 3)
+# Floating-point comparison test.
+IF(2.4 LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
+ENDIF(2.4 LESS 2.4)
+IF(2.4 GREATER 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
+ENDIF(2.4 GREATER 2.4)
+IF(NOT 2.4 EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
+ENDIF(NOT 2.4 EQUAL 2.4)
+
#
# Use the ansi CXX compile flag for building cmake
#
diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt
index 5a28e56793..deb0800e1e 100644
--- a/Tests/ComplexOneConfig/CMakeLists.txt
+++ b/Tests/ComplexOneConfig/CMakeLists.txt
@@ -53,6 +53,17 @@ ENDMACRO(TEST_VAR_ARG)
TEST_VAR_ARG(1 2 3)
+# Floating-point comparison test.
+IF(2.4 LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
+ENDIF(2.4 LESS 2.4)
+IF(2.4 GREATER 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
+ENDIF(2.4 GREATER 2.4)
+IF(NOT 2.4 EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
+ENDIF(NOT 2.4 EQUAL 2.4)
+
#
# Use the ansi CXX compile flag for building cmake
#
diff --git a/Tests/ComplexRelativePaths/CMakeLists.txt b/Tests/ComplexRelativePaths/CMakeLists.txt
index 5a28e56793..deb0800e1e 100644
--- a/Tests/ComplexRelativePaths/CMakeLists.txt
+++ b/Tests/ComplexRelativePaths/CMakeLists.txt
@@ -53,6 +53,17 @@ ENDMACRO(TEST_VAR_ARG)
TEST_VAR_ARG(1 2 3)
+# Floating-point comparison test.
+IF(2.4 LESS 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4")
+ENDIF(2.4 LESS 2.4)
+IF(2.4 GREATER 2.4)
+ MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4")
+ENDIF(2.4 GREATER 2.4)
+IF(NOT 2.4 EQUAL 2.4)
+ MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4")
+ENDIF(NOT 2.4 EQUAL 2.4)
+
#
# Use the ansi CXX compile flag for building cmake
#