Added very early CMakeLists.txt, builds main executable from game/main.cpp
parent
db56985828
commit
320fb3f8b8
@ -1,4 +1,8 @@
|
||||
*.o
|
||||
*~
|
||||
data
|
||||
mw-scripts
|
||||
CMakeFiles
|
||||
CMakeCache.txt
|
||||
Makefile
|
||||
cmake*.cmake
|
||||
openmw
|
||||
|
@ -0,0 +1,17 @@
|
||||
# We probably support older versions than this.
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
# Local files
|
||||
set(BSA bsa/bsa_archive.cpp bsa/bsa_file.cpp)
|
||||
set(NIF nif/nif_file.cpp nifogre/ogre_nif_loader.cpp)
|
||||
set(TOOLS tools/stringops.cpp)
|
||||
set(MANGLE_VFS mangle/vfs/servers/ogre_vfs.cpp)
|
||||
set(GAME game/main.cpp)
|
||||
|
||||
# Dependencies
|
||||
# Not exactly platform independent, FIXME!
|
||||
add_definitions(-I/usr/local/include/OGRE)
|
||||
|
||||
# Main executable
|
||||
add_executable(openmw ${BSA} ${TOOLS} ${GAME})
|
||||
target_link_libraries(openmw OgreMain)
|
@ -0,0 +1,53 @@
|
||||
#include <iostream>
|
||||
|
||||
#include "../bsa/bsa_archive.h"
|
||||
#include "../esm/records.hpp"
|
||||
|
||||
#include "Ogre.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
// Absolute minimal OGRE setup
|
||||
void ogre_setup()
|
||||
{
|
||||
using namespace Ogre;
|
||||
|
||||
// Disable Ogre logging
|
||||
new LogManager;
|
||||
Log *log = LogManager::getSingleton().createLog("");
|
||||
log->setDebugOutputEnabled(false);
|
||||
|
||||
// Set up Root.
|
||||
new Root();
|
||||
}
|
||||
|
||||
void maintest()
|
||||
{
|
||||
const char* bsaFile = "data/Morrowind.bsa";
|
||||
const char* esmFile = "data/Morrowind.esm";
|
||||
|
||||
cout << "Hello, fellow traveler!\n";
|
||||
|
||||
cout << "Initializing OGRE\n";
|
||||
ogre_setup();
|
||||
|
||||
cout << "Adding " << bsaFile << endl;
|
||||
addBSA(bsaFile);
|
||||
|
||||
cout << "Loading ESM " << esmFile << " (header only)\n";
|
||||
ESM::ESMReader esm;
|
||||
esm.open(esmFile);
|
||||
|
||||
cout << "\nThat's all for now!\n";
|
||||
}
|
||||
|
||||
int main(/*int argc, char**argv*/)
|
||||
{
|
||||
try { maintest(); }
|
||||
catch(exception &e)
|
||||
{
|
||||
cout << "\nERROR: " << e.what() << endl;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue