@ -1,22 +1,25 @@
# l o c a l f i l e s
set ( OPENMW_SOURCES
set ( GAME
m a i n . c p p
e n g i n e . c p p
e n g i n e . c p p
o p t i o n s . c p p
o p t i o n s . c p p
)
set ( OPENMW_RESOURCES
$ { C M A K E _ S O U R C E _ D I R } / f i l e s / w i n d o w s / o p e n m w . r c
$ { C M A K E _ S O U R C E _ D I R } / f i l e s / w i n d o w s / o p e n m w . r c
$ { C M A K E _ S O U R C E _ D I R } / f i l e s / w i n d o w s / o p e n m w . e x e . m a n i f e s t
$ { C M A K E _ S O U R C E _ D I R } / f i l e s / w i n d o w s / o p e n m w . e x e . m a n i f e s t
)
)
if ( ANDROID )
if ( ANDROID )
set ( GAME ${ GAME } android_main.cpp )
set ( OPENMW_SOURCES ${ OPENMW_SOURCES } android_main.cpp )
endif ( )
endif ( )
set ( GAME_HEADER
set ( OPENMW_HEADERS
d o c . h p p
e n g i n e . h p p
e n g i n e . h p p
o p t i o n s . h p p
p r o f i l e . h p p
)
)
source_group ( game FILES ${ GAME } ${ GAME_HEADER } )
source_group ( apps/openmw FILES main.cpp ${ OPENMW_SOURCES } ${ OPENMW_HEADERS } ${ OPENMW_RESOURCES } )
add_openmw_dir ( mwrender
add_openmw_dir ( mwrender
a c t o r s o b j e c t s r e n d e r i n g m a n a g e r a n i m a t i o n r o t a t e c o n t r o l l e r s k y s k y u t i l n p c a n i m a t i o n e s m 4 n p c a n i m a t i o n v i s m a s k
a c t o r s o b j e c t s r e n d e r i n g m a n a g e r a n i m a t i o n r o t a t e c o n t r o l l e r s k y s k y u t i l n p c a n i m a t i o n e s m 4 n p c a n i m a t i o n v i s m a s k
@ -120,16 +123,27 @@ add_openmw_dir (mwbase
# M a i n e x e c u t a b l e
# M a i n e x e c u t a b l e
if ( NOT ANDROID )
if ( NOT ANDROID )
openmw_add_executable( openmw
add_library( openmw-lib STATIC
$ { O P E N M W _ F I L E S }
$ { O P E N M W _ F I L E S }
$ { G A M E } $ { G A M E _ H E A D E R }
$ { O P E N M W _ S O U R C E S }
)
# O t h e r w i s e l i n k e r f a i l s w i t h L N K 1 1 4 9 b e c a u s e m a i n . c p p h a s __declspec ( dllexport )
if ( NOT WIN32 )
set_target_properties ( openmw-lib PROPERTIES OUTPUT_NAME openmw )
endif ( )
openmw_add_executable ( openmw
$ { A P P L E _ B U N D L E _ R E S O U R C E S }
$ { A P P L E _ B U N D L E _ R E S O U R C E S }
$ { O P E N M W _ R E S O U R C E S }
m a i n . c p p
)
)
target_link_libraries ( openmw openmw-lib )
else ( )
else ( )
add_library ( openmw
add_library ( openmw-lib SHARED
S H A R E D
$ { O P E N M W _ F I L E S }
$ { O P E N M W _ F I L E S }
$ { G A M E } $ { G A M E _ H E A D E R }
$ { OP E N M W _ S O U R C E S }
)
)
endif ( )
endif ( )
@ -139,7 +153,7 @@ include_directories(
$ { F F m p e g _ I N C L U D E _ D I R S }
$ { F F m p e g _ I N C L U D E _ D I R S }
)
)
target_link_libraries ( openmw
target_link_libraries ( openmw -lib
# C M a k e ' s b u i l t - i n O S G f i n d e r d o e s n o t u s e p k g c o n f i g , s o w e h a v e t o
# C M a k e ' s b u i l t - i n O S G f i n d e r d o e s n o t u s e p k g c o n f i g , s o w e h a v e t o
# m a n u a l l y e n s u r e t h e o r d e r i s c o r r e c t f o r i n t e r - l i b r a r y d e p e n d e n c i e s .
# m a n u a l l y e n s u r e t h e o r d e r i s c o r r e c t f o r i n t e r - l i b r a r y d e p e n d e n c i e s .
# T h i s o n l y m a k e s a d i f f e r e n c e w i t h ` - D O P E N M W _ U S E _ S Y S T E M _ O S G = O N - D O S G _ S T A T I C = O N ` .
# T h i s o n l y m a k e s a d i f f e r e n c e w i t h ` - D O P E N M W _ U S E _ S Y S T E M _ O S G = O N - D O S G _ S T A T I C = O N ` .
@ -163,7 +177,7 @@ target_link_libraries(openmw
)
)
if ( MSVC AND PRECOMPILE_HEADERS_WITH_MSVC )
if ( MSVC AND PRECOMPILE_HEADERS_WITH_MSVC )
target_precompile_headers ( openmw PRIVATE
target_precompile_headers ( openmw -lib PRIVATE
< b o o s t / p r o g r a m _ o p t i o n s / o p t i o n s _ d e s c r i p t i o n . h p p >
< b o o s t / p r o g r a m _ o p t i o n s / o p t i o n s _ d e s c r i p t i o n . h p p >
< s o l / s o l . h p p >
< s o l / s o l . h p p >
@ -191,20 +205,20 @@ endif()
add_definitions ( -DMYGUI_DONT_USE_OBSOLETE=ON )
add_definitions ( -DMYGUI_DONT_USE_OBSOLETE=ON )
if ( ANDROID )
if ( ANDROID )
target_link_libraries ( openmw EGL android log z )
target_link_libraries ( openmw -lib EGL android log z )
endif ( ANDROID )
endif ( ANDROID )
if ( USE_SYSTEM_TINYXML )
if ( USE_SYSTEM_TINYXML )
target_link_libraries ( openmw ${ TinyXML_LIBRARIES } )
target_link_libraries ( openmw -lib ${ TinyXML_LIBRARIES } )
endif ( )
endif ( )
if ( NOT UNIX )
if ( NOT UNIX )
target_link_libraries ( openmw ${ SDL2MAIN_LIBRARY } )
target_link_libraries ( openmw -lib ${ SDL2MAIN_LIBRARY } )
endif ( )
endif ( )
# F i x f o r n o t v i s i b l e p t h r e a d s f u n c t i o n s f o r l i n k e r w i t h g l i b c 2 . 1 5
# F i x f o r n o t v i s i b l e p t h r e a d s f u n c t i o n s f o r l i n k e r w i t h g l i b c 2 . 1 5
if ( UNIX AND NOT APPLE )
if ( UNIX AND NOT APPLE )
target_link_libraries ( openmw ${ CMAKE_THREAD_LIBS_INIT } )
target_link_libraries ( openmw -lib ${ CMAKE_THREAD_LIBS_INIT } )
endif ( )
endif ( )
if ( APPLE )
if ( APPLE )
@ -236,8 +250,12 @@ if(APPLE)
endif ( APPLE )
endif ( APPLE )
if ( BUILD_WITH_CODE_COVERAGE )
if ( BUILD_WITH_CODE_COVERAGE )
target_compile_options ( openmw PRIVATE --coverage )
target_compile_options ( openmw-lib PRIVATE --coverage )
target_link_libraries ( openmw gcov )
target_link_libraries ( openmw-lib gcov )
if ( NOT ANDROID )
target_compile_options ( openmw PRIVATE --coverage )
target_link_libraries ( openmw gcov )
endif ( )
endif ( )
endif ( )
if ( WIN32 )
if ( WIN32 )