Update Android toolchain from https://github.com/taka-no-me/android-cmake to support NDK r10c.

--- Source/CMake/Toolchains/android.toolchain.cmake
+++ Source/CMake/Toolchains/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-r10c
 #  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,119 +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
-#   - April 2014
-#     [+] updated for NDK r9d
 # ------------------------------------------------------------------------------

 # Modified by Lasse Oorni and Yao Wei Tjong for Urho3D
@@ -321,24 +224,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." )

-# Urho3D: updated for NDK r10
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10 -r9d -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} -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 )
@@ -352,14 +262,22 @@
  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
 # Urho3D: default to API 12
 set( ANDROID_DEFAULT_NDK_API_LEVEL 12 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 12 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_arm64 21 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 12)
+set( ANDROID_DEFAULT_NDK_API_LEVEL_x86_64 21 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 12 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_mips64 21 )

 macro( __LIST_FILTER listvar regex )
@@ -435,7 +353,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." )
@@ -547,12 +465,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
@@ -633,12 +554,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 )
@@ -654,24 +581,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()
@@ -747,28 +694,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
@@ -777,14 +741,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 )
@@ -792,7 +754,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 )
@@ -826,7 +787,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()
@@ -837,7 +798,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 )
@@ -866,15 +827,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()
@@ -886,7 +848,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 )
@@ -903,8 +865,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()

@@ -1046,7 +1008,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()
@@ -1079,7 +1041,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 )
@@ -1087,12 +1049,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 )
@@ -1218,7 +1180,11 @@
  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 )
@@ -1226,7 +1192,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 )
@@ -1267,7 +1233,14 @@
 endif()

 # NDK flags
-if( ARMEABI OR ARMEABI_V7A )
+if (ARM64_V8A )
+ set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fpic -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} -fpic -funwind-tables" )
  if( NOT ANDROID_FORCE_ARM_BUILD AND NOT ARMEABI_V6 )
   set( ANDROID_CXX_FLAGS_RELEASE "-mthumb -fomit-frame-pointer -fno-strict-aliasing" )
@@ -1283,7 +1256,7 @@
    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" )
@@ -1292,7 +1265,7 @@
  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 )
+elseif( MIPS OR MIPS64 )
  set( ANDROID_CXX_FLAGS         "${ANDROID_CXX_FLAGS} -fpic -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" )
@@ -1371,7 +1344,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 )
@@ -1387,7 +1360,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 )
@@ -1422,9 +1395,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
@@ -1448,13 +1421,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()
@@ -1571,7 +1538,7 @@
  set( ANDROID_LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" FORCE )
 endif()

-# copy shared stl library to build directory
+# copy shaed stl library to build directory
 if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" )
  get_filename_component( __libstlname "${__libstl}" NAME )
  execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
@@ -1715,8 +1682,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
@@ -1749,17 +1716,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, r9d, r10; 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 r10c; 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
@@ -1767,7 +1738,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"
@@ -1778,7 +1750,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:


[ox] Fix OxConfig to include Model library

--- deps/ox/OxConfig.cmake
+++ deps/ox/OxConfig.cmake
@@ -3,10 +3,13 @@
 	set(OxStd_LIBRARY /usr/local/lib/ox/libOxStd.a)
 	set(OxFS_LIBRARY /usr/local/lib/ox/libOxFS.a)
 	set(OxClArgs_LIBRARY /usr/local/lib/ox/libOxClArgs.a)
-	set(OxMetalClaw /usr/local/lib/ox/libOxMetalClaw.a)
+	set(OxMetalClaw_LIBRARY /usr/local/lib/ox/libOxMetalClaw.a)
+	set(OxModel_LIBRARY /usr/local/lib/ox/libOxModelClaw.a)
 else("${CMAKE_FIND_ROOT_PATH}" STREQUAL "")
 	set(Ox_INCLUDE_DIRS ${CMAKE_FIND_ROOT_PATH}/include/)
 	set(OxStd_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxStd.a)
 	set(OxFS_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxFS.a)
-	set(OxMetalClaw ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxMetalClaw.a)
+	set(OxClArgs_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxClArgs.a)
+	set(OxMetalClaw_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxMetalClaw.a)
+	set(OxModel_LIBRARY ${CMAKE_FIND_ROOT_PATH}/lib/ox/libOxModel.a)
 endif("${CMAKE_FIND_ROOT_PATH}" STREQUAL "")


Augment the cacheappend parameter to append to any prior such parameter.

SVN-Revision: 2770

--- make/package.cmake
+++ make/package.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2011 Google, Inc.    All rights reserved.
+# Copyright (c) 2011-2014 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -71,7 +71,9 @@
     string(REGEX REPLACE "^outdir=" "" arg_outdir "${arg}")
   endif ()
   if (${arg} MATCHES "^cacheappend=")
-    string(REGEX REPLACE "^cacheappend=" "" arg_cacheappend "${arg}")
+    # support multiple, appending each time
+    string(REGEX REPLACE "^cacheappend=" "" entry "${arg}")
+    set(arg_cacheappend "${arg_cacheappend}\n${entry}")
   endif ()
   if (${arg} MATCHES "^no64")
     set(arg_no64 ON)


Update UseBoost.cmake

Update UseBoost.cmake

--- Superbuild/UseBoost.cmake
+++ Superbuild/UseBoost.cmake
@@ -50,7 +50,7 @@
     else() # non-python libraries
       if(WIN32)
         set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
-        set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}$-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
+        set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}-x64${CMAKE_STATIC_LIBRARY_SUFFIX}")
       else()
         set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
         set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")


Minor stylistic change.

Minor stylistic change.

--- toolchains/android/x86_64.abi.cmake
+++ toolchains/android/x86_64.abi.cmake
@@ -14,4 +14,4 @@
 set( ANDROID_GCC_MACHINE_NAME "x86_64-linux-android" )
 set( TNUN_cpu_archs           "x86_64"               )

-add_compile_options( -m64 -march=atom -msse4.2 -mpopcnt ) # assume Silvermont arch
+add_compile_options( -m64 -march=atom -msse4.2 -mpopcnt ) # assume Silvermont arch


TestBuild.cmake

TestBuild.cmake

  Some comments on the necessity of CTEST_CVS_COMMAND.  We'll see if this change
  is picked up on tomorrow's nightly build.

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3787 3d70eeeb-363e-0410-a505-8a46323a89f2

--- TestBuild.cmake
+++ TestBuild.cmake
@@ -7,6 +7,9 @@
 SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)

 SET (CTEST_CMAKE_COMMAND "cmake")
+# NOTE(bigler): This command isn't defined for some tests that I've seen, so it
+# may not be necessary.  Also, I'm not sure how this is dealt with on windows
+# where it should be using TortoiseSVN.
 SET (CTEST_CVS_COMMAND "svn")

 # A smoke test only builds the code and doesn't run any tests, so we


ENH: Added dcmnet library and include directory to the DCMTK libraries found.

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -97,6 +97,26 @@
   NO_DEFAULT_PATH
 )

+FIND_PATH( DCMTK_dcmnet_INCLUDE_DIR dimse.h
+  PATHS
+    ${DCMTK_DIR}/include/dcmnet
+    ${DCMTK_DIR}/include/dcmtk/dcmnet
+    ${DCMTK_DIR}/dcmnet
+    ${DCMTK_DIR}/dcmnet/include
+  NO_DEFAULT_PATH
+)
+
+FIND_LIBRARY( DCMTK_dcmnet_LIBRARY dcmnet
+  PATHS
+    ${DCMTK_DIR}/dcmnet/libsrc
+    ${DCMTK_DIR}/dcmnet/libsrc/Release
+    ${DCMTK_DIR}/dcmnet/libsrc/Debug
+    ${DCMTK_DIR}/dcmnet/Release
+    ${DCMTK_DIR}/dcmnet/Debug
+    ${DCMTK_DIR}/lib
+  NO_DEFAULT_PATH
+)
+
 FIND_PATH( DCMTK_dcmimgle_INCLUDE_DIR dcmimage.h
   PATHS
     ${DCMTK_DIR}/dcmimgle/include
@@ -123,14 +143,6 @@
     ${DCMTK_DIR}/imagectn/libsrc/Release
     ${DCMTK_DIR}/imagectn/libsrc/
     ${DCMTK_DIR}/imagectn/libsrc/Debug
-  NO_DEFAULT_PATH
-  )
-
-FIND_LIBRARY(DCMTK_dcmnet_LIBRARY dcmnet
-  PATHS
-    ${DCMTK_DIR}/dcmnet/libsrc/Release
-    ${DCMTK_DIR}/dcmnet/libsrc/Debug
-    ${DCMTK_DIR}/dcmnet/libsrc/
   NO_DEFAULT_PATH
   )

@@ -140,6 +152,8 @@
     AND DCMTK_oflog_LIBRARY
     AND DCMTK_dcmdata_INCLUDE_DIR
     AND DCMTK_dcmdata_LIBRARY
+    AND DCMTK_dcmnet_INCLUDE_DIR
+    AND DCMTK_dcmnet_LIBRARY
     AND DCMTK_dcmimgle_INCLUDE_DIR
     AND DCMTK_dcmimgle_LIBRARY )

@@ -159,11 +173,13 @@
     ${DCMTK_config_INCLUDE_DIR}
     ${DCMTK_ofstd_INCLUDE_DIR}
     ${DCMTK_dcmdata_INCLUDE_DIR}
