|
|
|
@ -162,6 +162,7 @@ |
|
|
|
# MAGNUM_*_LIBRARY - Component libraries (w/o dependencies) |
|
|
|
# MAGNUM_*_LIBRARY - Component libraries (w/o dependencies) |
|
|
|
# MAGNUM_*_LIBRARY_DEBUG - Debug version of given library, if found |
|
|
|
# MAGNUM_*_LIBRARY_DEBUG - Debug version of given library, if found |
|
|
|
# MAGNUM_*_LIBRARY_RELEASE - Release version of given library, if found |
|
|
|
# MAGNUM_*_LIBRARY_RELEASE - Release version of given library, if found |
|
|
|
|
|
|
|
# MAGNUM_PLATFORM_JS - Path to MagnumPlatform.js file |
|
|
|
# MAGNUM_BINARY_INSTALL_DIR - Binary installation directory |
|
|
|
# MAGNUM_BINARY_INSTALL_DIR - Binary installation directory |
|
|
|
# MAGNUM_LIBRARY_INSTALL_DIR - Library installation directory |
|
|
|
# MAGNUM_LIBRARY_INSTALL_DIR - Library installation directory |
|
|
|
# MAGNUM_DATA_INSTALL_DIR - Data installation directory |
|
|
|
# MAGNUM_DATA_INSTALL_DIR - Data installation directory |
|
|
|
@ -696,7 +697,17 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
INTERFACE_LINK_LIBRARIES android EGL::EGL) |
|
|
|
INTERFACE_LINK_LIBRARIES android EGL::EGL) |
|
|
|
|
|
|
|
|
|
|
|
# EmscriptenApplication has no additional dependencies |
|
|
|
# Emscripten application dependencies |
|
|
|
|
|
|
|
elseif(_component STREQUAL EmscriptenApplication) |
|
|
|
|
|
|
|
# Emscripten has various stuff implemented in JS |
|
|
|
|
|
|
|
if(CORRADE_TARGET_EMSCRIPTEN) |
|
|
|
|
|
|
|
find_file(MAGNUM_PLATFORM_JS MagnumPlatform.js |
|
|
|
|
|
|
|
PATH_SUFFIXES lib) |
|
|
|
|
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
|
|
|
|
# TODO switch to INTERFACE_LINK_OPTIONS and SHELL: once |
|
|
|
|
|
|
|
# we require CMake 3.13 unconditionally |
|
|
|
|
|
|
|
INTERFACE_LINK_LIBRARIES "--js-library ${MAGNUM_PLATFORM_JS}") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# GLFW application dependencies |
|
|
|
# GLFW application dependencies |
|
|
|
elseif(_component STREQUAL GlfwApplication) |
|
|
|
elseif(_component STREQUAL GlfwApplication) |
|
|
|
@ -752,6 +763,14 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) |
|
|
|
elseif(CORRADE_TARGET_UNIX) |
|
|
|
elseif(CORRADE_TARGET_UNIX) |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) |
|
|
|
INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}) |
|
|
|
|
|
|
|
# Emscripten has various stuff implemented in JS |
|
|
|
|
|
|
|
elseif(CORRADE_TARGET_EMSCRIPTEN) |
|
|
|
|
|
|
|
find_file(MAGNUM_PLATFORM_JS MagnumPlatform.js |
|
|
|
|
|
|
|
PATH_SUFFIXES lib) |
|
|
|
|
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
|
|
|
|
# TODO switch to INTERFACE_LINK_OPTIONS and SHELL: once |
|
|
|
|
|
|
|
# we require CMake 3.13 unconditionally |
|
|
|
|
|
|
|
INTERFACE_LINK_LIBRARIES "--js-library ${MAGNUM_PLATFORM_JS}") |
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# With GLVND (since CMake 3.11) we need to explicitly link to |
|
|
|
# With GLVND (since CMake 3.11) we need to explicitly link to |
|
|
|
@ -985,7 +1004,7 @@ foreach(_component ${Magnum_FIND_COMPONENTS}) |
|
|
|
endforeach() |
|
|
|
endforeach() |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
INTERFACE_LINK_LIBRARIES Magnum::Magnum) |
|
|
|
INTERFACE_LINK_LIBRARIES Magnum::Magnum) |
|
|
|
set(_MAGNUM_${component}_OPTIONAL_DEPENDENCIES_TO_ADD ) |
|
|
|
set(_MAGNUM_${_component}_OPTIONAL_DEPENDENCIES_TO_ADD ) |
|
|
|
foreach(_dependency ${_MAGNUM_${_component}_DEPENDENCIES}) |
|
|
|
foreach(_dependency ${_MAGNUM_${_component}_DEPENDENCIES}) |
|
|
|
if(NOT _MAGNUM_${_component}_${_dependency}_DEPENDENCY_IS_OPTIONAL) |
|
|
|
if(NOT _MAGNUM_${_component}_${_dependency}_DEPENDENCY_IS_OPTIONAL) |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
set_property(TARGET Magnum::${_component} APPEND PROPERTY |
|
|
|
@ -1047,24 +1066,6 @@ if(CORRADE_TARGET_EMSCRIPTEN) |
|
|
|
MAGNUM_EMSCRIPTENAPPLICATION_JS |
|
|
|
MAGNUM_EMSCRIPTENAPPLICATION_JS |
|
|
|
MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS |
|
|
|
MAGNUM_WINDOWLESSEMSCRIPTENAPPLICATION_JS |
|
|
|
MAGNUM_WEBAPPLICATION_CSS) |
|
|
|
MAGNUM_WEBAPPLICATION_CSS) |
|
|
|
|
|
|
|
|
|
|
|
# If we are on CMake 3.13 and up, `-s USE_WEBGL2=1` linker option is |
|
|
|
|
|
|
|
# propagated from FindOpenGLES3.cmake already. If not (and the GL library |
|
|
|
|
|
|
|
# is used), we need to modify the global CMAKE_EXE_LINKER_FLAGS. Do it here |
|
|
|
|
|
|
|
# instead of in FindOpenGLES3.cmake so it works also for CMake subprojects |
|
|
|
|
|
|
|
# (in which case find_package(OpenGLES3) is called in (and so |
|
|
|
|
|
|
|
# CMAKE_EXE_LINKER_FLAGS would be modified in) Magnum's root CMakeLists.txt |
|
|
|
|
|
|
|
# and thus can't affect the variable in the outer project). CMake supports |
|
|
|
|
|
|
|
# IN_LIST as an operator since 3.1 (Emscripten needs at least 3.7), but |
|
|
|
|
|
|
|
# it's behind a policy, so enable that one as well. |
|
|
|
|
|
|
|
cmake_policy(SET CMP0057 NEW) |
|
|
|
|
|
|
|
# TODO since 1.39.19 it's possible to use `-sUSE_WEBGL2=1`, which can be |
|
|
|
|
|
|
|
# then passed via target_link_libraries() etc. without requiring CMake |
|
|
|
|
|
|
|
# 3.13: https://github.com/emscripten-core/emscripten/blob/main/ChangeLog.md#13919-07072020 |
|
|
|
|
|
|
|
# -- change to that once we drop support for older Emscripten versions |
|
|
|
|
|
|
|
if(CMAKE_VERSION VERSION_LESS 3.13 AND GL IN_LIST Magnum_FIND_COMPONENTS AND NOT MAGNUM_TARGET_GLES2 AND NOT CMAKE_EXE_LINKER_FLAGS MATCHES "-s USE_WEBGL2=1") |
|
|
|
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") |
|
|
|
|
|
|
|
endif() |
|
|
|
|
|
|
|
endif() |
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
|
|
# For CMake 3.16+ with REASON_FAILURE_MESSAGE, provide additional potentially |
|
|
|
# For CMake 3.16+ with REASON_FAILURE_MESSAGE, provide additional potentially |
|
|
|
|