|
|
|
|
@ -1,9 +1,9 @@
|
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -std=c++0x -fvisibility=hidden") |
|
|
|
|
|
|
|
|
|
# If targeting GLES, save it into configuration header |
|
|
|
|
if(TARGET_GLES) |
|
|
|
|
set(MAGNUM_TARGET_GLES 1) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake |
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h) |
|
|
|
|
|
|
|
|
|
@ -27,37 +27,34 @@ set(Magnum_SRCS
|
|
|
|
|
TypeTraits.cpp |
|
|
|
|
|
|
|
|
|
Trade/AbstractImporter.cpp |
|
|
|
|
Trade/MeshData.cpp |
|
|
|
|
) |
|
|
|
|
Trade/MeshData.cpp) |
|
|
|
|
add_library(MagnumObjects OBJECT ${Magnum_SRCS}) |
|
|
|
|
|
|
|
|
|
# Files shared between main library and math unit test library |
|
|
|
|
set(MagnumMath_SRCS |
|
|
|
|
Math/Math.cpp |
|
|
|
|
) |
|
|
|
|
Math/Math.cpp) |
|
|
|
|
add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS}) |
|
|
|
|
|
|
|
|
|
# Files compiled with different flags for main library and unit test library |
|
|
|
|
set(Magnum_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(MagnumObjects MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}") |
|
|
|
|
|
|
|
|
|
# Files compiled with different flags for main library and unit test library |
|
|
|
|
set(Magnum_GracefulAssert_SRCS |
|
|
|
|
Object.cpp |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# Main library |
|
|
|
|
add_library(Magnum SHARED |
|
|
|
|
$<TARGET_OBJECTS:MagnumObjects> |
|
|
|
|
$<TARGET_OBJECTS:MagnumMathObjects> |
|
|
|
|
${Magnum_GracefulAssert_SRCS} |
|
|
|
|
) |
|
|
|
|
${Magnum_GracefulAssert_SRCS}) |
|
|
|
|
target_link_libraries(Magnum ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY}) |
|
|
|
|
if(NOT TARGET_GLES) |
|
|
|
|
target_link_libraries(Magnum ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY}) |
|
|
|
|
else() |
|
|
|
|
target_link_libraries(Magnum ${OPENGLES2_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
install(TARGETS Magnum DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) |
|
|
|
|
|
|
|
|
|
# Install also configure file |
|
|
|
|
@ -73,11 +70,12 @@ add_subdirectory(Shaders)
|
|
|
|
|
if(BUILD_TESTS) |
|
|
|
|
enable_testing() |
|
|
|
|
|
|
|
|
|
include_directories(${QT_INCLUDE_DIR}) |
|
|
|
|
|
|
|
|
|
# Library with graceful assert for testing |
|
|
|
|
add_library(MagnumTestLib SHARED |
|
|
|
|
$<TARGET_OBJECTS:MagnumObjects> |
|
|
|
|
${Magnum_GracefulAssert_SRCS} |
|
|
|
|
) |
|
|
|
|
${Magnum_GracefulAssert_SRCS}) |
|
|
|
|
set_target_properties(MagnumTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT) |
|
|
|
|
target_link_libraries(MagnumTestLib ${CORRADE_UTILITY_LIBRARY} ${CORRADE_PLUGINMANAGER_LIBRARY}) |
|
|
|
|
if(NOT TARGET_GLES) |
|
|
|
|
@ -86,6 +84,5 @@ if(BUILD_TESTS)
|
|
|
|
|
target_link_libraries(MagnumTestLib ${OPENGLES2_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
include_directories(${QT_INCLUDE_DIR}) |
|
|
|
|
add_subdirectory(Test) |
|
|
|
|
endif() |
|
|
|
|
|