+    ${DCMTK_dcmnet_INCLUDE_DIR}
     ${DCMTK_dcmimgle_INCLUDE_DIR}
   )

   SET( DCMTK_LIBRARIES
     ${DCMTK_dcmimgle_LIBRARY}
+    ${DCMTK_dcmnet_LIBRARY}
     ${DCMTK_dcmdata_LIBRARY}
     ${DCMTK_ofstd_LIBRARY}
     ${DCMTK_oflog_LIBRARY}
@@ -176,13 +192,6 @@
    ${DCMTK_imagedb_LIBRARY}
    )
   ENDIF(DCMTK_imagedb_LIBRARY)
-
-  IF(DCMTK_dcmnet_LIBRARY)
-   SET( DCMTK_LIBRARIES
-   ${DCMTK_LIBRARIES}
-   ${DCMTK_dcmnet_LIBRARY}
-   )
-  ENDIF(DCMTK_dcmnet_LIBRARY)

   IF( WIN32 )
     SET( DCMTK_LIBRARIES ${DCMTK_LIBRARIES} ws2_32 netapi32 wsock32)
@@ -198,6 +207,8 @@
     AND DCMTK_oflog_LIBRARY
     AND DCMTK_dcmdata_INCLUDE_DIR
     AND DCMTK_dcmdata_LIBRARY
+    AND DCMTK_dcmnet_INCLUDE_DIR
+    AND DCMTK_dcmnet_LIBRARY
     AND DCMTK_dcmimgle_INCLUDE_DIR
     AND DCMTK_dcmimgle_LIBRARY )

@@ -226,6 +237,8 @@
   DCMTK_config_INCLUDE_DIR
   DCMTK_dcmdata_INCLUDE_DIR
   DCMTK_dcmdata_LIBRARY
+  DCMTK_dcmnet_INCLUDE_DIR
+  DCMTK_dcmnet_LIBRARY
   DCMTK_dcmimgle_INCLUDE_DIR
   DCMTK_dcmimgle_LIBRARY
   DCMTK_imagedb_LIBRARY


Update Bootstrap to version 6

Update Bootstrap to version 6

--- qibuild.cmake
+++ qibuild.cmake
@@ -1,6 +1,4 @@
-##
-## Copyright (C) 2010 Aldebaran Robotics
-##
+## Copyright (C) 2011 Aldebaran Robotics

 ###############################################
 # Auto-generated file.                        #
@@ -8,7 +6,7 @@
 # This file is part of the qibuild project    #
 ###############################################

-set(QIBUILD_BOOTSTRAP_VERSION 5)
+set(QIBUILD_BOOTSTRAP_VERSION 6)

 ##
@@ -16,8 +14,12 @@
 # and include it.
 # This allow us to find all qibuild/qibuild.cmake
 function(bootstrap)
-  find_program(PYTHON_EXECUTABLE NAMES python2 python python.exe)
-  find_program(QI_BUILD_EXECUTABLE qibuild.py)
+  find_program(PYTHON_EXECUTABLE NAMES python2 python python.exe
+    PATHS
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
+  )
+

   if(NOT PYTHON_EXECUTABLE)
     message(STATUS
@@ -30,6 +32,13 @@
     )
     message(FATAL_ERROR "")
   endif()
