Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geos, libzip, protobuf and qgis #80

Open
wants to merge 11 commits into
base: latest
Choose a base branch
from
113 changes: 65 additions & 48 deletions android-toolchain-ndk-r19c.cmake → android-toolchain-ndk-r21d.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ endif()
set(supported_ndks
ndk-r19c
ndk-r20 # compiler bugs pending, to be fixed in ndk-r21
ndk-r21d
)
set(ANDROID_TOOLCHAIN_VERSION "ndk-r19c" CACHE STRING
set(ANDROID_TOOLCHAIN_VERSION "ndk-r21d" CACHE STRING
"Version of the Android NDK toolchain to be used"
)
if(NOT ANDROID_TOOLCHAIN_VERSION IN_LIST supported_ndks)
Expand Down Expand Up @@ -97,12 +98,24 @@ if(CMAKE_BUILD_TYPE MATCHES Rel)
endif()
endif()

# Cf. https://developer.android.com/studio/command-line/variables
if(NOT DEFINED ANDROID_SDK_ROOT AND NOT "$ENV{ANDROID_HOME}" STREQUAL "")
message(STATUS "Using ANDROID_SDK_ROOT=ANDROID_HOME=$ENV{ANDROID_HOME}")
set(ANDROID_SDK_ROOT "$ENV{ANDROID_HOME}")
endif()
if(NOT DEFINED ANDROID_SDK_ROOT AND NOT "$ENV{ANDROID_SDK_ROOT}" STREQUAL "")
message(STATUS "Using ANDROID_SDK_ROOT=$ENV{ANDROID_SDK_ROOT}")
set(ANDROID_SDK_ROOT "$ENV{ANDROID_SDK_ROOT}")
endif()
if(NOT DEFINED ANDROID_NDK_ROOT AND NOT "$ENV{ANDROID_NDK_HOME}" STREQUAL "")
message(STATUS "Using ANDROID_NDK_ROOT=ANDROID_NDK_HOME=$ENV{ANDROID_NDK_HOME}")
set(ANDROID_NDK_ROOT "$ENV{ANDROID_NDK_HOME}")
endif()
if(NOT DEFINED ANDROID_NDK_ROOT AND NOT "$ENV{ANDROID_NDK_ROOT}" STREQUAL "")
message(STATUS "Using ANDROID_NDK_ROOT=$ENV{ANDROID_NDK_ROOT}")
set(ANDROID_NDK_ROOT "$ENV{ANDROID_NDK_ROOT}")
endif()

if(NOT "$ENV{ANDROID_PLATFORM}" STREQUAL "")
foreach(abi ${supported_abis})
set(system_platform_${abi} "$ENV{ANDROID_PLATFORM}")
Expand All @@ -112,39 +125,41 @@ elseif(DEFINED ANDROID_PLATFORM)
set(system_platform_${abi} "${ANDROID_PLATFORM}")
endforeach()
endif()

if(NOT DEFINED ANDROID_COMPILE_SDK AND NOT "$ENV{ANDROID_COMPILE_SDK}" STREQUAL "")
set(ANDROID_COMPILE_SDK "$ENV{ANDROID_COMPILE_SDK}")
else()
set(ANDROID_COMPILE_SDK android-28)
set(ANDROID_COMPILE_SDK android-29)
endif()

if(ANDROID_SDK_ROOT AND ANDROID_NDK_ROOT)
set(sdk_host "") # external SDK and NDK
elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(sdk_host "darwin")
elseif(UNIX AND NOT APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(NOT CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR must be x86_64")
elseif(APPLE)
set(sdk_host "mac")
elseif(UNIX)
set(sdk_host "linux")
elseif(NOT ANDROID_SDK_ROOT)
message(FATAL_ERROR "ANDROID_SDK_ROOT must be set to an external SDK")
elseif(NOT ANDROID_NDK_ROOT)
message(FATAL_ERROR "ANDROID_NDK_ROOT must be set to an external NDK")
else()
set(sdk_host "windows")
endif()
string(REPLACE "mac" "darwin" ndk_host "${sdk_host}")

set(android_toolchain_dependencies )


if(NOT ANDROID_SDK_ROOT)
# Download SDK tools, platform, platform tools, and build tools.
set(sdk_tools_version "4333796")
set(sdk_tools_darwin_${sdk_tools_version}_hash SHA256=ecb29358bc0f13d7c2fa0f9290135a5b608e38434aad9bf7067d0252c160853e)
set(sdk_tools_linux_${sdk_tools_version}_hash SHA256=92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9)
set(build_tools_version "28.0.2")
# Download command line tools, platform tools, platform, and build tools.
set(sdk_tools_version "6609375")
set(sdk_tools_mac_${sdk_tools_version}_hash SHA256=2c3822db1c916655223e5ee8ce0fbf6b73d0b99012045c9dc8eaa6a5736c0c55)
set(sdk_tools_linux_${sdk_tools_version}_hash SHA256=89f308315e041c93a37a79e0627c47f21d5c5edbe5e80ea8dc0aac8a649e0e92)
set(build_tools_version "29.0.2")
string(CONCAT sdk_setup_sh [[
# Generated by ]] "${CMAKE_CURRENT_LIST_FILE}\n" [[
echo y | ./tools/bin/sdkmanager --install "platforms;]] "${ANDROID_COMPILE_SDK}" [["
echo y | ./tools/bin/sdkmanager --install "platform-tools"
echo y | ./tools/bin/sdkmanager --install "build-tools;]] "${build_tools_version}" [["
yes | ./tools/bin/sdkmanager --licenses
set -x
echo y | ./cmdline-tools/tools/bin/sdkmanager --update
echo y | ./cmdline-tools/tools/bin/sdkmanager --install "platforms;]] "${ANDROID_COMPILE_SDK}" [["
echo y | ./cmdline-tools/tools/bin/sdkmanager --install "platform-tools"
echo y | ./cmdline-tools/tools/bin/sdkmanager --install "build-tools;]] "${build_tools_version}" [["
yes | ./cmdline-tools/tools/bin/sdkmanager --licenses
]]
)
set(ANDROID_SDK_INSTALL_ROOT "${PROJECT_BINARY_DIR}/source" CACHE STRING
Expand All @@ -158,14 +173,14 @@ yes | ./tools/bin/sdkmanager --licenses
SOURCE_WRITE
sdk_setup.sh sdk_setup_sh
SOURCE
DOWNLOAD_NAME android-sdk-tools-${sdk_host}-${sdk_tools_version}.zip
URL https://dl.google.com/android/repository/sdk-tools-${sdk_host}-${sdk_tools_version}.zip
DOWNLOAD_NAME android-commandlinetools-${sdk_host}-${sdk_tools_version}_latest.zip
URL https://dl.google.com/android/repository/commandlinetools-${sdk_host}-${sdk_tools_version}_latest.zip
URL_HASH ${sdk_tools_${sdk_host}_${sdk_tools_version}_hash}
DOWNLOAD_NO_EXTRACT 1 # We extract manually from within the source directory.
PATCH_COMMAND
"${CMAKE_COMMAND}" -E make_directory "${ANDROID_SDK_ROOT}"
"${CMAKE_COMMAND}" -E make_directory "${ANDROID_SDK_ROOT}/cmdline-tools"
COMMAND
"${CMAKE_COMMAND}" -E chdir "${ANDROID_SDK_ROOT}"
"${CMAKE_COMMAND}" -E chdir "${ANDROID_SDK_ROOT}/cmdline-tools"
"${CMAKE_COMMAND}" -E tar xzf "<DOWNLOADED_FILE>"
COMMAND
"${CMAKE_COMMAND}" -E chdir "${ANDROID_SDK_ROOT}"
Expand All @@ -182,6 +197,8 @@ if(NOT ANDROID_NDK_ROOT)
set(ndk_r19c_linux_hash SHA1=fd94d0be6017c6acbd193eb95e09cf4b6f61b834)
set(ndk_r20_darwin_hash SHA1=96d5f1c50452596912d1982439c514194b5751e6)
set(ndk_r20_linux_hash SHA1=8665fc84a1b1f0d6ab3b5fdd1e30200cc7b9adff)
set(ndk_r21d_darwin_hash SHA1=ef06c9f9d7efd6f243eb3c05ac440562ae29ae12)
set(ndk_r21d_linux_hash SHA1=bcf4023eb8cb6976a4c7cff0a8a8f145f162bf4d)
set(ANDROID_NDK_INSTALL_ROOT "${PROJECT_BINARY_DIR}/source" CACHE STRING
"The directory where to install the downloaded NDK (i.e. the basedir of ANDROID_NDK_ROOT)"
)
Expand All @@ -191,8 +208,8 @@ if(NOT ANDROID_NDK_ROOT)
VERSION ${version}

SOURCE
URL https://dl.google.com/android/repository/android-ndk-${version}-${sdk_host}-x86_64.zip
URL_HASH ${ndk_${version}_${sdk_host}_hash}
URL https://dl.google.com/android/repository/android-ndk-${version}-${ndk_host}-x86_64.zip
URL_HASH ${ndk_${version}_${ndk_host}_hash}
DOWNLOAD_NO_EXTRACT 1 # We extract manually from within the source directory.
PATCH_COMMAND
"${CMAKE_COMMAND}" -E chdir "${ANDROID_NDK_INSTALL_ROOT}"
Expand Down Expand Up @@ -298,7 +315,7 @@ if(NOT ANDROID_NDK_ROOT)
SOURCE
android-libcxx-${ANDROID_NDK_VERSION}

USING ANDROID_NDK_ROOT abi sdk_host system_platform_${abi}
USING ANDROID_NDK_ROOT abi ndk_host system_platform_${abi}
BUILD [[
CONFIGURE_COMMAND ""
BUILD_COMMAND
Expand All @@ -309,7 +326,7 @@ if(NOT ANDROID_NDK_ROOT)
"APP_PLATFORM=${system_platform_${abi}}"
"APP_MODULES=c++_shared c++_static"
"BIONIC_PATH=<SOURCE_DIR>/bionic"
"NDK_UNIFIED_SYSROOT_PATH=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/sysroot"
"NDK_UNIFIED_SYSROOT_PATH=${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/sysroot"
"NDK_PLATFORMS_ROOT=${ANDROID_NDK_ROOT}/platforms"
"NDK_TOOLCHAINS_ROOT=<SOURCE_DIR>/toolchains"
"NDK_PROJECT_PATH=null"
Expand Down Expand Up @@ -361,7 +378,7 @@ foreach(abi ${enabled_abis})
sb_install_dir(install_dir ${system_name})

if(NOT DEFINED ${system_name}_ENV_PATH)
set(${system_name}_ENV_PATH "${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin:${toolchain_dir}/bin:$ENV{PATH}" PARENT_SCOPE)
set(${system_name}_ENV_PATH "${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin:${toolchain_dir}/bin:$ENV{PATH}" PARENT_SCOPE)
endif()

if(NOT DEFINED ${system_name}_INSTALL_PREFIX)
Expand Down Expand Up @@ -404,8 +421,8 @@ set(CMAKE_FIND_ROOT_PATH "]] "${${system_name}_FIND_ROOT_PATH}" [[")
list(APPEND CMAKE_FIND_ROOT_PATH "${ANDROID_NDK_ROOT}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-]] ${system_arch_${abi}} [[")
set(CMAKE_SYSTEM_LIBRARY_PATH "/usr/lib/${SYSTEM_NAME}")

set(SUPERBUILD_CC "]] "${ANDROID_NDK_ROOT}" [[/toolchains/llvm/prebuilt/]] "${sdk_host}" [[-x86_64/bin/${SYSTEM_NAME}${ANDROID_NATIVE_API_LEVEL}-clang")
set(SUPERBUILD_CXX "]] "${ANDROID_NDK_ROOT}" [[/toolchains/llvm/prebuilt/]] "${sdk_host}" [[-x86_64/bin/${SYSTEM_NAME}${ANDROID_NATIVE_API_LEVEL}-clang++")
set(SUPERBUILD_CC "]] "${ANDROID_NDK_ROOT}" [[/toolchains/llvm/prebuilt/]] "${ndk_host}" [[-x86_64/bin/${SYSTEM_NAME}${ANDROID_NATIVE_API_LEVEL}-clang")
set(SUPERBUILD_CXX "]] "${ANDROID_NDK_ROOT}" [[/toolchains/llvm/prebuilt/]] "${ndk_host}" [[-x86_64/bin/${SYSTEM_NAME}${ANDROID_NATIVE_API_LEVEL}-clang++")
# ANDROID_LINKER_FLAGS defines flags for ABI specific linking requirements.
# Last not least, this includes the unwinding particularities of 32-bit ARM,
# https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#Unwinding
Expand Down Expand Up @@ -451,7 +468,7 @@ set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose output from Makefile b
USING
md5
install_dir
sdk_host
ndk_host
system_name
${system_name}_INSTALL_PREFIX
ANDROID_NDK_ROOT
Expand Down Expand Up @@ -483,67 +500,67 @@ set(CMAKE_VERBOSE_MAKEFILE ON CACHE BOOL "Enable verbose output from Makefile b
$<$<STREQUAL:@system_name@,armv7a-linux-androideabi>:# Add tools with same prefix as compiler
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-ar"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-ar"
"${INSTALL_DIR}/bin/${system_name}-ar"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-as"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-as"
"${INSTALL_DIR}/bin/${system_name}-as"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-c++filt"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-c++filt"
"${INSTALL_DIR}/bin/${system_name}-c++filt"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-dwp"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-dwp"
"${INSTALL_DIR}/bin/${system_name}-dwp"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-elfedit"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-elfedit"
"${INSTALL_DIR}/bin/${system_name}-gprof"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-ld"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-ld"
"${INSTALL_DIR}/bin/${system_name}-ld"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-ld.bfd"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-ld.bfd"
"${INSTALL_DIR}/bin/${system_name}-ld.bfd"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-ld.gold"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-ld.gold"
"${INSTALL_DIR}/bin/${system_name}-ld.gold"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-nm"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-nm"
"${INSTALL_DIR}/bin/${system_name}-nm"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-objcopy"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-objcopy"
"${INSTALL_DIR}/bin/${system_name}-objcopy"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-objdump"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-objdump"
"${INSTALL_DIR}/bin/${system_name}-objdump"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-ranlib"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-ranlib"
"${INSTALL_DIR}/bin/${system_name}-ranlib"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-readelf"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-readelf"
"${INSTALL_DIR}/bin/${system_name}-readelf"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-size"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-size"
"${INSTALL_DIR}/bin/${system_name}-size"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-strings"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-strings"
"${INSTALL_DIR}/bin/${system_name}-strings"
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${sdk_host}-x86_64/bin/arm-linux-androideabi-strip"
"${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/${ndk_host}-x86_64/bin/arm-linux-androideabi-strip"
"${INSTALL_DIR}/bin/${system_name}-strip"
>
]]
Expand Down
3 changes: 0 additions & 3 deletions ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ steps:
-DCMAKE_BUILD_TYPE=Release
-DSUPERBUILD_DOWNLOAD_DIR=$(Build.SourcesDirectory)/download
-DUSE_SYSTEM_PCRE2=FALSE
-DMapper_GIT_QT_VERSION=5.12
-DMapper_GIT_LICENSING_PROVIDER=superbuild
-DMapper_GIT_ENABLE_POSITIONING=ON
-DMapper_GIT_ENABLE_INSTALL=OFF
-Ddefault_INSTALL_DIR=
-Ddefault_INSTALL_PREFIX=$(SUPERBUILD_INSTALL_DIR)
Expand Down
13 changes: 13 additions & 0 deletions ci/setup-msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,19 @@ steps:
condition: not(variables['openorienteering.superbuild.msysBuildId'])
displayName: 'Install MSYS2 MinGW packages for OpenOrienteering Superbuild'

- script: |
set PATH=%SUPERBUILD_INSTALL_DIR_NATIVE%\usr\bin;%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\wbem
pacman --noconfirm -S --needed ^
mingw-w64-%MSYSTEM_CARCH%-wintab-sdk ^
2>error.log
if errorlevel 1 (
type error.log 1>&2
exit /b 1
) else (
type error.log
)
displayName: 'Install mingw-w64-wintab-sdk'

- script: |
set PATH=%SUPERBUILD_INSTALL_DIR_NATIVE%\usr\bin;%WINDIR%\system32;%WINDIR%;%WINDIR%\system32\wbem
pacman --noconfirm -Scc
Expand Down
59 changes: 59 additions & 0 deletions geos.3.8.1.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This file is part of OpenOrienteering.

# Copyright 2016-2020 Kai Pastor
#
# Redistribution and use is allowed according to the terms of the BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# https://tracker.debian.org/pkg/gdal
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing adaption


set(version 3.8.1)
set(download_hash SHA256=605df3f99056b7bb9c48f20d67e90e539f5a9ca5b2c7896d58ba06e3217dc106)
set(patch_version ${version})
set(base_url https://github.com/libgeos/geos/archive/)

superbuild_package(
NAME geos
VERSION ${patch_version}
DEPENDS
common-licenses

SOURCE
URL ${base_url}${version}.tar.gz
URL_HASH ${download_hash}

USING patch_version extra_cflags extra_cxxflags
BUILD [[
CMAKE_ARGS
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
"-DCMAKE_BUILD_TYPE:STRING=$<CONFIG>"
-DBUILD_SHARED_LIBS=ON
-DBUILD_TESTING=ON
-DDISABLE_GEOS_INLINE=ON
$<$<NOT:$<OR:$<BOOL:@CMAKE_CROSSCOMPILING@>,$<BOOL:@MSYS@>>>:
INSTALL_COMMAND
"${CMAKE_COMMAND}" --build . --target install/strip/fast
]]
)
13 changes: 11 additions & 2 deletions libwebp-1.1.0.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ set(test_system_libwebp [[
set(BUILD_CONDITION 0)
endif()
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(extra_flags "-Wno-unused-command-line-argument" PARENT_SCOPE)
elseif(CMAKE_C_COMPILER_ID STREQUAL "GNU")
set(extra_flags "" PARENT_SCOPE)
else()
set(extra_flags "" PARENT_SCOPE)
endif()
]])

superbuild_package(
Expand All @@ -58,17 +65,19 @@ superbuild_package(
URL https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-${version}.tar.gz
URL_HASH ${download_hash}

USING USE_SYSTEM_LIBWEBP patch_version
USING USE_SYSTEM_LIBWEBP patch_version extra_flags
BUILD_CONDITION ${test_system_libwebp}
BUILD [[
CMAKE_ARGS
"-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
"-DCMAKE_BUILD_TYPE:STRING=$<CONFIG>"
"-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} ${extra_flags}"
"-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} ${extra_flags}"
-DBUILD_SHARED_LIBS=ON
-DWEBP_BUILD_ANIM_UTILS=OFF
-DWEBP_BUILD_CWEBP=OFF
-DWEBP_BUILD_DWEBP=OFF
-DWEBP_BUILD_GIF2WEBP=OFF
-DWEBP_BUILD_GIF2WEBP=ON # Required for libwebpmux, which is required for qtimageformats
-DWEBP_BUILD_IMG2WEBP=OFF
-DWEBP_BUILD_VWEBP=OFF
-DWEBP_BUILD_WEBPINFO=OFF
Expand Down
Loading