Delete HunterGate.cmake

Delete HunterGate.cmake

--- cmake/HunterGate.cmake
+++ cmake/HunterGate.cmake
@@ -1,480 +0,0 @@
-# Copyright (c) 2013-2015, Ruslan Baratov
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright notice, this
-#   list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright notice,
-#   this list of conditions and the following disclaimer in the documentation
-#   and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# This is a gate file to Hunter package manager.
-# Include this file using `include` command and add package you need, example:
-#
-#     cmake_minimum_required(VERSION 3.0)
-#
-#     include("cmake/HunterGate.cmake")
-#     HunterGate(
-#         URL "https://github.com/path/to/hunter/archive.tar.gz"
-#         SHA1 "798501e983f14b28b10cda16afa4de69eee1da1d"
-#     )
-#
-#     project(MyProject)
-#
-#     hunter_add_package(Foo)
-#     hunter_add_package(Boo COMPONENTS Bar Baz)
-#
-# Projects:
-#     * https://github.com/hunter-packages/gate/
-#     * https://github.com/ruslo/hunter
-
-cmake_minimum_required(VERSION 3.0) # Minimum for Hunter
-include(CMakeParseArguments) # cmake_parse_arguments
-
-option(HUNTER_ENABLED "Enable Hunter package manager support" ON)
-option(HUNTER_STATUS_PRINT "Print working status" ON)
-option(HUNTER_STATUS_DEBUG "Print a lot info" OFF)
-
-set(HUNTER_WIKI "https://github.com/ruslo/hunter/wiki")
-
-function(hunter_gate_status_print)
-  foreach(print_message ${ARGV})
-    if(HUNTER_STATUS_PRINT OR HUNTER_STATUS_DEBUG)
-      message(STATUS "[hunter] ${print_message}")
-    endif()
-  endforeach()
-endfunction()
-
-function(hunter_gate_status_debug)
-  foreach(print_message ${ARGV})
-    if(HUNTER_STATUS_DEBUG)
-      string(TIMESTAMP timestamp)
-      message(STATUS "[hunter *** DEBUG *** ${timestamp}] ${print_message}")
-    endif()
-  endforeach()
-endfunction()
-
-function(hunter_gate_wiki wiki_page)
-  message("------------------------------ WIKI -------------------------------")
-  message("    ${HUNTER_WIKI}/${wiki_page}")
-  message("-------------------------------------------------------------------")
-  message("")
-  message(FATAL_ERROR "")
-endfunction()
-
-function(hunter_gate_internal_error)
-  message("")
-  foreach(print_message ${ARGV})
-    message("[hunter ** INTERNAL **] ${print_message}")
-  endforeach()
-  message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
-  message("")
-  hunter_gate_wiki("error.internal")
-endfunction()
-
-function(hunter_gate_fatal_error)
-  cmake_parse_arguments(hunter "" "WIKI" "" "${ARGV}")
-  if(NOT hunter_WIKI)
-    hunter_gate_internal_error("Expected wiki")
-  endif()
-  message("")
-  foreach(x ${hunter_UNPARSED_ARGUMENTS})
-    message("[hunter ** FATAL ERROR **] ${x}")
-  endforeach()
-  message("[hunter ** FATAL ERROR **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
-  message("")
-  hunter_gate_wiki("${hunter_WIKI}")
-endfunction()
-
-function(hunter_gate_user_error)
-  hunter_gate_fatal_error(${ARGV} WIKI "error.incorrect.input.data")
-endfunction()
-
-function(hunter_gate_self root version sha1 result)
-  string(COMPARE EQUAL "${root}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("root is empty")
-  endif()
-
-  string(COMPARE EQUAL "${version}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("version is empty")
-  endif()
-
-  string(COMPARE EQUAL "${sha1}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("sha1 is empty")
-  endif()
-
-  string(SUBSTRING "${sha1}" 0 7 archive_id)
-
-  if(EXISTS "${root}/cmake/Hunter")
-    set(hunter_self "${root}")
-  else()
-    set(
-        hunter_self
-        "${root}/_Base/Download/Hunter/${version}/${archive_id}/Unpacked"
-    )
-  endif()
-
-  set("${result}" "${hunter_self}" PARENT_SCOPE)
-endfunction()
-
-# Set HUNTER_GATE_ROOT cmake variable to suitable value.
-function(hunter_gate_detect_root)
-  # Check CMake variable
-  if(HUNTER_ROOT)
-    set(HUNTER_GATE_ROOT "${HUNTER_ROOT}" PARENT_SCOPE)
-    hunter_gate_status_debug("HUNTER_ROOT detected by cmake variable")
-    return()
-  endif()
-
-  # Check environment variable
-  string(COMPARE NOTEQUAL "$ENV{HUNTER_ROOT}" "" not_empty)
-  if(not_empty)
-    set(HUNTER_GATE_ROOT "$ENV{HUNTER_ROOT}" PARENT_SCOPE)
-    hunter_gate_status_debug("HUNTER_ROOT detected by environment variable")
-    return()
-  endif()
-
-  # Check HOME environment variable
-  string(COMPARE NOTEQUAL "$ENV{HOME}" "" result)
-  if(result)
-    set(HUNTER_GATE_ROOT "$ENV{HOME}/.hunter" PARENT_SCOPE)
-    hunter_gate_status_debug("HUNTER_ROOT set using HOME environment variable")
-    return()
-  endif()
-
-  # Check SYSTEMDRIVE and USERPROFILE environment variable (windows only)
-  if(WIN32)
-    string(COMPARE NOTEQUAL "$ENV{SYSTEMDRIVE}" "" result)
-    if(result)
-      set(HUNTER_GATE_ROOT "$ENV{SYSTEMDRIVE}/.hunter" PARENT_SCOPE)
-      hunter_gate_status_debug(
-          "HUNTER_ROOT set using SYSTEMDRIVE environment variable"
-      )
-      return()
-    endif()
-
-    string(COMPARE NOTEQUAL "$ENV{USERPROFILE}" "" result)
-    if(result)
-      set(HUNTER_GATE_ROOT "$ENV{USERPROFILE}/.hunter" PARENT_SCOPE)
-      hunter_gate_status_debug(
-          "HUNTER_ROOT set using USERPROFILE environment variable"
-      )
-      return()
-    endif()
-  endif()
-
-  hunter_gate_fatal_error(
-      "Can't detect HUNTER_ROOT"
-      WIKI "error.detect.hunter.root"
-  )
-endfunction()
-
-macro(hunter_gate_lock dir)
-  if(NOT HUNTER_SKIP_LOCK)
-    if("${CMAKE_VERSION}" VERSION_LESS "3.2")
-      hunter_gate_fatal_error(
-          "Can't lock, upgrade to CMake 3.2 or use HUNTER_SKIP_LOCK"
-          WIKI "error.can.not.lock"
-      )
-    endif()
-    hunter_gate_status_debug("Locking directory: ${dir}")
-    file(LOCK "${dir}" DIRECTORY GUARD FUNCTION)
-    hunter_gate_status_debug("Lock done")
-  endif()
-endmacro()
-
-function(hunter_gate_download dir)
-  string(
-      COMPARE
-      NOTEQUAL
-      "$ENV{HUNTER_DISABLE_AUTOINSTALL}"
-      ""
-      disable_autoinstall
-  )
-  if(disable_autoinstall AND NOT HUNTER_RUN_INSTALL)
-    hunter_gate_fatal_error(
-        "Hunter not found in '${dir}'"
-        "Set HUNTER_RUN_INSTALL=ON to auto-install it from '${HUNTER_GATE_URL}'"
-        "Settings:"
-        "  HUNTER_ROOT: ${HUNTER_GATE_ROOT}"
-        "  HUNTER_SHA1: ${HUNTER_GATE_SHA1}"
-        WIKI "error.run.install"
-    )
-  endif()
-  string(COMPARE EQUAL "${dir}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("Empty 'dir' argument")
-  endif()
-
-  string(COMPARE EQUAL "${HUNTER_GATE_SHA1}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("HUNTER_GATE_SHA1 empty")
-  endif()
-
-  string(COMPARE EQUAL "${HUNTER_GATE_URL}" "" is_bad)
-  if(is_bad)
-    hunter_gate_internal_error("HUNTER_GATE_URL empty")
-  endif()
-
-  set(done_location "${dir}/DONE")
-  set(sha1_location "${dir}/SHA1")
-
-  set(build_dir "${dir}/Build")
-  set(cmakelists "${dir}/CMakeLists.txt")
-
-  hunter_gate_lock("${dir}")
-  if(EXISTS "${done_location}")
-    # while waiting for lock other instance can do all the job
-    hunter_gate_status_debug("File '${done_location}' found, skip install")
-    return()
-  endif()
-
-  file(REMOVE_RECURSE "${build_dir}")
-  file(REMOVE_RECURSE "${cmakelists}")
-
-  file(MAKE_DIRECTORY "${build_dir}") # check directory permissions
-
-  # Disabling languages speeds up a little bit, reduces noise in the output
-  # and avoids path too long windows error
-  file(
-      WRITE
-      "${cmakelists}"
-      "cmake_minimum_required(VERSION 3.0)\n"
-      "project(HunterDownload LANGUAGES NONE)\n"
-      "include(ExternalProject)\n"
-      "ExternalProject_Add(\n"
-      "    Hunter\n"
-      "    URL\n"
-      "    \"${HUNTER_GATE_URL}\"\n"
-      "    URL_HASH\n"
-      "    SHA1=${HUNTER_GATE_SHA1}\n"
-      "    DOWNLOAD_DIR\n"
-      "    \"${dir}\"\n"
-      "    SOURCE_DIR\n"
-      "    \"${dir}/Unpacked\"\n"
-      "    CONFIGURE_COMMAND\n"
-      "    \"\"\n"
-      "    BUILD_COMMAND\n"
-      "    \"\"\n"
-      "    INSTALL_COMMAND\n"
-      "    \"\"\n"
-      ")\n"
-  )
-
-  if(HUNTER_STATUS_DEBUG)
-    set(logging_params "")
-  else()
-    set(logging_params OUTPUT_QUIET)
-  endif()
-
-  hunter_gate_status_debug("Run generate")
-  execute_process(
-      COMMAND "${CMAKE_COMMAND}" "-H${dir}" "-B${build_dir}"
-      WORKING_DIRECTORY "${dir}"
-      RESULT_VARIABLE download_result
-      ${logging_params}
-  )
-
-  if(NOT download_result EQUAL 0)
-    hunter_gate_internal_error("Configure project failed")
-  endif()
-
-  hunter_gate_status_print(
-      "Initializing Hunter workspace (${HUNTER_GATE_SHA1})"
-      "  ${HUNTER_GATE_URL}"
-      "  -> ${dir}"
-  )
-  execute_process(
-      COMMAND "${CMAKE_COMMAND}" --build "${build_dir}"
-      WORKING_DIRECTORY "${dir}"
-      RESULT_VARIABLE download_result
-      ${logging_params}
-  )
-
-  if(NOT download_result EQUAL 0)
-    hunter_gate_internal_error("Build project failed")
-  endif()
-
-  file(REMOVE_RECURSE "${build_dir}")
-  file(REMOVE_RECURSE "${cmakelists}")
-
-  file(WRITE "${sha1_location}" "${HUNTER_GATE_SHA1}")
-  file(WRITE "${done_location}" "DONE")
-
-  hunter_gate_status_debug("Finished")
-endfunction()
-
-# Must be a macro so master file 'cmake/Hunter' can
-# apply all variables easily just by 'include' command
-# (otherwise PARENT_SCOPE magic needed)
-macro(HunterGate)
-  if(HUNTER_GATE_DONE)
-    # variable HUNTER_GATE_DONE set explicitly for external project
-    # (see `hunter_download`)
-    set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
-  endif()
-
-  # First HunterGate command will init Hunter, others will be ignored
-  get_property(_hunter_gate_done GLOBAL PROPERTY HUNTER_GATE_DONE SET)
-
-  if(NOT HUNTER_ENABLED)
-    # Empty function to avoid error "unknown function"
-    function(hunter_add_package)
-    endfunction()
-  elseif(_hunter_gate_done)
-    hunter_gate_status_debug("Secondary HunterGate (use old settings)")
-    hunter_gate_self(
-        "${HUNTER_CACHED_ROOT}"
-        "${HUNTER_VERSION}"
-        "${HUNTER_SHA1}"
-        _hunter_self
-    )
-    include("${_hunter_self}/cmake/Hunter")
-  else()
-    set(HUNTER_GATE_LOCATION "${CMAKE_CURRENT_LIST_DIR}")
-
-    if(PROJECT_NAME)
-      hunter_gate_fatal_error(
-          "Please set HunterGate *before* 'project' command"
-          WIKI "error.huntergate.before.project"
-      )
-    endif()
-
-    cmake_parse_arguments(
-        HUNTER_GATE "LOCAL" "URL;SHA1;GLOBAL;FILEPATH" "" ${ARGV}
-    )
-    if(NOT HUNTER_GATE_SHA1)
-      hunter_gate_user_error("SHA1 suboption of HunterGate is mandatory")
-    endif()
-    if(NOT HUNTER_GATE_URL)
-      hunter_gate_user_error("URL suboption of HunterGate is mandatory")
-    endif()
-    if(HUNTER_GATE_UNPARSED_ARGUMENTS)
-      hunter_gate_user_error(
-          "HunterGate unparsed arguments: ${HUNTER_GATE_UNPARSED_ARGUMENTS}"
-      )
-    endif()
-    if(HUNTER_GATE_GLOBAL)
-      if(HUNTER_GATE_LOCAL)
-        hunter_gate_user_error("Unexpected LOCAL (already has GLOBAL)")
-      endif()
-      if(HUNTER_GATE_FILEPATH)
-        hunter_gate_user_error("Unexpected FILEPATH (already has GLOBAL)")
-      endif()
-    endif()
-    if(HUNTER_GATE_LOCAL)
-      if(HUNTER_GATE_GLOBAL)
-        hunter_gate_user_error("Unexpected GLOBAL (already has LOCAL)")
-      endif()
-      if(HUNTER_GATE_FILEPATH)
-        hunter_gate_user_error("Unexpected FILEPATH (already has LOCAL)")
-      endif()
-    endif()
-    if(HUNTER_GATE_FILEPATH)
-      if(HUNTER_GATE_GLOBAL)
-        hunter_gate_user_error("Unexpected GLOBAL (already has FILEPATH)")
-      endif()
-      if(HUNTER_GATE_LOCAL)
-        hunter_gate_user_error("Unexpected LOCAL (already has FILEPATH)")
-      endif()
-    endif()
-
-    hunter_gate_detect_root() # set HUNTER_GATE_ROOT
-
-    # Beautify path, fix probable problems with windows path slashes
-    get_filename_component(
-        HUNTER_GATE_ROOT "${HUNTER_GATE_ROOT}" ABSOLUTE
-    )
-    hunter_gate_status_debug("HUNTER_ROOT: ${HUNTER_GATE_ROOT}")
-    if(NOT HUNTER_ALLOW_SPACES_IN_PATH)
-      string(FIND "${HUNTER_GATE_ROOT}" " " _contain_spaces)
-      if(NOT _contain_spaces EQUAL -1)
-        hunter_gate_fatal_error(
-            "HUNTER_ROOT (${HUNTER_GATE_ROOT}) contains spaces."
-            "Set HUNTER_ALLOW_SPACES_IN_PATH=ON to skip this error"
-            "(Use at your own risk!)"
-            WIKI "error.spaces.in.hunter.root"
-        )
-      endif()
-    endif()
-
-    string(
-        REGEX
-        MATCH
-        "[0-9]+\\.[0-9]+\\.[0-9]+[-_a-z0-9]*"
-        HUNTER_GATE_VERSION
-        "${HUNTER_GATE_URL}"
-    )
-    string(COMPARE EQUAL "${HUNTER_GATE_VERSION}" "" _is_empty)
-    if(_is_empty)
-      set(HUNTER_GATE_VERSION "unknown")
-    endif()
-
-    hunter_gate_self(
-        "${HUNTER_GATE_ROOT}"
-        "${HUNTER_GATE_VERSION}"
-        "${HUNTER_GATE_SHA1}"
-        hunter_self_
-    )
-
-    set(_master_location "${hunter_self_}/cmake/Hunter")
-    if(EXISTS "${HUNTER_GATE_ROOT}/cmake/Hunter")
-      # Hunter downloaded manually (e.g. by 'git clone')
-      set(_unused "xxxxxxxxxx")
-      set(HUNTER_GATE_SHA1 "${_unused}")
-      set(HUNTER_GATE_VERSION "${_unused}")
-    else()
-      get_filename_component(_archive_id_location "${hunter_self_}/.." ABSOLUTE)
-      set(_done_location "${_archive_id_location}/DONE")
-      set(_sha1_location "${_archive_id_location}/SHA1")
-
-      # Check Hunter already downloaded by HunterGate
-      if(NOT EXISTS "${_done_location}")
-        hunter_gate_download("${_archive_id_location}")
-      endif()
-
-      if(NOT EXISTS "${_done_location}")
-        hunter_gate_internal_error("hunter_gate_download failed")
-      endif()
-
-      if(NOT EXISTS "${_sha1_location}")
-        hunter_gate_internal_error("${_sha1_location} not found")
-      endif()
-      file(READ "${_sha1_location}" _sha1_value)
-      string(COMPARE EQUAL "${_sha1_value}" "${HUNTER_GATE_SHA1}" _is_equal)
-      if(NOT _is_equal)
-        hunter_gate_internal_error(
-            "Short SHA1 collision:"
-            "  ${_sha1_value} (from ${_sha1_location})"
-            "  ${HUNTER_GATE_SHA1} (HunterGate)"
-        )
-      endif()
-      if(NOT EXISTS "${_master_location}")
-        hunter_gate_user_error(
-            "Master file not found:"
-            "  ${_master_location}"
-            "try to update Hunter/HunterGate"
-        )
-      endif()
-    endif()
-    include("${_master_location}")
-    set_property(GLOBAL PROPERTY HUNTER_GATE_DONE YES)
-  endif()
-endmacro()


get the CellML API config settings needed to get things building on ubuntu and OS X

--- cmake/SuperBuild.cmake
+++ cmake/SuperBuild.cmake
@@ -57,7 +57,25 @@
   TEST_COMMAND ""

   CMAKE_GENERATOR "Ninja"
-  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS}
+  CMAKE_ARGS ${DEPENDENCIES_CMAKE_ARGS} -DBUILD_TESTING=OFF
+    -DENABLE_ANNOTOOLS=ON
+    -DENABLE_CCGS=ON
+    -DENABLE_CELEDS=OFF
+    -DENABLE_CELEDS_EXPORTER=OFF
+    -DENABLE_CIS=OFF
+    -DENABLE_CUSES=ON
+    -DENABLE_CEVAS=ON
+    -DENABLE_CONTEXT=OFF
+    -DENABLE_EXAMPLES=OFF
+    -DENABLE_GSL_INTEGRATORS=OFF
+    -DENABLE_MALAES=ON
+    -DENABLE_MOFS=OFF
+    -DENABLE_RDF=OFF
+    -DENABLE_SPROS=OFF
+    -DENABLE_SRUS=OFF
+    -DENABLE_TELICEMS=OFF
+    -DENABLE_VACSS=OFF
+    -DENABLE_CGRS=OFF
   )

 list (APPEND DEPENDENCIES ep_llvm)


find openal

find openal

--- cmake/get-openal.cmake
+++ cmake/get-openal.cmake
@@ -25,11 +25,9 @@
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
         INSTALL_COMMAND
-            COMMAND ${CMAKE_COMMAND} -E copy "${DEPENDENCY_EXTRACT_DIR}/src/openal/bin/Win32/soft_oal.dll" "${DEPENDENCY_EXTRACT_DIR}/src/openal/bin/Win32/OpenAL32.dll"
-            COMMAND ${CMAKE_COMMAND} -E copy "${DEPENDENCY_EXTRACT_DIR}/src/openal/bin/Win64/soft_oal.dll" "${DEPENDENCY_EXTRACT_DIR}/src/openal/bin/Win64/OpenAL64.dll"
-            COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/openal/bin     ${DEPENDENCY_INSTALL_DIR}/bin
-            COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/openal/lib     ${DEPENDENCY_INSTALL_DIR}/lib
-            COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/openal/include ${DEPENDENCY_INSTALL_DIR}/include/openal
+            COMMAND ${CMAKE_COMMAND} -E copy ${DEPENDENCY_EXTRACT_DIR}/src/openal/bin/Win32/soft_oal.dll  ${DEPENDENCY_INSTALL_DIR}/bin/OpenAL32.dll
+            COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/openal/libs/Win32    ${DEPENDENCY_INSTALL_DIR}/lib
+            COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/openal/include/AL    ${DEPENDENCY_INSTALL_DIR}/include/OpenAL
     )

 else() # build from source


CMake: Updated CMake config to build Mesos against picojson v1.3.0.

Review: https://reviews.apache.org/r/38531

--- 3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ 3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -52,7 +52,7 @@
 set(STOUT ${PROCESS_3RD_SRC}/stout)

 EXTERNAL("boost"       "1.53.0"  "${PROCESS_3RD_BIN}")
-EXTERNAL("picojson"    "4f93734" "${PROCESS_3RD_BIN}")
+EXTERNAL("picojson"    "1.3.0"   "${PROCESS_3RD_BIN}")
 EXTERNAL("http_parser" "1c3624a" "${PROCESS_3RD_BIN}")
 EXTERNAL("libev"       "4.15"    "${PROCESS_3RD_BIN}")


finally fix windows build by disabling auto-link feature for boost...

--- external/vigra_cmake/VAD_Boost.cmake
+++ external/vigra_cmake/VAD_Boost.cmake
@@ -7,6 +7,13 @@

 function(vad_live)
   message("run VAD_LIVE for Boost")
+
+  # WARNING very important! disables auto-linking for boost!
+  set(_CFG_PATH "${VAD_EXTERNAL_ROOT}/boost_config/include/boost/config/user.hpp")
+  file(READ ${_CFG_PATH} FILECONTENT)
+  string(REPLACE "// #define BOOST_ALL_NO_LIB" "#define BOOST_ALL_NO_LIB" FILECONTENT ${FILECONTENT})
+  file(WRITE ${_CFG_PATH} ${FILECONTENT})
+

   # required for (all?) others
   vigra_add_dep(boost_config REQUIRED LIVE)


Fixed path search order for tixi find module

--- contrib/FindTIXI.cmake
+++ contrib/FindTIXI.cmake
@@ -23,8 +23,9 @@
 # Look for the header file.
 FIND_PATH(TIXI_INCLUDE_DIR
 	NAMES tixi.h
+	HINTS
+	${TIXI_PATH}/include
 	PATHS
-	${TIXI_PATH}/include
 	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\www.dlr.de/sc\\TIXI]/include"
 )

@@ -33,8 +34,9 @@
 # Look for the library.
 FIND_LIBRARY(TIXI_LIBRARY NAMES
 	TIXI
+	HINTS
+	${TIXI_PATH}/lib
 	PATHS
-    ${TIXI_PATH}/lib
 	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\www.dlr.de/sc\\TIXI]/lib"
 )
 # MARK_AS_ADVANCED(TIXI_LIBRARY)
@@ -42,8 +44,9 @@
 if(WIN32)
 FIND_PATH(TIXI_BINARY_DIR
 	NAMES TIXI.dll
+	HINTS
+	${TIXI_PATH}/bin
 	PATHS
-	${TIXI_PATH}/bin
 	"[HKEY_LOCAL_MACHINE\\SOFTWARE\\www.dlr.de/sc\\TIXI]/bin"
 )
 endif(WIN32)


--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -2753,6 +2753,8 @@
 	_get_components_to_find(_components)
 	foreach(_component IN LISTS _components)
 		_get_required_vars(${_component} _requiredComponentVars)
+		# suppress find_package_handle_standard_args warning on mismatching names
+		set (FPHSA_NAME_MISMATCHED On)
 		find_package_handle_standard_args(
 			Mathematica_${_component}
 			REQUIRED_VARS ${_requiredComponentVars}


fix order

fix order

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -243,7 +243,7 @@
 	set (${_outProgramNames} "")
 	# Mathematica products in order of preference
 	set (_MathematicaApps
-		"mathematica" "Mathematica"
+		"Mathematica" "mathematica"
 		"Wolfram Desktop" "Wolfram Engine"
 		"gridMathematica Server")
 	# Mathematica product versions in order of preference


upgrade to HDF5 1.10.1

upgrade to HDF5 1.10.1

--- version_config.cmake
+++ version_config.cmake
@@ -47,8 +47,13 @@
 set(FFTW3double_MD5 ${FFTW3_MD5})

 ## HDF5
-set(HDF5_URL https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.tar.gz )
-set(HDF5_MD5 6fb456d03a60f358f3c077288a6d1cd8 )
+#if (WIN32)
+  set(HDF5_URL https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.1/src/hdf5-1.10.1.tar.gz)
+  set(HDF5_MD5 43a2f9466702fb1db31df98ae6677f15 )
+#else()
+#  set(HDF5_URL https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/CMake-hdf5-1.10.0-patch1.tar.gz )
+#  set(HDF5_MD5 6fb456d03a60f358f3c077288a6d1cd8 )
+#endif()

 ## SWIG
 if (WIN32)


update CIL framework to point to current master (#361)

* update CIL framework and astra tags to point to current master at time of writing (their commit, not origin/master)

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

 ## ASTRA
 set(DEFAULT_astra-toolbox_URL https://github.com/astra-toolbox/astra-toolbox )
-set(DEFAULT_astra-toolbox_TAG v1.8.3)
+set(DEFAULT_astra-toolbox_TAG 8c2493710f5eac1316945585fe6333ab56f9a2a1)

 ## TomoPhantom
 set(DEFAULT_TomoPhantom_URL https://github.com/dkazanc/TomoPhantom )
@@ -178,7 +178,7 @@
   set(DEFAULT_ACE_TAG origin/master)
   # CCPi CIL
   set(DEFAULT_CCPi-Framework_URL https://github.com/vais-ral/CCPi-Framework.git)
-  set(DEFAULT_CCPi-Framework_TAG origin/master)
+  set(DEFAULT_CCPi-Framework_TAG adf4163c145e6ddc16899a92a06c3282f144d88c)
   set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git)
   set(DEFAULT_CCPi-Regularisation-Toolkit_TAG origin/master)
   set(DEFAULT_CCPi-FrameworkPlugins_URL https://github.com/vais-ral/CCPi-FrameworkPlugins.git)
@@ -208,7 +208,7 @@
   # CCPi CIL
   set(CIL_VERSION "v19.10")
   set(DEFAULT_CCPi-Framework_URL https://github.com/vais-ral/CCPi-Framework.git)
-  set(DEFAULT_CCPi-Framework_TAG ${CIL_VERSION})
+  set(DEFAULT_CCPi-Framework_TAG adf4163c145e6ddc16899a92a06c3282f144d88c)
   set(DEFAULT_CCPi-Regularisation-Toolkit_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git )
   set(DEFAULT_CCPi-Regularisation-Toolkit_TAG "${CIL_VERSION}")
   set(DEFAULT_CCPi-FrameworkPlugins_URL https://github.com/vais-ral/CCPi-FrameworkPlugins.git)


Android dependencies lookup were broken

Android dependencies lookup were broken

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -1576,7 +1576,7 @@
 set( BUILD_ANDROID True )

 # where is the target environment
-set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )
+set( CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}" "${OGRE_DEPENDENCIES_DIR}" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )

 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )


Recently the CEGUI renderer was configured on OS X to use an executable path from within the Plugins area, but this wasn't getting symlinked in.

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -299,6 +299,12 @@
           ${OGRE_SAMPLE_CONTENTS_PATH}/Plugins/
         )
       endif()
+      if (OGRE_BUILD_CEGUIRENDERER)
+        add_custom_command(TARGET ${SAMPLENAME} POST_BUILD
+        COMMAND ln ARGS -s -f ${CMAKE_BINARY_DIR}/lib/$(CONFIGURATION)/libCEGUIOgreRenderer.dylib
+          ${OGRE_SAMPLE_CONTENTS_PATH}/Plugins/
+        )
+      endif()
     endif()
   endif (APPLE)


clean-up FreeCADLibpackChecks.cmake

clean-up FreeCADLibpackChecks.cmake

--- cMake/FreeCAD_Helpers/FreeCADLibpackChecks.cmake
+++ cMake/FreeCAD_Helpers/FreeCADLibpackChecks.cmake
@@ -4,43 +4,14 @@
     if(FREECAD_LIBPACK_USE)

         # checking for a unique file in LibPack location to make sure the right version of the LibPack is there
-        find_file(FREECAD_LIBPACK_CHECKFILE6X boost_program_options-vc80-mt-gd.lib ${FREECAD_LIBPACK_DIR}/lib )
-        find_file(FREECAD_LIBPACK_CHECKFILE7X boost_program_options-vc90-mt-gd-1_39.lib ${FREECAD_LIBPACK_DIR}/lib )
-        find_file(FREECAD_LIBPACK_CHECKFILE8X boost_program_options-vc90-mt-gd-1_48.lib ${FREECAD_LIBPACK_DIR}/lib )
-        find_file(FREECAD_LIBPACK_CHECKFILE9X boost_program_options-vc90-mt-gd-1_54.lib ${FREECAD_LIBPACK_DIR}/lib )
-        find_file(FREECAD_LIBPACK_CHECKFILE10X boost_program_options-vc110-mt-1_55.lib ${FREECAD_LIBPACK_DIR}/lib )
-        find_file(FREECAD_LIBPACK_CHECKCUSTOM boost_program_options-vc90-mt-gd-1_41.lib ${FREECAD_LIBPACK_DIR}/lib )
         find_file(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER MANIFEST.db ${FREECAD_LIBPACK_DIR})

         # don't show them in the GUI
-        set(FREECAD_LIBPACK_CHECKFILE6X "${FREECAD_LIBPACK_CHECKFILE6X}" CACHE INTERNAL "Find libpack")
-        set(FREECAD_LIBPACK_CHECKFILE7X "${FREECAD_LIBPACK_CHECKFILE7X}" CACHE INTERNAL "Find libpack")
-        set(FREECAD_LIBPACK_CHECKFILE8X "${FREECAD_LIBPACK_CHECKFILE8X}" CACHE INTERNAL "Find libpack")
-        set(FREECAD_LIBPACK_CHECKFILE9X "${FREECAD_LIBPACK_CHECKFILE9X}" CACHE INTERNAL "Find libpack")
-        set(FREECAD_LIBPACK_CHECKFILE10X "${FREECAD_LIBPACK_CHECKFILE10X}" CACHE INTERNAL "Find libpack")
-        set(FREECAD_LIBPACK_CHECKCUSTOM "${FREECAD_LIBPACK_CHECKCUSTOM}" CACHE INTERNAL "Find libpack")
         set(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER "${FREECAD_LIBPACK_CHECKFILE_CLBUNDLER}" CACHE INTERNAL "Find libpack")

         if (FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
             set(FREECAD_LIBPACK_VERSION "CLbundler" CACHE STRING "Displays if the libpack has been found" FORCE)
             include(cMake/UseLibPackCLbundler.cmake)
-        elseif(FREECAD_LIBPACK_CHECKFILE9X)
-            set(FREECAD_LIBPACK_VERSION "9.x" CACHE STRING "Displays if the libpack has been found" FORCE)
-            include(cMake/UseLibPack9x.cmake)
-            set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-2.0.11/swig.exe CACHE STRING "Swig" FORCE)
-            set(FREECAD_LIBPACK_PYSIDEUIC_REL   "${FREECAD_LIBPACK_DIR}/pyside-tools/Lib/site-packages")
-            file(GLOB FREECAD_LIBPACK_PIVY_COIN "${FREECAD_LIBPACK_DIR}/pivy/*.*")
-            file(GLOB FREECAD_LIBPACK_SHIBOKEN  "${FREECAD_LIBPACK_DIR}/shiboken-1.2.1/lib/site-packages/*.pyd")
-            file(GLOB FREECAD_LIBPACK_PYSIDE    "${FREECAD_LIBPACK_DIR}/pyside/lib/site-packages/PySide/*.py*")
-            file(GLOB_RECURSE FREECAD_LIBPACK_PYSIDEUIC RELATIVE "${FREECAD_LIBPACK_PYSIDEUIC_REL}" "${FREECAD_LIBPACK_PYSIDEUIC_REL}/pysideuic/*.py")
-            file(GLOB FREECAD_LIBPACK_PYTHON    "${FREECAD_LIBPACK_DIR}/bin/*.py*")
-        elseif(FREECAD_LIBPACK_CHECKFILE10X)
-            set(FREECAD_LIBPACK_VERSION "10.x" CACHE STRING "Displays if the libpack has been found" FORCE)
-            include(cMake/UseLibPack10x.cmake)
-            set(SWIG_EXECUTABLE ${FREECAD_LIBPACK_DIR}/tools/swigwin-3.0.2/swig.exe CACHE STRING "Swig" FORCE)
-        elseif(FREECAD_LIBPACK_CHECKCUSTOM)
-            set(FREECAD_LIBPACK_VERSION "Custom" CACHE STRING "Displays if the libpack has been found" FORCE)
-            include(cMake/UseLibPackCustom.cmake)
         else(FREECAD_LIBPACK_CHECKFILE_CLBUNDLER)
             set(FREECAD_LIBPACK_VERSION "NOTFOUND" CACHE STRING "Displays if the libpack has been found" FORCE)
             message(SEND_ERROR  "Could not find libpack in specified location:" ${FREECAD_LIBPACK_DIR})


Prevent .. from being included in the project for the UT target. NOTE: there is still work to do to get the groups working correctly.

--- _cmake/AddLibrary/LibraryFunction.cmake
+++ _cmake/AddLibrary/LibraryFunction.cmake
@@ -68,7 +68,12 @@
 		set(executable_name "${library_name}-UT")
 		message("Adding Unit Test Executable '${executable_name}'")

-		add_source("${CMAKE_CURRENT_SOURCE_DIR}/tests/unit_test/" install_ut_headers ut_headers ut_implementation)
+		add_source(
+			"${CMAKE_CURRENT_SOURCE_DIR}/tests/unit_test/"
+			install_ut_headers
+			ut_headers
+			ut_implementation
+			FILTER_DIRS "..")
 		add_executable(${executable_name} ${ut_headers} ${ut_implementation} ${generated_ut_source_files})

 		foreach(flag ${ut_compiler_flags})


Fixed the hack/delete_commands.

Fixed the hack/delete_commands.

--- hack/delete_commands.cmake
+++ hack/delete_commands.cmake
@@ -5,12 +5,12 @@
 # The function to delete commands is implemented by storing in the `__command_<name>_deleted__` global property
 # whether the `<name>` command has been deleted and cheking that property.

-function(command_deleted_property_name result)
-  set(${result} __command_${name}_deleted__ PARENT_SCOPE)
+function(command_deleted_property_name command_name result)
+  set(${result} __command_${command_name}_deleted__ PARENT_SCOPE)
 endfunction()

 function(is_deleted_command name result)
-  command_deleted_property_name(prop_name)
+  command_deleted_property_name(${name} prop_name)
   if(NOT COMMAND ${name})
     set(${result} true PARENT_SCOPE)
     return()
@@ -20,9 +20,9 @@
 endfunction()

 function(delete_command name)
-  command_deleted_property_name(prop_name)
+  command_deleted_property_name(${name} prop_name)
   function(${name})
-    message([[This command is deleted!]])
+    message(WARNING [[This command is deleted!]])
   endfunction()
   set_property(GLOBAL PROPERTY ${prop_name} true)
 endfunction()


Use CMake if ( <variable> ) format in LanguageOptions

Standardize usage of if statements in the LanguageOptions file to no
explicitly evaluating the CMake variable.

Add comment block to separate languages

--- CMake/sitkLanguageOptions.cmake
+++ CMake/sitkLanguageOptions.cmake
@@ -38,6 +38,10 @@
 #
 # Setup the option for each language
 #
+
+#-----------------------------------------------------------
+# Lua
+
 set_QUIET( WRAP_LUA )
 find_package ( Lua ${_QUIET} )

@@ -65,8 +69,8 @@
 endif()

-
-# If you're not using python or it's the first time, be quiet
+#-----------------------------------------------------------
+# Python

 set_QUIET( WRAP_PYTHON )
 find_package ( PythonInterp ${_QUIET})
@@ -108,15 +112,17 @@
 endif ()

+#-----------------------------------------------------------
+# Java

 set_QUIET( WRAP_JAVA )
 find_package ( Java COMPONENTS Development Runtime ${_QUIET} )
 find_package ( JNI ${_QUIET} )
-if ( ${JAVA_FOUND} AND ${JNI_FOUND} )
+if ( JAVA_FOUND AND JNI_FOUND )
   set( WRAP_JAVA_DEFAULT ${WRAP_DEFAULT} )
-else ( ${JAVA_FOUND} AND ${JNI_FOUND} )
+else ( ${JAVA_FOUND} AND JNI_FOUND )
   set( WRAP_JAVA_DEFAULT OFF )
-endif ( ${JAVA_FOUND} AND ${JNI_FOUND} )
+endif ( )

 option ( WRAP_JAVA "Wrap Java" ${WRAP_JAVA_DEFAULT} )

@@ -146,15 +152,18 @@
 endif()

+#-----------------------------------------------------------
+# Tcl
+
 set_QUIET(WRAP_TCL)

 find_package ( TCL ${_QUIET} )

-if ( ${TCL_FOUND} )
+if ( TCL_FOUND )
   set ( WRAP_TCL_DEFAULT ${WRAP_DEFAULT} )
-else ( ${TCL_FOUND} )
+else ( )
   set ( WRAP_TCL_DEFAULT OFF )
-endif ( ${TCL_FOUND} )
+endif ( )

 option ( WRAP_TCL "Wrap Tcl" ${WRAP_TCL_DEFAULT} )

@@ -170,14 +179,17 @@
 endif()

+#-----------------------------------------------------------
+# Ruby
+
 set_QUIET( WRAP_RUBY )

 find_package ( Ruby ${_QUIET} )
-if ( ${RUBY_FOUND} )
+if ( RUBY_FOUND )
   set ( WRAP_RUBY_DEFAULT ${WRAP_DEFAULT} )
-else ( ${RUBY_FOUND} )
+else ( )
   set ( WRAP_RUBY_DEFAULT OFF )
-endif ( ${RUBY_FOUND} )
+endif ( )

 option ( WRAP_RUBY "Wrap Ruby" ${WRAP_RUBY_DEFAULT} )

@@ -193,14 +205,13 @@
 endif()

-if (DEFINED  WRAP_CSHARP AND WRAP_CSHARP)
-  set(_QUIET "REQUIRED")
-else()
-  set(_QUIET "QUIET")
-endif()
+#-----------------------------------------------------------
+#  CSharp
+
+set_QUIET( WRAP_CSHARP )

 find_package( CSharp ${_QUIET} )
-if ( ${CSHARP_FOUND} AND NOT MINGW )
+if ( CSHARP_FOUND AND NOT MINGW )
   set ( WRAP_CSHARP_DEFAULT ${WRAP_DEFAULT} )
 else ()
   set ( WRAP_CSHARP_DEFAULT OFF )
@@ -217,10 +228,13 @@
 endif()

+#-----------------------------------------------------------
+#  R
+
 set_QUIET( WRAP_R )

 find_package(R ${_QUIET})
-if ( ${R_FOUND} AND NOT WIN32 )
+if ( R_FOUND AND NOT WIN32 )
   set ( WRAP_R_DEFAULT ${WRAP_DEFAULT} )
 else( )
   set ( WRAP_R_DEFAULT OFF )
@@ -241,7 +255,3 @@
 if( WIN32 )
   mark_as_advanced( WRAP_R )
 endif()
-
-#
-# Below here are the 2nd tier languages they are not enabled automatically if detected
-#


Improved 'SPIRV-Headers' build time (#24)

--- cmake/projects/SPIRV-Headers/hunter.cmake
+++ cmake/projects/SPIRV-Headers/hunter.cmake
@@ -6,6 +6,7 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)

@@ -20,6 +21,12 @@
     77018bfe6cb1eceaf824e401dbd206660a25bf66
 )

+hunter_cmake_args(
+    SPIRV-Tools
+    CMAKE_ARGS
+      SPIRV_HEADERS_SKIP_EXAMPLES=ON
+)
+
 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(SPIRV-Headers)
 hunter_download(PACKAGE_NAME SPIRV-Headers)


Use the environment variable ADAFLAGS rather than FFLAGS (?) to set
Ada compiler flags.

svn path=/trunk/; revision=10872

--- cmake/modules/language_support/cmake/CMakeAdaInformation.cmake
+++ cmake/modules/language_support/cmake/CMakeAdaInformation.cmake
@@ -97,7 +97,7 @@

 SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make.  This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")

-SET(CMAKE_Ada_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Ada_FLAGS_INIT}")
+SET(CMAKE_Ada_FLAGS_INIT "$ENV{ADAFLAGS} ${CMAKE_Ada_FLAGS_INIT}")
 # avoid just having a space as the initial value for the cache
 IF(CMAKE_Ada_FLAGS_INIT STREQUAL " ")
   SET(CMAKE_Ada_FLAGS_INIT)


Only add libllqtwebkit.dylib when building osx i386

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -241,7 +241,6 @@
         libexpat.1.5.2.dylib
         libexpat.dylib
         libGLOD.dylib
-        libllqtwebkit.dylib
         libminizip.a
         libndofdev.dylib
         libhunspell-1.3.0.dylib
@@ -250,6 +249,12 @@
 		libgrowl.dylib
         libgrowl++.dylib
        )
+
+    if( NOT ND_BUILD64BIT_ARCH )
+        list(APPEND release_files
+             libllqtwebkit.dylib
+            )
+    endif( NOT ND_BUILD64BIT_ARCH )

     # <FS:ND> We only ever need google breakpad when crash reporting is used
     if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)


Update CppUTestConfigurationOptions.cmake

Creating CPPUTEST_NO_INF and CPPUTEST_NO_NAN for use with the Borland compiler

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -63,13 +63,13 @@
     set(CPPUTEST_USE_LONG_LONG 1)
 endif (LONGLONG)

-if (HAS_INF)
-    set(CPPUTEST_HAS_INF 1)
-endif (HAS_INF)
+if (NOT HAS_INF)
+    set(CPPUTEST_NO_INF 1)
+endif (NOT HAS_INF)

-if (HAS_NAN)
-    set(CPPUTEST_HAS_NAN 1)
-endif (HAS_NAN)
+if (NOT HAS_NAN)
+    set(CPPUTEST_NO_NAN 1)
+endif (NOT HAS_NAN)

 if (MAP_FILE AND NOT MSVC)
     set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -Wl,-Map,$<.map.txt")


BUG: Fix FindJsonCpp.cmake for finding the include directory.

The current version does not find the proper include directory.

--- CMake/FindJsonCpp.cmake
+++ CMake/FindJsonCpp.cmake
@@ -1,8 +1,8 @@
 ##############################################################################
 #
-# Library:   TubeTK
+# Initially developed for:   TubeTK
 #
-# Copyright 2010 Kitware Inc. 28 Corporate Drive,
+# Copyright 2013 Kitware Inc. 28 Corporate Drive,
 # Clifton Park, NY, 12065, USA.
 #
 # All rights reserved.
@@ -22,19 +22,20 @@
 ##############################################################################

 if( JsonCpp_DIR )
-  set( JsonCpp_INCLUDEDIR ${JsonCpp_DIR}/include )
-  set( JsonCpp_LIBDIR ${JsonCpp_DIR}/lib )
+  if( EXISTS ${JsonCpp_DIR}/CMakeCache.txt )
+    file( STRINGS ${JsonCpp_DIR}/CMakeCache.txt _source_dir_def REGEX "jsoncpp_SOURCE_DIR" )
+    string( REGEX REPLACE "[^=]+[=]" "" _source_dir "${_source_dir_def}" )
+    set( _jsoncpp_include_dir "${_source_dir}/include" )
+  endif()
+  set( _jsoncpp_library ${JsonCpp_DIR}/lib )
 endif( JsonCpp_DIR )

-find_package( PkgConfig QUIET )
-pkg_check_modules( PC_JsonCpp QUIET jsoncpp )
-
 find_path( JsonCpp_INCLUDE_DIR NAMES json/json.h
-  HINTS ${JsonCpp_INCLUDEDIR} ${PC_JsonCpp_INCLUDEDIR} ${PC_JsonCpp_INCLUDE_DIRS}
+  HINTS ${_jsoncpp_include_dir}
   PATH_SUFFIXES jsoncpp )

 find_library( JsonCpp_LIBRARY NAMES jsoncpp libjsoncpp
-  HINTS ${JsonCpp_LIBDIR} ${PC_JsonCpp_LIBDIR} ${PC_JsonCpp_LIBRARY_DIRS} )
+  HINTS ${_jsoncpp_library} )

 set( JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR} )
 set( JsonCpp_LIBRARIES ${JsonCpp_LIBRARY} )


