mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 22:15:32 +00:00
Merged in ardekanurs Boost changes
This commit is contained in:
commit
4cadf70abe
3 changed files with 11 additions and 45 deletions
|
@ -25,11 +25,13 @@ endif (WIN32)
|
|||
|
||||
# Dependencies
|
||||
find_package(OGRE REQUIRED)
|
||||
find_package(Boost REQUIRED)
|
||||
find_package(Boost REQUIRED COMPONENTS system filesystem)
|
||||
find_package(OIS REQUIRED)
|
||||
include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR})
|
||||
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
|
||||
|
||||
# Main executable
|
||||
add_executable(openmw ${BSA} ${TOOLS} ${OGRE} ${INPUT} ${GAME} ${GAMEREND})
|
||||
target_link_libraries(openmw ${OGRE_LIBRARIES} ${OIS_LIBRARIES})
|
||||
target_link_libraries(openmw ${OGRE_LIBRARIES})
|
||||
target_link_libraries(openmw ${OIS_LIBRARIES})
|
||||
target_link_libraries(openmw ${Boost_LIBRARIES})
|
||||
|
|
|
@ -16,8 +16,8 @@ Getting OpenMW Working
|
|||
1. Clone this repository.
|
||||
2. Install `bjam` through MacPorts.
|
||||
3. Download [boost][] 1.43 and install it with the following command:
|
||||
|
||||
$ mkdir build && sudo bjam --build-dir=build --layout=versioned --toolset=darwin --architecture=combined --address-model=32 --link=shared,static install
|
||||
|
||||
$ mkdir build && sudo bjam --build-dir=build --layout=versioned --toolset=darwin architecture=i386 address-model=32 --link=shared,static install
|
||||
|
||||
4. Download [Ogre][] 1.7.1 and build and Xcode project with CMake:
|
||||
|
||||
|
@ -28,10 +28,10 @@ Getting OpenMW Working
|
|||
6. Generate the Makefile for OpenMW as follows:
|
||||
|
||||
$ mkdir build && cd build && BOOST_INCLUDEDIR=/usr/local/include/boost-1_43 BOOST_LIBRARYDIR=/usr/local/lib CMAKE_OSX_ARCHITECTURES=i386 cmake ..
|
||||
|
||||
|
||||
7. Move your Morrowind `Data Files` directory into `build`, renamed as `data`.
|
||||
|
||||
[boost]: http://www.boost.org
|
||||
[Ogre]: http://www.ogre3d.org
|
||||
[official website]: http://openmw.com
|
||||
[Will Thimbleby's Ogre Framework]: http://www.thimbleby.net/ogre/
|
||||
[Will Thimbleby's Ogre Framework]: http://www.thimbleby.net/ogre/
|
||||
|
|
|
@ -1,44 +1,8 @@
|
|||
#include "fileops.hpp"
|
||||
|
||||
// Windows-specific implementation (NOT TESTED)
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
bool isFile(const char *name)
|
||||
{
|
||||
unsigned int stat = GetFileAttributes(name);
|
||||
return (stat != 0xFFFFFFFF &&
|
||||
(stat & FILE_ATTRIBUTE_DIRECTORY) == 0);
|
||||
boost::filesystem::path cfg_file_path(name);
|
||||
return boost::filesystem::exists(cfg_file_path);
|
||||
}
|
||||
#elif __linux__ // Linux implementations
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
bool isFile(const char *name)
|
||||
{
|
||||
// Does the file exist?
|
||||
if(access(name,0) != 0)
|
||||
return false;
|
||||
|
||||
struct stat st;
|
||||
if(stat(name, &st)) return false;
|
||||
return S_ISREG(st.st_mode);
|
||||
}
|
||||
|
||||
#elif __APPLE__ // Darwin implementations
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
|
||||
bool isFile(const char *name)
|
||||
{
|
||||
// Does the file exist?
|
||||
if(access(name,0) != 0)
|
||||
return false;
|
||||
|
||||
struct stat st;
|
||||
if(stat(name, &st)) return false;
|
||||
return S_ISREG(st.st_mode);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue