Pure C projects had errors in detect_vs_runtime()

CMAKE_CXX_FLAGS* are empty when creating a project with
project(MY_PROJECT C) as a header. This is causing issues
when trying to string(REPLACE) with an empty string.

--- conan.cmake
+++ conan.cmake
@@ -298,14 +298,16 @@
     string(TOUPPER ${CMAKE_BUILD_TYPE} build_type)
     set(variables CMAKE_CXX_FLAGS_${build_type} CMAKE_C_FLAGS_${build_type} CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
     foreach(variable ${variables})
-        string(REPLACE " " ";" flags ${${variable}})
-        foreach (flag ${flags})
-            if(${flag} STREQUAL "/MD" OR ${flag} STREQUAL "/MDd" OR ${flag} STREQUAL "/MT" OR ${flag} STREQUAL "/MTd")
-                string(SUBSTRING ${flag} 1 -1 runtime)
-                set(${result} ${runtime} PARENT_SCOPE)
-                return()
-            endif()
-        endforeach()
+        if(NOT "${${variable}}" STREQUAL "")
+            string(REPLACE " " ";" flags ${${variable}})
+            foreach (flag ${flags})
+                if(${flag} STREQUAL "/MD" OR ${flag} STREQUAL "/MDd" OR ${flag} STREQUAL "/MT" OR ${flag} STREQUAL "/MTd")
+                    string(SUBSTRING ${flag} 1 -1 runtime)
+                    set(${result} ${runtime} PARENT_SCOPE)
+                    return()
+                endif()
+            endforeach()
+        endif()
     endforeach()
     if(${build_type} STREQUAL "DEBUG")
         set(${result} "MDd" PARENT_SCOPE)


disable autoreq for rpm

disable autoreq for rpm

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -16,3 +16,4 @@
 SET(CPACK_SYSTEM_NAME "Linux-amd64")
 SET(CPACK_TOPLEVEL_TAG "Linux-amd64")
 SET(CPACK_PACKAGE_CONTACT "xuh@cs.unc.edu")
+set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")


SVN_SILENT made messages (.desktop file)

--- plasma-runner-ktp-contact.desktop.cmake
+++ plasma-runner-ktp-contact.desktop.cmake
@@ -8,6 +8,7 @@
 Name[fi]=Pikaviestintä
 Name[fr]=Messagerie instantanée
 Name[it]=Messaggistica istantanea
+Name[kk]=Лезде хабарласу
 Name[nb]=Lynmelding
 Name[nl]=Instant Messaging
 Name[pt]=Mensagens Instantâneas
@@ -32,6 +33,7 @@
 Comment[fi]=Aloita keskustelu muun pikaviestinkäyttäjän kanssa tai vaihda pikaviestintilaasi
 Comment[fr]=Démarre une discussion avec n'importe lequel de vos contacts de messagerie instantanée ou change l'état de celle-ci
 Comment[it]=Avvia una chat con un tuo contatto di MI oppure cambia il tuo stato di MI
+Comment[kk]=Кез-келген лезде хабарласу контактыңызбен чат-әңгімені бастау не күй-жайын өзгерту
 Comment[nb]=Start en prat med en av dine LM-kontakter eller endre din LM-status
 Comment[nl]=Begin een chat met een van uw IM-contactpersonen of wijzig uw IM-status
 Comment[pt]=Iniciar uma conversa com qualquer um dos seus contactos MI ou mudar o seu estado


SuperBuild: fix ossim build. (geos_i -> geos )

--- SuperBuild/CMake/External_geos.cmake
+++ SuperBuild/CMake/External_geos.cmake
@@ -46,7 +46,7 @@

 set(_SB_GEOS_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
 if(WIN32)
-  set(_SB_GEOS_LIBRARY ${SB_INSTALL_PREFIX}/lib/geos_i.lib )
+  set(_SB_GEOS_LIBRARY ${SB_INSTALL_PREFIX}/lib/geos.lib )
 elseif(UNIX)
   set(_SB_GEOS_LIBRARY ${SB_INSTALL_PREFIX}/lib/libgeos${CMAKE_SHARED_LIBRARY_SUFFIX})
 endif()


STYLE: trailing spaces removed

STYLE: trailing spaces removed

--- SuperBuild/CMake/External_hdf5.cmake
+++ SuperBuild/CMake/External_hdf5.cmake
@@ -45,8 +45,8 @@
     -DHDF5_BUILD_CPP_LIB:BOOL=OFF
     -DHDF5_BUILD_EXAMPLES:BOOL=ON
     -DHDF5_BUILD_FORTRAN:BOOL=OFF
-    -DHDF5_BUILD_HL_LIB:BOOL=ON
-    -DHDF5_BUILD_JAVA:BOOL=OFF
+    -DHDF5_BUILD_HL_LIB:BOOL=ON
+    -DHDF5_BUILD_JAVA:BOOL=OFF
     -DHDF5_BUILD_TOOLS:BOOL=OFF
     -DHDF5_ENABLE_SZIP_SUPPORT:BOOL=OFF
     -DHDF5_ENABLE_Z_LIB_SUPPORT:BOOL=ON


PKG: remove duplicates from notfound_dlls list

--- SuperBuild/CMake/PackageHelper.cmake
+++ SuperBuild/CMake/PackageHelper.cmake
@@ -174,7 +174,7 @@
   endif()

   ##################### install cli and gui scripts #######################
-  install(FILES ${PKG_APP_SCRIPTS}  DESTINATION ${PKG_STAGE_BIN_DIR})
+  install(PROGRAMS ${PKG_APP_SCRIPTS}  DESTINATION ${PKG_STAGE_BIN_DIR})

   if(include_mvd)
     install_monteverdi_files()
@@ -193,6 +193,7 @@

   ####################### install OSSIM data ###########################
   install(DIRECTORY ${PKG_SHARE_SOURCE_DIR}/ossim DESTINATION ${PKG_SHARE_DEST_DIR})
+

   ####################### Install otb applications ######################
   install(DIRECTORY "${OTB_APPLICATIONS_DIR}"  DESTINATION ${PKG_OTBLIBS_DIR})
@@ -363,8 +364,9 @@

   list(LENGTH notfound_dlls nos)
   if(${nos} GREATER 0)
-    STRING(REPLACE ".so;" ".so," notfound ${notfound_dlls})
-    message(FATAL_ERROR "Following dlls were not found: ${notfound_dlls}. Please consider adding their paths to SEARCHDIRS when calling superbuild_package macro.")
+    list(REMOVE_DUPLICATES notfound_dlls)
+    #string(REPLACE ".so;" ".so\\r\\n" notfound_dlls ${notfound_dlls})
+    message(FATAL_ERROR "Following dlls were not found: ${notfound_dlls}. Please consider adding their paths to PKG_SEARCHDIRS when calling superbuild_package macro.")
   endif()

   file(GLOB temp_files "${CMAKE_BINARY_DIR}/temp_so_names_dir/*") # /lib/otb


PKG: install otbcli*, otbgui* scripts as programs with exe bit

--- SuperBuild/CMake/Package_Macro.cmake
+++ SuperBuild/CMake/Package_Macro.cmake
@@ -93,8 +93,8 @@
           message(STATUS "Processing ${SEARCHDIR}/${infile}")
           is_file_executable("${SEARCHDIR}/${infile}" is_executable)
           if(is_executable)
-            install(PROGRAMS "${SEARCHDIR}/${infile}"
-              DESTINATION ${PKG_STAGE_DIR}/bin)
+              install(PROGRAMS "${SEARCHDIR}/${infile}"
+                DESTINATION ${PKG_STAGE_DIR}/bin)
           else(is_executable)
             get_filename_component(bn_we ${infile} NAME_WE)
             file(GLOB sofiles "${SEARCHDIR}/${bn_we}*")


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 01)

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


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   30)
+SET(KWSYS_DATE_STAMP_DAY   31)


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   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   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   04)
+SET(KWSYS_DATE_STAMP_DAY   05)


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 11)

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


Fix broken forge symlinks in OSX Installer

--- CMakeModules/osx_install/OSXInstaller.cmake
+++ CMakeModules/osx_install/OSXInstaller.cmake
@@ -110,15 +110,15 @@
     # Create symlinks separately. Copying them in above command will do a deep copy
     ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_FORGE_LIB PRE_BUILD
                        COMMAND ${CMAKE_COMMAND} -E create_symlink
-                       "${LIBFORGE_NAME}.${FORGE_VERSION}.dylib"
-                       "${LIBFORGE_NAME}.${FORGE_VERSION_MAJOR}.dylib"
+                       "libforge.${FORGE_VERSION}.dylib"
+                       "libforge.${FORGE_VERSION_MAJOR}.dylib"
                        WORKING_DIRECTORY "${OSX_TEMP}/Forge/${AF_INSTALL_LIB_DIR}"
                        COMMENT "Copying libforge files to temporary OSX Install Dir (Symlink)"
                        )
     ADD_CUSTOM_COMMAND(TARGET OSX_INSTALL_SETUP_FORGE_LIB PRE_BUILD
                        COMMAND ${CMAKE_COMMAND} -E create_symlink
-                       "${LIBFORGE_NAME}.${FORGE_VERSION_MAJOR}.dylib"
-                       "${LIBFORGE_NAME}.dylib"
+                       "libforge.${FORGE_VERSION_MAJOR}.dylib"
+                       "libforge.dylib"
                        WORKING_DIRECTORY "${OSX_TEMP}/Forge/${AF_INSTALL_LIB_DIR}"
                        COMMENT "Copying libforge files to temporary OSX Install Dir (Symlink)"
                        )


deal with CMake double expansion

deal with CMake double expansion

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -27,7 +27,7 @@

 set(Connext_FOUND FALSE)