+
+  get_filename_component(_python_root ${PYTHON_EXECUTABLE} PATH)
+  find_program(QI_BUILD_EXECUTABLE qibuild.py
+    PATHS
+      "${_python_root}/Scripts"
+  )
+

   if(NOT QI_BUILD_EXECUTABLE)
     message(STATUS


cmake: Remove orbsvcs detection for TAO case.

Signed-off-by: Peter Soetens <4b8373d016f277527198385ba72fda0feb5da015@thesourceworks.com>

--- lib/orogen/templates/config/FindOrocosCORBA.cmake
+++ lib/orogen/templates/config/FindOrocosCORBA.cmake
@@ -34,21 +34,18 @@
             MESSAGE(STATUS "Orocos uses the TAO ORB")

             FIND_PROGRAM(OrocosCORBA_IDL_EXECUTABLE tao_idl)
-            OROCOS_PKGCONFIG(TAO_CosEvent ORBSVCS_FOUND ORBSVCS_INCLUDE_DIR ORBSVCS_DEFINES ORBSVCS_LINK_DIR ORBSVCS_LIBRARIES)
-
-            IF (OrocosCORBA_IDL_EXECUTABLE AND ORBSVCS_FOUND)
+            IF (OrocosCORBA_IDL_EXECUTABLE )
                 SET(OrocosCORBA_Typekit_FOUND TRUE)
                 ADD_DEFINITIONS(-D_REENTRANT)
-                SET(OrocosCORBA_Typekit_DEFINES ${ORBSVCS_DEFINES})
                 # The ${OrocosRTT_INCLUDE_DIRS}/rtt part is a workaround for RTT's
                 # includes brokenness
-                SET(OrocosCORBA_Typekit_INCLUDE_DIR "${ORBSVCS_INCLUDE_DIR};${OrocosCORBA_INCLUDE_DIRS}")
+                SET(OrocosCORBA_Typekit_INCLUDE_DIR "${OrocosCORBA_INCLUDE_DIRS}")
                 SET(OrocosCORBA_IDL ${OrocosCORBA_IDL_EXECUTABLE})
-            ELSE(OrocosCORBA_IDL_EXECUTABLE AND ORBSVCS_FOUND)
+            ELSE(OrocosCORBA_IDL_EXECUTABLE )
                 IF(NOT OrocosCORBA_FIND_QUIETLY)
                     MESSAGE(STATUS "cannot find tao_idl or associated development files")
                 ENDIF(NOT OrocosCORBA_FIND_QUIETLY)
-            ENDIF (OrocosCORBA_IDL_EXECUTABLE AND ORBSVCS_FOUND)
+            ENDIF (OrocosCORBA_IDL_EXECUTABLE)

         ELSEIF (CORBA_IMPLEMENTATION STREQUAL "OMNIORB")
             MESSAGE(STATUS "Orocos uses the OmniORB")


Remove 'PIE' for Clang ThreadSanitizer

Remove 'PIE' for Clang ThreadSanitizer

--- flags/sanitize_thread.cmake
+++ flags/sanitize_thread.cmake
@@ -1,4 +1,4 @@
-# Copyright (c) 2014, Ruslan Baratov
+# Copyright (c) 2014-2017, Ruslan Baratov
 # All rights reserved.

 if(DEFINED POLLY_FLAGS_SANITIZE_THREAD_CMAKE_)
@@ -10,11 +10,16 @@
 include(polly_add_cache_flag)

 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fsanitize=thread")
-polly_add_cache_flag(CMAKE_CXX_FLAGS "-fPIE")
-polly_add_cache_flag(CMAKE_CXX_FLAGS "-pie")
 polly_add_cache_flag(CMAKE_CXX_FLAGS "-g")

 polly_add_cache_flag(CMAKE_C_FLAGS "-fsanitize=thread")
-polly_add_cache_flag(CMAKE_C_FLAGS "-fPIE")
-polly_add_cache_flag(CMAKE_C_FLAGS "-pie")
 polly_add_cache_flag(CMAKE_C_FLAGS "-g")
+
+# NOTE:
+#
+#   PIE flags removed because it's not a requirement anymore:
+#   * https://github.com/google/sanitizers/issues/503#issuecomment-137946595
+#
+#   With PIE flags sanitizer doesn't work on Ubuntu 14.04/16.04
+#   producing runtime error "ThreadSanitizer: unexpected memory mapping":
+#   * https://github.com/google/sanitizers/issues/503


CMake: Bugfix: be less restrictive in the mpi interface check

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@32979 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/macros/macro_check_mpi_interface.cmake
+++ deal.II/cmake/macros/macro_check_mpi_interface.cmake
@@ -27,7 +27,8 @@
     SET(_nope FALSE)

     FOREACH(_library ${${_feature}_LIBRARIES})
-      IF(_library MATCHES "/libmpi[^/]*\\.so")
+      IF( _library MATCHES "/libmpi[^/]*\\.so"
+          AND NOT _library MATCHES "f(77|90|ort)" )
         LIST(FIND MPI_LIBRARIES "${_library}" _position)
         IF("${_position}" STREQUAL "-1")
           SET(_nope TRUE)


Update common.cmake to allow addons to the file globbing

--- common.cmake
+++ common.cmake
@@ -63,8 +63,11 @@

 include_directories( include  )

-file(GLOB PROJECT_INCLUDES "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
-file(GLOB PROJECT_SRC "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+set(PROJECT_INCLUDES_GLOBS ${PROJECT_INCLUDES_GLOBS} "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
+set(PROJECT_SRC_GLOBS ${PROJECT_SRC_GLOBS} "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")
+
+file(GLOB PROJECT_INCLUDES ${PROJECT_INCLUDES_GLOBS} )
+file(GLOB PROJECT_SRC ${PROJECT_SRC_GLOBS} )

 add_library (${PROJECT} ${PROJECT_SRC} ${PROJECT_INCLUDES})


Small typo fix

Small typo fix

--- cmake/externals/projects_modules/medInria.cmake
+++ cmake/externals/projects_modules/medInria.cmake
@@ -139,7 +139,7 @@

 ExternalProject_Add_Step(${ep} get-revisions
     COMMAND cmake ${GET_REVISIONS_MODULE_PATH}
-    COMMENT Get projects revisionss
+    COMMENT "Get projects revisions"
     DEPENDEES download
     ALWAYS 1
     WORKING_DIRECTORY ${revisions_dir}


Fix boneheaded mistake

Fix boneheaded mistake

--- emdata.cmake
+++ emdata.cmake
@@ -14,8 +14,8 @@
     GIT_REPOSITORY      ${emdata_URL}
     UPDATE_COMMAND      ""
     PATCH_COMMAND       ""
-    CONFIGURE_COMMAND   ""
-    BUILD_COMMAND       ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} -DBUILDEM_DIR=${BUILDEM_DIR} ${emdata_SRC_DIR}
-    TEST_COMMAND        ""
+    CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} -DBUILDEM_DIR=${BUILDEM_DIR} ${emdata_SRC_DIR}
+    BUILD_COMMAND       make
+    TEST_COMMAND        ${BUILDEM_ENV_STRING} ${BUILDEM_BIN_DIR}/test/test_encoder
     INSTALL_COMMAND     ""
 )


Add comment

Add comment

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -207,6 +207,8 @@
   set(HUNTER_ARGS_FILE "${HUNTER_PACKAGE_HOME_DIR}/args.cmake")

   # Registering dependency (before return!)
+  # Note: there will be no dependency registration on cache run.
+  # HUNTER_PARENT_PACKAGE set to empty string in 'hunter_cache_run'
   hunter_register_dependency(
       PACKAGE "${HUNTER_PARENT_PACKAGE}"
       DEPENDS_ON_PACKAGE "${HUNTER_PACKAGE_NAME}"


Check base directory exists

Check base directory exists

--- cmake/modules/hunter_try_lock.cmake
+++ cmake/modules/hunter_try_lock.cmake
@@ -4,6 +4,7 @@
 cmake_minimum_required(VERSION 3.0)

 include(hunter_fatal_error)
+include(hunter_test_has_write_permission)
 include(hunter_test_string_not_empty)

 function(hunter_try_lock result)
@@ -18,6 +19,12 @@
   if(HUNTER_SKIP_LOCK)
     hunter_fatal_error("Internal error: HUNTER_SKIP_LOCK is set")
   endif()
+
+  if(NOT EXISTS "${HUNTER_BASE}")
+    hunter_fatal_error("Base directory missing: ${HUNTER_BASE}")
+  endif()
+
+  hunter_test_has_write_permission()

   file(TO_NATIVE_PATH "${HUNTER_LOCK_PATH}" lock_path)


libpcre: Enable Unicode properties

libpcre: Enable Unicode properties

--- cmake/projects/libpcre/hunter.cmake
+++ cmake/projects/libpcre/hunter.cmake
@@ -28,6 +28,7 @@
     libpcre
     CMAKE_ARGS
     PKGCONFIG_EXPORT_TARGETS=libpcre;libpcrecpp;libpcreposix
+    EXTRA_FLAGS=--enable-unicode-properties
 )

 hunter_cacheable(libpcre)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -100,7 +100,7 @@
     # if we could extract them, compare with the requested version number
     if (SFML_VERSION_MAJOR)
         # transform version numbers to an integer
-		math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + 1 * 100")
+		math(EXPR SFML_VERSION "${2 * 10000 + 1 * 100")

         # compare them
         if(SFML_VERSION LESS SFML_REQUESTED_VERSION)


CMake/LLVM: update llvm-config search

CMake/LLVM: update llvm-config search

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -36,9 +36,11 @@
   # search for any version
   find_program(LLVM_CONFIG
     NAMES "llvm-config"
+      "llvm-config-mp-5.0" "llvm-config-5.0" "llvm-config50"
+      "llvm-config-mp-4.0" "llvm-config-4.0" "llvm-config40"
+      "llvm-config-mp-3.9" "llvm-config-3.9" "llvm-config39"
       "llvm-config-mp-3.8" "llvm-config-3.8" "llvm-config38"
       "llvm-config-mp-3.7" "llvm-config-3.7" "llvm-config37"
-      "llvm-config-mp-3.9" "llvm-config-3.9" "llvm-config39"
     DOC "llvm-config executable")
 endif()


Set ARCH for CUDA GTESTS

Set ARCH for CUDA GTESTS

--- test/BuildGPUTests.cmake
+++ test/BuildGPUTests.cmake
@@ -44,6 +44,7 @@
     set_target_properties(${name} PROPERTIES
         CUDA_SEPARABLE_COMPILATION ON
         OUTPUT_NAME ${name}
+        CUDA_ARCHITECTURES 35 60 70
         COMPILE_FLAGS "${GPU_NVT_flags}")
 	if (CMAKE_BUILD_TYPE STREQUAL "Debug")
 		message("-- Debug build type detected, ${name} setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
@@ -64,6 +65,7 @@
     set_target_properties(${name} PROPERTIES
         CUDA_SEPARABLE_COMPILATION ON
         OUTPUT_NAME ${name}
+        CUDA_ARCHITECTURES 35 60 70
         COMPILE_FLAGS "${GPU_NPT_flags}")
 	if (CMAKE_BUILD_TYPE STREQUAL "Debug")
 		message("-- Debug build type detected, ${name} setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
@@ -84,6 +86,7 @@
     set_target_properties(${name} PROPERTIES
         CUDA_SEPARABLE_COMPILATION ON
         OUTPUT_NAME ${name}
+        CUDA_ARCHITECTURES 35 60 70
         COMPILE_FLAGS "${GPU_GC_flags}")
 	if (CMAKE_BUILD_TYPE STREQUAL "Debug")
 		message("-- Debug build type detected, ${name} setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
@@ -104,6 +107,7 @@
     set_target_properties(${name} PROPERTIES
         CUDA_SEPARABLE_COMPILATION ON
         OUTPUT_NAME ${name}
+        CUDA_ARCHITECTURES 35 60 70
         COMPILE_FLAGS "${GPU_GE_flags}")
 	if (CMAKE_BUILD_TYPE STREQUAL "Debug")
 		message("-- Debug build type detected, ${name} setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")


boards: x86/qemu: enable CPU flags for MMX/SSE

Tells QEMU to enable CPU flags corresponding to MMX/SSE
kconfigs.

Signed-off-by: Daniel Leung <d94e04d205b5962d7873a139ef298b03c1717f72@intel.com>

--- boards/x86/qemu_x86/board.cmake
+++ boards/x86/qemu_x86/board.cmake
@@ -26,9 +26,36 @@
   math(EXPR QEMU_MEMORY_SIZE_MB "${CONFIG_SRAM_SIZE} / 1024")
 endif()

+set(QEMU_CPU_FLAGS "")
+if(CONFIG_X86_MMX)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "mmx")
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "mmxext")
+endif()
+if(CONFIG_X86_SSE)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "sse")
+endif()
+if(CONFIG_X86_SSE2)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "sse2")
+endif()
+if(CONFIG_X86_SSE3)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "pni")
+endif()
+if(CONFIG_X86_SSSE3)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "ssse3")
+endif()
+if(CONFIG_X86_SSE41)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "sse4.1")
+endif()
+if(CONFIG_X86_SSE42)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "sse4.2")
+endif()
+if(CONFIG_X86_SSE4A)
+  string(JOIN "," QEMU_CPU_FLAGS "${QEMU_CPU_FLAGS}" "sse4a")
+endif()
+
 set(QEMU_FLAGS_${ARCH}
   -m ${QEMU_MEMORY_SIZE_MB}
-  -cpu ${QEMU_CPU_TYPE_${ARCH}}
+  -cpu ${QEMU_CPU_TYPE_${ARCH}}${QEMU_CPU_FLAGS}
   -device isa-debug-exit,iobase=0xf4,iosize=0x04
   ${REBOOT_FLAG}
   -nographic


Update select_compute_arch.cmake from version in 3.24

--- CMakeModules/select_compute_arch.cmake
+++ CMakeModules/select_compute_arch.cmake
@@ -7,7 +7,7 @@
 #      ARCH_AND_PTX : NAME | NUM.NUM | NUM.NUM(NUM.NUM) | NUM.NUM+PTX
 #      NAME: Fermi Kepler Maxwell Kepler+Tegra Kepler+Tesla Maxwell+Tegra Pascal Volta Turing Ampere
 #      NUM: Any number. Only those pairs are currently accepted by NVCC though:
-#            2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 8.0
+#            2.0 2.1 3.0 3.2 3.5 3.7 5.0 5.2 5.3 6.0 6.2 7.0 7.2 7.5 8.0 8.6
 #      Returns LIST of flags to be added to CUDA_NVCC_FLAGS in ${out_variable}
 #      Additionally, sets ${out_variable}_readable to the resulting numeric list
 #      Example:
@@ -16,6 +16,7 @@
 #
 #      More info on CUDA architectures: https://en.wikipedia.org/wiki/CUDA
 #
+
 if(CMAKE_CUDA_COMPILER_LOADED) # CUDA as a language
   if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA"
       AND CMAKE_CUDA_COMPILER_VERSION MATCHES "^([0-9]+\\.[0-9]+)")
@@ -24,97 +25,84 @@
 endif()

 # See: https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#gpu-feature-list