Set INCLUDE_DIRECTORIES property for every WASM target. This allows the scanning of implicit dependencies of every contract source file to work properly (IMPLICIT_DEPENDS)

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -88,5 +88,7 @@
   )

   add_custom_target(${target} ALL DEPENDS ${DESTINATION_FOLDER}/${target}.wast.hpp)
+  set_property(TARGET ${target} PROPERTY INCLUDE_DIRECTORIES ${INCLUDE_FOLDERS})
+

 endmacro(add_wast_target)


Add exclusion for cmake RPM to fix install on CentOS 7

--- projects/cmakexp.cmake
+++ projects/cmakexp.cmake
@@ -55,6 +55,7 @@
   xpBuildOnlyRelease()
   set(XP_CONFIGURE
     -DCPACK_OUTPUT_FILE_PREFIX:PATH=${STAGE_DIR}/pkg
+    -DCPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION=/usr/share/aclocal
     -DCMAKE_USE_OPENSSL=ON
     -DCMAKE_USE_OPENSSL_MODULE_PATH=ON
     -Dusexp-OpenSSL_DIR=${STAGE_DIR}/share/cmake


FindARPACK: fail if ARPACK_DIR set wrong.

--- cmake/FindARPACK.cmake
+++ cmake/FindARPACK.cmake
@@ -1,11 +1,17 @@
 SET(ARPACK_SEARCH_PATHS ${ARPACK_DIR})

-FIND_LIBRARY(ARPACK_LIB NAMES arpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
-FIND_LIBRARY(ARPACK_LIB NAMES arpack)
+IF (DEFINED ARPACK_SEARCH_PATHS)
+    FIND_LIBRARY(ARPACK_LIB NAMES arpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
+ELSE (DEFINED ARPACK_SEARCH_PATHS)
+    FIND_LIBRARY(ARPACK_LIB NAMES arpack)
+ENDIF (DEFINED ARPACK_SEARCH_PATHS)

 if(USE_MPI)
-  FIND_LIBRARY(PARPACK_LIB NAMES parpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
-  FIND_LIBRARY(PARPACK_LIB NAMES parpack)
+  IF (DEFINED ARPACK_SEARCH_PATHS)
+    FIND_LIBRARY(PARPACK_LIB NAMES parpack PATHS ${ARPACK_SEARCH_PATHS} NO_DEFAULT_PATH)
+  ELSE (DEFINED ARPACK_SEARCH_PATHS)
+    FIND_LIBRARY(PARPACK_LIB NAMES parpack)
+  ENDIF (DEFINED ARPACK_SEARCH_PATHS)
 endif (USE_MPI)

 SET(ARPACK_FOUND FALSE)


Unset `CMAKE_REQUIRED_LIBRARIES` to avoid influencing tests

On a fedora system without `binutils-devel` the build fails with
`pthread not found`:

```
-- Please install the libbpf development package (missing: LIBBPF_LIBRARIES LIBBPF_INCLUDE_DIRS)
-- Please install the libbfd development package (missing: LIBBFD_LIBRARIES LIBBFD_INCLUDE_DIRS)
-- Performing Test LIBBFD_DISASM_FOUR_ARGS_SIGNATURE
-- Performing Test LIBBFD_DISASM_FOUR_ARGS_SIGNATURE - Failed
-- Please install the libopcodes development package (missing: LIBOPCODES_LIBRARIES LIBOPCODES_INCLUDE_DIRS)
-- Looking for sys/sdt.h
-- Looking for sys/sdt.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - not found
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find Threads (missing: Threads_FOUND)
```

This is  caused by the `CMAKE_REQUIRED_LIBRARIES` being
"leaked" between tests combined with CMP0075 . When testing for threads
cmake still links agains `bfd` and `opcodes` which do not exist and the
test fails. To avoid this we have to clear `CMAKE_REQUIRED_LIBRARIES`
after the test.

--- cmake/FindLibBfd.cmake
+++ cmake/FindLibBfd.cmake
@@ -59,3 +59,4 @@
                abfd);
   return 0;
 }" LIBBFD_DISASM_FOUR_ARGS_SIGNATURE)
+SET(CMAKE_REQUIRED_LIBRARIES)


Update lib paths

Update lib paths

--- cmake/FindLuaJIT.cmake
+++ cmake/FindLuaJIT.cmake
@@ -5,22 +5,23 @@
 # LUAJIT_LIBRARY

 set(LUAJIT_SEARCH_PATHS
-	/usr/local
-	/usr
+    /usr/local
+    /usr
+    c:/usr/local/lib
     c:/usr/local
     c:/usr
-	$ENV{LUAJIT_DIR}
-	)
+    $ENV{LUAJIT_DIR}
+    )

 find_path(LUAJIT_INCLUDE_DIR
-	NAMES luajit.h
-	PATH_SUFFIXES include include/luajit-2.0 src
-	PATHS ${LUAJIT_SEARCH_PATHS})
+    NAMES luajit.h
+    PATH_SUFFIXES include include/luajit-2.0 src
+    PATHS ${LUAJIT_SEARCH_PATHS})

 find_library(LUAJIT_LIBRARY
-	NAMES luajit-5.1 lua51
-	PATH_SUFFIXES lib
-	PATHS ${LUAJIT_SEARCH_PATHS})
+    NAMES luajit-5.1 lua51
+    PATH_SUFFIXES lib
+    PATHS ${LUAJIT_SEARCH_PATHS})

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LuaJIT DEFAULT_MSG LUAJIT_LIBRARY LUAJIT_INCLUDE_DIR)