-if(NOT "$ENV{NDDSHOME}" STREQUAL "")
+if(NOT "$ENV{NDDSHOME} " STREQUAL " ")
   # look inside of NDDSHOME if defined
   message(STATUS "Found RTI Connext: $ENV{NDDSHOME}")
   set(Connext_INCLUDE_DIRS "$ENV{NDDSHOME}/include/ndds")


Do not use the SSE2 flag on MinGW (which was used to circumvent an earlier GCC version bug), as it leads to crashes inside Bullet on GCC 4.9.1.

--- Source/CMake/Modules/Urho3D-CMake-common.cmake
+++ Source/CMake/Modules/Urho3D-CMake-common.cmake
@@ -267,15 +267,8 @@
                 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
                 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")
                 if (URHO3D_SSE)
-                    if (NOT WIN32)
-                        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
-                        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
-                    else ()
-                        message (STATUS "Using SSE2 instead of SSE because SSE fails on some Windows ports of GCC")
-                        message (STATUS "Disable SSE with the CMake option -DURHO3D_SSE=0 if this is not desired")
-                        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2")
-                        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2")
-                    endif ()
+                    set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse")
+                    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse")
                 endif ()
             endif ()
         endif ()


cmake: keep THREAD_LIBS_AS_NEEDED more local

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -108,7 +108,9 @@
 		set (CMAKE_SHARED_LINKER_FLAGS "-fsanitize=address ${CMAKE_SHARED_LINKER_FLAGS}")
 		# this is needed because of wrong pthread detection https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69443
 		find_package(Threads)
-		set (THREAD_LIBS_AS_NEEDED "${COMMON_FLAGS} -Wl,--as-needed ${CMAKE_THREAD_LIBS_INIT}")
+		set (THREAD_LIBS_AS_NEEDED "-Wl,--as-needed ${CMAKE_THREAD_LIBS_INIT}")
+		set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${THREAD_LIBS_AS_NEEDED}")
+		set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${THREAD_LIBS_AS_NEEDED}")
 	endif ()

 	set (DISABLE_LSAN "LSAN_OPTIONS=detect_leaks=0") #this is needed so ASAN is not used during GIR compilation
@@ -148,8 +150,8 @@
 #
 # Merge all flags
 #
-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STD} ${EXTRA_FLAGS} ${COMMON_FLAGS} -Wsign-compare -Wfloat-equal -Wformat-security ${THREAD_LIBS_AS_NEEDED}")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STD} ${EXTRA_FLAGS} ${CXX_EXTRA_FLAGS} ${COMMON_FLAGS} ${THREAD_LIBS_AS_NEEDED}")
+set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_STD} ${EXTRA_FLAGS} ${COMMON_FLAGS} -Wsign-compare -Wfloat-equal -Wformat-security")
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_STD} ${EXTRA_FLAGS} ${CXX_EXTRA_FLAGS} ${COMMON_FLAGS}")

 message (STATUS "C flags are ${CMAKE_C_FLAGS}")
 message (STATUS "CXX flags are ${CMAKE_CXX_FLAGS}")


Fixed spelling typo

Fixed spelling typo

git-svn-id: e31799a7ad59d6ea355ca047c69e0aee8a59fcd3@5506 53f5c7ee-bee3-0310-bbc5-ea0e15fffd5e

--- cmake/OpenSyncDefaults.cmake
+++ cmake/OpenSyncDefaults.cmake
@@ -50,7 +50,7 @@
 ENDIF ( NOT CMAKE_BUILD_TYPE )

 SET( OPENSYNC_TRACE TRUE CACHE BOOL "Debugging/Trace output of OpenSync" )
-SET( OPENSYNC_DEBUG_MODULES FALSE CACHE BOOL "Debugging modules. Avhoid unload of modules." )
+SET( OPENSYNC_DEBUG_MODULES FALSE CACHE BOOL "Debugging modules. Avoid unload of modules." )
 SET( OPENSYNC_UNITTESTS FALSE CACHE BOOL "Build OpenSync unit tests." )
 SET( OPENSYNC_PYTHONBINDINGS TRUE CACHE BOOL "Build OpenSync with Python bindings." )


fix (#46074)

fix (#46074)

--- cmake/external/rocksdb.cmake
+++ cmake/external/rocksdb.cmake
@@ -35,6 +35,7 @@
   CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
              -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
              -DWITH_BZ2=OFF
+             -DPORTABLE=1
              -DWITH_GFLAGS=OFF
              -DCMAKE_CXX_FLAGS=${ROCKSDB_CMAKE_CXX_FLAGS}
              -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}


CMake: tablegen: Add .td files under the inlude/llvm directory
hierarchy to the list of dependencies.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@75510 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -3,14 +3,15 @@
 # Adds the name of the generated file to TABLEGEN_OUTPUT.

 macro(tablegen ofn)
-  file(GLOB all_tds "*.td")
+  file(GLOB local_tds "*.td")
+  file(GLOB_RECURSE global_tds "${LLVM_MAIN_SRC_DIR}/include/llvm/*.td")

   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     COMMAND ${LLVM_TABLEGEN_EXE} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
     ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
     -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
-    DEPENDS tblgen ${all_tds}
+    DEPENDS tblgen ${local_tds} ${global_tds}
     COMMENT "Building ${ofn}.tmp..."
     )
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}


udev/rules: fix install location

udev/rules: fix install location

--- CMakeInstall.cmake
+++ CMakeInstall.cmake
@@ -92,7 +92,7 @@

   else()

-    set(TCAM_INSTALL_UDEV "${CMAKE_INSTALL_PREFIX}/udev/rules.d" CACHE PATH "udev rules installation path" FORCE)
+    set(TCAM_INSTALL_UDEV "${CMAKE_INSTALL_PREFIX}/lib/udev/rules.d" CACHE PATH "udev rules installation path" FORCE)
     set(TCAM_INSTALL_SYSTEMD "${CMAKE_INSTALL_PREFIX}/lib/systemd/system/" CACHE PATH "systemd unit installation path" FORCE)

     set(TCAM_INSTALL_PKGCONFIG "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" CACHE PATH "pkgconfig installation path" FORCE)


update to code coverage script

update to code coverage script

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -123,21 +123,27 @@
 		MESSAGE(FATAL_ERROR "genhtml not found! Aborting...")
 	ENDIF() # NOT GENHTML_PATH

+  ADD_CUSTOM_TARGET(${_targetname}-info
+
+    # Cleanup lcov
+    ${LCOV_PATH} --directory . --zerocounters
+
+    # Run tests
+    COMMAND ${_testrunner} ${ARGV3}
+
+    # Capturing lcov counters and generating report
+    COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
+    COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
+    FILE RENAME ${_outputname}.info.cleaned ${_outputname}.info
+  )
+
 	# Setup target
 	ADD_CUSTOM_TARGET(${_targetname}

-		# Cleanup lcov
-		${LCOV_PATH} --directory . --zerocounters
-
-		# Run tests
-		COMMAND ${_testrunner} ${ARGV3}
-
-		# Capturing lcov counters and generating report
-		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-		COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
-		FILE REMOVE_RECURSE ${_outputname}
-		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
-		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned
+		DEPENDS ${_targetname}-info
+		COMMAND ${CMAKE_COMMAND} -E remove_directory ${_outputname}
+		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info
+		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info

 		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
 		COMMENT "Resetting code coverage counters to zero.\nProcessing code coverage counters and generating report."
@@ -150,37 +156,3 @@
 		)

 ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE
-
-# Param _targetname     The name of new the custom make target
-# Param _testrunner     The name of the target which runs the tests
-# Param _outputname     cobertura output is generated as _outputname.xml
-# Optional fourth parameter is passed as arguments to _testrunner
-#   Pass them in list form, e.g.: "-j;2" for -j 2
-FUNCTION(SETUP_TARGET_FOR_COVERAGE_COBERTURA _targetname _testrunner _outputname)
-
-	IF(NOT PYTHON_EXECUTABLE)
-		MESSAGE(FATAL_ERROR "Python not found! Aborting...")
-	ENDIF() # NOT PYTHON_EXECUTABLE
-
-	IF(NOT GCOVR_PATH)
-		MESSAGE(FATAL_ERROR "gcovr not found! Aborting...")
-	ENDIF() # NOT GCOVR_PATH
-
-	ADD_CUSTOM_TARGET(${_targetname}
-
-		# Run tests
-		${_testrunner} ${ARGV3}
-
-		# Running gcovr
-		COMMAND ${GCOVR_PATH} -x -r ${CMAKE_SOURCE_DIR} -e '${CMAKE_SOURCE_DIR}/tests/'  -o ${_outputname}.xml
-		WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-		COMMENT "Running gcovr to produce Cobertura code coverage report."
-		)
-
-	# Show info where to find the report
-	ADD_CUSTOM_COMMAND(TARGET ${_targetname} POST_BUILD
-		COMMAND ;
-		COMMENT "Cobertura code coverage report saved in ${_outputname}.xml."
-		)
-
-ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE_COBERTURA


update android.toolchain.cmake

update android.toolchain.cmake

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

 # ------------------------------------------------------------------------------
-#  Android CMake toolchain file, for use with the Android NDK r5-r9
+#  Android CMake toolchain file, for use with the Android NDK r5-r10d
 #  Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
 #  See home page: https://github.com/taka-no-me/android-cmake
-#
-#  The file is mantained by the OpenCV project. The latest version can be get at
-#  http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
 #
 #  Usage Linux:
 #   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@@ -50,7 +47,7 @@
 #
 #  Usage Windows:
 #     You need native port of make to build your project.
-#     Android NDK r7 (or newer) already has make.exe on board.
+#     Android NDK r7 (and newer) already has make.exe on board.
 #     For older NDK you have to install it separately.
 #     For example, this one: http://gnuwin32.sourceforge.net/packages/make.htm
 #
@@ -76,36 +73,54 @@
 #      used by ndk-build tool from Android NDK.
 #
 #      Possible targets are:
