@ -20,7 +20,7 @@ message(STATUS "Configuring OpenMW...")
set ( OPENMW_VERSION_MAJOR 0 )
set ( OPENMW_VERSION_MINOR 35 )
set ( OPENMW_VERSION_RELEASE 0 )
set ( OPENMW_VERSION_RELEASE 1 )
set ( OPENMW_VERSION_COMMITHASH "" )
set ( OPENMW_VERSION_TAGHASH "" )
@ -98,43 +98,6 @@ endif()
# W e p r o b a b l y s u p p o r t o l d e r v e r s i o n s t h a n t h i s .
cmake_minimum_required ( VERSION 2.6 )
# s o u r c e d i r e c t o r y : l i b s
set ( LIBS_DIR ${ CMAKE_SOURCE_DIR } /libs )
set ( OENGINE_OGRE
$ { L I B S _ D I R } / o p e n e n g i n e / o g r e / r e n d e r e r . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / o g r e / l i g h t s . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / o g r e / s e l e c t i o n b u f f e r . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / o g r e / i m a g e r o t a t e . c p p
)
set ( OENGINE_GUI
$ { L I B S _ D I R } / o p e n e n g i n e / g u i / l o g l i s t e n e r . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / g u i / m a n a g e r . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / g u i / l a y o u t . c p p
)
set ( OENGINE_BULLET
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B t O g r e . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B t O g r e E x t r a s . h
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B t O g r e G P . h
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B t O g r e P G . h
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / p h y s i c . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / p h y s i c . h p p
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B u l l e t S h a p e L o a d e r . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / B u l l e t S h a p e L o a d e r . h
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / t r a c e . c p p
$ { L I B S _ D I R } / o p e n e n g i n e / b u l l e t / t r a c e . h
)
set ( OENGINE_ALL ${ OENGINE_OGRE } ${ OENGINE_GUI } ${ OENGINE_BULLET } )
source_group ( libs\\openengine FILES ${ OENGINE_ALL } )
set ( OPENMW_LIBS ${ OENGINE_ALL } )
set ( OPENMW_LIBS_HEADER )
# S o u n d s e t u p
set ( FFmpeg_FIND_COMPONENTS AVCODEC AVFORMAT AVUTIL SWSCALE SWRESAMPLE AVRESAMPLE )
unset ( FFMPEG_LIBRARIES CACHE )
@ -270,7 +233,8 @@ endif ()
endif ( WIN32 )
endif ( OGRE_STATIC )
include_directories ( "."
include_directories ( "." ${ LIBS_DIR }
S Y S T E M
$ { O G R E _ I N C L U D E _ D I R } $ { O G R E _ I N C L U D E _ D I R } / O g r e $ { O G R E _ I N C L U D E _ D I R } / O G R E $ { O G R E _ I N C L U D E _ D I R S } $ { O G R E _ P L U G I N _ I N C L U D E _ D I R S }
$ { O G R E _ I N C L U D E _ D I R } / O v e r l a y $ { O G R E _ O v e r l a y _ I N C L U D E _ D I R }
$ { S D L 2 _ I N C L U D E _ D I R }
@ -279,7 +243,7 @@ include_directories("."
$ { M Y G U I _ I N C L U D E _ D I R S }
$ { M Y G U I _ P L A T F O R M _ I N C L U D E _ D I R S }
$ { O P E N A L _ I N C L U D E _ D I R }
$ { LI B S _ D I R }
$ { BU L L E T _ I N C L U D E _ D I R S }
)
link_directories ( ${ SDL2_LIBRARY_DIRS } ${ Boost_LIBRARY_DIRS } ${ OGRE_LIB_DIR } ${ MYGUI_LIB_DIR } )
@ -379,6 +343,9 @@ configure_file(${OpenMW_SOURCE_DIR}/files/opencs.ini
configure_file ( ${ OpenMW_SOURCE_DIR } /files/opencs/defaultfilters
" $ { O p e n M W _ B I N A R Y _ D I R } / r e s o u r c e s / d e f a u l t f i l t e r s " C O P Y O N L Y )
configure_file ( ${ OpenMW_SOURCE_DIR } /files/gamecontrollerdb.txt
" $ { O p e n M W _ B I N A R Y _ D I R } / g a m e c o n t r o l l e r d b . t x t " )
if ( NOT WIN32 AND NOT APPLE )
configure_file ( ${ OpenMW_SOURCE_DIR } /files/openmw.desktop
" $ { O p e n M W _ B I N A R Y _ D I R } / o p e n m w . d e s k t o p " )
@ -386,22 +353,22 @@ if (NOT WIN32 AND NOT APPLE)
" $ { O p e n M W _ B I N A R Y _ D I R } / o p e n m w - c s . d e s k t o p " )
endif ( )
# C om p i l e r s e t t i n g s
if ( CMAKE_C OMPILER_IS_GNUCC )
SET( CMAKE_CXX_FLAGS " -Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long ${CMAKE_CXX_FLAGS} ")
# C XX C om p i l e r s e t t i n g s
if ( CMAKE_C XX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-reorder -std=c++98 -pedantic -Wno-long-long")
execute_process ( COMMAND ${ CMAKE_C_COMPILER } -dumpversion
O U T P U T _ V A R I A B L E G C C _ V E R S I O N )
if ( "${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6 )
SET( CMAKE_CXX_FLAGS "-Wno-unused-but-set-parameter ${CMAKE_CXX_FLAGS} ")
endif ( "${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6 )
if ( CMAKE_CXX_COMPILER_ID STREQUAL GNU AND "${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6 )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-parameter ")
endif ( CMAKE_CXX_COMPILER_ID STREQUAL GNU AND "${GCC_VERSION}" VERSION_GREATER 4.6 OR "${GCC_VERSION}" VERSION_EQUAL 4.6 )
elseif ( MSVC )
# E n a b l e l i n k - t i m e c o d e g e n e r a t i o n g l o b a l l y f o r a l l l i n k i n g
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL" )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
set ( CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /LTCG" )
set ( CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG" )
endif ( CMAKE_C OMPILER_IS_GNUCC )
endif ( CMAKE_C XX_COMPILER_ID STREQUAL GNU OR CMAKE_CXX_COMPILER_ID STREQUAL Clang )
IF ( NOT WIN32 AND NOT APPLE )
# L i n u x b u i l d i n g
@ -468,6 +435,8 @@ IF(NOT WIN32 AND NOT APPLE)
INSTALL ( FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw" )
INSTALL ( FILES "${OpenMW_BINARY_DIR}/transparency-overrides.cfg" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw" )
INSTALL ( FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" DESTINATION "${SYSCONFDIR}" RENAME "openmw.cfg" COMPONENT "openmw" )
INSTALL ( FILES "${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" DESTINATION "${SYSCONFDIR}" COMPONENT "openmw" )
IF ( BUILD_OPENCS )
INSTALL ( FILES "${OpenMW_BINARY_DIR}/opencs.ini" DESTINATION "${SYSCONFDIR}" COMPONENT "opencs" )
ENDIF ( BUILD_OPENCS )
@ -488,6 +457,7 @@ if(WIN32)
" $ { O p e n M W _ S O U R C E _ D I R } / D o c s / l i c e n s e / D e j a V u F o n t L i c e n s e . t x t "
" $ { O p e n M W _ B I N A R Y _ D I R } / s e t t i n g s - d e f a u l t . c f g "
" $ { O p e n M W _ B I N A R Y _ D I R } / t r a n s p a r e n c y - o v e r r i d e s . c f g "
" $ { O p e n M W _ B I N A R Y _ D I R } / g a m e c o n t r o l l e r d b . t x t "
" $ { O p e n M W _ B I N A R Y _ D I R } / R e l e a s e / o p e n m w . e x e "
D E S T I N A T I O N " . " )
@ -572,6 +542,10 @@ if(WIN32)
include ( CPack )
endif ( WIN32 )
# L i b s
include_directories ( libs )
add_subdirectory ( libs/openengine )
# E x t e r n
# add_subdirectory ( extern/shiny )
# add_subdirectory ( extern/ogre-ffmpeg-videoplayer )
@ -682,6 +656,7 @@ if (WIN32)
4 1 9 3 # # p r a g m a warning ( pop ) : n o m a t c h i n g ' # p r a g m a warning ( push ) '
4 2 5 1 # c l a s s ' X X X X ' n e e d s t o h a v e d l l - i n t e r f a c e t o b e u s e d b y c l i e n t s o f c l a s s ' Y Y Y Y '
4 2 7 5 # n o n d l l - i n t e r f a c e s t r u c t ' X X X X ' u s e d a s b a s e f o r d l l - i n t e r f a c e c l a s s ' Y Y Y Y '
4 3 1 5 # u n d o c u m e n t e d , ' t h i s ' p o i n t e r f o r m e m b e r m i g h t n o t b e aligned ( OgreMemoryStlAllocator.h )
# c a u s e d b y b o o s t
4 1 9 1 # ' t y p e c a s t ' : u n s a f e conversion ( 1.56, thread_primitives.hpp, normally off )
@ -689,6 +664,7 @@ if (WIN32)
# O p e n M W s p e c i f i c w a r n i n g s
4 0 9 9 # T y p e m i s m a t c h , d e c l a r e d c l a s s o r s t r u c t i s d e f i n e d w i t h o t h e r t y p e
4 1 0 0 # U n r e f e r e n c e d f o r m a l parameter ( -Wunused-parameter )
4 1 0 1 # U n r e f e r e n c e d l o c a l variable ( -Wunused-variable )
4 1 2 7 # C o n d i t i o n a l e x p r e s s i o n i s c o n s t a n t
4 2 4 2 # S t o r i n g v a l u e i n a v a r i a b l e o f a s m a l l e r t y p e , p o s s i b l e l o s s o f d a t a
4 2 4 4 # S t o r i n g v a l u e o f o n e t y p e i n v a r i a b l e o f another ( size_t in int, for example )
@ -707,56 +683,23 @@ if (WIN32)
set ( WARNINGS "${WARNINGS} /wd${d}" )
endforeach ( d )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS} ${MT_BUILD}" )
# b o o s t : : w a v e h a s a f e w i s s u e s w i t h s i g n e d / u n s i g n e d c o n v e r s i o n s , s o w e s u p p r e s s t h o s e h e r e
set ( SHINY_WARNINGS "${WARNINGS} /wd4245" )
set_target_properties ( shiny PROPERTIES COMPILE_FLAGS "${SHINY_WARNINGS} ${MT_BUILD}" )
# t h e r e ' s a n u n r e f e r e n c e d l o c a l v a r i a b l e i n t h e o g r e p l a t f o r m , s u p p r e s s i t
set ( SHINY_OGRE_WARNINGS "${WARNINGS} /wd4101" )
set_target_properties ( shiny.OgrePlatform PROPERTIES COMPILE_FLAGS "${SHINY_OGRE_WARNINGS} ${MT_BUILD}" )
set_target_properties ( sdl4ogre PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
# o i c s u s e s t i n y x m l , w h i c h h a s a n i n i t i a l i z e d b u t u n u s e d v a r i a b l e
set ( OICS_WARNINGS "${WARNINGS} /wd4189" )
set_target_properties ( oics PROPERTIES COMPILE_FLAGS "${OICS_WARNINGS} ${MT_BUILD}" )
set_target_properties ( components PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
if ( BUILD_LAUNCHER )
set_target_properties ( openmw-launcher PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
endif ( BUILD_LAUNCHER )
set_target_properties ( openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
if ( BUILD_BSATOOL )
set_target_properties ( bsatool PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
endif ( BUILD_BSATOOL )
if ( BUILD_ESMTOOL )
set_target_properties ( esmtool PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
endif ( BUILD_ESMTOOL )
if ( BUILD_WIZARD )
set_target_properties ( openmw-wizard PROPERTIES COMPILE_FLAGS ${ WARNINGS } )
endif ( BUILD_WIZARD )
if ( BUILD_OPENCS )
# Q T t r i g g e r s a n i n f o r m a t i o n a l w a r n i n g t h a t t h e o b j e c t l a y o u t m a y d i f f e r w h e n c o m p i l e d w i t h / v d 2
set ( OPENCS_WARNINGS "${WARNINGS} ${MT_BUILD} /wd4435" )
set_target_properties ( openmw-cs PROPERTIES COMPILE_FLAGS ${ OPENCS_WARNINGS } )
endif ( BUILD_OPENCS )
if ( BUILD_MWINIIMPORTER )
set_target_properties ( openmw-iniimporter PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}" )
endif ( BUILD_MWINIIMPORTER )
endif ( MSVC )
# S a m e f o r M i n G W
if ( MINGW )
if ( USE_DEBUG_CONSOLE )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_DEBUG "-Wl,-subsystem,console" )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "-Wl,-subsystem,console" )
set_target_properties ( openmw PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE" )
else ( USE_DEBUG_CONSOLE )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_DEBUG "-Wl,-subsystem,windows" )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_RELWITHDEBINFO "-Wl,-subsystem,windows" )
endif ( USE_DEBUG_CONSOLE )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_RELEASE "-Wl,-subsystem,console" )
set_target_properties ( openmw PROPERTIES LINK_FLAGS_MINSIZEREL "-Wl,-subsystem,console" )
set_target_properties ( openmw PROPERTIES COMPILE_DEFINITIONS_RELEASE "_CONSOLE" )
endif ( MINGW )
# T O D O : A t s o m e p o i n t r e l e a s e b u i l d s s h o u l d n o t u s e t h e c o n s o l e b u t r a t h e r w r i t e t o a l o g f i l e
# set_target_properties ( openmw PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS" )
# set_target_properties ( openmw PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS" )
@ -770,6 +713,7 @@ if (APPLE)
install ( DIRECTORY "${OpenMW_BINARY_DIR}/resources" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )
install ( FILES "${OpenMW_BINARY_DIR}/openmw.cfg.install" RENAME "openmw.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )
install ( FILES "${OpenMW_BINARY_DIR}/settings-default.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )
install ( FILES "${OpenMW_BINARY_DIR}/gamecontrollerdb.txt" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )
install ( FILES "${OpenMW_BINARY_DIR}/transparency-overrides.cfg" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )
install ( FILES "${OpenMW_BINARY_DIR}/opencs.ini" DESTINATION "${INSTALL_SUBDIR}" COMPONENT Runtime )