SourceKit: micro-optimization of CMake (NFC)

Set all the target properties in a single shot.  This avoids the multiple string
parsing within CMake.  Although this makes no noticable differnce, it is
slightly more efficient and also colocates all the target properties.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -335,31 +335,33 @@
         LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
         ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
         RUNTIME DESTINATION bin)
-    set_target_properties(${name} PROPERTIES FOLDER "SourceKit frameworks")
     set_output_directory(${name}
         BINARY_DIR ${SOURCEKIT_RUNTIME_OUTPUT_INTDIR}
         LIBRARY_DIR ${SOURCEKIT_LIBRARY_OUTPUT_INTDIR})
-    set_target_properties(${name} PROPERTIES FRAMEWORK TRUE)
-    set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${headers}")
-    set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_INFO_PLIST "${SOURCEKIT_SOURCE_DIR}/cmake/MacOSXFrameworkInfo.plist.in")
-    set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_IDENTIFIER "com.apple.${name}")
-    set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_SHORT_VERSION_STRING "1.0")
-    set_target_properties(${name} PROPERTIES MACOSX_FRAMEWORK_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}")
-    set_target_properties(${name} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
-    set_target_properties(${name} PROPERTIES INSTALL_NAME_DIR "@rpath")
+    set_target_properties(${name} PROPERTIES
+                          BUILD_WITH_INSTALL_RPATH TRUE
+                          FOLDER "SourceKit frameworks"
+                          FRAMEWORK TRUE
+                          INSTALL_NAME_DIR "@rpath"
+                          MACOSX_FRAMEWORK_INFO_PLIST "${SOURCEKIT_SOURCE_DIR}/cmake/MacOSXFrameworkInfo.plist.in"
+                          MACOSX_FRAMEWORK_IDENTIFIER "com.apple.${name}"
+                          MACOSX_FRAMEWORK_SHORT_VERSION_STRING "1.0"
+                          MACOSX_FRAMEWORK_BUNDLE_VERSION "${SOURCEKIT_VERSION_STRING}"
+                          PUBLIC_HEADER "${headers}")
   else()
     swift_install_in_component(${SOURCEKITFW_INSTALL_IN_COMPONENT}
         DIRECTORY ${framework_location}
         DESTINATION lib${LLVM_LIBDIR_SUFFIX}
         USE_SOURCE_PERMISSIONS)
-    set_target_properties(${name} PROPERTIES FOLDER "SourceKit frameworks")
     set_output_directory(${name}
         BINARY_DIR ${framework_location}
         LIBRARY_DIR ${framework_location})
-    set_target_properties(${name} PROPERTIES PREFIX "")
-    set_target_properties(${name} PROPERTIES SUFFIX "")
-    set_target_properties(${name} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
-    set_target_properties(${name} PROPERTIES INSTALL_NAME_DIR "@rpath/${name}.framework")
+    set_target_properties(${name} PROPERTIES
+                          BUILD_WITH_INSTALL_RPATH TRUE
+                          FOLDER "SourceKit frameworks"
+                          INSTALL_NAME_DIR "@rpath/${name}.framework"
+                          PREFIX ""
+                          SUFFIX "")

     foreach(hdr ${headers})
       get_filename_component(hdrname ${hdr} NAME)


link to clang++

link to clang++

--- build/toolchains/rasperypi.cmake
+++ build/toolchains/rasperypi.cmake
@@ -1,3 +1,6 @@
+# target clang++
+set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
+
 # options
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -stdlib=libc++ -std=c++11")
 set(CXX_FLAGS_DEBUG "-g -O0")


[CMake] Pass LLVM_HOST_TRIPLE to external projects

LLVM runtimes rely on LLVM_HOST_TRIPLE being set in their builds
and tests so make sure it's being passed down.

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

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

--- cmake/modules/LLVMExternalProjectUtils.cmake
+++ cmake/modules/LLVMExternalProjectUtils.cmake
@@ -147,6 +147,7 @@
                -DLLVM_BINARY_DIR=${PROJECT_BINARY_DIR}
                -DLLVM_CONFIG_PATH=$<TARGET_FILE:llvm-config>
                -DLLVM_ENABLE_WERROR=${LLVM_ENABLE_WERROR}
+               -DLLVM_HOST_TRIPLE=${LLVM_HOST_TRIPLE}
                -DPACKAGE_VERSION=${PACKAGE_VERSION}
                -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}


Fix odb-boost on Android

Fix odb-boost on Android

--- cmake/modules/hunter_autotools_project.cmake
+++ cmake/modules/hunter_autotools_project.cmake
@@ -117,7 +117,7 @@

   if(ANDROID)
     hunter_test_string_not_empty("${CMAKE_C_ANDROID_TOOLCHAIN_PREFIX}")
-    hunter_test_string_not_empty("${CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX}")
+    # CMAKE_C_ANDROID_TOOLCHAIN_SUFFIX can be empty

     # Extra Android variables that can't be set in toolchain
     # (some variables available only after toolchain processed).
@@ -269,8 +269,8 @@
     hunter_test_string_not_empty("${CMAKE_RANLIB}")
     hunter_test_string_not_empty("${CMAKE_STRIP}")

-    hunter_test_string_not_empty("${CMAKE_CXX_ANDROID_TOOLCHAIN_NAME}")
-    set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_NAME})
+    hunter_test_string_not_empty("${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE}")
+    set(configure_host --host=${CMAKE_CXX_ANDROID_TOOLCHAIN_MACHINE})
     set(ldflags "${ldflags} ${__libstl}")
   elseif(is_ios)
     hunter_status_debug("Autotools iOS IPHONEOS_ARCHS: ${IPHONEOS_ARCHS} IPHONESIMULATOR_ARCHS: ${IPHONESIMULATOR_ARCHS}")


FIX: The code for setting HAS_VTK has been moved to the main CMakeLists.txt

--- Utilities/ITKFindVTK.cmake
+++ Utilities/ITKFindVTK.cmake
@@ -107,15 +107,4 @@
 ENDIF (USE_BUILT_VTK AND USE_INSTALLED_VTK)