-
-# This list will be used for CUDA_ARCH_NAME = All option
-set(CUDA_KNOWN_GPU_ARCHITECTURES "Fermi" "Kepler" )
-
-# This list will be used for CUDA_ARCH_NAME = Common option (enabled by default)
-set(CUDA_COMMON_GPU_ARCHITECTURES "3.0" "3.5" "5.0")
-
-if(CUDA_VERSION VERSION_LESS "7.0")
-  set(CUDA_LIMIT_GPU_ARCHITECTURE "5.2")
-endif()
-
-# This list is used to filter CUDA archs when autodetecting
-set(CUDA_ALL_GPU_ARCHITECTURES "3.0" "3.2" "3.5" "5.0")
-
-if(CUDA_VERSION VERSION_GREATER "7.0" OR CUDA_VERSION VERSION_EQUAL "7.0" )
-  list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Kepler+Tegra" "Kepler+Tesla" "Maxwell" "Maxwell+Tegra")
-  list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.0" "5.2")
-  list(APPEND CUDA_ALL_GPU_ARCHITECTURES "5.0" "5.2" "5.3")
-
-  if(CUDA_VERSION VERSION_LESS "8.0")
-    list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "5.2+PTX")
-    set(CUDA_LIMIT_GPU_ARCHITECTURE "6.0")
-  endif()
-endif()
-
-if(CUDA_VERSION VERSION_GREATER "8.0" OR CUDA_VERSION VERSION_EQUAL "8.0" )
-  list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Pascal" "Pascal+Tegra")
+# Additions, deprecations, and removals can be found in the release notes:
+# https://developer.nvidia.com/cuda-toolkit-archive
+
+# The initial status here is for CUDA 7.0
+set(CUDA_KNOWN_GPU_ARCHITECTURES  "Fermi" "Kepler" "Maxwell" "Kepler+Tegra" "Kepler+Tesla" "Maxwell+Tegra")
+set(CUDA_COMMON_GPU_ARCHITECTURES "2.0" "2.1" "3.0" "3.5" "5.0" "5.3")
+set(CUDA_LIMIT_GPU_ARCHITECTURE "6.0")
+set(CUDA_ALL_GPU_ARCHITECTURES "2.0" "2.1" "3.0" "3.2" "3.5" "3.7" "5.0" "5.2" "5.3")
+set(_CUDA_MAX_COMMON_ARCHITECTURE "5.2+PTX")
+
+
+if(CUDA_VERSION VERSION_GREATER_EQUAL "8.0")
+  list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Pascal")
   list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.0" "6.1")
   list(APPEND CUDA_ALL_GPU_ARCHITECTURES "6.0" "6.1" "6.2")

-  if(CUDA_VERSION VERSION_LESS "9.0")
-    list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "6.2+PTX")
-    set(CUDA_LIMIT_GPU_ARCHITECTURE "7.0")
-  endif()
+  set(_CUDA_MAX_COMMON_ARCHITECTURE "6.2+PTX")
+  set(CUDA_LIMIT_GPU_ARCHITECTURE "7.0")
+
+  list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "2.0" "2.1")
 endif ()

-if(CUDA_VERSION VERSION_GREATER "9.0" OR CUDA_VERSION VERSION_EQUAL "9.0")
+if(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")
   list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta")
   list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0")
-  list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0")
-
-  if(CUDA_VERSION VERSION_GREATER "9.1" OR CUDA_VERSION VERSION_EQUAL "9.1")
-    list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Volta+Tegra")
-    list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.2")
-  endif()
+  list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.0" "7.2")
+
+  set(_CUDA_MAX_COMMON_ARCHITECTURE "7.2+PTX")
+  set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")

   list(REMOVE_ITEM CUDA_KNOWN_GPU_ARCHITECTURES "Fermi")
-  list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "2.0")
-
-  if(CUDA_VERSION VERSION_GREATER "9.1" OR CUDA_VERSION VERSION_EQUAL "9.1"
-     AND CUDA_VERSION VERSION_LESS "10.0")
-    list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.0+PTX")
-  endif()
-
-  set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")
-
-endif()
-
-if(CUDA_VERSION VERSION_GREATER "10.0" OR CUDA_VERSION VERSION_EQUAL "10.0")
+  list(REMOVE_ITEM CUDA_ALL_GPU_ARCHITECTURES "2.0" "2.1")
+endif()
+
+if(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
   list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Turing")
   list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5")
   list(APPEND CUDA_ALL_GPU_ARCHITECTURES "7.5")

-  if(CUDA_VERSION VERSION_LESS "11.0")
-    set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")
-    list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "7.5+PTX")
-  endif()
-endif()
-
-if(CUDA_VERSION VERSION_GREATER "11.0" OR CUDA_VERSION VERSION_EQUAL "11.0")
+  set(_CUDA_MAX_COMMON_ARCHITECTURE "7.5+PTX")
+  set(CUDA_LIMIT_GPU_ARCHITECTURE "8.0")
+
+  list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "3.0")
+endif()
+
+# https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#cuda-general-new-features
+# https://docs.nvidia.com/cuda/archive/11.0/cuda-toolkit-release-notes/index.html#deprecated-features
+if(CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
   list(APPEND CUDA_KNOWN_GPU_ARCHITECTURES "Ampere")
   list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0")
   list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.0")

-  list(REMOVE_ITEM CUDA_KNOWN_GPU_ARCHITECTURES "Kepler+Tegra")
-  list(REMOVE_ITEM CUDA_KNOWN_GPU_ARCHITECTURES "Kepler")
-  list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "3.0" "3.2")
-
-  if(CUDA_VERSION VERSION_GREATER "11.1" OR CUDA_VERSION VERSION_EQUAL "11.1")
-    list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.6")
-  endif()
-
-  if(CUDA_VERSION VERSION_GREATER "11.1" OR CUDA_VERSION VERSION_EQUAL "11.1"
-      AND CUDA_VERSION VERSION_LESS "12.0")
-    list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.0+PTX")
-  endif()
-
-  if(CUDA_VERSION VERSION_LESS "12.0")
-    set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0")
-  endif()
-endif()
+  set(_CUDA_MAX_COMMON_ARCHITECTURE "8.0+PTX")
+  set(CUDA_LIMIT_GPU_ARCHITECTURE "8.6")
+
+  list(REMOVE_ITEM CUDA_COMMON_GPU_ARCHITECTURES "3.5" "5.0")
+  list(REMOVE_ITEM CUDA_ALL_GPU_ARCHITECTURES "3.0" "3.2")
+endif()
+
+if(CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
+  list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "8.6")
+  list(APPEND CUDA_ALL_GPU_ARCHITECTURES "8.6")
+
+  set(_CUDA_MAX_COMMON_ARCHITECTURE "8.6+PTX")
+  set(CUDA_LIMIT_GPU_ARCHITECTURE "9.0")
+endif()
+
+list(APPEND CUDA_COMMON_GPU_ARCHITECTURES "${_CUDA_MAX_COMMON_ARCHITECTURE}")
+
+# Check with: cmake -DCUDA_VERSION=7.0 -P select_compute_arch.cmake
+if(DEFINED CMAKE_SCRIPT_MODE_FILE)
+  include(CMakePrintHelpers)
+  cmake_print_variables(CUDA_KNOWN_GPU_ARCHITECTURES)
+  cmake_print_variables(CUDA_COMMON_GPU_ARCHITECTURES)
+  cmake_print_variables(CUDA_LIMIT_GPU_ARCHITECTURE)
+  cmake_print_variables(CUDA_ALL_GPU_ARCHITECTURES)
+endif()
+

 ################################################################################################
 # A function for automatic detection of GPUs installed  (if autodetection is enabled)
@@ -174,8 +162,7 @@
     set(CUDA_GPU_DETECT_OUTPUT_FILTERED "")
     separate_arguments(CUDA_GPU_DETECT_OUTPUT)
     foreach(ITEM IN ITEMS ${CUDA_GPU_DETECT_OUTPUT})
-      if(CUDA_LIMIT_GPU_ARCHITECTURE AND (ITEM VERSION_GREATER CUDA_LIMIT_GPU_ARCHITECTURE OR
-                                          ITEM VERSION_EQUAL CUDA_LIMIT_GPU_ARCHITECTURE))
+        if(CUDA_LIMIT_GPU_ARCHITECTURE AND ITEM VERSION_GREATER_EQUAL CUDA_LIMIT_GPU_ARCHITECTURE)
         list(GET CUDA_COMMON_GPU_ARCHITECTURES -1 NEWITEM)
         string(APPEND CUDA_GPU_DETECT_OUTPUT_FILTERED " ${NEWITEM}")
       else()
@@ -201,11 +188,9 @@

   set(cuda_arch_bin)
   set(cuda_arch_ptx)
-  set(cuda_arch_with_ptx false)

   if("${CUDA_ARCH_LIST}" STREQUAL "All")
     set(CUDA_ARCH_LIST ${CUDA_KNOWN_GPU_ARCHITECTURES})
-    set(cuda_arch_with_ptx true)
   elseif("${CUDA_ARCH_LIST}" STREQUAL "Common")
     set(CUDA_ARCH_LIST ${CUDA_COMMON_GPU_ARCHITECTURES})
   elseif("${CUDA_ARCH_LIST}" STREQUAL "Auto")
@@ -216,18 +201,10 @@
   # Now process the list and look for names
   string(REGEX REPLACE "[ \t]+" ";" CUDA_ARCH_LIST "${CUDA_ARCH_LIST}")
   list(REMOVE_DUPLICATES CUDA_ARCH_LIST)
-
-  list(GET CUDA_ARCH_LIST -1 latest_arch)
-
   foreach(arch_name ${CUDA_ARCH_LIST})
     set(arch_bin)
     set(arch_ptx)
     set(add_ptx FALSE)
-
-    if(${arch_name} STREQUAL ${latest_arch} AND cuda_arch_with_ptx)
-      set(add_ptx TRUE)
-    endif()
-
     # Check to see if we are compiling PTX
     if(arch_name MATCHES "(.*)\\+PTX$")
       set(add_ptx TRUE)
@@ -242,11 +219,10 @@
         set(arch_bin 2.0 "2.1(2.0)")
       elseif(${arch_name} STREQUAL "Kepler+Tegra")
         set(arch_bin 3.2)
+      elseif(${arch_name} STREQUAL "Kepler+Tesla")
+        set(arch_bin 3.7)
       elseif(${arch_name} STREQUAL "Kepler")
