updated android toolchain to include android ndk r10d

--- cmake/toolchain/android.toolchain.cmake
+++ cmake/toolchain/android.toolchain.cmake
@@ -29,12 +29,9 @@
 # POSSIBILITY OF SUCH DAMAGE.

 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r9
+#  Android CMake toolchain file, for use with the Android NDK r5-r10d
 #  Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
 #  See home page: https://github.com/taka-no-me/android-cmake
-#
-#  The file is mantained by the OpenCV project. The latest version can be get at
-#  http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
 #
 #  Usage Linux:
 #   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@@ -50,7 +47,7 @@
 #
 #  Usage Windows:
 #     You need native port of make to build your project.
-#     Android NDK r7 (or newer) already has make.exe on board.
+#     Android NDK r7 (and newer) already has make.exe on board.
 #     For older NDK you have to install it separately.
 #     For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm
 #
@@ -76,36 +73,54 @@
 #      used by ndk-build tool from Android NDK.
 #
 #      Possible targets are:
-#        "armeabi" - matches to the NDK ABI with the same name.
-#           See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-#        "armeabi-v7a" - matches to the NDK ABI with the same name.
-#           See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
+#        "armeabi" - ARMv5TE based CPU with software floating point operations
+#        "armeabi-v7a" - ARMv7 based devices with hardware FPU instructions
+#            this ABI target is used by default
 #        "armeabi-v7a with NEON" - same as armeabi-v7a, but
 #            sets NEON as floating-point unit
 #        "armeabi-v7a with VFPV3" - same as armeabi-v7a, but
-#            sets VFPV3 as floating-point unit (has 32 registers instead of 16).
-#        "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP.
-#        "x86" - matches to the NDK ABI with the same name.
-#            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-#        "mips" - matches to the NDK ABI with the same name.
-#            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
+#            sets VFPV3 as floating-point unit (has 32 registers instead of 16)
+#        "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP
+#        "x86" - IA-32 instruction set
+#        "mips" - MIPS32 instruction set
+#
+#      64-bit ABIs for NDK r10 and newer:
+#        "arm64-v8a" - ARMv8 AArch64 instruction set
+#        "x86_64" - Intel64 instruction set (r1)
+#        "mips64" - MIPS64 instruction set (r6)
 #
 #    ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
 #      Option is read-only when standalone toolchain is used.
-#
-#    ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.6 - the name of compiler
+#      Note: building for "android-L" requires explicit configuration.
+#
+#    ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler
 #      toolchain to be used. The list of possible values depends on the NDK
-#      version. For NDK r8c the possible values are:
-#
-#        * arm-linux-androideabi-4.4.3
+#      version. For NDK r10c the possible values are:
+#
+#        * aarch64-linux-android-4.9
+#        * aarch64-linux-android-clang3.4
+#        * aarch64-linux-android-clang3.5
 #        * arm-linux-androideabi-4.6
-#        * arm-linux-androideabi-clang3.1
-#        * mipsel-linux-android-4.4.3
+#        * arm-linux-androideabi-4.8
+#        * arm-linux-androideabi-4.9 (default)
+#        * arm-linux-androideabi-clang3.4
+#        * arm-linux-androideabi-clang3.5
+#        * mips64el-linux-android-4.9
+#        * mips64el-linux-android-clang3.4
+#        * mips64el-linux-android-clang3.5
 #        * mipsel-linux-android-4.6
-#        * mipsel-linux-android-clang3.1
-#        * x86-4.4.3
+#        * mipsel-linux-android-4.8
+#        * mipsel-linux-android-4.9
+#        * mipsel-linux-android-clang3.4
+#        * mipsel-linux-android-clang3.5
 #        * x86-4.6
-#        * x86-clang3.1
+#        * x86-4.8
+#        * x86-4.9
+#        * x86-clang3.4
+#        * x86-clang3.5
+#        * x86_64-4.9
+#        * x86_64-clang3.4
+#        * x86_64-clang3.5
 #
 #    ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
 #      instead of Thumb. Is not available for "x86" (inapplicable) and
@@ -181,8 +196,9 @@
 #    ANDROID and BUILD_ANDROID will be set to true, you may test any of these
 #    variables to make necessary Android-specific configuration changes.
 #
-#    Also ARMEABI or ARMEABI_V7A or X86 or MIPS will be set true, mutually
-#    exclusive. NEON option will be set true if VFP is set to NEON.
+#    Also ARMEABI or ARMEABI_V7A or X86 or MIPS or ARM64_V8A or X86_64 or MIPS64
+#    will be set true, mutually exclusive. NEON option will be set true
+#    if VFP is set to NEON.
 #
 #    LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
 #    libraries will be installed.
@@ -190,117 +206,6 @@
 #    under the ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}
 #    (depending on the target ABI). This is convenient for Android packaging.
 #
-#  Change Log:
-#   - initial version December 2010
-#   - April 2011
-#     [+] added possibility to build with NDK (without standalone toolchain)
-#     [+] support cross-compilation on Windows (native, no cygwin support)
-#     [+] added compiler option to force "char" type to be signed
-#     [+] added toolchain option to compile to 32-bit ARM instructions
-#     [+] added toolchain option to disable SWIG search
-#     [+] added platform "armeabi-v7a with VFPV3"
-#     [~] ARM_TARGETS renamed to ARM_TARGET
-#     [+] EXECUTABLE_OUTPUT_PATH is set by toolchain (required on Windows)
-#     [~] Fixed bug with ANDROID_API_LEVEL variable
-#     [~] turn off SWIG search if it is not found first time
-#   - May 2011
-#     [~] ANDROID_LEVEL is renamed to ANDROID_API_LEVEL
-#     [+] ANDROID_API_LEVEL is detected by toolchain if not specified
-#     [~] added guard to prevent changing of output directories on the first
-#         cmake pass
-#     [~] toolchain exits with error if ARM_TARGET is not recognized
-#   - June 2011
-#     [~] default NDK path is updated for version r5c
-#     [+] variable CMAKE_SYSTEM_PROCESSOR is set based on ARM_TARGET
-#     [~] toolchain install directory is added to linker paths
-#     [-] removed SWIG-related stuff from toolchain
-#     [+] added macro find_host_package, find_host_program to search
-#         packages/programs on the host system
-#     [~] fixed path to STL library
-#   - July 2011
-#     [~] fixed options caching
-#     [~] search for all supported NDK versions
-#     [~] allowed spaces in NDK path
-#   - September 2011
-#     [~] updated for NDK r6b
-#   - November 2011
-#     [*] rewritten for NDK r7
-#     [+] x86 toolchain support (experimental)
-#     [+] added "armeabi-v6 with VFP" ABI for ARMv6 processors.
-#     [~] improved compiler and linker flags management
-#     [+] support different build flags for Release and Debug configurations
-#     [~] by default compiler flags the same as used by ndk-build (but only
-#         where reasonable)
-#     [~] ANDROID_NDK_TOOLCHAIN_ROOT is splitted to ANDROID_STANDALONE_TOOLCHAIN
-#         and ANDROID_TOOLCHAIN_ROOT
-#     [~] ARM_TARGET is renamed to ANDROID_ABI
-#     [~] ARMEABI_NDK_NAME is renamed to ANDROID_NDK_ABI_NAME
-#     [~] ANDROID_API_LEVEL is renamed to ANDROID_NATIVE_API_LEVEL
-#   - January 2012
-#     [+] added stlport_static support (experimental)
-#     [+] added special check for cygwin
-#     [+] filtered out hidden files (starting with .) while globbing inside NDK
-#     [+] automatically applied GLESv2 linkage fix for NDK revisions 5-6
-#     [+] added ANDROID_GET_ABI_RAWNAME to get NDK ABI names by CMake flags
-#   - February 2012
-#     [+] updated for NDK r7b
-#     [~] fixed cmake try_compile() command
-#     [~] Fix for missing install_name_tool on OS X
-#   - March 2012
-#     [~] fixed incorrect C compiler flags
-#     [~] fixed CMAKE_SYSTEM_PROCESSOR change on ANDROID_ABI change
-#     [+] improved toolchain loading speed
-#     [+] added assembler language support (.S)
-#     [+] allowed preset search paths and extra search suffixes
-#   - April 2012
-#     [+] updated for NDK r7c
-#     [~] fixed most of problems with compiler/linker flags and caching
-#     [+] added option ANDROID_FUNCTION_LEVEL_LINKING
-#   - May 2012
-#     [+] updated for NDK r8
-#     [+] added mips architecture support
-#   - August 2012
-#     [+] updated for NDK r8b
-#     [~] all intermediate files generated by toolchain are moved to CMakeFiles
-#     [~] libstdc++ and libsupc are removed from explicit link libraries
-#     [+] added CCache support (via NDK_CCACHE environment or cmake variable)
-#     [+] added gold linker support for NDK r8b
-#     [~] fixed mips linker flags for NDK r8b
-#   - September 2012
-#     [+] added NDK release name detection (see ANDROID_NDK_RELEASE)
-#     [+] added support for all C++ runtimes from NDK
-#         (system, gabi++, stlport, gnustl)
-#     [+] improved warnings on known issues of NDKs
-#     [~] use gold linker as default if available (NDK r8b)
-#     [~] globally turned off rpath
-#     [~] compiler options are aligned with NDK r8b
-#   - October 2012
-#     [~] fixed C++ linking: explicitly link with math library (OpenCV #2426)
-#   - November 2012
-#     [+] updated for NDK r8c
-#     [+] added support for clang compiler
-#   - December 2012
-#     [+] suppress warning about unused CMAKE_TOOLCHAIN_FILE variable
-#     [+] adjust API level to closest compatible as NDK does
-#     [~] fixed ccache full path search
-#     [+] updated for NDK r8d
-#     [~] compiler options are aligned with NDK r8d
-#   - March 2013
-#     [+] updated for NDK r8e (x86 version)
-#     [+] support x86_64 version of NDK
-#   - April 2013
-#     [+] support non-release NDK layouts (from Linaro git and Android git)
-#     [~] automatically detect if explicit link to crtbegin_*.o is needed
-#   - June 2013
-#     [~] fixed stl include path for standalone toolchain made by NDK >= r8c
-#   - July 2013
-#     [+] updated for NDK r9
-#   - November 2013
-#     [+] updated for NDK r9b
-#   - December 2013
-#     [+] updated for NDK r9c
-#   - January 2014
-#     [~] fix copying of shared STL
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -311,23 +216,31 @@
 endif()

 if( CMAKE_TOOLCHAIN_FILE )
- # touch toolchain variable only to suppress "unused variable" warning
-endif()
-
+ # touch toolchain variable to suppress "unused variable" warning
+endif()
+
+# inherit settings in recursive loads
 get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
 if( _CMAKE_IN_TRY_COMPILE )
  include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
 endif()

 # this one is important
-set( CMAKE_SYSTEM_NAME Linux )
+if( CMAKE_VERSION VERSION_GREATER "3.0.99" )
+ set( CMAKE_SYSTEM_NAME Android )
+else()
+ set( CMAKE_SYSTEM_NAME Linux )
+endif()
+
 # this one not so much
 set( CMAKE_SYSTEM_VERSION 1 )

 # rpath makes low sence for Android
+set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" )
 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )

-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+# NDK search paths
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -341,13 +254,21 @@
  set( ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH /opt/android-toolchain )
 endif()

+# known ABIs
 set( ANDROID_SUPPORTED_ABIS_arm "armeabi-v7a;armeabi;armeabi-v7a with NEON;armeabi-v7a with VFPV3;armeabi-v6 with VFP" )
+set( ANDROID_SUPPORTED_ABIS_arm64 "arm64-v8a" )
 set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
-set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )
-
+set( ANDROID_SUPPORTED_ABIS_x86_64 "x86_64" )
+set( ANDROID_SUPPORTED_ABIS_mips "mips" )
+set( ANDROID_SUPPORTED_ABIS_mips64 "mips64" )
+
+# API level defaults
 set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_arm64 21 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_x86_64 21 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_mips64 21 )

 macro( __LIST_FILTER listvar regex )
@@ -423,7 +344,7 @@
 endmacro()

 macro( __DETECT_NATIVE_API_LEVEL _var _path )
- SET( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*$" )
+ SET( __ndkApiLevelRegex "^[\t ]*#define[\t ]+__ANDROID_API__[\t ]+([0-9]+)[\t ]*.*$" )
  FILE( STRINGS ${_path} __apiFileContent REGEX "${__ndkApiLevelRegex}" )
  if( NOT __apiFileContent )
   message( SEND_ERROR "Could not get Android native API level. Probably you have specified invalid level value, or your copy of NDK/toolchain is broken." )
@@ -535,12 +456,15 @@
  set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
  set( BUILD_WITH_ANDROID_NDK True )
  if( EXISTS "${ANDROID_NDK}/RELEASE.TXT" )
-  file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX r[0-9]+[a-z]? )
-  string( REGEX MATCH r[0-9]+[a-z]? ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" )
+  file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE_FULL LIMIT_COUNT 1 REGEX "r[0-9]+[a-z]?" )
+  string( REGEX MATCH "r([0-9]+)([a-z]?)" ANDROID_NDK_RELEASE "${ANDROID_NDK_RELEASE_FULL}" )
  else()
   set( ANDROID_NDK_RELEASE "r1x" )
   set( ANDROID_NDK_RELEASE_FULL "unreleased" )
  endif()
+ string( REGEX REPLACE "r([0-9]+)([a-z]?)" "\\1*1000" ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE}" )
+ string( FIND " abcdefghijklmnopqastuvwxyz" "${CMAKE_MATCH_2}" __ndkReleaseLetterNum )
+ math( EXPR ANDROID_NDK_RELEASE_NUM "${ANDROID_NDK_RELEASE_NUM}+${__ndkReleaseLetterNum}" )
 elseif( ANDROID_STANDALONE_TOOLCHAIN )
  get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
  # try to detect change