[cmake] FindMATLAB: indentation cleanup

[cmake] FindMATLAB: indentation cleanup

No logic change

--- cmake/FindMATLAB.cmake
+++ cmake/FindMATLAB.cmake
@@ -147,44 +147,30 @@
   ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

   # Get path to the MEX libraries
-  EXECUTE_PROCESS(
-    #COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmex${LIBRARY_EXTENSION} # Peter
-	COMMAND find "${MATLAB_ROOT}/bin" -name libmex${LIBRARY_EXTENSION} # Standard
-    COMMAND xargs echo -n
-    OUTPUT_VARIABLE MATLAB_MEX_LIBRARY
-    )
-  EXECUTE_PROCESS(
-    #COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmx${LIBRARY_EXTENSION} # Peter
-	COMMAND find "${MATLAB_ROOT}/bin" -name libmx${LIBRARY_EXTENSION} # Standard
-    COMMAND xargs echo -n
-    OUTPUT_VARIABLE MATLAB_MX_LIBRARY
-    )
-  EXECUTE_PROCESS(
-    #COMMAND find "${MATLAB_ROOT}/extern/lib" -name libmat${LIBRARY_EXTENSION} # Peter
-	COMMAND find "${MATLAB_ROOT}/bin" -name libmat${LIBRARY_EXTENSION} # Standard
-    COMMAND xargs echo -n
-    OUTPUT_VARIABLE MATLAB_MAT_LIBRARY
-    )
-  EXECUTE_PROCESS(
-    #COMMAND find "${MATLAB_ROOT}/extern/lib" -name libeng${LIBRARY_EXTENSION} # Peter
-	COMMAND find "${MATLAB_ROOT}/bin" -name libeng${LIBRARY_EXTENSION} # Standard
-    COMMAND xargs echo -n
-    OUTPUT_VARIABLE MATLAB_ENG_LIBRARY
-    )
+  EXECUTE_PROCESS(COMMAND find "${MATLAB_ROOT}/bin" -name libmex${LIBRARY_EXTENSION}
+                  COMMAND xargs echo -n
+                  OUTPUT_VARIABLE MATLAB_MEX_LIBRARY)