-        set(arch_bin 3.0)
-        set(arch_ptx 3.0)
-      elseif(${arch_name} STREQUAL "Kepler+Tesla")
-        set(arch_bin 3.5 3.7)
+        set(arch_bin 3.0 3.5)
         set(arch_ptx 3.5)
       elseif(${arch_name} STREQUAL "Maxwell+Tegra")
         set(arch_bin 5.3)


STYLE: Removed trailing whitespaces.

STYLE: Removed trailing whitespaces.

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -55,7 +55,7 @@
 set (CTEST_INSTALL_DIRECTORY "${CI_ROOT_DIR}/xdk/")

 # HACK
-# This is needed because when using return() function ctest is trying
+# This is needed because when using return() function ctest is trying
 # to run the CTEST_COMMAND. And we need it to not produce an error
 set (CTEST_COMMAND "echo \"Exit\"") # HACK FIX ME
 set (CMAKE_COMMAND "cmake")
@@ -84,7 +84,7 @@
 set ( BRANCH_NAME "${IMAGE_NAME}/${SB_MD5}")
 set( GIT "git" )
 execute_process(
-  COMMAND ${GIT} "ls-remote" "${REMOTE}" "${BRANCH_NAME}"
+  COMMAND ${GIT} "ls-remote" "${REMOTE}" "${BRANCH_NAME}"
   OUTPUT_VARIABLE IS_SB_BUILD
   )
 if ( IS_SB_BUILD )
@@ -107,7 +107,7 @@

 # FIXME we should not have to pass through CMAKE_INSTALL_PREFIX
 # this is a superbuild issue
-set (CONFIGURE_OPTIONS
+set (CONFIGURE_OPTIONS
   "-DCMAKE_INSTALL_PREFIX=${CTEST_INSTALL_DIRECTORY}")

 ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
@@ -147,17 +147,17 @@
 # The image used will be passed to this script.
 # TODO verify that images does not have forbidden char in there name
 # TODO right now we rely on ctest_build to know whether there has been an error
-# in build, whereas SuperBuild does not necessarily return an error if something
+# in build, whereas SuperBuild does not necessarily return an error if something
 # goes wrong
 set ( SB_ARTIFACT_GIT "${CI_PROJ_DIR}/superbuild-artifact" )

-# REPOSITORY_GIT_URL and REMOTE whould be the same. Right now there are
+# REPOSITORY_GIT_URL and REMOTE whould be the same. Right now there are
 # different because one is https and one is ssh. Both should be ssh.
 set( REPOSITORY_GIT_URL "git@gitlab.orfeo-toolbox.org:gbonnefille/superbuild-artifact.git")
 # We clone master to have a basic configuration, mainly a correct .gitattribute
 # git clone $REMOTE --branch master --depth 1 superbuild-artifact
 execute_process(
-  COMMAND ${GIT} "clone" "${REPOSITORY_GIT_URL}"
+  COMMAND ${GIT} "clone" "${REPOSITORY_GIT_URL}"
   "--branch" "master" "--depth" "1" "superbuild-artifact"
   WORKING_DIRECTORY "${CI_PROJ_DIR}"
   )
@@ -166,7 +166,7 @@
 # StrictHostKeyChecking so we don't have to add the host as a known key
 # -F /dev/null so the agent is not taking a default file ~/.ssh/..
 execute_process(
-  COMMAND ${GIT} "config" "core.sshCommand"
+  COMMAND ${GIT} "config" "core.sshCommand"
   "ssh -o StrictHostKeyChecking=no -F /dev/null"
   WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
   RESULT_VARIABLE ssh_res
@@ -233,13 +233,13 @@
 # We need to create tar in its directory to avoid weird name in file
 # "tar: Removing leading `../../' from member names"
 # WARNING
-# We are creating a tar containing xdk/.., so when extracting the archive in
+# We are creating a tar containing xdk/.., so when extracting the archive in
 # an other environment the output file will be xdk... Obvious isn't it?
 # Well... Not for everyone...
-# May be for easier maintainability the tar name should be the same as the
+# May be for easier maintainability the tar name should be the same as the
 # file inside.
 execute_process(
-  COMMAND ${CMAKE_COMMAND} "-E" "tar" "cf" "${SB_TAR_NAME}"
+  COMMAND ${CMAKE_COMMAND} "-E" "tar" "cf" "${SB_TAR_NAME}"
   -- "${CTEST_INSTALL_DIRECTORY}"
   WORKING_DIRECTORY ${CI_ROOT_DIR}
   )
@@ -280,7 +280,7 @@
 # In our case if toto is deploying a key in superbuild-artifact repo
 # the the mail will be toto's
 execute_process(
-  COMMAND ${GIT} "commit" "--author=\"otbbot <otbbot@orfeo-toolbox.org>\""
+  COMMAND ${GIT} "commit" "--author=\"otbbot <otbbot@orfeo-toolbox.org>\""
   "-m" "\"New Superbuild for ${SB_MD5} on ${IMAGE_NAME}\""
   WORKING_DIRECTORY ${SB_ARTIFACT_GIT}
   RESULT_VARIABLE com_res
@@ -327,4 +327,4 @@
   message( "push_res = ${push_res}" )
   message( "push_out = ${push_out}" )
   message( "push_err = ${push_err}" )
-endif() +endif()


Added GDAL_FIND_DEBUG option

Added GDAL_FIND_DEBUG option

--- CMakeModules/FindGDAL.cmake
+++ CMakeModules/FindGDAL.cmake
@@ -18,6 +18,18 @@

 # This makes the presumption that you are include gdal.h like
 # #include "gdal.h"
+
+set(GDAL_FIND_DEBUG TRUE CACHE BOOL "Also search for the debug version of the GDAL library")
+
+if(GDAL_FIND_DEBUG)
+	if(GDAL_INCLUDE_DIR AND GDAL_LIBRARY AND GDAL_LIBRARY_DEBUG)
+		set(GDAL_FIND_QUIETLY TRUE)
+	endif(GDAL_INCLUDE_DIR AND GDAL_LIBRARY AND GDAL_LIBRARY_DEBUG)
+else(GDAL_FIND_DEBUG)
+	if(GDAL_INCLUDE_DIR AND GDAL_LIBRARY)
+		set(GDAL_FIND_QUIETLY TRUE)
+	endif(GDAL_INCLUDE_DIR AND GDAL_LIBRARY)
+endif(GDAL_FIND_DEBUG)

 FIND_PATH(GDAL_INCLUDE_DIR gdal.h
   HINTS
@@ -83,8 +95,17 @@
 )

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GDAL DEFAULT_MSG GDAL_INCLUDE_DIR GDAL_LIBRARY GDAL_LIBRARY_DEBUG)
+find_package_handle_standard_args(GDAL DEFAULT_MSG GDAL_INCLUDE_DIR GDAL_LIBRARY)

 if(GDAL_FOUND)
-	set(GDAL_LIBRARIES debug ${GDAL_LIBRARY_DEBUG} optimized ${GDAL_LIBRARY})
-endif(GDAL_FOUND)+	if(GDAL_FIND_DEBUG)
+		if(NOT GDAL_LIBRARY_DEBUG)
+			set(GDAL_LIBRARY_DEBUG ${GDAL_LIBRARY})
+		endif(NOT GDAL_LIBRARY_DEBUG)
+		set(GDAL_LIBRARIES debug ${GDAL_LIBRARY_DEBUG} optimized ${GDAL_LIBRARY})
+	else(GDAL_FIND_DEBUG)
+		set(GDAL_LIBRARIES ${GDAL_LIBRARY})
+	endif(GDAL_FIND_DEBUG)
+else(GDAL_FOUND)
+	SET(GDAL_LIBRARIES )
+endif(GDAL_FOUND)


Added more paths to FindGLFW

Added more paths to FindGLFW

--- CMakeModules/FindGLFW.cmake
+++ CMakeModules/FindGLFW.cmake
@@ -42,8 +42,14 @@
   $ENV{GLFW_ROOT}
   PATH_SUFFIXES lib/win32 #For finding the library file under the root of the glfw expanded archive, typically on Windows.
   PATHS
+  /usr/lib
+  /usr/lib64
+  /usr/lib/x86_64-linux-gnu
+  /usr/lib/arm-linux-gnueabihf
   /usr/local/lib
-  /usr/lib
+  /usr/local/lib64
+  /sw/lib
+  /opt/local/lib
   ${GLFW_ROOT_DIR}/lib-msvc100/release # added by ptr
 )


Remove space (style convention)

Remove space (style convention)

--- CMakeModules/FindHDF4.cmake
+++ CMakeModules/FindHDF4.cmake
@@ -29,7 +29,7 @@
 if(DF_LIBRARY)
   set(CMAKE_REQUIRED_LIBRARIES ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${SZIP_LIBRARIES})
   check_library_exists(${DF_LIBRARY} Hopen "" HAVE_DF_LIBRARY)
-endif (DF_LIBRARY)
+endif(DF_LIBRARY)

 find_library(MFHDF_LIBRARY NAMES mfhdf libmfhdf PATHS ${HDF4_LIBRARY_DIR})
 if(MFHDF_LIBRARY)


Fixed FindAllegro.cmake to search for allegro in /usr/local/include/allegro5 in addition to /usr/include/allegro5

--- cmake/Modules/FindAllegro.cmake
+++ cmake/Modules/FindAllegro.cmake
@@ -24,6 +24,7 @@
     PATHS
       /usr/include/allegro5
       /usr/include
+      /usr/local/include/allegro5
       /usr/local/include
       /opt/local/include
       /sw/include


Squashed '3rdparty/github/cmake-utils/' changes from 4be0e8da..da88dd07

da88dd07 cmake/MyPackageDependency.cmake: to to ALL_IN_ONE branch if target exists

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: da88dd072980be0e02cad0bd7e6674040e6e7ccc

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -180,9 +180,12 @@
         ENDIF ()
         SET (realPackageDepend ${packageDepend}_static)
       ELSE ()
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency resolved to ${packageDepend} for target ${_target}")
+        ENDIF ()
         SET (realPackageDepend ${packageDepend})
       ENDIF ()
-      IF (_ALL_IN_ONE)
+      IF (_ALL_IN_ONE OR (TARGET ${realPackageDepend}))
         #
         # Dependency by target
         #
@@ -260,6 +263,9 @@
         # Include dependency
         #
         GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_INCLUDE_DIRS)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} include dirs list is ${_property}")
