|
| 1 | +# |
| 2 | +# Copyright © 2018 Jonathan Hale <squareys@googlemail.com> |
| 3 | +# |
| 4 | +# Permission is hereby granted, free of charge, to any person obtaining a |
| 5 | +# copy of this software and associated documentation files (the "Software"), |
| 6 | +# to deal in the Software without restriction, including without limitation |
| 7 | +# the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 8 | +# and/or sell copies of the Software, and to permit persons to whom the |
| 9 | +# Software is furnished to do so, subject to the following conditions: |
| 10 | +# |
| 11 | +# The above copyright notice and this permission notice shall be included |
| 12 | +# in all copies or substantial portions of the Software. |
| 13 | +# |
| 14 | +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 15 | +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 16 | +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 17 | +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 18 | +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 19 | +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 20 | +# DEALINGS IN THE SOFTWARE. |
| 21 | +# |
| 22 | + |
| 23 | +cmake_minimum_required(VERSION 2.8.12) |
| 24 | + |
| 25 | +# CMake policies. 0025 needs to be before project(), so putting all there. |
| 26 | +# Use AppleClang instead of Clang on Apple |
| 27 | +if(POLICY CMP0025) |
| 28 | + cmake_policy(SET CMP0025 NEW) |
| 29 | +endif() |
| 30 | +# Don't treat imported targets with :: as files |
| 31 | +if(POLICY CMP0028) |
| 32 | + cmake_policy(SET CMP0028 NEW) |
| 33 | +endif() |
| 34 | +# Enable MACOSX_RPATH by default |
| 35 | +if(POLICY CMP0042) |
| 36 | + cmake_policy(SET CMP0042 NEW) |
| 37 | +endif() |
| 38 | +# Quoted variables should not be dereferenced |
| 39 | +if(POLICY CMP0054) |
| 40 | + cmake_policy(SET CMP0054 NEW) |
| 41 | +endif() |
| 42 | + |
| 43 | +# Configuration fails on < 3.4 if only C++ is enabled (CheckFunctionExists |
| 44 | +# macro called from FindX11) |
| 45 | +if(NOT CMAKE_VERSION VERSION_LESS 3.4.0) |
| 46 | + set(LANG CXX) |
| 47 | +endif() |
| 48 | +project(MagnumVrUiGallery ${LANG}) |
| 49 | + |
| 50 | +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/modules/") |
| 51 | + |
| 52 | +find_package(Magnum REQUIRED |
| 53 | + MeshTools |
| 54 | + Primitives |
| 55 | + Sdl2Application |
| 56 | + Shaders |
| 57 | + Trade) |
| 58 | +find_package(MagnumIntegration REQUIRED Ovr) |
| 59 | +find_package(MagnumExtras REQUIRED Ui) |
| 60 | +find_package(Leap REQUIRED) |
| 61 | + |
| 62 | +add_executable(magnum-vr-ui-gallery |
| 63 | + src/VrGallery.cpp) |
| 64 | +target_link_libraries(magnum-vr-ui-gallery PRIVATE |
| 65 | + MagnumExtras::Ui |
| 66 | + Magnum::Application |
| 67 | + Magnum::MeshTools |
| 68 | + Magnum::Primitives |
| 69 | + Magnum::Shaders |
| 70 | + Magnum::Trade |
| 71 | + MagnumIntegration::Ovr |
| 72 | + Leap::Leap) |
| 73 | +install(TARGETS magnum-vr-ui-gallery DESTINATION bin) |
0 commit comments