-#        "armeabi" - matches to the NDK ABI with the same name.
-#           See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-#        "armeabi-v7a" - matches to the NDK ABI with the same name.
-#           See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
+#        "armeabi" - ARMv5TE based CPU with software floating point operations
+#        "armeabi-v7a" - ARMv7 based devices with hardware FPU instructions
+#            this ABI target is used by default
 #        "armeabi-v7a with NEON" - same as armeabi-v7a, but
 #            sets NEON as floating-point unit
 #        "armeabi-v7a with VFPV3" - same as armeabi-v7a, but
-#            sets VFPV3 as floating-point unit (has 32 registers instead of 16).
-#        "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP.
-#        "x86" - matches to the NDK ABI with the same name.
-#            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-#        "mips" - matches to the NDK ABI with the same name.
-#            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
+#            sets VFPV3 as floating-point unit (has 32 registers instead of 16)
+#        "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP
+#        "x86" - IA-32 instruction set
+#        "mips" - MIPS32 instruction set
+#
+#      64-bit ABIs for NDK r10 and newer:
+#        "arm64-v8a" - ARMv8 AArch64 instruction set
+#        "x86_64" - Intel64 instruction set (r1)
+#        "mips64" - MIPS64 instruction set (r6)
 #
 #    ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
 #      Option is read-only when standalone toolchain is used.
-#
-#    ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.6 - the name of compiler
+#      Note: building for "android-L" requires explicit configuration.
+#
+#    ANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 - the name of compiler
 #      toolchain to be used. The list of possible values depends on the NDK
-#      version. For NDK r8c the possible values are:
-#
-#        * arm-linux-androideabi-4.4.3
+#      version. For NDK r10c the possible values are:
+#
+#        * aarch64-linux-android-4.9
+#        * aarch64-linux-android-clang3.4
+#        * aarch64-linux-android-clang3.5
 #        * arm-linux-androideabi-4.6
-#        * arm-linux-androideabi-clang3.1
-#        * mipsel-linux-android-4.4.3
+#        * arm-linux-androideabi-4.8
+#        * arm-linux-androideabi-4.9 (default)
+#        * arm-linux-androideabi-clang3.4
+#        * arm-linux-androideabi-clang3.5
+#        * mips64el-linux-android-4.9
+#        * mips64el-linux-android-clang3.4
+#        * mips64el-linux-android-clang3.5
 #        * mipsel-linux-android-4.6
-#        * mipsel-linux-android-clang3.1
-#        * x86-4.4.3
+#        * mipsel-linux-android-4.8
+#        * mipsel-linux-android-4.9
+#        * mipsel-linux-android-clang3.4
+#        * mipsel-linux-android-clang3.5
 #        * x86-4.6
-#        * x86-clang3.1
+#        * x86-4.8
+#        * x86-4.9
+#        * x86-clang3.4
+#        * x86-clang3.5
+#        * x86_64-4.9
+#        * x86_64-clang3.4
+#        * x86_64-clang3.5
 #
 #    ANDROID_FORCE_ARM_BUILD=OFF - set ON to generate 32-bit ARM instructions
 #      instead of Thumb. Is not available for "x86" (inapplicable) and
@@ -181,8 +196,9 @@
 #    ANDROID and BUILD_ANDROID will be set to true, you may test any of these
 #    variables to make necessary Android-specific configuration changes.
 #
-#    Also ARMEABI or ARMEABI_V7A or X86 or MIPS will be set true, mutually
-#    exclusive. NEON option will be set true if VFP is set to NEON.
+#    Also ARMEABI or ARMEABI_V7A or X86 or MIPS or ARM64_V8A or X86_64 or MIPS64
+#    will be set true, mutually exclusive. NEON option will be set true
+#    if VFP is set to NEON.
 #
 #    LIBRARY_OUTPUT_PATH_ROOT should be set in cache to determine where Android
 #    libraries will be installed.
@@ -190,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
-#   - October 2014
-#     [~] fix NATIVE_API_LEVEL detection for NDK r10
 # ------------------------------------------------------------------------------

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

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

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

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

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

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

 macro( __LIST_FILTER listvar regex )
@@ -425,18 +344,12 @@
 endmacro()

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

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

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

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

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

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

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

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

 # configure rtti
@@ -1671,6 +1649,7 @@
                 ANDROID_RELRO
                 ANDROID_LIBM_PATH
                 ANDROID_EXPLICIT_CRT_LINK
+                ANDROID_APP_PIE
                 )
   if( DEFINED ${__var} )
    if( "${__var}" MATCHES " ")
@@ -1709,8 +1688,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
@@ -1743,17 +1722,21 @@
 #   ARMEABI : TRUE for arm v6 and older devices
 #   ARMEABI_V6 : TRUE for arm v6
 #   ARMEABI_V7A : TRUE for arm v7a
+#   ARM64_V8A : TRUE for arm64-v8a
 #   NEON : TRUE if NEON unit is enabled
 #   VFPV3 : TRUE if VFP version 3 is enabled
 #   X86 : TRUE if configured for x86
+#   X86_64 : TRUE if configured for x86_64
 #   MIPS : TRUE if configured for mips
+#   MIPS64 : TRUE if configured for mips64
 #   BUILD_ANDROID : always TRUE
 #   BUILD_WITH_ANDROID_NDK : TRUE if NDK is used
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
-#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
-#   ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e, r9, r9b, r9c; set only for NDK
-#   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
+#   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86", "mips", "arm64-v8a", "x86_64", "mips64" depending on ANDROID_ABI
+#   ANDROID_NDK_RELEASE : from r5 to r10d; set only for NDK
+#   ANDROID_NDK_RELEASE_NUM : numeric ANDROID_NDK_RELEASE version (1000*major+minor)
+#   ANDROID_ARCH_NAME : "arm", "x86", "mips", "arm64", "x86_64", "mips64" depending on ANDROID_ABI
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
 #   ANDROID_COMPILER_IS_CLANG : TRUE if clang compiler is used
@@ -1761,7 +1744,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"
@@ -1772,7 +1756,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:


Fixed a minor CMake issue for Windows.

Fixed a minor CMake issue for Windows.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -23,13 +23,26 @@

     COMMON_INITIALISATION()

-    # Check whether we are building in 32-bit or 64-bit
-    # Note: normally, we would check the value of CMAKE_SIZEOF_VOID_P, but in
-    #       some cases it may not be set (e.g. when generating an Xcode project
-    #       file), so we determine and retrieve that value ourselves...
+    # Make sure that we are building on a supported architecture
+    # Note #1: normally, we would check the value of CMAKE_SIZEOF_VOID_P, but
+    #          in some cases it may not be set (e.g. when generating an Xcode
+    #          project file), so we determine and retrieve that value
+    #          ourselves...
+    # Note #2: we can come here from either the main project (i.e. the GUI
+    #          version of OpenCOR on Windows and the GUI/CLI versions of
+    #          OpenCOR on Linux / OS X) or non-main project (i.e. the CLI
+    #          version of OpenCOR on Windows), hence we test the existence of
+    #          the cmake folder so that we can determine the exact location of
+    #          architecture.c file...
+
+    IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake)
+        SET(ARCHITECTURE_FILENAME ${CMAKE_SOURCE_DIR}/cmake/architecture.c)
+    ELSE()
+        SET(ARCHITECTURE_FILENAME ${CMAKE_SOURCE_DIR}/../cmake/architecture.c)
+    ENDIF()

     TRY_RUN(ARCHITECTURE_RUN ARCHITECTURE_COMPILE
-            ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/architecture.c
+            ${CMAKE_BINARY_DIR} ${ARCHITECTURE_FILENAME}
             RUN_OUTPUT_VARIABLE ARCHITECTURE)

     IF(NOT ${ARCHITECTURE} EQUAL 32 AND NOT ${ARCHITECTURE} EQUAL 64)
@@ -756,20 +769,13 @@
 ENDMACRO()

 MACRO(COPY_FILE_TO_BUILD_DIR ORIG_DIRNAME DEST_DIRNAME FILENAME)
-    # Determine the real destination folder, based on whether we came here from
-    # the main project (i.e. GUI version of OpenCOR on Windows and GUI/CLI
-    # versions of OpenCOR on Linux / OS X) or non-main project (i.e. the CLI
-    # version of OpenCOR on Windows)
-
-    IF(EXISTS ${CMAKE_BINARY_DIR}/../cmake)
-        # A CMake directory exists at the same level as the binary directory,
-        # so we are dealing with the main project
-
+    # Determine the real destination folder
+    # Note: see the INITIALISE_PROJECT() macro for an explanation of why we
+    #       check the existence of the cmake folder below...
+
+    IF(EXISTS ${CMAKE_SOURCE_DIR}/cmake)
         SET(REAL_DEST_DIRNAME ${PROJECT_BUILD_DIR}/${DEST_DIRNAME})
     ELSE()
-        # No CMake directory exists at the same level as the binary directory,
-        # so we are dealing with a non-main project
-
         SET(REAL_DEST_DIRNAME ${CMAKE_BINARY_DIR}/../../build/${CMAKE_CFG_INTDIR}/${DEST_DIRNAME})
     ENDIF()


add one liner function for adding a test

--- MemCheckTest.cmake
+++ MemCheckTest.cmake
@@ -16,3 +16,12 @@

 endfunction()

+function(add_opt_memcheck_test _cond _targetname _testrunner)
+
+  if (NOT ${_cond} OR NOT MEMCHECK_COMMAND)
+    add_test(${_targetname} ${_testrunner})
+  else ()
+    add_test(${_targetname} ${MEMCHECK_COMMAND} --leak-check=full --error-exitcode=5 ${ARGV2} --quiet ${_testrunner})
+  endif()
+
+endfunction()


Updated package listing.

Updated package listing.