+        ENDIF ()
         FOREACH (_include_directory ${_property})
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} directory to ${_target}'s include directories")
@@ -270,6 +276,9 @@
         # Library dependency
         #
         GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_LIBRARIES)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} library list is ${_property}")
+        ENDIF ()
         FOREACH (_library ${_property})
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library to ${_target}")
@@ -280,6 +289,9 @@
         # Compile definitions
         #
         GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_C_FLAGS_SHARED)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} compile definitions is ${_property}")
+        ENDIF ()
         FOREACH (_flag ${_property})
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile flag to ${_target}")
@@ -290,6 +302,9 @@
         # Link flags
         #
         GET_PROPERTY(_property GLOBAL PROPERTY MYPACKAGE_DEPENDENCY_${packageDepend}_LINK_FLAGS)
+        IF (MYPACKAGE_DEBUG)
+          MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} link flags is ${_property}")
+        ENDIF ()
         FOREACH (_flag ${_property})
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} link flag to ${_target}")
@@ -299,6 +314,10 @@
             LINK_FLAGS ${_flag}
             )
         ENDFOREACH ()
+      ENDIF ()
+    ELSE ()
+      IF (MYPACKAGE_DEBUG)
+        MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] No target ${_target}")
       ENDIF ()
     ENDIF ()
   ENDFOREACH ()


Add distortosSetFixedConfiguration() to distortos-utilities.cmake

This is very similar to distortosSetConfiguration(), but the variables
are not stored in cache, not saved in distortosConfiguration.cmake file
and not presented in the GUI. This is basically meant to define fixed
values which will be inserted into generated distortosConfiguration.h
file.

--- cmake/distortos-utilities.cmake
+++ cmake/distortos-utilities.cmake
@@ -329,6 +329,44 @@
 endfunction()

 #
+# Sets new distortos fixed configuration named `name` with type `type` and value `value`.
+#
+# `BOOLEAN` type
+# `value` must be either `ON` or `OFF`.
+#
+# `INTEGER` type
+# `value` must be decimal integer in [-2147483648; 2147483647] range.
+#
+# `STRING` type
+# Any string is accepted as `value`.
+#
+
+function(distortosSetFixedConfiguration type name value)
+	list(FIND DISTORTOS_FIXED_CONFIGURATION_NAMES "${name}" index)
+	if(NOT index EQUAL -1)
+		message(FATAL_ERROR "Fixed configuration variable \"${name}\" is already set")
+	endif()
+
+	if(type STREQUAL BOOLEAN)
+		distortosCheckBoolean("${name}" "${value}")
+	elseif(type STREQUAL INTEGER)
+		distortosCheckInteger("${name}" "${value}" -2147483648 2147483647)
+	elseif(type STREQUAL STRING)
+		# nothing to check, accept everything
+	else()
+		message(FATAL_ERROR "\"${type}\" is not a valid type")
+	endif()
+
+	set("${name}" "${value}" PARENT_SCOPE)
+
+	list(APPEND DISTORTOS_FIXED_CONFIGURATION_NAMES "${name}")
+	set(DISTORTOS_FIXED_CONFIGURATION_NAMES ${DISTORTOS_FIXED_CONFIGURATION_NAMES} PARENT_SCOPE)
+	set("${name}_TYPE" "${type}" PARENT_SCOPE)
+	set("${name}_OUTPUT_NAME" "${name}" PARENT_SCOPE)
+	set("${name}_OUTPUT_TYPES" "${type}" PARENT_SCOPE)
+endfunction()
+
+#
 # Prints size of output file of `target`.
 #
 # All additional arguments are passed to ${CMAKE_SIZE}.


detect mingw's libdxerr9.a

detect mingw's libdxerr9.a

--- CMake/Packages/FindDirectX.cmake
+++ CMake/Packages/FindDirectX.cmake
@@ -56,7 +56,7 @@
   endif(CMAKE_CL_64)
   find_library(DirectX9_LIBRARY NAMES d3d9 HINTS ${DirectX9_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX9_LIBPATH_SUFFIX})
   find_library(DirectX9_D3DX9_LIBRARY NAMES d3dx9 HINTS ${DirectX9_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX9_LIBPATH_SUFFIX})
-  find_library(DirectX9_DXERR_LIBRARY NAMES DxErr HINTS ${DirectX9_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX9_LIBPATH_SUFFIX})
+  find_library(DirectX9_DXERR_LIBRARY NAMES DxErr dxerr9 HINTS ${DirectX9_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX9_LIBPATH_SUFFIX})
   find_library(DirectX9_DXGUID_LIBRARY NAMES dxguid HINTS ${DirectX9_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX9_LIBPATH_SUFFIX})

   findpkg_finish(DirectX9)


Automatically fall back on /usr/bin/gcc

Automatically fall back on /usr/bin/gcc

When an unsupported gcc is on the PATH (i.e., your cluster admins
provide the latest version), nvcc cannot compile GPU code. This commit
automatically falls back on /usr/bin/gcc (via -ccbin) when an
unsupported gcc version is detected.

--- CMake/hoomd/HOOMDCUDASetup.cmake
+++ CMake/hoomd/HOOMDCUDASetup.cmake
@@ -68,3 +68,24 @@

 endif (ENABLE_EMBED_CUDA)

+# automatically handle setting ccbin to /usr when needed
+if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_VERSION VERSION_GREATER 2.8.7)
+    # CMAKE_CXX_COMPILER_VERSION is only available on 2.8.8 and newer
+
+    # need to set ccbin to  when gcc is unsupported
+    # this assumes that the user is on a system where CUDA is supported and /usr/bin/gcc will work - if they aren't, then it is their problem
+
+    if (CUDA_VERSION VERSION_EQUAL 4.1)
+        if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.5.99)
+            message(STATUS "CUDA 4.1 doesn't support gcc >= 4.6, falling back on /usr/bin/gcc")
+            list(APPEND CUDA_NVCC_FLAGS "-ccbin;/usr/bin/gcc")
+        endif()
+    endif()
+
+    if (CUDA_VERSION VERSION_EQUAL 4.2)
+        if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6.99)
+            message(STATUS "CUDA 4.1 doesn't support gcc >= 4.7, falling back on /usr/bin/gcc")
+            list(APPEND CUDA_NVCC_FLAGS "-ccbin;/usr/bin/gcc")
+        endif()
+    endif()
+endif()


Remove old .swiftdoc file before creating new .swiftdoc file

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -491,6 +491,8 @@
         COMMAND
           "${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_file}"
         COMMAND
+          "${CMAKE_COMMAND}" "-E" "remove" "-f" "${module_doc_file}"
+        COMMAND
           "${PYTHON_EXECUTABLE}" "${line_directive_tool}" "@${file_path}" --
           "${swift_compiler_tool}" "-emit-module" "-o" "${module_file}" ${swift_flags}
           "@${file_path}"


Fix regression in MSVC runtime flag

Fix regression in MSVC runtime flag

In attempting to fix a CMake style issue, a variable dereference
was accidentally removed that should have been left alone. Restore
it to how it was.

--- cmake/msvc_static_runtime.cmake
+++ cmake/msvc_static_runtime.cmake
@@ -22,7 +22,7 @@
     CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
     CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)

-    if(flag_var MATCHES "/MD")
+    if(${flag_var} MATCHES "/MD")
       string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
     endif()
   endforeach()


Fixed email module on ubuntu 64bit

Fixed email module on ubuntu 64bit

--- cmake_modules/FindCClient.cmake
+++ cmake_modules/FindCClient.cmake
@@ -32,11 +32,11 @@
 mark_as_advanced(CCLIENT_INCLUDE)

 # Look for the library.
-find_file(
+find_library(
   CCLIENT_LIBRARY
-  NAMES libc-client.a libc-client4.a
+  NAMES c-client c-client4
   PATHS ${CCLIENT_LIBRARY_DIRS} /opt/local/lib /usr/lib
-  DOC "Library to link against for the email support (libc-client.a, libc-client4.a or cclient.lib)")
+  DOC "Library to link against for the email support (c-client, libc-client or cclient.lib)")

 if (CCLIENT_LIBRARY)
   MESSAGE(STATUS "Found CCLIENT library -- " ${CCLIENT_LIBRARY})


Squashed 'cmake_modules/' changes from 62a312db..6fb1fe51

6fb1fe51 Allow for multiple environment variables to be set

git-subtree-dir: cmake_modules
git-subtree-split: 6fb1fe511151e03c0ec94c1e932ce91523864669

--- cmake_modules/IMPAddTests.cmake
+++ cmake_modules/IMPAddTests.cmake
@@ -30,7 +30,7 @@
       set_tests_properties("${modulename}-${name}" PROPERTIES TIMEOUT ${timeout})
       set_tests_properties("${modulename}-${name}" PROPERTIES COST ${IMP_${length}_COST})
       if(DEFINED IMP_TESTS_PROPERTIES)
-        set_tests_properties("${modulename}-${name}" PROPERTIES ${IMP_TESTS_PROPERTIES})
+        set_property(TEST "${modulename}-${name}" PROPERTY ${IMP_TESTS_PROPERTIES})
       endif()
   endforeach(test)
 endfunction(imp_add_python_tests)
