mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-07 17:29:36 +00:00
1
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,276 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#include "stdafx.h"
|
||||
#include "makefilecreator.h"
|
||||
#include "cmdlib.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CMakefileCreator::CMakefileCreator() {
|
||||
m_FileToBaseDirMapping.SetLessFunc( DefLessFunc( int ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CMakefileCreator::~CMakefileCreator()
|
||||
{
|
||||
}
|
||||
|
||||
void CMakefileCreator::CreateMakefiles( CVCProjConvert & proj )
|
||||
{
|
||||
m_ProjName = proj.GetName();
|
||||
m_BaseDir = proj.GetBaseDir();
|
||||
for ( int i = 0; i < proj.GetNumConfigurations(); i++ )
|
||||
{
|
||||
m_FileToBaseDirMapping.RemoveAll();
|
||||
m_BuildDirectories.RemoveAll();
|
||||
m_BaseDirs.RemoveAll();
|
||||
|
||||
CreateMakefileName( proj.GetName().String(), proj.GetConfiguration(i) );
|
||||
CreateBaseDirs( proj.GetConfiguration(i) );
|
||||
FileHandle_t f = g_pFileSystem->Open( m_MakefileName.String(), "w+" );
|
||||
if ( !f )
|
||||
{
|
||||
Warning( "failed to open %s for writing.\n", m_MakefileName.String() );
|
||||
continue;
|
||||
}
|
||||
OutputDirs(f);
|
||||
OutputIncludes( proj.GetConfiguration(i), f );
|
||||
OutputObjLists( proj.GetConfiguration(i), f );
|
||||
OutputMainBuilder(f);
|
||||
OutputBuildTarget(f);
|
||||
g_pFileSystem->Close(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CMakefileCreator::CreateBaseDirs( CVCProjConvert::CConfiguration & config )
|
||||
{
|
||||
// m_BaseDirs.Insert( "" );
|
||||
for ( int i = 0; i < config.GetNumFileNames(); i++ )
|
||||
{
|
||||
if ( config.GetFileType(i) == CVCProjConvert::CConfiguration::FILE_SOURCE )
|
||||
{
|
||||
char basedir[ MAX_PATH ];
|
||||
char fulldir[ MAX_PATH ];
|
||||
Q_snprintf( fulldir, sizeof(fulldir), "%s/%s", m_BaseDir.String(), config.GetFileName(i) );
|
||||
if ( Q_ExtractFilePath( fulldir, basedir, sizeof(basedir) ) )
|
||||
{
|
||||
Q_FixSlashes( basedir );
|
||||
Q_StripTrailingSlash( basedir );
|
||||
int index = m_BaseDirs.Find( basedir );
|
||||
if ( index == m_BaseDirs.InvalidIndex() )
|
||||
{
|
||||
index = m_BaseDirs.Insert( basedir );
|
||||
}
|
||||
m_FileToBaseDirMapping.Insert(i, index );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_FileToBaseDirMapping.Insert(i, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMakefileCreator::CleanupFileName( char *name )
|
||||
{
|
||||
for ( int i = Q_strlen( name ) - 1; i >= 0; --i )
|
||||
{
|
||||
if ( name[i] == ' ' || name[i] == '|' || name[i] == '\\' || name[i] == '/' || ( name[i] == '.' && i>=1 && name[i-1] == '.' ))
|
||||
{
|
||||
Q_memmove( &name[i], &name[i+1], Q_strlen( name ) - i - 1 );
|
||||
name[ Q_strlen( name ) - 1 ] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CMakefileCreator::CreateMakefileName( const char *projectName, CVCProjConvert::CConfiguration & config )
|
||||
{
|
||||
char makefileName[ MAX_PATH ];
|
||||
Q_snprintf( makefileName, sizeof(makefileName), "Makefile.%s_%s", projectName, config.GetName().String() );
|
||||
CleanupFileName( makefileName );
|
||||
m_MakefileName = makefileName;
|
||||
}
|
||||
|
||||
void CMakefileCreator::CreateDirectoryFriendlyName( const char *dirName, char *friendlyDirName, int friendlyDirNameSize )
|
||||
{
|
||||
Q_strncpy( friendlyDirName, dirName, friendlyDirNameSize );
|
||||
|
||||
int i;
|
||||
for ( i = Q_strlen( friendlyDirName ) - 1; i >= 0; --i )
|
||||
{
|
||||
if ( friendlyDirName[i] == '/' || friendlyDirName[i] == '\\' )
|
||||
{
|
||||
friendlyDirName[i] = '_';
|
||||
}
|
||||
if ( isalpha( friendlyDirName[i] ) )
|
||||
{
|
||||
friendlyDirName[i] = toupper(friendlyDirName[i]);
|
||||
}
|
||||
if ( friendlyDirName[i] == '.' )
|
||||
{
|
||||
Q_memmove( &friendlyDirName[i], &friendlyDirName[i+1], Q_strlen( friendlyDirName ) - i - 1 );
|
||||
friendlyDirName[ Q_strlen( friendlyDirName ) - 1 ] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// strip any leading/trailing underscores
|
||||
while ( friendlyDirName[0] == '_' && Q_strlen(friendlyDirName)>0 )
|
||||
{
|
||||
Q_memmove( &friendlyDirName[0], &friendlyDirName[1], Q_strlen( friendlyDirName )- 1 );
|
||||
friendlyDirName[ Q_strlen( friendlyDirName ) - 1 ] = 0;
|
||||
}
|
||||
while ( Q_strlen(friendlyDirName)>0 && friendlyDirName[Q_strlen(friendlyDirName)-1] == '_' )
|
||||
{
|
||||
friendlyDirName[ Q_strlen( friendlyDirName ) - 1 ] = 0;
|
||||
}
|
||||
|
||||
CleanupFileName( friendlyDirName );
|
||||
}
|
||||
|
||||
void CMakefileCreator::CreateObjDirectoryFriendlyName ( char *name )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
char *updir = "..\\";
|
||||
#else
|
||||
char *updir = "../";
|
||||
#endif
|
||||
|
||||
char *sep = Q_strstr( name, updir );
|
||||
while ( sep )
|
||||
{
|
||||
Q_strcpy( sep, sep + strlen(updir) );
|
||||
sep = Q_strstr( sep, updir );
|
||||
}
|
||||
}
|
||||
|
||||
void CMakefileCreator::FileWrite( FileHandle_t f, const char *fmt, ... )
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
char stringBuf[ 4096 ];
|
||||
Q_vsnprintf( stringBuf, sizeof(stringBuf), fmt, args );
|
||||
va_end(args);
|
||||
g_pFileSystem->Write( stringBuf, Q_strlen(stringBuf), f );
|
||||
}
|
||||
|
||||
void CMakefileCreator::OutputIncludes( CVCProjConvert::CConfiguration & config, FileHandle_t f )
|
||||
{
|
||||
FileWrite( f, "INCLUDES=" );
|
||||
for ( int i = 0; i < config.GetNumIncludes(); i++ )
|
||||
{
|
||||
FileWrite( f, "-I%s ", config.GetInclude(i) );
|
||||
}
|
||||
|
||||
for ( int i = 0; i < config.GetNumDefines(); i++ )
|
||||
{
|
||||
FileWrite( f, "-D%s ", config.GetDefine(i) );
|
||||
}
|
||||
FileWrite( f, "\n\n" );
|
||||
}
|
||||
|
||||
void CMakefileCreator::OutputDirs( FileHandle_t f )
|
||||
{
|
||||
for ( int i = m_BaseDirs.First(); i != m_BaseDirs.InvalidIndex(); i = m_BaseDirs.Next(i) )
|
||||
{
|
||||
const char *dirName = m_BaseDirs.GetElementName(i);
|
||||
if ( !dirName || !Q_strlen(dirName) )
|
||||
{
|
||||
dirName = m_BaseDir.String();
|
||||
}
|
||||
|
||||
char friendlyDirName[ MAX_PATH ];
|
||||
CreateDirectoryFriendlyName( dirName, friendlyDirName, sizeof(friendlyDirName) );
|
||||
int dirLen = Q_strlen(friendlyDirName);
|
||||
Q_strncat( friendlyDirName, "_SRC_DIR", sizeof(friendlyDirName), COPY_ALL_CHARACTERS );
|
||||
struct OutputDirMapping_t dirs;
|
||||
dirs.m_SrcDir = friendlyDirName;
|
||||
dirs.m_iBaseDirIndex = i;
|
||||
friendlyDirName[ dirLen ] = 0;
|
||||
Q_strncat( friendlyDirName, "_OBJ_DIR", sizeof(friendlyDirName), COPY_ALL_CHARACTERS );
|
||||
dirs.m_ObjDir = friendlyDirName;
|
||||
friendlyDirName[ dirLen ] = 0;
|
||||
Q_strncat( friendlyDirName, "_OBJS", sizeof(friendlyDirName), COPY_ALL_CHARACTERS );
|
||||
dirs.m_ObjName = friendlyDirName;
|
||||
|
||||
char objDirName[ MAX_PATH ];
|
||||
Q_snprintf( objDirName, sizeof(objDirName) , "obj%c$(NAME)_$(ARCH)%c", CORRECT_PATH_SEPARATOR, CORRECT_PATH_SEPARATOR );
|
||||
Q_strncat( objDirName, dirName, sizeof(objDirName), COPY_ALL_CHARACTERS );
|
||||
CreateObjDirectoryFriendlyName( objDirName );
|
||||
dirs.m_ObjOutputDir = objDirName;
|
||||
|
||||
m_BuildDirectories.AddToTail( dirs );
|
||||
|
||||
FileWrite( f, "%s=%s\n", dirs.m_SrcDir.String(), dirName );
|
||||
FileWrite( f, "%s=%s\n", dirs.m_ObjDir.String(), objDirName );
|
||||
}
|
||||
FileWrite( f, "\n\n" );
|
||||
}
|
||||
|
||||
void CMakefileCreator::OutputMainBuilder( FileHandle_t f )
|
||||
{
|
||||
int i;
|
||||
FileWrite( f, "\n\nall: dirs $(NAME)_$(ARCH).$(SHLIBEXT)\n\n" );
|
||||
FileWrite( f, "dirs:\n" );
|
||||
for ( i = 0; i < m_BuildDirectories.Count(); i++ )
|
||||
{
|
||||
FileWrite( f, "\t-mkdir -p $(%s)\n", m_BuildDirectories[i].m_ObjDir.String() );
|
||||
}
|
||||
FileWrite( f, "\n\n" );
|
||||
|
||||
|
||||
FileWrite( f, "\n\n$(NAME)_$(ARCH).$(SHLIBEXT): " );
|
||||
for ( i = 0; i < m_BuildDirectories.Count(); i++ )
|
||||
{
|
||||
FileWrite( f, "$(%s) ", m_BuildDirectories[i].m_ObjName.String() );
|
||||
}
|
||||
FileWrite( f, "\n\t$(CLINK) $(SHLIBLDFLAGS) $(DEBUG) -o $(BUILD_DIR)/$@ " );
|
||||
for ( i = 0; i < m_BuildDirectories.Count(); i++ )
|
||||
{
|
||||
FileWrite( f, "$(%s) ", m_BuildDirectories[i].m_ObjName.String() );
|
||||
}
|
||||
FileWrite( f, "$(LDFLAGS) $(CPP_LIB)\n\n" );
|
||||
}
|
||||
|
||||
void CMakefileCreator::OutputObjLists( CVCProjConvert::CConfiguration & config, FileHandle_t f )
|
||||
{
|
||||
for ( int buildDirIndex = 0; buildDirIndex < m_BuildDirectories.Count(); buildDirIndex++ )
|
||||
{
|
||||
struct OutputDirMapping_t & dirs = m_BuildDirectories[buildDirIndex];
|
||||
FileWrite( f, "%s= \\\n", dirs.m_ObjName.String() );
|
||||
|
||||
for ( int j = m_FileToBaseDirMapping.FirstInorder(); j != m_FileToBaseDirMapping.InvalidIndex(); j = m_FileToBaseDirMapping.NextInorder(j) )
|
||||
{
|
||||
if ( dirs.m_iBaseDirIndex == m_FileToBaseDirMapping[j] )
|
||||
{
|
||||
char baseName[ MAX_PATH ];
|
||||
const char *fileName = config.GetFileName(m_FileToBaseDirMapping.Key(j));
|
||||
Q_FileBase( fileName, baseName, sizeof(baseName) );
|
||||
Q_SetExtension( baseName, ".o", sizeof(baseName) );
|
||||
|
||||
FileWrite( f, "\t$(%s)/%s \\\n", dirs.m_ObjDir.String(), baseName );
|
||||
}
|
||||
}
|
||||
FileWrite( f, "\n\n" );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CMakefileCreator::OutputBuildTarget( FileHandle_t f )
|
||||
{
|
||||
for( int i = 0; i < m_BuildDirectories.Count(); i++ )
|
||||
{
|
||||
struct OutputDirMapping_t & dirs = m_BuildDirectories[i];
|
||||
FileWrite( f, "$(%s)/%%.o: $(%s)/%%.cpp\n", dirs.m_ObjDir.String(), dirs.m_SrcDir.String() );
|
||||
FileWrite( f, "\t$(DO_CC)\n\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifndef MAKEFILECREATOR_H
|
||||
#define MAKEFILECREATOR_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "utlvector.h"
|
||||
#include "utlsymbol.h"
|
||||
#include "utldict.h"
|
||||
#include "utlmap.h"
|
||||
#include "vcprojconvert.h"
|
||||
#include "filesystem.h"
|
||||
|
||||
class CMakefileCreator
|
||||
{
|
||||
public:
|
||||
|
||||
CMakefileCreator();
|
||||
~CMakefileCreator();
|
||||
|
||||
void CreateMakefiles( CVCProjConvert & proj );
|
||||
|
||||
private:
|
||||
void CleanupFileName( char *name );
|
||||
void OutputDirs( FileHandle_t f );
|
||||
void OutputBuildTarget( FileHandle_t f );
|
||||
void OutputObjLists( CVCProjConvert::CConfiguration & config, FileHandle_t f );
|
||||
void OutputIncludes( CVCProjConvert::CConfiguration & config, FileHandle_t f );
|
||||
void OutputMainBuilder( FileHandle_t f );
|
||||
|
||||
void CreateBaseDirs( CVCProjConvert::CConfiguration & config );
|
||||
void CreateMakefileName( const char *projectName, CVCProjConvert::CConfiguration & config );
|
||||
void CreateDirectoryFriendlyName( const char *dirName, char *friendlyDirName, int friendlyDirNameSize );
|
||||
void CreateObjDirectoryFriendlyName ( char *name );
|
||||
void FileWrite( FileHandle_t f, PRINTF_FORMAT_STRING const char *fmt, ... );
|
||||
|
||||
|
||||
CUtlDict<CUtlSymbol, int> m_BaseDirs;
|
||||
CUtlMap<int, int> m_FileToBaseDirMapping;
|
||||
|
||||
struct OutputDirMapping_t
|
||||
{
|
||||
CUtlSymbol m_SrcDir;
|
||||
CUtlSymbol m_ObjDir;
|
||||
CUtlSymbol m_ObjName;
|
||||
CUtlSymbol m_ObjOutputDir;
|
||||
int m_iBaseDirIndex;
|
||||
};
|
||||
|
||||
CUtlVector<struct OutputDirMapping_t> m_BuildDirectories;
|
||||
CUtlSymbol m_MakefileName;
|
||||
CUtlSymbol m_ProjName;
|
||||
CUtlSymbol m_BaseDir;
|
||||
};
|
||||
|
||||
#endif // MAKEFILECREATOR_H
|
||||
@@ -0,0 +1,15 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// classcheck.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
// TODO: reference any additional headers you need in STDAFX.H
|
||||
// and not in this file
|
||||
@@ -0,0 +1,26 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//=============================================================================//
|
||||
// stdafx.h : include file for standard system include files,
|
||||
// or project specific include files that are used frequently, but
|
||||
// are changed infrequently
|
||||
//
|
||||
|
||||
#if !defined(AFX_STDAFX_H__50E4147E_A508_4D85_BF0A_BA26676063F0__INCLUDED_)
|
||||
#define AFX_STDAFX_H__50E4147E_A508_4D85_BF0A_BA26676063F0__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
|
||||
//{{AFX_INSERT_LOCATION}}
|
||||
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
||||
|
||||
#endif // !defined(AFX_STDAFX_H__50E4147E_A508_4D85_BF0A_BA26676063F0__INCLUDED_)
|
||||
@@ -0,0 +1,828 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifdef _LINUX
|
||||
#include <ctime> // needed by xercesc
|
||||
#endif
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "tier0/platform.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <comutil.h> // _variant_t
|
||||
#include <atlbase.h> // CComPtr
|
||||
#elif _LINUX
|
||||
#include <unistd.h>
|
||||
#include <dirent.h> // scandir()
|
||||
#define _stat stat
|
||||
|
||||
|
||||
#include <xercesc/util/PlatformUtils.hpp>
|
||||
#include <xercesc/util/XMLString.hpp>
|
||||
#include <xercesc/dom/DOM.hpp>
|
||||
#include <xercesc/sax/HandlerBase.hpp>
|
||||
#include <xercesc/parsers/XercesDOMParser.hpp>
|
||||
|
||||
#include "valve_minmax_off.h"
|
||||
#if defined(XERCES_NEW_IOSTREAMS)
|
||||
#include <iostream>
|
||||
#else
|
||||
#include <iostream.h>
|
||||
#endif
|
||||
|
||||
#include "valve_minmax_on.h"
|
||||
|
||||
#define IXMLDOMNode DOMNode
|
||||
#define IXMLDOMNodeList DOMNodeList
|
||||
|
||||
#define _alloca alloca
|
||||
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
|
||||
class XStr
|
||||
{
|
||||
public :
|
||||
XStr(const char* const toTranscode)
|
||||
{
|
||||
// Call the private transcoding method
|
||||
fUnicodeForm = XMLString::transcode(toTranscode);
|
||||
}
|
||||
|
||||
~XStr()
|
||||
{
|
||||
XMLString::release(&fUnicodeForm);
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
// Getter methods
|
||||
// -----------------------------------------------------------------------
|
||||
const XMLCh* unicodeForm() const
|
||||
{
|
||||
return fUnicodeForm;
|
||||
}
|
||||
|
||||
private :
|
||||
XMLCh* fUnicodeForm;
|
||||
};
|
||||
|
||||
#define _bstr_t(str) XStr(str).unicodeForm()
|
||||
|
||||
|
||||
#else
|
||||
#error "Unsupported platform"
|
||||
#endif
|
||||
|
||||
#include "vcprojconvert.h"
|
||||
#include "utlvector.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CVCProjConvert::CVCProjConvert()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
::CoInitialize(NULL);
|
||||
#elif _LINUX
|
||||
try {
|
||||
XMLPlatformUtils::Initialize();
|
||||
}
|
||||
catch (const XMLException& toCatch) {
|
||||
char* message = XMLString::transcode(toCatch.getMessage());
|
||||
Error( "Error during initialization! : %s\n", message);
|
||||
XMLString::release(&message);
|
||||
}
|
||||
#endif
|
||||
m_bProjectLoaded = false;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: destructor
|
||||
//-----------------------------------------------------------------------------
|
||||
CVCProjConvert::~CVCProjConvert()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
::CoUninitialize();
|
||||
#elif _LINUX
|
||||
// nothing to shutdown
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: load up a project and parse it
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::LoadProject( const char *project )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
HRESULT hr;
|
||||
IXMLDOMDocument *pXMLDoc=NULL;
|
||||
|
||||
hr = ::CoCreateInstance(CLSID_DOMDocument,
|
||||
NULL,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
IID_IXMLDOMDocument,
|
||||
(void**)&pXMLDoc);
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
Msg ("Cannot instantiate msxml2.dll\n");
|
||||
Msg ("Please download the MSXML run-time (url below)\n");
|
||||
Msg ("http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/msdn-files/027/001/766/msdncompositedoc.xml\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
VARIANT_BOOL vtbool;
|
||||
_variant_t bstrProject(project);
|
||||
|
||||
pXMLDoc->put_async( VARIANT_BOOL(FALSE) );
|
||||
hr = pXMLDoc->load(bstrProject,&vtbool);
|
||||
if (FAILED(hr) || vtbool==VARIANT_FALSE)
|
||||
{
|
||||
Msg ("Could not open %s.\n", bstrProject);
|
||||
pXMLDoc->Release();
|
||||
return false;
|
||||
}
|
||||
#elif _LINUX
|
||||
XercesDOMParser* parser = new XercesDOMParser();
|
||||
parser->setValidationScheme(XercesDOMParser::Val_Always); // optional.
|
||||
parser->setDoNamespaces(true); // optional
|
||||
|
||||
ErrorHandler* errHandler = (ErrorHandler*) new HandlerBase();
|
||||
parser->setErrorHandler(errHandler);
|
||||
|
||||
try {
|
||||
parser->parse(project);
|
||||
}
|
||||
catch (const XMLException& toCatch) {
|
||||
char* message = XMLString::transcode(toCatch.getMessage());
|
||||
Error( "Exception message is: %s\n", message );
|
||||
XMLString::release(&message);
|
||||
return;
|
||||
}
|
||||
catch (const DOMException& toCatch) {
|
||||
char* message = XMLString::transcode(toCatch.msg);
|
||||
Error( "Exception message is: %s\n", message );
|
||||
XMLString::release(&message);
|
||||
return;
|
||||
}
|
||||
catch (...) {
|
||||
Error( "Unexpected Exception \n" );
|
||||
return;
|
||||
}
|
||||
|
||||
DOMDocument *pXMLDoc = parser->getDocument();
|
||||
#endif
|
||||
|
||||
ExtractProjectName( pXMLDoc );
|
||||
if ( !m_Name.IsValid() )
|
||||
{
|
||||
Msg( "Failed to extract project name\n" );
|
||||
return false;
|
||||
}
|
||||
char baseDir[ MAX_PATH ];
|
||||
Q_ExtractFilePath( project, baseDir, sizeof(baseDir) );
|
||||
Q_StripTrailingSlash( baseDir );
|
||||
m_BaseDir = baseDir;
|
||||
|
||||
ExtractConfigurations( pXMLDoc );
|
||||
if ( m_Configurations.Count() == 0 )
|
||||
{
|
||||
Msg( "Failed to find any configurations to load\n" );
|
||||
return false;
|
||||
}
|
||||
|
||||
ExtractFiles( pXMLDoc );
|
||||
|
||||
#ifdef _WIN32
|
||||
pXMLDoc->Release();
|
||||
#elif _LINUX
|
||||
delete pXMLDoc;
|
||||
delete errHandler;
|
||||
#endif
|
||||
|
||||
m_bProjectLoaded = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns the number of different configurations loaded
|
||||
//-----------------------------------------------------------------------------
|
||||
int CVCProjConvert::GetNumConfigurations()
|
||||
{
|
||||
Assert( m_bProjectLoaded );
|
||||
return m_Configurations.Count();
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns the index of a config with this name, -1 on err
|
||||
//-----------------------------------------------------------------------------
|
||||
int CVCProjConvert::FindConfiguration( CUtlSymbol name )
|
||||
{
|
||||
if ( !name.IsValid() )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
for ( int i = 0; i < m_Configurations.Count(); i++ )
|
||||
{
|
||||
if ( m_Configurations[i].GetName() == name )
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: extracts the value of the xml attrib "attribName"
|
||||
//-----------------------------------------------------------------------------
|
||||
CUtlSymbol CVCProjConvert::GetXMLAttribValue( IXMLDOMElement *p, const char *attribName )
|
||||
{
|
||||
if (!p)
|
||||
{
|
||||
return CUtlSymbol();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
VARIANT vtValue;
|
||||
p->getAttribute( _bstr_t(attribName), &vtValue);
|
||||
if ( vtValue.vt == VT_NULL )
|
||||
{
|
||||
return CUtlSymbol(); // element not found
|
||||
}
|
||||
|
||||
Assert( vtValue.vt == VT_BSTR );
|
||||
CUtlSymbol name( static_cast<char *>( _bstr_t( vtValue.bstrVal ) ) );
|
||||
::SysFreeString(vtValue.bstrVal);
|
||||
#elif _LINUX
|
||||
const XMLCh *xAttrib = XMLString::transcode( attribName );
|
||||
const XMLCh *value = p->getAttribute( xAttrib );
|
||||
if ( value == NULL )
|
||||
{
|
||||
return CUtlSymbol(); // element not found
|
||||
}
|
||||
char *transValue = XMLString::transcode(value);
|
||||
CUtlSymbol name( transValue );
|
||||
XMLString::release( &xAttrib );
|
||||
XMLString::release( &transValue );
|
||||
#endif
|
||||
return name;
|
||||
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns the name of this node
|
||||
//-----------------------------------------------------------------------------
|
||||
CUtlSymbol CVCProjConvert::GetXMLNodeName( IXMLDOMElement *p )
|
||||
{
|
||||
CUtlSymbol name;
|
||||
if (!p)
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
BSTR bstrName;
|
||||
p->get_nodeName( &bstrName );
|
||||
_bstr_t bstr(bstrName);
|
||||
name = static_cast<char *>(bstr);
|
||||
return name;
|
||||
#elif _LINUX
|
||||
Assert( 0 );
|
||||
Error( "Function CVCProjConvert::GetXMLNodeName not implemented\n" );
|
||||
return name;
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: returns the config object at this index
|
||||
//-----------------------------------------------------------------------------
|
||||
CVCProjConvert::CConfiguration & CVCProjConvert::GetConfiguration( int i )
|
||||
{
|
||||
Assert( m_bProjectLoaded );
|
||||
Assert( m_Configurations.IsValidIndex(i) );
|
||||
return m_Configurations[i];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: extracts the project name from the loaded vcproj
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::ExtractProjectName( IXMLDOMDocument *pDoc )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
CComPtr<IXMLDOMNodeList> pProj;
|
||||
pDoc->getElementsByTagName( _bstr_t("VisualStudioProject"), &pProj);
|
||||
if (pProj)
|
||||
{
|
||||
long len = 0;
|
||||
pProj->get_length(&len);
|
||||
Assert( len == 1 );
|
||||
if ( len == 1 )
|
||||
{
|
||||
CComPtr<IXMLDOMNode> pNode;
|
||||
pProj->get_item( 0, &pNode );
|
||||
if (pNode)
|
||||
{
|
||||
CComQIPtr<IXMLDOMElement> pElem( pNode );
|
||||
m_Name = GetXMLAttribValue( pElem, "Name");
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif _LINUX
|
||||
DOMNodeList *nodes = pDoc->getElementsByTagName( _bstr_t("VisualStudioProject") );
|
||||
if ( nodes )
|
||||
{
|
||||
int len = nodes->getLength();
|
||||
if ( len == 1 )
|
||||
{
|
||||
DOMNode *node = nodes->item(0);
|
||||
if ( node )
|
||||
{
|
||||
m_Name = GetXMLAttribValue( node, "Name" );
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: extracts the list of configuration names from the vcproj
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::ExtractConfigurations( IXMLDOMDocument *pDoc )
|
||||
{
|
||||
m_Configurations.RemoveAll();
|
||||
|
||||
if (!pDoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
CComPtr<IXMLDOMNodeList> pConfigs;
|
||||
pDoc->getElementsByTagName( _bstr_t("Configuration"), &pConfigs);
|
||||
if (pConfigs)
|
||||
{
|
||||
long len = 0;
|
||||
pConfigs->get_length(&len);
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
CComPtr<IXMLDOMNode> pNode;
|
||||
pConfigs->get_item( i, &pNode );
|
||||
if (pNode)
|
||||
{
|
||||
CComQIPtr<IXMLDOMElement> pElem( pNode );
|
||||
CUtlSymbol configName = GetXMLAttribValue( pElem, "Name" );
|
||||
if ( configName.IsValid() )
|
||||
{
|
||||
int newIndex = m_Configurations.AddToTail();
|
||||
CConfiguration & config = m_Configurations[newIndex];
|
||||
config.SetName( configName );
|
||||
ExtractIncludes( pElem, config );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif _LINUX
|
||||
DOMNodeList *nodes = pDoc->getElementsByTagName( _bstr_t("Configuration"));
|
||||
if ( nodes )
|
||||
{
|
||||
int len = nodes->getLength();
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
DOMNode *node = nodes->item(i);
|
||||
if (node)
|
||||
{
|
||||
CUtlSymbol configName = GetXMLAttribValue( node, "Name" );
|
||||
if ( configName.IsValid() )
|
||||
{
|
||||
int newIndex = m_Configurations.AddToTail();
|
||||
CConfiguration & config = m_Configurations[newIndex];
|
||||
config.SetName( configName );
|
||||
ExtractIncludes( node, config );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: extracts the list of defines and includes used for this config
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::ExtractIncludes( IXMLDOMElement *pDoc, CConfiguration & config )
|
||||
{
|
||||
config.ResetDefines();
|
||||
config.ResetIncludes();
|
||||
|
||||
if (!pDoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
CComPtr<IXMLDOMNodeList> pTools;
|
||||
pDoc->getElementsByTagName( _bstr_t("Tool"), &pTools);
|
||||
if (pTools)
|
||||
{
|
||||
long len = 0;
|
||||
pTools->get_length(&len);
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
CComPtr<IXMLDOMNode> pNode;
|
||||
pTools->get_item( i, &pNode );
|
||||
if (pNode)
|
||||
{
|
||||
CComQIPtr<IXMLDOMElement> pElem( pNode );
|
||||
CUtlSymbol toolName = GetXMLAttribValue( pElem, "Name" );
|
||||
if ( toolName == "VCCLCompilerTool" )
|
||||
{
|
||||
CUtlSymbol defines = GetXMLAttribValue( pElem, "PreprocessorDefinitions" );
|
||||
char *str = (char *)_alloca( Q_strlen( defines.String() ) + 1 );
|
||||
Assert( str );
|
||||
Q_strcpy( str, defines.String() );
|
||||
// now tokenize the string on the ";" char
|
||||
char *delim = strchr( str, ';' );
|
||||
char *curpos = str;
|
||||
while ( delim )
|
||||
{
|
||||
*delim = 0;
|
||||
delim++;
|
||||
if ( Q_stricmp( curpos, "WIN32" ) && Q_stricmp( curpos, "_WIN32" ) &&
|
||||
Q_stricmp( curpos, "_WINDOWS") && Q_stricmp( curpos, "WINDOWS")) // don't add WIN32 defines
|
||||
{
|
||||
config.AddDefine( curpos );
|
||||
}
|
||||
curpos = delim;
|
||||
delim = strchr( delim, ';' );
|
||||
}
|
||||
if ( Q_stricmp( curpos, "WIN32" ) && Q_stricmp( curpos, "_WIN32" ) &&
|
||||
Q_stricmp( curpos, "_WINDOWS") && Q_stricmp( curpos, "WINDOWS")) // don't add WIN32 defines
|
||||
{
|
||||
config.AddDefine( curpos );
|
||||
}
|
||||
|
||||
CUtlSymbol includes = GetXMLAttribValue( pElem, "AdditionalIncludeDirectories" );
|
||||
char *str2 = (char *)_alloca( Q_strlen( includes.String() ) + 1 );
|
||||
Assert( str2 );
|
||||
Q_strcpy( str2, includes.String() );
|
||||
// now tokenize the string on the ";" char
|
||||
delim = strchr( str2, ',' );
|
||||
curpos = str2;
|
||||
while ( delim )
|
||||
{
|
||||
*delim = 0;
|
||||
delim++;
|
||||
config.AddInclude( curpos );
|
||||
curpos = delim;
|
||||
delim = strchr( delim, ',' );
|
||||
}
|
||||
config.AddInclude( curpos );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#elif _LINUX
|
||||
DOMNodeList *nodes= pDoc->getElementsByTagName( _bstr_t("Tool"));
|
||||
if (nodes)
|
||||
{
|
||||
int len = nodes->getLength();
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
DOMNode *node = nodes->item(i);
|
||||
if (node)
|
||||
{
|
||||
CUtlSymbol toolName = GetXMLAttribValue( node, "Name" );
|
||||
if ( toolName == "VCCLCompilerTool" )
|
||||
{
|
||||
CUtlSymbol defines = GetXMLAttribValue( node, "PreprocessorDefinitions" );
|
||||
char *str = (char *)_alloca( Q_strlen( defines.String() ) + 1 );
|
||||
Assert( str );
|
||||
Q_strcpy( str, defines.String() );
|
||||
// now tokenize the string on the ";" char
|
||||
char *delim = strchr( str, ';' );
|
||||
char *curpos = str;
|
||||
while ( delim )
|
||||
{
|
||||
*delim = 0;
|
||||
delim++;
|
||||
if ( Q_stricmp( curpos, "WIN32" ) && Q_stricmp( curpos, "_WIN32" ) &&
|
||||
Q_stricmp( curpos, "_WINDOWS") && Q_stricmp( curpos, "WINDOWS")) // don't add WIN32 defines
|
||||
{
|
||||
config.AddDefine( curpos );
|
||||
}
|
||||
curpos = delim;
|
||||
delim = strchr( delim, ';' );
|
||||
}
|
||||
if ( Q_stricmp( curpos, "WIN32" ) && Q_stricmp( curpos, "_WIN32" ) &&
|
||||
Q_stricmp( curpos, "_WINDOWS") && Q_stricmp( curpos, "WINDOWS")) // don't add WIN32 defines
|
||||
{
|
||||
config.AddDefine( curpos );
|
||||
}
|
||||
|
||||
CUtlSymbol includes = GetXMLAttribValue( node, "AdditionalIncludeDirectories" );
|
||||
char *str2 = (char *)_alloca( Q_strlen( includes.String() ) + 1 );
|
||||
Assert( str2 );
|
||||
Q_strcpy( str2, includes.String() );
|
||||
// now tokenize the string on the ";" char
|
||||
char token = ',';
|
||||
delim = strchr( str2, token );
|
||||
if ( !delim )
|
||||
{
|
||||
token = ';';
|
||||
delim = strchr( str2, token );
|
||||
}
|
||||
curpos = str2;
|
||||
while ( delim )
|
||||
{
|
||||
*delim = 0;
|
||||
delim++;
|
||||
Q_FixSlashes( curpos );
|
||||
char fullPath[ MAX_PATH ];
|
||||
Q_snprintf( fullPath, sizeof(fullPath), "%s/%s", m_BaseDir.String(), curpos );
|
||||
Q_StripTrailingSlash( fullPath );
|
||||
config.AddInclude( fullPath );
|
||||
curpos = delim;
|
||||
delim = strchr( delim, token );
|
||||
}
|
||||
Q_FixSlashes( curpos );
|
||||
Q_strlower( curpos );
|
||||
char fullPath[ MAX_PATH ];
|
||||
Q_snprintf( fullPath, sizeof(fullPath), "%s/%s", m_BaseDir.String(), curpos );
|
||||
Q_StripTrailingSlash( fullPath );
|
||||
config.AddInclude( fullPath );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: walks a particular files config entry and removes an files not valid for this config
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::IterateFileConfigurations( IXMLDOMElement *pFile, CUtlSymbol fileName )
|
||||
{
|
||||
#ifdef _WIN32
|
||||
CComPtr<IXMLDOMNodeList> pConfigs;
|
||||
pFile->getElementsByTagName( _bstr_t("FileConfiguration"), &pConfigs);
|
||||
if (pConfigs)
|
||||
{
|
||||
long len = 0;
|
||||
pConfigs->get_length(&len);
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
CComPtr<IXMLDOMNode> pNode;
|
||||
pConfigs->get_item( i, &pNode);
|
||||
if (pNode)
|
||||
{
|
||||
CComQIPtr<IXMLDOMElement> pElem( pNode );
|
||||
CUtlSymbol configName = GetXMLAttribValue( pElem, "Name");
|
||||
CUtlSymbol excluded = GetXMLAttribValue( pElem ,"ExcludedFromBuild");
|
||||
if ( configName.IsValid() && excluded.IsValid() )
|
||||
{
|
||||
int index = FindConfiguration( configName );
|
||||
if ( index > 0 && excluded == "TRUE" )
|
||||
{
|
||||
m_Configurations[index].RemoveFile( fileName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}//for
|
||||
}//if
|
||||
#elif _LINUX
|
||||
DOMNodeList *nodes = pFile->getElementsByTagName( _bstr_t("FileConfiguration"));
|
||||
if (nodes)
|
||||
{
|
||||
int len = nodes->getLength();
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
DOMNode *node = nodes->item(i);
|
||||
if (node)
|
||||
{
|
||||
CUtlSymbol configName = GetXMLAttribValue( node, "Name");
|
||||
CUtlSymbol excluded = GetXMLAttribValue( node ,"ExcludedFromBuild");
|
||||
if ( configName.IsValid() && excluded.IsValid() )
|
||||
{
|
||||
int index = FindConfiguration( configName );
|
||||
if ( index >= 0 && excluded == "TRUE" )
|
||||
{
|
||||
m_Configurations[index].RemoveFile( fileName );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}//for
|
||||
}//if
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: walks the file elements in the vcproj and inserts them into configs
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CVCProjConvert::ExtractFiles( IXMLDOMDocument *pDoc )
|
||||
{
|
||||
if (!pDoc)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
Assert( m_Configurations.Count() ); // some configs must be loaded first
|
||||
|
||||
#ifdef _WIN32
|
||||
CComPtr<IXMLDOMNodeList> pFiles;
|
||||
pDoc->getElementsByTagName( _bstr_t("File"), &pFiles);
|
||||
if (pFiles)
|
||||
{
|
||||
long len = 0;
|
||||
pFiles->get_length(&len);
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
CComPtr<IXMLDOMNode> pNode;
|
||||
pFiles->get_item( i, &pNode);
|
||||
if (pNode)
|
||||
{
|
||||
CComQIPtr<IXMLDOMElement> pElem( pNode );
|
||||
CUtlSymbol fileName = GetXMLAttribValue(pElem,"RelativePath");
|
||||
if ( fileName.IsValid() )
|
||||
{
|
||||
CConfiguration::FileType_e type = GetFileType( fileName.String() );
|
||||
CConfiguration::CFileEntry fileEntry( fileName.String(), type );
|
||||
for ( int i = 0; i < m_Configurations.Count(); i++ ) // add the file to all configs
|
||||
{
|
||||
CConfiguration & config = m_Configurations[i];
|
||||
config.InsertFile( fileEntry );
|
||||
}
|
||||
IterateFileConfigurations( pElem, fileName ); // now remove the excluded ones
|
||||
}
|
||||
}
|
||||
}//for
|
||||
}
|
||||
#elif _LINUX
|
||||
DOMNodeList *nodes = pDoc->getElementsByTagName( _bstr_t("File") );
|
||||
if (nodes)
|
||||
{
|
||||
int len = nodes->getLength();
|
||||
for ( int i=0; i<len; i++ )
|
||||
{
|
||||
DOMNode *node = nodes->item(i);
|
||||
if (node)
|
||||
{
|
||||
CUtlSymbol fileName = GetXMLAttribValue(node,"RelativePath");
|
||||
if ( fileName.IsValid() )
|
||||
{
|
||||
char fixedFileName[ MAX_PATH ];
|
||||
Q_strncpy( fixedFileName, fileName.String(), sizeof(fixedFileName) );
|
||||
if ( fixedFileName[0] == '.' && fixedFileName[1] == '\\' )
|
||||
{
|
||||
Q_memmove( fixedFileName, fixedFileName+2, sizeof(fixedFileName)-2 );
|
||||
}
|
||||
|
||||
Q_FixSlashes( fixedFileName );
|
||||
FindFileCaseInsensitive( fixedFileName, sizeof(fixedFileName) );
|
||||
CConfiguration::FileType_e type = GetFileType( fileName.String() );
|
||||
CConfiguration::CFileEntry fileEntry( fixedFileName, type );
|
||||
for ( int i = 0; i < m_Configurations.Count(); i++ ) // add the file to all configs
|
||||
{
|
||||
CConfiguration & config = m_Configurations[i];
|
||||
config.InsertFile( fileEntry );
|
||||
}
|
||||
IterateFileConfigurations( node, fixedFileName ); // now remove the excluded ones
|
||||
}
|
||||
}
|
||||
}//for
|
||||
}
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef _LINUX
|
||||
static char fileName[MAX_PATH];
|
||||
int CheckName(const struct dirent *dir)
|
||||
{
|
||||
return !strcasecmp( dir->d_name, fileName );
|
||||
}
|
||||
|
||||
const char *findFileInDirCaseInsensitive(const char *file)
|
||||
{
|
||||
const char *dirSep = strrchr(file,'/');
|
||||
if( !dirSep )
|
||||
{
|
||||
dirSep=strrchr(file,'\\');
|
||||
if( !dirSep )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char *dirName = static_cast<char *>( alloca( ( dirSep - file ) +1 ) );
|
||||
if( !dirName )
|
||||
return NULL;
|
||||
|
||||
Q_strncpy( dirName, file, dirSep - file );
|
||||
dirName[ dirSep - file ] = '\0';
|
||||
|
||||
struct dirent **namelist;
|
||||
int n;
|
||||
|
||||
Q_strncpy( fileName, dirSep + 1, MAX_PATH );
|
||||
|
||||
|
||||
n = scandir( dirName , &namelist, CheckName, alphasort );
|
||||
|
||||
if( n > 0 )
|
||||
{
|
||||
while( n > 1 )
|
||||
{
|
||||
free( namelist[n] ); // free the malloc'd strings
|
||||
n--;
|
||||
}
|
||||
|
||||
Q_snprintf( fileName, sizeof( fileName ), "%s/%s", dirName, namelist[0]->d_name );
|
||||
return fileName;
|
||||
}
|
||||
else
|
||||
{
|
||||
// last ditch attempt, just return the lower case version!
|
||||
Q_strncpy( fileName, file, sizeof(fileName) );
|
||||
Q_strlower( fileName );
|
||||
return fileName;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CVCProjConvert::FindFileCaseInsensitive( char *fileName, int fileNameSize )
|
||||
{
|
||||
char filePath[ MAX_PATH ];
|
||||
|
||||
Q_snprintf( filePath, sizeof(filePath), "%s/%s", m_BaseDir.String(), fileName );
|
||||
|
||||
struct _stat buf;
|
||||
if ( _stat( filePath, &buf ) == 0)
|
||||
{
|
||||
return; // found the filename directly
|
||||
}
|
||||
|
||||
#ifdef _LINUX
|
||||
const char *realName = findFileInDirCaseInsensitive( filePath );
|
||||
if ( realName )
|
||||
{
|
||||
Q_strncpy( fileName, realName+strlen(m_BaseDir.String())+1, fileNameSize );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: extracts the generic type of a file being loaded
|
||||
//-----------------------------------------------------------------------------
|
||||
CVCProjConvert::CConfiguration::FileType_e CVCProjConvert::GetFileType( const char *fileName )
|
||||
{
|
||||
CConfiguration::FileType_e type = CConfiguration::FILE_TYPE_UNKNOWN_E;
|
||||
char ext[10];
|
||||
Q_ExtractFileExtension( fileName, ext, sizeof(ext) );
|
||||
if ( !Q_stricmp( ext, "lib" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_LIBRARY;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "h" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_HEADER;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "hh" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_HEADER;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "hpp" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_HEADER;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "cpp" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_SOURCE;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "c" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_SOURCE;
|
||||
}
|
||||
else if ( !Q_stricmp( ext, "cc" ) )
|
||||
{
|
||||
type = CConfiguration::FILE_SOURCE;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#ifndef VCPROJCONVERT_H
|
||||
#define VCPROJCONVERT_H
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "utlvector.h"
|
||||
#include "utlsymbol.h"
|
||||
#ifdef _WIN32
|
||||
#include "msxml2.h"
|
||||
#elif _LINUX
|
||||
#include "xercesc/dom/DOMDocument.hpp"
|
||||
#define IXMLDOMDocument DOMDocument
|
||||
#define IXMLDOMElement DOMElement
|
||||
XERCES_CPP_NAMESPACE_USE
|
||||
|
||||
#else
|
||||
#error "Unsupported Platform"
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: constructor
|
||||
//-----------------------------------------------------------------------------
|
||||
class CVCProjConvert
|
||||
{
|
||||
public:
|
||||
CVCProjConvert();
|
||||
~CVCProjConvert();
|
||||
|
||||
bool LoadProject( const char *project );
|
||||
int GetNumConfigurations();
|
||||
CUtlSymbol & GetName() { return m_Name; }
|
||||
CUtlSymbol & GetBaseDir() { return m_BaseDir; }
|
||||
|
||||
class CConfiguration
|
||||
{
|
||||
public:
|
||||
CConfiguration() {}
|
||||
~CConfiguration() {}
|
||||
|
||||
typedef enum
|
||||
{
|
||||
FILE_SOURCE,
|
||||
FILE_HEADER,
|
||||
FILE_LIBRARY,
|
||||
FILE_TYPE_UNKNOWN_E
|
||||
} FileType_e;
|
||||
|
||||
class CFileEntry
|
||||
{
|
||||
public:
|
||||
CFileEntry( CUtlSymbol name, FileType_e type ) { m_Name = name; m_Type = type; }
|
||||
~CFileEntry() {}
|
||||
|
||||
const char *GetName() { return m_Name.String(); }
|
||||
FileType_e GetType() { return m_Type; }
|
||||
bool operator==( const CFileEntry other ) const { return m_Name == other.m_Name; }
|
||||
|
||||
private:
|
||||
FileType_e m_Type;
|
||||
CUtlSymbol m_Name;
|
||||
};
|
||||
|
||||
void InsertFile( CFileEntry file ) { m_Files.AddToTail( file ); }
|
||||
void RemoveFile( CUtlSymbol file ) { m_Files.FindAndRemove( CFileEntry( file, FILE_TYPE_UNKNOWN_E ) ); } // file type doesn't matter on remove
|
||||
void SetName( CUtlSymbol name ) { m_Name = name; }
|
||||
|
||||
int GetNumFileNames() { return m_Files.Count(); }
|
||||
const char * GetFileName(int i) { return m_Files[i].GetName(); }
|
||||
FileType_e GetFileType(int i) { return m_Files[i].GetType(); }
|
||||
CUtlSymbol & GetName() { return m_Name; }
|
||||
|
||||
void ResetDefines() { m_Defines.RemoveAll(); }
|
||||
void AddDefine( CUtlSymbol define ) { m_Defines.AddToTail( define ); }
|
||||
int GetNumDefines() { return m_Defines.Count(); }
|
||||
const char *GetDefine( int i ) { return m_Defines[i].String(); }
|
||||
|
||||
void ResetIncludes() { m_Includes.RemoveAll(); }
|
||||
void AddInclude( CUtlSymbol include ) { m_Includes.AddToTail( include ); }
|
||||
int GetNumIncludes() { return m_Includes.Count(); }
|
||||
const char *GetInclude( int i ) { return m_Includes[i].String(); }
|
||||
|
||||
private:
|
||||
CUtlSymbol m_Name;
|
||||
CUtlVector<CUtlSymbol> m_Defines;
|
||||
CUtlVector<CUtlSymbol> m_Includes;
|
||||
CUtlVector<CFileEntry> m_Files;
|
||||
};
|
||||
|
||||
CConfiguration & GetConfiguration( int i );
|
||||
int FindConfiguration( CUtlSymbol name );
|
||||
|
||||
private:
|
||||
bool ExtractFiles( IXMLDOMDocument *pDoc );
|
||||
bool ExtractConfigurations( IXMLDOMDocument *pDoc );
|
||||
bool ExtractProjectName( IXMLDOMDocument *pDoc );
|
||||
bool ExtractIncludes( IXMLDOMElement *pDoc, CConfiguration & config );
|
||||
bool IterateFileConfigurations( IXMLDOMElement *pFile, CUtlSymbol fileName );
|
||||
|
||||
// helper funcs
|
||||
CUtlSymbol GetXMLNodeName( IXMLDOMElement *p );
|
||||
CUtlSymbol GetXMLAttribValue( IXMLDOMElement *p, const char *attribName );
|
||||
CConfiguration::FileType_e GetFileType( const char *fileName );
|
||||
void FindFileCaseInsensitive( char *file, int fileNameSize );
|
||||
|
||||
// data
|
||||
CUtlVector<CConfiguration> m_Configurations;
|
||||
CUtlSymbol m_Name;
|
||||
CUtlSymbol m_BaseDir;
|
||||
bool m_bProjectLoaded;
|
||||
};
|
||||
|
||||
#endif // VCPROJCONVERT_H
|
||||
@@ -0,0 +1,134 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
#include "stdafx.h"
|
||||
#include <stdio.h>
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#elif _LINUX
|
||||
#define stricmp strcasecmp
|
||||
#endif
|
||||
#include "tier1/strtools.h"
|
||||
#include "tier0/dbg.h"
|
||||
#include "KeyValues.h"
|
||||
#include "cmdlib.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "vcprojconvert.h"
|
||||
#include "makefilecreator.h"
|
||||
|
||||
SpewRetval_t SpewFunc( SpewType_t type, char const *pMsg )
|
||||
{
|
||||
printf( "%s", pMsg );
|
||||
#ifdef _WIN32
|
||||
OutputDebugString( pMsg );
|
||||
#endif
|
||||
|
||||
if ( type == SPEW_ERROR )
|
||||
{
|
||||
printf( "\n" );
|
||||
#ifdef _WIN32
|
||||
OutputDebugString( "\n" );
|
||||
#endif
|
||||
}
|
||||
else if (type == SPEW_ASSERT)
|
||||
{
|
||||
return SPEW_DEBUGGER;
|
||||
}
|
||||
|
||||
return SPEW_CONTINUE;
|
||||
}
|
||||
|
||||
class MyFileSystem : public IBaseFileSystem
|
||||
{
|
||||
public:
|
||||
int Read( void* pOutput, int size, FileHandle_t file ) { return fread( pOutput, 1, size, (FILE *)file); }
|
||||
int Write( void const* pInput, int size, FileHandle_t file ) { return fwrite( pInput, 1, size, (FILE *)file); }
|
||||
FileHandle_t Open( const char *pFileName, const char *pOptions, const char *pathID = 0 ) { return (FileHandle_t)fopen( pFileName, pOptions); }
|
||||
void Close( FileHandle_t file ) { fclose( (FILE *)file ); }
|
||||
void Seek( FileHandle_t file, int pos, FileSystemSeek_t seekType ) {}
|
||||
unsigned int Tell( FileHandle_t file ) { return 0;}
|
||||
unsigned int Size( FileHandle_t file ) { return 0;}
|
||||
unsigned int Size( const char *pFileName, const char *pPathID = 0 ) { return 0; }
|
||||
void Flush( FileHandle_t file ) { fflush((FILE *)file); }
|
||||
bool Precache( const char *pFileName, const char *pPathID = 0 ) {return false;}
|
||||
bool FileExists( const char *pFileName, const char *pPathID = 0 ) {return false;}
|
||||
bool IsFileWritable( char const *pFileName, const char *pPathID = 0 ) {return false;}
|
||||
bool SetFileWritable( char const *pFileName, bool writable, const char *pPathID = 0 ) {return false;}
|
||||
long GetFileTime( const char *pFileName, const char *pPathID = 0 ) { return 0; }
|
||||
bool ReadFile( const char *pFileName, const char *pPath, CUtlBuffer &buf, int nMaxBytes = 0, int nStartingByte = 0, FSAllocFunc_t pfnAlloc = NULL ) {return false;}
|
||||
bool WriteFile( const char *pFileName, const char *pPath, CUtlBuffer &buf ) {return false;}
|
||||
bool UnzipFile( const char *,const char *,const char * ) {return false;}
|
||||
};
|
||||
|
||||
MyFileSystem g_MyFS;
|
||||
IBaseFileSystem *g_pFileSystem = &g_MyFS;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: help text
|
||||
//-----------------------------------------------------------------------------
|
||||
void printusage( void )
|
||||
{
|
||||
Msg( "usage: vcprojtomake <vcproj filename> \n" );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose: debug helper, spits out a human readable keyvalues version of the various configs
|
||||
//-----------------------------------------------------------------------------
|
||||
void OutputKeyValuesVersion( CVCProjConvert & proj )
|
||||
{
|
||||
KeyValues *kv = new KeyValues( "project" );
|
||||
for ( int projIndex = 0; projIndex < proj.GetNumConfigurations(); projIndex++ )
|
||||
{
|
||||
CVCProjConvert::CConfiguration & config = proj.GetConfiguration(projIndex);
|
||||
KeyValues *configKv = kv->FindKey( config.GetName().String(), true );
|
||||
int fileCount = 0;
|
||||
for( int fileIndex = 0; fileIndex < config.GetNumFileNames(); fileIndex++ )
|
||||
{
|
||||
if ( config.GetFileType(fileIndex) == CVCProjConvert::CConfiguration::FILE_SOURCE )
|
||||
{
|
||||
char num[20];
|
||||
Q_snprintf( num, sizeof(num), "%i", fileCount );
|
||||
fileCount++;
|
||||
configKv->SetString( num, config.GetFileName(fileIndex) );
|
||||
}
|
||||
}
|
||||
}
|
||||
kv->SaveToFile( g_pFileSystem, "files.vdf" );
|
||||
kv->deleteThis();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Input : argc -
|
||||
// argv[] -
|
||||
// Output : int
|
||||
//-----------------------------------------------------------------------------
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
SpewOutputFunc( SpewFunc );
|
||||
|
||||
Msg( "Valve Software - vcprojtomake.exe (%s)\n", __DATE__ );
|
||||
CommandLine()->CreateCmdLine( argc, argv );
|
||||
|
||||
if ( CommandLine()->ParmCount() < 2)
|
||||
{
|
||||
printusage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
CVCProjConvert proj;
|
||||
if ( !proj.LoadProject( CommandLine()->GetParm( 1 )) )
|
||||
{
|
||||
Msg( "Failed to parse project\n" );
|
||||
return -1;
|
||||
}
|
||||
|
||||
OutputKeyValuesVersion(proj);
|
||||
|
||||
CMakefileCreator makefile;
|
||||
makefile.CreateMakefiles( proj );
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,559 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="vprojtomake"
|
||||
ProjectGUID="{EA55446E-BC04-491C-A9F0-605DFCBB213A}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="if exist ..\..\..\game\bin\vcpm.exe attrib -r ..\..\..\game\bin\vcpm.exe
if exist "$(TargetPath)" copy "$(TargetPath)" ..\..\..\game\bin\vcpm.exe
"
|
||||
Outputs="..\..\..\game\bin\vcpm.exe"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/vprojtomake.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\common,..\..\public,..\..\public\tier1,..\..\public\tier0"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Release/vprojtomake.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib comsupp.lib msxml2.lib comsuppw.lib"
|
||||
OutputFile=".\Release/vcpm.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\..\lib\public"
|
||||
IgnoreDefaultLibraryNames="LIBCMTD"
|
||||
ProgramDatabaseFile=".\Release/vprojtomake.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
CommandLine="if exist ..\..\..\game\bin\vcpm.exe attrib -r ..\..\..\game\bin\vcpm.exe
if exist "$(TargetPath)" copy "$(TargetPath)" ..\..\..\game\bin\vcpm.exe
"
|
||||
Outputs="..\..\..\game\bin\vcpm.exe"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/vprojtomake.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\common,..\..\public,..\..\public\tier1;..\..\public\tier0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderThrough="stdafx.h"
|
||||
PrecompiledHeaderFile=".\Debug/vprojtomake.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
BrowseInformationFile=".\Debug/"
|
||||
WarningLevel="4"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="/FIXED:NO"
|
||||
AdditionalDependencies="odbc32.lib odbccp32.lib msxml2.lib comsuppw.lib comsupp.lib"
|
||||
OutputFile=".\Debug/vprojtomake.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
AdditionalLibraryDirectories="..\..\lib\public"
|
||||
IgnoreDefaultLibraryNames="LIBCMT"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/vprojtomake.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName=".\Debug/vprojtomake.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\tier1\interface.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tier1\KeyValues.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="makefilecreator.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StdAfx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tier1\utlbuffer.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\tier1\utlsymbol.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="vcprojconvert.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="vprojtomake.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
UsePrecompiledHeader="0"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BasicRuntimeChecks="3"
|
||||
UsePrecompiledHeader="0"
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Public\tier0\basetypes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Public\tier1\characterset.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\common\cmdlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Public\FileSystem.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\tier1\KeyValues.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="makefilecreator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="MsXml2.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="StdAfx.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\tier1\utlbuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\tier1\utldict.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\tier1\utlmap.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Public\tier1\UtlMemory.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Public\tier1\utlsymbol.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\tier1\utlvector.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="vcprojconvert.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\public\vstdlib\vstdlib.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath="..\..\public\appframework\IAppSystem.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\public\tier0.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
Description=""
|
||||
CommandLine=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\public\tier1.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\public\tier2.lib"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\public\vstdlib.lib"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
Reference in New Issue
Block a user