mirror of https://github.com/mosra/magnum.git
22 changed files with 162 additions and 81 deletions
@ -0,0 +1,42 @@ |
|||||||
|
# Files shared between main library and unit test library |
||||||
|
set(MagnumSceneGraph_SRCS |
||||||
|
Camera.cpp |
||||||
|
Light.cpp) |
||||||
|
set(MagnumSceneGraph_HEADERS |
||||||
|
Camera.h |
||||||
|
Light.h |
||||||
|
Object.h |
||||||
|
Scene.h |
||||||
|
|
||||||
|
magnumSceneGraphVisibility.h) |
||||||
|
add_library(MagnumSceneGraphObjects OBJECT ${MagnumSceneGraph_SRCS}) |
||||||
|
|
||||||
|
# Files compiled with different flags for main library and unit test library |
||||||
|
set(MagnumSceneGraph_GracefulAssert_SRCS |
||||||
|
Object.cpp) |
||||||
|
|
||||||
|
# Set shared library flags for the objects, as they will be part of shared lib |
||||||
|
# TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well |
||||||
|
set_target_properties(MagnumSceneGraphObjects PROPERTIES COMPILE_FLAGS "-DMagnumSceneGraphObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") |
||||||
|
|
||||||
|
# SceneGraph library |
||||||
|
add_library(MagnumSceneGraph SHARED |
||||||
|
$<TARGET_OBJECTS:MagnumSceneGraphObjects> |
||||||
|
${MagnumSceneGraph_GracefulAssert_SRCS}) |
||||||
|
target_link_libraries(MagnumSceneGraph Magnum) |
||||||
|
|
||||||
|
install(TARGETS MagnumSceneGraph DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) |
||||||
|
install(FILES ${MagnumSceneGraph_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/SceneGraph) |
||||||
|
|
||||||
|
if(BUILD_TESTS) |
||||||
|
enable_testing() |
||||||
|
|
||||||
|
# Library with graceful assert for testing |
||||||
|
add_library(MagnumSceneGraphTestLib SHARED |
||||||
|
$<TARGET_OBJECTS:MagnumSceneGraphObjects> |
||||||
|
${MagnumSceneGraph_GracefulAssert_SRCS}) |
||||||
|
set_target_properties(MagnumSceneGraphTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) |
||||||
|
target_link_libraries(MagnumSceneGraphTestLib Magnum) |
||||||
|
|
||||||
|
add_subdirectory(Test) |
||||||
|
endif() |
||||||
@ -0,0 +1,3 @@ |
|||||||
|
corrade_add_test2(SceneGraphObjectTest ObjectTest.cpp LIBRARIES MagnumSceneGraphTestLib) |
||||||
|
corrade_add_test2(SceneGraphCameraTest CameraTest.cpp LIBRARIES MagnumSceneGraph) |
||||||
|
corrade_add_test2(SceneGraphSceneTest SceneTest.cpp LIBRARIES MagnumSceneGraph) |
||||||
@ -0,0 +1,30 @@ |
|||||||
|
#ifndef Magnum_SceneGraph_magnumSceneGraphVisibility_h |
||||||
|
#define Magnum_SceneGraph_magnumSceneGraphVisibility_h |
||||||
|
/*
|
||||||
|
Copyright © 2010, 2011, 2012 Vladimír Vondruš <mosra@centrum.cz> |
||||||
|
|
||||||
|
This file is part of Magnum. |
||||||
|
|
||||||
|
Magnum is free software: you can redistribute it and/or modify |
||||||
|
it under the terms of the GNU Lesser General Public License version 3 |
||||||
|
only, as published by the Free Software Foundation. |
||||||
|
|
||||||
|
Magnum is distributed in the hope that it will be useful, |
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||||
|
GNU Lesser General Public License version 3 for more details. |
||||||
|
*/ |
||||||
|
|
||||||
|
#ifdef _WIN32 |
||||||
|
#if defined(MagnumSceneGraph_EXPORTS) || defined(MagnumSceneGraphObjects_EXPORTS) |
||||||
|
#define SCENEGRAPH_EXPORT __declspec(dllexport) |
||||||
|
#else |
||||||
|
#define SCENEGRAPH_EXPORT __declspec(dllimport) |
||||||
|
#endif |
||||||
|
#define SCENEGRAPH_LOCAL |
||||||
|
#else |
||||||
|
#define SCENEGRAPH_EXPORT __attribute__ ((visibility ("default"))) |
||||||
|
#define SCENEGRAPH_LOCAL __attribute__ ((visibility ("hidden"))) |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif |
||||||
@ -1,6 +1,2 @@ |
|||||||
corrade_add_test2(ObjectTest ObjectTest.cpp LIBRARIES MagnumTestLib) |
|
||||||
corrade_add_test2(CameraTest CameraTest.cpp LIBRARIES Magnum) |
|
||||||
corrade_add_test2(SceneTest SceneTest.cpp LIBRARIES Magnum) |
|
||||||
|
|
||||||
corrade_add_test2(ColorTest ColorTest.cpp) |
corrade_add_test2(ColorTest ColorTest.cpp) |
||||||
corrade_add_test2(SwizzleTest SwizzleTest.cpp) |
corrade_add_test2(SwizzleTest SwizzleTest.cpp) |
||||||
|
|||||||
Loading…
Reference in new issue