[Cmake-commits] [cmake-commits] hoffman committed CMakeLists.txt 1.431 1.432 cmGlobalJOMMakefileGenerator.cxx NONE 1.1 cmGlobalJOMMakefileGenerator.h NONE 1.1 cmSystemTools.cxx 1.409 1.410 cmSystemTools.h 1.163 1.164 cmake.cxx 1.436 1.437
cmake-commits at cmake.org
cmake-commits at cmake.org
Thu Nov 5 15:00:17 EST 2009
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv13420
Modified Files:
CMakeLists.txt cmSystemTools.cxx cmSystemTools.h cmake.cxx
Added Files:
cmGlobalJOMMakefileGenerator.cxx
cmGlobalJOMMakefileGenerator.h
Log Message:
Add JOM support and clean up some of the tar -E stuff
Index: cmSystemTools.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.h,v
retrieving revision 1.163
retrieving revision 1.164
diff -C 2 -d -r1.163 -r1.164
*** cmSystemTools.h 28 Sep 2009 15:42:49 -0000 1.163
--- cmSystemTools.h 5 Nov 2009 20:00:15 -0000 1.164
***************
*** 355,365 ****
/** Create tar */
static bool ListTar(const char* outFileName,
- std::vector<cmStdString>& files,
bool gzip, bool verbose);
static bool CreateTar(const char* outFileName,
const std::vector<cmStdString>& files, bool gzip,
! bool verbose);
! static bool ExtractTar(const char* inFileName,
! const std::vector<cmStdString>& files, bool gzip,
bool verbose);
// This should be called first thing in main
--- 355,363 ----
/** Create tar */
static bool ListTar(const char* outFileName,
bool gzip, bool verbose);
static bool CreateTar(const char* outFileName,
const std::vector<cmStdString>& files, bool gzip,
! bool bzip2, bool verbose);
! static bool ExtractTar(const char* inFileName, bool gzip,
bool verbose);
// This should be called first thing in main
--- NEW FILE: cmGlobalJOMMakefileGenerator.h ---
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#ifndef cmGlobalJOMMakefileGenerator_h
#define cmGlobalJOMMakefileGenerator_h
#include "cmGlobalUnixMakefileGenerator3.h"
/** \class cmGlobalJOMMakefileGenerator
* \brief Write a JOM makefiles.
*
* cmGlobalJOMMakefileGenerator manages nmake build process for a tree
*/
class cmGlobalJOMMakefileGenerator : public cmGlobalUnixMakefileGenerator3
{
public:
cmGlobalJOMMakefileGenerator();
static cmGlobalGenerator* New() {
return new cmGlobalJOMMakefileGenerator; }
///! Get the name for the generator.
virtual const char* GetName() const {
return cmGlobalJOMMakefileGenerator::GetActualName();}
static const char* GetActualName() {return "JOM Makefiles";}
/** Get the documentation entry for this generator. */
virtual void GetDocumentation(cmDocumentationEntry& entry) const;
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator();
/**
* Try to determine system infomation such as shared library
* extension, pthreads, byte order etc.
*/
virtual void EnableLanguage(std::vector<std::string>const& languages,
cmMakefile *, bool optional);
};
#endif
Index: cmSystemTools.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSystemTools.cxx,v
retrieving revision 1.409
retrieving revision 1.410
diff -C 2 -d -r1.409 -r1.410
*** cmSystemTools.cxx 5 Nov 2009 16:37:47 -0000 1.409
--- cmSystemTools.cxx 5 Nov 2009 20:00:15 -0000 1.410
***************
*** 1705,1709 ****
bool cmSystemTools::CreateTar(const char* outFileName,
const std::vector<cmStdString>& files,
! bool gzip, bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
--- 1705,1709 ----
bool cmSystemTools::CreateTar(const char* outFileName,
const std::vector<cmStdString>& files,
! bool gzip, bool bzip2, bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
***************
*** 1756,1759 ****
--- 1756,1767 ----
}
}
+ if(bzip2)
+ {
+ res = archive_write_set_compression_bzip2(a);
+ if(res != ARCHIVE_OK)
+ {
+ cmSystemTools::Error("Unable to use bzip2 in libarchive");
+ }
+ }
res = archive_write_set_format_ustar(a);
if(res != ARCHIVE_OK)
***************
*** 1823,1827 ****
#define BSDTAR_FILESIZE_TYPE unsigned long
void
! list_item_verbose(FILE *out, struct archive_entry *entry)
{
char tmp[100];
--- 1831,1835 ----
#define BSDTAR_FILESIZE_TYPE unsigned long
void
! list_item_verbose(FILE *out, struct archive_entry *entry)
{
char tmp[100];
***************
*** 1863,1867 ****
}
fprintf(out, "%-*s ", (int)u_width, p);
-
/* Use gname if it's present, else gid. */
p = archive_entry_gname(entry);
--- 1871,1874 ----
***************
*** 1906,1910 ****
}
fprintf(out, "%*s", (int)(gs_width - w), tmp);
!
/* Format the time using 'ls -l' conventions. */
tim = archive_entry_mtime(entry);
--- 1913,1917 ----
}
fprintf(out, "%*s", (int)(gs_width - w), tmp);
!
/* Format the time using 'ls -l' conventions. */
tim = archive_entry_mtime(entry);
***************
*** 1927,1931 ****
fprintf(out, " %s ", tmp);
fprintf(out, "%s", archive_entry_pathname(entry));
!
/* Extra information for links. */
if (archive_entry_hardlink(entry)) /* Hard link */
--- 1934,1938 ----
fprintf(out, " %s ", tmp);
fprintf(out, "%s", archive_entry_pathname(entry));
!
/* Extra information for links. */
if (archive_entry_hardlink(entry)) /* Hard link */
***************
*** 1968,1972 ****
}
! bool extract_tar(const char* outFileName, bool verbose, bool extract)
{
struct archive* a = archive_read_new();
--- 1975,1980 ----
}
! bool extract_tar(const char* outFileName, bool verbose,
! bool extract)
{
struct archive* a = archive_read_new();
***************
*** 2039,2046 ****
bool cmSystemTools::ExtractTar(const char* outFileName,
- const std::vector<cmStdString>& files,
bool , bool verbose)
{
- (void)files;
#if defined(CMAKE_BUILD_WITH_CMAKE)
return extract_tar(outFileName, verbose, true);
--- 2047,2052 ----
***************
*** 2053,2061 ****
bool cmSystemTools::ListTar(const char* outFileName,
! std::vector<cmStdString>& files, bool ,
bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
- (void)files;
return extract_tar(outFileName, verbose, false);
#else
--- 2059,2066 ----
bool cmSystemTools::ListTar(const char* outFileName,
! bool ,
bool verbose)
{
#if defined(CMAKE_BUILD_WITH_CMAKE)
return extract_tar(outFileName, verbose, false);
#else
Index: cmake.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmake.cxx,v
retrieving revision 1.436
retrieving revision 1.437
diff -C 2 -d -r1.436 -r1.437
*** cmake.cxx 22 Oct 2009 12:24:11 -0000 1.436
--- cmake.cxx 5 Nov 2009 20:00:15 -0000 1.437
***************
*** 68,71 ****
--- 68,72 ----
# include "cmGlobalBorlandMakefileGenerator.h"
# include "cmGlobalNMakeMakefileGenerator.h"
+ # include "cmGlobalJOMMakefileGenerator.h"
# include "cmGlobalWatcomWMakeGenerator.h"
# define CMAKE_HAVE_VS_GENERATORS
***************
*** 970,974 ****
<< " remove [-f] file1 file2 ... - remove the file(s), use -f to force "
"it\n"
! << " tar [cxt][vfz] file.tar file/dir1 file/dir2 ... - create a tar "
"archive\n"
<< " time command [args] ... - run command and return elapsed time\n"
--- 971,975 ----
<< " remove [-f] file1 file2 ... - remove the file(s), use -f to force "
"it\n"
! << " tar [cxt][vfz][cvfj] file.tar file/dir1 file/dir2 ... - create a tar "
"archive\n"
<< " time command [args] ... - run command and return elapsed time\n"
***************
*** 1541,1545 ****
--- 1542,1551 ----
}
bool gzip = false;
+ bool bzip2 = false;
bool verbose = false;
+ if ( flags.find_first_of('j') != flags.npos )
+ {
+ bzip2 = true;
+ }
if ( flags.find_first_of('z') != flags.npos )
{
***************
*** 1553,1557 ****
if ( flags.find_first_of('t') != flags.npos )
{
! if ( !cmSystemTools::ListTar(outFile.c_str(), files, gzip, verbose) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
--- 1559,1563 ----
if ( flags.find_first_of('t') != flags.npos )
{
! if ( !cmSystemTools::ListTar(outFile.c_str(), gzip, verbose) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
***************
*** 1562,1566 ****
{
if ( !cmSystemTools::CreateTar(
! outFile.c_str(), files, gzip, verbose) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
--- 1568,1572 ----
{
if ( !cmSystemTools::CreateTar(
! outFile.c_str(), files, gzip, bzip2, verbose) )
{
cmSystemTools::Error("Problem creating tar: ", outFile.c_str());
***************
*** 1571,1575 ****
{
if ( !cmSystemTools::ExtractTar(
! outFile.c_str(), files, gzip, verbose) )
{
cmSystemTools::Error("Problem extracting tar: ", outFile.c_str());
--- 1577,1581 ----
{
if ( !cmSystemTools::ExtractTar(
! outFile.c_str(), gzip, verbose) )
{
cmSystemTools::Error("Problem extracting tar: ", outFile.c_str());
***************
*** 2382,2385 ****
--- 2388,2393 ----
this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] =
&cmGlobalNMakeMakefileGenerator::New;
+ this->Generators[cmGlobalJOMMakefileGenerator::GetActualName()] =
+ &cmGlobalJOMMakefileGenerator::New;
this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] =
&cmGlobalWatcomWMakeGenerator::New;
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CMakeLists.txt,v
retrieving revision 1.431
retrieving revision 1.432
diff -C 2 -d -r1.431 -r1.432
*** CMakeLists.txt 30 Oct 2009 17:08:20 -0000 1.431
--- CMakeLists.txt 5 Nov 2009 20:00:14 -0000 1.432
***************
*** 282,285 ****
--- 282,287 ----
cmGlobalNMakeMakefileGenerator.cxx
cmGlobalNMakeMakefileGenerator.h
+ cmGlobalJOMMakefileGenerator.cxx
+ cmGlobalJOMMakefileGenerator.h
cmGlobalVisualStudio6Generator.cxx
cmGlobalVisualStudio6Generator.h
--- NEW FILE: cmGlobalJOMMakefileGenerator.cxx ---
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "cmGlobalJOMMakefileGenerator.h"
#include "cmLocalUnixMakefileGenerator3.h"
#include "cmMakefile.h"
cmGlobalJOMMakefileGenerator::cmGlobalJOMMakefileGenerator()
{
this->FindMakeProgramFile = "CMakeJOMFindMake.cmake";
this->ForceUnixPaths = false;
this->ToolSupportsColor = true;
this->UseLinkScript = false;
}
void cmGlobalJOMMakefileGenerator
::EnableLanguage(std::vector<std::string>const& l,
cmMakefile *mf,
bool optional)
{
// pick a default
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
if(!(cmSystemTools::GetEnv("INCLUDE") &&
cmSystemTools::GetEnv("LIB"))
)
{
std::string message = "To use the JOM generator, cmake must be run "
"from a shell that can use the compiler cl from the command line. "
"This environment does not contain INCLUDE, LIB, or LIBPATH, and "
"these must be set for the cl compiler to work. ";
mf->IssueMessage(cmake::WARNING,
message);
}
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
}
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalJOMMakefileGenerator::CreateLocalGenerator()
{
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
lg->SetDefineWindowsNULL(true);
lg->SetWindowsShell(true);
lg->SetMakeSilentFlag("/nologo");
lg->SetGlobalGenerator(this);
lg->SetIgnoreLibPrefix(true);
lg->SetPassMakeflags(true);
lg->SetNMake(true);
lg->SetUnixCD(false);
return lg;
}
//----------------------------------------------------------------------------
void cmGlobalJOMMakefileGenerator
::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.Name = this->GetName();
entry.Brief = "Generates JOM makefiles.";
entry.Full = "";
}
More information about the Cmake-commits
mailing list