-IF(USE_VTK_FILE)
-  # Verify if VTK was built using ansi.
-  # This is required in order to be compatible with ITK
-  IF(VTK_USE_ANSI_STDLIB)
-    SET(HAS_VTK 1 CACHE INTERNAL "VTK Headers and Libraries are available")
-  ELSE( VTK_USE_ANSI_STDLIB )
-    MESSAGE ("Warning. Your VTK was not built with the VTK_USE_ANSI_STDLIB option ON. Please reconfigure and recompile VTK with this option before trying to use it with ITK.")
-  ENDIF( VTK_USE_ANSI_STDLIB )
-ENDIF(USE_VTK_FILE)

-
-


restored clang compile flags

restored clang compile flags

--- scripts/OptimizationFlags.cmake
+++ scripts/OptimizationFlags.cmake
@@ -9,7 +9,7 @@
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
   set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wcheck -wd2259,981,869,383 -Wno-unknown-pragmas")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  set(CMAKE_CXX_FLAGS "-W -pedantic -std=c++11 -Wno-long-long -Wno-unused-parameter -Wno-unknown-pragmas -Wno-c++0x-extensions -Wno-variadic-macros")
+  set(CMAKE_CXX_FLAGS "-W -pedantic -stdlib=libc++ -std=c++11 -Wno-long-long -Wno-unused-parameter -Wno-unknown-pragmas -Wno-c++0x-extensions -Wno-variadic-macros")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Sun")
   set(CMAKE_CXX_FLAGS "-erroff=wvarhidemem,hidevf,badstring,largeshift -errtags=yes")
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "PGI")


[cmake] set directly the options to avoid conflict with other dirs.

--- cmake/ExternalInclude.cmake
+++ cmake/ExternalInclude.cmake
@@ -1,13 +1,13 @@
 #set the compile defdinition for current directory (i.e. externals)
 if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
-  add_compile_options(/w )
+    if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
+        string(REGEX REPLACE "/W[0-4]" "/w " EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+    else()
+        set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /w ")
+    endif()
 else()
-  add_compile_options(-w)
+    set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
 endif()
-
-#create a sepefic options for the external build
-get_directory_property(EXTERNAL_FLAGS COMPILE_OPTIONS)
-set(EXTERNAL_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTERNAL_FLAGS}")

 #if we are in a radium process, use radium specific option, else use cmake option.
 if(RADIUM_EXTERNAL_CMAKE_INSTALL_MESSAGE)


link SimModel after SimMeshTools

link SimModel after SimMeshTools

--- cmake/FindSimModSuite.cmake
+++ cmake/FindSimModSuite.cmake
@@ -38,8 +38,8 @@
 set(SIM_LIB_NAMES
   SimPartitionedMesh-mpi
   SimMeshing
+  SimMeshTools
   SimModel
-  SimMeshTools
   SimPartitionWrapper-${SIM_MPI})

 option(SIM_PARASOLID "Use Parasolid through Simmetrix" OFF)


Fix compile error with external TBB and -DBUILD_SHARED_LIBS=OFF.

Adds IMPORTED for the TBB::tbb alias target as otherwise cmake produces
the following error:

CMake Error: install(EXPORT "OpenCVModules" ...) includes target "opencv_core" which requires target "tbb" that is not in the export set.

This problem occurs with the defaults used by homebrew on macOS, which
compiles both static and shared versions of TBB and OpenCV.

--- cmake/OpenCVDetectTBB.cmake
+++ cmake/OpenCVDetectTBB.cmake
@@ -29,8 +29,10 @@
       message(STATUS "Found TBB (cmake): ${_lib}")
       get_target_property(_inc TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
       ocv_tbb_read_version("${_inc}")
-      add_library(tbb INTERFACE)
-      target_link_libraries(tbb INTERFACE TBB::tbb)
+      add_library(tbb INTERFACE IMPORTED)
+      set_target_properties(tbb PROPERTIES
+        INTERFACE_LINK_LIBRARIES TBB::tbb
+      )
       set(${_found} TRUE PARENT_SCOPE)
     endif()
 endfunction()


Updated eigen3 bundle

Updated eigen3 bundle

--- cmake/external/Eigen3.cmake
+++ cmake/external/Eigen3.cmake
@@ -5,8 +5,8 @@
 	Eigen3
 	PREFIX ${CMAKE_BINARY_DIR}/Eigen3
 	DOWNLOAD_DIR ${THIRD_PARTY_DIR}/Eigen3
-	URL http://ubuntu.osuosl.org/ubuntu/pool/universe/e/eigen3/eigen3_3.1.2.orig.tar.bz2
-	URL_MD5 e9c081360dde5e7dcb8eba3c8430fde2
+	URL http://bitbucket.org/eigen/eigen/get/3.1.4.tar.bz2
+	URL_MD5 15a7914c3768d51a3637fb3d64556a28
 	CMAKE_ARGS -DEIGEN_INCLUDE_INSTALL_DIR:PATH=${THIRD_PARTY_DIR}/include/eigen
 		-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}${CMAKE_DEFINITIONS}
 		-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}${CMAKE_DEFINITIONS}
@@ -19,4 +19,4 @@
 LIST(APPEND SHOGUN_DEPENDS Eigen3)

 UNSET(C_COMPILER)
-UNSET(CXX_COMPILER)+UNSET(CXX_COMPILER)


[CMake] Use add_dependencies in add_llvm_install_targets

Summary:
The CMake documentation says that the `DEPENDS` field of
add_custom_target is for files and output of custom commands. Adding a
dependency on a target should be done with `add_dependency`.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -603,21 +603,35 @@
     set(prefix_option -DCMAKE_INSTALL_PREFIX="${ARG_PREFIX}")
   endif()

+  set(file_dependencies)
+  set(target_dependencies)
+  foreach(dependency ${ARG_DEPENDS})
+    if(TARGET ${dependency})
+      list(APPEND target_dependencies ${dependency})
+    else()
+      list(APPEND file_dependencies ${dependency})
+    endif()
+  endforeach()
+
   add_custom_target(${target}
-                    DEPENDS ${ARG_DEPENDS}
+                    DEPENDS ${file_dependencies}
                     COMMAND "${CMAKE_COMMAND}"
                             ${component_option}
                             ${prefix_option}
                             -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
                     USES_TERMINAL)
   add_custom_target(${target}-stripped
-                    DEPENDS ${ARG_DEPENDS}
+                    DEPENDS ${file_dependencies}
                     COMMAND "${CMAKE_COMMAND}"
                             ${component_option}
                             ${prefix_option}
                             -DCMAKE_INSTALL_DO_STRIP=1
                             -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
                     USES_TERMINAL)
