CMake for Windows-patch by Sylvain T (NOT YET TESTED). Includes update to Mangle.

Details:
- create a sub directory to store CMake scripts (later more to come)
- add a search Ogre package script (may be replaced later by "official" Ogre 1.7 search script, since they switched to CMake, yeah !)
- fixed header issues being not available with MSVC and replaced by equivalent functions if assumed portable enough
actorid
Nicolay Korslund 15 years ago
parent ef871c813b
commit 7238847b8b

@ -1,6 +1,11 @@
project(OpenMW)
# We probably support older versions than this.
cmake_minimum_required(VERSION 2.6)
# Add path for CMake scripts
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/)
# Local files
set(BSA bsa/bsa_archive.cpp bsa/bsa_file.cpp)
set(NIF nif/nif_file.cpp nifogre/ogre_nif_loader.cpp)
@ -8,10 +13,17 @@ set(TOOLS tools/stringops.cpp)
set(MANGLE_VFS mangle/vfs/servers/ogre_vfs.cpp)
set(GAME game/main.cpp)
# Platform specific
if (WIN32)
set(PLATFORM_INCLUDE_DIR "platform")
else (WIN32)
set(PLATFORM_INCLUDE_DIR "")
endif (WIN32)
# Dependencies
find_package(PkgConfig REQUIRED)
pkg_check_modules(OGRE REQUIRED OGRE)
include_directories(${OGRE_INCLUDE_DIRS})
find_package(OGRE REQUIRED)
include_directories("." "bsa" "esm" "game" "mangle" "nif" "nifogre" "tools" ${OGRE_INCLUDE_DIR} ${PLATFORM_INCLUDE_DIR})
link_directories(${OGRE_LIB_DIR})
# Main executable
add_executable(openmw ${BSA} ${TOOLS} ${GAME})

@ -0,0 +1,27 @@
The following files are derived from the Thermite project
(http://www.thermite3d.org) and are covered under the license below.
FindMYGUI.cmake, FindOGRE.cmake, FindOIS.cmake, FindBullet.cmake
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

@ -0,0 +1,68 @@
# Find OGRE includes and library
#
# This module defines
# OGRE_INCLUDE_DIR
# OGRE_LIBRARIES, the libraries to link against to use OGRE.
# OGRE_LIB_DIR, the location of the libraries
# OGRE_FOUND, If false, do not try to use OGRE
#
# Copyright © 2007, Matt Williams
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
CMAKE_POLICY(PUSH)
IF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
SET(OGRE_FIND_QUIETLY TRUE) # Already in cache, be silent
ENDIF (OGRE_LIBRARIES AND OGRE_INCLUDE_DIR)
IF (WIN32) #Windows
MESSAGE(STATUS "Looking for OGRE")
SET(OGRESDK $ENV{OGRE_HOME})
SET(OGRESOURCE $ENV{OGRE_SRC})
IF (OGRESDK)
MESSAGE(STATUS "Using OGRE SDK")
STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESDK}")
SET(OGRE_INCLUDE_DIR ${OGRESDK}/include)
SET(OGRE_LIB_DIR ${OGRESDK}/lib)
SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
ENDIF (OGRESDK)
IF (OGRESOURCE)
MESSAGE(STATUS "Using OGRE built from source")
SET(OGRE_INCLUDE_DIR $ENV{OGRE_SRC}/OgreMain/include)
SET(OGRE_LIB_DIR $ENV{OGRE_SRC}/lib)
SET(OGRE_LIBRARIES debug OgreMain_d optimized OgreMain)
ENDIF (OGRESOURCE)
ELSE (WIN32) #Unix
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
FIND_PACKAGE(PkgConfig REQUIRED)
PKG_SEARCH_MODULE(OGRE REQUIRED OGRE)
SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIRS})
SET(OGRE_LIB_DIR ${OGRE_LIBDIR})
SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
ENDIF (WIN32)
#Do some preparation
SEPARATE_ARGUMENTS(OGRE_INCLUDE_DIR)
SEPARATE_ARGUMENTS(OGRE_LIBRARIES)
SET(OGRE_INCLUDE_DIR ${OGRE_INCLUDE_DIR} CACHE PATH "")
SET(OGRE_LIBRARIES ${OGRE_LIBRARIES} CACHE STRING "")
SET(OGRE_LIB_DIR ${OGRE_LIB_DIR} CACHE PATH "")
IF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
SET(OGRE_FOUND TRUE)
ENDIF (OGRE_INCLUDE_DIR AND OGRE_LIBRARIES)
IF (OGRE_FOUND)
IF (NOT OGRE_FIND_QUIETLY)
MESSAGE(STATUS " libraries : ${OGRE_LIBRARIES} from ${OGRE_LIB_DIR}")
MESSAGE(STATUS " includes : ${OGRE_INCLUDE_DIR}")
ENDIF (NOT OGRE_FIND_QUIETLY)
ELSE (OGRE_FOUND)
IF (OGRE_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find OGRE")
ENDIF (OGRE_FIND_REQUIRED)
ENDIF (OGRE_FOUND)
CMAKE_POLICY(POP)

@ -1 +1 @@
Subproject commit 2a6ed21351464751245c485f933ed788d6cb0698
Subproject commit 401fa0079c9045e4550c05ca342bde8775e39264

@ -0,0 +1,11 @@
// Wrapper for MSVC
#ifndef _STDINT_WRAPPER_H
#define _STDINT_WRAPPER_H
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#endif

@ -0,0 +1,9 @@
// Wrapper for MSVC
#ifndef _STRINGS_WRAPPER_H
#define _STRINGS_WRAPPER_H
#pragma warning(disable: 4996)
#define strcasecmp stricmp
#endif
Loading…
Cancel
Save