-   EXECUTE_PROCESS(
-       COMMAND "${MATLAB_ROOT}/bin/mexext"
-       COMMAND xargs echo -n
-       OUTPUT_VARIABLE MATLAB_MEXEXT
-       )
+  EXECUTE_PROCESS(COMMAND find "${MATLAB_ROOT}/bin" -name libmx${LIBRARY_EXTENSION}
+                  COMMAND xargs echo -n
+                  OUTPUT_VARIABLE MATLAB_MX_LIBRARY)

+  EXECUTE_PROCESS(COMMAND find "${MATLAB_ROOT}/bin" -name libmat${LIBRARY_EXTENSION}
+                  COMMAND xargs echo -n
+                  OUTPUT_VARIABLE MATLAB_MAT_LIBRARY)

+  EXECUTE_PROCESS(COMMAND find "${MATLAB_ROOT}/bin" -name libeng${LIBRARY_EXTENSION}
+                  COMMAND xargs echo -n
+                  OUTPUT_VARIABLE MATLAB_ENG_LIBRARY)
+
+  EXECUTE_PROCESS(COMMAND "${MATLAB_ROOT}/bin/mexext"
+                  COMMAND xargs echo -n
+                  OUTPUT_VARIABLE MATLAB_MEXEXT)

   # Get path to the include directory
   FIND_PATH(MATLAB_INCLUDE_DIR
-    "mex.h"
-    PATHS "${MATLAB_ROOT}/extern/include"
-    )
+            "mex.h"
+            PATHS "${MATLAB_ROOT}/extern/include")

 ENDIF(WIN32)


