summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
Diffstat (limited to 'Source')
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDocumentVariables.cxx7
-rw-r--r--Source/cmDocumentGeneratorExpressions.h11
-rw-r--r--Source/cmDocumentVariables.cxx16
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx96
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h5
-rw-r--r--Source/cmGeneratorExpression.cxx55
-rw-r--r--Source/cmGeneratorExpression.h1
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmIfCommand.h7
-rw-r--r--Source/cmInstallCommand.h4
-rw-r--r--Source/cmListCommand.cxx18
-rw-r--r--Source/cmNinjaTargetGenerator.cxx36
13 files changed, 145 insertions, 117 deletions
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index c514d2b..88b859c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 9)
-set(CMake_VERSION_TWEAK 20120818)
+set(CMake_VERSION_TWEAK 20120820)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index edbef45..7fa401c 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -45,17 +45,18 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
" packaging.", "DESTDIR means DESTination DIRectory."
" It is commonly used by makefile "
"users in order to install software at non-default location. It "
- "is a basic relocation mechanism. "
+ "is a basic relocation mechanism that should not be used on"
+ " Windows (see CMAKE_INSTALL_PREFIX documentation). "
"It is usually invoked like this:\n"
" make DESTDIR=/home/john install\n"
"which will install the concerned software using the"
- " installation prefix, e.g. \"/usr/local\" prepended with "
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
"the DESTDIR value which finally gives \"/home/john/usr/local\"."
" When preparing a package, CPack first installs the items to be "
"packaged in a local (to the build tree) directory by using the "
"same DESTDIR mechanism. Nevertheless, if "
"CPACK_SET_DESTDIR is set then CPack will set DESTDIR before"
- " doing the local install. The most noticeable difference is"
+ " doing the local install. The most noticeable difference is"
" that without CPACK_SET_DESTDIR, CPack uses "
"CPACK_PACKAGING_INSTALL_PREFIX as a prefix whereas with "
"CPACK_SET_DESTDIR set, CPack will use CMAKE_INSTALL_PREFIX as"
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 5359013..74c673a 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -16,6 +16,9 @@
"Generator expressions are evaluted during build system generation " \
"to produce information specific to each build configuration. " \
"Valid expressions are:\n" \
+ " $<0:...> = empty string (ignores \"...\")\n" \
+ " $<1:...> = content of \"...\"\n" \
+ " $<CONFIG:cfg> = '1' if config is \"cfg\", else '0'\n" \
" $<CONFIGURATION> = configuration name\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
@@ -25,6 +28,12 @@
"versions can produce the directory and file name components:\n" \
" $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n" \
" $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n" \
- " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n"
+ " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n" \
+ "Boolean expressions:\n" \
+ " $<AND:?[,?]...> = '1' if all '?' are '1', else '0'\n" \
+ " $<OR:?[,?]...> = '0' if all '?' are '0', else '1'\n" \
+ " $<NOT:?> = '0' if '?' is '1', else '1'\n" \
+ "where '?' is always either '0' or '1'.\n" \
+ ""
#endif
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 05ef8fc..c2197f2 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -595,7 +595,21 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"If \"make install\" is invoked or INSTALL is built"
", this directory is pre-pended onto all install "
"directories. This variable defaults to /usr/local"
- " on UNIX and c:/Program Files on Windows.",false,
+ " on UNIX and c:/Program Files on Windows.\n"
+ "On UNIX one can use the DESTDIR mechanism in order"
+ " to relocate the whole installation. "
+ "DESTDIR means DESTination DIRectory. It is "
+ "commonly used by makefile users "
+ "in order to install software at non-default location. "
+ "It is usually invoked like this:\n"
+ " make DESTDIR=/home/john install\n"
+ "which will install the concerned software using the"
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
+ "the DESTDIR value which finally gives \"/home/john/usr/local\".\n"
+ "WARNING: DESTDIR may not be used on Windows because installation"
+ " prefix usually contains a drive letter like in \"C:/Program Files\""
+ " which cannot be pre-pended with some other prefix."
+ ,false,
"Variables That Change Behavior");
cm->DefineProperty
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 5c7d400..1f976f7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -462,18 +462,6 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
this->CreateLinksForTargets(fout);
}
- // I'm not sure this makes too much sense. There can be different
- // output directories in different subdirs, so we would need more of them.
-
- // for EXECUTABLE_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
- // for LIBRARY_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
-
fout << "\t</linkedResources>\n";
fout << "</projectDescription>\n";
@@ -610,6 +598,16 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
if (!inc->empty())
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
+
+ // handle framework include dirs on OSX, the remainder after the
+ // Frameworks/ part has to be stripped
+ // /System/Library/Frameworks/GLUT.framework/Headers
+ cmsys::RegularExpression frameworkRx("(.+/Frameworks)/.+\\.framework/");
+ if(frameworkRx.find(dir.c_str()))
+ {
+ dir = frameworkRx.match(1);
+ }
+
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);
@@ -761,18 +759,6 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
excludeFromOut += "**/CMakeFiles/";
fout << "<pathentry excluding=\"" << excludeFromOut
<< "\" kind=\"out\" path=\"\"/>\n";
- // add output entry for EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
- // - if it is a subdir of homeOutputDirectory, there is no need to add it
- // - if it is not then create a linked resource and add the linked name
- // but check it doesn't conflict with other linked resources names
- for (std::vector<std::string>::const_iterator
- it = this->OutLinkedResources.begin();
- it != this->OutLinkedResources.end();
- ++it)
- {
- fout << "<pathentry kind=\"out\" path=\"" << this->EscapeForXML(*it)
- << "\"/>\n";
- }
// add pre-processor definitions to allow eclipse to gray out sections
emmited.clear();
@@ -1317,65 +1303,3 @@ void cmExtraEclipseCDT4Generator
"\t\t</link>\n"
;
}
-
-bool cmExtraEclipseCDT4Generator
-::AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname)
-{
- if (defname.empty() && altdefname.empty())
- {
- return false;
- }
-
- std::string outputPath = (defname.empty() ? altdefname : defname);
-
- if (!cmSystemTools::FileIsFullPath(outputPath.c_str()))
- {
- outputPath = this->HomeOutputDirectory + "/" + outputPath;
- }
-
- // in this case it's not necessary:
- if (cmSystemTools::IsSubDirectory(outputPath.c_str(),
- this->HomeOutputDirectory.c_str()))
- {
- return false;
- }
-
- // in these two cases Eclipse would complain:
- if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
- outputPath.c_str()))
- {
- return false;
- }
- if (cmSystemTools::GetRealPath(outputPath.c_str())
- == cmSystemTools::GetRealPath(this->HomeOutputDirectory.c_str()))
- {
- return false;
- }
-
- std::string name = this->GetPathBasename(outputPath);
-
- // make sure linked resource name is unique
- while (this->GlobalGenerator->GetProjectMap().find(name)
- != this->GlobalGenerator->GetProjectMap().end())
- {
- name += "_";
- }
-
- if (std::find(this->OutLinkedResources.begin(),
- this->OutLinkedResources.end(),
- name)
- != this->OutLinkedResources.end())
- {
- return false;
- }
- else
- {
- this->AppendLinkedResource(fout, name,
- this->GetEclipsePath(outputPath), LinkToFolder);
- this->OutLinkedResources.push_back(name);
- return true;
- }
-}
-
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index ebd8c08..37ce65e 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -93,10 +93,6 @@ private:
const std::string& path,
LinkType linkType);
- bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname);
-
static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs);
@@ -109,7 +105,6 @@ private:
void CreateLinksForTargets(cmGeneratedFileStream& fout);
std::vector<std::string> SrcLinkedResources;
- std::vector<std::string> OutLinkedResources;
std::string HomeDirectory;
std::string HomeOutputDirectory;
bool IsOutOfSourceBuild;
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index f88ab0b..92bbf1d 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -14,6 +14,8 @@
#include "cmMakefile.h"
#include "cmTarget.h"
+#include <cmsys/String.h>
+
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
cmMakefile* mf, const char* config,
@@ -25,6 +27,7 @@ cmGeneratorExpression::cmGeneratorExpression(
"_FILE(|_NAME|_DIR):" // Filename component.
"([A-Za-z0-9_.-]+)" // Target name.
">$");
+ this->TestConfig.compile("^\\$<CONFIG:([A-Za-z0-9_]*)>$");
}
//----------------------------------------------------------------------------
@@ -103,6 +106,26 @@ bool cmGeneratorExpression::Evaluate()
}
//----------------------------------------------------------------------------
+static bool cmGeneratorExpressionBool(const char* c, std::string& result,
+ const char* name,
+ const char* a, const char* b)
+{
+ result = a;
+ while((c[0] == '0' || c[0] == '1') && (c[1] == ',' || c[1] == '>'))
+ {
+ if(c[0] == b[0]) { result = b; }
+ c += 2;
+ }
+ if(c[0])
+ {
+ result = name;
+ result += " requires one or more comma-separated '0' or '1' values.";
+ return false;
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGeneratorExpression::Evaluate(const char* expr, std::string& result)
{
if(this->TargetInfo.find(expr))
@@ -116,6 +139,38 @@ bool cmGeneratorExpression::Evaluate(const char* expr, std::string& result)
{
result = this->Config? this->Config : "";
}
+ else if(strncmp(expr, "$<0:",4) == 0)
+ {
+ result = "";
+ }
+ else if(strncmp(expr, "$<1:",4) == 0)
+ {
+ result = std::string(expr+4, strlen(expr)-5);
+ }
+ else if(strncmp(expr, "$<NOT:",6) == 0)
+ {
+ const char* c = expr+6;
+ if((c[0] != '0' && c[0] != '1') || c[1] != '>' || c[2])
+ {
+ result = "NOT requires exactly one '0' or '1' value.";
+ return false;
+ }
+ result = c[0] == '1'? "0" : "1";
+ }
+ else if(strncmp(expr, "$<AND:",6) == 0)
+ {
+ return cmGeneratorExpressionBool(expr+6, result, "AND", "1", "0");
+ }
+ else if(strncmp(expr, "$<OR:",5) == 0)
+ {
+ return cmGeneratorExpressionBool(expr+5, result, "OR", "0", "1");
+ }
+ else if(this->TestConfig.find(expr))
+ {
+ result = cmsysString_strcasecmp(this->TestConfig.match(1).c_str(),
+ this->Config? this->Config:"") == 0
+ ? "1":"0";
+ }
else
{
result = "Expression syntax not recognized.";
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 1a9d4c6..a023eb0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -51,6 +51,7 @@ private:
std::vector<char> Data;
std::stack<size_t> Barriers;
cmsys::RegularExpression TargetInfo;
+ cmsys::RegularExpression TestConfig;
std::set<cmTarget*> Targets;
bool Evaluate();
bool Evaluate(const char* expr, std::string& result);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ae92a0a..e8ab38f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -787,6 +787,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
{
sourcecode += ".fortran.f90";
}
+ else if(lang == "ASM")
+ {
+ sourcecode += ".asm";
+ }
//else
// {
// // Already specialized above or we leave sourcecode == "sourcecode"
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 4893a17..0a1fe06 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -149,7 +149,12 @@ public:
" if(file1 IS_NEWER_THAN file2)\n"
"True if file1 is newer than file2 or if one of the two files "
"doesn't exist. "
- "Behavior is well-defined only for full paths.\n"
+ "Behavior is well-defined only for full paths. "
+ "If the file time stamps are exactly the same, an "
+ "IS_NEWER_THAN comparison returns true, so that any dependent "
+ "build operations will occur in the event of a tie. "
+ "This includes the case of passing the same file name for both "
+ "file1 and file2.\n"
" if(IS_DIRECTORY directory-name)\n"
"True if the given name is a directory. "
"Behavior is well-defined only for full paths.\n"
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 76e622e..7c06009 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -70,7 +70,9 @@ public:
"the directory on disk to which a file will be installed. "
"If a full path (with a leading slash or drive letter) is given it "
"is used directly. If a relative path is given it is interpreted "
- "relative to the value of CMAKE_INSTALL_PREFIX.\n"
+ "relative to the value of CMAKE_INSTALL_PREFIX. The prefix can "
+ "be relocated at install time using DESTDIR mechanism explained in the "
+ "CMAKE_INSTALL_PREFIX variable documentation.\n"
"PERMISSIONS arguments specify permissions for installed files. "
"Valid permissions are "
"OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, "
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 9d4f175..7848424 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -429,6 +429,12 @@ bool cmListCommand
this->SetError("sub-command REVERSE requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command REVERSE only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
@@ -463,6 +469,12 @@ bool cmListCommand
"sub-command REMOVE_DUPLICATES requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command REMOVE_DUPLICATES only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
@@ -506,6 +518,12 @@ bool cmListCommand
this->SetError("sub-command SORT requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command SORT only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 3532c8b..b6bdfdc 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -342,24 +342,26 @@ cmNinjaTargetGenerator
cmMakefile* mf = this->GetMakefile();
bool useClDeps = false;
+ std::string clBinary;
std::string clDepsBinary;
std::string clShowPrefix;
if (lang == "C" || lang == "CXX" || lang == "RC")
{
- const char* depsPtr = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
- const char* showPtr = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
- if (depsPtr && showPtr)
+ clDepsBinary = mf->GetSafeDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+ if (!clDepsBinary.empty() &&
+ !this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile())
{
- // don't wrap for try_compile,
- // TODO but why doesn't it work with cmcldeps?
- const std::string projectName = mf->GetProjectName() ?
- mf->GetProjectName() : "";
- if (projectName != "CMAKE_TRY_COMPILE")
+ clShowPrefix = mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
+ clBinary = mf->GetDefinition("CMAKE_C_COMPILER") ?
+ mf->GetSafeDefinition("CMAKE_C_COMPILER") :
+ mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
+ if (!clBinary.empty() && !clShowPrefix.empty())
{
useClDeps = true;
- std::string qu = "\"";
- clDepsBinary = qu + depsPtr + qu;
- clShowPrefix = qu + showPtr + qu;
+ const std::string quote = " \"";
+ clBinary = quote + clBinary + "\" ";
+ clDepsBinary = quote + clDepsBinary + "\" ";
+ clShowPrefix = quote + clShowPrefix + "\" ";
vars.DependencyFile = "$DEP_FILE";
}
}
@@ -393,16 +395,14 @@ cmNinjaTargetGenerator
i != compileCmds.end(); ++i)
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
- std::string cmdLine =
- this->GetLocalGenerator()->BuildCommandLine(compileCmds);
-
+ std::string cmdLine;
if(useClDeps)
{
- std::string cl = mf->GetDefinition("CMAKE_C_COMPILER");
- cl = "\"" + cl + "\" ";
- cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
- + clShowPrefix + " " + cl + cmdLine;
+ cmdLine = clDepsBinary + lang + " $in \"$DEP_FILE\" $out " +
+ clShowPrefix + clBinary;
}
+ cmdLine += this->GetLocalGenerator()->BuildCommandLine(compileCmds);
+
// Write the rule for compiling file of the given language.
cmOStringStream comment;