cmake: host-gcc: Detect libgcc for all archs

This commit updates the build system to always detect the libgcc path
for the host platforms regardless of the target architecture.

The native_posix_64 target previously used the x32 ABI (`-mx32`) and
the multilib for this ABI was not commonly available in the x86-64 host
toolchains.

That is no longer the case because native_posix_64 had been updated to
use the x86-64 ABI (`-m64`).

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>

--- cmake/compiler/host-gcc/target.cmake
+++ cmake/compiler/host-gcc/target.cmake
@@ -18,20 +18,15 @@
 endif()
 find_program(CMAKE_CXX_COMPILER ${cplusplus_compiler}     CACHE INTERNAL " " FORCE)

-# The x32 version of libgcc is usually not available (can't trust gcc
-# -mx32 --print-libgcc-file-name) so don't fail to build for something
-# that is currently not needed. See comments in compiler/gcc/target.cmake
-if (CONFIG_X86)
-  # Convert to list as cmake Modules/*.cmake do it
-  STRING(REGEX REPLACE " +" ";" PRINT_LIBGCC_ARGS "${CMAKE_C_FLAGS}")
-  # This libgcc code is partially duplicated in compiler/*/target.cmake
-  execute_process(
-    COMMAND ${CMAKE_C_COMPILER} "${PRINT_LIBGCC_ARGS}" --print-libgcc-file-name
-    OUTPUT_VARIABLE LIBGCC_FILE_NAME
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-  assert_exists(LIBGCC_FILE_NAME)
-endif()
+# Convert to list as cmake Modules/*.cmake do it
+STRING(REGEX REPLACE " +" ";" PRINT_LIBGCC_ARGS "${CMAKE_C_FLAGS}")
+# This libgcc code is partially duplicated in compiler/*/target.cmake
+execute_process(
+  COMMAND ${CMAKE_C_COMPILER} "${PRINT_LIBGCC_ARGS}" --print-libgcc-file-name
+  OUTPUT_VARIABLE LIBGCC_FILE_NAME
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+assert_exists(LIBGCC_FILE_NAME)

 set(NOSTDINC "")


changed MD5 sums for openni installers

changed MD5 sums for openni installers

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

--- cmake/pcl_all_in_one_installer.cmake
+++ cmake/pcl_all_in_one_installer.cmake
@@ -25,10 +25,10 @@
     if(CMAKE_CL_64)
         set(OPENNI_PACKAGE "OpenNI-Win64-1.5.4-Dev.msi")
         set(OPENNI_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_PACKAGE}")
-        set(OPENNI_MD5 95087985e8271552d7c87dad03b41b21)
+        set(OPENNI_MD5 c8f9cbe8447a16d32572a4e2c2d00af0)
         set(OPENNI_SENSOR_PACKAGE "Sensor-Win-OpenSource64-5.1.0.msi")
         set(OPENNI_SENSOR_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_SENSOR_PACKAGE}")
-        set(OPENNI_SENSOR_MD5 1db3babe0291add6c07314c2e11582d5)
+        set(OPENNI_SENSOR_MD5 badb880116436870943b1b7c447dfa22)
     else(CMAKE_CL_64)
         set(OPENNI_PACKAGE "OpenNI-Win32-1.5.4-Dev.msi")
         set(OPENNI_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_PACKAGE}")


Mark NodeJS headers as system includes to suppress compiler warnings.

--- cmake/NodeJS.cmake
+++ cmake/NodeJS.cmake
@@ -595,7 +595,7 @@
         PUBLIC ${NODEJS_DEFINITIONS}
     )
     # This properly defines includes for the module
-    target_include_directories(${NAME} PUBLIC ${NODEJS_INCLUDE_DIRS})
+    target_include_directories(${NAME} SYSTEM PUBLIC ${NODEJS_INCLUDE_DIRS})

     # Add link flags to the module
     target_link_libraries(${NAME} ${NODEJS_LIBRARIES})


Update to latest Plugin.cmake from cmake-modules

--- cmake/Plugin.cmake
+++ cmake/Plugin.cmake
@@ -9,11 +9,13 @@
   endif()

   if(CMAKE_COMPILER_IS_GNUCXX)
-    target_compile_options(${name} PRIVATE -Wno-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-attributes")
   endif()

   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    target_compile_options(${name} PRIVATE -Wno-ignored-attributes)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 COMPILE_FLAGS " -Wno-ignored-attributes")
   endif()

   if(WIN32 AND CMAKE_COMPILER_IS_GNUCC)


glm: remove useless GLM_FORCE_CXX03 define

--- cmake/Reaper.cmake
+++ cmake/Reaper.cmake
@@ -67,7 +67,6 @@
     set(TARGET_COMPILE_DEFINITIONS REAPER_BUILD_${REAPER_BUILD_TYPE})
     if(MSVC)
         set_target_properties(${target} PROPERTIES PROJECT_LABEL ${project_label})
-        set(TARGET_COMPILE_DEFINITIONS ${TARGET_COMPILE_DEFINITIONS} GLM_FORCE_CXX03)
         get_target_property(SOURCE_FILES ${target} SOURCES)
         reaper_add_vs_source_tree("${SOURCE_FILES}" ${CMAKE_CURRENT_SOURCE_DIR})
         target_compile_options(${target} PRIVATE "/MP")


Revert rev. 46664, it breaks the compilation

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -477,7 +477,7 @@

   ALICE_Format(PELIBSDIR "-L" "" "${PELIBSDIR}")
   ALICE_CheckLibraries(PBLIBS "${PBLIBS}")
-  ALICE_CheckLibraries(PELIBS "${PELIBS}")
+  #ALICE_CheckLibraries(PELIBS "${PELIBS}")

   ALICE_CorrectPaths(EINCLUDE "${EINCLUDE}")
   ALICE_CorrectPaths(PINC "${PINC}")


cmake: Fix typo in FindDirectX.

cmake: Fix typo in FindDirectX.

--- cmake/FindDirectX.cmake
+++ cmake/FindDirectX.cmake
@@ -125,7 +125,7 @@
         if (USE_WINSDK_HEADERS)
             # XXX: We currently just assume the library exists
             set (library_var "DirectX_${var_name}_LIBRARY")
-            set (${library_dir_var} ${library})
+            set (${library_var} ${library})
             mark_as_advanced (${library_var})
         else ()
             find_dxsdk_library (${var_name} ${library})


Removed cmake/FindIlmBase.cmake

Removed cmake/FindIlmBase.cmake

This has been unused within the OpenSubdiv project for a long time.

--- cmake/FindIlmBase.cmake
+++ cmake/FindIlmBase.cmake
@@ -1,166 +0,0 @@
-#
-#   Copyright 2013 Pixar
-#
-#   Licensed under the Apache License, Version 2.0 (the "Apache License")
-#   with the following modification; you may not use this file except in
-#   compliance with the Apache License and the following modification to it:
-#   Section 6. Trademarks. is deleted and replaced with:
-#
-#   6. Trademarks. This License does not grant permission to use the trade
-#      names, trademarks, service marks, or product names of the Licensor
-#      and its affiliates, except as required to comply with Section 4(c) of
-#      the License and to reproduce the content of the NOTICE file.
-#
-#   You may obtain a copy of the Apache License at
-#
-#       http://www.apache.org/licenses/LICENSE-2.0
-#
-#   Unless required by applicable law or agreed to in writing, software
-#   distributed under the Apache License with the above modification is
-#   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#   KIND, either express or implied. See the Apache License for the specific
-#   language governing permissions and limitations under the Apache License.
-#
-
-# - Try to find the IlmBase library
-# Once done this will define
-#
-#  ILMBASE_FOUND - System has IlmBase
-#  ILMBASE_INCLUDE_DIR - The include directory
-#  ILMBASE_LIBRARIES - The libraries needed
-
-IF(NOT DEFINED ILMBASE_LOCATION)
-    IF ( ${CMAKE_HOST_UNIX} )
-        IF( APPLE )
-          # TODO: set to default install path when shipping out
-          SET( ILMBASE_LOCATION NOTFOUND )
-        ELSE()
-          SET(ILMBASE_LOCATION /usr/local/ilmbase-1.0.1 )
-        ENDIF()
-    ELSE()
-        IF ( WIN32 )
-          # Note: This assumes that the Deploy directory has been copied
-          #       back into the IlmBase root directory.
-          SET( ILMBASE_LOCATION "$ENV{PROGRAMFILES}/ilmbase-1.0.1/Deploy" )
-        ENDIF()
-    ENDIF()
-ENDIF()
-
-IF ( ${CMAKE_HOST_UNIX} )
-    SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -lpthread")
-ELSE()
-ENDIF()
-
-SET(LIBRARY_PATHS
-    "${ILMBASE_LOCATION}/lib"
-    "${ILMBASE_LOCATION}/lib/Release"
-    "${ILMBASE_LOCATION}/lib/x64/Release"
-    "$ENV{ILMBASE_LOCATION}/lib"
-    "$ENV{ILMBASE_LOCATION}/lib/Release"
-    "$ENV{ILMBASE_LOCATION}/lib/x64/Release"
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/lib
-    /usr/lib
-    /sw/lib
-    /opt/local/lib
-    /opt/csw/lib
-    /opt/lib
-    /usr/freeware/lib64
-)
-
-SET(INCLUDE_PATHS
-    "${ILMBASE_LOCATION}/include/OpenEXR/"
-    "${ILMBASE_LOCATION}/include"
-    "$ENV{ILMBASE_LOCATION}/include/OpenEXR/"
-    "$ENV{ILMBASE_LOCATION}/include"
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include/OpenEXR/
-    /usr/local/include
-    /usr/include
-    /usr/include/OpenEXR
-    /sw/include # Fink
-    /opt/local/include # DarwinPorts
-    /opt/csw/include # Blastwave
-    /opt/include
-    /usr/freeware/include
-)
-
-
-FIND_PATH( ILMBASE_INCLUDE_DIR
-        ImathMath.h
-    PATHS
-        "${INCLUDE_PATHS}"
-    NO_DEFAULT_PATH
-    NO_CMAKE_ENVIRONMENT_PATH
-    NO_CMAKE_PATH
-    NO_SYSTEM_ENVIRONMENT_PATH
-    NO_CMAKE_SYSTEM_PATH
-    DOC "The directory where ImathMath.h resides" )
-
-FIND_LIBRARY( ILMBASE_IEX_LIB
-        Iex
-    PATHS
-        "${LIBRARY_PATHS}"
-        NO_DEFAULT_PATH
-        NO_CMAKE_ENVIRONMENT_PATH
-        NO_CMAKE_PATH
-        NO_SYSTEM_ENVIRONMENT_PATH
-        NO_CMAKE_SYSTEM_PATH
-        DOC "The Iex library" )
-
-FIND_LIBRARY( ILMBASE_ILMTHREAD_LIB
-        IlmThread
-    PATHS
-        "${LIBRARY_PATHS}"
-        NO_DEFAULT_PATH
-        NO_CMAKE_ENVIRONMENT_PATH
-        NO_CMAKE_PATH
-        NO_SYSTEM_ENVIRONMENT_PATH
-        NO_CMAKE_SYSTEM_PATH
-        DOC "The IlmThread library" )
-
-FIND_LIBRARY( ILMBASE_IMATH_LIB
-        Imath
-    PATHS
-        "${LIBRARY_PATHS}"
-        NO_DEFAULT_PATH
-        NO_CMAKE_ENVIRONMENT_PATH
-        NO_CMAKE_PATH
-        NO_SYSTEM_ENVIRONMENT_PATH
-        NO_CMAKE_SYSTEM_PATH
-        DOC "The Imath library" )
-
-
-IF ( ${ILMBASE_IEX_LIB} STREQUAL "ILMBASE_IEX_LIB-NOTFOUND" )
-  MESSAGE( FATAL_ERROR "ilmbase libraries (Iex) not found, required: ILMBASE_LOCATION: ${ILMBASE_LOCATION}" )
-ENDIF()
-
-IF ( ${ILMBASE_ILMTHREAD_LIB} STREQUAL "ILMBASE_ILMTHREAD_LIB-NOTFOUND" )
-  MESSAGE( FATAL_ERROR "ilmbase libraries (IlmThread) not found, required: ILMBASE_LOCATION: ${ILMBASE_LOCATION}" )
-ENDIF()
-
-IF ( ${ILMBASE_IMATH_LIB} STREQUAL "ILMBASE_IMATH_LIB-NOTFOUND" )
-  MESSAGE( FATAL_ERROR "ilmbase libraries (Imath) not found, required: ILMBASE_LOCATION: ${ILMBASE_LOCATION}" )
-ENDIF()
-
-IF ( ${ILMBASE_INCLUDE_DIR} STREQUAL "ILMBASE_INCLUDE_DIR-NOTFOUND" )
-  MESSAGE( FATAL_ERROR "ilmbase header files not found, required: ILMBASE_LOCATION: ${ILMBASE_LOCATION}" )
-ENDIF()
-
-SET( ILMBASE_LIBRARIES
-    "${ILMBASE_IMATH_LIB}"
-    "${ILMBASE_ILMTHREAD_LIB}"
-    "${ILMBASE_IEX_LIB}"
-)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(IlmBase DEFAULT_MSG
-    ILMBASE_LOCATION
-    ILMBASE_INCLUDE_DIR
-    ILMBASE_LIBRARIES
-)
-
-SET( ILMBASE_FOUND TRUE )
-


Fix typo in FindOpenSim.cmake

Fix typo in FindOpenSim.cmake

--- cmake/FindOpenSim.cmake
+++ cmake/FindOpenSim.cmake
@@ -21,7 +21,7 @@
           HINTS ${OPENSIM_HOME}
           PATHS ${OPENSIM_POSSIBLE_DIRECTORIES}
           PATH_SUFFIXES sdk/include )