re-enable CPU_BASELINE=FP16 on Armv7 platform

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -329,7 +329,7 @@
       ocv_update(CPU_VFPV3_FLAGS_ON "-mfpu=vfpv3")
       ocv_update(CPU_NEON_FLAGS_ON "-mfpu=neon")
       ocv_update(CPU_NEON_FLAGS_CONFLICT "-mfpu=[^ ]*")
-      ocv_update(CPU_FP16_FLAGS_ON "-mfpu=neon-fp16")
+      ocv_update(CPU_FP16_FLAGS_ON "-mfpu=neon-fp16 -mfp16-format=ieee")
       ocv_update(CPU_FP16_FLAGS_CONFLICT "-mfpu=[^ ]*")
     endif()
     ocv_update(CPU_FP16_IMPLIES "NEON")
@@ -617,9 +617,6 @@
   if(ENABLE_POWERPC)
     add_extra_compiler_option("-mcpu=G3 -mtune=G5")
   endif()
-  if(ARM)
-    add_extra_compiler_option("-mfp16-format=ieee")
-  endif(ARM)
 endmacro()

 macro(ocv_compiler_optimization_options_finalize)


Remove -std=gnu++14 from toolchain file

Remove -std=gnu++14 from toolchain file

We use set(CMAKE_CXX_STANDARD 17) in the root CMakeLists.txt.

Change-Id: I71084df69d646d7e024d0ace29def06785a087d2
GitOrigin-RevId: b6d0f6bcf5e46cf04209edc7415e8c2f7aab903c

--- cmake/toolchain-arm-none-eabi-gcc.cmake
+++ cmake/toolchain-arm-none-eabi-gcc.cmake
@@ -131,7 +131,7 @@
 set(CMAKE_C_FLAGS "${COMMON_C_FLAGS_STR} -std=gnu99" CACHE STRING "" FORCE)
 set(CMAKE_C_FLAGS_DEBUG "${COMMON_C_FLAGS_DEBUG_STR}" CACHE STRING "" FORCE)
 set(CMAKE_C_FLAGS_RELEASE "${COMMON_C_FLAGS_RELEASE_STR}" CACHE STRING "" FORCE)
-set(CMAKE_CXX_FLAGS "${COMMON_C_FLAGS_STR} -fno-rtti -fno-exceptions -std=gnu++14" CACHE STRING "" FORCE)
+set(CMAKE_CXX_FLAGS "${COMMON_C_FLAGS_STR} -fno-rtti -fno-exceptions" CACHE STRING "" FORCE)
 set(CMAKE_CXX_FLAGS_DEBUG "${COMMON_C_FLAGS_DEBUG_STR}" CACHE STRING "" FORCE)
 set(CMAKE_CXX_FLAGS_RELEASE "${COMMON_C_FLAGS_RELEASE_STR}" CACHE STRING "" FORCE)
 set(CMAKE_EXE_LINKER_FLAGS "${COMMON_LINK_FLAGS_STR} -Xlinker --gc-sections -Xlinker -Map=output.map" CACHE STRING "" FORCE)


PARQUET-1016: Upgrade thirdparty Arrow to 0.4.0

Close #334

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #348 from wesm/PARQUET-1016 and squashes the following commits:

8fecd96 [Wes McKinney] Upgrade thirdparty Arrow to 0.4.0

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -519,7 +519,7 @@
   endif()

   if ("$ENV{PARQUET_ARROW_VERSION}" STREQUAL "")
-    set(ARROW_VERSION "d8db8f8a11abbbb6c45645b2d7370610311731bd")
+    set(ARROW_VERSION "a8f8ba0cbcf5f596f042e90b7a208e7a0c3925b7")
   else()
     set(ARROW_VERSION "$ENV{PARQUET_ARROW_VERSION}")
   endif()


use correct macro name to enable strdup()

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -12,7 +12,7 @@

     add_definitions(-D_REENTRANT)           # for gmtime_r()
     add_definitions(-D_XOPEN_SOURCE) 	    # for popen() and pclose()
-    add_definitions(-DXOPEN_SOURCE_EXTENDED)   # for strdup(), which isn't part of C99
+    add_definitions(-D_XOPEN_SOURCE_EXTENDED) # for strdup(), which isn't part of C99
     add_definitions(-D__STDC_FORMAT_MACROS) # for PRI*PTR format macros, required by C99

     # with -fPIC


cmake: fix plugin getter name

cmake: fix plugin getter name

This changes autogenerate_plugin_container.cmake script to generate the
plugin getter method to be named with an underscore as you would expect.

For instance for the plugin FollowMe this would yield `follow_me`
instead of `followme`.

--- autogenerate_plugin_container.cmake
+++ autogenerate_plugin_container.cmake
@@ -119,7 +119,13 @@
 # Go through all the plugins and generate the strings.
 foreach(class_name ${plugin_class_names})

-    string(TOLOWER ${class_name} class_name_lowercase)
+    # We want to go from CamelCase to snake_case.
+    # CamelCase -> Camel_Case
+    string(REGEX REPLACE "(.)([A-Z][a-z]+)" "\\1_\\2" class_name_with_underscores "${class_name}")
+    # Camel0Case -> Camel0_Case
+    string(REGEX REPLACE "([a-z0-9])([A-Z])" "\\1_\\2" class_name_with_underscores "${class_name_with_underscores}")
+    # Camel_Case to snake_case
+    string(TOLOWER ${class_name_with_underscores} class_name_lowercase)

     set(get_name ${class_name_lowercase})
     set(member_name "_${class_name_lowercase}")


fixed absolute install paths

fixed absolute install paths

--- bindings/python/InstallConfig.cmake
+++ bindings/python/InstallConfig.cmake
@@ -26,10 +26,11 @@
     )
     install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" --build . --target install_venv --config \${CMAKE_INSTALL_CONFIG_NAME} WORKING_DIRECTORY \"${Iron_BINARY_DIR}\")")
 else()
+    file(RELATIVE_PATH REL_PYTHON_BINDINGS_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}" "${PYTHON_BINDINGS_INSTALL_DIR}")
     install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/opencmiss
-            DESTINATION ${PYTHON_BINDINGS_INSTALL_DIR}
+            DESTINATION ${REL_PYTHON_BINDINGS_INSTALL_DIR}
             FILES_MATCHING PATTERN ${ZINC_SHARED_OBJECT_GLOB})
     install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/opencmiss
-            DESTINATION ${PYTHON_BINDINGS_INSTALL_DIR}
+            DESTINATION ${REL_PYTHON_BINDINGS_INSTALL_DIR}
             FILES_MATCHING PATTERN "*.py")
 endif()


Use ARGN in set_if_not_set().

Use ARGN in set_if_not_set().

	* build-aux/cmake/modules/Tools.cmake: Do that.

--- build-aux/cmake/modules/Tools.cmake
+++ build-aux/cmake/modules/Tools.cmake
@@ -40,9 +40,9 @@

   # Set the given variable with the given value if the variable is not already
   # set.
-  macro(SET_IF_NOT_SET var val)
+  macro(SET_IF_NOT_SET var)
     IF(NOT DEFINED "${var}")
-      SET(${var} "${val}")
+      SET(${var} ${ARGN})
     ENDIF(NOT DEFINED "${var}")
   endmacro(SET_IF_NOT_SET var val)


Don't assume the gnu linker is being used on solaris.

Gcc on some of our solaris machines uses the gnu linker. Others use the
vendor linker.

--- build/cmake/CondorSetLinkLibs.cmake
+++ build/cmake/CondorSetLinkLibs.cmake
@@ -27,7 +27,9 @@
 	endif()

 	 if ( NOT WINDOWS )
-		if (DARWIN OR AIX)
+		# This should really test for whether the gnu linker
+		# is being used
+		if (DARWIN OR AIX OR SOLARIS)
 			target_link_libraries( ${_CNDR_TARGET} ${${_CNDR_TARGET}LinkLibs} ${${_CNDR_TARGET}LinkLibs}  )
 		else()
 	 		target_link_libraries( ${_CNDR_TARGET} -Wl,--start-group ${${_CNDR_TARGET}LinkLibs} -Wl,--end-group )


update vtk

update vtk

--- superbuild/versions.cmake
+++ superbuild/versions.cmake
@@ -85,7 +85,7 @@

 add_revision(vtk
   GIT_REPOSITORY http://vtk.org/VTK.git
-  GIT_TAG v6.2.0
+  GIT_TAG b9d4f39d695f6b69a8b39042a52a50f624c61f55
 )

 if (UNIX)


FIX: Corrected DCMTK sub library linker order for oflog + minor cleanups.

--- Utilities/CMake/FindDCMTK.cmake
+++ Utilities/CMake/FindDCMTK.cmake
@@ -66,6 +66,15 @@
   NO_DEFAULT_PATH
 )

+FIND_PATH( DCMTK_oflog_INCLUDE_DIR logger.h
+  PATHS
+    ${DCMTK_DIR}/oflog/include
+    ${DCMTK_DIR}/oflog
+    ${DCMTK_DIR}/include/oflog
+    ${DCMTK_DIR}/include/dcmtk/oflog
+  NO_DEFAULT_PATH
+)
+
 FIND_LIBRARY( DCMTK_oflog_LIBRARY oflog
   PATHS
     ${DCMTK_DIR}/oflog/libsrc
@@ -138,6 +147,7 @@
 )

 # MM: I could not find this library on debian system / dcmtk 3.5.4