@@ -621,12 +545,18 @@
  if( NOT __availableToolchainMachines )
   message( FATAL_ERROR "Could not determine machine name of your toolchain. Probably your Android standalone toolchain is broken." )
  endif()
- if( __availableToolchainMachines MATCHES i686 )
+ if( __availableToolchainMachines MATCHES x86_64 )
+  set( __availableToolchainArchs "x86_64" )
+ elseif( __availableToolchainMachines MATCHES i686 )
   set( __availableToolchainArchs "x86" )
+ elseif( __availableToolchainMachines MATCHES aarch64 )
+  set( __availableToolchainArchs "arm64" )
  elseif( __availableToolchainMachines MATCHES arm )
   set( __availableToolchainArchs "arm" )
+ elseif( __availableToolchainMachines MATCHES mips64el )
+  set( __availableToolchainArchs "mips64" )
  elseif( __availableToolchainMachines MATCHES mipsel )
-  set( __availableToolchainArchs "mipsel" )
+  set( __availableToolchainArchs "mips" )
  endif()
  execute_process( COMMAND "${ANDROID_STANDALONE_TOOLCHAIN}/bin/${__availableToolchainMachines}-gcc${TOOL_OS_SUFFIX}" -dumpversion
                   OUTPUT_VARIABLE __availableToolchainCompilerVersions OUTPUT_STRIP_TRAILING_WHITESPACE )
@@ -642,24 +572,44 @@
 macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
  foreach( __toolchain ${${__availableToolchainsLst}} )
   if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
-   string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
+   SET( __toolchainVersionRegex "^TOOLCHAIN_VERSION[\t ]+:=[\t ]+(.*)$" )
+   FILE( STRINGS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}/setup.mk" __toolchainVersionStr REGEX "${__toolchainVersionRegex}" )
+   if( __toolchainVersionStr )
+    string( REGEX REPLACE "${__toolchainVersionRegex}" "\\1" __toolchainVersionStr "${__toolchainVersionStr}" )
+    string( REGEX REPLACE "-clang3[.][0-9]$" "-${__toolchainVersionStr}" __gcc_toolchain "${__toolchain}" )
+   else()
+    string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
+   endif()
+   unset( __toolchainVersionStr )
+   unset( __toolchainVersionRegex )
   else()
    set( __gcc_toolchain "${__toolchain}" )
   endif()
   __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" )
   if( __machine )
    string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" )
-   if( __machine MATCHES i686 )
+   if( __machine MATCHES x86_64 )
+    set( __arch "x86_64" )
+   elseif( __machine MATCHES i686 )
     set( __arch "x86" )
+   elseif( __machine MATCHES aarch64 )
+    set( __arch "arm64" )
    elseif( __machine MATCHES arm )
     set( __arch "arm" )
+   elseif( __machine MATCHES mips64el )
+    set( __arch "mips64" )
    elseif( __machine MATCHES mipsel )
-    set( __arch "mipsel" )
+    set( __arch "mips" )
+   else()
+    set( __arch "" )
    endif()
-   list( APPEND __availableToolchainMachines "${__machine}" )
-   list( APPEND __availableToolchainArchs "${__arch}" )
-   list( APPEND __availableToolchainCompilerVersions "${__version}" )
-   list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
+   #message("machine: !${__machine}!\narch: !${__arch}!\nversion: !${__version}!\ntoolchain: !${__toolchain}!\n")
+   if (__arch)
+    list( APPEND __availableToolchainMachines "${__machine}" )
+    list( APPEND __availableToolchainArchs "${__arch}" )
+    list( APPEND __availableToolchainCompilerVersions "${__version}" )
+    list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
+   endif()
   endif()
   unset( __gcc_toolchain )
  endforeach()
@@ -735,28 +685,45 @@
  set( X86 true )
  set( ANDROID_NDK_ABI_NAME "x86" )
  set( ANDROID_ARCH_NAME "x86" )
- set( ANDROID_ARCH_FULLNAME "x86" )
  set( ANDROID_LLVM_TRIPLE "i686-none-linux-android" )
  set( CMAKE_SYSTEM_PROCESSOR "i686" )
+elseif( ANDROID_ABI STREQUAL "x86_64" )
+ set( X86 true )
+ set( X86_64 true )
+ set( ANDROID_NDK_ABI_NAME "x86_64" )
+ set( ANDROID_ARCH_NAME "x86_64" )
+ set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
+ set( ANDROID_LLVM_TRIPLE "x86_64-none-linux-android" )
+elseif( ANDROID_ABI STREQUAL "mips64" )
+ set( MIPS64 true )
+ set( ANDROID_NDK_ABI_NAME "mips64" )
+ set( ANDROID_ARCH_NAME "mips64" )
+ set( ANDROID_LLVM_TRIPLE "mips64el-none-linux-android" )
+ set( CMAKE_SYSTEM_PROCESSOR "mips64" )
 elseif( ANDROID_ABI STREQUAL "mips" )
  set( MIPS true )
  set( ANDROID_NDK_ABI_NAME "mips" )
  set( ANDROID_ARCH_NAME "mips" )
- set( ANDROID_ARCH_FULLNAME "mipsel" )
  set( ANDROID_LLVM_TRIPLE "mipsel-none-linux-android" )
  set( CMAKE_SYSTEM_PROCESSOR "mips" )
+elseif( ANDROID_ABI STREQUAL "arm64-v8a" )
+ set( ARM64_V8A true )
+ set( ANDROID_NDK_ABI_NAME "arm64-v8a" )
+ set( ANDROID_ARCH_NAME "arm64" )
+ set( ANDROID_LLVM_TRIPLE "aarch64-none-linux-android" )
+ set( CMAKE_SYSTEM_PROCESSOR "aarch64" )
+ set( VFPV3 true )
+ set( NEON true )
 elseif( ANDROID_ABI STREQUAL "armeabi" )
  set( ARMEABI true )
  set( ANDROID_NDK_ABI_NAME "armeabi" )
  set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
  set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
  set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
 elseif( ANDROID_ABI STREQUAL "armeabi-v6 with VFP" )
  set( ARMEABI_V6 true )
  set( ANDROID_NDK_ABI_NAME "armeabi" )
  set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
  set( ANDROID_LLVM_TRIPLE "armv5te-none-linux-androideabi" )
  set( CMAKE_SYSTEM_PROCESSOR "armv6" )
  # need always fallback to older platform
@@ -765,14 +732,12 @@
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
  set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
 elseif( ANDROID_ABI STREQUAL "armeabi-v7a with VFPV3" )
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
  set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
  set( VFPV3 true )
@@ -780,7 +745,6 @@
  set( ARMEABI_V7A true )
  set( ANDROID_NDK_ABI_NAME "armeabi-v7a" )
  set( ANDROID_ARCH_NAME "arm" )
- set( ANDROID_ARCH_FULLNAME "arm" )
  set( ANDROID_LLVM_TRIPLE "armv7-none-linux-androideabi" )
  set( CMAKE_SYSTEM_PROCESSOR "armv7-a" )
  set( VFPV3 true )
@@ -814,7 +778,7 @@
 To configure the toolchain set CMake variable ANDROID_TOOLCHAIN_NAME to one of the following values:\n${toolchains_list}\n" )
  endif()
  list( GET __availableToolchainArchs ${__toolchainIdx} __toolchainArch )
- if( NOT __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
+ if( NOT __toolchainArch STREQUAL ANDROID_ARCH_NAME )
   message( SEND_ERROR "Selected toolchain \"${ANDROID_TOOLCHAIN_NAME}\" is not able to compile binaries for the \"${ANDROID_ARCH_NAME}\" platform." )
  endif()
 else()
@@ -825,7 +789,7 @@
  math( EXPR __availableToolchainsCount "${__availableToolchainsCount}-1" )
  foreach( __idx RANGE ${__availableToolchainsCount} )
   list( GET __availableToolchainArchs ${__idx} __toolchainArch )
-  if( __toolchainArch STREQUAL ANDROID_ARCH_FULLNAME )
+  if( __toolchainArch STREQUAL ANDROID_ARCH_NAME )
    list( GET __availableToolchainCompilerVersions ${__idx} __toolchainVersion )
    string( REPLACE "x" "99" __toolchainVersion "${__toolchainVersion}")
    if( __toolchainVersion VERSION_GREATER __toolchainMaxVersion )
@@ -854,15 +818,16 @@

 # choose native API level
 __INIT_VARIABLE( ANDROID_NATIVE_API_LEVEL ENV_ANDROID_NATIVE_API_LEVEL ANDROID_API_LEVEL ENV_ANDROID_API_LEVEL ANDROID_STANDALONE_TOOLCHAIN_API_LEVEL ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME} ANDROID_DEFAULT_NDK_API_LEVEL )
-string( REGEX MATCH "[0-9]+" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
+string( REPLACE "android-" "" ANDROID_NATIVE_API_LEVEL "${ANDROID_NATIVE_API_LEVEL}" )
+string( STRIP "${ANDROID_NATIVE_API_LEVEL}" ANDROID_NATIVE_API_LEVEL )
 # adjust API level
 set( __real_api_level ${ANDROID_DEFAULT_NDK_API_LEVEL_${ANDROID_ARCH_NAME}} )
 foreach( __level ${ANDROID_SUPPORTED_NATIVE_API_LEVELS} )
- if( NOT __level GREATER ANDROID_NATIVE_API_LEVEL AND NOT __level LESS __real_api_level )
+ if( (__level LESS ANDROID_NATIVE_API_LEVEL OR __level STREQUAL ANDROID_NATIVE_API_LEVEL) AND NOT __level LESS __real_api_level )
   set( __real_api_level ${__level} )
  endif()
 endforeach()
-if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL EQUAL __real_api_level )
+if( __real_api_level AND NOT ANDROID_NATIVE_API_LEVEL STREQUAL __real_api_level )
  message( STATUS "Adjusting Android API level 'android-${ANDROID_NATIVE_API_LEVEL}' to 'android-${__real_api_level}'")
  set( ANDROID_NATIVE_API_LEVEL ${__real_api_level} )
 endif()
@@ -874,7 +839,7 @@
 else()
  if( BUILD_WITH_ANDROID_NDK )
   __DETECT_NATIVE_API_LEVEL( __realApiLevel "${ANDROID_NDK}/platforms/android-${ANDROID_NATIVE_API_LEVEL}/arch-${ANDROID_ARCH_NAME}/usr/include/android/api-level.h" )
-  if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL )
+  if( NOT __realApiLevel EQUAL ANDROID_NATIVE_API_LEVEL AND NOT __realApiLevel GREATER 9000 )
    message( SEND_ERROR "Specified Android API level (${ANDROID_NATIVE_API_LEVEL}) does not match to the level found (${__realApiLevel}). Probably your copy of NDK is broken." )
   endif()
   unset( __realApiLevel )
@@ -891,8 +856,8 @@
 # remember target ABI
 set( ANDROID_ABI "${ANDROID_ABI}" CACHE STRING "The target ABI for Android. If arm, then armeabi-v7a is recommended for hardware floating point." FORCE )
 if( CMAKE_VERSION VERSION_GREATER "2.8" )
- list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME} )
- set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_FULLNAME}} )
+ list( SORT ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME} )
+ set_property( CACHE ANDROID_ABI PROPERTY STRINGS ${ANDROID_SUPPORTED_ABIS_${ANDROID_ARCH_NAME}} )
 endif()

@@ -1034,7 +999,7 @@
  string( REGEX MATCH "[0-9]+[.][0-9]+" ANDROID_CLANG_VERSION "${ANDROID_CLANG_VERSION}")
 elseif( "${ANDROID_TOOLCHAIN_NAME}" MATCHES "-clang3[.][0-9]?$" )
  string( REGEX MATCH "3[.][0-9]$" ANDROID_CLANG_VERSION "${ANDROID_TOOLCHAIN_NAME}")
- string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-4.6" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
+ string( REGEX REPLACE "-clang${ANDROID_CLANG_VERSION}$" "-${ANDROID_COMPILER_VERSION}" ANDROID_GCC_TOOLCHAIN_NAME "${ANDROID_TOOLCHAIN_NAME}" )
  if( NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/llvm-${ANDROID_CLANG_VERSION}${ANDROID_NDK_TOOLCHAINS_SUBPATH}/bin/clang${TOOL_OS_SUFFIX}" )
   message( FATAL_ERROR "Could not find the Clang compiler driver" )
  endif()
@@ -1067,7 +1032,7 @@
   set( ANDROID_EXCEPTIONS       ON )
   set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/system/include" )
  elseif( ANDROID_STL MATCHES "gabi" )
-  if( ANDROID_NDK_RELEASE STRLESS "r7" )
+  if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
    message( FATAL_ERROR "gabi++ is not awailable in your NDK. You have to upgrade to NDK r7 or newer to use gabi++.")
   endif()
   set( ANDROID_RTTI             ON )
@@ -1075,12 +1040,12 @@
   set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_NDK}/sources/cxx-stl/gabi++/include" )
   set( __libstl                 "${ANDROID_NDK}/sources/cxx-stl/gabi++/libs/${ANDROID_NDK_ABI_NAME}/libgabi++_static.a" )
  elseif( ANDROID_STL MATCHES "stlport" )
-  if( NOT ANDROID_NDK_RELEASE STRLESS "r8d" )
+  if( NOT ANDROID_NDK_RELEASE_NUM LESS 8004 ) # before r8d
    set( ANDROID_EXCEPTIONS       ON )
   else()
    set( ANDROID_EXCEPTIONS       OFF )
   endif()
-  if( ANDROID_NDK_RELEASE STRLESS "r7" )
+  if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
    set( ANDROID_RTTI            OFF )
   else()
    set( ANDROID_RTTI            ON )
@@ -1101,7 +1066,7 @@
   else()
    set( __libstl                "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++" )
   endif()