-MESSAGE( STATUS "OpenSim Include path: ${OPENSIM_INCLUDE_DIRS}")
+MESSAGE( STATUS "OpenSim Include path: ${OpenSim_INCLUDE_DIRS}")

 find_path(SIMTK_INCLUDE_DIRS Simbody.h
           HINTS ${OPENSIM_HOME}


Fixed libraries in FindOpenSim

Fixed libraries in FindOpenSim

--- cmake/FindOpenSim.cmake
+++ cmake/FindOpenSim.cmake
@@ -198,7 +198,19 @@
 # ----------------
 # Back out the root installation directory.
 get_filename_component(OPENSIM_SDK_DIR "${OPENSIM_INCLUDE_DIR}" PATH)
-get_filename_component(OPENSIM_ROOT_DIR "${OPENSIM_SDK_DIR}" PATH)
+get_filename_component(OPENSIM_SDK_DIR_PARENT "${OPENSIM_SDK_DIR}" PATH)
+
+if(EXISTS "${OPENSIM_SDK_DIR_PARENT}/sdk" AND IS_DIRECTORY "${OPENSIM_INCLUDE_DIR}/sdk")
+    # There really is the sdk/ directory
+    set(OPENSIM_ROOT_DIR ${OPENSIM_SDK_DIR_PARENT})
+else()
+    # OpenSim 4.3 doesn't have the sdk directory anymore, so make root equal to the sdk directory
+    set(OPENSIM_ROOT_DIR ${OPENSIM_SDK_DIR})
+endif()
+
+
+message(STATUS "OPENSIM_SDK_DIR: ${OPENSIM_SDK_DIR}")
+message(STATUS "OPENSIM_ROOT_DIR: ${OPENSIM_ROOT_DIR}")

 # OPENSIM_LIB_DIR and OPENSIM_BIN_DIR
 # -----------------------------------
@@ -210,6 +222,8 @@
 set(OPENSIM_LIB_DIR ${OPENSIM_ROOT_DIR}/${OPENSIM_PLATFORM_LIB_RELPATH})
 set(OPENSIM_BIN_DIR ${OPENSIM_ROOT_DIR}/bin)

+message(STATUS "OPENSIM_LIB_DIR: ${OPENSIM_LIB_DIR}")
+

 # OPENSIM_LIBRARIES and OPENSIMSIMBODY_LIBRARIES
 # ----------------------------------------------
@@ -232,6 +246,9 @@
         NO_DEFAULT_PATH)
     if(FOUND_LIB)
         list(APPEND OPENSIM_LIBRARY optimized ${FOUND_LIB})
+        message(STATUS "Found ${LIB_NAME}")
+    else()
+        message(STATUS "Failed to find ${LIB_NAME}")
     endif()
     unset(FOUND_LIB CACHE)

@@ -243,6 +260,8 @@
     endif()
     unset(FOUND_LIB CACHE)
 endforeach()
+
+message(STATUS "OPENSIM_LIBRARY: ${OPENSIM_LIBRARY}")

 # Start off this list of libraries with the OpenSim libraries.
 set(OPENSIMSIMBODY_LIBRARY ${OPENSIM_LIBRARY})
@@ -253,6 +272,9 @@
         NO_DEFAULT_PATH)
     if(FOUND_LIB)
         list(APPEND OPENSIMSIMBODY_LIBRARY optimized ${FOUND_LIB})
+        message(STATUS "Found ${LIB_NAME}")
+    else()
+        message(STATUS "Failed to find ${LIB_NAME}")
     endif()
     unset(FOUND_LIB CACHE)

@@ -265,6 +287,7 @@
     unset(FOUND_LIB CACHE)
 endforeach()

+message(STATUS "OPENSIMSIMBODY_LIBRARY: ${OPENSIMSIMBODY_LIBRARY}")

 # Wrap up
 # -------


Add Threads dependency to Panda3D components

--- cmake/Findpanda3d.cmake
+++ cmake/Findpanda3d.cmake
@@ -162,7 +162,15 @@
             )
         endif()

