|
| 1 | +# This file is part of OpenOrienteering. |
| 2 | + |
| 3 | +# Copyright 2016-2018 Kai Pastor |
| 4 | +# |
| 5 | +# Redistribution and use is allowed according to the terms of the BSD license: |
| 6 | +# |
| 7 | +# Redistribution and use in source and binary forms, with or without |
| 8 | +# modification, are permitted provided that the following conditions |
| 9 | +# are met: |
| 10 | +# |
| 11 | +# 1. Redistributions of source code must retain the copyright |
| 12 | +# notice, this list of conditions and the following disclaimer. |
| 13 | +# 2. Redistributions in binary form must reproduce the copyright |
| 14 | +# notice, this list of conditions and the following disclaimer in the |
| 15 | +# documentation and/or other materials provided with the distribution. |
| 16 | +# 3. The name of the author may not be used to endorse or promote products |
| 17 | +# derived from this software without specific prior written permission. |
| 18 | +# |
| 19 | +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 20 | +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 21 | +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 22 | +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 23 | +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 24 | +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 | +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 | +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 28 | +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 | + |
| 30 | +set(version 0.8.2) |
| 31 | +set(download_hash SHA256=11e6f2e93442f217f7373bd737a58a75e8e6da81d4365e12691a8dfdf1f01066) |
| 32 | +set(qt_version 5.6.2) |
| 33 | + |
| 34 | +set(Mapper_LICENSING_PROVIDER "superbuild" CACHE STRING "Mapper: Provider for 3rd-party licensing information") |
| 35 | + |
| 36 | +superbuild_package( |
| 37 | + NAME openorienteering-mapper |
| 38 | + VERSION ${version} |
| 39 | + DEPENDS |
| 40 | + gdal |
| 41 | + libpolyclipping |
| 42 | + proj |
| 43 | + qtandroidextras-${qt_version} |
| 44 | + qtbase-${qt_version} |
| 45 | + qtimageformats-${qt_version} |
| 46 | + qtlocation-${qt_version} |
| 47 | + qtsensors-${qt_version} |
| 48 | + qttools-${qt_version} |
| 49 | + qttranslations-${qt_version} |
| 50 | + zlib |
| 51 | + host:doxygen |
| 52 | + host:qttools-${qt_version} |
| 53 | + |
| 54 | + SOURCE |
| 55 | + DOWNLOAD_NAME openorienteering-mapper_${version}.tar.gz |
| 56 | + URL https://github.com/OpenOrienteering/mapper/archive/v${version}.tar.gz |
| 57 | + URL_HASH ${download_hash} |
| 58 | + |
| 59 | + USING Mapper_LICENSING_PROVIDER |
| 60 | + BUILD_CONDITION [[ |
| 61 | + if(NOT CMAKE_BUILD_TYPE MATCHES "Rel") |
| 62 | + message(FATAL_ERROR "Not building a release configuration") |
| 63 | + endif() |
| 64 | + ]] |
| 65 | + BUILD [[ |
| 66 | + CMAKE_ARGS |
| 67 | + "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" |
| 68 | + "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" |
| 69 | + "-DBUILD_SHARED_LIBS=0" |
| 70 | + "-DMapper_AUTORUN_SYSTEM_TESTS=0" |
| 71 | + "-DLICENSING_PROVIDER=superbuild" |
| 72 | + "-DMapper_BUILD_PACKAGE=1" |
| 73 | + $<$<BOOL:${ANDROID}>: |
| 74 | + "-DCMAKE_DISABLE_FIND_PACKAGE_Qt5PrintSupport=TRUE" |
| 75 | + "-DKEYSTORE_URL=${KEYSTORE_URL}" |
| 76 | + "-DKEYSTORE_ALIAS=${KEYSTORE_ALIAS}" |
| 77 | + > |
| 78 | + $<$<NOT:$<BOOL:${ANDROID}>>: |
| 79 | + "-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Positioning=TRUE" |
| 80 | + "-DCMAKE_DISABLE_FIND_PACKAGE_Qt5Sensors=TRUE" |
| 81 | + > |
| 82 | + INSTALL_COMMAND |
| 83 | + "${CMAKE_COMMAND}" --build . --target install -- VERBOSE=1 |
| 84 | + $<$<BOOL:${WIN32}>: |
| 85 | + # Mapper Windows installation layout is weird |
| 86 | + "DESTDIR=${INSTALL_DIR}/OpenOrienteering" |
| 87 | + >$<$<NOT:$<BOOL:${WIN32}>>: |
| 88 | + "DESTDIR=${INSTALL_DIR}" |
| 89 | + > |
| 90 | + $<$<NOT:$<BOOL:${CMAKE_CROSSCOMPILING}>>: |
| 91 | + TEST_BEFORE_INSTALL 1 |
| 92 | + > |
| 93 | + ]] |
| 94 | + |
| 95 | + EXECUTABLES src/Mapper |
| 96 | + |
| 97 | + PACKAGE [[ |
| 98 | + COMMAND "${CMAKE_COMMAND}" --build . --target package/fast |
| 99 | + ]] |
| 100 | +) |
0 commit comments