-  set( ANDROID_STL_INCLUDE_DIRS "${__libstl}/include" "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include" )
+  set( ANDROID_STL_INCLUDE_DIRS "${__libstl}/include" "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/include" "${__libstl}/include/backward" )
   if( EXISTS "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
    set( __libstl                "${__libstl}/libs/${ANDROID_NDK_ABI_NAME}/libgnustl_static.a" )
   else()
@@ -1203,10 +1168,14 @@
 include( CMakeForceCompiler )
 CMAKE_FORCE_C_COMPILER( "${CMAKE_C_COMPILER}" GNU )
 if( ANDROID_COMPILER_IS_CLANG )
- set( CMAKE_C_COMPILER_ID Clang)
+ set( CMAKE_C_COMPILER_ID Clang )
 endif()
 set( CMAKE_C_PLATFORM_ID Linux )
-set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+if( X86_64 OR MIPS64 OR ARM64_V8A )
+ set( CMAKE_C_SIZEOF_DATA_PTR 8 )
+else()
+ set( CMAKE_C_SIZEOF_DATA_PTR 4 )
+endif()
 set( CMAKE_C_HAS_ISYSROOT 1 )
 set( CMAKE_C_COMPILER_ABI ELF )
 CMAKE_FORCE_CXX_COMPILER( "${CMAKE_CXX_COMPILER}" GNU )
@@ -1214,7 +1183,7 @@
  set( CMAKE_CXX_COMPILER_ID Clang)
 endif()
 set( CMAKE_CXX_PLATFORM_ID Linux )
-set( CMAKE_CXX_SIZEOF_DATA_PTR 4 )
+set( CMAKE_CXX_SIZEOF_DATA_PTR ${CMAKE_C_SIZEOF_DATA_PTR} )
 set( CMAKE_CXX_HAS_ISYSROOT 1 )
 set( CMAKE_CXX_COMPILER_ABI ELF )
 set( CMAKE_CXX_SOURCE_FILE_EXTENSIONS cc cp cxx cpp CPP c++ C )
@@ -1225,6 +1194,14 @@
 set( CMAKE_ASM_COMPILER_FORCED TRUE )
 set( CMAKE_COMPILER_IS_GNUASM 1)
 set( CMAKE_ASM_SOURCE_FILE_EXTENSIONS s S asm )
+
+foreach( lang C CXX ASM )
+ if( ANDROID_COMPILER_IS_CLANG )
+  set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_CLANG_VERSION} )
+ else()
+  set( CMAKE_${lang}_COMPILER_VERSION ${ANDROID_COMPILER_VERSION} )
+ endif()
+endforeach()

 # flags and definitions
 remove_definitions( -DANDROID )
@@ -1255,8 +1232,15 @@
 endif()

 # NDK flags
-if( ARMEABI OR ARMEABI_V7A )
- set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic -funwind-tables" )
+if (ARM64_V8A )
+ set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -ffunction-sections -funwind-tables" )
+ set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
+ set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer -fno-strict-aliasing" )
+ if( NOT ANDROID_COMPILER_IS_CLANG )
+  set( ANDROID_CXX_FLAGS_RELEASE "${ANDROID_CXX_FLAGS_RELEASE} -funswitch-loops -finline-limit=300" )
+ endif()
+elseif( ARMEABI OR ARMEABI_V7A)
+ set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
  if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
   set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
   set( ANDROID_CXX_FLAGS_DEBUG   "-marm -fno-omit-frame-pointer -fno-strict-aliasing" )
@@ -1271,17 +1255,15 @@
    set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
   endif()
  endif()
-elseif( X86 )
+elseif( X86 OR X86_64 )
  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables" )
  if( NOT ANDROID_COMPILER_IS_CLANG )
   set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funswitch-loops -finline-limit=300" )
- else()
-  set( ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fPIC" )
  endif()
  set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer -fstrict-aliasing" )
  set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer -fno-strict-aliasing" )
-elseif( MIPS )
- set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0" )
+elseif( MIPS OR MIPS64 )
+ set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0" )
  set( ANDROID_CXX_FLAGS_RELEASE "-fomit-frame-pointer" )
  set( ANDROID_CXX_FLAGS_DEBUG   "-fno-omit-frame-pointer" )
  if( NOT ANDROID_COMPILER_IS_CLANG )
@@ -1359,7 +1341,7 @@
 endif()

 # variables controlling optional build flags
-if (ANDROID_NDK_RELEASE STRLESS "r7")
+if( ANDROID_NDK_RELEASE_NUM LESS 7000 ) # before r7
  # libGLESv2.so in NDK's prior to r7 refers to missing external symbols.
  # So this flag option is required for all projects using OpenGL from native.
  __INIT_VARIABLE( ANDROID_SO_UNDEFINED                      VALUES ON )
@@ -1375,7 +1357,7 @@
 set( ANDROID_NO_UNDEFINED           ${ANDROID_NO_UNDEFINED}           CACHE BOOL "Show all undefined symbols as linker errors" )
 set( ANDROID_SO_UNDEFINED           ${ANDROID_SO_UNDEFINED}           CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
 set( ANDROID_FUNCTION_LEVEL_LINKING ${ANDROID_FUNCTION_LEVEL_LINKING} CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
-set( ANDROID_GOLD_LINKER            ${ANDROID_GOLD_LINKER}            CACHE BOOL "Enables gold linker (only avaialble for NDK r8b for ARM and x86 architectures on linux-86 and darwin-x86 hosts)" )
+set( ANDROID_GOLD_LINKER            ${ANDROID_GOLD_LINKER}            CACHE BOOL "Enables gold linker" )
 set( ANDROID_NOEXECSTACK            ${ANDROID_NOEXECSTACK}            CACHE BOOL "Allows or disallows undefined symbols in shared libraries" )
 set( ANDROID_RELRO                  ${ANDROID_RELRO}                  CACHE BOOL "Enables RELRO - a memory corruption mitigation technique" )
 mark_as_advanced( ANDROID_NO_UNDEFINED ANDROID_SO_UNDEFINED ANDROID_FUNCTION_LEVEL_LINKING ANDROID_GOLD_LINKER ANDROID_NOEXECSTACK ANDROID_RELRO )
@@ -1410,9 +1392,9 @@
 endif()

 if( ANDROID_COMPILER_VERSION VERSION_EQUAL "4.6" )
- if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE STRGREATER "r8b") AND (ARMEABI OR ARMEABI_V7A OR X86) )
+ if( ANDROID_GOLD_LINKER AND (CMAKE_HOST_UNIX OR ANDROID_NDK_RELEASE_NUM GREATER 8002) AND (ARMEABI OR ARMEABI_V7A OR X86) )
   set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=gold" )
- elseif( ANDROID_NDK_RELEASE STRGREATER "r8b")
+ elseif( ANDROID_NDK_RELEASE_NUM GREATER 8002 ) # after r8b
   set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -fuse-ld=bfd" )
  elseif( ANDROID_NDK_RELEASE STREQUAL "r8b" AND ARMEABI AND NOT _CMAKE_IN_TRY_COMPILE )
   message( WARNING "The default bfd linker from arm GCC 4.6 toolchain can fail with 'unresolvable R_ARM_THM_CALL relocation' error message. See https://code.google.com/p/android/issues/detail?id=35342
@@ -1436,13 +1418,7 @@
 endif()

 if( ANDROID_COMPILER_IS_CLANG )
- set( ANDROID_CXX_FLAGS "-Qunused-arguments ${ANDROID_CXX_FLAGS}" )
- if( ARMEABI_V7A AND NOT ANDROID_FORCE_ARM_BUILD )
-  set( ANDROID_CXX_FLAGS_RELEASE "-target thumbv7-none-linux-androideabi ${ANDROID_CXX_FLAGS_RELEASE}" )
-  set( ANDROID_CXX_FLAGS_DEBUG   "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS_DEBUG}" )
- else()
-  set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} ${ANDROID_CXX_FLAGS}" )
- endif()
+ set( ANDROID_CXX_FLAGS "-target ${ANDROID_LLVM_TRIPLE} -Qunused-arguments ${ANDROID_CXX_FLAGS}" )
  if( BUILD_WITH_ANDROID_NDK )
   set( ANDROID_CXX_FLAGS "-gcc-toolchain ${ANDROID_TOOLCHAIN_ROOT} ${ANDROID_CXX_FLAGS}" )
  endif()
@@ -1484,6 +1460,16 @@
  set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_SHARED_LINKER_FLAGS}" )
  set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.xsc ${CMAKE_MODULE_LINKER_FLAGS}" )
  set( CMAKE_EXE_LINKER_FLAGS    "-Wl,-T,${ANDROID_NDK_TOOLCHAINS_PATH}/${ANDROID_GCC_TOOLCHAIN_NAME}/mipself.x ${CMAKE_EXE_LINKER_FLAGS}" )
+endif()
+
+# pie/pic
+if( NOT (ANDROID_NATIVE_API_LEVEL LESS 16) AND (NOT DEFINED ANDROID_APP_PIE OR ANDROID_APP_PIE) AND (CMAKE_VERSION VERSION_GREATER 2.8.8) )
+ set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
+ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie")
+else()
+ set( CMAKE_POSITION_INDEPENDENT_CODE FALSE )
+ set( CMAKE_CXX_FLAGS "-fpic ${CMAKE_CXX_FLAGS}" )
+ set( CMAKE_C_FLAGS   "-fpic ${CMAKE_C_FLAGS}" )
 endif()

 # configure rtti
@@ -1667,6 +1653,7 @@
                 ANDROID_RELRO
                 ANDROID_LIBM_PATH
                 ANDROID_EXPLICIT_CRT_LINK
+                ANDROID_APP_PIE
                 )
   if( DEFINED ${__var} )
    if( "${__var}" MATCHES " ")
@@ -1705,8 +1692,8 @@

 # Variables controlling behavior or set by cmake toolchain:
-#   ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips"
-#   ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14 (depends on NDK version)
+#   ANDROID_ABI : "armeabi-v7a" (default), "armeabi", "armeabi-v7a with NEON", "armeabi-v7a with VFPV3", "armeabi-v6 with VFP", "x86", "mips", "arm64-v8a", "x86_64", "mips64"
+#   ANDROID_NATIVE_API_LEVEL : 3,4,5,8,9,14,15,16,17,18,19,21 (depends on NDK version)
 #   ANDROID_STL : gnustl_static/gnustl_shared/stlport_static/stlport_shared/gabi++_static/gabi++_shared/system_re/system/none
 #   ANDROID_FORBID_SYGWIN : ON/OFF
 #   ANDROID_NO_UNDEFINED : ON/OFF
@@ -1739,17 +1726,21 @@
 #   ARMEABI : TRUE for arm v6 and older devices
 #   ARMEABI_V6 : TRUE for arm v6
 #   ARMEABI_V7A : TRUE for arm v7a
+#   ARM64_V8A : TRUE for arm64-v8a
 #   NEON : TRUE if NEON unit is enabled
 #   VFPV3 : TRUE if VFP version 3 is enabled
 #   X86 : TRUE if configured for x86
+#   X86_64 : TRUE if configured for x86_64
 #   MIPS : TRUE if configured for mips
+#   MIPS64 : TRUE if configured for mips64
 #   BUILD_ANDROID : always TRUE
 #   BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
-#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
-#   ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e, r9, r9b, r9c; set only for NDK
-#   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
+#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI
+#   ANDROID_NDK_RELEASE : from r5 to r10d; set only for NDK
+#   ANDROID_NDK_RELEASE_NUM : numeric ANDROID_NDK_RELEASE version (1000*major+minor)
+#   ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 #   ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
@@ -1757,7 +1748,8 @@
 #   ARMEABI_NDK_NAME : superseded by ANDROID_NDK_ABI_NAME
 #
 # Secondary (less stable) read-only variables:
-#   ANDROID_COMPILER_VERSION : GCC version used
+#   ANDROID_COMPILER_VERSION : GCC version used (not Clang version)
+#   ANDROID_CLANG_VERSION : version of clang compiler if clang is used
 #   ANDROID_CXX_FLAGS : C/C++ compiler flags required by Android platform
 #   ANDROID_SUPPORTED_ABIS : list of currently allowed values for ANDROID_ABI
 #   ANDROID_TOOLCHAIN_MACHINE_NAME : "arm-linux-androideabi", "arm-eabi" or "i686-android-linux"
@@ -1768,7 +1760,6 @@
 #   ANDROID_RTTI : if rtti is enabled by the runtime
 #   ANDROID_EXCEPTIONS : if exceptions are enabled by the runtime
 #   ANDROID_GCC_TOOLCHAIN_NAME : read-only, differs from ANDROID_TOOLCHAIN_NAME only if clang is used
-#   ANDROID_CLANG_VERSION : version of clang compiler if clang is used
 #   ANDROID_LIBM_PATH : path to libm.so (set to something like $(TOP)/out/target/product/<product_name>/obj/lib/libm.so) to workaround unresolved `sincos`
 #
 # Defaults:


PARQUET-1319: Pass BISON_EXECUTABLE to Thrift EP for MacOS

Author: thamht4190 <thamht01188@gmail.com>
Author: gubee <thamht01188@gmail.com>

Closes #470 from thamht4190/PARQUET-1319 and squashes the following commits:

d8ced13 [thamht4190] PARQUET-1319: Pass BISON_EXECUTABLE to Thrift EP for MacOS
da9c86b [gubee] Merge pull request #1 from apache/master

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -249,6 +249,11 @@
                           "-DWITH_PLUGIN=OFF"
                           ${THRIFT_CMAKE_ARGS})
     set(THRIFT_DEPENDENCIES ${THRIFT_DEPENDENCIES} zlib_ep)
