Browse Source

CMake subproject support, part 1: use project-relative paths.

Otherwise it would reference directory relative to source root and not
project root, which is not always the same.
pull/126/head
Vladimír Vondruš 11 years ago
parent
commit
447ca6a2ff
  1. 2
      CMakeLists.txt
  2. 2
      doc/generated/CMakeLists.txt
  3. 2
      doc/getting-started.dox
  4. 2
      src/CMakeLists.txt

2
CMakeLists.txt

@ -27,7 +27,7 @@ cmake_minimum_required(VERSION 2.8.9)
project(Magnum)
# Find Corrade first so we can check on the target
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/")
find_package(Corrade REQUIRED)
include(CMakeDependentOption)

2
doc/generated/CMakeLists.txt

@ -26,7 +26,7 @@
cmake_minimum_required(VERSION 2.8.9)
project(MyApplication)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/../../modules/")
find_package(Magnum REQUIRED
MeshTools

2
doc/getting-started.dox

@ -86,7 +86,7 @@ subdirectory.
cmake_minimum_required(VERSION 2.8.9)
project(MyApplication)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/")
add_subdirectory(src)
@endcode

2
src/CMakeLists.txt

@ -47,7 +47,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CO
# 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)
include_directories(${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL)
add_subdirectory(MagnumExternal)
add_subdirectory(Magnum)

Loading…
Cancel
Save