[cmake-commits] hoffman committed cmFileCommand.cxx 1.56.2.5 1.56.2.6
cmListCommand.h 1.2.2.4 1.2.2.5 cmLocalGenerator.cxx 1.132.2.12
1.132.2.13 cmTryCompileCommand.h 1.18.2.1 1.18.2.2
cmXCodeObject.cxx 1.19.2.1 1.19.2.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon May 28 10:07:06 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv11377/Source
Modified Files:
Tag: CMake-2-4
cmFileCommand.cxx cmListCommand.h cmLocalGenerator.cxx
cmTryCompileCommand.h cmXCodeObject.cxx
Log Message:
ENH: merge in changes from branch RC 7
Index: cmLocalGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v
retrieving revision 1.132.2.12
retrieving revision 1.132.2.13
diff -u -d -r1.132.2.12 -r1.132.2.13
--- cmLocalGenerator.cxx 17 May 2007 18:41:52 -0000 1.132.2.12
+++ cmLocalGenerator.cxx 28 May 2007 14:07:04 -0000 1.132.2.13
@@ -1466,9 +1466,17 @@
// Some search paths should never be emitted
emitted.insert("");
- emitted.insert("/usr/lib");
- emitted.insert("/usr/lib32");
- emitted.insert("/usr/lib64");
+ if(const char* implicitLinks =
+ (this->Makefile->GetDefinition
+ ("CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES")))
+ {
+ std::vector<std::string> implicitLinkVec;
+ cmSystemTools::ExpandListArgument(implicitLinks, implicitLinkVec);
+ for(unsigned int k = 0; k < implicitLinkVec.size(); ++k)
+ {
+ emitted.insert(implicitLinkVec[k]);
+ }
+ }
std::string libPathFlag =
this->Makefile->GetRequiredDefinition("CMAKE_LIBRARY_PATH_FLAG");
std::string libLinkFlag =
Index: cmXCodeObject.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmXCodeObject.cxx,v
retrieving revision 1.19.2.1
retrieving revision 1.19.2.2
diff -u -d -r1.19.2.1 -r1.19.2.2
--- cmXCodeObject.cxx 14 May 2006 19:22:44 -0000 1.19.2.1
+++ cmXCodeObject.cxx 28 May 2007 14:07:04 -0000 1.19.2.2
@@ -192,7 +192,7 @@
}
bool needQuote = false;
this->String = "";
- if(ss.find_first_of(" <>.+-=") != ss.npos)
+ if(ss.find_first_of(" <>.+-=@") != ss.npos)
{
needQuote = true;
}
Index: cmListCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmListCommand.h,v
retrieving revision 1.2.2.4
retrieving revision 1.2.2.5
diff -u -d -r1.2.2.4 -r1.2.2.5
--- cmListCommand.h 13 Oct 2006 14:52:02 -0000 1.2.2.4
+++ cmListCommand.h 28 May 2007 14:07:04 -0000 1.2.2.5
@@ -79,9 +79,9 @@
"INSERT will insert elements to the list to the specified location.\n"
"When specifying an index, negative value corresponds to index from the"
" end of the list.\n"
- "REMOVE_AT and REMOVE_ITEM will remove item from the list. The "
+ "REMOVE_AT and REMOVE_ITEM will remove items from the list. The "
"difference is that REMOVE_ITEM will remove the given items, while "
- "REMOVE_AT will remove the item at the given indices.\n"
+ "REMOVE_AT will remove the items at the given indices.\n"
;
}
Index: cmTryCompileCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTryCompileCommand.h,v
retrieving revision 1.18.2.1
retrieving revision 1.18.2.2
diff -u -d -r1.18.2.1 -r1.18.2.2
--- cmTryCompileCommand.h 14 May 2006 19:22:44 -0000 1.18.2.1
+++ cmTryCompileCommand.h 28 May 2007 14:07:04 -0000 1.18.2.2
@@ -77,30 +77,41 @@
" TRY_COMPILE(RESULT_VAR bindir srcdir\n"
" projectName <targetname> <CMAKE_FLAGS <Flags>>\n"
" <OUTPUT_VARIABLE var>)\n"
- "Try compiling a program. Return the success or failure in "
- "RESULT_VAR. If <target name> is specified then build just that target "
+ "Try compiling a program. In this form, srcdir should contain a complete "
+ "CMake project with a CMakeLists.txt file and all sources. The bindir and "
+ "srcdir will not be deleted after this command is run. "
+ "If <target name> is specified then build just that target "
"otherwise the all or ALL_BUILD target is built.\n"
" TRY_COMPILE(RESULT_VAR bindir srcfile\n"
" <CMAKE_FLAGS <Flags>>\n"
" <COMPILE_DEFINITIONS <flags> ...>\n"
" <OUTPUT_VARIABLE var>)\n"
- "Try compiling a srcfile. Return the success or failure in "
- "RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags "
- "to cmake. Some extra flags that can be included are, "
+ "Try compiling a srcfile. In this case, the user need only supply a "
+ "source file. CMake will create the appropriate CMakeLists.txt file "
+ "to build the source. "
+ "In this version all files in bindir/CMakeFiles/CMakeTmp, "
+ "will be cleaned automatically, for debugging a --debug-trycompile can "
+ "be passed to cmake to avoid the clean. Some extra flags that "
+ " can be included are, "
"INCLUDE_DIRECTORIES, LINK_DIRECTORIES, and LINK_LIBRARIES. "
"COMPILE_DEFINITIONS are -Ddefinition that will be passed to the "
- "compile line. If srcfile is specified the files in "
- "bindir/CMakeFiles/CMakeTmp "
- "are cleaned automatically. If OUTPUT_VARIABLE is specified, then the "
- "output from the build process is stored in the given variable. "
+ "compile line. "
+
"TRY_COMPILE creates a CMakeList.txt "
- "file on the fly, and in that file it looks like this:\n"
+ "file on the fly that looks like this:\n"
" ADD_DEFINITIONS( <expanded COMPILE_DEFINITIONS from calling "
"cmake>)\n"
" INCLUDE_DIRECTORIES(${INCLUDE_DIRECTORIES})\n"
" LINK_DIRECTORIES(${LINK_DIRECTORIES})\n"
" ADD_EXECUTABLE(cmTryCompileExec sources)\n"
- " TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n";
+ " TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n"
+ "In both versions of the command, "
+ "if OUTPUT_VARIABLE is specified, then the "
+ "output from the build process is stored in the given variable. "
+ "Return the success or failure in "
+ "RESULT_VAR. CMAKE_FLAGS can be used to pass -DVAR:TYPE=VALUE flags "
+ "to the cmake that is run during the build. "
+ "";
}
cmTypeMacro(cmTryCompileCommand, cmCommand);
Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.56.2.5
retrieving revision 1.56.2.6
diff -u -d -r1.56.2.5 -r1.56.2.6
--- cmFileCommand.cxx 13 Oct 2006 14:52:02 -0000 1.56.2.5
+++ cmFileCommand.cxx 28 May 2007 14:07:04 -0000 1.56.2.6
@@ -452,9 +452,65 @@
}
return true;
}
+
+private:
+ bool InstallSymlink(const char* fromFile, const char* toFile, bool always);
};
//----------------------------------------------------------------------------
+bool cmFileInstaller::InstallSymlink(const char* fromFile, const char* toFile,
+ bool always)
+{
+ // Inform the user about this file installation.
+ std::string message = "Installing ";
+ message += toFile;
+ this->Makefile->DisplayStatus(message.c_str(), -1);
+
+ // Read the original symlink.
+ std::string symlinkTarget;
+ if(!cmSystemTools::ReadSymlink(fromFile, symlinkTarget))
+ {
+ cmOStringStream e;
+ e << "INSTALL cannot read symlink \"" << fromFile
+ << "\" to duplicate at \"" << toFile << "\".";
+ this->FileCommand->SetError(e.str().c_str());
+ return false;
+ }
+
+ // Compare the symlink value to that at the destination if not
+ // always installing.
+ if(!always)
+ {
+ std::string oldSymlinkTarget;
+ if(cmSystemTools::ReadSymlink(toFile, oldSymlinkTarget))
+ {
+ if(symlinkTarget == oldSymlinkTarget)
+ {
+ return true;
+ }
+ }
+ }
+
+ // Remove the destination file so we can always create the symlink.
+ cmSystemTools::RemoveFile(toFile);
+
+ // Create the symlink.
+ if(!cmSystemTools::CreateSymlink(symlinkTarget.c_str(), toFile))
+ {
+ cmOStringStream e;
+ e << "INSTALL cannot duplicate symlink \"" << fromFile
+ << "\" at \"" << toFile << "\".";
+ this->FileCommand->SetError(e.str().c_str());
+ return false;
+ }
+
+ // Add the file to the manifest.
+ this->ManifestAppend(toFile);
+
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmFileInstaller::InstallFile(const char* fromFile, const char* toFile,
bool always)
{
@@ -467,6 +523,12 @@
return true;
}
+ // Short-circuit for symbolic links.
+ if(cmSystemTools::FileIsSymlink(fromFile))
+ {
+ return this->InstallSymlink(fromFile, toFile, always);
+ }
+
// Inform the user about this file installation.
std::string message = "Installing ";
message += toFile;
@@ -519,6 +581,12 @@
return true;
}
+ // Short-circuit for symbolic links.
+ if(cmSystemTools::FileIsSymlink(source))
+ {
+ return this->InstallSymlink(source, destination, always);
+ }
+
// Inform the user about this directory installation.
std::string message = "Installing ";
message += destination;
More information about the Cmake-commits
mailing list