-        if(${component_name} STREQUAL "panda")
+        if(${component_name} STREQUAL "p3dtool")
+            if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+                include(CMakeFindDependencyMacro)
+                find_dependency(Threads REQUIRED)
+                set_property(TARGET panda3d::${component_name} APPEND
+                    PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads
+                )
+            endif()
+        elseif(${component_name} STREQUAL "panda")
             if((${CMAKE_SYSTEM_NAME} MATCHES "Windows") OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux"))
                 # check if Eigen is used
                 file(STRINGS "${panda3d_INCLUDE_DIR}/dtool_config.h"


fixed issue with install if Dicom or OpenIGTLink modules are disabled

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -233,13 +233,17 @@
 		DESTINATION fast/licenses/zlib/
 )
 # OpenIGTLink
+if(FAST_MODULE_OpenIGTLink)
 install(FILES ${FAST_EXTERNAL_BUILD_DIR}/OpenIGTLink/src/OpenIGTLink/LICENSE.txt
 		DESTINATION fast/licenses/OpenIGTLink/
 )
+endif()
 # DCMTK
+if(FAST_MODULE_Dicom)
 install(FILES ${FAST_EXTERNAL_BUILD_DIR}/dcmtk/src/dcmtk/COPYRIGHT
 		DESTINATION fast/licenses/dcmtk/
 )
+endif()
 # NumPy (numpy.i file)
 install(FILES ${PROJECT_SOURCE_DIR}/cmake/InstallFiles/NumPy_LICENSE.txt
 		DESTINATION fast/licenses/numpy/


fix pkg-config generation for mingw

fix pkg-config generation for mingw

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -1002,7 +1002,7 @@
 macro(ocv_get_libname var_name)
   get_filename_component(__libname "${ARGN}" NAME)
   # libopencv_core.so.3.3 -> opencv_core
-  string(REGEX REPLACE "^lib(.+)\\.(a|so)(\\.[.0-9]+)?$" "\\1" __libname "${__libname}")
+  string(REGEX REPLACE "^lib(.+)\\.(a|so|dll)(\\.[.0-9]+)?$" "\\1" __libname "${__libname}")
   # MacOSX: libopencv_core.3.3.1.dylib -> opencv_core
   string(REGEX REPLACE "^lib(.+[^.0-9])\\.([.0-9]+\\.)?dylib$" "\\1" __libname "${__libname}")
   set(${var_name} "${__libname}")


Turn ocv_convert_to_lib_name into a function

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -449,17 +449,15 @@

 # convert list of paths to libraries names without lib prefix
-macro(ocv_convert_to_lib_name var)
-  set(__tmp "")
+function(ocv_convert_to_lib_name var)
+  set(tmp "")
   foreach(path ${ARGN})
-    get_filename_component(__tmp_name "${path}" NAME_WE)
-    string(REGEX REPLACE "^lib" "" __tmp_name ${__tmp_name})
-    list(APPEND __tmp "${__tmp_name}")
-  endforeach()
-  set(${var} ${__tmp})
-  unset(__tmp)
-  unset(__tmp_name)
-endmacro()
+    get_filename_component(tmp_name "${path}" NAME_WE)
+    string(REGEX REPLACE "^lib" "" tmp_name "${tmp_name}")
+    list(APPEND tmp "${tmp_name}")
+  endforeach()
+  set(${var} ${tmp} PARENT_SCOPE)
+endfunction()

 # add install command


refs qorelanguage/qore#3554 cmake fix

refs qorelanguage/qore#3554 cmake fix

--- cmake/find-xmlsec.cmake
+++ cmake/find-xmlsec.cmake
@@ -10,7 +10,9 @@
 check_function_exists(xmlSecFindNode HAVE_XMLSEC)
 if (NOT HAVE_XMLSEC)
     message(STATUS "-- Looking for xmlsec")
-    find_library(XMLSEC_LIBRARY NAMES xmlsec1 xmlsec)
+    find_library(XMLSEC_LIBRARY NAMES xmlsec1 xmlsec
+      HINTS $ENV{XMLSEC_DIR}/lib64
+    )
     if (XMLSEC_INCLUDE_DIR AND XMLSEC_LIBRARY)
         message(STATUS "-- Found xmlsec: ${XMLSEC_LIBRARY}")
         set(HAVE_XMLSEC true)


Prefer system libraries.

Prefer system libraries.

--- common/FindCLBLAS.cmake
+++ common/FindCLBLAS.cmake
@@ -54,26 +54,24 @@
     NO_DEFAULT_PATH)

 FIND_PATH(_CLBLAS_INCLUDE_DIR
-    NAMES   clBLAS.h
-    DOC     "Location of the clBLAS include directory."
-    HINTS   ${CLBLAS_PACKAGE_DIR}/include
-            ${CLBLAS_PACKAGE_DIR}/package/include)
+    NAMES           clBLAS.h
+    DOC             "Location of the clBLAS include directory."
+    PATH_SUFFIXES   include package/include
+    HINTS           /usr/local
+                    ${CLBLAS_PACKAGE_DIR})

 FIND_PATH(CLBLAS_LIBRARY_DIR
-    NAMES   libclBLAS${CMAKE_SHARED_LIBRARY_SUFFIX}
-    DOC     "Location of the clBLAS library"
-    HINTS   ${CLBLAS_PACKAGE_DIR}/lib64
-            ${CLBLAS_PACKAGE_DIR}/package/lib64
-			${CLBLAS_PACKAGE_DIR}/lib64/import
-			${CLBLAS_PACKAGE_DIR}/package/lib64/import)
+    NAMES           libclBLAS${CMAKE_SHARED_LIBRARY_SUFFIX}
+    DOC             "Location of the clBLAS library"
+    PATH_SUFFIXES   lib64 package/lib64 lib64/import package/lib64/import
+    HINTS           ${CLBLAS_PACKAGE_DIR})

 FIND_LIBRARY(_CLBLAS_LIBRARY
-    NAMES   clBLAS
-    DOC     "Library files"
-    HINTS   ${CLBLAS_PACKAGE_DIR}/lib64
-            ${CLBLAS_PACKAGE_DIR}/package/lib64
-			${CLBLAS_PACKAGE_DIR}/lib64/import
-			${CLBLAS_PACKAGE_DIR}/package/lib64/import)
+    NAMES           clBLAS
+    DOC             "Library files"
+    PATH_SUFFIXES   lib lib64 package/lib64 lib64/import package/lib64/import
+    HINTS           /usr/local
+                    ${CLBLAS_PACKAGE_DIR})

 # Set up the includes and library directories
 SET(CLBLAS_LIBRARY ${_CLBLAS_LIBRARY})


Add latest freetype version

Add latest freetype version

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


ARC: MWDT: add missing options to generate symbol file

Fix for #47353 where we add and enable symbol generation,
but miss to add proper options for ARCMWDT toolchain.

Signed-off-by: Evgeniy Paltsev <7de4ab8b01334d64e4e84734c688a8a936513edc@gmail.com>
Signed-off-by: Eugeniy Paltsev <ec089b543c2604b626d7ce60c03e4d074ed102c7@synopsys.com>

--- cmake/bintools/arcmwdt/target_bintools.cmake
+++ cmake/bintools/arcmwdt/target_bintools.cmake
@@ -101,3 +101,11 @@

 set_property(TARGET bintools PROPERTY strip_flag_infile "")
 set_property(TARGET bintools PROPERTY strip_flag_outfile -o )
+
+# list symbols in a binary
+set_property(TARGET bintools PROPERTY symbols_command ${CMAKE_NM})
+# flags are set to be as close to gnu nm format as possible
+set_property(TARGET bintools PROPERTY symbols_flag "-xhpqgn")
+set_property(TARGET bintools PROPERTY symbols_final "")
+set_property(TARGET bintools PROPERTY symbols_infile "")
+set_property(TARGET bintools PROPERTY symbols_outfile ">;" )


add comment

add comment

--- cmake/modules/HextExternalProjectGumbo.cmake
+++ cmake/modules/HextExternalProjectGumbo.cmake
@@ -1,3 +1,6 @@
+# Download gumbo's latest trunk and build it. Add gumbo's .lib/ directory
+# to LINK_DIRECTORIES. Add gumbo's src/ directory to INCLUDE_DIRECTORIES.
+
 EXTERNALPROJECT_ADD(
     gumbo
     GIT_REPOSITORY https://github.com/google/gumbo-parser.git


Remove flags which have already been defined in configure.cmake.

Add a note to investigate -felide-constructors usage on OSX.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -136,7 +136,7 @@
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_C_FLAGS}")
   ENDIF()
   IF(CMAKE_COMPILER_IS_GNUCXX)
