Browse Source

Making includes absolute, part 2: make it compile again.

Added new root CMakeLists.txt file, the old include paths are used only
if MAGNUM_BUILD_DEPRECATED is set, thus it can now compile and install
only if deprecated build is enabled.
pull/51/head
Vladimír Vondruš 13 years ago
parent
commit
05b620dd09
  1. 4
      CMakeLists.txt
  2. 58
      src/CMakeLists.txt
  3. 27
      src/Magnum/CMakeLists.txt
  4. 2
      src/MagnumExternal/OpenGL/GL/CMakeLists.txt
  5. 2
      src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt
  6. 2
      src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt
  7. 2
      src/MagnumExternal/OpenGL/KHR/CMakeLists.txt
  8. 2
      src/MagnumExternal/Optional/CMakeLists.txt
  9. 2
      src/MagnumPlugins/CMakeLists.txt

4
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_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum)
set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules) set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules)
set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum) 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(modules)
add_subdirectory(src) add_subdirectory(src)

58
src/CMakeLists.txt

@ -0,0 +1,58 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013 Vladimír Vondruš <mosra@centrum.cz>
#
# 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)

27
src/Magnum/CMakeLists.txt

@ -22,32 +22,6 @@
# DEALINGS IN THE SOFTWARE. # 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 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h) ${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(Math)
add_subdirectory(Platform) add_subdirectory(Platform)
add_subdirectory(Plugins)
add_subdirectory(Trade) add_subdirectory(Trade)
if(WITH_AUDIO) if(WITH_AUDIO)

2
src/MagnumExternal/OpenGL/GL/CMakeLists.txt vendored

@ -30,4 +30,4 @@ else()
set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -DGLLoadGen_EXPORTS") set_target_properties(MagnumGLLoadGenObjects PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS} -DGLLoadGen_EXPORTS")
endif() 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)

2
src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt vendored

@ -33,4 +33,4 @@ if(TARGET_GLES2 AND NOT CORRADE_TARGET_NACL)
gl2.h) gl2.h)
endif() endif()
install(FILES ${MagnumOpenGL_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/OpenGL/GLES2) install(FILES ${MagnumOpenGL_HEADERS} DESTINATION ${MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR}/OpenGL/GLES2)

2
src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt vendored

@ -22,4 +22,4 @@
# DEALINGS IN THE SOFTWARE. # 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)

2
src/MagnumExternal/OpenGL/KHR/CMakeLists.txt vendored

@ -24,5 +24,5 @@
# NaCl has its own gl2.h, this one causes linker issues # NaCl has its own gl2.h, this one causes linker issues
if(NOT CORRADE_TARGET_NACL) 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() endif()

2
src/MagnumExternal/Optional/CMakeLists.txt vendored

@ -22,4 +22,4 @@
# DEALINGS IN THE SOFTWARE. # 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)

2
src/MagnumPlugins/CMakeLists.txt

@ -22,8 +22,6 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
# Wrapper for creating given plugin type # Wrapper for creating given plugin type
macro(add_plugin) macro(add_plugin)
if(NOT BUILD_STATIC) if(NOT BUILD_STATIC)

Loading…
Cancel
Save