forked from teamnwah/openmw-tes3coop
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
|
# Dependencies
|
||||||
find_package(OGRE REQUIRED)
|
find_package(OGRE REQUIRED)
|
||||||
find_package(Boost REQUIRED)
|
find_package(Boost REQUIRED COMPONENTS system filesystem)
|
||||||
find_package(OIS REQUIRED)
|
find_package(OIS REQUIRED)
|
||||||
include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR})
|
include_directories("." ${OGRE_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR})
|
||||||
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
|
link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
|
||||||
|
|
||||||
# Main executable
|
# Main executable
|
||||||
add_executable(openmw ${BSA} ${TOOLS} ${OGRE} ${INPUT} ${GAME} ${GAMEREND})
|
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})
|
||||||
|
|
|
@ -17,7 +17,7 @@ Getting OpenMW Working
|
||||||
2. Install `bjam` through MacPorts.
|
2. Install `bjam` through MacPorts.
|
||||||
3. Download [boost][] 1.43 and install it with the following command:
|
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:
|
4. Download [Ogre][] 1.7.1 and build and Xcode project with CMake:
|
||||||
|
|
||||||
|
|
|
@ -1,44 +1,8 @@
|
||||||
#include "fileops.hpp"
|
#include "fileops.hpp"
|
||||||
|
#include <boost/filesystem.hpp>
|
||||||
// Windows-specific implementation (NOT TESTED)
|
|
||||||
#ifdef _WIN32
|
|
||||||
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
bool isFile(const char *name)
|
bool isFile(const char *name)
|
||||||
{
|
{
|
||||||
unsigned int stat = GetFileAttributes(name);
|
boost::filesystem::path cfg_file_path(name);
|
||||||
return (stat != 0xFFFFFFFF &&
|
return boost::filesystem::exists(cfg_file_path);
|
||||||
(stat & FILE_ATTRIBUTE_DIRECTORY) == 0);
|
|
||||||
}
|
}
|
||||||
#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