-    SET(COMMON_CXX_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer -fno-implicit-templates -felide-constructors -fno-exceptions -fno-rtti")
+    SET(COMMON_CXX_FLAGS               "-g -static-libgcc -fno-omit-frame-pointer")
     SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
     SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${COMMON_CXX_FLAGS}")
   ENDIF()
@@ -161,7 +161,7 @@
   IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
     IF(CMAKE_C_COMPILER_ID MATCHES "Intel")
       SET(COMMON_C_FLAGS                 "-static-intel -static-libgcc -g -mp -restrict")
-      SET(COMMON_CXX_FLAGS               "-static-intel -static-libgcc -g -mp -restrict -fno-implicit-templates -fno-exceptions -fno-rtti")
+      SET(COMMON_CXX_FLAGS               "-static-intel -static-libgcc -g -mp -restrict -fno-exceptions -fno-rtti")
       IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ia64")
         SET(COMMON_C_FLAGS               "${COMMON_C_FLAGS} -no-ftz -no-prefetch")
         SET(COMMON_CXX_FLAGS             "${COMMON_CXX_FLAGS} -no-ftz -no-prefetch")
@@ -177,7 +177,8 @@
   # OSX flags
   IF(APPLE)
     SET(COMMON_C_FLAGS                 "-g -fno-common")
-    SET(COMMON_CXX_FLAGS               "-g -fno-common -felide-constructors -fno-implicit-templates -fno-exceptions -fno-rtti")
+    # XXX: why are we using -felide-constructors on OSX?
+    SET(COMMON_CXX_FLAGS               "-g -fno-common -felide-constructors")
     SET(CMAKE_C_FLAGS_DEBUG            "-O ${COMMON_C_FLAGS}")
     SET(CMAKE_CXX_FLAGS_DEBUG          "-O ${COMMON_CXX_FLAGS}")
     SET(CMAKE_C_FLAGS_RELWITHDEBINFO   "-Os ${COMMON_C_FLAGS}")


Fix compiler options for pmr-config

Fix compiler options for pmr-config

--- src/tool/config/config.cmake
+++ src/tool/config/config.cmake
@@ -1,4 +1,11 @@
 cmake_minimum_required(VERSION 2.8.11)
+
+if("${CMAKE_CXX_FLAGS}" STREQUAL "")
+    set(CMAKE_CXX_FLAGS "-Wall -Werror -O3 -std=c++11")
+else()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -O3 -std=c++11")
+endif()
+
 add_executable(config
     info.cpp
     parameter.cpp


Clarify add_web_client_test_docs

Clarify add_web_client_test_docs

--- tests/JavascriptTests.cmake
+++ tests/JavascriptTests.cmake
@@ -103,8 +103,9 @@
   # :param case: the name of this test case
   # :param specFile: the path of the spec file to run
   # Optional parameters:
-  # PLUGIN (name of plugin) : this plugin is loaded (unless overridden with
-  #     ENABLEDPLUGINS) and the test name includes the plugin name
+  # PLUGIN (name of plugin) : this plugin and all dependencies are loaded
+  # (unless overridden with ENABLEDPLUGINS) and the test name includes the
+  # plugin name
   # PLUGIN_DIRS (list of plugin dirs) : A list of directories plugins
   # should live in.
   # ASSETSTORE (assetstore type) : use the specified assetstore type when
@@ -113,7 +114,7 @@
   #     'true'
   # ENABLEDPLUGINS (list of plugins): A list of plugins to load. This overrides the
   # PLUGIN parameter, so if you intend to load PLUGIN it must be included in this
-  # list.
+  # list. All dependencies of ENABLEDPLUGINS are also loaded.
   # RESOURCE_LOCKS (list of resources): A list of resources that this test
   #     needs exclusive access to.  Defaults to mongo and cherrypy.
   # TIMEOUT (seconds): An overall test timeout.


Testsuite: Typo

Testsuite: Typo

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

--- deal.II/cmake/scripts/run_test.cmake
+++ deal.II/cmake/scripts/run_test.cmake
@@ -54,10 +54,10 @@

 IF(NOT "${_passed_regex}" STREQUAL "")
   SET(_stage PASSED)
+ELSEIF(NOT "${_diff_regex}" STREQUAL "")
+  SET(_stage DIFF)
 ELSEIF(NOT "${_run_regex}" STREQUAL "")
   SET(_stage RUN)
-ELSEIF(NOT "${_diff_regex}" STREQUAL "")
-  SET(_stage DIFF)
 ELSEIF(NOT "${_configure_regex}" STREQUAL "")
   SET(_stage CONFIGURE)
 ELSE() # unconditionally, because "BUILD failed." doesn't have to be printed...


BUG: fix missing ITK include for wrapping

--- otbIncludeDirectories.cmake
+++ otbIncludeDirectories.cmake
@@ -161,8 +161,17 @@
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/vxl/v3p/netlib
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/vxl/vcl
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/vxl/core
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities
         ${OTB_BINARY_DIR}/Utilities/ITK/Utilities
         ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/itkExtHdrs
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/DICOMParser
+        ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/DICOMParser
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/MetaIO
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/nifti/niftilib
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/nifti/znzlib
+        ${OTB_SOURCE_DIR}/Utilities/ITK/Utilities/gdcm/src
+        ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/gdcm
+        ${OTB_BINARY_DIR}/Utilities/ITK/Utilities/NrrdIO
         )
 ENDIF(OTB_USE_EXTERNAL_ITK)


Doxygen: Speed up in ivw_get_include_dirs

--- tools/doxygen/doxygen.cmake
+++ tools/doxygen/doxygen.cmake
@@ -41,34 +41,39 @@
     set(${retval} ${res} PARENT_SCOPE)
 endfunction()

+set(ivw_doxy_all_dirs "" CACHE INTERNAL "")
 function(ivw_get_include_dirs retval)
-    set(res "")
-    ivw_get_subdirs_recursive(subdirs ${IVW_ROOT_DIR})
-    foreach(subdir IN LISTS subdirs)
-        get_property(targets DIRECTORY ${subdir} PROPERTY BUILDSYSTEM_TARGETS)
-        foreach(target IN LISTS targets)
-            ivw_get_target_property_recursive(dirs ${target} INTERFACE_INCLUDE_DIRECTORIES True)
-            list(APPEND res ${dirs})
-            ivw_get_target_property_recursive(dirs ${target} INCLUDE_DIRECTORIES False)
-            list(APPEND res ${dirs})
-            list(REMOVE_DUPLICATES res)
+    list(LENGTH ivw_doxy_all_dirs len)
+    if(${len} EQUAL 0)
+        set(temp "")
+        ivw_get_subdirs_recursive(subdirs ${IVW_ROOT_DIR})
+        foreach(subdir IN LISTS subdirs)
+            get_property(targets DIRECTORY ${subdir} PROPERTY BUILDSYSTEM_TARGETS)
+            foreach(target IN LISTS targets)
+                ivw_get_target_property_recursive(dirs ${target} INTERFACE_INCLUDE_DIRECTORIES True)
+                list(APPEND temp ${dirs})
+                ivw_get_target_property_recursive(dirs ${target} INCLUDE_DIRECTORIES False)
+                list(APPEND temp ${dirs})
+                list(REMOVE_DUPLICATES temp)
+            endforeach()
         endforeach()
-    endforeach()
+        set(ivw_doxy_all_dirs ${temp} CACHE INTERNAL "")
+    endif()

     # filter generator expr
-    set(res2 "")
-    foreach(item IN LISTS res)
+    set(inc_dirs "")
+    foreach(item IN LISTS ${ivw_doxy_all_dirs})
         string(REGEX MATCH [=[^\$<BUILD_INTERFACE:([^$<>]+)>$]=] repl ${item})
         if(CMAKE_MATCH_1)
-            list(APPEND res2 "\"${CMAKE_MATCH_1}\"")
+            list(APPEND inc_dirs "\"${CMAKE_MATCH_1}\"")
         endif()
         string(REGEX MATCH [=[^[^$<>]*$]=] repl ${item})
         if(CMAKE_MATCH_0)
-            list(APPEND "res2" "\"${CMAKE_MATCH_0}\"")
+            list(APPEND "inc_dirs" "\"${CMAKE_MATCH_0}\"")
         endif()
     endforeach()
-    list(REMOVE_DUPLICATES res2)
-    set(${retval} ${res2} PARENT_SCOPE)
+    list(REMOVE_DUPLICATES inc_dirs)
+    set(${retval} ${inc_dirs} PARENT_SCOPE)
 endfunction()

 if(${MSVC})


Adding CONTEXT_SRCS and CONTEXT_HDRS into library build.  https://tracker.physiomeproject.org/show_bug.cgi?id=2648

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@8858 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/cmake/cmgui_lib_source_files.cmake
+++ source/cmake/cmgui_lib_source_files.cmake
@@ -1,12 +1,12 @@

 # Defines CMGUI_LIB_SRCS
-SET( CMGUI_LIB_BASE_SRCS ${API_SRCS} ${COMFILE_SRCS} ${COMMAND_SRCS}
+SET( CMGUI_LIB_BASE_SRCS ${API_SRCS} ${COMFILE_SRCS} ${COMMAND_SRCS} ${CONTEXT_SRCS}
 	${COMPUTED_FIELD_SRCS} ${CONTEXT_SRCS} ${CURVE_SRCS} ${ELEMENT_SRCS} ${EMOTER_SRCS}
 	${FIELD_IO_SRCS} ${FINITE_ELEMENT_GRAPHICS_SRCS} ${FINITE_ELEMENT_ADDITIONAL_SRCS} ${GENERAL_SRCS}
 	${GRAPHICS_SRCS} ${HELP_SRCS} ${IMAGE_PROCESSING_SRCS} ${INTERACTION_SRCS}
 	${IO_DEVICES_SRCS} ${MESH_SRCS} ${NODE_SRCS} ${SELECTION_SRCS} ${INTERPRETER_SRCS}
 	${THREE_D_DRAWING_SRCS} ${TIME_SRCS} ${USER_INTERFACE_SRCS} ${OPENCASCADE_SRCS} )
-SET( CMGUI_LIB_BASE_HDRS ${API_HDRS} ${COMFILE_HDRS} ${COMMAND_HDRS}
+SET( CMGUI_LIB_BASE_HDRS ${API_HDRS} ${COMFILE_HDRS} ${COMMAND_HDRS} ${CONTEXT_HDRS}
 	${COMPUTED_FIELD_HDRS} ${CONTEXT_HDRS} ${CURVE_HDRS} ${ELEMENT_HDRS} ${EMOTER_HDRS}
 	${FIELD_IO_HDRS} ${FINITE_ELEMENT_GRAPHICS_HDRS} ${FINITE_ELEMENT_ADDITIONAL_HDRS} ${GENERAL_HDRS}
 	${GRAPHICS_HDRS} ${HELP_HDRS} ${IMAGE_PROCESSING_HDRS} ${INTERACTION_HDRS}


ENH: Adding -fcompact option.      From email in the developers list:      http://www.itk.org/mailman/private/insight-developers/2007-September/009556.html

--- Wrapping/WrapITK/CreateWrapperLibrary.cmake
+++ Wrapping/WrapITK/CreateWrapperLibrary.cmake
@@ -413,6 +413,7 @@
         -I${CSWIG_DEFAULT_LIB}
         ${CSWIG_IGNORE_WARNINGS}
         -noruntime
+        -fcompact
         ${cindex}
         -depend ${input_xml}.depend
         -outdir ${outdir}


- Fix resource directory for OSX

- Fix resource directory for OSX

--- toolchain/cmake/Packaging/MacAppBuild.cmake
+++ toolchain/cmake/Packaging/MacAppBuild.cmake
@@ -174,8 +174,12 @@
             )

         get_filename_component ( ICON_BASENAME "${OSX_ICON}" NAME )
+        add_custom_target ( ${TARGET}.resources
+            COMMAND
+                ${CMAKE_COMMAND} -E make_directory ${RESOURCE_DIR}
+            )
         add_custom_target ( ${TARGET}.icns
-            DEPENDS ${OSX_ICON}
+            DEPENDS ${OSX_ICON} ${TARGET}.resources
             COMMAND
                 qlmanage -t -s 512 -o . ${OSX_ICON}
             COMMAND


experimental support for ARMv7 hardfloat ABI

--- toolchains/android/armv7-vfp3d16.arch.cmake
+++ toolchains/android/armv7-vfp3d16.arch.cmake
@@ -14,6 +14,28 @@
 list( APPEND TNUN_compiler_optimize_for_size  -mthumb )
 list( APPEND TNUN_compiler_optimize_for_speed -marm   )

+##
+# Implementation note:
+#
+# Official ndk-build script removed support for armeabi-v7a-hardfloat because
+# Google does not want to support that anymore - they say that performance benefits
+# by using this is not big. However, if all dependencies can be built with hardfloat,
+# we can use it. Why not benefit where possible?
+# We'll keep this disabled by default because using hardfloat ABI requires that all
+# other dependencies (including 3rd party binaries) are using hardfloat ABI, which is
+# not so common.
+#
+# https://stackoverflow.com/questions/32046055/is-it-safe-to-replace-armeabi-v7a-with-armeabi-v7a-hard
+# http://blog.alexrp.com/2014/02/18/android-hard-float-support/
+#
+#                                         ( 01.09.2016. Nenad Miksa )
+
+option( TNUN_ANDROID_ARM7_HARDFLOAT_ABI "Use hardfloat ABI for armv7 binaries" false )
+if( ${TNUN_ANDROID_ARM7_HARDFLOAT_ABI} )
+    add_compile_options( -mhard-float -D_NDK_MATH_NO_SOFTFP=1 )
+    link_libraries( -Wl,-lm_hard )
+endif()
+
 # this is *required* to use the following linker flags that routes around
 # a CPU bug in some Cortex-A8 implementations:
 link_libraries( "-Wl,--fix-cortex-a8" )


binding.gyp.cmake: get v8 version from node and export to c++ compiler

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/javascript/binding.gyp.cmake
+++ src/javascript/binding.gyp.cmake
@@ -9,11 +9,16 @@
       'include_dirs': [
 @mraa_LIB_INCLUDE_DIRS_GYP@
                       ],
+      'variables': {
+          "v8_version%": "<!(node -e 'console.log(process.versions.v8)' | sed 's/\.//g')"
+      },
       'cflags_cc!': [ '-fno-rtti', '-fno-exceptions' ],
       'cflags!': [ '-fno-exceptions' ],
       'defines' : [ 'SWIG',
                     'SWIGJAVASCRIPT',
-		    'BUILDING_NODE_EXTENSION=1' ],
+                    'BUILDING_NODE_EXTENSION=1',
+                    'SWIG_V8_VERSION=0x0<(v8_version)',
+                    'V8_VERSION=0x0<(v8_version)' ],
       'conditions' : [
           [ 'target_arch=="x64"',
             { 'defines' : [ 'X86PLAT=ON' ], },


Horrifying hack to handle Windows-style paths in svn delete.

--- test/remote/SvnPackage.cmake
+++ test/remote/SvnPackage.cmake
@@ -173,7 +173,17 @@
                    --context-item "${chgdir}/svn-info.xml"
                    OUTPUT_VARIABLE clientroot)
   foreach (filepath ${deletefiles})
-    # These are absolute paths from the client; convert to relative paths
+    # These are absolute paths from the client, which might be
+    # Windows-style paths with drive letters. The following is a
+    # horrific hack which lets us get the remote path component no
+    # matter which platform they came from. (Note: This only works on
+    # Linux, which is the platform the remote queue runs on. If we
+    # ever have a Windows remote queue machine, this will die.)
+    # 1. Stick a leading / on them, so Linux thinks they're absolute.
+    # 2. Convert to "CMake paths", which have forward-slashes.
+    # 3. Do relative_path as normal.
+    file (TO_CMAKE_PATH "/${clientroot}" clientroot)
+    file (TO_CMAKE_PATH "/${filepath}" filepath)
     file (RELATIVE_PATH relpath "${clientroot}" "${filepath}")
     execute_process (COMMAND "${svn}" delete "${svndir}/${relpath}"
       OUTPUT_VARIABLE output ERROR_VARIABLE output RESULT_VARIABLE result)


Missing CUDA_NVCC_FLAGS & CUDA_HOST_COMPILER flags at GPU arch detection.

Summary:
This tiny patch fix missing ```CUDA_NVCC_FLAGS``` & ```CUDA_HOST_ARCH``` from ```caffe_detect_installed_gpus()```.

-----------------

People may want define their custom flags or compilers that are more CUDA compatible. Automatic gpu arch detection ignores these flags and fail. Example of such custom flags:

```
cmake . \
-DCUDA_ARCH_NAME="Auto" \
-DCUDA_HOST_COMPILER="/usr/bin/gcc5"
```

* Autodetection part fails regardless proper compiler flags are passed, due to system gcc 7.0 that doesnt work with CUDA thus all arch will be enabled:
```
-- The C compiler identification is GNU 7.0.1
-- The CXX compiler identification is GNU 7.0.1
...//\\...
-- CUDA detected: 8.0
...//\\...
-- Automatic GPU detection failed. Building for all known architectures.
-- Added CUDA NVCC flags for: sm_20 sm_21 sm_30 sm_35 sm_50 sm_60 sm_61
```
* Patch fix the autodetection time as expected:
```
$ cmake ../ -DCUDA_NVCC_FLAGS="-Xcompiler=-std=c++03 -I/usr/include/cuda/"
-- The C compiler identification is
Closes https://github.com/caffe2/caffe2/pull/288

Differential Revision: D4914215

Pulled By: Yangqing

fbshipit-source-id: c407a750e03cb163f9d57f9f6403042704046014

--- cmake/Cuda.cmake
+++ cmake/Cuda.cmake
@@ -27,7 +27,7 @@
       "  return 0;\n"
       "}\n")

-    execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "--run" "${__cufile}"
+    execute_process(COMMAND "${CUDA_NVCC_EXECUTABLE}" "-ccbin=${CUDA_HOST_COMPILER}" ${CUDA_NVCC_FLAGS} "--run" "${__cufile}"
                     WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/CMakeFiles/"
                     RESULT_VARIABLE __nvcc_res OUTPUT_VARIABLE __nvcc_out
                     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)


Switch to https for zlib download

Switch to https for zlib download

Don't panic, we had a check against a hardcoded hash previously ;) (yup, it is unfortunately MD5, but this would still need zlib's authors cooperation to forge a collision according to current state of the MD5 (in)security)

--- cmake/zlib.cmake
+++ cmake/zlib.cmake
@@ -10,7 +10,7 @@
   set(ZLIB_SOURCE  "${CMAKE_CURRENT_BINARY_DIR}/zlib-src")
   set(ZLIB_BUILD   "${CMAKE_CURRENT_BINARY_DIR}/zlib")
   set(ZLIB_INSTALL "${CMAKE_CURRENT_BINARY_DIR}/prefix")
-  set(ZLIB_FILE "http://zlib.net/fossils/zlib-1.2.8.tar.gz")
+  set(ZLIB_FILE "https://zlib.net/fossils/zlib-1.2.8.tar.gz")
   set(ZLIB_MD5 "44d667c142d7cda120332623eab69f40")

   if(CMAKE_CFG_INTDIR STREQUAL ".")
@@ -26,6 +26,7 @@
       BINARY_DIR ${ZLIB_BUILD}
       INSTALL_DIR ${ZLIB_INSTALL}
       URL ${ZLIB_FILE}
+      # `ExternalProject_Add` currently doesn't support anything other than MD5.
       URL_MD5 ${ZLIB_MD5}
       PATCH_COMMAND ${CMAKE_COMMAND} -E remove "<SOURCE_DIR>/zconf.h"
       CMAKE_CACHE_ARGS


add -fPIC flag for Intel and static linking

--- cmake/CXXCompilers.cmake
+++ cmake/CXXCompilers.cmake
@@ -63,6 +63,11 @@
             "${CMAKE_CXX_FLAGS} -openmp"
             )
     endif()
+    if(ENABLE_STATIC_LINKING)
+        set(CMAKE_CXX_FLAGS
+            "${CMAKE_CXX_FLAGS} -fPIC"
+            )
+    endif()
 endif ()

 if(CMAKE_CXX_COMPILER_ID MATCHES PGI)


Added pkg-config to cmake OpenH264 detection.

--- cmake/FindOpenH264.cmake
+++ cmake/FindOpenH264.cmake
@@ -7,17 +7,22 @@
 #  OPENH264_INCLUDE_DIR - the OpenH264 include directory
 #  OPENH264_LIBRARIES - libopenh264 library

+if (UNIX AND NOT ANDROID)
+  find_package(PkgConfig QUIET)
+  pkg_check_modules(PC_OPENH264 QUIET openh264)
+endif (UNIX AND NOT ANDROID)
+
 if (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)
 	set(OPENH264_FIND_QUIETLY TRUE)
 endif (OPENH264_INCLUDE_DIR AND OPENH264_LIBRARY)

 find_path(OPENH264_INCLUDE_DIR NAMES wels/codec_api.h wels/codec_app_def.h wels/codec_def.h
 	PATH_SUFFIXES include
-	HINTS ${OPENH264_ROOT})
+	HINTS ${OPENH264_ROOT} ${PC_OPENH264_INCLUDE_DIRS})
 find_library(OPENH264_LIBRARY
 	 NAMES openh264_dll openh264 welsdec
 	 PATH_SUFFIXES lib
-	 HINTS ${OPENH264_ROOT})
+	 HINTS ${OPENH264_ROOT} ${PC_OPENH264_LIBRARY_DIRS})

 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenH264 DEFAULT_MSG OPENH264_LIBRARY OPENH264_INCLUDE_DIR)


Fix static/shared lib detection

Fix static/shared lib detection

The check for BUILD_SHARED_LIBS had its logic backwards. If this
variable is not defined we must assume a build of static libs.

--- cmake/OpenCVConfig.cmake
+++ cmake/OpenCVConfig.cmake
@@ -47,7 +47,7 @@

 if(NOT DEFINED OpenCV_STATIC)
   # look for global setting
-  if(NOT DEFINED BUILD_SHARED_LIBS OR BUILD_SHARED_LIBS)
+  if(BUILD_SHARED_LIBS)
     set(OpenCV_STATIC OFF)
   else()
     set(OpenCV_STATIC ON)