+  elseif (APPLE)
+    if (DEFINED BISON_EXECUTABLE)
+      set(THRIFT_CMAKE_ARGS "-DBISON_EXECUTABLE=${BISON_EXECUTABLE}"
+                            ${THRIFT_CMAKE_ARGS})
+    endif()
   endif()

   ExternalProject_Add(thrift_ep


Enhancements to checked_find_package (#2681)

Sometimes the true minimum version of a dependency that we are able to
build against is lower than the minimum *recommended* version (perhaps
because some important feature was added in a subsequent release that
we would like to expose if available).

This patch allows checked_find_package to take two new optional
arguments: RECOMMEND_MIN is the minimum *recommended* version (but not
the true rejection minimum) and RECOMMEND_MIN_REASON is some text to
add to the error message if there is a succinct explanation for why we
recommend a higher version than the true minimum.

As an example, we will (currently) build against any OpenEXR 2.x. But
if it's not at least 2.2, we can't support DWAA and DWAB compression.

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/externalpackages.cmake
+++ src/cmake/externalpackages.cmake
@@ -52,13 +52,25 @@
 #     present package is only needed because it's a dependency, and
 #     therefore if <downstream> is disabled, we don't bother with this
 #     package either.
+#   * Optional RECOMMEND_MIN, if supplied, gives a minimum recommended
+#     version, accepting but warning if it is below this number (even
+#     if above the true minimum version accepted). The warning message
+#     can give an optional explanation, passed as RECOMMEND_MIN_REASON.
 #
 # N.B. This needs to be a macro, not a function, because the find modules
 # will set(blah val PARENT_SCOPE) and we need that to be the global scope,
 # not merely the scope for this function.
 macro (checked_find_package pkgname)
-    cmake_parse_arguments(_pkg "REQUIRED" "ENABLE;ISDEPOF" "DEFINITIONS;PRINT;DEPS" ${ARGN})
-        # Arguments: <prefix> noValueKeywords singleValueKeywords multiValueKeywords argsToParse
+    cmake_parse_arguments(_pkg   # prefix
+        # noValueKeywords:
+        "REQUIRED"
+        # singleValueKeywords:
+        "ENABLE;ISDEPOF;RECOMMEND_MIN;RECOMMEND_MIN_REASON"
+        # multiValueKeywords:
+        "DEFINITIONS;PRINT;DEPS"
+        # argsToParse:
+        ${ARGN})
+    string (TOLOWER ${pkgname} pkgname_lower)
     string (TOUPPER ${pkgname} pkgname_upper)
     if (NOT VERBOSE)
         set (${pkgname}_FIND_QUIETLY true)
@@ -111,6 +123,11 @@
                 endforeach ()
             endif ()
             add_definitions (${_pkg_DEFINITIONS})
+            if (_pkg_RECOMMEND_MIN)
+                if (${${pkgname}_VERSION} VERSION_LESS ${_pkg_RECOMMEND_MIN})
+                    message (STATUS "${ColorYellow}Recommend ${pkgname} >= ${_pkg_RECOMMEND_MIN} ${_pkg_RECOMMEND_MIN_REASON} ${ColorReset}")
+                endif ()
+            endif ()
         else ()
             message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
             if (${pkgname}_ROOT)
@@ -192,10 +209,14 @@
 # that we will not complete the build if they are not found.

 checked_find_package (ZLIB REQUIRED)  # Needed by several packages
-checked_find_package (TIFF 3.0 REQUIRED)
+checked_find_package (TIFF 3.9 REQUIRED
+                      RECOMMEND_MIN 4.0
+                      RECOMMEND_MIN_REASON "to support >4GB files")

 # IlmBase & OpenEXR
-checked_find_package (OpenEXR 2.0 REQUIRED)
+checked_find_package (OpenEXR 2.0 REQUIRED
+                      RECOMMEND_MIN 2.2
+                      RECOMMEND_MIN_REASON "for DWA compression")
 # We use Imath so commonly, may as well include it everywhere.
 include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}"
                      "${ILMBASE_INCLUDES}/OpenEXR")
@@ -259,10 +280,14 @@
 checked_find_package (Field3D
                    DEPS         HDF5
                    DEFINITIONS  -DUSE_FIELD3D=1)
-checked_find_package (GIF 4)
+checked_find_package (GIF 4.1
+                      RECOMMEND_MIN 5.0
+                      RECOMMEND_MIN_REASON "for stability and thread safety")
 checked_find_package (Libheif 1.3)  # For HEIF/HEIC format
 checked_find_package (LibRaw
-                    PRINT LibRaw_r_LIBRARIES)
+                      PRINT LibRaw_r_LIBRARIES
+                      RECOMMEND_MIN 0.18
+                      RECOMMEND_MIN_REASON "for ACES support")
 checked_find_package (OpenJpeg 2.0)
 checked_find_package (OpenVDB 5.0
                    DEPS         TBB


Remove GRM as long as it does not pass test

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -127,7 +127,7 @@
 include ( "${CMAKE_CURRENT_LIST_DIR}/configure_options.cmake" )

 # For superbuild we need remote module
-foreach(remote_module otbGRM DiapOTBModule OTBTemporalGapFilling) #Mosaic # #SertitObject
+foreach(remote_module DiapOTBModule OTBTemporalGapFilling)#otbGRM #Mosaic # #SertitObject
     set ( CONFIGURE_OPTIONS
       "${CONFIGURE_OPTIONS}-DModule_${remote_module}:BOOL=ON;")
 endforeach()


Be smarter about whether Boost is required or not

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -96,7 +96,12 @@
 	find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)
 endif()
 # Optional Boost libs (Boost_${COMPONENT}_FOUND
-macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" FALSE "" "")
+if(OGRE_BUILD_COMPONENT_PROPERTY)
+	set(OGRE_BOOST_REQUIRED TRUE)
+else ()
+	set(OGRE_BOOST_REQUIRED FALSE)
+endif()
+macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" ${OGRE_BOOST_REQUIRED} "" "")
 macro_log_feature(Boost_THREAD_FOUND "boost-thread" "Used for threading support" "http://boost.org" FALSE "" "")


Remove obsolete apple_config.cmake

Remove obsolete apple_config.cmake

--- CMake/apple_config.cmake
+++ CMake/apple_config.cmake
@@ -1,9 +0,0 @@
-message(STATUS "Setting Apple configurations")
-
-macro(os_set_flags)
-    set(FORCE_LIBUVC ON)
-    set(BUILD_WITH_TM2 ON)
-endmacro()
-
-macro(os_target_config)
-endmacro()


Use ITK GTest already defined

Use ITK GTest already defined

When compiling against an ITK build director the GTest targets will
already be defined, and will not need to be reimported.

--- CMake/sitkUseGTest.cmake
+++ CMake/sitkUseGTest.cmake
@@ -14,11 +14,17 @@
 # directory.

+include(GoogleTest)
+
+if (TARGET GTest::Main AND TARGET GTest::GTest)
+    message(STATUS "GTest targets already defined.")
+#    return()
+endif()
+
 set(GTEST_ROOT "" CACHE PATH "Path to the root of a binary gtest \
 installation where GTEST_ROOT/include/gtest/gtest.h can be found OR \
 path to a Google Test source tree.")

-include(GoogleTest)

 function(_sitk_gtest_use_gtest_source)


UPD: build information for RelWithDebInfo

--- CMakeLists.default.cmake
+++ CMakeLists.default.cmake
@@ -13,7 +13,7 @@

 if (NOT CMAKE_BUILD_TYPE)
 	set(CMAKE_BUILD_TYPE Debug CACHE STRING
-      	"Choose the type of build, options are: Debug Release."
+      	"Choose the type of build, options are: Debug, RelWithDebInfo or Release."
       	FORCE
 	)
 endif(NOT CMAKE_BUILD_TYPE)
@@ -36,6 +36,6 @@
 	)

 	set(CMAKE_C_FLAGS_RELWITHDEBINFO "-g -O2 -D_FORTIFY_SOURCE=1 -fstrict-aliasing ${CMAKE_USER_C_FLAGS}" CACHE STRING
-		"Flags used by the compiler during release build." FORCE
+		"Flags used by the compiler during release build with debug information." FORCE
 	)
 endif (CMAKE_COMPILER_IS_GNUCXX)


ENH: Added VTK_DOXYGEN_HOME setting.

ENH: Added VTK_DOXYGEN_HOME setting.

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -175,5 +175,5 @@
   ENDIF (JAVA_AWT_INCLUDE_PATH)
 ENDIF (VTK_WRAP_JAVA)

-
-
+# The doxygen helper perl script location.
+SET(VTK_DOXYGEN_HOME ${VTK_SOURCE_DIR}/Utilities/Doxygen)


build: prefer mozjs over js because modern versions are mozjs

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -52,13 +52,13 @@

 find_library(
     SPIDERMONKEY_LIBRARY
-    NAMES js mozjs js32
+    NAMES mozjs js js32
     PATHS "${SPIDERMONKEY_ROOT}/lib"
     NO_DEFAULT_PATH)

 find_library(
     SPIDERMONKEY_LIBRARY
-    NAMES js mozjs js32)
+    NAMES mozjs js js32)

 set(SPIDERMONKEY_LIBRARIES ${SPIDERMONKEY_LIBRARY})


added special section to handle modules defining variable with a different name than the package name...

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -281,12 +281,35 @@
 	set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/CMake/Modules/")

 	find_package( ${package_name} ${ARGN} )
-	if ( ${package_name}_FOUND )
+
+	#Sometime the variable name is differnet from the package name... annoying
+	set ( package_var_name ${package_name} )
+	#handle special cases
+	if ( ${package_var_name} STREQUAL "SDL_image")
+		set ( package_var_name "SDLIMAGE")
+	endif ( ${package_var_name} STREQUAL "SDL_image")
+	if ( ${package_var_name} STREQUAL "SDL_mixer")
+		set ( package_var_name "SDLMIXER")
+	endif ( ${package_var_name} STREQUAL "SDL_mixer")
+	if ( ${package_var_name} STREQUAL "SDL_ttf")
+		set ( package_var_name "SDLTTF")
+	endif ( ${package_var_name} STREQUAL "SDL_ttf")
+	if ( ${package_var_name} STREQUAL "SDL_net")
+		set ( package_var_name "SDLNET")
+	endif ( ${package_var_name} STREQUAL "SDL_net")
+	if ( ${package_var_name} STREQUAL "OpenGL" )
+		set ( package_var_name "OPENGL")
+	endif ( ${package_var_name} STREQUAL "OpenGL" )
+	#etc.
+	# add whats needed for the projects we support, waiting for a standard way in cmake modules...
+	# TODO : put that ina  separate file to avoid noise here...
+
+	if ( ${package_var_name}_FOUND )
 		message ( STATUS "Binary Dependency ${package_name} : Found ! " )
-		include_directories(${${package_name}_INCLUDE_DIRS})
-		target_link_libraries(${PROJECT_NAME} ${${package_name}_LIBRARIES})
+		include_directories(${${package_var_name}_INCLUDE_DIRS})
+		target_link_libraries(${PROJECT_NAME} ${${package_var_name}_LIBRARIES})
 		#if the find module also defines the runtime libraries ( Wk find module standard )
-		set( ${PROJECT_NAME}_RUN_LIBRARIES ${${PROJECT_NAME}_RUN_LIBRARIES} ${${package_name}_RUN_LIBRARIES} CACHE INTERNAL " libraries needed to run ${PROJECT_NAME} " )
+		set( ${PROJECT_NAME}_RUN_LIBRARIES ${${PROJECT_NAME}_RUN_LIBRARIES} ${${package_var_name}_RUN_LIBRARIES} CACHE INTERNAL " libraries needed to run ${PROJECT_NAME} " )
 		#once the project is built with it the dependency becomes mandatory
 		# we append to the config cmake script
 		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
@@ -296,19 +319,19 @@
 CMAKE_POLICY(VERSION 2.6)

 find_package( ${package_name} REQUIRED )
-if ( ${package_name}_FOUND )
-	set(${PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_INCLUDE_DIRS} \${${package_name}_INCLUDE_DIRS} )
-	set(${PROJECT_NAME}_LIBRARIES \${${PROJECT_NAME}_LIBRARIES} \${${package_name}_LIBRARIES} )
-	set(${PROJECT_NAME}_RUN_LIBRARIES \${${PROJECT_NAME}_RUN_LIBRARIES} \${${package_name}_RUN_LIBRARIES} )
-endif ( ${package_name}_FOUND )
+if ( ${package_var_name}_FOUND )
+	set(${PROJECT_NAME}_INCLUDE_DIRS \${${PROJECT_NAME}_INCLUDE_DIRS} \${${package_var_name}_INCLUDE_DIRS} )
+	set(${PROJECT_NAME}_LIBRARIES \${${PROJECT_NAME}_LIBRARIES} \${${package_var_name}_LIBRARIES} )
+	set(${PROJECT_NAME}_RUN_LIBRARIES \${${PROJECT_NAME}_RUN_LIBRARIES} \${${package_var_name}_RUN_LIBRARIES} )
+endif ( ${package_var_name}_FOUND )

 CMAKE_POLICY(POP)

 		")

-	else ( ${package_name}_FOUND )
+	else ( ${package_var_name}_FOUND )
 		message ( STATUS "Binary Dependency ${package_name} : FAILED ! " )
-	endif ( ${package_name}_FOUND )
+	endif ( ${package_var_name}_FOUND )

 CMAKE_POLICY(POP)
 endmacro (WkDepends package_name)


BUG: CMakeModules dependency not added to OSSIM

--- CMake/External_ossim.cmake
+++ CMake/External_ossim.cmake
@@ -81,10 +81,13 @@
     INSTALL_COMMAND "")

   set(OSSIM_CXX_FLAGS  -D__STDC_CONSTANT_MACROS)
+ list(APPEND ${proj}_DEPENDENCIES ossim_cmakemodules)
+
   if(MSVC)
     #checkout cmakeModules
-    set(${proj}_DEPENDENCIES ossim_cmakemodules)
+     set(${proj}_DEPENDENCIES ossim_cmakemodules)
      list(APPEND ${proj}_DEPENDENCIES OPENTHREAD)