+  if(target_dependencies)
+    add_dependencies(${target} ${target_dependencies})
+    add_dependencies(${target}-stripped ${target_dependencies})
+  endif()
 endfunction()

 macro(add_llvm_library name)


replace find tbb with better version

replace find tbb with better version

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -1,91 +1,283 @@
-## ---------------------------------------------------------------------
-## $Id$
-##
-## Copyright (C) 2012 - 2013 by the deal.II authors
-##
-## This file is part of the deal.II library.
-##
-## The deal.II library is free software; you can use it, redistribute
-## it, and/or modify it under the terms of the GNU Lesser General
-## Public License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-## The full text of the license can be found in the file LICENSE at
-## the top level of the deal.II distribution.
-##
-## ---------------------------------------------------------------------
-
-#
-# Try to find the Threading Building Blocks library
-#
-# This module exports
-#
-#   TBB_LIBRARIES
-#   TBB_INCLUDE_DIRS
-#   TBB_WITH_DEBUGLIB
-#
-
-MACRO(SET_IF_EMPTY _variable _value)
-  IF("${${_variable}}" STREQUAL "")
-    SET(${_variable} ${_value})
-  ENDIF()
-ENDMACRO()
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-SET_IF_EMPTY(TBBROOT "$ENV{TBBROOT}")
-
-FIND_PATH(TBB_INCLUDE_DIR tbb/parallel_reduce.h
-  HINTS
-    ${TBBROOT}
-  PATH_SUFFIXES include include/tbb tbb
-  )
-
-FILE(GLOB _path ${TBBROOT}/build/*_release)
-
-FIND_LIBRARY(TBB_LIBRARY
-  NAMES tbb
-  HINTS
-    ${_path}
-    ${TBBROOT}
-  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
-  )
-
-FILE(GLOB _path ${TBBROOT}/build/*_debug)
-
-FIND_LIBRARY(TBB_DEBUG_LIBRARY
-  NAMES tbb_debug
-  HINTS
-    ${_path}
-    ${TBBROOT}
-  PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
-  )
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(TBB DEFAULT_MSG
-  TBB_LIBRARY
-  TBB_INCLUDE_DIR
-  )
-
-MARK_AS_ADVANCED(
-  TBB_LIBRARY
-  TBB_DEBUG_LIBRARY
-  TBB_INCLUDE_DIR
-  )
-
-IF(TBB_FOUND)
-
-  IF(NOT TBB_DEBUG_LIBRARY MATCHES "-NOTFOUND")
-    SET(TBB_WITH_DEBUGLIB TRUE)
-    SET(TBB_LIBRARIES debug ${TBB_DEBUG_LIBRARY} optimized ${TBB_LIBRARY})
-  ELSE()
-    SET(TBB_LIBRARIES ${TBB_LIBRARY})
-  ENDIF()
-
-  SET(TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR})
-
-  MARK_AS_ADVANCED(TBBROOT)
-ELSE()
-  SET(TBBROOT "" CACHE PATH
-    "An optional hint to a TBB installation"
-    )
-ENDIF()
-
+# Locate Intel Threading Building Blocks include paths and libraries
+# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
+# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
+# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
+#   Florian Uhlig <F.Uhlig _at_ gsi.de>,
+#   Jiri Marsik <jiri.marsik89 _at_ gmail.com>
+
+# The MIT License
+#
+# Copyright (c) 2011 Hannes Hofmann
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
+#   e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
+#   TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
+#   in the TBB installation directory (TBB_INSTALL_DIR).
+#
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
+#
+# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
+# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
+#   which architecture to use
+# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
+#   which compiler to use (detected automatically on Windows)
+
+# This module respects
+# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
+
+# This module defines
+# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
+# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
+# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
+# TBB_INSTALL_DIR, the base TBB install directory
+# TBB_LIBRARIES, the libraries to link against to use TBB.
+# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
+# TBB_FOUND, If false, don't try to use TBB.
+# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
+
+
+if (WIN32)
+    # has em64t/vc8 em64t/vc9
+    # has ia32/vc7.1 ia32/vc8 ia32/vc9
+    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
+    set(_TBB_LIB_NAME "tbb")
+    set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+    set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+    set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+    if (MSVC71)
+        set (_TBB_COMPILER "vc7.1")
+    endif(MSVC71)
+    if (MSVC80)
+        set(_TBB_COMPILER "vc8")
+    endif(MSVC80)
+    if (MSVC90)
+        set(_TBB_COMPILER "vc9")
+    endif(MSVC90)
+    if(MSVC10)
+        set(_TBB_COMPILER "vc10")
+    endif(MSVC10)
+    # Todo: add other Windows compilers such as ICL.
+    set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+endif (WIN32)
+
+if (UNIX)
+    if (APPLE)
+        # MAC
+        set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
+        # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # default flavor on apple: ia32/cc4.0.1_os10.4.9
+        # Jiri: There is no reason to presume there is only one flavor and
+        #       that user's setting of variables should be ignored.
+        if(NOT TBB_COMPILER)
+            set(_TBB_COMPILER "cc4.0.1_os10.4.9")
+        elseif (NOT TBB_COMPILER)
+            set(_TBB_COMPILER ${TBB_COMPILER})
+        endif(NOT TBB_COMPILER)
+        if(NOT TBB_ARCHITECTURE)
+            set(_TBB_ARCHITECTURE "ia32")
+        elseif(NOT TBB_ARCHITECTURE)
+            set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+        endif(NOT TBB_ARCHITECTURE)
+    else (APPLE)
+        # LINUX
+        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
+        # has ia32/*
+        # has itanium/*
+        set(_TBB_COMPILER ${TBB_COMPILER})
+        set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+    endif (APPLE)
+endif (UNIX)
+
+if (CMAKE_SYSTEM MATCHES "SunOS.*")
+# SUN
+# not yet supported
+# has em64t/cc3.4.3_kernel5.10
+# has ia32/*
+endif (CMAKE_SYSTEM MATCHES "SunOS.*")
+
+
+#-- Clear the public variables
+set (TBB_FOUND "NO")
+
+
+#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
+# first: use CMake variable TBB_INSTALL_DIR
+if (TBB_INSTALL_DIR)
+    set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
+endif (TBB_INSTALL_DIR)
+# second: use environment variable
+if (NOT _TBB_INSTALL_DIR)
+    if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
+    endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
+    # Intel recommends setting TBB21_INSTALL_DIR
+    if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
+    endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
+    if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
+    endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
+    if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
+    endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
+endif (NOT _TBB_INSTALL_DIR)
+# third: try to find path automatically
+if (NOT _TBB_INSTALL_DIR)
+    if (_TBB_DEFAULT_INSTALL_DIR)
+        set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
+    endif (_TBB_DEFAULT_INSTALL_DIR)
+endif (NOT _TBB_INSTALL_DIR)
+# sanity check
+if (NOT _TBB_INSTALL_DIR)
+    message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
+else (NOT _TBB_INSTALL_DIR)
+# finally: set the cached CMake variable TBB_INSTALL_DIR
+if (NOT TBB_INSTALL_DIR)
+    set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
+    mark_as_advanced(TBB_INSTALL_DIR)
+endif (NOT TBB_INSTALL_DIR)
+
+
+#-- A macro to rewrite the paths of the library. This is necessary, because
+#   find_library() always found the em64t/vc9 version of the TBB libs
+macro(TBB_CORRECT_LIB_DIR var_name)
+#    if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
+        string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+#    endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
+    string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+    string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+endmacro(TBB_CORRECT_LIB_DIR var_content)
+
+
+#-- Look for include directory and set ${TBB_INCLUDE_DIR}
+set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
+# Jiri: tbbvars now sets the CPATH environment variable to the directory
+#       containing the headers.
+find_path(TBB_INCLUDE_DIR
+    tbb/task_scheduler_init.h
+    PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
+)
+mark_as_advanced(TBB_INCLUDE_DIR)
+
+
+#-- Look for libraries
+# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
+if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+    set (_TBB_LIBRARY_DIR
+         ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
+         ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
+        )
+endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+# Jiri: This block isn't mutually exclusive with the previous one
+#       (hence no else), instead I test if the user really specified
+#       the variables in question.
+if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
+    # HH: deprecated
+    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
+    # Jiri: It doesn't hurt to look in more places, so I store the hints from
+    #       ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
+    #       variables and search them both.
+    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
+endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
+
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
+list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
+
+# Jiri: No reason not to check the default paths. From recent versions,
+#       tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
+#       variables, which now point to the directories of the lib files.
+#       It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
+#       argument instead of the implicit PATHS as it isn't hard-coded
+#       but computed by system introspection. Searching the LIBRARY_PATH
+#       and LD_LIBRARY_PATH environment variables is now even more important
+#       that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
+#       the use of TBB built from sources.
+find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+#Extract path from TBB_LIBRARY name
+get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
+mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
+
+#-- Look for debug libraries
+# Jiri: Changed the same way as for the release libraries.
+find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+# Jiri: Self-built TBB stores the debug libraries in a separate directory.
+#       Extract path from TBB_LIBRARY_DEBUG name
+get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
+mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
+
+
+if (TBB_INCLUDE_DIR)
+    if (TBB_LIBRARY)
+        set (TBB_FOUND "YES")
+        set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
+        set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
+        set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
+        set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
+        # Jiri: Self-built TBB stores the debug libraries in a separate directory.
+        set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
+        mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
+        message(STATUS "Found Intel TBB")
+    endif (TBB_LIBRARY)
+endif (TBB_INCLUDE_DIR)
+
+if (NOT TBB_FOUND)
+    message("ERROR: Intel TBB NOT found!")
+    message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
+    # do only throw fatal, if this pkg is REQUIRED
+    if (TBB_FIND_REQUIRED)
+        message(FATAL_ERROR "Could NOT find TBB library.")
+    endif (TBB_FIND_REQUIRED)
+endif (NOT TBB_FOUND)
+
+endif (NOT _TBB_INSTALL_DIR)
+
+if (TBB_FOUND)
+	set(TBB_INTERFACE_VERSION 0)
+	FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
+	STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
+	set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
+endif (TBB_FOUND)


build(deps): use CPM one-liner

build(deps): use CPM one-liner

--- cmake/JEGPFindDependencies.cmake
+++ cmake/JEGPFindDependencies.cmake
@@ -7,10 +7,6 @@
 FetchContent_MakeAvailable(CPM)
 include(${cpm_SOURCE_DIR}/cmake/CPM.cmake)

-CPMFindPackage(
-    NAME jegp_cmake_modules
-    GITHUB_REPOSITORY johelegp/jegp.cmake_modules
-    GIT_TAG master
-    GIT_SHALLOW True)
+CPMAddPackage("gh:johelegp/jegp.cmake_modules#master")

-list(APPEND CMAKE_MODULE_PATH "${jegp_cmake_modules_SOURCE_DIR}")
+list(APPEND CMAKE_MODULE_PATH "${jegp.cmake_modules_SOURCE_DIR}")


corrected gadgetron URL as given git tag isn't yet on CCPPETMR

--- version_config.cmake
+++ version_config.cmake
@@ -93,7 +93,7 @@
   set(DEFAULT_STIR_TAG 41651b3a2007c58cbf1f7706bb2e269a21e870b1)

   ## Gadgetron
-  set(DEFAULT_Gadgetron_URL https://github.com/CCPPETMR/gadgetron )
+  set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )
   #https://github.com/CCPPETMR/gadgetron)

   set(DEFAULT_Gadgetron_TAG 00b96376568278a595e78879026bb3b0d5fbb98d )


arch-user: fix linux build

arch-user: fix linux build

--- kernel/arch/user/linux/arch.cmake
+++ kernel/arch/user/linux/arch.cmake
@@ -3,6 +3,6 @@
   init.h
 )

-foreach(F ${MAC_SRC})
+foreach(F ${LINUX_SRC})
   add_arch_file(${CMAKE_CURRENT_LIST_DIR}/${F})
 endforeach()


Use pkgconfig in FindOpenEXR.cmake if available (#2008)

* added search for IlmBase and OpenEXR with pkgconfig if found

* Added _ILMBASE/OPENEXR_LIBDIR variables found by pkgconfig to GENERIC_LIBRARY_PATHS

--- src/cmake/modules/FindOpenEXR.cmake
+++ src/cmake/modules/FindOpenEXR.cmake
@@ -27,6 +27,13 @@
     set (ILMBASE_PTHREADS ${CMAKE_THREAD_LIBS_INIT})
 endif ()

+# Attempt to find OpenEXR with pkgconfig
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+    pkg_check_modules(_ILMBASE QUIET IlmBase)
+    pkg_check_modules(_OPENEXR QUIET OpenEXR>=2.0.0)
+endif (PKG_CONFIG_FOUND)
+
 # List of likely places to find the headers -- note priority override of
 # OPENEXR_CUSTOM_INCLUDE_DIR and ${OPENEXR_HOME}/include.
 # ILMBASE is needed in case ilmbase an openexr are installed in separate
@@ -35,6 +42,8 @@
     ${OPENEXR_CUSTOM_INCLUDE_DIR}
     ${OPENEXR_HOME}/include
     ${ILMBASE_HOME}/include
+    ${_ILMBASE_INCLUDEDIR}
+    ${_OPENEXR_INCLUDEDIR}
     /usr/local/include
     /usr/include
     /usr/include/${CMAKE_LIBRARY_ARCHITECTURE}
@@ -90,6 +99,8 @@
     ${GENERIC_LIBRARY_PATHS}
     ${OPENEXR_INCLUDE_PATH}/../lib
     ${ILMBASE_INCLUDE_PATH}/../lib
+    ${_ILMBASE_LIBDIR}
+    ${_OPENEXR_LIBDIR}
     /usr/local/lib
     /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
     /usr/lib


Occupancy: make block size a multiple of warp size

--- runtime/hipacc_cu.hpp.cmake
+++ runtime/hipacc_cu.hpp.cmake
@@ -708,19 +708,18 @@
 void hipaccPrintKernelOccupancy(CUfunction fun, int tile_size_x, int tile_size_y) {
     CUresult err = CUDA_SUCCESS;
     CUdevice dev = 0;
-
     int warp_size;
-    err = cuDeviceGetAttribute(&warp_size, CU_DEVICE_ATTRIBUTE_WARP_SIZE, dev);
-    checkErrDrv(err, "cuDeviceGetAttribute()");
     int block_size = tile_size_x*tile_size_y;
     size_t dynamic_smem_bytes = 0;
     int block_size_limit = 0;
+
+    err = cuDeviceGetAttribute(&warp_size, CU_DEVICE_ATTRIBUTE_WARP_SIZE, dev);
+    checkErrDrv(err, "cuDeviceGetAttribute()");

     int active_blocks;
     int min_grid_size, opt_block_size;
     err = cuOccupancyMaxActiveBlocksPerMultiprocessor(&active_blocks, fun, block_size, dynamic_smem_bytes);
     checkErrDrv(err, "cuOccupancyMaxActiveBlocksPerMultiprocessor()");
-
     err = cuOccupancyMaxPotentialBlockSize(&min_grid_size, &opt_block_size, fun, &blockSizeToSmemSize, dynamic_smem_bytes, block_size_limit);
     checkErrDrv(err, "cuOccupancyMaxPotentialBlockSize()");

@@ -728,6 +727,8 @@
     int max_blocks;
     err = cuOccupancyMaxActiveBlocksPerMultiprocessor(&max_blocks, fun, opt_block_size, dynamic_smem_bytes);
     checkErrDrv(err, "cuOccupancyMaxActiveBlocksPerMultiprocessor()");
+
+    block_size = ((block_size + warp_size - 1) / warp_size) * warp_size;
     int max_warps = max_blocks * (opt_block_size/warp_size);
     int active_warps = active_blocks * (block_size/warp_size);
     float occupancy = (float)active_warps/(float)max_warps;


artifacts folder

artifacts folder

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -7,7 +7,7 @@
 ENDIF()

 IF(NOT DEFINED ARTIFACTS_PATH)
-	set(ARTIFACTS_PATH ${CMAKE_MODULE_PATH}/../artifacts)
+	set(ARTIFACTS_PATH ${CMAKE_MODULE_PATH}/../cmaki_generator)
 ENDIF()

 IF(NOT DEFINED CMAKI_PATH)


Using GLPK 4.61

Using GLPK 4.61


do not enable sanitizers by default

do not enable sanitizers by default

--- build_options.cmake
+++ build_options.cmake
@@ -68,8 +68,7 @@
 endif()

-TNUN_add_compile_options( Debug   ${TNUN_compiler_debug_flags} ${TNUN_compiler_debug_symbols} ${TNUN_compiler_runtime_sanity_checks} )
-TNUN_add_link_options   ( Debug   ${TNUN_linker_runtime_sanity_checks} )
+TNUN_add_compile_options( Debug   ${TNUN_compiler_debug_flags} ${TNUN_compiler_debug_symbols} )
 TNUN_add_compile_options( Release ${TNUN_compiler_release_flags} )
 add_compile_options( ${TNUN_default_warnings} )


Fix install of link files.

Fix install of link files.

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -165,7 +165,7 @@
 	      ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(Configuration)/${alias}.exe)
     install(
       PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$(Configuration)/${alias}.exe
-      RUNTIME DESTINATION ${where})
+      DESTINATION ${where})
   else ()
     add_custom_command(
       TARGET ${name}
@@ -174,7 +174,7 @@
         ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias})
     install(
       PROGRAMS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${alias}
-      RUNTIME DESTINATION ${where})
+      DESTINATION ${where})
   endif ()
 endmacro ()


CMake: suppressing Warning C4127 (cond expr is const), #69

--- cmake/compileoptions.cmake
+++ cmake/compileoptions.cmake
@@ -58,6 +58,7 @@
             endif()
             list(APPEND comp_opts "/W4")     # Set default warning level to 4
             list(APPEND comp_opts "/wd4005") # macro redefinition    https://msdn.microsoft.com/en-us/library/8d10sc3w.aspx
+            list(APPEND comp_opts "/wd4127") # cond expr is const    https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4127
             list(APPEND comp_opts "/wd4201") # nameless struct/union https://msdn.microsoft.com/en-us/library/c89bw853.aspx
             list(APPEND comp_opts "/wd4251") # needs dll-interface   https://msdn.microsoft.com/en-us/library/esew7y1w.aspx
             list(APPEND comp_opts "/wd4505") # unreferenced funtion  https://msdn.microsoft.com/en-us/library/mt694070.aspx


Propagate the Position Independent Code flag (#957)

--- cmake/external_rules.cmake
+++ cmake/external_rules.cmake
@@ -240,6 +240,9 @@
           -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
     endif()
   endif()
+  # Propagate the PIC setting, as the dependencies need to match it
+  set(CMAKE_SUB_CONFIGURE_OPTIONS ${CMAKE_SUB_CONFIGURE_OPTIONS}
+      -DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE})
   message(STATUS "Sub-configure options: ${CMAKE_SUB_CONFIGURE_OPTIONS}")
   message(STATUS "Sub-build options: ${CMAKE_SUB_BUILD_OPTIONS}")


Fix typo, allow SVR4 packages to be built again.

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -86,7 +86,7 @@
     SET(CMAKE_INSTALL_PREFIX ${default_prefix}
       CACHE PATH "install prefix" FORCE)
   ENDIF()
-  SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR5")
+  SET(VALID_INSTALL_LAYOUTS "RPM" "STANDALONE" "DEB" "SVR4")
   LIST(FIND VALID_INSTALL_LAYOUTS "${INSTALL_LAYOUT}" ind)
   IF(ind EQUAL -1)
     MESSAGE(FATAL_ERROR "Invalid INSTALL_LAYOUT parameter:${INSTALL_LAYOUT}."


Remove obsolete stuff

Remove obsolete stuff

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -1,3 +1,5 @@
+include(GNUInstallDirs)
+
 option(USE_RELATIVE
   "Do you want to have all path are relative to the binary"
   OFF
@@ -44,11 +46,6 @@
   # resources
   set(TRI_RESOURCEDIR "resources")

-  # bin dir ----------------------------
-  set(ARANGODB_INSTALL_BIN "bin")
-  set(ARANGODB_INSTALL_LIBEXEC "libexec")
-  set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
-
   # MS stuff ---------------------------
   if (MSVC)
     set(ARANGODB_INSTALL_SBIN "bin")
@@ -113,16 +110,6 @@

   # resources
   set(TRI_RESOURCEDIR "resources")
-
-  # binaries
-  if (MSVC)
-    set(ARANGODB_INSTALL_BIN "bin")
-    set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
-  else ()
-    set(ARANGODB_INSTALL_BIN "bin")
-    set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
-  endif ()
-  set(ARANGODB_INSTALL_LIBEXEC "libexec")

   # sbinaries
   if (MSVC)
@@ -172,7 +159,7 @@
 if (NOT WINDOWS)
   install(
     PROGRAMS ${PROJECT_BINARY_DIR}/bin/etcd-arango
-    DESTINATION ${ARANGODB_INSTALL_LIBEXEC}
+    DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}
   )
 endif ()


Remove some debug output

Remove some debug output

--- cmake/FindLibArchive.cmake
+++ cmake/FindLibArchive.cmake
@@ -17,7 +17,4 @@
 find_package_handle_standard_args(LIBARCHIVE DEFAULT_MSG LIBARCHIVE_INCLUDE_DIR
                                   LIBARCHIVE_LIBRARY)

-message("LIBARCHIVE include dir = ${LIBARCHIVE_INCLUDE_DIR}")
-message("LIBARCHIVE lib = ${LIBARCHIVE_LIBRARY}")
-
 mark_as_advanced(LIBARCHIVE_INCLUDE_DIR LIBARCHIVE_LIBRARY)


Remove newlines from the output of brew --prefix

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -46,6 +46,9 @@
         # brew --prefix will list where qscintilla2 would be installed, whether
         # or not it actually is.  I'd rather play it safe and not assume the
         # command succeeded, though.
+        string(STRIP "${BREW_PREFIX_OUTPUT}" BREW_PREFIX_OUTPUT)
+        # brew --prefix outputs a newline, so we must strip it
+
         set(QSCINTILLA_BREW_ROOT "${BREW_PREFIX_OUTPUT}")
         set(QSCINTILLA_BREW_INCLUDE_DIR "${QSCINTILLA_BREW_ROOT}/include")
         set(QSCINTILLA_BREW_LIBRARY "${QSCINTILLA_BREW_ROOT}/lib")


[Compiler-rt][MIPS] Fix simple test failure when using gcc

Reviewers: dsanders

Subscribers: slthakur, jaydeep, llvm-commits, Sanitizers

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

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

--- cmake/base-config-ix.cmake
+++ cmake/base-config-ix.cmake
@@ -148,10 +148,10 @@
       # since the default ABI differs between gcc and clang.
       # FIXME: Ideally, we would build the N32 library too.
       test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu")
-      test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=n64")
+      test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=64")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips")
       test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu")
-      test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=n64")
+      test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=64")
     elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm")
       test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft")
       test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard")


Remove -fmodules from C++ compilation flags. (#6385)

This option doesn't work with C++, and even though the clang compiler
ignores it, clangd does not, and this causes syntax highlighting
failures in CLion.

--- cmake/compiler_setup.cmake
+++ cmake/compiler_setup.cmake
@@ -85,7 +85,6 @@
   set(
     FIREBASE_IOS_OBJC_FLAGS
     -fobjc-arc
-    -fmodules
     -fno-autolink
   )
   set(


keep the mkl win's version inconsistent with Linux's test=develop

--- cmake/external/mklml.cmake
+++ cmake/external/mklml.cmake
@@ -47,8 +47,8 @@
 IF((NOT DEFINED MKLML_VER) OR (NOT DEFINED MKLML_URL))
     MESSAGE(STATUS "use pre defined download url")
     if(WIN32)
-        SET(MKLML_VER "mklml_win_2019.0.1.20180928" CACHE STRING "" FORCE)
-        SET(MKLML_URL "https://github.com/intel/mkl-dnn/releases/download/v0.17/${MKLML_VER}.zip" CACHE STRING "" FORCE)
+        SET(MKLML_VER "mklml_win_2019.0.20180710" CACHE STRING "" FORCE)
+        SET(MKLML_URL "https://github.com/intel/mkl-dnn/releases/download/v0.16/${MKLML_VER}.zip" CACHE STRING "" FORCE)
     else()
         SET(MKLML_VER "mklml_lnx_2019.0.20180710" CACHE STRING "" FORCE)
         SET(MKLML_URL "http://paddlepaddledeps.cdn.bcebos.com/${MKLML_VER}.tgz" CACHE STRING "" FORCE)


CHG: Change configuration file generator

--- cmake/facekit_config.cmake
+++ cmake/facekit_config.cmake
@@ -10,7 +10,7 @@
     set(FACEKITCONFIG_AVAILABLE_COMPONENTS_LIST "${FACEKITCONFIG_AVAILABLE_COMPONENTS_LIST}\n# - ${_ss}")
     GET_IN_MAP(_deps FACEKIT_SUBSYS_DEPS ${_ss})
     if(_deps)
-        set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}set(oglkit_${_ss}_int_dep ")
+        set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}set(facekit_${_ss}_int_dep ")
         foreach(_dep ${_deps})
             set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}${_dep} ")
         endforeach(_dep)
@@ -27,7 +27,7 @@
           set(FACEKITCONFIG_AVAILABLE_COMPONENTS_LIST "${FACEKITCONFIG_AVAILABLE_COMPONENTS_LIST}\n# - ${_sub}")
           GET_IN_MAP(_deps FACEKIT_SUBSYS_DEPS ${_ss}_${sub})
           if(_deps)
-            set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}set(oglkit_${_sub}_int_dep ")
+            set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}set(facekit_${_sub}_int_dep ")
             foreach(_dep ${_deps})
               set(FACEKITCONFIG_INTERNAL_DEPENDENCIES "${FACEKITCONFIG_INTERNAL_DEPENDENCIES}${_dep} ")
             endforeach(_dep)
@@ -39,12 +39,12 @@
   endif(_status)
 endforeach(_ss)

-configure_file("${FACEKIT_SOURCE_DIR}/cmake/FACEKITConfig.cmake.in"
-               "${FACEKIT_BINARY_DIR}/FACEKITConfig.cmake" @ONLY)
-configure_file("${FACEKIT_SOURCE_DIR}/cmake/FACEKITConfigVersion.cmake.in"
-               "${FACEKIT_BINARY_DIR}/FACEKITConfigVersion.cmake" @ONLY)
+configure_file("${FACEKIT_SOURCE_DIR}/cmake/FaceKitConfig.cmake.in"
+               "${FACEKIT_BINARY_DIR}/FaceKitConfig.cmake" @ONLY)
+configure_file("${FACEKIT_SOURCE_DIR}/cmake/FaceKitConfigVersion.cmake.in"
+               "${FACEKIT_BINARY_DIR}/FaceKitConfigVersion.cmake" @ONLY)
 install(FILES
-        "${FACEKIT_BINARY_DIR}/FACEKITConfig.cmake"
-        "${FACEKIT_BINARY_DIR}/FACEKITConfigVersion.cmake"
-        COMPONENT oglkitconfig
+        "${FACEKIT_BINARY_DIR}/FaceKitConfig.cmake"
+        "${FACEKIT_BINARY_DIR}/FaceKitConfigVersion.cmake"
+        COMPONENT facekitconfig
         DESTINATION ${FACEKITCONFIG_INSTALL_DIR})


[mechanics] remove useless messages

[mechanics] remove useless messages

--- mechanics/mechanics_tests.cmake
+++ mechanics/mechanics_tests.cmake
@@ -34,14 +34,14 @@
       file(GLOB EXAMPLES_FILES ${CMAKE_SOURCE_DIR}/examples/Mechanics/Mechanisms/${_dir}/bodydef.py
 	${CMAKE_SOURCE_DIR}/examples/Mechanics/Mechanisms/${_dir}/mbtbLocalOptions.py)
       foreach(_F ${EXAMPLES_FILES})
-	MESSAGE("${_F}")
+	#MESSAGE("${_F}")
 	configure_file(${_F} ${bin_dir})
 	file(READ ${_F} RESOURCES_FILE)
 	string(REGEX REPLACE
 	  "with3D=1"
 	  "with3D=0 # remove X output for test#"
 	  RESOURCES_FILE_MODIFIED ${RESOURCES_FILE})
-	MESSAGE(${RESOURCES_FILE_MODIFIED})
+	#MESSAGE(${RESOURCES_FILE_MODIFIED})
 	get_filename_component(_F_NAME ${_F} NAME)
 	file(WRITE ${bin_dir}/${_F_NAME} ${RESOURCES_FILE_MODIFIED})
       endforeach()


Remove absolute path to arm toolchain.

Remove absolute path to arm toolchain.

--- linux/arm_gcc.cmake
+++ linux/arm_gcc.cmake
@@ -1,6 +1,6 @@
 # this one is important
 SET(CMAKE_SYSTEM_NAME Linux)

-SET(CMAKE_C_COMPILER "/opt/OSELAS.Toolchain-2012.12.1/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/arm-cortexa9-linux-gnueabihf-gcc")
-SET(CMAKE_CXX_COMPILER "/opt/OSELAS.Toolchain-2012.12.1/arm-cortexa9-linux-gnueabihf/gcc-4.7.3-glibc-2.16.0-binutils-2.22-kernel-3.6-sanitized/bin/arm-cortexa9-linux-gnueabihf-g++")
+SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
+SET(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)


True alphabetical ordering that accounts for the full path, for qt_transform_sources.

--- cmake/QtUtils.cmake
+++ cmake/QtUtils.cmake
@@ -64,9 +64,31 @@
         endif()
     endforeach()

-    # Organize the list...
-    list(SORT final_sources)
+    # Remove any duplicate items from our final source list
     list(REMOVE_DUPLICATES final_sources)
+
+    # Here is a nice trick to get real alphabetical ordering... most IDEs will
+    # display the filenames of source files without any path. However, because
+    # our list may include both relative and absolute paths, sorting it will
+    # not produce the desired result since the sort key is the entire path
+    # and not just the name part. So what we'll do is create a clone of our
+    # source list, but prepend the name of each file to its path, then sort that
+    # list, giving us true alphabetical ordering. Then we'll simply remove the
+    # prefixes after sorting to get our original list back, but sorted appropriately.
+    # We use four backslashes surrounded by colons to separate items since that sequence
+    # is extremely unlikely to ever appear in any filename.
+    foreach(final_source ${final_sources})
+        get_filename_component(final_source_name "${final_source}" NAME)
+        list(APPEND final_sources_sorter "${final_source_name}:\\\\\\\\:${final_source}")
+    endforeach()
+
+    list(SORT final_sources_sorter)
+    set(final_sources ) # clear out the real variable
+
+    foreach(final_source_sorted ${final_sources_sorter})
+        string(REGEX REPLACE "(.*):\\\\\\\\\\\\\\\\:" "" final_source_sorted "${final_source_sorted}")
+        list(APPEND final_sources "${final_source_sorted}")
+    endforeach()

     # Sets the final_sources var to the parent scope so we can
     # pass it to add_executable or add_library


Added more summary information for debugging python versions

Summary: Closes https://github.com/caffe2/caffe2/pull/167

Reviewed By: Yangqing

Differential Revision: D4610416

Pulled By: bwasti

fbshipit-source-id: 0f56941bed2a75105787e518a71638916e4d503f

--- cmake/Summary.cmake
+++ cmake/Summary.cmake
@@ -29,6 +29,8 @@
   message(STATUS "")
   message(STATUS "  BUILD_SHARED_LIBS     : ${BUILD_SHARED_LIBS}")
   message(STATUS "  BUILD_PYTHON          : ${BUILD_PYTHON}")
+  message(STATUS "    Python version      : ${PYTHONLIBS_VERSION_STRING}")
+  message(STATUS "    Python library      : ${PYTHON_LIBRARIES}")

   message(STATUS "  USE_CUDA              : ${USE_CUDA}")
   if(${USE_CUDA})


CMake: Fix formatting of error message

CMake: Fix formatting of error message

--- scripts/cmake/Modules/LibAddPlugin.cmake
+++ scripts/cmake/Modules/LibAddPlugin.cmake
@@ -311,8 +311,8 @@
 			if (NOT ${VARIABLE} STREQUAL "${VAR}")
 				message (
 					FATAL_ERROR
-						"Internally inconsistency, plugin ${PLUGIN_NAME} got different values for variable ${VARIABLE}: '${${VARIABLE}}' != '${VAR}'"
-						"Concatenate variables that contain the value of ${VARIABLE} in a single variable during the DEPENDENCY_PHASE."
+						"Internally inconsistency, plugin ${PLUGIN_NAME} got different values for variable ${VARIABLE}: '${${VARIABLE}}' != '${VAR}'. "
+						"Concatenate variables that contain the value of ${VARIABLE} in a single variable during the DEPENDENCY_PHASE. "
 						"Make sure that only a single variable is passed to every argument of add_plugin.")
 			endif ()
 		else ()


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -524,13 +524,11 @@
 	if (CMAKE_BUILD_TYPE STREQUAL "Release")
 		add_test(
 			NAME ${_TEST_NAME}_exe
-			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
 			COMMAND valgrind --tool=callgrind ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
 			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
 	else()
 		add_test(
 			NAME ${_TEST_NAME}_exe
-			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
 			COMMAND ${_TEST_NAME}_exe --gtest_repeat=1 --gtest_break_on_failure --gtest_shuffle --gmock_verbose=info
 			WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${CMAKE_BUILD_TYPE})
 	endif()


new ref without concise args

new ref without concise args

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -134,8 +134,8 @@
 set(pypolyhedron_depends)

 set(kinematics-utils_url ssh://git@github.com/mitdrc/kinematics-utils.git)
-set(kinematics-utils_revision 7ccebe6213046385ff594ccb6105c5805a2f2f4f)
-set(kinematics-utils_depends)
+set(kinematics-utils_revision 062e36b056eaa0b5ddc38ed7c738999b9bb5831b)
+set(kinematics-utils_depends Eigen_pod)

 set(externals
   Eigen_pod


add libmultisense and multisense-lcm external repos

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -137,6 +137,21 @@
 set(kinematics-utils_revision 062e36b056eaa0b5ddc38ed7c738999b9bb5831b)
 set(kinematics-utils_depends Eigen_pod)

+set(libmultisense_url https://bitbucket.org/crl/libmultisense)
+set(libmultisense_hg_tag efb8099)
+set(libmultisense_depends opencv-drc)
+set(libmultisense_external_args
+  CMAKE_CACHE_ARGS
+    -DCMAKE_PREFIX_PATH:PATH=${CMAKE_INSTALL_PREFIX}
+    -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
+    -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+  )
+
+set(multisense_lcm_url http://github.com/mitdrc/multisense-lcm.git)
+set(multisense_lcm_revision d06446e6b4)
+set(multisense_lcm_depends libmultisense)
+
+
 set(externals
   Eigen_pod
   libbot-drc
@@ -145,6 +160,8 @@
   #pcl_drc
   pcl
   octomap-drc
+  libmultisense
+  multisense_lcm
   occ-map
   common_utils
   #scanmatch
@@ -179,7 +196,9 @@
 endif()

 macro(add_external proj)
-  if (${${proj}_url} MATCHES "\\.git$")
+  if (DEFINED ${proj}_hg_tag)
+    add_mercurial_external(${proj})
+  elseif (${${proj}_url} MATCHES "\\.git$")
     add_git_external(${proj})
   else()
     add_svn_external(${proj})
@@ -225,6 +244,17 @@
 endmacro()

+macro(add_mercurial_external proj)
+    ExternalProject_Add(${proj}
+      HG_REPOSITORY ${${proj}_url}
+      HG_TAG ${${proj}_revision}
+      DEPENDS ${${proj}_depends}
+      SOURCE_DIR ${DRCExternals_SOURCE_DIR}/${proj}
+      ${${proj}_external_args}
+      )
+endmacro()
+
+
 foreach(external ${externals})
   add_external(${external})
 endforeach()
@@ -235,3 +265,9 @@
 ExternalProject_Add_Step(Eigen_pod make_pkgconfig_dir
   COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig
   DEPENDERS configure)
+
+
+# This can be removed after CRL updates their install rule for libmultisense
+ExternalProject_Add_Step(libmultisense copy_include_dir
+  COMMAND cp -r ${DRCExternals_SOURCE_DIR}/libmultisense/source/LibMultiSense/details ${CMAKE_INSTALL_PREFIX}/include/MultiSense/
+  DEPENDEES install)