@@ -62,7 +62,7 @@
               ${output}/${name_we}${CMAKE_EXECUTABLE_SUFFIX} ${IMP_TEST_ARGUMENTS})
      set_tests_properties("${modulename}-${name}" PROPERTIES LABELS "${modulename}-${ttype}-cpp-${length}")
      if(DEFINED IMP_TESTS_PROPERTIES)
-        set_tests_properties("${modulename}-${name}" PROPERTIES ${IMP_TESTS_PROPERTIES})
+        set_property(TEST "${modulename}-${name}" PROPERTY ${IMP_TESTS_PROPERTIES})
      endif()
      set_tests_properties("${modulename}-${name}" PROPERTIES TIMEOUT ${timeout})
      set_tests_properties("${modulename}-${name}" PROPERTIES COST ${IMP_${length}_COST})


Choose the newest available C++ standard

--- common/cmake/CommonHeader.cmake
+++ common/cmake/CommonHeader.cmake
@@ -1,3 +1,13 @@
+list (FIND CMAKE_CXX_COMPILE_FEATURES cxx_std_14 CXX_STD_14)
+
+set (CXX_STD_MAX 11)
+if (CXX_STD_14 GREATER_EQUAL -1)
+	set (CXX_STD_MAX 14)
+endif (CXX_STD_14 GREATER_EQUAL -1)
+
+set (CMAKE_CXX_STANDARD ${CXX_STD_MAX})
+set (CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
 # adapted from
 # https://github.com/RLovelett/eigen/blob/master/CMakeLists.txt


Fix ios demo with cmake 3.9.0 (#1589)

Fix ios demo with cmake 3.9.0 (#1589)

Refer the following for details on the issue with prior versions of cmake
https://gitlab.kitware.com/cmake/cmake/issues/16680
https://cmake.org/pipermail/cmake/2016-August/064125.html
https://cmake.org/cmake/help/v3.9/prop_sf/MACOSX_PACKAGE_LOCATION.html

--- toolchains/iOS.cmake
+++ toolchains/iOS.cmake
@@ -6,6 +6,15 @@
 set(TANGRAM_FRAMEWORK ${PROJECT_SOURCE_DIR}/${TANGRAM_FRAMEWORK})
 set(EXECUTABLE_NAME "tangram")
 set(FRAMEWORKS CoreGraphics CoreFoundation QuartzCore UIKit OpenGLES Security CFNetwork GLKit)
+
+# NB:cmake versions before 3.9.0 had an issue where the path specified for MACOSX_FRAMEWORK_LOCATION
+# was prepended by "../" when set to something other than "Resources" which is what we require here.
+# Refer: https://gitlab.kitware.com/cmake/cmake/issues/16680 for the actual cmake issue
+if(${CMAKE_VERSION} VERSION_LESS "3.9.0")
+    set(MACOSX_FRAMEWORK_LOCATION ${EXECUTABLE_NAME}.app/Frameworks)
+else()
+    set(MACOSX_FRAMEWORK_LOCATION Resources/Frameworks)
+endif()

 message(STATUS "Linking with Tangram Framework " ${TANGRAM_FRAMEWORK})
 message(STATUS "Building for architectures " ${ARCH})
@@ -37,7 +46,7 @@
     RESOURCE "${IOS_DEMO_RESOURCES}")

 set_source_files_properties(${TANGRAM_FRAMEWORK} PROPERTIES
-    MACOSX_PACKAGE_LOCATION ${EXECUTABLE_NAME}.app/Frameworks)
+    MACOSX_PACKAGE_LOCATION ${MACOSX_FRAMEWORK_LOCATION})

 if(NOT ${CMAKE_BUILD_TYPE} STREQUAL "Release")
     set_xcode_property(${EXECUTABLE_NAME} GCC_GENERATE_DEBUGGING_SYMBOLS YES)


kwsysPlatformTests: Use if(DEFINED) to simplify conditions

Replace old hacks of the form 'if("${VAR}" MATCHES "^${VAR}$")'
with the much simpler 'if(NOT DEFINED ${VAR})'.

Change-Id: Ie0e2fc5ceb85156221abe8938dfdd148b3862742

--- kwsysPlatformTests.cmake
+++ kwsysPlatformTests.cmake
@@ -13,7 +13,7 @@
 SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)

 MACRO(KWSYS_PLATFORM_TEST lang var description invert)
-  IF("${var}_COMPILED" MATCHES "^${var}_COMPILED$")
+  IF(NOT DEFINED ${var}_COMPILED)
     MESSAGE(STATUS "${description}")
     TRY_COMPILE(${var}_COMPILED
       ${CMAKE_CURRENT_BINARY_DIR}
@@ -43,7 +43,7 @@
         MESSAGE(STATUS "${description} - no")
       ENDIF(${var}_COMPILED)
     ENDIF(${invert} MATCHES INVERT)
-  ENDIF("${var}_COMPILED" MATCHES "^${var}_COMPILED$")
+  ENDIF()
   IF(${invert} MATCHES INVERT)
     IF(${var}_COMPILED)
       SET(${var} 0)
@@ -60,7 +60,7 @@
 ENDMACRO(KWSYS_PLATFORM_TEST)

 MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert)