+# Michael Onken: this module is now called dcmqrdb. I will re-work that script soon...
 FIND_LIBRARY(DCMTK_imagedb_LIBRARY imagedb
   PATHS
     ${DCMTK_DIR}/imagectn/libsrc/Release
@@ -149,6 +159,7 @@
 IF( DCMTK_config_INCLUDE_DIR
     AND DCMTK_ofstd_INCLUDE_DIR
     AND DCMTK_ofstd_LIBRARY
+    AND DCMTK_oflog_INCLUDE_DIR
     AND DCMTK_oflog_LIBRARY
     AND DCMTK_dcmdata_INCLUDE_DIR
     AND DCMTK_dcmdata_LIBRARY
@@ -172,6 +183,7 @@
     ${DCMTK_DIR}/include
     ${DCMTK_config_INCLUDE_DIR}
     ${DCMTK_ofstd_INCLUDE_DIR}
+    ${DCMTK_oflog_INCLUDE_DIR}
     ${DCMTK_dcmdata_INCLUDE_DIR}
     ${DCMTK_dcmnet_INCLUDE_DIR}
     ${DCMTK_dcmimgle_INCLUDE_DIR}
@@ -181,8 +193,8 @@
     ${DCMTK_dcmimgle_LIBRARY}
     ${DCMTK_dcmnet_LIBRARY}
     ${DCMTK_dcmdata_LIBRARY}
+    ${DCMTK_oflog_LIBRARY}
     ${DCMTK_ofstd_LIBRARY}
-    ${DCMTK_oflog_LIBRARY}
     ${DCMTK_config_LIBRARY}
   )

@@ -204,6 +216,7 @@
 ENDIF( DCMTK_config_INCLUDE_DIR
     AND DCMTK_ofstd_INCLUDE_DIR
     AND DCMTK_ofstd_LIBRARY
+    AND DCMTK_oflog_INCLUDE_DIR
     AND DCMTK_oflog_LIBRARY
     AND DCMTK_dcmdata_INCLUDE_DIR
     AND DCMTK_dcmdata_LIBRARY
@@ -242,9 +255,9 @@
   DCMTK_dcmimgle_INCLUDE_DIR
   DCMTK_dcmimgle_LIBRARY
   DCMTK_imagedb_LIBRARY
-  DCMTK_dcmnet_LIBRARY
   DCMTK_ofstd_INCLUDE_DIR
   DCMTK_ofstd_LIBRARY
+  DCMTK_oflog_INCLUDE_DIR
   DCMTK_oflog_LIBRARY
   )


Update to pcl 1.8.1 and newer PointCloudLibraryPlugin

This allows compilation to succeed with newer versions of VTK which
remove some deprecated functions.

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -469,7 +469,7 @@
   ExternalProject_Add(
     pcl
     GIT_REPOSITORY http://github.com/pointcloudlibrary/pcl.git
-    GIT_TAG pcl-1.8.0
+    GIT_TAG pcl-1.8.1
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
       ${eigen_args}
@@ -503,7 +503,7 @@

 ExternalProject_Add(PointCloudLibraryPlugin
   GIT_REPOSITORY https://github.com/patmarion/PointCloudLibraryPlugin.git
-  GIT_TAG 84de916
+  GIT_TAG 2c46eb9
   CMAKE_CACHE_ARGS
     ${default_cmake_args}
     ${eigen_args}


update

update

--- modules/cpp-optparse.cmake
+++ modules/cpp-optparse.cmake
@@ -2,7 +2,12 @@

   # Module library
   file(GLOB SOURCE_FILES "cpp-optparse/OptionParser.cpp")
-  set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+  if(NOT MSVC)
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+  else()
+    # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4244")
+  endif()
   add_library(cpp-optparse ${SOURCE_FILES})

   # Module folder


Actually load the shared scripts in the exported config file.

--- osvrConfig.cmake
+++ osvrConfig.cmake
@@ -21,3 +21,7 @@
 # share the osvr_convert_json script between the main tree and external config users.
 set(OSVR_JSON_TO_C_EXECUTABLE "osvr::osvr_json_to_c" CACHE INTERNAL
     "The target name for the osvr_json_to_c executable" FORCE)
+
+# The shared scripts
+include("${CMAKE_CURRENT_LIST_DIR}/osvrAddPlugin.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/osvrConvertJson.cmake")


Add TODO.

Add TODO.

--- packaging/linux/LinuxPackaging.cmake
+++ packaging/linux/LinuxPackaging.cmake
@@ -51,11 +51,13 @@
 if(${DISTRIBUTOR_ID} MATCHES fc|fedora|Fedora|Centos|centos|SUSE|Suse|suse)
   set(CPACK_GENERATOR RPM)
   set(CPACK_RPM_PACKAGE_REQUIRES "qt, qtwebkit")
-  set(CPACK_RPM_PACKAGE_OBSOLETES "medinria-all, dcmtk-inria, itk-inria-build, medinria, medinria-plugins, medinria-plugins-asclepios, medinria-visages-plugins, vtk-inria-build")
+  set(CPACK_RPM_PACKAGE_OBSOLETES "medinria-all, dcmtk-inria, itk-inria-build, medinria, medinria-plugins, medinria-plugins-asclepios, medinria-visages-plugins, vtk-inria-build")
+  #TODO When we will not support old fedora it will not be necessary anymore.
 else()
   set(CPACK_GENERATOR DEB)
   set(CPACK_DEBIAN_PACKAGE_DEPENDS "libqt4-sql-sqlite, libqt4-webkit")
   set(CPACK_DEBIAN_PACKAGE_REPLACES "medinria-all, dcmtk-inria, itk-inria-build, medinria, medinria-plugins, medinria-plugins-asclepios, medinria-visages-plugins, vtk-inria-build")
+  #TODO When we will not support old ubuntu it will not be necessary anymore.
 endif()
 set(CPACK_GENERATOR "${CPACK_GENERATOR}" CACHE STRING "Type of package to build")
 mark_as_advanced(CPACK_GENERATOR)


cmake/uselib: better performance, preserve cache when running twice

This fixes failing corresponding automatic test

--- cmake/qibuild/internal/uselib.cmake
+++ cmake/qibuild/internal/uselib.cmake
@@ -28,7 +28,6 @@

 #compute the dependencies list, removing duplicate
-#TODO: store computed dependencies in ${_U_PKG}_FLAT_DEPENDS ?
 function(_qi_use_lib_get_deps name _OUT_list)
   set(_result ${ARGN})
   list(LENGTH _result _count)
@@ -69,11 +68,11 @@
       list(FIND _result ${_sub_dep} _is_present)
       string(TOUPPER ${_sub_dep} _u_sub_dep)
       if (_is_present EQUAL -1)
-        #if (NOT ${_u_sub_dep}_FAT_DEPENDS)
+        if (NOT ${_u_sub_dep}_FAT_DEPENDS)
           _qi_use_lib_get_deps("${_U_PKG}" _new_deps "${_sub_dep}")
-        #else()
-        #  set(_new_deps ${${_u_sub_dep}_FAT_DEPENDS})
-        #endif()
+        else()
+          set(_new_deps ${${_u_sub_dep}_FAT_DEPENDS})
+        endif()
         list(APPEND _result ${_new_deps})
       endif()
     endforeach()
@@ -152,5 +151,5 @@
     endif()
   endforeach()
   string(TOUPPER "${name}" _U_name)
-  qi_set_advanced_cache("${_U_name}_DEPENDS" ${${_U_name}_DEPENDS} ${_DEPS})
+  qi_set_advanced_cache("${_U_name}_DEPENDS" ${${_U_name}_DEPENDS})
 endfunction()


Fix bug with package names containing 'meta'

--- find.cmake
+++ find.cmake
@@ -25,7 +25,7 @@
       file(GLOB _packageInfos ${_repo}/*.meta)
       foreach(_packageInfo ${_packageInfos})
         get_filename_component(_packageName ${_packageInfo} NAME)
-        string(REPLACE ".meta" "" _packageName ${_packageName})
+        string(REGEX REPLACE "\\.meta$" "" _packageName ${_packageName})
         vpm_trace("Mapping ${_packageName} to ${_name} repo")
         list(APPEND VPM_PACKAGE_${_packageName}_REPOS ${_name})
       endforeach()


Remove -g from Android complier flags in release mode (used by NDK but inconvenient for CMake)

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -1158,8 +1158,8 @@
 # cache flags
 set( CMAKE_CXX_FLAGS           ""                        CACHE STRING "c++ flags" )
 set( CMAKE_C_FLAGS             ""                        CACHE STRING "c flags" )
-set( CMAKE_CXX_FLAGS_RELEASE   "-O3 -g -DNDEBUG"         CACHE STRING "c++ Release flags" )
-set( CMAKE_C_FLAGS_RELEASE     "-O3 -g -DNDEBUG"         CACHE STRING "c Release flags" )
+set( CMAKE_CXX_FLAGS_RELEASE   "-O3 -DNDEBUG"            CACHE STRING "c++ Release flags" )
+set( CMAKE_C_FLAGS_RELEASE     "-O3 -DNDEBUG"            CACHE STRING "c Release flags" )
 set( CMAKE_CXX_FLAGS_DEBUG     "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c++ Debug flags" )
 set( CMAKE_C_FLAGS_DEBUG       "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c Debug flags" )
 set( CMAKE_SHARED_LINKER_FLAGS ""                        CACHE STRING "shared linker flags" )


Android toolchain: restored explicit include_directories of system /usr/include

It is needed because of explicit STL include paths.
Otherwise some standard headers (like fenv.h) can not not be correctly found by the compiler.

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -1175,11 +1175,8 @@
 endif()

 # global includes and link directories
-if( ANDROID_STL_INCLUDE_DIRS )
- include_directories( SYSTEM ${ANDROID_STL_INCLUDE_DIRS} )
-endif()
+include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} )
 link_directories( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
-

 # set these global flags for cmake client scripts to change behavior
 set( ANDROID True )


ENH: CI: Disable MIT_SHM X11 extension

ENH: CI: Disable MIT_SHM X11 extension

Set environment variable QT_X11_NO_MITSHM=1 to disable MIT_SHM X11
extension. This avoids CI errors like:

    X Error: BadAccess (attempt to access private resource denied) 10
      Extension:    130 (MIT-SHM)
      Minor opcode: 1 (X_ShmAttach)
      Resource id:  0x11b

--- CMake/CircleCI/CircleCI_CTK_Docker.cmake
+++ CMake/CircleCI/CircleCI_CTK_Docker.cmake
@@ -67,6 +67,8 @@
 set( BUILD_TESTING ON )
 set( CTK_BUILD_EXAMPLES OFF )

+# Disable MIT_SHM X11 extension
+set( ENV{QT_X11_NO_MITSHM} 1 )

 ###################


[cmake] update OptimizeForArchitecture

[cmake] update OptimizeForArchitecture

--- src/cmake/OptimizeForArchitecture.cmake
+++ src/cmake/OptimizeForArchitecture.cmake
@@ -1,6 +1,53 @@
+# Determine the host CPU feature set and determine the best set of compiler
+# flags to enable all supported SIMD relevant features. Alternatively, the
+# target CPU can be explicitly selected (for generating more generic binaries
+# or for targeting a different system).
+# Compilers provide e.g. the -march=native flag to achieve a similar result.
+# This fails to address the need for building for a different microarchitecture
+# than the current host.
+# The script tries to deduce all settings from the model and family numbers of
+# the CPU instead of reading the CPUID flags from e.g. /proc/cpuinfo. This makes
+# the detection more independent from the CPUID code in the kernel (e.g. avx2 is
+# not listed on older kernels).
+#
+# Usage:
+# OptimizeForArchitecture()
+# If either of Vc_SSE_INTRINSICS_BROKEN, Vc_AVX_INTRINSICS_BROKEN,
+# Vc_AVX2_INTRINSICS_BROKEN is defined and set, the OptimizeForArchitecture
+# macro will consequently disable the relevant features via compiler flags.
+# See https://github.com/VcDevel/Vc/blob/master/cmake/OptimizeForArchitecture.cmake
+
+#=============================================================================
+# Copyright 2010-2016 Matthias Kretz <kretz@kde.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#  * Redistributions of source code must retain the above copyright notice,
+#    this list of conditions and the following disclaimer.
+#  * Redistributions in binary form must reproduce the above copyright notice,
+#    this list of conditions and the following disclaimer in the documentation
+#    and/or other materials provided with the distribution.
+#  * Neither the names of contributing organizations nor the
+#    names of its contributors may be used to endorse or promote products
+#    derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#=============================================================================
+
 get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH)
 include("${_currentDir}/AddCompilerFlag.cmake")
-include(CheckIncludeFile)
+include(CheckIncludeFileCXX)

 macro(_my_find _list _value _ret)
    list(FIND ${_list} "${_value}" _found)
@@ -11,9 +58,7 @@
    endif(_found EQUAL -1)
 endmacro(_my_find)

-macro(AutodetectHostArchitecture)
-   set(TARGET_ARCHITECTURE "generic")
-   set(Vc_ARCHITECTURE_FLAGS)
+macro(OFA_AutodetectX86)
    set(_vendor_id)
    set(_cpu_family)
    set(_cpu_model)
@@ -22,12 +67,15 @@
       string(REGEX REPLACE ".*vendor_id[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _vendor_id "${_cpuinfo}")
       string(REGEX REPLACE ".*cpu family[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_family "${_cpuinfo}")
       string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}")
-      string(REGEX REPLACE ".*flags[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_flags "${_cpuinfo}")
+      string(REGEX REPLACE ".*flags[ \t]*:[ \t]+([^\n]+).*" "\\1" _cpu_flags "${_cpuinfo}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor" OUTPUT_VARIABLE _vendor_id)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.model"  OUTPUT_VARIABLE _cpu_model)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.family" OUTPUT_VARIABLE _cpu_family)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE _cpu_flags)
+      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features" OUTPUT_VARIABLE _sysctl_output_string)
+      string(REPLACE "\n" ";" _sysctl_output ${_sysctl_output_string})
+      list(GET _sysctl_output 0 _vendor_id)
+      list(GET _sysctl_output 1 _cpu_model)
+      list(GET _sysctl_output 2 _cpu_family)
+      list(GET _sysctl_output 3 _cpu_flags)
+
       string(TOLOWER "${_cpu_flags}" _cpu_flags)
       string(REPLACE "." "_" _cpu_flags "${_cpu_flags}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
@@ -37,48 +85,82 @@
       string(REGEX REPLACE ".* Family ([0-9]+) .*" "\\1" _cpu_family "${_cpu_id}")
       string(REGEX REPLACE ".* Model ([0-9]+) .*" "\\1" _cpu_model "${_cpu_id}")
    endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
-   message(STATUS "Detected: Vendor ID '${_vendor_id}'   CPU Family '${_cpu_family}'  CPU Model '${_cpu_model}'  CPU Flags  '${_cpu_flags}'")
    if(_vendor_id STREQUAL "GenuineIntel")
       if(_cpu_family EQUAL 6)
-         # Any recent Intel CPU except NetBurst
-         if(_cpu_model EQUAL 70) #intel haswell
+         # taken from the Intel ORM
+         # http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
+         # CPUID Signature Values of Of Recent Intel Microarchitectures
+         # 4E 5E       | Skylake microarchitecture
+         # 3D 47 56    | Broadwell microarchitecture
+         # 3C 45 46 3F | Haswell microarchitecture
+         # 3A 3E       | Ivy Bridge microarchitecture
+         # 2A 2D       | Sandy Bridge microarchitecture
+         # 25 2C 2F    | Intel microarchitecture Westmere
+         # 1A 1E 1F 2E | Intel microarchitecture Nehalem
+         # 17 1D       | Enhanced Intel Core microarchitecture
+         # 0F          | Intel Core microarchitecture
+         #
+         # Intel SDM Vol. 3C 35-1 / December 2016:
+         # 57          | Xeon Phi 3200, 5200, 7200  [Knights Landing]
+         # 85          | Future Xeon Phi
+         # 8E 9E       | 7th gen. Core              [Kaby Lake]
+         # 55          | Future Xeon                [Skylake w/ AVX512]
+         # 4E 5E       | 6th gen. Core / E3 v5      [Skylake w/o AVX512]
+         # 56          | Xeon D-1500                [Broadwell]
+         # 4F          | Xeon E5 v4, E7 v4, i7-69xx [Broadwell]
+         # 47          | 5th gen. Core / Xeon E3 v4 [Broadwell]
+         # 3D          | M-5xxx / 5th gen.          [Broadwell]
+         # 3F          | Xeon E5 v3, E7 v3, i7-59xx [Haswell-E]
+         # 3C 45 46    | 4th gen. Core, Xeon E3 v3  [Haswell]
+         # 3E          | Xeon E5 v2, E7 v2, i7-49xx [Ivy Bridge-E]
+         # 3A          | 3rd gen. Core, Xeon E3 v2  [Ivy Bridge]
+         # 2D          | Xeon E5, i7-39xx           [Sandy Bridge]
+         # 2F          | Xeon E7
+         # 2A          | Xeon E3, 2nd gen. Core     [Sandy Bridge]
+         # 2E          | Xeon 7500, 6500 series
+         # 25 2C       | Xeon 3600, 5600 series, Core i7, i5 and i3
+         #
+         # Values from the Intel SDE:
+         # 5C | Goldmont
+         # 5A | Silvermont
+         # 57 | Knights Landing
+         # 66 | Cannonlake
+         # 55 | Skylake Server
+         # 4E | Skylake Client
+         # 3C | Broadwell (likely a bug in the SDE)
+         # 3C | Haswell
+         if(_cpu_model EQUAL 87) # 57
+            set(TARGET_ARCHITECTURE "knl")  # Knights Landing
+         elseif(_cpu_model EQUAL 92)
+            set(TARGET_ARCHITECTURE "goldmont")
+         elseif(_cpu_model EQUAL 90 OR _cpu_model EQUAL 76)
+            set(TARGET_ARCHITECTURE "silvermont")
+         elseif(_cpu_model EQUAL 102)
+            set(TARGET_ARCHITECTURE "cannonlake")
+         elseif(_cpu_model EQUAL 142 OR _cpu_model EQUAL 158) # 8E, 9E
+            set(TARGET_ARCHITECTURE "kaby-lake")
+         elseif(_cpu_model EQUAL 85) # 55
+            set(TARGET_ARCHITECTURE "skylake-avx512")
+         elseif(_cpu_model EQUAL 78 OR _cpu_model EQUAL 94) # 4E, 5E
+            set(TARGET_ARCHITECTURE "skylake")
+         elseif(_cpu_model EQUAL 61 OR _cpu_model EQUAL 71 OR _cpu_model EQUAL 79 OR _cpu_model EQUAL 86) # 3D, 47, 4F, 56
+            set(TARGET_ARCHITECTURE "broadwell")
+         elseif(_cpu_model EQUAL 60 OR _cpu_model EQUAL 69 OR _cpu_model EQUAL 70 OR _cpu_model EQUAL 63)
             set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 69) # Core i5/i7-4xxxU CPUs
-            set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 63) # Xeon E5 series
+         elseif(_cpu_model EQUAL 58 OR _cpu_model EQUAL 62)
+            set(TARGET_ARCHITECTURE "ivy-bridge")
+         elseif(_cpu_model EQUAL 42 OR _cpu_model EQUAL 45)
             set(TARGET_ARCHITECTURE "sandy-bridge")
-         elseif(_cpu_model EQUAL 62)
-            set(TARGET_ARCHITECTURE "ivy-bridge")
-         elseif(_cpu_model EQUAL 60)
-            set(TARGET_ARCHITECTURE "haswell")
-         elseif(_cpu_model EQUAL 58)
-            set(TARGET_ARCHITECTURE "ivy-bridge")
-         elseif(_cpu_model EQUAL 47) # Xeon E7 4860
+         elseif(_cpu_model EQUAL 37 OR _cpu_model EQUAL 44 OR _cpu_model EQUAL 47)
             set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 46) # Xeon 7500 series
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 45) # Xeon TNG
-            set(TARGET_ARCHITECTURE "sandy-bridge")
-         elseif(_cpu_model EQUAL 44) # Xeon 5600 series
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 42) # Core TNG
-            set(TARGET_ARCHITECTURE "sandy-bridge")
-         elseif(_cpu_model EQUAL 37) # Core i7/i5/i3
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 31) # Core i7/i5
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 30) # Core i7/i5
-            set(TARGET_ARCHITECTURE "westmere")
-         elseif(_cpu_model EQUAL 29)
-            set(TARGET_ARCHITECTURE "penryn")
-         elseif(_cpu_model EQUAL 28)
-            set(TARGET_ARCHITECTURE "atom")
-         elseif(_cpu_model EQUAL 26)
+         elseif(_cpu_model EQUAL 26 OR _cpu_model EQUAL 30 OR _cpu_model EQUAL 31 OR _cpu_model EQUAL 46)
             set(TARGET_ARCHITECTURE "nehalem")
-         elseif(_cpu_model EQUAL 23)
+         elseif(_cpu_model EQUAL 23 OR _cpu_model EQUAL 29)
             set(TARGET_ARCHITECTURE "penryn")
          elseif(_cpu_model EQUAL 15)
             set(TARGET_ARCHITECTURE "merom")
+         elseif(_cpu_model EQUAL 28)
+            set(TARGET_ARCHITECTURE "atom")
          elseif(_cpu_model EQUAL 14)
             set(TARGET_ARCHITECTURE "core")
          elseif(_cpu_model LESS 14)
@@ -97,11 +179,13 @@
          endif(_cpu_model GREATER 2)
       endif(_cpu_family EQUAL 6)
    elseif(_vendor_id STREQUAL "AuthenticAMD")
-      if(_cpu_family EQUAL 22) # 16h
+      if(_cpu_family EQUAL 23)
+         set(TARGET_ARCHITECTURE "zen")
+      elseif(_cpu_family EQUAL 22) # 16h
          set(TARGET_ARCHITECTURE "AMD 16h")
       elseif(_cpu_family EQUAL 21) # 15h
          if(_cpu_model LESS 2)
-         set(TARGET_ARCHITECTURE "bulldozer")
+            set(TARGET_ARCHITECTURE "bulldozer")
          else()
             set(TARGET_ARCHITECTURE "piledriver")
          endif()
@@ -119,38 +203,85 @@
    endif(_vendor_id STREQUAL "GenuineIntel")
 endmacro()

-macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
-   set(_force)
-   if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
-      message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
-      set(_force FORCE)
+macro(OFA_AutodetectArm)
+   message(WARNING "Architecture auto-detection for CMAKE_SYSTEM_PROCESSOR '${CMAKE_SYSTEM_PROCESSOR}' is not supported by OptimizeForArchitecture.cmake")
+endmacro()
+
+macro(OFA_AutodetectHostArchitecture)
+   set(TARGET_ARCHITECTURE "generic")
+   set(Vc_ARCHITECTURE_FLAGS)
+   if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
+      OFA_AutodetectX86()
+   elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(arm|aarch32|aarch64)")
+      OFA_AutodetectArm()
+   else()
+      message(FATAL_ERROR "OptimizeForArchitecture.cmake does not implement support for CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
    endif()
-   set(_last_target_arch "${TARGET_ARCHITECTURE}" CACHE STRING "" FORCE)
-   mark_as_advanced(_last_target_arch)
-   string(TOLOWER "${TARGET_ARCHITECTURE}" TARGET_ARCHITECTURE)
-
+endmacro()
+
+macro(OFA_HandleX86Options)
    set(_march_flag_list)
    set(_available_vector_units_list)
-
-   if(TARGET_ARCHITECTURE STREQUAL "auto")
-      if(${CMAKE_COMPILER_IS_GNUCXX})
-         execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
-                         OUTPUT_VARIABLE GCC_VERSION)
-         if(GCC_VERSION VERSION_GREATER 4.2 OR GCC_VERSION VERSION_EQUAL 4.2)
-            set(_is_arch_native_supported YES)
-         endif()
-      endif()
-
-      if(_is_arch_native_supported)
-         AddCompilerFlag("-march=native")
-         set(TARGET_ARCHITECTURE "native")
-         message(STATUS "Optimizing for the host architecture using -march=native")
-      else()
-         AutodetectHostArchitecture()
-         message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
-      endif()
-   endif(TARGET_ARCHITECTURE STREQUAL "auto")
+   macro(_nehalem)
+      list(APPEND _march_flag_list "nehalem")
+      list(APPEND _march_flag_list "corei7")
+      list(APPEND _march_flag_list "core2")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+   endmacro()
+   macro(_westmere)
+      list(APPEND _march_flag_list "westmere")
+      _nehalem()
+   endmacro()
+   macro(_sandybridge)
+      list(APPEND _march_flag_list "sandybridge")
+      list(APPEND _march_flag_list "corei7-avx")
+      _westmere()
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+   endmacro()
+   macro(_ivybridge)
+      list(APPEND _march_flag_list "ivybridge")
+      list(APPEND _march_flag_list "core-avx-i")
+      _sandybridge()
+      list(APPEND _available_vector_units_list "rdrnd" "f16c")
+   endmacro()
+   macro(_haswell)
+      list(APPEND _march_flag_list "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      _ivybridge()
+      list(APPEND _available_vector_units_list "avx2" "fma" "bmi" "bmi2")
+   endmacro()
+   macro(_broadwell)
+      list(APPEND _march_flag_list "broadwell")
+      _haswell()
+   endmacro()
+   macro(_skylake)
+      list(APPEND _march_flag_list "skylake")
+      _broadwell()
+   endmacro()
+   macro(_skylake_avx512)
+      list(APPEND _march_flag_list "skylake-avx512")
+      _skylake()
+      list(APPEND _available_vector_units_list "avx512f" "avx512cd" "avx512dq" "avx512bw" "avx512vl")
+   endmacro()
+   macro(_cannonlake)
+      list(APPEND _march_flag_list "cannonlake")
+      _skylake_avx512()
+      list(APPEND _available_vector_units_list "avx512ifma" "avx512vbmi")
+   endmacro()
+   macro(_knightslanding)
+      list(APPEND _march_flag_list "knl")
+      _broadwell()
+      list(APPEND _available_vector_units_list "avx512f" "avx512pf" "avx512er" "avx512cd")
+   endmacro()
+   macro(_silvermont)
+      list(APPEND _march_flag_list "silvermont")
+      _westmere()
+      list(APPEND _available_vector_units_list "rdrnd")
+   endmacro()
+   macro(_goldmont)
+      list(APPEND _march_flag_list "goldmont")
+      _silvermont()
+   endmacro()

    if(TARGET_ARCHITECTURE STREQUAL "core")
       list(APPEND _march_flag_list "core2")
@@ -170,32 +301,32 @@
       else()
          message(STATUS "SSE4.1: disabled (auto-detected from this computer's CPU flags)")
       endif()
+   elseif(TARGET_ARCHITECTURE STREQUAL "knl")
+      _knightslanding()
+   elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
+      _cannonlake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "kaby-lake")
+      _skylake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon" OR TARGET_ARCHITECTURE STREQUAL "skylake-avx512")
+      _skylake_avx512()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
+      _skylake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
+      _broadwell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+      _haswell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
+      _ivybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
+      _sandybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
+      _westmere()
    elseif(TARGET_ARCHITECTURE STREQUAL "nehalem")
-      list(APPEND _march_flag_list "nehalem")
-      list(APPEND _march_flag_list "corei7")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
-   elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
-      list(APPEND _march_flag_list "westmere")
-      list(APPEND _march_flag_list "corei7")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
-   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
-      list(APPEND _march_flag_list "core-avx2")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma")
-   elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "rdrnd" "f16c")
-   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
-      list(APPEND _march_flag_list "sandybridge")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+      _nehalem()
+   elseif(TARGET_ARCHITECTURE STREQUAL "goldmont")
+      _goldmont()
+   elseif(TARGET_ARCHITECTURE STREQUAL "silvermont")
+      _silvermont()
    elseif(TARGET_ARCHITECTURE STREQUAL "atom")
       list(APPEND _march_flag_list "atom")
       list(APPEND _march_flag_list "core2")
@@ -214,6 +345,10 @@
    elseif(TARGET_ARCHITECTURE STREQUAL "AMD 14h")
       list(APPEND _march_flag_list "btver1")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a")
+   elseif(TARGET_ARCHITECTURE STREQUAL "zen")
+      list(APPEND _march_flag_list "znver1")
+      _skylake()
+      list(APPEND _available_vector_units_list "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "piledriver")
       list(APPEND _march_flag_list "bdver2")
       list(APPEND _march_flag_list "bdver1")
@@ -247,117 +382,93 @@
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "generic")
       list(APPEND _march_flag_list "generic")
-   elseif(TARGET_ARCHITECTURE STREQUAL "none" OR TARGET_ARCHITECTURE STREQUAL "native")
+   elseif(TARGET_ARCHITECTURE STREQUAL "none")
       # add this clause to remove it from the else clause
    else(TARGET_ARCHITECTURE STREQUAL "core")
       message(FATAL_ERROR "Unknown target architecture: \"${TARGET_ARCHITECTURE}\". Please set TARGET_ARCHITECTURE to a supported value.")
    endif(TARGET_ARCHITECTURE STREQUAL "core")

-   if(NOT (TARGET_ARCHITECTURE STREQUAL "none" OR TARGET_ARCHITECTURE STREQUAL "native"))
+   if(NOT TARGET_ARCHITECTURE STREQUAL "none")
       set(_disable_vector_unit_list)
       set(_enable_vector_unit_list)
-      _my_find(_available_vector_units_list "sse2" SSE2_FOUND)
-      _my_find(_available_vector_units_list "sse3" SSE3_FOUND)
-      _my_find(_available_vector_units_list "ssse3" SSSE3_FOUND)
-      _my_find(_available_vector_units_list "sse4.1" SSE4_1_FOUND)
-      _my_find(_available_vector_units_list "sse4.2" SSE4_2_FOUND)
-      _my_find(_available_vector_units_list "sse4a" SSE4a_FOUND)
       if(DEFINED Vc_AVX_INTRINSICS_BROKEN AND Vc_AVX_INTRINSICS_BROKEN)
-         UserWarning("AVX disabled per default because of old/broken compiler")
-         set(AVX_FOUND false)
-         set(XOP_FOUND false)
-         set(FMA4_FOUND false)
-         set(AVX2_FOUND false)
+         message(STATUS "AVX disabled because of old/broken toolchain")
+         set(_avx_broken true)
+         set(_avx2_broken true)
+         set(_fma4_broken true)
+         set(_xop_broken true)
       else()
-         _my_find(_available_vector_units_list "avx" AVX_FOUND)
-         _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
+         set(_avx_broken false)
+         if(DEFINED Vc_FMA4_INTRINSICS_BROKEN AND Vc_FMA4_INTRINSICS_BROKEN)
+            message(STATUS "FMA4 disabled because of old/broken toolchain")
+            set(_fma4_broken true)
+         else()
+            set(_fma4_broken false)
+         endif()
          if(DEFINED Vc_XOP_INTRINSICS_BROKEN AND Vc_XOP_INTRINSICS_BROKEN)
-            UserWarning("XOP disabled per default because of old/broken compiler")
-            set(XOP_FOUND false)
+            message(STATUS "XOP disabled because of old/broken toolchain")
+            set(_xop_broken true)
          else()
-            _my_find(_available_vector_units_list "xop" XOP_FOUND)
+            set(_xop_broken false)
          endif()
          if(DEFINED Vc_AVX2_INTRINSICS_BROKEN AND Vc_AVX2_INTRINSICS_BROKEN)
-            UserWarning("AVX2 disabled per default because of old/broken compiler")
-            set(AVX2_FOUND false)
+            message(STATUS "AVX2 disabled because of old/broken toolchain")
+            set(_avx2_broken true)
          else()
-            _my_find(_available_vector_units_list "avx2" AVX2_FOUND)
+            set(_avx2_broken false)
          endif()
       endif()
-      set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
-      set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSSE3  ${SSSE3_FOUND}  CACHE BOOL "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
-      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
-      set(USE_AVX2   ${AVX2_FOUND}   CACHE BOOL "Use AVX2. This will double all of the vector sizes relative to SSE." ${_force})
-      set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
-      set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA4)
-      if(USE_SSE2)
-         list(APPEND _enable_vector_unit_list "sse2")
-      else(USE_SSE2)
-         list(APPEND _disable_vector_unit_list "sse2")
-      endif(USE_SSE2)
-      if(USE_SSE3)
-         list(APPEND _enable_vector_unit_list "sse3")
-      else(USE_SSE3)
-         list(APPEND _disable_vector_unit_list "sse3")
-      endif(USE_SSE3)
-      if(USE_SSSE3)
-         list(APPEND _enable_vector_unit_list "ssse3")
-      else(USE_SSSE3)
-         list(APPEND _disable_vector_unit_list "ssse3")
-      endif(USE_SSSE3)
-      if(USE_SSE4_1)
-         list(APPEND _enable_vector_unit_list "sse4.1")
-      else(USE_SSE4_1)
-         list(APPEND _disable_vector_unit_list "sse4.1")
-      endif(USE_SSE4_1)
-      if(USE_SSE4_2)
-         list(APPEND _enable_vector_unit_list "sse4.2")
-      else(USE_SSE4_2)
-         list(APPEND _disable_vector_unit_list "sse4.2")
-      endif(USE_SSE4_2)
-      if(USE_SSE4a)
-         list(APPEND _enable_vector_unit_list "sse4a")
-      else(USE_SSE4a)
-         list(APPEND _disable_vector_unit_list "sse4a")
-      endif(USE_SSE4a)
-      if(USE_AVX)
-         list(APPEND _enable_vector_unit_list "avx")
-         # we want SSE intrinsics to result in instructions using the VEX prefix.
-         # Otherwise integer ops (which require the older SSE intrinsics) would
-         # always have a large penalty.
-         list(APPEND _enable_vector_unit_list "sse2avx")
-      else(USE_AVX)
-         list(APPEND _disable_vector_unit_list "avx")
-      endif(USE_AVX)
-      if(USE_XOP)
-         list(APPEND _enable_vector_unit_list "xop")
-      else()
-         list(APPEND _disable_vector_unit_list "xop")
-      endif()
-      if(USE_FMA4)
-         list(APPEND _enable_vector_unit_list "fma4")
-      else()
-         list(APPEND _disable_vector_unit_list "fma4")
-      endif()
-      if(USE_AVX2)
-         list(APPEND _enable_vector_unit_list "avx2")
-      else()
-         list(APPEND _disable_vector_unit_list "avx2")
-      endif()
+
+      macro(_enable_or_disable _name _flag _documentation _broken)
+         if(_broken)
+            set(_found false)
+         else()
+            _my_find(_available_vector_units_list "${_flag}" _found)
+         endif()
+         set(USE_${_name} ${_found} CACHE BOOL "${documentation}" ${_force})
+         mark_as_advanced(USE_${_name})
+         if(USE_${_name})
+            list(APPEND _enable_vector_unit_list "${_flag}")
+         else()
+            list(APPEND _disable_vector_unit_list "${_flag}")
+         endif()
+      endmacro()
+      _enable_or_disable(SSE2 "sse2" "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." false)
+      _enable_or_disable(SSE3 "sse3" "Use SSE3. If SSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSSE3 "ssse3" "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_1 "sse4.1" "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_2 "sse4.2" "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4a "sse4a" "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." false)
+      _enable_or_disable(AVX "avx" "Use AVX. This will all floating-point vector sizes relative to SSE." _avx_broken)
+      _enable_or_disable(FMA "fma" "Use FMA." _avx_broken)
+      _enable_or_disable(BMI2 "bmi2" "Use BMI2." _avx_broken)
+      _enable_or_disable(AVX2 "avx2" "Use AVX2. This will double all of the vector sizes relative to SSE." _avx2_broken)
+      _enable_or_disable(XOP "xop" "Use XOP." _xop_broken)
+      _enable_or_disable(FMA4 "fma4" "Use FMA4." _fma4_broken)
+      _enable_or_disable(AVX512F "avx512f" "Use AVX512F. This will double all floating-point vector sizes relative to AVX2." false)
+      _enable_or_disable(AVX512VL "avx512vl" "Use AVX512VL. This enables 128- and 256-bit vector length instructions with EVEX coding (improved write-masking & more vector registers)." _avx2_broken)
+      _enable_or_disable(AVX512PF "avx512pf" "Use AVX512PF. This enables prefetch instructions for gathers and scatters." false)
+      _enable_or_disable(AVX512ER "avx512er" "Use AVX512ER. This enables exponential and reciprocal instructions." false)
+      _enable_or_disable(AVX512CD "avx512cd" "Use AVX512CD." false)
+      _enable_or_disable(AVX512DQ "avx512dq" "Use AVX512DQ." false)
+      _enable_or_disable(AVX512BW "avx512bw" "Use AVX512BW." false)
+      _enable_or_disable(AVX512IFMA "avx512ifma" "Use AVX512IFMA." false)
+      _enable_or_disable(AVX512VBMI "avx512vbmi" "Use AVX512VBMI." false)
+
       if(MSVC)
          # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
          # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)
-         _my_find(_enable_vector_unit_list "avx" _avx)
-         set(_avx_flag FALSE)
-         if(_avx)
-            AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _avx_flag)
-         endif()
-         if(NOT _avx_flag)
+         _my_find(_enable_vector_unit_list "avx2" _found)
+         if(_found)
+            AddCompilerFlag("/arch:AVX2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _found)
+         endif()
+         if(NOT _found)
+            _my_find(_enable_vector_unit_list "avx" _found)
+            if(_found)
+               AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _found)
+            endif()
+         endif()
+         if(NOT _found)
             _my_find(_enable_vector_unit_list "sse2" _found)
             if(_found)
                AddCompilerFlag("/arch:SSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
@@ -369,54 +480,33 @@
             add_definitions("-D${_flag}")
          endforeach(_flag)
       elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
-         _my_find(_available_vector_units_list "avx2"    _found)
-         if(_found)
-            AddCompilerFlag("-xCORE-AVX2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-         else(_found)
-            _my_find(_available_vector_units_list "f16c"    _found)
-            if(_found)
-               AddCompilerFlag("-xCORE-AVX-I" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-            else(_found)
-               _my_find(_available_vector_units_list "avx"    _found)
-               if(_found)
-                  AddCompilerFlag("-xAVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-               else(_found)
-                  _my_find(_available_vector_units_list "sse4.2" _found)
-                  if(_found)
-                     AddCompilerFlag("-xSSE4.2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                  else(_found)
-                     _my_find(_available_vector_units_list "sse4.1" _found)
-                     if(_found)
-                        AddCompilerFlag("-xSSE4.1" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                     else(_found)
-                        _my_find(_available_vector_units_list "ssse3"  _found)
-                        if(_found)
-                           AddCompilerFlag("-xSSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                        else(_found)
-                           _my_find(_available_vector_units_list "sse3"   _found)
-                           if(_found)
-                              # If the target host is an AMD machine then we still want to use -xSSE2 because the binary would refuse to run at all otherwise
-                              _my_find(_march_flag_list "barcelona" _found)
-                              if(NOT _found)
-                                 _my_find(_march_flag_list "k8-sse3" _found)
-                              endif(NOT _found)
-                              if(_found)
-                                 AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                              else(_found)
-                                 AddCompilerFlag("-xSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                              endif(_found)
-                           else(_found)
-                              _my_find(_available_vector_units_list "sse2"   _found)
-                              if(_found)
-                                 AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                              endif(_found)
-                           endif(_found)
-                        endif(_found)
-                     endif(_found)
-                  endif(_found)
-               endif(_found)
-            endif(_found)
-         endif(_found)
+         set(OFA_map_knl "-xMIC-AVX512")
+         set(OFA_map_cannonlake "-xCORE-AVX512")
+         set(OFA_map_skylake-avx512 "-xCORE-AVX512")
+         set(OFA_map_skylake "-xCORE-AVX2")
+         set(OFA_map_broadwell "-xCORE-AVX2")
+         set(OFA_map_haswell "-xCORE-AVX2")
+         set(OFA_map_ivybridge "-xCORE-AVX-I")
+         set(OFA_map_sandybridge "-xAVX")
+         set(OFA_map_westmere "-xSSE4.2")
+         set(OFA_map_nehalem "-xSSE4.2")
+         set(OFA_map_penryn "-xSSSE3")
+         set(OFA_map_merom "-xSSSE3")
+         set(OFA_map_core2 "-xSSE3")
+         set(_ok FALSE)
+         foreach(arch ${_march_flag_list})
+            if(DEFINED OFA_map_${arch})
+               AddCompilerFlag(${OFA_map_${arch}} CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _ok)
+               if(_ok)
+                  break()
+               endif()
+            endif()
+         endforeach()
+         if(NOT _ok)
+            # This is the Intel compiler, so SSE2 is a very reasonable baseline.
+            message(STATUS "Did not recognize the requested architecture flag, falling back to SSE2")
+            AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+         endif()
       else() # not MSVC and not ICC => GCC, Clang, Open64
          foreach(_flag ${_march_flag_list})
             AddCompilerFlag("-march=${_flag}" CXX_RESULT _good CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
@@ -450,7 +540,7 @@
                set(_resultVar "HAVE_${_header}")
                string(REPLACE "." "_" _resultVar "${_resultVar}")
                if(_header)
-                  CHECK_INCLUDE_FILE("${_header}" ${_resultVar} "-m${_flag}")
+                  CHECK_INCLUDE_FILE_CXX("${_header}" ${_resultVar} "-m${_flag}")
                   if(NOT ${_resultVar})
                      set(_useVar "USE_${_flag}")
                      string(TOUPPER "${_useVar}" _useVar)
@@ -461,7 +551,7 @@
                   endif()
                endif()
                if(NOT _header OR ${_resultVar})
-                  set(Vc_ARCHITECTURE_FLAGS "${Vc_ARCHITECTURE_FLAGS} -m${_flag}")
+                  list(APPEND Vc_ARCHITECTURE_FLAGS "-m${_flag}")
                endif()
             endif()
          endforeach(_flag)
@@ -470,4 +560,53 @@
          endforeach(_flag)
       endif()
    endif()
+endmacro()
+
+macro(OFA_HandleArmOptions)
+   option(USE_NEON "Enable use of NEON instructions" ON)
+   if(USE_NEON)
+      AddCompilerFlag(-mfloat-abi=softfp CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+      AddCompilerFlag(-mfpu=neon CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+   endif()
+endmacro()
+
+macro(OptimizeForArchitecture)
+   if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
+      set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. \
+Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. \
+Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
+Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
+\"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
+\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kaby-lake\", \"cannonlake\", \"silvermont\", \
+\"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
+\"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
+\"AMD 14h\", \"AMD 16h\", \"zen\".")
+   elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(arm|aarch32|aarch64)")
+      set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. \
+Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used. \
+Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
+Other supported values are: \"none\", \"generic\", TODO...")
+   else()
+      message(WARNING "The CMAKE_SYSTEM_PROCESSOR '${CMAKE_SYSTEM_PROCESSOR}' is not supported by OptimizeForArchitecture.cmake")
+   endif()
+   set(_force)
+   if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
+      message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
+      set(_force FORCE)
+   endif()
+   set(_last_target_arch "${TARGET_ARCHITECTURE}" CACHE STRING "" FORCE)
+   mark_as_advanced(_last_target_arch)
+   string(TOLOWER "${TARGET_ARCHITECTURE}" TARGET_ARCHITECTURE)
+
+   if(TARGET_ARCHITECTURE STREQUAL "auto")
+      OFA_AutodetectHostArchitecture()
+      message(STATUS "Detected Host CPU: ${TARGET_ARCHITECTURE}")
+   endif()
+
+   if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
+      OFA_HandleX86Options()
+   elseif("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(arm|aarch32|aarch64)")
+      OFA_HandleArmOptions()
+   endif()
 endmacro(OptimizeForArchitecture)
+


Bump the ParaView SHA for new fixes

Bump the ParaView SHA for new fixes

--- versions.cmake
+++ versions.cmake
@@ -68,7 +68,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "886c58ee8d8e79abf22c12d1f090b80329fa9870")
+  set(_paraview_revision "70155c17cfe7c2f547bb25ddb859a65518896ee3")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


make testsuite aware of EIGEN_CTEST_ARGS

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -147,6 +147,9 @@

 # which ctest command to use for running the dashboard
 SET (CTEST_COMMAND "${EIGEN_CMAKE_DIR}ctest -D ${EIGEN_MODE}")
+if($ENV{EIGEN_CTEST_ARGS})
+SET (CTEST_COMMAND "${CTEST_COMMAND} $ENV{EIGEN_CTEST_ARGS}")
+endif($ENV{EIGEN_CTEST_ARGS})
 # what cmake command to use for configuring this dashboard
 SET (CTEST_CMAKE_COMMAND "${EIGEN_CMAKE_DIR}cmake -DEIGEN_LEAVE_TEST_IN_ALL_TARGET=ON")