Browse Source

CMake: last piece missing for CMake subproject support in Emscripten.

pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
4b29f64b5a
  1. 8
      CMakeLists.txt
  2. 2
      doc/changelog.dox
  3. 2
      src/CMakeLists.txt

8
CMakeLists.txt

@ -300,6 +300,14 @@ else()
set(SHARED_OR_STATIC STATIC) set(SHARED_OR_STATIC STATIC)
endif() endif()
# If we're in a CMake subproject, find_package(Magnum) will be looking for
# these when targeting Emscripten, so supply their in-source location
if(CORRADE_TARGET_EMSCRIPTEN AND NOT PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
set(MAGNUM_EMSCRIPTENAPPLICATION_JS ${PROJECT_SOURCE_DIR}/src/Magnum/Platform/EmscriptenApplication.js CACHE INTERNAL "" FORCE)
set(MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS ${PROJECT_SOURCE_DIR}/src/Magnum/Platform/WindowlessEmscriptenApplication.js CACHE INTERNAL "" FORCE)
set(MAGNUM_WEBAPPLICATION_CSS ${PROJECT_SOURCE_DIR}/src/Magnum/Platform/WebApplication.css CACHE INTERNAL "" FORCE)
endif()
# Installation paths # Installation paths
include(${CORRADE_LIB_SUFFIX_MODULE}) include(${CORRADE_LIB_SUFFIX_MODULE})
set(MAGNUM_BINARY_INSTALL_DIR bin) set(MAGNUM_BINARY_INSTALL_DIR bin)

2
doc/changelog.dox

@ -181,6 +181,8 @@ See also:
flag in particular) is now handled by the `FindOpenGLES3.cmake` module flag in particular) is now handled by the `FindOpenGLES3.cmake` module
and the new `INTERFACE_LINK_OPTIONS` property instead of `FindMagnum.cmake`. On older versions this is handled in `FindMagnum.cmake` by modifying the and the new `INTERFACE_LINK_OPTIONS` property instead of `FindMagnum.cmake`. On older versions this is handled in `FindMagnum.cmake` by modifying the
global `CMAKE_EXE_LINKER_FLAGS` variable. global `CMAKE_EXE_LINKER_FLAGS` variable.
- It's now possible to use Magnum as a CMake subproject also when building
for Emscripten (see [mosra/magnum#219](https://github.com/mosra/magnum/issues/219))
@subsection changelog-latest-bugfixes Bug fixes @subsection changelog-latest-bugfixes Bug fixes

2
src/CMakeLists.txt

@ -58,4 +58,4 @@ add_subdirectory(Magnum)
add_subdirectory(MagnumPlugins) add_subdirectory(MagnumPlugins)
# Magnum include dir for superprojects # Magnum include dir for superprojects
set(MAGNUM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "") set(MAGNUM_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "" FORCE)

Loading…
Cancel
Save