-  IF("${var}" MATCHES "^${var}$")
+  IF(NOT DEFINED ${var})
     MESSAGE(STATUS "${description}")
     TRY_RUN(${var} ${var}_COMPILED
       ${CMAKE_CURRENT_BINARY_DIR}
@@ -107,7 +107,7 @@
         MESSAGE(STATUS "${description} - failed to compile")
       ENDIF(${var}_COMPILED)
     ENDIF(${invert} MATCHES INVERT)
-  ENDIF("${var}" MATCHES "^${var}$")
+  ENDIF()

   IF(${invert} MATCHES INVERT)
     IF(${var}_COMPILED)


build - added dependencies to library target having figured out that's how it should be done :)

--- set_cxx_norm.cmake
+++ set_cxx_norm.cmake
@@ -46,7 +46,7 @@
     elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")

         if(${NORM} EQUAL ${CXX_NORM_CXX11})
-            add_definitions("-std=c++0x")
+            add_definitions("-std=c++11")
         endif()

     endif()


Added CMake warning messages for expensive debug options

--- cmake/ConfigOptions.cmake
+++ cmake/ConfigOptions.cmake
@@ -98,12 +98,16 @@
 option(WITH_DEBUG_ALL "Print all debug messages." OFF)

 if(WITH_DEBUG_ALL)
+    message(WARNING "WITH_DEBUG_ALL=ON, the build will be slow and might leak sensitive information, do not use with release builds!")
 	set(DEFAULT_DEBUG_OPTION "ON")
 else()
 	set(DEFAULT_DEBUG_OPTION "OFF")
 endif()

 option(WITH_DEBUG_CERTIFICATE "Print certificate related debug messages." ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_CERTIFICATE)
+    message(WARNING "WITH_DEBUG_CERTIFICATE=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_CAPABILITIES "Print capability negotiation debug messages." ${DEFAULT_DEBUG_OPTION})
 option(WITH_DEBUG_CHANNELS "Print channel manager debug messages." ${DEFAULT_DEBUG_OPTION})
 option(WITH_DEBUG_CLIPRDR "Print clipboard redirection debug messages" ${DEFAULT_DEBUG_OPTION})
@@ -111,10 +115,25 @@
 option(WITH_DEBUG_DVC "Print dynamic virtual channel debug messages." ${DEFAULT_DEBUG_OPTION})
 CMAKE_DEPENDENT_OPTION(WITH_DEBUG_TSMF "Print TSMF virtual channel debug messages." ${DEFAULT_DEBUG_OPTION} "CHANNEL_TSMF" OFF)
 option(WITH_DEBUG_KBD "Print keyboard related debug messages." ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_KBD)
+    message(WARNING "WITH_DEBUG_KBD=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_LICENSE "Print license debug messages." ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_LICENSE)
+    message(WARNING "WITH_DEBUG_LICENSE=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_NEGO "Print negotiation related debug messages." ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_NEGO)
+    message(WARNING "WITH_DEBUG_NEGO=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_NLA "Print authentication related debug messages." ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_NLA)
+    message(WARNING "WITH_DEBUG_NLA=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_NTLM "Print NTLM debug messages" ${DEFAULT_DEBUG_OPTION})
+if(WITH_DEBUG_NTLM)
+    message(WARNING "WITH_DEBUG_NTLM=ON, the build might leak sensitive information, do not use with release builds!")
+endif()
 option(WITH_DEBUG_TSG "Print Terminal Server Gateway debug messages" ${DEFAULT_DEBUG_OPTION})
 option(WITH_DEBUG_RAIL "Print RemoteApp debug messages" ${DEFAULT_DEBUG_OPTION})
 option(WITH_DEBUG_RDP "Print RDP debug messages" ${DEFAULT_DEBUG_OPTION})


More work on warning fix

More work on warning fix

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -17,9 +17,9 @@
   # the flag -ftest-coverage causes nvcc to barf, so exclude that one
   if (CMAKE_COMPILER_IS_GNUCC)
     string (REPLACE "-ftest-coverage" "" TMP "${CMAKE_CXX_FLAGS}")
-    string (REPLACE "-ftemplate-depth=50" "" TMP "${TMP}")
+    string (REPLACE "-ftemplate-depth-50" "" TMP "${TMP}")
     string (REPLACE " " "," TMP "${TMP}")
-    set (CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS} ${TMP})
+    set (CUDA_CXX_FLAGS ${TMP})
   endif ()

   # GCS 2012-05-07: Workaround for poor, troubled FindCUDA


Change name of executable binaries.

Change name of executable binaries.

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -435,6 +435,7 @@
 		else()
 			add_executable(${name}-exe WIN32 ${HALLEY_PATH}/src/entry/halley_exe_entry.cpp)
 		endif()
+		set_target_properties(${name}-exe PROPERTIES OUTPUT_NAME ${name})

 		target_compile_definitions(${name} PUBLIC HALLEY_STATIC_LIBRARY)
 		target_compile_definitions(${name}-dll PUBLIC HALLEY_SHARED_LIBRARY)
@@ -448,9 +449,6 @@
 			configure_file(${HALLEY_PATH}/cmake/halley_game_dll.vcxproj.user.in ${CMAKE_CURRENT_BINARY_DIR}/${name}-dll.vcxproj.user @ONLY)
 			add_dependencies(${name}-dll halley-cmd)
 		endif()
-
-		#set_target_properties(${name}-dll PROPERTIES OUTPUT_NAME ${name})
-		#set_target_properties(${name}-exe PROPERTIES OUTPUT_NAME ${name})
 	endif()

 	if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)


Генерация версии

Генерация версии

--- cmake/build.version.cmake
+++ cmake/build.version.cmake
@@ -14,8 +14,7 @@
 	namespace version
 	{
 		static const std::string g_appName("${APP_NAME}");
-		static const std::string g_version("2.0");
-		static const std::string g_build  ("svn-${CMAKE_SVN_VERSION}");
+		static const std::string g_version("${PROJECT_VERSION_LONG}");
 		static const std::string g_site   ("${ORG_WEBSITE}");

 #ifdef RDO_MT
@@ -58,12 +57,11 @@
 		static const std::string g_limitRes("");
 #endif

-		static const std::string g_versionName = boost::str(boost::format("%1% %2%%3%-version %4% (build %5%) %6%-%7%%8%")
+		static const std::string g_versionName = boost::str(boost::format("%1% %2%%3%-version %4% %5%-%6%%7%")
 			% g_appName
 			% g_mt
 			% g_comp
 			% g_version
-			% g_build
 			% g_systemOS
 			% g_systemArchitectures
 			% (!g_academic.empty() || !g_limitRes.empty()


Set CPACK_PACKAGE_CONTACT, required for .deb

--- cmake/mysql_version.cmake
+++ cmake/mysql_version.cmake
@@ -106,6 +106,7 @@
 IF(NOT CPACK_SOURCE_PACKAGE_FILE_NAME)
   SET(CPACK_SOURCE_PACKAGE_FILE_NAME "mysql-${VERSION}")
 ENDIF()
+SET(CPACK_PACKAGE_CONTACT "MySQL Build Team <build@mysql.com>")
 SET(CPACK_PACKAGE_VENDOR "Sun Microsystems, Inc")
 SET(CPACK_SOURCE_GENERATOR "TGZ")
 INCLUDE(cpack_source_ignore_files)


use globs instead of guessing snap filename - this doesn't work reliably.


testing: build as extension

testing: build as extension

--- SuperBuild/External_QtToCppXML.cmake
+++ SuperBuild/External_QtToCppXML.cmake
@@ -43,9 +43,11 @@

   IF(Qt4_SUPPORT)
     set(QT_VERSION 4)
+    set(QT_DIRECTORY ${Qt4_DIR})
     set(${proj}_DEPENDENCIES SlicerExecutionModel Qt4 )
   ELSE()
     set(QT_VERSION 5)
+    set(QT_DIRECTORY ${Qt5_DIR})
     set(${proj}_DEPENDENCIES SlicerExecutionModel Qt5 )
   ENDIF()

@@ -59,7 +61,7 @@
     -DUSE_SYSTEM_SlicerExecutionModel:BOOL=ON
     -DSlicerExecutionModel_DIR:PATH=${SlicerExecutionModel_DIR}
     -DQT_VERSION=${QT_VERSION}
-    -DCMAKE_PREFIX_PATH:PATH=${Qt5_DIR}
+    -DCMAKE_PREFIX_PATH:PATH=${QT_DIRECTORY}
   )


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   06)
+SET(KWSYS_DATE_STAMP_DAY   07)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   05)
+SET(KWSYS_DATE_STAMP_DAY   06)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   08)
+SET(KWSYS_DATE_STAMP_DAY   09)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   26)
+SET(KWSYS_DATE_STAMP_DAY   27)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   28)
+SET(KWSYS_DATE_STAMP_DAY   29)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   20)
+SET(KWSYS_DATE_STAMP_DAY   21)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   13)
+SET(KWSYS_DATE_STAMP_DAY   14)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   23)
+SET(KWSYS_DATE_STAMP_DAY   24)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 10)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   05)
+SET(KWSYS_DATE_STAMP_DAY   06)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 01)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   02)
+SET(KWSYS_DATE_STAMP_DAY   03)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2010)

 # KWSys version date month component.  Format is MM.
-SET(KWSYS_DATE_STAMP_MONTH 09)
+SET(KWSYS_DATE_STAMP_MONTH 10)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   30)
+SET(KWSYS_DATE_STAMP_DAY   01)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   17)
+SET(KWSYS_DATE_STAMP_DAY   18)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   16)
+SET(KWSYS_DATE_STAMP_DAY   17)


Adding LC_ALL to list of env variables

Adding LC_ALL to list of env variables

--- ydbcmake/CMakeMUMPSInformation.cmake
+++ ydbcmake/CMakeMUMPSInformation.cmake
@@ -26,7 +26,7 @@
 set(CMAKE_MUMPS_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> -shared -o <TARGET> <OBJECTS>")
 set(CMAKE_MUMPS_CREATE_SHARED_MODULE "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> -o <TARGET> <OBJECTS>")
 set(CMAKE_MUMPS_CREATE_STATIC_LIBRARY "")
-set(CMAKE_MUMPS_COMPILE_OBJECT "ydb_chset=\"${ydb_chset}\" ydb_icu_version=\"${icu_version}\" <CMAKE_MUMPS_COMPILER> -object=<OBJECT> <SOURCE>")
+set(CMAKE_MUMPS_COMPILE_OBJECT "LC_ALL=\"${LC_ALL}\" ydb_chset=\"${ydb_chset}\" ydb_icu_version=\"${icu_version}\" <CMAKE_MUMPS_COMPILER> -object=<OBJECT> <SOURCE>")
 set(CMAKE_MUMPS_LINK_EXECUTABLE "")

 set(CMAKE_MUMPS_OUTPUT_EXTENSION .o)


Add an option

Add an option

--- config/MakeCoverage.cmake
+++ config/MakeCoverage.cmake
@@ -9,7 +9,7 @@
 add_custom_command (TARGET coverage
     COMMAND ${CMAKE_COMMAND} -E make_directory coverage
     #COMMAND ${LCOV_PATH} --directory . --zerocounters
-    COMMAND ${LCOV_PATH} --directory . --capture --output-file ./coverage/total.info
+    COMMAND ${LCOV_PATH} --directory . --capture --compat split_crc=auto --output-file ./coverage/total.info
     COMMAND ${LCOV_PATH} -r ./coverage/total.info '/usr/include/*' -o ./coverage/base.info
     COMMAND ${GENHTML_PATH} -o ./coverage ./coverage/base.info --legend
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR} )


cmake: Change the DTS preprocessing work directory

Change the DTS preprocessor working directory from the binary
directory to the application directory.

This is done so that the user can specify
-DDTC_OVERLAY_FILE=overlay.dts with a relative path from the
application directory as is possible for CONF_FILE, and as is
reasonably expected to be possible by users.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -126,10 +126,10 @@
     -P
     -E   # Stop after preprocessing
     -MD  # Generate a dependency file as a side-effect
-    -MF ${BOARD}.dts.pre.d
-    -o ${BOARD}.dts.pre.tmp
+    -MF ${PROJECT_BINARY_DIR}/${BOARD}.dts.pre.d
+    -o  ${PROJECT_BINARY_DIR}/${BOARD}.dts.pre.tmp
     ${ZEPHYR_BASE}/misc/empty_file.c
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    WORKING_DIRECTORY ${APPLICATION_SOURCE_DIR}
     RESULT_VARIABLE ret
     )
   if(NOT "${ret}" STREQUAL "0")


Update ios.toolchain.cmake

Update ios.toolchain.cmake

Correct spelling mistakes

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -174,7 +174,7 @@
   set(SDK_NAME iphoneos)
   if(NOT IOS_ARCH)
     if (XCODE_VERSION VERSION_GREATER 10.0)
-      set(IOS_ARCH armv7 armv7s arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+      set(IOS_ARCH armv7 armv7s arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missing bitcode markers for example
     else()
       set(IOS_ARCH armv7 armv7s arm64)
     endif()
@@ -183,7 +183,7 @@
   set(SDK_NAME iphoneos)
   if(NOT IOS_ARCH)
     if (XCODE_VERSION VERSION_GREATER 10.0)
-      set(IOS_ARCH arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+      set(IOS_ARCH arm64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missing bitcode markers for example
     else()
       set(IOS_ARCH arm64)
     endif()
@@ -193,7 +193,7 @@
   if(MODERN_CMAKE)
     if(NOT IOS_ARCH)
       if (XCODE_VERSION VERSION_GREATER 10.0)
-        set(IOS_ARCH arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missung bitcode markers for example
+        set(IOS_ARCH arm64 x86_64) # Add arm64e when Apple have fixed the integration issues with it, libarclite_iphoneos.a is currently missing bitcode markers for example
       else()
         set(IOS_ARCH arm64 x86_64)
       endif()