@ -24,6 +24,10 @@
# D E A L I N G S I N T H E S O F T W A R E .
#
# I D E f o l d e r i n V S , X c o d e e t c . C M a k e 3 . 1 2 + , o l d e r v e r s i o n s h a v e o n l y t h e F O L D E R
# p r o p e r t y t h a t w o u l d h a v e t o b e s e t o n e a c h t a r g e t s e p a r a t e l y .
set ( CMAKE_FOLDER "Magnum/Platform" )
# C o d e s h a r e d b y m o r e a p p l i c a t i o n / c o n t e x t i m p l e m e n t a t i o n s
set ( MagnumPlatform_SRCS )
@ -63,7 +67,6 @@ if(WITH_EMSCRIPTENAPPLICATION OR WITH_GLFWAPPLICATION OR WITH_SDL2APPLICATION)
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumPlatformObjects PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
set_target_properties ( MagnumPlatformObjects PROPERTIES FOLDER "Magnum/Platform" )
# U s e t h e F o u n d a t i o n f r a m e w o r k o n A p p l e t o q u e r y t h e D P I a w a r e n e s s
if ( CORRADE_TARGET_APPLE )
@ -148,8 +151,7 @@ if(WITH_ANDROIDAPPLICATION)
add_library ( MagnumAndroidApplicationGlue OBJECT
" $ { C M A K E _ A N D R O I D _ N D K } / s o u r c e s / a n d r o i d / n a t i v e _ a p p _ g l u e / a n d r o i d _ n a t i v e _ a p p _ g l u e . c " )
set_target_properties ( MagnumAndroidApplicationGlue PROPERTIES
C O R R A D E _ U S E _ P E D A N T I C _ F L A G S O F F
F O L D E R " M a g n u m / P l a t f o r m " )
C O R R A D E _ U S E _ P E D A N T I C _ F L A G S O F F )
add_library ( MagnumAndroidApplication STATIC
$ { M a g n u m A n d r o i d A p p l i c a t i o n _ S R C S }
@ -159,8 +161,7 @@ if(WITH_ANDROIDAPPLICATION)
target_include_directories ( MagnumAndroidApplication PUBLIC
" $ { C M A K E _ A N D R O I D _ N D K } / s o u r c e s / a n d r o i d / n a t i v e _ a p p _ g l u e / " )
set_target_properties ( MagnumAndroidApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h e A p p l i c a t i o n l i b i s a l w a y s
# l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e s h a r e d l i b
target_link_libraries ( MagnumAndroidApplication PUBLIC
@ -195,8 +196,7 @@ if(WITH_EMSCRIPTENAPPLICATION)
$ { M a g n u m E m s c r i p t e n A p p l i c a t i o n _ H E A D E R S }
$ { M a g n u m E m s c r i p t e n A p p l i c a t i o n _ P R I V A T E _ H E A D E R S } )
set_target_properties ( MagnumEmscriptenApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
# T O D O : u s e M a g n u m P l a t f o r m O b j e c t s i n s t e a d o f $ { M a g n u m P l a t f o r m _ * } w h e n
# C M a k e s u p p o r t s i t
target_link_libraries ( MagnumEmscriptenApplication PUBLIC Magnum
@ -236,8 +236,7 @@ if(WITH_GLFWAPPLICATION)
$ { M a g n u m G l f w A p p l i c a t i o n _ S R C S }
$ { M a g n u m G l f w A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumGlfwApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumGlfwApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -309,8 +308,7 @@ if(WITH_SDL2APPLICATION)
$ { M a g n u m S d l 2 A p p l i c a t i o n _ S R C S }
$ { M a g n u m S d l 2 A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumSdl2Application PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumSdl2Application PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -401,8 +399,7 @@ if(WITH_GLXAPPLICATION)
$ { M a g n u m G l x A p p l i c a t i o n _ S R C S }
$ { M a g n u m G l x A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumGlxApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h e A p p l i c a t i o n l i b i s a l w a y s
# l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e s h a r e d l i b
target_include_directories ( MagnumGlxApplication PUBLIC ${ X11_INCLUDE_DIR } )
@ -452,8 +449,7 @@ if(WITH_XEGLAPPLICATION)
$ { M a g n u m X E g l A p p l i c a t i o n _ S R C S }
$ { M a g n u m X E g l A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumXEglApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h e A p p l i c a t i o n l i b i s a l w a y s
# l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e s h a r e d l i b
target_include_directories ( MagnumXEglApplication PUBLIC ${ X11_INCLUDE_DIR } )
@ -491,8 +487,7 @@ if(WITH_WINDOWLESSEGLAPPLICATION)
$ { M a g n u m W i n d o w l e s s E g l A p p l i c a t i o n _ H E A D E R S }
$ { M a g n u m W i n d o w l e s s E g l A p p l i c a t i o n _ P R I V A T E _ H E A D E R S } )
set_target_properties ( MagnumWindowlessEglApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWindowlessEglApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -530,8 +525,7 @@ if(WITH_WINDOWLESSGLXAPPLICATION)
$ { M a g n u m W i n d o w l e s s G l x A p p l i c a t i o n _ S R C S }
$ { M a g n u m W i n d o w l e s s G l x A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumWindowlessGlxApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
# X 1 1 m a c r o s a r e a m e s s , d i s a b l e w a r n i n g s f o r C - s t y l e c a s t s
target_compile_options ( MagnumWindowlessGlxApplication PRIVATE "-Wno-old-style-cast" )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
@ -576,8 +570,7 @@ if(WITH_WINDOWLESSIOSAPPLICATION)
$ { M a g n u m W i n d o w l e s s I o s A p p l i c a t i o n _ S R C S }
$ { M a g n u m W i n d o w l e s s I o s A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumWindowlessIosApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWindowlessIosApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -613,8 +606,7 @@ if(WITH_WINDOWLESSWGLAPPLICATION)
$ { M a g n u m W i n d o w l e s s W g l A p p l i c a t i o n _ S R C S }
$ { M a g n u m W i n d o w l e s s W g l A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumWindowlessWglApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
target_compile_definitions ( MagnumWindowlessWglApplication PRIVATE "UNICODE" )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWindowlessWglApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
@ -653,8 +645,7 @@ if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION)
$ { M a g n u m W i n d o w l e s s W i n d o w s E g l A p p l i c a t i o n _ H E A D E R S }
$ { M a g n u m W i n d o w l e s s W i n d o w s E g l A p p l i c a t i o n _ P R I V A T E _ H E A D E R S } )
set_target_properties ( MagnumWindowlessWindowsEglApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWindowlessWindowsEglApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -690,8 +681,7 @@ if(WITH_WINDOWLESSCGLAPPLICATION)
$ { M a g n u m W i n d o w l e s s C g l A p p l i c a t i o n _ S R C S }
$ { M a g n u m W i n d o w l e s s C g l A p p l i c a t i o n _ H E A D E R S } )
set_target_properties ( MagnumWindowlessCglApplication PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWindowlessCglApplication PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -720,7 +710,6 @@ if(NEED_ABSTRACTXAPPLICATION)
target_compile_options ( MagnumAbstractXApplication PRIVATE "-Wno-old-style-cast" )
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h e A p p l i c a t i o n l i b i s a l w a y s
# l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e s h a r e d l i b
set_target_properties ( MagnumAbstractXApplication PROPERTIES FOLDER "Magnum/Platform" )
install ( FILES ${ MagnumAbstractXApplication_HEADERS } DESTINATION ${ MAGNUM_INCLUDE_INSTALL_DIR } /Platform )
endif ( )
@ -742,7 +731,6 @@ if(NEED_GLXCONTEXTHANDLER)
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h i s i s p a r t o f A p p l i c a t i o n l i b ,
# w h i c h i s a l w a y s l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e
# s h a r e d l i b
set_target_properties ( MagnumGlxContextHandler PROPERTIES FOLDER "Magnum/Platform" )
endif ( )
# E G L c o n t e x t h a n d l e r
@ -771,7 +759,6 @@ if(NEED_EGLCONTEXTHANDLER)
# A s s u m i n g t h a t P I C i s n o t n e e d e d b e c a u s e t h i s i s p a r t o f A p p l i c a t i o n l i b ,
# w h i c h i s a l w a y s l i n k e d t o t h e e x e c u t a b l e a n d n o t t o a n y i n t e r m e d i a t e
# s h a r e d l i b
set_target_properties ( MagnumEglContextHandler PROPERTIES FOLDER "Magnum/Platform" )
endif ( )
# P l a t f o r m - s p e c i f i c s o u r c e s f o r c o n t e x t l i b r a r y
@ -806,7 +793,6 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT)
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumCglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
set_target_properties ( MagnumCglContextObjects PROPERTIES FOLDER "Magnum/Platform" )
# A l s o c r e a t e p r o p e r s t a t i c l i b r a r y , i f r e q u e s t e d
if ( WITH_CGLCONTEXT )
@ -818,8 +804,7 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT)
$ < T A R G E T _ O B J E C T S : M a g n u m C g l C o n t e x t O b j e c t s >
$ { P R O J E C T _ S O U R C E _ D I R } / s r c / d u m m y . c p p ) # X C o d e w o r k a r o u n d , s e e f i l e c o m m e n t f o r d e t a i l s
set_target_properties ( MagnumCglContext PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumCglContext PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -850,7 +835,6 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT)
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumEglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
set_target_properties ( MagnumEglContextObjects PROPERTIES FOLDER "Magnum/Platform" )
# A l s o c r e a t e p r o p e r s t a t i c l i b r a r y , i f r e q u e s t e d
if ( WITH_EGLCONTEXT )
@ -862,8 +846,7 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT)
$ < T A R G E T _ O B J E C T S : M a g n u m E g l C o n t e x t O b j e c t s >
$ { P R O J E C T _ S O U R C E _ D I R } / s r c / d u m m y . c p p ) # X C o d e w o r k a r o u n d , s e e f i l e c o m m e n t f o r d e t a i l s
set_target_properties ( MagnumEglContext PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumEglContext PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -889,7 +872,6 @@ if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT)
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumGlxContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
set_target_properties ( MagnumGlxContextObjects PROPERTIES FOLDER "Magnum/Platform" )
# A l s o c r e a t e p r o p e r s t a t i c l i b r a r y , i f r e q u e s t e d
if ( WITH_GLXCONTEXT )
@ -899,8 +881,7 @@ if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT)
add_library ( MagnumGlxContext STATIC $< TARGET_OBJECTS:MagnumGlxContextObjects > )
set_target_properties ( MagnumGlxContext PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumGlxContext PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -927,7 +908,6 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT)
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWglContextObjects PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
set_target_properties ( MagnumWglContextObjects PROPERTIES FOLDER "Magnum/Platform" )
# A l s o c r e a t e p r o p e r s t a t i c l i b r a r y , i f r e q u e s t e d
if ( WITH_WGLCONTEXT )
@ -937,8 +917,7 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT)
add_library ( MagnumWglContext STATIC $< TARGET_OBJECTS:MagnumWglContextObjects > )
set_target_properties ( MagnumWglContext PROPERTIES
D E B U G _ P O S T F I X " - d "
F O L D E R " M a g n u m / P l a t f o r m " )
D E B U G _ P O S T F I X " - d " )
if ( NOT BUILD_STATIC OR BUILD_STATIC_PIC )
set_target_properties ( MagnumWglContext PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif ( )
@ -983,7 +962,6 @@ if(WITH_GL_INFO)
else ( )
message ( FATAL_ERROR "magnum-gl-info is not available on this platform. Set WITH_GL_INFO to OFF to skip building it." )
endif ( )
set_target_properties ( magnum-gl-info PROPERTIES FOLDER "Magnum/Platform" )
if ( NOT CORRADE_TARGET_EMSCRIPTEN )
install ( TARGETS magnum-gl-info DESTINATION ${ MAGNUM_BINARY_INSTALL_DIR } )
@ -1021,7 +999,6 @@ endif()
# F o r c e I D E s d i s p l a y a l s o a l l h e a d e r f i l e s a n d a d d i t i o n a l f i l e s i n p r o j e c t v i e w
add_custom_target ( MagnumPlatform SOURCES ${ MagnumPlatform_HEADERS } ${ MagnumPlatform_FILES } )
set_target_properties ( MagnumPlatform PROPERTIES FOLDER "Magnum/Platform" )
if ( BUILD_TESTS )
add_subdirectory ( Test )