+     list(APPEND ${proj}_DEPENDENCIES GEOTIFF)
     #cmake flags for exception handling in c++
     set(OSSIM_CXX_FLAGS /EHsc)
     #clear all dependent library settings except GEOTIFF as we link with gdal_i.
@@ -93,8 +96,9 @@
     set(OSSIM_SB_GEOS_CONFIG)
     set(OSSIM_SB_JPEG_CONFIG)
     set(OSSIM_SB_OPENTHREAD_CONFIG)
+    set(OSSIM_SB_GEOTIFF_CONFIG)
     #build geotiff and use it
-    set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
+    #set(OSSIM_SB_GEOTIFF_CONFIG -DGEOTIFF_LIBRARY:STRING=${CMAKE_INSTALL_PREFIX}/lib/gdal_i.lib)
   endif()

   ExternalProject_Add(${proj}
@@ -103,6 +107,7 @@
     SVN_REVISION -r 23087
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
+    CMAKE_GENERATOR "NMake Makefiles"
     CMAKE_CACHE_ARGS
       -DOSSIM_VERSION:STRING=1.8.18-1
       -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}


CMake: print file extensions that codecs are supporting

--- CMake/FeatureSummary.cmake
+++ CMake/FeatureSummary.cmake
@@ -130,22 +130,22 @@
 	set(_core "${_core}  + Mesh Lod\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_DDS)
-	set(_core "${_core}  + DDS image codec\n")
+	set(_core "${_core}  + DDS image codec (.dds)\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_PVRTC)
-	set(_core "${_core}  + PVRTC image codec\n")
+	set(_core "${_core}  + PVRTC image codec (.pvr)\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_ETC)
-	set(_core "${_core}  + ETC image codec\n")
+	set(_core "${_core}  + ETC image codec (.pkm, .ktx) \n")
 endif ()
 if (OGRE_CONFIG_ENABLE_FREEIMAGE)
-	set(_core "${_core}  + FreeImage codec\n")
+	set(_core "${_core}  + FreeImage codec (generic)\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_STBI)
-	set(_core "${_core}  + STBI codec\n")
+	set(_core "${_core}  + STBI codec (generic)\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_ASTC)
-	set(_core "${_core}  + ASTC image codec\n")
+	set(_core "${_core}  + ASTC image codec (.astc)\n")
 endif ()
 if (OGRE_CONFIG_ENABLE_ZIP)
 	set(_core "${_core}  + ZIP archives\n")


Improve flag hashing with C++11 try_compiles

Change-Id: Id8ba59e50d6269b80d98cce930c27012479c632e

--- CMake/sitkCheckCXX11.cmake
+++ CMake/sitkCheckCXX11.cmake
@@ -17,25 +17,33 @@
 # Function to wrap try compiles on the aggregate cxx test file1
 #
 function(sitkCXX11Test VARIABLE)
-  # use the hash of the dependent cxx flags in the variable name to
-  # cache the results.
-  string(MD5 cmake_cxx_flags_hash "${CMAKE_CXX_FLAGS}")
-  set(cache_var "${VARIABLE}_${hash_cmake_cxx_flags_hash}")
-  if(NOT DEFINED "${cache_var}")
+  # use the hash of the dependent cxx flags in the cached variable
+  # value to know if the arguments have changed, and need to rerun
+  string(MD5 cmake_flags_hash "${CMAKE_CXX_FLAGS}")
+  set(cache_var "${VARIABLE}_hash")
+
+  if(NOT DEFINED "${cache_var}" )
+    unset("${VARIABLE}" CACHE)
+  elseif(NOT "${${cache_var}}" STREQUAL "${cmake_flags_hash}" )
+    unset("${VARIABLE}" CACHE)
+  endif()
+
+  if(NOT DEFINED "${VARIABLE}")
     message(STATUS "Performing Test ${VARIABLE}")
     set(requred_definitions "${CMAKE_REQUIRED_DEFINITIONS} -D${VARIABLE}")
     try_compile(${VARIABLE}
-      ${SimpleITK_BINARY_DIR}/CMakeTmp
-      ${SimpleITK_SOURCE_DIR}/CMake/sitk_check_cxx11.cxx
+      "${PROJECT_BINARY_DIR}/CMakeTmp"
+      "${CMAKE_CURRENT_LIST_DIR}/sitk_check_cxx11.cxx"
       CMAKE_FLAGS
       -DCOMPILE_DEFINITIONS:STRING=${requred_definitions}
       OUTPUT_VARIABLE output)
+
+    set(${cache_var} "${cmake_flags_hash}" CACHE INTERNAL  "hashed try_compile flags")
+
     if(${VARIABLE})
-      set(${cache_var} 1 CACHE INTERNAL "SimpleITK test ${FUNCTION}")
       message(STATUS "Performing Test ${VARIABLE} - Success")
     else()
       message(STATUS "Performing Test ${VARIABLE} - Failed")
-      set(${cache_var} 0 CACHE INTERNAL "SimpleITKTest ${FUNCTION}")
       file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
                  "Performing Test ${VARIABLE} failed with the following output:\n"
                  "${OUTPUT}\n")


Whoops, think before you push...

Whoops, think before you push...

--- CMake/FindFFMPEG.cmake
+++ CMake/FindFFMPEG.cmake
@@ -105,7 +105,7 @@

 #Locate msinttypes
-#IF(MSVC)
+IF(MSVC)
 SET(MSINTTYPES_FOUND "NO")
 FIND_PATH(MSINTTYPES_INCLUDE_DIR inttypes.h ${FFMPEG_INCLUDE_SEARCH_DIRS})
 IF(MSINTTYPES_INCLUDE_DIR)


COMP: Use GDAL_CONFIG when importing GDAL for MinGW compiler

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -17,7 +17,7 @@
   message(STATUS "  GDAL includes : ${GDAL_INCLUDE_DIR}")
   message(STATUS "  GDAL library  : ${GDAL_LIBRARY}")

-  if(UNIX)
+  if(UNIX OR MINGW)
     if(NOT GDAL_CONFIG)
       message(FATAL_ERROR "Cannot find gdal-config. Set GDAL_CONFIG")
     endif()


reverted unnecessary cmake edit

reverted unnecessary cmake edit

--- firmware/robot2015/cpu/arm_mbed.cmake
+++ firmware/robot2015/cpu/arm_mbed.cmake
@@ -7,7 +7,6 @@
 # ------------------------------------------------------------------------------
 # git checkout and build location of mbed libraries
 set(MBED_PATH ${CMAKE_CURRENT_BINARY_DIR}/mbed_library-prefix/src/mbed_library)
-set(GCC_GCC_PATH "/usr/lib/gcc/arm-none-eabi/4.8.2")

 # ------------------------------------------------------------------------------
 # setup processor settings add aditional boards here


Be helpful if a build tree knows where opencv is and a consumer asks.

--- osvrConfigBuildTreePaths.cmake
+++ osvrConfigBuildTreePaths.cmake
@@ -8,4 +8,10 @@
 set(jsoncpp_DIR_IMPORTED "@jsoncpp_DIR@")
 if(jsoncpp_DIR_IMPORTED AND NOT JSONCPP_FOUND)
     list(APPEND CMAKE_PREFIX_PATH "${jsoncpp_DIR_IMPORTED}")
+endif()
+
+# Likewise for OpenCV.
+set(OpenCV_DIR_IMPORTED "@OpenCV_DIR@")
+if(OpenCV_DIR_IMPORTED AND NOT OPENCV_FOUND)
+    list(APPEND CMAKE_PREFIX_PATH "${OpenCV_DIR_IMPORTED}")
 endif()


Bump AWS SDK version

Bump AWS SDK version

- Fixes #1204
- Print out found path for AWS libraries

--- cmake/Modules/FindAWSSDK_EP.cmake
+++ cmake/Modules/FindAWSSDK_EP.cmake
@@ -71,8 +71,8 @@

     ExternalProject_Add(ep_awssdk
       PREFIX "externals"
-      URL "https://github.com/aws/aws-sdk-cpp/archive/1.7.81.zip"
-      URL_HASH SHA1=ea35fe7dcdace59014ebfd917f8cd696461c5413
+      URL "https://github.com/aws/aws-sdk-cpp/archive/1.7.94.zip"
+      URL_HASH SHA1=171c0fa56e880d15c6b369cf66ec7eae4bf63659
       CMAKE_ARGS
         -DCMAKE_BUILD_TYPE=Release
         -DENABLE_TESTING=OFF
@@ -111,7 +111,7 @@
       PATHS ${AWSSDK_LIB_DIR}
       ${TILEDB_DEPS_NO_DEFAULT_PATH}
     )
-    message(STATUS "Found AWS lib: ${LIB}")
+    message(STATUS "Found AWS lib: ${LIB} (${AWS_FOUND_${LIB}})")
     if (NOT TARGET AWSSDK::${LIB})
       add_library(AWSSDK::${LIB} UNKNOWN IMPORTED)
       set_target_properties(AWSSDK::${LIB} PROPERTIES


qibuild: continue work on compat.cmake

qibuild: continue work on compat.cmake

--- cmake/qibuild/compat/compat.cmake
+++ cmake/qibuild/compat/compat.cmake
@@ -12,90 +12,145 @@
 ######################
 # Install
 ######################
-function(install_header _name)
-  qi_deprecated("no implementation")
-endfunction()
-
-function(install_data _subfolder)
-  qi_deprecated("no implementation")
+function(install_header)
+  qi_deprecated("install_header is deprecated.
+  Use qi_install_header instead")
+  qi_install_header(${ARGN})
+endfunction()
+
+function(install_data)
+  qi_deprecated("install_data is deprecated.
+  Use qi_install_data instead")
+  qi_install_data(${ARGN})
 endfunction()

 function(install_data_dir _subfolder)
   qi_deprecated("no implementation")
 endfunction()

-function(install_doc _subfolder)
-  qi_deprecated("no implementation")
-endfunction()
-
-function(install_conf _subfolder)
-  qi_deprecated("no implementation")
-endfunction()
-
-function(install_cmake _subfolder)
-  qi_deprecated("no implementation")
+function(install_doc)
+  qi_deprecated("install_doc is deprecated.
+  Use qi_install_doc instead")
+  qi_install_doc(${ARGN})
+endfunction()
+
+function(install_conf)
+  qi_deprecated("install_conf is deprecated.
+  Use qi_install_conf instead")
+  qi_install_conf(${ARGN})
+endfunction()
+
+function(install_cmake)
+  qi_deprecated("install_cmake is deprecated.
+  Use qi_install_cmake instead")
+  qi_install_cmake(${ARGN})
 endfunction()

 ######################
 # Target
 ######################
-function(create_bin _name)
-  qi_deprecated("no implementation")
+function(create_bin)
+  qi_deprecated("create_bin is deprecated:
+    use qi_create_bin instead
+  ")
+  qi_create_bin(${ARGN})
 endfunction()

 function(create_script _name _namein)
-  qi_deprecated("no implementation")
-endfunction()
-
-function(create_lib _name)
-  qi_deprecated("no implementation")
+  qi_deprecated("create_script is deprecated:
+    use qi_create_script instead")
+  qi_create_script(${ARGN})
+endfunction()
+
+function(create_lib)
+  qi_deprecated("create_lib is deprecated:
+    use qi_create_lib instead")
+  qi_create_lib(${ARGN})
 endfunction()

 function(create_config_h _header _nameout)
-  qi_deprecated("unimplemented")
+  qi_deprecated("create_config_h is deprecated:
+    use qi_create_config_h instead")
+  qi_create_config_h(${ARGN})
 endfunction()

 function(create_gtest _name)
-  qi_deprecated("unimplemented")
+  qi_deprecated("create_gtest is deprecated:
+    use qi_create_gtest instead")
+  qi_create_gtest(${ARGN})
 endfunction()

 function(create_cmake _NAME)
-  qi_deprecated("unimplemented")
+  qi_deprecated("create_cmake is deprecated:
+    Simply put you cmake code in you_project/cmake/modules
+  ")
 endfunction()

 function(use _NAME)
-  qi_deprecated("unimplemented")
+  qi_deprecated("use is deprecated:
+    Use the regular include() function instead
+  ")
 endfunction()

 function(use_lib _name)
-  qi_deprecated("unimplemented")
+  qi_use_lib("use qi_use_lib instead.
+    Note that the names can be target names.
+
+    For instance, intead of:
+
+      create_lib(foo foo.cpp)
+
+      stage_lib(foo FOO)
+
+      use_lib(bar FOO)
+
+
+    you can do:
+      qi_create_lib(foo foo.cpp)
+
+      qi_stage_lib(foo)
+
+      qi_use_lib(bar foo)
+  ")
+  qi_use_lib(${ARGN})
+
 endfunction()

 ######################
 # Log
 ######################
 function(debug)
-  qi_deprecated()
+  qi_deprecated("debug is deprecated:
+    Use qi_debug instead:
+  ")
   qi_debug(${ARGN})
 endfunction()

 function(verbose)
-  qi_deprecated()
+  qi_deprecated("verbose is deprecated:
+    Use qi_verbose instead:
+  ")
   qi_verbose(${ARGN})
 endfunction()

 function(info)
-  qi_deprecated()
+  qi_deprecated("info is deprecated:
+    Use qi_info instead:
+  ")
   qi_info(${ARGN})
 endfunction()

 function(warning)
-  qi_deprecated()
+  qi_deprecated("warning is deprecated:
+    Use qi_warning instead:
+  ")
   qi_warning(${ARGN})
 endfunction()

 function(error)
-  qi_deprecated()
+  qi_deprecated("error is deprecated:
+    Use qi_error instead:
+  ")
   qi_error(${ARGN})
 endfunction()

@@ -103,7 +158,27 @@
 # stage
 #####################
 function(stage_lib _targetname _name)
-  qi_deprecated("unimplemented")
+  qi_deprecated("stage_lib is deprecated:
+    Use qi_stage_lib instead.
+
+    Warning the signature has changed:
+
+    Instead of:
+
+      create_lib(foo foo.cpp)
+
+      stage_lib(foo FOO)
+
+    Use:
+
+      qi_create_lib(foo foo.cpp)
+
+      # No need for upper-case \"stage name\"
+      # anymore:
+      qi_stage_lib(foo)
+
+  ")
+  qi_stage_lib(${_targetname} ${ARGN})
 endfunction()

 function(stage_script _file _name)
@@ -118,8 +193,12 @@
   qi_deprecated("unimplemented")
 endfunction()

-function(cond_subdirectory subdir)
-  qi_deprecated("unimplemented")
+function(cond_subdirectory)
+  qi_deprecated("cond_subdirectory is deprecated.
+  Use qi_add_subdirectory() instead.
+
+  ")
+  qi_add_subdirectory(${ARGN})
 endfunction()

 function(add_python_test _name _pythonFile)


link against boost by default + only link when needed

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@691 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -77,8 +77,16 @@
         set(_lib_type "STATIC")
     endif(PCL_SHARED_LIBS)
     add_library(${_name} ${_lib_type} ${ARGN})
-    #must link explicitly against boost.
+    # must link explicitly against boost.
     target_link_libraries(${_name} ${Boost_LIBRARIES})
+    #
+    # Only link if needed
+    if(UNIX)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS --as-needed)
+    elseif(WIN32)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
+    endif()
+    #
     set_target_properties(${_name} PROPERTIES
         VERSION ${PCL_VERSION}
         SOVERSION ${PCL_MAJOR_VERSION}
@@ -96,6 +104,16 @@
 # ARGN the source files for the library.
 macro(PCL_ADD_EXECUTABLE _name _component)
     add_executable(${_name} ${ARGN})
+    # must link explicitly against boost.
+    target_link_libraries(${_name} ${Boost_LIBRARIES})
+    #
+    # Only link if needed
+    if(UNIX)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS --as-needed)
+    elseif(WIN32)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
+    endif()
+    #
     set(PCL_EXECUTABLES ${PCL_EXECUTABLES} ${_name})
     install(TARGETS ${_name} RUNTIME DESTINATION ${BIN_INSTALL_DIR}
         COMPONENT ${_component})


no OPT:REF in debug msvc

no OPT:REF in debug msvc

In msvc Debug mode, OPT:REF is not compatible with incremental linking

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@918 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -82,8 +82,8 @@
     #
     # Only link if needed
     if(WIN32 AND MSVC)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
-		else()
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
+    else()
       SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
     #
@@ -110,8 +110,8 @@
     target_link_libraries(${_name} ${Boost_LIBRARIES})
     #
     # Only link if needed
-		if(WIN32 AND MSVC)
-      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS /OPT:REF)
+    if(WIN32 AND MSVC)
+      SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
     else()
       SET_TARGET_PROPERTIES(${_name} PROPERTIES LINK_FLAGS -Wl,--as-needed)
     endif()
@@ -144,7 +144,7 @@
       # GTest >= 1.5 requires pthread and CMake's 2.8.4 FindGTest is broken
       target_link_libraries(${_exename} pthread)
     elseif(WIN32)
-      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS /OPT:REF)
+      SET_TARGET_PROPERTIES(${_exename} PROPERTIES LINK_FLAGS_RELEASE /OPT:REF)
     endif()
     #
     PCL_LINK_OPENMP(${_exename})


Force include no longer needed

Force include no longer needed

--- Plugins/PluginTemplate.cmake
+++ Plugins/PluginTemplate.cmake
@@ -67,7 +67,7 @@
         "\ninclude_dirs:\n${target_include_dirs_}\n"
         "\nlib_dirs_debug:\n${link_dirs_debug}\n${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/Debug\n"
         "\nlib_dirs_release:\n${link_dirs_release}\n${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/RelWithDebInfo\n"
-        "\ncompile_options:\n-DPROJECT_BUILD_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"\n${WIN_DEFS}\n-DPLUGIN_NAME=${PROJECT_NAME}\n-include \"EagleLib/Detail/PluginExport.hpp\""
+        "\ncompile_options:\n-DPROJECT_BUILD_DIR=\"${CMAKE_CURRENT_BINARY_DIR}\"\n${WIN_DEFS}\n-DPLUGIN_NAME=${PROJECT_NAME}\n"
     )
 	set(outfile_ "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${PROJECT_NAME}_config.txt")


Workaround MSVC arm64 codegen bug

Workaround MSVC arm64 codegen bug

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -83,6 +83,16 @@
             # MSVC defines
             $<$<CXX_COMPILER_ID:MSVC>:_CRT_SECURE_NO_WARNINGS>)

+    # Work around compiler bug in MSVC when targeting arm64
+    # https://developercommunity.visualstudio.com/t/inlining-turns-constant-into-register-operand-for/1394798
+    # https://github.com/microsoft/vcpkg/pull/24869
+    if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+        if(CPU_ARCHITECTURE STREQUAL armv8 OR CPU_ARCHITECTURE STREQUAL arm64)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /d2ssa-cfg-sink-")
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /d2ssa-cfg-sink-")
+        endif()
+    endif()
+
     if(${DECOMPRESSOR})
         target_compile_definitions(${NAME}
             PRIVATE


Update Version.cmake

Update Version.cmake

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,2 +1,2 @@
 # This version number is loaded by the package and the project.
-SET( VERSION "0.12.0" )
+SET( VERSION "0.13.0" )


create different python based tests for single and multi configuration build generators

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -237,20 +237,32 @@
 # test/name.py.  It does nothing if Python is not installed.
 function(py_test name)
   if (PYTHONINTERP_FOUND)
-    # ${CMAKE_BINARY_DIR} is known at configuration time, so we can
-    # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
-    # only at ctest runtime (by calling ctest -c <Configuration>), so
-    # we have to escape $ to delay variable substitution here.
     if (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
-      add_test(
-        NAME ${name}
-        COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
-            --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>)
+      if (CMAKE_CONFIGURATION_TYPES)
+	# Multi-configuration build generators as for Visual Studio save
+	# output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug,
+	# Release etc.), so we have to provide it here.
+        add_test(
+          NAME ${name}
+          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
+              --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>)
+      else (CMAKE_CONFIGURATION_TYPES)
+	# Single-configuration build generators like Makefile generators
+	# don't have subdirs below CMAKE_CURRENT_BINARY_DIR.
+        add_test(
+          NAME ${name}
+          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
+              --build_dir=${CMAKE_CURRENT_BINARY_DIR})
+      endif (CMAKE_CONFIGURATION_TYPES)
     else (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
+      # ${CMAKE_CURRENT_BINARY_DIR} is known at configuration time, so we can
+      # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
+      # only at ctest runtime (by calling ctest -c <Configuration>), so
+      # we have to escape $ to delay variable substitution here.
       add_test(
         ${name}
         ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
           --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
     endif (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.1)
-  endif()
-endfunction()
+  endif(PYTHONINTERP_FOUND)
+endfunction()


Revert "Updating the gemmlowp hash and location for cmake build in master."

--- tensorflow/contrib/cmake/external/gemmlowp.cmake
+++ tensorflow/contrib/cmake/external/gemmlowp.cmake
@@ -14,8 +14,8 @@
 # ==============================================================================
 include (ExternalProject)

-set(gemmlowp_URL http://mirror.bazel.build/github.com/google/gemmlowp/archive/a6f29d8ac48d63293f845f2253eccbf86bc28321.tar.gz)
-set(gemmlowp_HASH SHA256=75d40ea8e68b0d1644f052fffe8f14a410b2a73d40ccb859a95c0578d194ec26)
+set(gemmlowp_URL http://github.com/google/gemmlowp/archive/010bb3e71a26ca1d0884a167081d092b43563996.tar.gz)
+set(gemmlowp_HASH SHA256=861cc6d9d902861f54fd77e1ab79286477dcc559b2a283e75b9c22d37b61f6ae)
 set(gemmlowp_BUILD ${CMAKE_CURRENT_BINARY_DIR}/gemmlowp/src/gemmlowp)
 set(gemmlowp_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/gemmlowp/src/gemmlowp)


Split off 5.6.0 branch

Split off 5.6.0 branch

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,10 +4,10 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 5 )

-set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 2 )
-set ( HPCC_MATURITY "release" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_MINOR 6 )
+set ( HPCC_POINT 0 )
+set ( HPCC_MATURITY "closedown" )
+set ( HPCC_SEQUENCE 0 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


CMake: Clean up version.cmake git checking

--- version.cmake
+++ version.cmake
@@ -8,21 +8,24 @@
 set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
 set(SUMMARY "${PROJECT_NAME} Game Boy Advance Emulator")

-execute_process(COMMAND git describe --always --abbrev=40 --dirty OUTPUT_VARIABLE GIT_COMMIT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND git describe --always --dirty OUTPUT_VARIABLE GIT_COMMIT_SHORT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND git symbolic-ref --short HEAD OUTPUT_VARIABLE GIT_BRANCH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND git rev-list HEAD --count OUTPUT_VARIABLE GIT_REV ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND git describe --tag --exact-match OUTPUT_VARIABLE GIT_TAG ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+find_program(GIT git)
+if(GIT AND NOT SKIP_GIT)
+	execute_process(COMMAND ${GIT} describe --always --abbrev=40 --dirty OUTPUT_VARIABLE GIT_COMMIT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+	execute_process(COMMAND ${GIT} describe --always --dirty OUTPUT_VARIABLE GIT_COMMIT_SHORT ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+	execute_process(COMMAND ${GIT} symbolic-ref --short HEAD OUTPUT_VARIABLE GIT_BRANCH ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+	execute_process(COMMAND ${GIT} rev-list HEAD --count OUTPUT_VARIABLE GIT_REV ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+	execute_process(COMMAND ${GIT} describe --tag --exact-match OUTPUT_VARIABLE GIT_TAG ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()

-if(GIT_REV STREQUAL "")
+if(NOT GIT_REV)
 	set(GIT_REV -1)
 endif()
-if(NOT GIT_TAG STREQUAL "")
+if(GIT_TAG)
 	set(VERSION_STRING ${GIT_TAG})
-elseif(GIT_BRANCH STREQUAL "")
+elseif(NOT GIT_BRANCH)
 	set(VERSION_STRING ${LIB_VERSION_STRING})
 else()
-	if(GIT_BRANCH STREQUAL "master")
+	if(GIT_BRANCH STREQUAL "master" OR NOT GIT_BRANCH)
 		set(VERSION_STRING ${GIT_REV}-${GIT_COMMIT_SHORT})
 	else()
 		set(VERSION_STRING ${GIT_BRANCH}-${GIT_REV}-${GIT_COMMIT_SHORT})


Split off 8.0.40

Split off 8.0.40

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 39 )
+set ( HPCC_POINT 41 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


improvement to FindPythonQt.cmake, adds a search suffix

--- cmake/FindPythonQt.cmake
+++ cmake/FindPythonQt.cmake
@@ -13,7 +13,7 @@
   set(_pythonqt_lib_dir "${PYTHONQT_DIR}/lib")
 endif()

-find_path(PYTHONQT_INCLUDE_DIR PythonQt.h HINTS ${_pythonqt_include_dir} DOC "Path to the PythonQt include directory")
+find_path(PYTHONQT_INCLUDE_DIR PythonQt.h HINTS ${_pythonqt_include_dir} PATH_SUFFIXES PythonQt DOC "Path to the PythonQt include directory")
 find_library(PYTHONQT_LIBRARY PythonQt HINTS ${_pythonqt_lib_dir} DOC "The PythonQt library")

 set(PYTHONQT_INCLUDE_DIRS ${PYTHONQT_INCLUDE_DIR})


support for odb-mysql in Findodb.cmake

support for odb-mysql in Findodb.cmake

--- cmake/find/Findodb.cmake
+++ cmake/find/Findodb.cmake
@@ -77,12 +77,18 @@
     list(APPEND _component_link_libraries "odb")
     string(COMPARE EQUAL "${_odb_component}" "sqlite" is_sqlite)
     string(COMPARE EQUAL "${_odb_component}" "pgsql" is_pgsql)
+    string(COMPARE EQUAL "${_odb_component}" "mysql" is_mysql)
     if(is_sqlite)
       find_package(SQLite3 REQUIRED)
       list(APPEND _component_link_libraries "SQLite3")
     elseif(is_pgsql)
       find_package(PostgreSQL REQUIRED)
       list(APPEND _component_link_libraries "PostgreSQL::libpq")
+    elseif(is_mysql)
+      find_package(MySQL-client REQUIRED)
+      list(APPEND _component_link_libraries "MySQL::client")
+    else()
+      message(FATAL_ERROR "unknown odb component: ${_odb_component}")
     endif()

     set_target_properties(


os.cmake MacOS build improvements

os.cmake MacOS build improvements

- Remove libgcc/compiler-rt detection as this is now provided by a conan
package
- Remove hardcoded reference to strip

Signed-off-by: Magnus Skjegstad <9f4ca770b638615ac5c3e0d2da16b77c80c2f2c6@skjegstad.com>

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -154,19 +154,6 @@
   set_target_properties(libpthread PROPERTIES LINKER_LANGUAGE C)
   set_target_properties(libpthread PROPERTIES IMPORTED_LOCATION "${INCLUDEOS_PREFIX}/${ARCH}/lib/libpthread.a")

-  # libgcc/compiler-rt detection
-  if (UNIX)
-    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-        set(TARGET_LINE --target=${TRIPLE})
-    endif()
-    execute_process(
-        COMMAND ${CMAKE_CXX_COMPILER} ${TARGET_LINE} --print-libgcc-file-name
-        RESULT_VARIABLE CC_RT_RES
-        OUTPUT_VARIABLE COMPILER_RT_FILE OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if (NOT ${CC_RT_RES} EQUAL 0)
-      message(AUTHOR_WARNING "Failed to detect libgcc/compiler-rt: ${COMPILER_RT_FILE}")
-    endif()
-  endif()
   if (NOT COMPILER_RT_FILE)
     set(COMPILER_RT_FILE "${INCLUDEOS_PREFIX}/${ARCH}/lib/libcompiler.a")
   endif()
@@ -299,7 +286,7 @@
   if (CMAKE_BUILD_TYPE MATCHES DEBUG)
     set(STRIP_LV )
   else()
-    set(STRIP_LV strip --strip-all ${CMAKE_CURRENT_BINARY_DIR}/${TARGET})
+    set(STRIP_LV ${CMAKE_STRIP} --strip-all ${CMAKE_CURRENT_BINARY_DIR}/${TARGET})
   endif()
   FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/binary.txt
     "${TARGET}"


Reenable a warning in Common.cmake

Reenable a warning in Common.cmake

--- Common.cmake
+++ Common.cmake
@@ -62,7 +62,7 @@
   if(GCC_COMPILER_VERSION VERSION_LESS 4.1)
     message(ERROR "GCC 4.1 or later required, found ${GCC_COMPILER_VERSION}")
   endif()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Wshadow -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter -Wno-write-strings")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Wshadow -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wuninitialized")
   set(CMAKE_CXX_FLAGS_DEBUG
     "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")


Makefile is modified to support Altera AOC compilation

--- tests/Makefile.cmake
+++ tests/Makefile.cmake
@@ -8,7 +8,7 @@
                   -I`@LLVM_CONFIG_EXECUTABLE@ --includedir` \
                   -I`@LLVM_CONFIG_EXECUTABLE@ --includedir`/c++/v1 \
                   -I$(HIPACC_DIR)/include/dsl
-TEST_CASE      ?= ./tests/opencv_blur_8uc1
+TEST_CASE      ?= ./tests/mean_filter
 MYFLAGS        ?= -DWIDTH=2048 -DHEIGHT=2048 -DSIZE_X=5 -DSIZE_Y=5
 NVCC_FLAGS      = -gencode=arch=compute_$(GPU_ARCH),code=\"sm_$(GPU_ARCH),compute_$(GPU_ARCH)\" \
                   -Xptxas -v #-keep
@@ -21,6 +21,7 @@
 CL_LINK         = $(CC_LINK) @OPENCL_LFLAGS@
 CU_LINK         = $(CC_LINK) @CUDA_LINK@
 ALTERA_RUN      = LD_LIBRARY_PATH=$$LD_LIBRARAY_PATH$$(aocl link-config | sed 's/\ /\n/g' | grep "^\-L" | sed 's/-L/:/g' | tr -d '\n')
+ALTERA_CXX     := arm-linux-gnueabihf-g++

 # Source-to-source compiler configuration
@@ -104,13 +105,19 @@
 	@echo 'Executing Hipacc Compiler for OpenCL:'
 	$(COMPILER) $(TEST_CASE)/main.cpp $(MYFLAGS) $(COMPILER_INC) -emit-$@ $(HIPACC_OPTS) -o main.cc

-altera: opencl-fpga
-	@echo 'Generate aocx for Altera'
-	aoc -march=emulator *.cl
-	@echo 'Compiling Host file for Altera Emulation'
-	g++ -DALTERACL -std=c++11 -fPIC -I$(HIPACC_DIR)/include $(shell aocl compile-config) -Wl,--no-as-needed $(shell aocl link-config) -lstdc++ -static-libstdc++ -o main_altera main.cc
+altera-emulate: opencl-fpga
+	@echo 'Compiling Host Code for Altera Emulation'
+	g++ -DALTERACL -std=c++11 -fPIC -I$(HIPACC_DIR)/include $(shell aocl compile-config) -Wl,--no-as-needed $(shell aocl link-config) -lstdc++ -static-libstdc++ -o main_altera_em main.cc
+	echo 'Generate aocx for Altera Emulation'
+	aoc -v -march=emulator *.cl
 	@echo 'Emulate Generated Binaries'
-	CL_CONTEXT_EMULATOR_DEVICE_ALTERA=s5_ref $(ALTERA_RUN) ./main_altera
+	CL_CONTEXT_EMULATOR_DEVICE_ALTERA=s5_ref $(ALTERA_RUN) ./main_altera_em
+
+altera-compile: opencl-fpga
+	@echo 'Compiling Host Code for Target Architecture'
+	$(ECHO)$(ALTERA_CXX)  -DALTERACL -std=c++11 -fPIC -I$(HIPACC_DIR)/include $(shell aocl compile-config) main.cc $(shell aocl link-config) -static-libstdc++ -o ./main_altera_syn
+	@echo 'Generate aocx for Target Altera Device'
+	aoc -v --report *.cl

 filterscript renderscript:
 	rm -f *.rs *.fs
@@ -132,6 +139,6 @@
 	adb shell /data/local/tmp/main_$@

 clean:
-	rm -f main_* *.cu *.cc *.cubin *.cl *.isa *.rs *.fs
-	rm -rf build_*
+	rm -f main_* *.cu *.cc *.cubin *.cl *.isa *.rs *.fs *.aoco *.aocx
+	rm -rf build_* bin_*


[cmake] [compiler-rt] Call llvm_setup_rpath() when adding shared libraries.

Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.

Differential Revision: https://reviews.llvm.org/D42462

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@323606 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -247,6 +247,9 @@
       target_link_libraries(${libname} ${LIB_LINK_LIBS})
     endif()
     if(${type} STREQUAL "SHARED")
+      if(COMMAND llvm_setup_rpath)
+        llvm_setup_rpath(${libname})
+      endif()
       if(WIN32 AND NOT CYGWIN AND NOT MINGW)
         set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "")
         set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib")


BUG:cache GLX_USES_MACRO_GLX_GLXEXT_LEGACY.

--- CMake/vtkTestGLX.cmake
+++ CMake/vtkTestGLX.cmake
@@ -198,9 +198,9 @@
 unset(GLX_GLXEXT_LEGACY_OCCURENCE)
 file(STRINGS ${glx_h_full_path} GLX_GLXEXT_LEGACY_OCCURENCE REGEX GLX_GLXEXT_LEGACY)
 if(GLX_GLXEXT_LEGACY_OCCURENCE)
- set(GLX_USES_MACRO_GLX_GLXEXT_LEGACY TRUE)
+ set(GLX_USES_MACRO_GLX_GLXEXT_LEGACY TRUE CACHE INTERNAL "")
 else(GLX_GLXEXT_LEGACY_OCCURENCE)
- set(GLX_USES_MACRO_GLX_GLXEXT_LEGACY FALSE)
+ set(GLX_USES_MACRO_GLX_GLXEXT_LEGACY FALSE CACHE INTERNAL "")
 endif(GLX_GLXEXT_LEGACY_OCCURENCE)


update

update

--- cmake/SetupProjectVariables.cmake
+++ cmake/SetupProjectVariables.cmake
@@ -39,7 +39,7 @@
   SET(GLM_INCLUDE_DIR "~/Projects/others/glm-regnirpsj-git")

   # GLI
-  SET(GLI_INCLUDE_DIR "~/Projects/others/gli-regnirpsj-git")
+  SET(GLI_INCLUDE_DIR "~/Projects/others/gli-git")

   # OGL+
   SET(OGLplus_ROOT_DIR "~/Projects/others/oglplus-develop-git/_install")


root_generate_dictionary: filter out only CMake keywords

Without using '^' and '$', the regular expression also
matches things that contain the keywords, like FILESYSTEM.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -166,8 +166,8 @@

   set(include_dirs -I${CMAKE_CURRENT_SOURCE_DIR})
   get_directory_property(incdirs INCLUDE_DIRECTORIES)
-  foreach( d ${incdirs})
-    if(NOT "${d}" MATCHES "AFTER|BEFORE|INTERFACE|PRIVATE|PUBLIC|SYSTEM")
+  foreach(d ${incdirs})
+    if(NOT "${d}" MATCHES "^(AFTER|BEFORE|INTERFACE|PRIVATE|PUBLIC|SYSTEM)$")
       set(include_dirs ${include_dirs} -I${d})
     endif()
   endforeach()


Export tools to the build tree as well

Export tools to the build tree as well

--- cmake/targets.cmake
+++ cmake/targets.cmake
@@ -76,9 +76,11 @@
       runtime)
   endif ()

+  vistk_export(${name})
+
   vistk_install(
     TARGETS     ${name}
-    EXPORT      vistk_exports
+    ${exports}
     DESTINATION bin
     COMPONENT   ${component})
 endfunction ()


Fix nodejslib path on windows

Fix nodejslib path on windows

--- src/nodejslib/nodejslib.cmake
+++ src/nodejslib/nodejslib.cmake
@@ -6,6 +6,8 @@

 if (APPLE)
 	set(INSTALL_PATH  "nodejslib/opencamlib.darwin.node")
+elseif(WIN32)
+	set(INSTALL_PATH  "nodejslib/opencamlib.windows.node")
 else()
 	set(INSTALL_PATH  "nodejslib/opencamlib.linux.node")
 endif()


Added pattern to include hpp files in make install.

--- functions.cmake
+++ functions.cmake
@@ -205,7 +205,7 @@
     if (${SECOND_ELEMENT} STREQUAL "vespa" AND ${THIRD_ELEMENT} STREQUAL "src")
         # Preserve the name */src/vespa/<name> as not every module has <name>=module name (e.g. vespalog)
         get_filename_component(RELATIVE_TO ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
-        file(GLOB_RECURSE HEADERS RELATIVE ${RELATIVE_TO} "*.h")
+        file(GLOB_RECURSE HEADERS RELATIVE ${RELATIVE_TO} "*.h" "*.hpp")
         foreach(HEADER ${HEADERS})
             get_filename_component(RELDIR ${HEADER} DIRECTORY)
             install(FILES ${RELATIVE_TO}/${HEADER} DESTINATION include/vespa/${RELDIR})


Only create symlinks if directory exists.

--- functions.cmake
+++ functions.cmake
@@ -551,7 +551,7 @@

 function(install_java_artifact_dependencies NAME)
     install(DIRECTORY "target/dependency/" DESTINATION lib/jars/${NAME} FILES_MATCHING PATTERN "*.jar")
-    install(CODE "execute_process(COMMAND bash -c \"cd \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/lib/jars && ln -sf ${NAME}/*.jar .\")")
+    install(CODE "execute_process(COMMAND bash -c \"cd \$ENV{DESTDIR}/${CMAKE_INSTALL_PREFIX}/lib/jars && if [ -d ${NAME} ]; then ln -sf ${NAME}/*.jar . ; fi\")")
 endfunction()

 function(install_fat_java_artifact NAME)


New version: 0.4.16

New version: 0.4.16

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "15")
+SET(HAWKEY_PATCH "16")


ASAN: Do not explicitly link ASAN library on macOS

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -122,8 +122,6 @@
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer")
 	if (UNIX AND NOT APPLE)
 		set (ASAN_LIBRARY "-lubsan") # this is needed for GIR to put asan in front
-	else (UNIX AND NOT APPLE)
-		set (ASAN_LIBRARY "-lasan") # this is needed for GIR to put asan in front
 	endif (UNIX AND NOT APPLE)

 	if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")


update for kepler arch support

update for kepler arch support

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -13,7 +13,7 @@

   message(STATUS "CUDA detected: " ${CUDA_VERSION})

-  set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0)" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
+  set(CUDA_ARCH_BIN "1.1 1.2 1.3 2.0 2.1(2.0) 3.0" CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
   set(CUDA_ARCH_PTX "2.0" CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")

   string(REGEX REPLACE "\\." "" ARCH_BIN_NO_POINTS "${CUDA_ARCH_BIN}")


Loosen warning level for comments and strict aliasing because of glm

--- cmake/PlatformLinuxGCC.cmake
+++ cmake/PlatformLinuxGCC.cmake
@@ -47,6 +47,8 @@
       -Wcast-qual
       -Wcast-align
       -Wconversion
+      -Wno-error=comment
+      -Wno-error=strict-aliasing

       -Wno-error=float-equal
       -Wno-error=conversion


fix installation of variant replacement

fix installation of variant replacement

--- cmake/external/variant.cmake
+++ cmake/external/variant.cmake
@@ -13,4 +13,4 @@
 		INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VARIANT_SOURCE_DIR}/${VARIANT_RELEASE_VERSION}/variant.hpp ${VARIANT_INCLUDE_DIR}/variant.hpp
 )

-LIST(APPEND SHOGUN_DEPENDS variant)
+add_dependencies(libshogun variant)


build: pass `/GR-` when using cl-like drivers

When building with clang-cl, we should pass /GR- rather than the
gcc-style driver options.  This repairs the build of swift on Windows.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -265,7 +265,9 @@
     # Emulate /GR-.
     # TODO(compnerd) when moving up to VS 2017 15.3 and newer, we can disable
     # RTTI again
-    if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+    if(SWIFT_COMPILER_IS_MSVC_LIKE)
+      list(APPEND result /GR-)
+    else()
       list(APPEND result -frtti)
       list(APPEND result -Xclang;-fno-rtti-data)
     endif()


build: cleanup unneeded flags for Windows

This flag is now handled by the driver, so remove it from the special
handling in the build system.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1849,12 +1849,6 @@
         set(swiftlib_swift_compile_private_frameworks_flag "-Fsystem" "${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/System/Library/PrivateFrameworks/")
       endif()

-      if("${sdk}" STREQUAL WINDOWS)
-        if(arch STREQUAL x86_64)
-          set(swiftlib_swift_compile_flags_arch -Xcc -D_AMD64_)
-        endif()
-      endif()
-
       # Add this library variant.
       _add_swift_library_single(
         ${VARIANT_NAME}


cmake: Remove setting CMAKE_FIND_ROOT_PATH_MODE_* variables

These variables affect how CMake locates programs, libraries, include
files, and CMake packages. But the defaults are sufficient for Zephyr.

NEVER: Only host system's root will be searched.
ONLY: Only the paths specified by a variable will be searched. Typically
      these paths point to cross-compilers.

Signed-off-by: Mark Ruvald Pedersen <3c05dc905675c0722f67ee578faf639727313efa@oticon.com>

--- cmake/target_toolchain.cmake
+++ cmake/target_toolchain.cmake
@@ -2,11 +2,6 @@
 set(CMAKE_SYSTEM_PROCESSOR ${ARCH})

 set(BUILD_SHARED_LIBS OFF)
-
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

 if(NOT (COMPILER STREQUAL "host-gcc"))
   include(${TOOLCHAIN_ROOT}/cmake/toolchain/${ZEPHYR_TOOLCHAIN_VARIANT}/target.cmake)


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -209,6 +209,9 @@
                      " -Wno-c++98-compat"
                      " -Wno-shorten-64-to-32"
                      " -Wno-c++98-compat-pedantic"
+                     " -Wno-used-but-marked-unused" # : boost unit tests. should be reinabled and sorted out.
+                     " -Wno-newline-eof" # : end of line newline. should be reinabled and so.
+                     " -Wno-return-std-move-in-c++11" # :
                      )
              string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
              #endif ()


Set proper include dir for GLEW

Set proper include dir for GLEW

--- CMakeModules/KlamptDependencies.cmake
+++ CMakeModules/KlamptDependencies.cmake
@@ -32,7 +32,7 @@
   ENDIF()

   SET(OPENGL_LIBRARY_DIR ${KLAMPT_DEPENDENCY_LIB_DIR})  #this is needed for glut32.lib / glui32.lib to be found in Cpp/Dependencies
-  SET(GLEW_INCLUDE_DIR "${KLAMPT_DEPENDENCIES}/glew-2.0.0")
+  SET(GLEW_INCLUDE_DIR "${KLAMPT_DEPENDENCIES}/glew-2.0.0/include")
   SET(GLEW_LIBRARY "${KLAMPT_DEPENDENCY_LIB_DIR}/glew32.lib")

   SET(CURL_INCLUDE_DIR "${KLAMPT_DEPENDENCIES}/curl-7.64.1/include")


modules: minor cleanup.

modules: minor cleanup.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -530,10 +530,9 @@
                     INTERFACE_INCLUDE_DIRECTORIES ${X11_INCLUDE_DIR})
                 set_property(TARGET Magnum::${_component} APPEND PROPERTY
                     INTERFACE_LINK_LIBRARIES ${X11_LIBRARIES})
-            endif()

             # EGL context dependencies
-            if(_component STREQUAL EglContext)
+            elseif(_component STREQUAL EglContext)
                 find_package(EGL)
                 set_property(TARGET Magnum::${_component} APPEND PROPERTY
                     INTERFACE_LINK_LIBRARIES EGL::EGL)


Update hunter gate

Update hunter gate

--- HunterGate.cmake
+++ HunterGate.cmake
@@ -15,7 +15,7 @@
 cmake_minimum_required(VERSION 2.8.10)

 set(HUNTER_MINIMUM_VERSION "0.4.0")
-set(HUNTER_MINIMUM_VERSION_HASH 0c11dc7ad4ec7ebbb5d62ae697cecdca81d2b85d)
+set(HUNTER_MINIMUM_VERSION_HASH 29a971c88703849a768da0c8aa56405f44208389)

 # Set HUNTER_ROOT cmake variable to suitable value.
 # Info about variable can be found in HUNTER_ROOT_INFO.


Link with double tap library.

Link with double tap library.

--- src/omv/ports/rp2/omv_portconfig.cmake
+++ src/omv/ports/rp2/omv_portconfig.cmake
@@ -33,6 +33,10 @@
 target_compile_definitions(${MICROPY_TARGET} PRIVATE
     ARM_MATH_CM0PLUS
     ${OMV_BOARD_MODULES_DEFINITIONS}
+)
+
+target_link_libraries(${MICROPY_TARGET}
+    pico_bootsel_via_double_reset
 )

 # Linker script


Add dCache rw functional tests

Add dCache rw functional tests

--- test/functional/ctest_functional.cmake
+++ test/functional/ctest_functional.cmake
@@ -6,30 +6,32 @@
 set(BASIC_LOGIN "test")
 set(BASIC_PASSWD "tester")

-set(http_dcache "http://sligo.desy.de:2880/pnfs/desy.de/data/dteam/davix-tests/" CACHE STRING "dCache test instance to use")
+set(http_dcache "http://sligo.desy.de:2880/pnfs/desy.de/data/dteam/davix-tests/" CACHE STRING "dCache test instance to use (read-only)")

-set(https_dpm "https://dpmhead-trunk.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use")
+set(https_dpm "https://dpmhead-trunk.cern.ch/dpm/cern.ch/home/dteam/davix-tests/" CACHE STRING "DPM test instance to use")
 set(https_dpm_file "${https_dpm}/davix-tests/testread0011")
-set(dav_dpm "davs://dpmhead-trunk.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use throught WebDAV protocol")
+set(dav_dpm "davs://dpmhead-trunk.cern.ch/dpm/cern.ch/home/dteam/davix-tests/" CACHE STRING "DPM test instance to use throught WebDAV protocol")
+
+set(https_dcache "https://prometheus.desy.de/VOs/dteam/" CACHE STRING "dCache test instance to use")

 set(http_dynaFed_base "http://federation.desy.de/fed/dynafeds_demo/everywhere/")
 set(http_dynaFed_file "${http_dynaFed_base}/file_1005.txt")
-
-# set(http_desy_base "http://sligo.desy.de:2880/pnfs/desy.de/data/dteam/davix-tests/" CACHE STRING "dCache test instance to use")
-# set(http_desy_mv "http://sligo.desy.de:2880/pnfs/desy.de/data/dteam/" CACHE STRING "dCache test instance to use for rename")
-# set(http_lcgdm_base "https://lxfsra04a04.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use" )
-# set(dav_lcgdm_base "davs://lxfsra04a04.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use, Webdav protocol" )
-#set(http_lcgdm_base "https://lxfsra10a01.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use" )
-
-#set(http_storm_base "https://gridhttps-storm-atlas.cr.cnaf.infn.it:8443/webdav/dteam/davix-tests/" CACHE STRING "Storm test instance to use")

 # set(metalink_url "http://download.documentfoundation.org/libreoffice/stable/4.3.4/deb/x86_64/LibreOffice_4.3.4_Linux_x86-64_deb.tar.gz")
 # set(metalink3_url "http://download.documentfoundation.org/libreoffice/stable/4.3.4/deb/x86_64/LibreOffice_4.3.4_Linux_x86-64_deb_helppack_en-US.tar.gz.metalink")
 # set(metalink_url_direct "http://download.documentfoundation.org/libreoffice/stable/4.3.4/deb/x86_64/LibreOffice_4.3.4_Linux_x86-64_deb_helppack_en-US.tar.gz.meta4")

+# dCache read-only
+test_dav_endpoint_ronly( "${http_dcache}" "proxy")
+
 # dCache tests
-test_dav_endpoint_ronly( "${http_dcache}" "proxy")
+test_valid_write_read_generic("${https_dcache}" "proxy")
+test_rename("${https_dcache}" "proxy")
+test_dav_endpoint_rw( "${https_dcache}" "proxy")
+# test_valid_delete_all("${https_dcache}"  "proxy")
+test_valid_read_generic("${https_dcache}" "proxy")
+test_valid_write_read_generic("${https_dcache}" "proxy")

 # DPM tests


qi_create_service: Add proxy header to includes if generated.

Change-Id: I8ae07290458ead8ffcbb50ec5c76ecd3976b5bb2
Reviewed-on: http://gerrit.aldebaran.lan:8080/17152
Reviewed-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>
Tested-by: mnottale <e3ccf1b6558404e921a21fa09cebb1153b50ec36@aldebaran-robotics.com>

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -160,6 +160,8 @@
         -o ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp
     )
     list(APPEND ARG_SRC ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp)
+    set(service_includes "${service_includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp")
+    set(includes "${includes},${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp")
   endif()
   # Generate binder
   # Build command argument from classes and modules


Add Karabiner-DriverKit-VirtualHIDDevice/include to header search path

--- src/common.cmake
+++ src/common.cmake
@@ -6,6 +6,7 @@

 include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/vendor)
 include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/vendor/cget/include)
+include_directories(SYSTEM ${CMAKE_CURRENT_LIST_DIR}/vendor/Karabiner-DriverKit-VirtualHIDDevice/include)
 include_directories(${CMAKE_CURRENT_LIST_DIR}/share)

 add_compile_options(-Wall)


Update default STIR tag

Update default STIR tag

--- version_config.cmake
+++ version_config.cmake
@@ -142,7 +142,7 @@

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )
-  set(DEFAULT_STIR_TAG fd3a7576a11930856d6af50d217f17d4848c2bff)
+  set(DEFAULT_STIR_TAG 3a277f7a819f35a553a8d6097402ea25cf55a240)

   ## siemens_to_ismrmrd
   set(DEFAULT_siemens_to_ismrmrd_URL https://github.com/ismrmrd/siemens_to_ismrmrd)


Fix FindPROX.cmake to use new paths.

Fix FindPROX.cmake to use new paths.

--- build/modules/FindPROX.cmake
+++ build/modules/FindPROX.cmake
@@ -40,12 +40,12 @@

 # Look for the protocol buffers headers, first in the additional location and then in default system locations
 IF(PROX_ROOT)
-FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/QueryHandler.hpp PATHS ${PROX_ROOT}/libprox/include/ ${PROX_ROOT}/include ${TOP_LEVEL}/externals/include ${TOP_LEVEL}/externals/prox/libprox/include/ ${TOP_LEVEL}/externals/include/ DOC "Location of PROX header files" NO_DEFAULT_PATH)
+FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/base/QueryCache.hpp PATHS ${PROX_ROOT}/libprox/include/ ${PROX_ROOT}/include ${TOP_LEVEL}/externals/include ${TOP_LEVEL}/externals/prox/libprox/include/ ${TOP_LEVEL}/externals/include/ DOC "Location of PROX header files" NO_DEFAULT_PATH)
 ELSE()
-FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/QueryHandler.hpp PATHS ${TOP_LEVEL}/externals/include ${TOP_LEVEL}/externals/prox/libprox/include/ ${TOP_LEVEL}/externals/include/ DOC "Location of PROX header files" NO_DEFAULT_PATH)
+FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/base/QueryCache.hpp PATHS ${TOP_LEVEL}/externals/include ${TOP_LEVEL}/externals/prox/libprox/include/ ${TOP_LEVEL}/externals/include/ DOC "Location of PROX header files" NO_DEFAULT_PATH)
 ENDIF()
 IF(NOT PROX_INCLUDE_DIRS)
-    FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/QueryHandler.hpp DOC "Location of antlr header files")
+    FIND_PATH(PROX_INCLUDE_DIRS NAMES prox/base/QueryCache.hpp DOC "Location of PROX header files")
 ENDIF()

 SET(PROX_FOUND FALSE)
@@ -61,24 +61,6 @@
         # Destroy trailing "/include" in the path.
         GET_FILENAME_COMPONENT(PROX_ROOT_DIRS ${PROX_ROOT_DIRS} PATH)
     ENDIF()
-    SET(PROX_LIBRARY_DIRS ${PROX_ROOT_DIRS})
-    IF(EXISTS ${PROX_LIBRARY_DIRS}/src)
-        SET(PROX_LIBRARY_DIRS ${PROX_LIBRARY_DIRS}/src)
-    ENDIF()
-    IF(PROX_LIBRARY_DIRS)
-        SET(PROX_SOURCE_FILES
-         ${PROX_LIBRARY_DIRS}/ArcAngle.cpp
-         ${PROX_LIBRARY_DIRS}/BruteForceQueryHandler.cpp
-         ${PROX_LIBRARY_DIRS}/Duration.cpp
-         ${PROX_LIBRARY_DIRS}/Object.cpp
-         ${PROX_LIBRARY_DIRS}/Quaternion.cpp
-         ${PROX_LIBRARY_DIRS}/QueryCache.cpp
-         ${PROX_LIBRARY_DIRS}/Query.cpp
-         ${PROX_LIBRARY_DIRS}/RTreeQueryHandler.cpp
-         ${PROX_LIBRARY_DIRS}/SolidAngle.cpp
-         ${PROX_LIBRARY_DIRS}/Time.cpp)
-        SET(PROX_FOUND TRUE)
-    ENDIF()
 ENDIF()

 IF(PROX_FOUND)


ENH: Custom build name with SoftwareGuide CircleCI build

--- Docker/itksoftwareguide-dashboard/dashboard.cmake
+++ Docker/itksoftwareguide-dashboard/dashboard.cmake
@@ -8,7 +8,13 @@

 # Build identification.
 set(CTEST_SITE "$ENV{HOSTNAME}.docker")
-set(CTEST_BUILD_NAME "Linux GCC Software Guide")
+if("$ENV{CIRCLE_PROJECT_REPONAME}")
+  set(sha "$ENV{CIRCLE_SHA1}")
+  string(SUBSTRING "${sha}" 0 7 short_sha)
+  set(CTEST_BUILD_NAME "Software Guide CircleCI build $ENV{CIRCLE_BUILD_NUM} for ${short_sha}")
+else()
+  set(CTEST_BUILD_NAME "Linux GCC Software Guide")
+endif()
 set(CTEST_BUILD_CONFIGURATION MinSizeRel)
 set(CTEST_CMAKE_GENERATOR "Ninja")

@@ -41,7 +47,11 @@
 ITK_GIT_TAG:STRING=nightly-master
 ")

-ctest_start(Nightly)
+if("$ENV{CIRCLE_PROJECT_REPONAME}")
+  ctest_start(Experimental)
+else()
+  ctest_start(Nightly)
+endif()
 ctest_update()
 ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" SOURCE "${CTEST_SOURCE_DIRECTORY}")
 ctest_submit(PARTS Update Notes Configure)