diff --git a/CMakeLists.txt b/CMakeLists.txt index bc0db64a9..32cd0218a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,8 +156,8 @@ set(MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/audio set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum) set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) -set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum/Plugins) +set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumExternal) +set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins) -add_subdirectory(external) add_subdirectory(modules) add_subdirectory(src) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000..3f51b4a48 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,58 @@ +# +# This file is part of Magnum. +# +# Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +# Disable `-pedantic` for GCC 4.6, as the compiler doesn't like +# list-initialization of array of classes (RectangularMatrix constructors). It +# is perfectly legal C++11 and both GCC 4.7 and Clang accept it without notice. +if(CORRADE_GCC46_COMPATIBILITY) + string(REPLACE "-pedantic" "" CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS}") +endif() + +# On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest +# without any warning, only in release build, any attempt to add debug print +# results in issue disappearing. Not an issue on Clang or GCC < 4.8. +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") +endif() + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") + +include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CORRADE_INCLUDE_DIR}) + +# We can use both implicit include path (GLES2/gl2.h) where our headers can +# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) +# where only our headers will be used +include_directories(${CMAKE_SOURCE_DIR}/src/MagnumExternal/OpenGL) + +if(MAGNUM_BUILD_DEPRECATED) + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR}/Magnum + ${CMAKE_CURRENT_BINARY_DIR}/Magnum + ${CMAKE_CURRENT_SOURCE_DIR}/MagnumPlugins + ${CMAKE_CURRENT_SOURCE_DIR}/MagnumExternal) +endif() + +add_subdirectory(MagnumExternal) +add_subdirectory(Magnum) +add_subdirectory(MagnumPlugins) diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 1e41aaa82..fdb6d5d5d 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -22,32 +22,6 @@ # DEALINGS IN THE SOFTWARE. # -# Disable `-pedantic` for GCC 4.6, as the compiler doesn't like -# list-initialization of array of classes (RectangularMatrix constructors). It -# is perfectly legal C++11 and both GCC 4.7 and Clang accept it without notice. -if(CORRADE_GCC46_COMPATIBILITY) - string(REPLACE "-pedantic" "" CORRADE_CXX_FLAGS "${CORRADE_CXX_FLAGS}") -endif() - -# On 4.8.2 strict aliasing causes failure of DebugToolsCylinderRendererTest -# without any warning, only in release build, any attempt to add debug print -# results in issue disappearing. Not an issue on Clang or GCC < 4.8. -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.0") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing") -endif() - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}") -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${CORRADE_INCLUDE_DIR} - - # We can use both implicit include path (GLES2/gl2.h) where our headers can - # be overriden with system ones or explicit (OpenGL/GLES2/gl2ext.h) where - # only our headers will be used - ${CMAKE_SOURCE_DIR}/external - ${CMAKE_SOURCE_DIR}/external/OpenGL) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h) @@ -212,7 +186,6 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h DESTINATION ${MAGNUM add_subdirectory(Math) add_subdirectory(Platform) -add_subdirectory(Plugins) add_subdirectory(Trade) if(WITH_AUDIO) diff --git a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt index c8048349e..33f3113a3 100644 --- a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt @@ -30,4 +30,4 @@ else() set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -DGLLoadGen_EXPORTS") endif() -install(FILES gl_magnum.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GL) +install(FILES gl_magnum.h DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/OpenGL/GL) diff --git a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt index 2a1a501ca..adfe3f038 100644 --- a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt @@ -33,4 +33,4 @@ if(TARGET_GLES2 AND NOT CORRADE_TARGET_NACL) gl2.h) endif() -install(FILES ${MagnumOpenGL_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GLES2) +install(FILES ${MagnumOpenGL_HEADERS} DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/OpenGL/GLES2) diff --git a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt index 6699d72ba..14e62289b 100644 --- a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt @@ -22,4 +22,4 @@ # DEALINGS IN THE SOFTWARE. # -install(FILES gl3.h gl3platform.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GLES3) +install(FILES gl3.h gl3platform.h DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/OpenGL/GLES3) diff --git a/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt b/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt index e8e737ceb..ba8222611 100644 --- a/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/KHR/CMakeLists.txt @@ -24,5 +24,5 @@ # NaCl has its own gl2.h, this one causes linker issues if(NOT CORRADE_TARGET_NACL) - install(FILES khrplatform.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/KHR) + install(FILES khrplatform.h DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/OpenGL/KHR) endif() diff --git a/src/MagnumExternal/Optional/CMakeLists.txt b/src/MagnumExternal/Optional/CMakeLists.txt index 46923f333..9a0576e57 100644 --- a/src/MagnumExternal/Optional/CMakeLists.txt +++ b/src/MagnumExternal/Optional/CMakeLists.txt @@ -22,4 +22,4 @@ # DEALINGS IN THE SOFTWARE. # -install(FILES optional.hpp DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Optional) +install(FILES optional.hpp DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/Optional) diff --git a/src/MagnumPlugins/CMakeLists.txt b/src/MagnumPlugins/CMakeLists.txt index f7324492d..dd4f4b9fa 100644 --- a/src/MagnumPlugins/CMakeLists.txt +++ b/src/MagnumPlugins/CMakeLists.txt @@ -22,8 +22,6 @@ # DEALINGS IN THE SOFTWARE. # -include_directories(${CMAKE_CURRENT_SOURCE_DIR}) - # Wrapper for creating given plugin type macro(add_plugin) if(NOT BUILD_STATIC)