@ -2,14 +2,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++0x -fvisibility=
include_directories ( ${ CMAKE_CURRENT_SOURCE_DIR } ${ CORRADE_INCLUDE_DIR } )
include_directories ( ${ CMAKE_CURRENT_SOURCE_DIR } ${ CORRADE_INCLUDE_DIR } )
add_subdirectory ( Math )
# O n 6 4 b i t L i n u x w i t h G C C f l a g - f P I C i s n e e d e d f o r b u i l d i n g s o m e s t a t i c l i b r a r i e s
add_subdirectory ( MeshTools )
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 AND CMAKE_COMPILER_IS_GNUCC AND CMAKE_SYSTEM_NAME STREQUAL "Linux" )
add_subdirectory ( Physics )
set ( USE_FPIC ON )
add_subdirectory ( Primitives )
else ( )
add_subdirectory ( Shaders )
set ( USE_FPIC OFF )
endif ( )
# F i l e s s h a r e d b e t w e e n m a i n l i b r a r y a n d u n i t t e s t l i b r a r y
set ( Magnum_SRCS
set ( Magnum_SRCS
O b j e c t . c p p
A b s t r a c t I m a g e . c p p
A b s t r a c t I m a g e . c p p
A b s t r a c t T e x t u r e . c p p
A b s t r a c t T e x t u r e . c p p
A b s t r a c t S h a d e r P r o g r a m . c p p
A b s t r a c t S h a d e r P r o g r a m . c p p
@ -27,21 +28,48 @@ set(Magnum_SRCS
T r a d e / A b s t r a c t I m p o r t e r . c p p
T r a d e / A b s t r a c t I m p o r t e r . c p p
T r a d e / M e s h D a t a . c p p
T r a d e / M e s h D a t a . c p p
)
add_library ( MagnumObjects OBJECT ${ Magnum_SRCS } )
# F i l e s s h a r e d b e t w e e n m a i n l i b r a r y a n d m a t h u n i t t e s t l i b r a r y
set ( MagnumMath_SRCS
M a t h / M a t h . c p p
M a t h / M a t h . c p p
)
)
add_library ( MagnumMathObjects OBJECT ${ MagnumMath_SRCS } )
add_library ( Magnum SHARED ${ Magnum_SRCS } )
if ( USE_FPIC )
set_target_properties ( MagnumObjects PROPERTIES COMPILE_FLAGS -fPIC )
set_target_properties ( MagnumMathObjects PROPERTIES COMPILE_FLAGS -fPIC )
endif ( )
target_link_libraries ( Magnum ${ CORRADE_UTILITY_LIBRARY } ${ CORRADE_PLUGINMANAGER_LIBRARY } ${ OPENGL_gl_LIBRARY } ${ GLEW_LIBRARY } )
# F i l e s c o m p i l e d w i t h d i f f e r e n t f l a g s f o r m a i n l i b r a r y a n d u n i t t e s t l i b r a r y
set ( Magnum_GracefulAssert_SRCS
O b j e c t . c p p
)
# M a i n l i b r a r y
add_library ( Magnum SHARED
$ < T A R G E T _ O B J E C T S : M a g n u m O b j e c t s >
$ < T A R G E T _ O B J E C T S : M a g n u m M a t h O b j e c t s >
$ { M a g n u m _ G r a c e f u l A s s e r t _ S R C S }
)
target_link_libraries ( Magnum ${ CORRADE_UTILITY_LIBRARY } ${ CORRADE_PLUGINMANAGER_LIBRARY } ${ OPENGL_gl_LIBRARY } ${ GLEW_LIBRARY } )
install ( TARGETS Magnum DESTINATION ${ MAGNUM_LIBRARY_INSTALL_DIR } )
install ( TARGETS Magnum DESTINATION ${ MAGNUM_LIBRARY_INSTALL_DIR } )
add_subdirectory ( Math )
add_subdirectory ( MeshTools )
add_subdirectory ( Physics )
add_subdirectory ( Primitives )
add_subdirectory ( Shaders )
if ( BUILD_TESTS )
if ( BUILD_TESTS )
enable_testing ( )
enable_testing ( )
# L i b r a r y w i t h g r a c e f u l a s s e r t f o r t e s t i n g
# L i b r a r y w i t h g r a c e f u l a s s e r t f o r t e s t i n g
add_library ( MagnumTestLib SHARED ${ Magnum_SRCS } )
add_library ( MagnumTestLib SHARED
$ < T A R G E T _ O B J E C T S : M a g n u m O b j e c t s >
$ { M a g n u m _ G r a c e f u l A s s e r t _ S R C S }
)
set_target_properties ( MagnumTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT )
set_target_properties ( MagnumTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT )
target_link_libraries ( MagnumTestLib ${ CORRADE_UTILITY_LIBRARY } ${ CORRADE_PLUGINMANAGER_LIBRARY } ${ OPENGL_gl_LIBRARY } ${ GLEW_LIBRARY } )
target_link_libraries ( MagnumTestLib ${ CORRADE_UTILITY_LIBRARY } ${ CORRADE_PLUGINMANAGER_LIBRARY } ${ OPENGL_gl_LIBRARY } ${ GLEW_LIBRARY } )