Let the abitility to predefine DTK_HAVE_NITE.

--- cmake/dtkDependencies.cmake
+++ cmake/dtkDependencies.cmake
@@ -4,9 +4,9 @@
 ## Copyright (C) 2008 - Julien Wintz, Inria.
 ## Created: Fri Apr  2 09:11:53 2010 (+0200)
 ## Version: $Id$
-## Last-Updated: Thu Jan 10 11:33:27 2013 (+0100)
+## Last-Updated: Wed Jan 16 16:58:07 2013 (+0100)
 ##           By: Julien Wintz
-##     Update #: 129
+##     Update #: 130
 ######################################################################
 ##
 ### Commentary:
@@ -242,9 +242,9 @@
 # link_directories(/usr/lib)
 # endif(OPENNI_LIBRARY AND NITE_LIBRARY)

-# if(OPENNI_INCLUDES AND NITE_INCLUDES)
+# if(OPENNI_INCLUDES AND NITE_INCLUDES AND NOT DEFINED DTK_HAVE_NITE)
 # set(DTK_HAVE_NITE "YES")
-# endif(OPENNI_INCLUDES AND NITE_INCLUDES)
+# endif(OPENNI_INCLUDES AND NITE_INCLUDES AND NOT DEFINED DTK_HAVE_NITE)

 # mark_as_advanced(OPENNI_INCLUDES)
 # mark_as_advanced(NITE_INCLUDES)


Let TCL available on M$ Windows.

Let TCL available on M$ Windows.


Update DNNL version to 1.3 (#23204)

Update DNNL version to 1.3 (#23204)

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -20,7 +20,7 @@
 SET(MKLDNN_INSTALL_DIR    ${THIRD_PARTY_PATH}/install/mkldnn)
 SET(MKLDNN_INC_DIR        "${MKLDNN_INSTALL_DIR}/include" CACHE PATH "mkldnn include directory." FORCE)
 SET(MKLDNN_REPOSITORY     https://github.com/intel/mkl-dnn.git)
-SET(MKLDNN_TAG            75d0b1a7f3586c212e37acebbb8acd221cee7216)
+SET(MKLDNN_TAG            589c09728e34d09d79106cba0211e93caf142d54)

 # Introduce variables:
 # * CMAKE_INSTALL_LIBDIR


Information about MSVC and WATCOM compiler are sent to the output now as well.

svn path=/trunk/; revision=7115

--- cmake/modules/summary.cmake
+++ cmake/modules/summary.cmake
@@ -27,9 +27,11 @@
 UNIX:			${UNIX}
 WIN32:			${WIN32}
 APPLE:			${APPLE}
+MSVC:			${MSVC}	(MSVC_VERSION:	${MSVC_VERSION})
 MINGW:			${MINGW}
 CYGWIN:			${CYGWIN}
 BORLAND:		${BORLAND}
+WATCOM:		  ${WATCOM}

 SWIG_FOUND:		${SWIG_FOUND}
 PERL_FOUND:		${PERL_FOUND}


Removed comments and debug printing

Removed comments and debug printing

Former-commit-id: 475216848142586d276c76bffbcc73e31001f7f3

--- cmake-modules/Fetch_glog.cmake
+++ cmake-modules/Fetch_glog.cmake
@@ -91,15 +91,6 @@
     remove_library_shallow(glog::glog "Threads::Threads|pthread|unwind")
     target_link_libraries(glog::glog INTERFACE unwind::full pthread )

-    # Modernize
-#    get_property(imp_loc_set TARGET glog::glog PROPERTY IMPORTED_LOCATION SET) # Returns a boolean if set
-#    get_property(loc_set     TARGET glog::glog PROPERTY LOCATION SET) # Returns a boolean if set
-#    if(loc_set AND NOT imp_loc_set)
-#        get_target_property(imp_loc glog::glog LOCATION)
-#        set_target_properties(glog::glog PROPERTIES IMPORTED_LOCATION ${imp_loc})
-#    endif()
-    include(cmake-modules/PrintTargetProperties.cmake)
-    print_target_properties(glog::glog)
     check_glog_compiles("glog::glog" "" "" "" "")
     if(NOT GLOG_COMPILES)
         include(cmake-modules/PrintTargetProperties.cmake)


cmake/HextEnableWarnings: do not quote variables (see CMP0054)

--- cmake/HextEnableWarnings.cmake
+++ cmake/HextEnableWarnings.cmake
@@ -1,12 +1,12 @@
 # Enable reasonable warnings.

 # Clang
-IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+IF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   ADD_DEFINITIONS("-Weverything" "-Wno-c++98-compat" "-Wno-padded"
     "-Wno-documentation-unknown-command" "-Wno-documentation-html"
     "-Wno-documentation" "-Wno-weak-vtables" "-Wno-switch-enum"
     "-Wno-exit-time-destructors" "-Wno-global-constructors")
-ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ENDIF(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")

 # G++
 IF(CMAKE_COMPILER_IS_GNUCXX)


cmake: handle luajit 2.1 (#343)

cmake: handle luajit 2.1 (#343)

Fixes https://github.com/luvit/luv/issues/342.

--- cmake/Modules/FindLuaJIT.cmake
+++ cmake/Modules/FindLuaJIT.cmake
@@ -23,7 +23,7 @@
 #  LUA_VERSION_MINOR  - the minor version of Lua
 #  LUA_VERSION_PATCH  - the patch version of Lua

-FIND_PATH(LUAJIT_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES luajit-2.0)
+FIND_PATH(LUAJIT_INCLUDE_DIR NAMES lua.h PATH_SUFFIXES luajit-2.0 luajit-2.1)
 FIND_LIBRARY(LUAJIT_LIBRARIES NAMES luajit-5.1 luajit)

 if (LUAJIT_INCLUDE_DIR AND EXISTS "${LUAJIT_INCLUDE_DIR}/lua.h")


cmake: update condition for find_package(Eigen3 CONFIG)

--- cmake/OpenCVFindLibsPerf.cmake
+++ cmake/OpenCVFindLibsPerf.cmake
@@ -51,7 +51,10 @@

 # --- Eigen ---
 if(WITH_EIGEN AND NOT HAVE_EIGEN)
-  if(NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG)
+  if((OPENCV_FORCE_EIGEN_FIND_PACKAGE_CONFIG
+      OR NOT (CMAKE_VERSION VERSION_LESS "3.0.0")  # Eigen3Targets.cmake required CMake 3.0.0+
+      ) AND NOT OPENCV_SKIP_EIGEN_FIND_PACKAGE_CONFIG
+  )
     find_package(Eigen3 CONFIG QUIET)  # Ceres 2.0.0 CMake scripts doesn't work with CMake's FindEigen3.cmake module (due to missing EIGEN3_VERSION_STRING)
   endif()
   if(NOT Eigen3_FOUND)


cmake/OpenCVGenPkgconfig.cmake: rework opencv.pc generation

Using absolute path to locate the components in the "Libs:" field of the
*.pc can badly break cross-compilation, especially when building
statically linked objects.

Indeed, pkg-config automatically replaces the '-I...' and '-L...' paths
when the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment
variables are set [1]. This feature is very helpful and common in
cross-compilation framework like Buildroot [2,3].

When there are absolute paths in the *.pc files, pkg-config won't be
able to do the path substitutions for these paths when the
aforementioned environment variables are set.
In such case, since the prefix is the target one, not the sysroot one,
these libraries' absolute paths will point to:
- in the best case: a non-existing file (i.e. these files do not exists
  on the host system;
- at worst: the host system's libraries. This will make the linking
  failed because these host system's libraries will most likely not be
  build for the target architecture [4].

So, this patch replace the components' absolute paths by the form:
  -L<libdir> -l<libname>

This way, the linker will be able to resolve each dependency path,
whatever the kind of objects/build (shared object or static build) it
is dealing with.

Note that for static link, the library order does matter [5]. The order
of the opencv components has been carefully chosen to comply with this
requirement.

Fixes #3931

This patch is a port of [6] on the master branch.

[1] http://linux.die.net/man/1/pkg-config
[2] http://buildroot.org/
[3] http://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in
[4] http://autobuild.buildroot.net/results/e8a/e8a859276db34aff87ef181b0cce98916b0afc90/build-end.log
[5] http://stackoverflow.com/questions/45135/linker-order-gcc
[6] https://github.com/Itseez/opencv/commit/eceada586bbf18fc267e437522ec4f1f23ddc656

Signed-off-by: Samuel Martin <fa84b044cd972a3040f6596903a3209d1974a1c1@gmail.com>

--- cmake/OpenCVGenPkgconfig.cmake
+++ cmake/OpenCVGenPkgconfig.cmake
@@ -8,10 +8,6 @@
 #
 # ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install"
 # -------------------------------------------------------------------------------------------
-set(prefix      "${CMAKE_INSTALL_PREFIX}")
-set(exec_prefix "\${prefix}")
-set(libdir      "") #TODO: need link paths for OpenCV_EXTRA_COMPONENTS
-set(includedir  "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")

 if(CMAKE_BUILD_TYPE MATCHES "Release")
   set(ocv_optkind OPT)
@@ -35,44 +31,71 @@
 ocv_list_reverse(OpenCV_EXTRA_COMPONENTS)

 #build the list of components
-set(OpenCV_LIB_COMPONENTS_ "")
+
+# Note:
+#   when linking against static libraries, if libfoo depends on libbar, then
+#   libfoo must come first in the linker flags.
+
+# world and contrib_world are special targets whose library should come first,
+# especially for static link.
+if(OpenCV_LIB_COMPONENTS MATCHES "opencv_world")
+  list(REMOVE_ITEM OpenCV_LIB_COMPONENTS "opencv_world")
+  list(INSERT OpenCV_LIB_COMPONENTS 0 "opencv_world")
+endif()
+
+if(OpenCV_LIB_COMPONENTS MATCHES "opencv_contrib_world")
+  list(REMOVE_ITEM OpenCV_LIB_COMPONENTS "opencv_contrib_world")
+  list(INSERT OpenCV_LIB_COMPONENTS 0 "opencv_contrib_world")
+endif()
+
+set(OpenCV_LIB_COMPONENTS_)
 foreach(CVLib ${OpenCV_LIB_COMPONENTS})
-  if (TARGET ${CVLib})
-  get_target_property(libpath ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
-  get_filename_component(libname "${libpath}" NAME)

-  if(INSTALL_TO_MANGLED_PATHS)
-    set(libname "${libname}.${OPENCV_VERSION}")
+  get_target_property(libloc ${CVLib} LOCATION_${CMAKE_BUILD_TYPE})
+  if(libloc MATCHES "3rdparty")
+    set(libpath "\${exec_prefix}/share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
+  else()
+    set(libpath "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
   endif()
+  list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libpath}")

-  #need better solution....
-  if(libpath MATCHES "3rdparty")
-    set(installDir "share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}")
-  else()
-    set(installDir "${OPENCV_LIB_INSTALL_PATH}")
-  endif()
+  get_filename_component(libname ${CVLib} NAME_WE)
+  string(REGEX REPLACE "^lib" "" libname "${libname}")
+  list(APPEND OpenCV_LIB_COMPONENTS_ "-l${libname}")

-  set(OpenCV_LIB_COMPONENTS_ "${OpenCV_LIB_COMPONENTS_} \${exec_prefix}/${installDir}/${libname}")
-  endif()
 endforeach()

 # add extra dependencies required for OpenCV
-set(OpenCV_LIB_COMPONENTS ${OpenCV_LIB_COMPONENTS_})
 if(OpenCV_EXTRA_COMPONENTS)
   foreach(extra_component ${OpenCV_EXTRA_COMPONENTS})

-    if(extra_component MATCHES "^-[lL]" OR extra_component MATCHES "[\\/]")
-      set(maybe_l_prefix "")
+    if(extra_component MATCHES "^-[lL]")
+      set(libprefix "")
+      set(libname "${extra_component}")
+    elseif(extra_component MATCHES "[\\/]")
+      get_filename_component(libdir "${extra_component}" PATH)
+      list(APPEND OpenCV_LIB_COMPONENTS_ "-L${libdir}")
+      get_filename_component(libname "${extra_component}" NAME_WE)
+      string(REGEX REPLACE "^lib" "" libname "${libname}")
+      set(libprefix "-l")
     else()
-      set(maybe_l_prefix "-l")
+      set(libprefix "-l")
+      set(libname "${extra_component}")
     endif()
-
-    set(OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS} ${maybe_l_prefix}${extra_component}")
+    list(APPEND OpenCV_LIB_COMPONENTS_ "${libprefix}${libname}")

   endforeach()
 endif()

+list(REMOVE_DUPLICATES OpenCV_LIB_COMPONENTS_)
+string(REPLACE ";" " " OpenCV_LIB_COMPONENTS "${OpenCV_LIB_COMPONENTS_}")
+
 #generate the .pc file
+set(prefix      "${CMAKE_INSTALL_PREFIX}")
+set(exec_prefix "\${prefix}")
+set(libdir      "\${exec_prefix}/${OPENCV_LIB_INSTALL_PATH}")
+set(includedir  "\${prefix}/${OPENCV_INCLUDE_INSTALL_PATH}")
+
 if(INSTALL_TO_MANGLED_PATHS)
   set(OPENCV_PC_FILE_NAME "opencv-${OPENCV_VERSION}.pc")
 else()


Use correct std lib for clang on Linux

Use correct std lib for clang on Linux

--- cmake/PlatformLinuxClang.cmake
+++ cmake/PlatformLinuxClang.cmake
@@ -3,7 +3,7 @@

 # Enable C++11 support

-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")

 include_directories("/usr/include/c++/v1/")


update FindLibBot.cmake

update FindLibBot.cmake

--- cmake/modules/FindLibBot.cmake
+++ cmake/modules/FindLibBot.cmake
@@ -21,15 +21,16 @@
 find_library(LIBBOT_PARAM_CLIENT_LIBRARY bot2-param-client HINTS ${_lib_dir_hint} DOC "The bot-param-client library")
 find_library(LIBBOT_LCMGL_CLIENT_LIBRARY bot2-lcmgl-client HINTS ${_lib_dir_hint} DOC "The bot-lcmgl-client library")
 find_library(LIBBOT_LCMGL_RENDERER_LIBRARY bot2-lcmgl-renderer HINTS ${_lib_dir_hint} DOC "The bot-lcmgl-renderer library")
-find_library(LIBBOT_VIS_LIBRARY bot2-vis HINTS ${_lib_dir_hint} DOC "The bot-vis library")

 set(LIBBOT_INCLUDE_DIRS ${LIBBOT_INCLUDE_DIR} ${GTK2_GLIB_INCLUDE_DIR} ${GTK2_GLIBCONFIG_INCLUDE_DIR})
-set(LIBBOT_LIBRARIES ${LIBBOT_CORE_LIBRARY} ${LIBBOT_FRAMES_LIBRARY} ${LIBBOT_PARAM_CLIENT_LIBRARY} ${LIBBOT_LCMGL_CLIENT_LIBRARY} ${LIBBOT_LCMGL_RENDERER_LIBRARY} ${LIBBOT_VIS_LIBRARY} ${GTK2_GLIB_LIBRARY})
+set(LIBBOT_LIBRARIES ${LIBBOT_CORE_LIBRARY} ${LIBBOT_FRAMES_LIBRARY} ${LIBBOT_PARAM_CLIENT_LIBRARY} ${LIBBOT_LCMGL_CLIENT_LIBRARY} ${LIBBOT_LCMGL_RENDERER_LIBRARY} ${GTK2_GLIB_LIBRARY})

 include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBot DEFAULT_MSG LIBBOT_INCLUDE_DIR LIBBOT_CORE_LIBRARY LIBBOT_FRAMES_LIBRARY LIBBOT_PARAM_CLIENT_LIBRARY)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibBot DEFAULT_MSG LIBBOT_INCLUDE_DIR LIBBOT_LIBRARIES)

 mark_as_advanced(LIBBOT_INCLUDE_DIR)
 mark_as_advanced(LIBBOT_CORE_LIBRARY)
 mark_as_advanced(LIBBOT_FRAMES_LIBRARY)
 mark_as_advanced(LIBBOT_PARAM_CLIENT_LIBRARY)
+mark_as_advanced(LIBBOT_LCMGL_CLIENT_LIBRARY)
+mark_as_advanced(LIBBOT_LCMGL_RENDERER_LIBRARY)


NFC:  Fix typo in a cmake message

NFC:  Fix typo in a cmake message

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@362845 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -181,7 +181,7 @@
   set (PYTHON_DLL ${PYTHON_DLL} PARENT_SCOPE)
   set (PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR} PARENT_SCOPE)

-  message("-- LLDB Found PythonExecutable: ${PYTHON_EXE}}")
+  message("-- LLDB Found PythonExecutable: ${PYTHON_EXE}")
   message("-- LLDB Found PythonLibs: ${PYTHON_LIB}")
   message("-- LLDB Found PythonDLL: ${PYTHON_DLL}")
   message("-- LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")


linux compilation, defaults to using the older gtk solution till more folks have a chance to beat up the zenity one.

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -204,6 +204,9 @@
 #option(DEBUG_SPEW "more debug" OFF)
 set(TORQUE_NO_DSO_GENERATION ON)

+option(TORQUE_UseZenity "use the Zenity backend for NFD" OFF)
+mark_as_advanced(TORQUE_UseZenity)
+
 if(WIN32)
     # warning C4800: 'XXX' : forcing value to bool 'true' or 'false' (performance warning)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -wd4800")
@@ -460,7 +463,11 @@
        # Add other flags to the compiler
        add_definitions(${GTK3_CFLAGS_OTHER})

-       set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m"  )
+	   if(TORQUE_UseZenity)
+			set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m"  )
+	   else()
+			set(BLACKLIST "nfd_win.cpp" "nfd_cocoa.m" "simple_exec.h" "nfd_zenity.c")
+	   endif()
        addLib(nativeFileDialogs)

        set(BLACKLIST ""  )


filters false flags from clang compilation

--- Tools/CMake/torque3d.cmake
+++ Tools/CMake/torque3d.cmake
@@ -28,9 +28,15 @@
     endif()
     #set(CXX_FLAG32 "-m32") #uncomment for build x32 on OSx64

+    if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS}")
+    else()
     # default compiler flags
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$$ORIGIN'")
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CXX_FLAG32} -Wundef -msse -pipe -Wfatal-errors ${TORQUE_ADDITIONAL_LINKER_FLAGS} -Wl,-rpath,'$$ORIGIN'")
+
+   endif()

 	# for asm files
 	SET (CMAKE_ASM_NASM_OBJECT_FORMAT "elf")


Fix incorrect build type regression from ef89b0dc51d (#33894)

--- stdlib/cmake/modules/SwiftSource.cmake
+++ stdlib/cmake/modules/SwiftSource.cmake
@@ -244,7 +244,7 @@
       "-F${SWIFT_SDK_${sdk}_ARCH_${arch}_PATH}/../../../Developer/Library/Frameworks")
   endif()

-  swift_optimize_flag_for_build_type("${CMAKE_BUILD_TYPE}" optimize_flag)
+  swift_optimize_flag_for_build_type("${build_type}" optimize_flag)
   list(APPEND result "${optimize_flag}")

   is_build_type_with_debuginfo("${build_type}" debuginfo)


- improve functional tests, avoid any conflict with gfal2 ones

--- test/functional/ctest_functional.cmake
+++ test/functional/ctest_functional.cmake
@@ -9,8 +9,8 @@
 set(http_desy_base "https://vm-dcache-deploy6.desy.de:2880/dteam/davix-tests" CACHE STRING "dCache test instance to use")
 set(http_lcgdm_base "https://lxfsra04a04.cern.ch/dpm/cern.ch/home/dteam" CACHE STRING "DPM test instance to use" )
 set(http_dynaFed_base "http://dav-federation.cern.ch/myfed/dteam/")
-set(http_lcgdm_file "${http_lcgdm_base}/gfal2-tests/testread0011")
-set(http_dynaFed_file "${http_dynaFed_base}/gfal2-tests/testread0011")
+set(http_lcgdm_file "${http_lcgdm_base}/davix-tests/testread0011")
+set(http_dynaFed_file "${http_dynaFed_base}/davix-tests/testread0011")

 set(metalink_url "http://download.documentfoundation.org/libreoffice/stable/4.2.3/deb/x86_64/LibreOffice_4.2.3_Linux_x86-64_deb.tar.gz")
 set(metalink3_url "http://download.documentfoundation.org/libreoffice/stable/4.2.3/deb/x86_64/LibreOffice_4.2.3_Linux_x86-64_deb.tar.gz.metalink")


LaTeX: add the pdf_depends also to HTML so the files are copied properly

--- cmake/LATEX.cmake
+++ cmake/LATEX.cmake
@@ -1708,6 +1708,7 @@
           "${HTLATEX_COMPILER_TEX4HT_POSTPROCESSOR_FLAGS}"
           "${HTLATEX_COMPILER_T4HT_POSTPROCESSOR_FLAGS}"
           ${HTLATEX_COMPILER_ARGS}
+	DEPENDS ${make_pdf_depends}
         VERBATIM
         )
       add_custom_target(${html_target}


[OpenMP] Fix nvidia-cuda-toolkit detection on Debian/Ubuntu

The OpenMP runtime's cmake scripts do not correctly locate the
libdevice that the Debian/Ubuntu package nvidia-cuda-toolkit currently
includes, at least on my Ubuntu 18.04.1 installation.  This patch
fixes that for me.

This problem was discussed at length in D55269.  D40453 added a
similar adjustment in clang, but reviewers of D55269 concluded that,
for the OpenMP runtime, the right place to address this problem is in
cmake's CUDA support.  However, it was also suggested we could add a
workaround to OpenMP's cmake scripts now.  This patch contains such a
workaround, which I've tried to design so that it will have no harmful
effect if cmake improves in the future.

nvidia-cuda-toolkit also needs improvements because its intended
monolithic CUDA tree shim, /usr/lib/cuda, has many empty directories,
such as bin.  I reported that at:

<https://bugs.launchpad.net/ubuntu/+source/nvidia-cuda-toolkit/+bug/1808999>

Reviewed By: grokos

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

git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@350377 91177308-0d34-0410-b5e6-96231b3b80d8

--- libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -112,6 +112,9 @@
 ################################################################################
 # Looking for CUDA...
 ################################################################################
+if (CUDA_TOOLKIT_ROOT_DIR)
+  set(LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET TRUE)
+endif()
 find_package(CUDA QUIET)

 set(LIBOMPTARGET_DEP_CUDA_FOUND ${CUDA_FOUND})
@@ -158,3 +161,33 @@
   LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES)

 mark_as_advanced(LIBOMPTARGET_DEP_CUDA_DRIVER_LIBRARIES)
+
+################################################################################
+# Looking for CUDA libdevice subdirectory
+#
+# Special case for Debian/Ubuntu to have nvidia-cuda-toolkit work
+# out of the box. More info on http://bugs.debian.org/882505
+################################################################################
+
+set(LIBOMPTARGET_CUDA_LIBDEVICE_SUBDIR nvvm/libdevice)
+
+# Don't alter CUDA_TOOLKIT_ROOT_DIR if the user specified it, if a value was
+# already cached for it, or if it already has libdevice.  Otherwise, on
+# Debian/Ubuntu, look where the nvidia-cuda-toolkit package normally installs
+# libdevice.
+if (NOT LIBOMPTARGET_CUDA_TOOLKIT_ROOT_DIR_PRESET AND
+    NOT EXISTS
+      "${CUDA_TOOLKIT_ROOT_DIR}/${LIBOMPTARGET_CUDA_LIBDEVICE_SUBDIR}")
+  find_program(LSB_RELEASE lsb_release)
+  if (LSB_RELEASE)
+    execute_process(COMMAND ${LSB_RELEASE} -is
+      OUTPUT_VARIABLE LSB_RELEASE_ID
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    set(candidate_dir /usr/lib/cuda)
+    if ((LSB_RELEASE_ID STREQUAL "Debian" OR LSB_RELEASE_ID STREQUAL "Ubuntu")
+        AND EXISTS "${candidate_dir}/${LIBOMPTARGET_CUDA_LIBDEVICE_SUBDIR}")
+      set(CUDA_TOOLKIT_ROOT_DIR "${candidate_dir}" CACHE PATH
+          "Toolkit location." FORCE)
+    endif()
+  endif()
+endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2011)

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


BUG: Fix issues when cloning elastix repository on networks with where git protocol is blocked

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -1,6 +1,6 @@
 set( proj Elastix )

-set( ELASTIX_REPOSITORY git://github.com/mstaring/elastix.git )
+set( ELASTIX_REPOSITORY https://github.com/mstaring/elastix.git )
 set( ELASTIX_TAG c35842cd0152d8fd2894e7c6706d2dd8396f0fed )

 ExternalProject_Add( ${proj}


[cmake]Add -L-ldl in order to build with DMD


Update WSREP_PATCH_REVNO.

Update WSREP_PATCH_REVNO.

--- cmake/wsrep.cmake
+++ cmake/wsrep.cmake
@@ -23,7 +23,7 @@
 # MariaDB addition: Revision number of the last revision merged from
 # codership branch visible in @@visible_comment.
 # Branch : https://github.com/codership/mysql-wsrep/tree/5.6
-SET(WSREP_PATCH_REVNO "af7f02e") # Should be updated on every merge.
+SET(WSREP_PATCH_REVNO "c3fc46e") # Should be updated on every merge.

 # MariaDB: Obtain patch revision number:
 # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.


refine and fix glow-config.cmake

refine and fix glow-config.cmake

--- glow-config.cmake
+++ glow-config.cmake
@@ -16,6 +16,7 @@
 	$ENV{GLOW_DIR}/include
 	${GLOW_DIR}/include
 	$ENV{PROGRAMFILES}/GLOW/include
+	/include
 	/usr/include
 	/usr/local/include
 	/sw/include
@@ -25,6 +26,7 @@
 set(LIB_PATHS
 	$ENV{GLOW_DIR}/lib
 	${GLOW_DIR}/lib
+	/lib
 	/usr/lib
 	/usr/local/lib
 	/sw/lib


ENH: Update CLAPACK remote repository

ENH: Update CLAPACK remote repository

CLAPACK source code is now downloaded from Github. This allows us to patch it if necessary. The build system has been patch to avoid building the tests if BULD_TESTING is turned OFF.

--- SuperBuild/External_CLAPACK.cmake
+++ SuperBuild/External_CLAPACK.cmake
@@ -43,11 +43,12 @@
     )

 set(CLAPACK_version 3.2.1)
-#set(CLAPACK_file "http://www.netlib.org/clapack/clapack-${clapack_version}-CMAKE.tgz")
-# Since the netlib.org server has been down several time, especially when the nightly dashboard
-# started, we added a copy of the archive to slicer3 lib mirrors.
-set(CLAPACK_file http://svn.slicer.org/Slicer3-lib-mirrors/trunk/clapack-${CLAPACK_version}-CMAKE.tgz)
-set(CLAPACK_MD5 4fd18eb33f3ff8c5d65a7d43913d661b)
+# We needed to patch CLAPACK to avoid building tests when BUILD_TESTING was set to OFF
+# Instead of patching the source code each time, we copied the source code from
+# http://svn.slicer.org/Slicer3-lib-mirrors/trunk/clapack-3.2.1-CMAKE.tgz
+# to https://github.com/NIRALUser/CLAPACK
+set(${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/CLAPACK.git)
+set(${proj}_GIT_TAG b12609ee7addcad38d6b9265a7d1ae5446b05255)

 # Turn off the warnings for CLAPACK on windows
 string(REPLACE "/W3" "/W0" CMAKE_CXX_FLAGS_CLAPACK "${ep_common_cxx_flags}")
@@ -65,11 +66,10 @@
 endif()
   ### --- End Project specific additions
   ExternalProject_Add(${proj}
-    DOWNLOAD_DIR ${CMAKE_BINARY_DIR}
+    GIT_REPOSITORY ${${proj}_REPOSITORY}
+    GIT_TAG ${${proj}_GIT_TAG}
     SOURCE_DIR ${EXTERNAL_SOURCE_DIRECTORY}/${proj}
     BINARY_DIR ${proj}-build
-    URL ${CLAPACK_file}
-    URL_MD5 ${CLAPACK_MD5}
     CMAKE_GENERATOR ${gen}
     CMAKE_ARGS
       ${CMAKE_OSX_EXTERNAL_PROJECT_ARGS}
@@ -77,6 +77,7 @@
       -DBUILD_EXAMPLES:BOOL=OFF
       -DBUILD_TESTING:BOOL=OFF
       ${${proj}_CMAKE_OPTIONS}
+    #PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/SuperBuild/CLAPACK-PatchTesting.txt ${CMAKE_CURRENT_BINARY_DIR}/CLAPACK/CMakeLists.txt # No testing if BUILD_TESTING is set to OFF
     INSTALL_COMMAND ""
     DEPENDS
       ${${proj}_DEPENDENCIES}
@@ -85,7 +86,7 @@
   set(${extProjName}_DIR ${CMAKE_BINARY_DIR}/${proj}-build)
 else()
   if(${USE_SYSTEM_${extProjName}})
-    find_package(${extProjName} ${ITK_VERSION_MAJOR} REQUIRED)
+    find_package(${extProjName} REQUIRED)
     if(NOT ${extProjName}_DIR)
       message(FATAL_ERROR "To use the system ${extProjName}, set ${extProjName}_DIR")
     endif()


ENH: Update elastix to revision

ENH: Update elastix to revision

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -1,12 +1,21 @@
 set( proj elastix )

+get_cmake_property( _varNames VARIABLES )#
+
+if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
+  set( ELASTIX_BUILD_SHARED_LIBS ON )
+else()
+  set( ELASTIX_BUILD_SHARED_LIBS OFF )
+endif()
+
 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )
-set( ELASTIX_REPOSITORY http://github.com/kaspermarstal/elastix )
-set( ELASTIX_TAG 3c7deef6d4f44203207bc198cc27f011ac1222c7 )
+
+set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/kaspermarstal/elastix )
+set( ELASTIX_GIT_TAG 098f973472f3a51bbffbe2967440fae970518001 )

 ExternalProject_Add( ${proj}
-  GIT_REPOSITORY ${ELASTIX_REPOSITORY}
-  GIT_TAG ${ELASTIX_TAG}
+  GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}
+  GIT_TAG ${ELASTIX_GIT_TAG}
   UPDATE_COMMAND ""
   SOURCE_DIR ${proj}
   BINARY_DIR ${proj}-build
@@ -14,9 +23,11 @@
   CMAKE_ARGS
   --no-warn-unused-cli
   -C "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt"
+  ${ep_common_args}
+  -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
   -DELASTIX_BUILD_TESTING:BOOL=OFF
   -DELASTIX_BUILD_EXECUTABLE:BOOL=OFF
-  -DELASTIX_BUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+  -DELASTIX_BUILD_SHARED_LIBS:BOOL=${ELASTIX_BUILD_SHARED_LIBS}
   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
   -DITK_DIR:PATH=${ITK_DIR}
   -DUSE_ALL_PIXELTYPES:BOOL=ON
@@ -85,7 +96,7 @@
   -DUSE_RayCastInterpolator:BOOL=ON
   -DUSE_RayCastResampleInterpolator:BOOL=ON
   -DUSE_ReducedDimensionBSplineInterpolator:BOOL=ON
-  -DUSE_ReducedDimensionBSplineResampleInterpolator:BOOL=ON
+  -DUSE_ReducedDimensionBSplineResampleInterpolator:BOOL=ON
   -DUSE_RegularStepGradientDescent:BOOL=ON
   -DUSE_SimilarityTransformElastix:BOOL=ON
   -DUSE_Simplex:BOOL=ON


COMP: Always invoke elastix build

COMP: Always invoke elastix build

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -108,5 +108,13 @@
   DEPENDS ${${CMAKE_PROJECT_NAME}_DEPENDENCIES}
 )

+ExternalProject_Add_Step(${proj} forcebuild
+  COMMAND ${CMAKE_COMMAND} -E remove
+    ${CMAKE_CURRENT_BUILD_DIR}/${proj}-prefix/src/${proj}-stamp/${prog}-build
+  DEPENDEES configure
+  DEPENDERS build
+  ALWAYS 1
+)
+
 ExternalProject_Get_Property( Elastix BINARY_DIR )
 set( ELASTIX_USE_FILE "${BINARY_DIR}/UseElastix.cmake" )


Update ITK superbuild with optimizer patches

Change-Id: I6b2bcd90285ea58a7d0b952d7e2259f673611869

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.7.1) # v4.7.1 release
+set(ITK_TAG_COMMAND GIT_TAG 8f7c404aff99f5ae3dfedce6e480701f0304864c) # after v4.7.1 release

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


For WrapITK superbuild don't install into system path

Explicitly, disable WrapITK compatibility installation to install
WrapITK into ITK prefix as opposed to the system path.

Change-Id: I6252ad8ef0b0ea796504d243eaf95a87c4c484ef

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -67,6 +67,8 @@
   -DITK_WRAP_rgb_unsigned_char:BOOL=ON
   -DITK_WRAP_rgb_unsigned_short:BOOL=ON
   -DITK_WRAP_PYTHON:BOOL=${ITK_WRAPPING}
+  # Required as to not install into system
+  -DINSTALL_WRAP_ITK_COMPATIBILITY:BOOL=OFF
   # Swig
   -DSWIG_DIR:PATH=${SWIG_DIR}
   -DSWIG_EXECUTABLE:PATH=${SWIG_EXECUTABLE}


BUG: Update VTK Git clone URL

BUG: Update VTK Git clone URL

The old URL, git protocol, is no longer supported.

--- Superbuild/External-VTK.cmake
+++ Superbuild/External-VTK.cmake
@@ -8,7 +8,7 @@
 set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}")

 ExternalProject_Add(VTK
-  GIT_REPOSITORY "${git_protocol}://vtk.org/VTK.git"
+  GIT_REPOSITORY "https://gitlab.kitware.com/VTK/VTK.git"
   GIT_TAG "${VTK_TAG}"
   SOURCE_DIR VTK
   BINARY_DIR VTK-build
@@ -23,7 +23,7 @@
     -DModule_vtkImagingMath:BOOL=ON
     -DVTK_WRAP_PYTHON:BOOL=ON
     -DExternalData_OBJECT_STORES:STRING=${ExternalData_OBJECT_STORES}
-    "-DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
+    "-DPython3_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}"
     -DVTK_USE_SYSTEM_ZLIB:BOOL=ON
     "-DZLIB_ROOT:PATH=${ZLIB_ROOT}"
     "-DZLIB_INCLUDE_DIR:PATH=${ZLIB_INCLUDE_DIR}"


ENH: Bump VTK version to 9.0.1 in Superbuild

--- Superbuild/External-VTK.cmake
+++ Superbuild/External-VTK.cmake
@@ -2,7 +2,7 @@
 # Get and build vtk

 if(NOT VTK_TAG)
-  set(VTK_TAG "v8.2.0")
+  set(VTK_TAG "v9.0.1")
 endif()

 set(PYTHON_EXECUTABLE "${ITKPYTHON_EXECUTABLE}")


Add '_' prefix to variable not to be propagated to ITK project

Change-Id: I1e0fba33c35f7c0f7d47537be2e96972902276ec

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -7,16 +7,16 @@
 check_type_size(size_t SITK_SIZEOF_SIZE_T)
 check_type_size(long SITK_SIZEOF_LONG)

-set(ITK_USE_64BITS_IDS_DEFAULT OFF)
+set(_ITK_USE_64BITS_IDS_DEFAULT OFF)
 if(SITK_SIZEOF_SIZE_T EQUAL 8
     AND NOT SITK_SIZEOF_LONG EQUAL 8 )
-  set(ITK_USE_64BITS_IDS_DEFAULT ON)
+  set(_ITK_USE_64BITS_IDS_DEFAULT ON)
 endif()

 option(ITK_USE_64BITS_IDS "When ON, ITK will use 64 bits integers to
  index pixels. This is needed for managing images larger than 4Gb in
  some platforms."
-  ${ITK_USE_64BITS_IDS_DEFAULT})
+  ${_ITK_USE_64BITS_IDS_DEFAULT})
 mark_as_advanced(ITK_USE_64BITS_IDS)


ENH: Bump ITK ExternalProject to v4.8.0.

Change-Id: If9de2ce5f6135ba8c094f5c15952f34e288e4ee2

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -2,7 +2,7 @@
 # Get and build itk

 if( NOT ITK_TAG )
-  set( ITK_TAG "v4.8rc03" )
+  set( ITK_TAG "v4.8.0" )
 endif()

 set( _vtk_args )


COMP: Fix vxl_config_macros usage of CMake check macros

Some CMake check macros used the idiom

  if("${VAR}" MATCHES "^${VAR}$")

to detect whether a variable is set.  In vxl_config_macros we were
abusing this implementation by using

  SET( ${VARIABLE} ${VARIABLE} )

to reset the check state.  This prevents the CMake macros from using

  if(NOT DEFINED "${VAR}")

instead of the old idiom.  Use the much cleaner

  UNSET(${VARIABLE})

instead.

Change-Id: Iabd613d6666cd3513a406f5c5c1479f205dbbf69

--- Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_config_macros.cmake
+++ Modules/ThirdParty/VNL/src/vxl/config/cmake/config/vxl_config_macros.cmake
@@ -154,7 +154,7 @@

 MACRO(PERFORM_CHECK_HEADER FILE VARIABLE)
   IF( VXL_UPDATE_CONFIGURATION )
-    SET( ${VARIABLE} ${VARIABLE} )
+    UNSET(${VARIABLE})
   ENDIF( VXL_UPDATE_CONFIGURATION )
   CHECK_INCLUDE_FILE_CXX(${FILE} ${VARIABLE})
   IF("${VARIABLE}" MATCHES "^$")
@@ -262,7 +262,7 @@

 MACRO(CHECK_FUNCTION_EXISTS_ZERO FUNCTION VARIABLE)
   IF( VXL_UPDATE_CONFIGURATION )
-    SET( ${VARIABLE} ${VARIABLE} )
+    UNSET(${VARIABLE})
   ENDIF( VXL_UPDATE_CONFIGURATION )
   CHECK_FUNCTION_EXISTS("${FUNCTION}" "${VARIABLE}")
   IF(NOT ${VARIABLE})
@@ -330,7 +330,7 @@

 MACRO(PERFORM_C_CHECK_FUNCTION SYMBOL FILE VARIABLE)
   IF( VXL_UPDATE_CONFIGURATION )
-    SET( ${VARIABLE} ${VARIABLE} )
+    UNSET(${VARIABLE})
   ENDIF( VXL_UPDATE_CONFIGURATION )
   CHECK_SYMBOL_EXISTS(${SYMBOL} ${FILE} ${VARIABLE})
   IF(${VARIABLE})


ENH (#3262): Adding videoInput (DirectShow wrapper lib) support. The videoInput comes with OpenCV. Unfortunately, the OpenCV CvCapture module has a bug. Therefore, the videoInput library is used directly to implement a new video source (HD capable)

--- CMake/MITK_OpenCV_Config.cmake
+++ CMake/MITK_OpenCV_Config.cmake
@@ -6,9 +6,13 @@
 IF(OPENCV_DIR)
 INCLUDE("${OPENCV_DIR}/OpenCVConfig.cmake")
 LOAD_CACHE(${THIS_OPENCV_CONFIG_PATH} READ_WITH_PREFIX OpenCV_ OpenCV_SOURCE_DIR)
-SET(OpenCV_INCLUDE_DIRS "${OpenCV_OpenCV_SOURCE_DIR}/include" "${OpenCV_OpenCV_SOURCE_DIR}/include/opencv")
+SET(OpenCV_INCLUDE_DIRS "${OpenCV_OpenCV_SOURCE_DIR}/include" "${OpenCV_OpenCV_SOURCE_DIR}/include/opencv" "${OpenCV_OpenCV_SOURCE_DIR}/3rdparty/include")

 LIST(APPEND ALL_INCLUDE_DIRECTORIES ${OpenCV_INCLUDE_DIRS})
+IF(WIN32)
+SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:atlthunk" )
+set(OpenCV_LIBS ${OpenCV_LIBS} "${OpenCV_OpenCV_SOURCE_DIR}/3rdparty/lib/videoInput.lib")
+ENDIF(WIN32)
 LIST(APPEND ALL_LIBRARIES ${OpenCV_LIBS})
 link_directories(${OpenCV_LIB_DIR})
 ELSE(OPENCV_DIR)


BUG: When the option is not available the current value should be saved as an internal cache entry only if it is already set.

--- CMake/vtkDependentOption.cmake
+++ CMake/vtkDependentOption.cmake
@@ -21,7 +21,9 @@
       OPTION(${option} "${doc}" "${default}")
       SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
     ELSE(${option}_AVAILABLE)
-      SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
+      IF(DEFINED ${option})
+        SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
+      ENDIF(DEFINED ${option})
       SET(${option} ${force})
     ENDIF(${option}_AVAILABLE)
   ELSE(${option}_ISSET MATCHES "^${option}_ISSET")


cmake: remove useless file

cmake: remove useless file

--- cmake/Modules/plugin.cmake
+++ cmake/Modules/plugin.cmake
@@ -1,56 +0,0 @@
-set(EOVIM_INCLUDE_DIRS
-   "${CMAKE_SOURCE_DIR}/include"
-   "${CMAKE_BINARY_DIR}/include")
-
-find_program(Python3 COMPONENTS Interpreter)
-
-function (add_plugin Plugin)
-   set(BUILD_DIR "${CMAKE_BINARY_DIR}/plugins")
-   set(SRC_DIR "${CMAKE_SOURCE_DIR}/plugins/${Plugin}")
-   set(LIB_DIR "${CMAKE_SOURCE_DIR}/plugins/lib")
-   set(GEN_HELPER "${CMAKE_SOURCE_DIR}/plugins/lib/gen_helper.py")
-   set(SOURCES
-     "${SRC_DIR}/plugin.c"
-     "${BUILD_DIR}/plugin_${Plugin}.c"
-     "${BUILD_DIR}/plugin_${Plugin}.h"
-   )
-
-   add_custom_command(
-      OUTPUT
-        "${BUILD_DIR}/plugin_${Plugin}.c"
-        "${BUILD_DIR}/plugin_${Plugin}.h"
-      COMMAND
-        ${Python3_EXECUTABLE} ${GEN_HELPER}
-          -t "${LIB_DIR}/helper.c.j2" -o "${BUILD_DIR}/plugin_${Plugin}.c"
-          -t "${LIB_DIR}/helper.h.j2" -o "${BUILD_DIR}/plugin_${Plugin}.h"
-          "${SRC_DIR}/plugin.json"
-      DEPENDS
-        "${LIB_DIR}/helper.c.j2"
-        "${LIB_DIR}/helper.h.j2"
-   )
-   add_library(${Plugin} MODULE
-      ${SOURCES})
-   target_include_directories(${Plugin}
-      PRIVATE
-      ${BUILD_DIR}
-   )
-   target_include_directories(${Plugin}
-      SYSTEM PRIVATE
-      ${EINA_INCLUDE_DIRS}
-      ${EVAS_INCLUDE_DIRS}
-      ${ELEMENTARY_INCLUDE_DIRS}
-      ${MSGPACK_INCLUDE_DIRS}
-      ${EOVIM_INCLUDE_DIRS}
-   )
-   target_link_libraries(${Plugin}
-      ${EINA_LIBRARIES}
-      ${EVAS_LIBRARIES}
-      ${ELEMENTARY_LIBRARIES}
-      ${MSGPACK_LIBRARIES}
-      libeovim
-   )
-   add_nazi_compiler_warnings(${Plugin})
-   set_target_properties(${Plugin} PROPERTIES PREFIX "")
-
-   install(TARGETS ${Plugin} LIBRARY DESTINATION ${LIB_INSTALL_DIR}/eovim)
-endfunction ()


cmake: Fix configuration errors

cmake: Fix configuration errors

--- cmake/PlatformDetect.cmake
+++ cmake/PlatformDetect.cmake
@@ -3,15 +3,15 @@
 	string (TOLOWER ${CMAKE_SYSTEM_NAME} PLIB_TARGET_OS)

 	# Detect C compiler by it's ID
-	if (${CMAKE_C_COMPILER_ID} STREQUAL GNU)
+	if (CMAKE_C_COMPILER_ID STREQUAL GNU)
 		set (PLIB_C_COMPILER gcc)
-	elseif (${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
+	elseif (CMAKE_C_COMPILER_ID STREQUAL MSVC)
 		set (PLIB_C_COMPILER msvc)
 	else()
 		string (TOLOWER ${CMAKE_C_COMPILER_ID} PLIB_C_COMPILER)
 	endif()

-	# Fix gcc -> qcc nameing on QNX 6
+	# Fix gcc -> qcc naming on QNX 6
 	if ((PLIB_TARGET_OS STREQUAL qnx) AND (PLIB_C_COMPILER STREQUAL gcc))
 		set (PLIB_C_COMPILER qcc)
 	endif()


Fix RPM prefix.

Fix RPM prefix.

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -67,7 +67,7 @@
 #ENDIF()

 IF(UNIX)
-  IF(INSTALL_LAYOUT MATCHES "UNIX")
+  IF(INSTALL_LAYOUT MATCHES "RPM")
     SET(default_prefix "/usr")
   ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
     SET(default_prefix "/opt/mysql/mysql")


First cut at SVR4 layout.

First cut at SVR4 layout.

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -53,13 +53,17 @@

 IF(NOT INSTALL_LAYOUT MATCHES "STANDALONE")
   IF(NOT INSTALL_LAYOUT MATCHES "UNIX")
-    SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}")
+    # XXX not keen on this, how many more will we need? prefer to just bail...
+    IF(NOT INSTALL_LAYOUT MATCHES "SVR4")
+      SET(INSTALL_LAYOUT "${DEFAULT_INSTALL_LAYOUT}")
   ENDIF()
 ENDIF()

 IF(UNIX)
   IF(INSTALL_LAYOUT MATCHES "UNIX")
     SET(default_prefix "/usr")
+  ELSEIF(INSTALL_LAYOUT MATCHES "SVR4")
+    SET(default_prefix "/opt/mysql/mysql")
   ELSE()
     SET(default_prefix "/usr/local/mysql")
   ENDIF()
@@ -90,6 +94,23 @@
  SET(INSTALL_DOCREADMEDIR_STANDALONE ".")
  SET(INSTALL_SUPPORTFILESDIR_STANDALONE "support-files")
  SET(INSTALL_MYSQLDATADIR_STANDALONE "data")
+
+ # SVR4 layout
+ SET(INSTALL_BINDIR_SVR4 "bin")
+ SET(INSTALL_SBINDIR_SVR4 "bin")
+ SET(INSTALL_LIBDIR_SVR4 "lib")
+ SET(INSTALL_INCLUDEDIR_SVR4 "include")
+ SET(INSTALL_PLUGINDIR_SVR4 "lib/plugin")
+ SET(INSTALL_DOCDIR_SVR4 "docs")
+ SET(INSTALL_MANDIR_SVR4 "man")
+ SET(INSTALL_MYSQLSHAREDIR_SVR4 "share")
+ SET(INSTALL_SHAREDIR_SVR4 "share")
+ SET(INSTALL_SCRIPTDIR_SVR4 "scripts")
+ SET(INSTALL_MYSQLTESTDIR_SVR4 "mysql-test")
+ SET(INSTALL_SQLBENCHROOTDIR_SVR4 ".")
+ SET(INSTALL_DOCREADMEDIR_SVR4 ".")
+ SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
+ SET(MYSQL_DATADIR "/var/lib/mysql")

  # UNIX layout
  SET(INSTALL_BINDIR_UNIX "bin")


Started luanova_add_module cmake function.

--- cmake/luanova_module.cmake
+++ cmake/luanova_module.cmake
@@ -8,14 +8,27 @@
 ## Needs LuaDoc to automatically generate the modules' documentation.
 find_program (LUADOC luadoc)

-if (LUADOC STREQUAL LUADOC-NOTFOUND)
+set (GENERATE_DOC NOT LUADOC STREQUAL LUADOC-NOTFOUND)
+
+if (${GENERATE_DOC})
+  message ("-- Using LuaDoc: ${LUADOC}")
+else (${GENERATE_DOC})
   message ("-- !!WARNING!! LuaDoc not found, no documentation will be "
            "generated.")
-else (LUADOC STREQUAL LUADOC-NOTFOUND)
-  message ("-- Using LuaDoc: ${LUADOC}")
-endif (LUADOC STREQUAL LUADOC-NOTFOUND)
+endif (${GENERATE_DOC})
+
+set (DOC_DIR doc)

 function (luanova_add_modules modules)
-  #add_custom_command
+  if (${GENERATE_DOC})
+    set (outputs ${DOC_DIR}/index.html)
+    foreach (module ${modules})
+      string (REGEX REPLACE "^src/(.*).lua$" "${DOC_DIR}/modules/\\1.html"
+              docmodule ${module})
+      message ("-- Doc target: ${docmodule}")
+      set (outputs ${outputs} docmodule)
+    endforeach (module)
+    #add_custom_command
+  endif (${GENERATE_DOC})
 endfunction (luanova_add_modules)


Force LIB_TAG to be the empty string as discussed on list.

Tested on Linux using the test_interactive and test_noninteractive
targets in the build tree.

svn path=/trunk/; revision=13064

--- cmake/modules/double.cmake
+++ cmake/modules/double.cmake
@@ -25,7 +25,17 @@
 option(PL_DOUBLE
 "Compile the library with double precision floating point" ON)

-if(PL_DOUBLE)
-  set(LIB_TAG "${LIB_TAG}d")
-endif(PL_DOUBLE)
+# Force LIB_TAG to be empty in all cases.  This is completely
+# different from the previous case where "d" was appended to the user
+# setting of this variable if the library was double precision.  As
+# discussed on list we are forcing LIB_TAG to be empty because it is
+# only applied to a subset of our libraries (because the other ones do
+# not have a single-precision or double-precision variant).
+# Furthermore, the recommended and absolutely most reliable way to
+# distinguish between various kinds of PLplot builds is not by
+# appending various confusing library suffixes.  (For example, "d" is
+# often incorrectly assumed to refer to a debugging version of the
+# PLplot library.)  Instead, simply use a different install prefix for
+# each different kind of build.
+set(LIB_TAG "" CACHE STRING "LIB_TAG should _always_ be the empty string" FORCE)


ensure breakpad was built before trying to generate debug symbol data.

--- cmake/modules/macros.cmake
+++ cmake/modules/macros.cmake
@@ -56,6 +56,8 @@
 function(generate_symbol_data target)
   if(UNIX)
     set(TARGET_PATH ${CMAKE_BINARY_DIR}/bin/symbols/${target}.sym)
+
+    add_dependencies(${target} breakpad)

     add_custom_command(TARGET ${target}
       POST_BUILD


Drop "DEBUG: " from PYTHON_VERSION output.

svn path=/trunk/; revision=11092

--- cmake/modules/python.cmake
+++ cmake/modules/python.cmake
@@ -163,7 +163,7 @@
     OUTPUT_VARIABLE PYTHON_VERSION
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )
-  message(STATUS "DEBUG: PYTHON_VERSION = ${PYTHON_VERSION}")
+  message(STATUS "PYTHON_VERSION = ${PYTHON_VERSION}")

   # Enable plsmem if the Python and Swig versions support it
   transform_version(NUMERICAL_SWIG_MINIMUM_VERSION_FOR_PLSMEM "1.3.38")


build: update the driver version to 2aa88dc

Signed-off-by: Leonardo Grasso <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@leonardograsso.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -29,8 +29,8 @@
 # default below In case you want to test against another sysdig version just pass the variable - ie., `cmake
 # -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
-  set(SYSDIG_VERSION "e0db61604dbe41765d3848a59f80f9dc61d6ffc2")
-  set(SYSDIG_CHECKSUM "SHA256=b6ffd89af2ff77270a24f900cfc40e7869183d1c7dbc289278683144228d4079")
+  set(SYSDIG_VERSION "2aa88dcf6243982697811df4c1b484bcbe9488a2")
+  set(SYSDIG_CHECKSUM "SHA256=a737077543a6f3473ab306b424bcf7385d788149829ed1538252661b0f20d0f6")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


Bump version

Bump version

--- cmake/ospray_version.cmake
+++ cmake/ospray_version.cmake
@@ -3,7 +3,7 @@

 set(OSPRAY_VERSION_MAJOR 2)
 set(OSPRAY_VERSION_MINOR 1)
-set(OSPRAY_VERSION_PATCH 0)
+set(OSPRAY_VERSION_PATCH 1)
 set(OSPRAY_SOVERSION 2)
 set(OSPRAY_VERSION_GITHASH 0)
 set(OSPRAY_VERSION_NOTE "")


Allow exporting of CMake options to meta projects

--- cmake/GTClangOptions.cmake
+++ cmake/GTClangOptions.cmake
@@ -14,13 +14,15 @@
 ##
 ##===------------------------------------------------------------------------------------------===##

+include(DawnExportOptions)
 include(CMakeDependentOption)

-# Building
 set(BUILD_IS_NOT_RELEASE ON)
 if(${CMAKE_BUILD_TYPE} MATCHES "Release")
   set(BUILD_IS_NOT_RELEASE OFF)
 endif()
+
+# Building
 option(GTCLANG_ASSERTS "Enable asserts" ${BUILD_IS_NOT_RELEASE})
 option(GTCLANG_USE_CCACHE "Use compile cache (ccache)" ON)
 option(GTCLANG_BUILD_EXAMPLES "Build examples (requires boost, gridtools and OpenMP/CUDA)" ON)
@@ -34,4 +36,16 @@
                        "Enable integration testing" ON "GTCLANG_TESTING" OFF)

 # Documentation
-option(GTCLANG_DOCUMENTATION "Enable documentation" OFF)+option(GTCLANG_DOCUMENTATION "Enable documentation" OFF)
+
+# Export options for meta projects
+dawn_export_options(GTCLANG
+  GTCLANG_ASSERTS
+  GTCLANG_USE_CCACHE
+  GTCLANG_BUILD_EXAMPLES
+  GTCLANG_BUILD_EXAMPLES_WITH_GPU
+  GTCLANG_TESTING
+  GTCLANG_UNIT_TESTING
+  GTCLANG_INTEGRATION_TESTING
+  GTCLANG_DOCUMENTATION
+)


Look for cppzmq header file

Look for cppzmq header file

--HG--
branch : transport_0.3.0_jrivero

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -57,6 +57,18 @@
 endif ()

 #################################################
+# Find cppzeromq header (shipped together with zeromq in debian/ubuntu but
+# different upstream projects and tarballs)
+find_path(cppzmq_INCLUDE_DIRS zmq.hpp PATHS ${zmq_INCLUDE_DIRS})
+if (NOT cppzmq_INCLUDE_DIRS)
+  message(STATUS "cppzmq header file was not found")
+  BUILD_ERROR("cppzmq header file was not found")
+else()
+  message(STATUS "cppzmq file - found")
+  include_directories(${cppzmq_INCLUDE_DIRS})
+endif()
+
+#################################################
 # Find czmq.:
 pkg_check_modules(czmq libczmq>=1.4.0)


SiftGPU fixup

SiftGPU fixup

--- cmake/V4RFindSiftGPU.cmake
+++ cmake/V4RFindSiftGPU.cmake
@@ -7,9 +7,9 @@
                     "find system-wide installation of SiftGPU yourself.")
   endif()
   if(NOT SIFTGPU_FOUND)
-    v4r_clear_vars(SIFTGPU_LIBRARY SIFTGPU_INCLUDE_DIR)
+    v4r_clear_vars(SIFTGPU_LIBRARY SIFTGPU_INCLUDE_DIRS)
     set(SIFTGPU_LIBRARY siftgpu)
-    set(SIFTGPU_LIBRARIES ${SIFTGPU_LIBRARY})
+    set(SIFTGPU_LIBRARIES ${SIFTGPU_LIBRARY} GLEW IL)  # TODO: search for GLEW/IL/etc explicitly in cmakelists
     add_subdirectory("${V4R_SOURCE_DIR}/3rdparty/SiftGPU")
     set(SIFTGPU_INCLUDE_DIRS "${${SIFTGPU_LIBRARY}_SOURCE_DIR}/src")
   endif()


We don't need to depend on the install step if we install as part of the build

--- cmake/modules/macros.cmake
+++ cmake/modules/macros.cmake
@@ -55,10 +55,6 @@

 function(generate_symbol_data target)
   if(WITH_CRASH_REPORTS)
-    if(NOT BREAKPAD_FOUND)
-      add_dependencies(${target} breakpad-install)
-    endif()
-
     if(UNIX)
       set(TARGET_PATH ${CMAKE_BINARY_DIR}/bin/symbols/${target}.sym)


vtr: fixes due to changes in vtr package

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -599,7 +599,6 @@
         --device ${DEVICE_FULL}
         ${WIRE_EBLIF}
         --place_algorithm bounding_box
-        --enable_timing_computations off
         --route_chan_width 6
         --echo_file on
         --min_route_chan_width_hint 1
@@ -1549,7 +1548,7 @@

   # Generate placement constraints.
   # -------------------------------------------------------------------------
-  set(FIX_PINS_ARG "")
+  set(FIX_CLUSTERS_ARG "")

   if(NOT ${ADD_FPGA_TARGET_INPUT_IO_FILE} STREQUAL "" OR NOT ${ADD_FPGA_TARGET_INPUT_XDC_FILE} STREQUAL "")
     get_target_property_required(NO_PINS ${ARCH} NO_PINS)
@@ -1631,9 +1630,9 @@
       add_output_to_fpga_target(${NAME} IO_PLACE ${OUT_CONSTR_REL})
       append_file_dependency(VPR_DEPS ${OUT_CONSTR_REL})

-      set(FIX_PINS_ARG --fix_pins ${OUT_CONSTR})
+      set(FIX_CLUSTERS_ARG --fix_clusters ${OUT_CONSTR})
     else()
-      set(FIX_PINS_ARG --fix_pins ${OUT_IO})
+      set(FIX_CLUSTERS_ARG --fix_clusters ${OUT_IO})
     endif()

   endif()
@@ -1644,7 +1643,7 @@
   add_custom_command(
     OUTPUT ${OUT_PLACE}
     DEPENDS ${OUT_NET} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} ${FIX_PINS_ARG} --place
+    COMMAND ${VPR_CMD} ${FIX_CLUSTERS_ARG} --place
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/vpr_stdout.log
       ${OUT_LOCAL}/place.log
@@ -1655,7 +1654,7 @@
   add_custom_command(
     OUTPUT ${ECHO_OUT_PLACE}
     DEPENDS ${ECHO_OUT_NET} ${VPR_DEPS}
-    COMMAND ${VPR_CMD} ${FIX_PINS_ARG} --echo_file on --place
+    COMMAND ${VPR_CMD} ${FIX_CLUSTERS_ARG} --echo_file on --place
     COMMAND
       ${CMAKE_COMMAND} -E copy ${OUT_LOCAL}/echo/vpr_stdout.log
         ${OUT_LOCAL}/echo/place.log


Removed accidentally added check against ROS_BUILD_TEST_LABEL from rosbuild_add_rostest

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -544,12 +544,9 @@
 macro(rosbuild_add_rostest file)
   string(REPLACE "/" "_" _testname ${file})
   _rosbuild_add_rostest(${file})
-  # Check for agreement of optional label and environment variable
-  if("${ARGN}" STREQUAL "$ENV{ROS_BUILD_TEST_LABEL}")
-    # Redeclaration of target is to workaround bug in 2.4.6
-    add_custom_target(test)
-    add_dependencies(test rostest_${_testname})
-  endif("${ARGN}" STREQUAL "$ENV{ROS_BUILD_TEST_LABEL}")
+  # Redeclaration of target is to workaround bug in 2.4.6
+  add_custom_target(test)
+  add_dependencies(test rostest_${_testname})
   _rosbuild_check_rostest_result(rostest_${_testname} ${PROJECT_NAME} ${file})
 endmacro(rosbuild_add_rostest)


disabling RPM changelog, timestamp creates issues in CentOS 6.0

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -221,10 +221,10 @@
     SET(CPACK_RPM_devel_PACKAGE_ARCHITECTURE noarch)
     SET(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") # Apache Software License, Version 2.0
     SET(CPACK_RPM_PACKAGE_GROUP "Development/Libraries")
-    SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
-    STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
-    SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
-    FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
+    #SET(CPACK_RPM_CHANGELOG_FILE ${CMAKE_BINARY_DIR}/rpm_changelog.txt) # ChangeLog of the RPM
+    #STRING(TIMESTAMP CHANGELOG_DATE "%a %b %d %Y")
+    #SET(RPM_CHANGELOG "* ${CHANGELOG_DATE} Johannes Günther <johannes.guenther@intel.com> - ${EMBREE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}\n- First package")
+    #FILE(WRITE ${CPACK_RPM_CHANGELOG_FILE} ${RPM_CHANGELOG})
     SET(CPACK_RPM_PACKAGE_URL http://embree.github.io/)
     SET(CPACK_RPM_DEFAULT_DIR_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) # otherwise cmake directory has wrong 775 permissions


update vtk version for bug fix

update vtk version for bug fix

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

 add_revision(vtk
   GIT_REPOSITORY git://vtk.org/VTK.git
-  GIT_TAG 5acca0574ee3b5e2a5c6ad8b35a8ef40dd8d7e4 )
+  GIT_TAG fa9ca03e2fb4ee413e3070e05cff2206170177c4 )

 if (UNIX)
   add_revision(mpi


Change solaris macros to Solaris10 and Solaris11. #1783

We don't use Solaris210 or Solaris211.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -190,9 +190,9 @@
 	if (${OS_VER} STREQUAL "5.9")
 		add_definitions(-DSolaris29)
 	elseif(${OS_VER} STREQUAL "5.10")
-		add_definitions(-DSolaris210)
+		add_definitions(-DSolaris10)
 	elseif(${OS_VER} STREQUAL "5.11")
-		add_definitions(-DSolaris211)
+		add_definitions(-DSolaris11)
 	else()
 		message(FATAL_ERROR "unknown version of Solaris")
 	endif()


Another try with R HOME on OSX

Another try with R HOME on OSX

--- dev/cmake/Modules/FindR.cmake
+++ dev/cmake/Modules/FindR.cmake
@@ -18,9 +18,6 @@
              NAMES R
              PATHS ${R_BIN}
              )
-execute_process(
-    COMMAND ${R_EXEC} RHOME OUTPUT_VARIABLE R_HOME_TEXT RESULT_VARIABLE R_HOME_RESULT
-)
 MESSAGE(STATUS "R_EXEC= ${R_EXEC}")
 # Parse the output of the R path commmand, removing whitespace
 FUNCTION(chomp arg1 arg2)
@@ -32,9 +29,15 @@
     # see http://www.cmake.org/pipermail/cmake/2008-November/025423.html
     set(${arg2} ${arg1path} PARENT_SCOPE)
 ENDFUNCTION(chomp)
-STRING(STRIP ${R_HOME_TEXT} R_HOME_TEXT)
-MESSAGE(STATUS "R_HOME_TEXT = ${R_HOME_TEXT}")
-MESSAGE(STATUS "R_HOME_RESULT = ${R_HOME_RESULT}")
+
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/get_home.R R.home())
+execute_process(
+    COMMAND ${R_EXEC} --quiet -f ${CMAKE_CURRENT_BINARY_DIR}/get_bin.R OUTPUT_VARIABLE R_HOME_TEXT RESULT_VARIABLE R_HOME_RESULT
+)
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/get_home.R)
+MESSAGE(STATUS "R_HOME_TEXT = ${R_HOME_TEXT} w/ RESULT=${R_HOME_RESULT}")
+chomp(${R_HOME_TEXT} R_HOME_TEXT)
+
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/get_include.R R.home(component=\"include\"))
 execute_process(
     COMMAND ${R_EXEC} --quiet -f ${CMAKE_CURRENT_BINARY_DIR}/get_include.R OUTPUT_VARIABLE R_INCLUDE_TEXT RESULT_VARIABLE R_INCLUDE_RESULT


Work-around for libusb breaking changes in Master branch (v1.0.24)

Change-Id: I22d53022131041681759b89d62b1496700c07952

--- CMake/external_libusb.cmake
+++ CMake/external_libusb.cmake
@@ -3,7 +3,9 @@
 ExternalProject_Add(
     libusb

-    GIT_REPOSITORY "https://github.com/libusb/libusb.git"
+    # Work-around for libusb master broken on Nov 26' 2020 with introduction of v1.0.24
+    # the issue has been reported in https://github.com/libusb/libusb/issues/812
+    GIT_REPOSITORY "https://github.com/ev-mp/libusb.git"
     GIT_TAG "2a7372db54094a406a755f0b8548b614ba8c78ec" # "v1.0.22" + Mac get_device_list hang fix

     UPDATE_COMMAND ${CMAKE_COMMAND} -E copy_if_different


New version: 0.4.5

New version: 0.4.5

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "4")
+SET(HAWKEY_PATCH "5")


Update Version.cmake

Update Version.cmake

fixed typo
not sure why trilinos does it this way.
cmake seems to have the convention:
DataTransferKit_VERSION_MAJOR
DataTransferKit_VERSION_MINOR
DataTransferKit_VERSION_PATCH

--- Version.cmake
+++ Version.cmake
@@ -1,5 +1,5 @@
 SET(DataTransferKit_VERSION 2.0.0)
-SET(DataTransferKit_MAJOR_VERSION 1)
+SET(DataTransferKit_MAJOR_VERSION 2)
 SET(DataTransferKit_MAJOR_MINOR_VERSION 020000)
 SET(DataTransferKit_VERSION_STRING "2.0.0 (Dev)")
 SET(DataTransferKit_ENABLE_DEVELOPMENT_MODE_DEFAULT ON) # Change to 'OFF' for a release


Ignore multiple dictionaries. Build module only for the primary one.

Some libraries require more than one (primary) dictionary to be built. The
secondary dictionaries cause redefining the module entry.

In future we should combine all primary and secondary dictionary header files to
end up in the same module. However, now, in some cases we explicitly build a
secondary dictionary to avoid putting the content of a header file in a
precompiled for (eg. PCH).

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -376,9 +376,14 @@
     endif()
   endif()
   if(cxxmodules)
-    # We build libSmatrix and libGenVector for 32 and 64 bits. Both contain the
-    # same header files, ignore the 32 bit version and make the module unique.
-    if(NOT ${dictionary} MATCHES .*32 )
+    # FIXME: Support mulptiple dictionaries. In some cases (libSMatrix and
+    # libGenVector) we have to have two or more dictionaries (eg. for math,
+    # we need the two for double vs Double32_t template specializations).
+    # In some other cases, eg. libTreePlayer.so we add in a separate dictionary
+    # files which for some reason (temporarily?) cannot be put in the PCH. Eg.
+    # all rest of the first dict is in the PCH but this file is not and it
+    # cannot be present in the original dictionary.
+    if(NOT ARG_MULTIDICT)
       ROOT_CXXMODULES_APPEND_TO_MODULEMAP("${library_name}" "${rheaderfiles}")
     endif()
   endif(cxxmodules)


Fix in `find_python_module` cmake function `REQUIRED` flag; adapt function so that it prints cause of error

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -955,24 +955,28 @@
 # find_python_module(module [REQUIRED])
 #----------------------------------------------------------------------------
 function(find_python_module module)
-  string(TOUPPER ${module} module_upper)
-  if(NOT PY_${module_upper})
-    if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
-      set(${module}_FIND_REQUIRED TRUE)
-    endif()
-    # A module's location is usually a directory, but for binary modules
-    # it's a .so file.
-    execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
-      "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
-      RESULT_VARIABLE _${module}_status
-      OUTPUT_VARIABLE _${module}_location
-      ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if(NOT _${module}_status)
-      set(PY_${module_upper} ${_${module}_location} CACHE STRING  "Location of Python module ${module}")
-    endif()
-  endif()
-  find_package_handle_standard_args(PY_${module} DEFAULT_MSG PY_${module_upper})
-  set(PY_${module_upper}_FOUND ${PY_${module_upper}_FOUND} PARENT_SCOPE)
-endfunction()
-
-
+   string(TOUPPER ${module} module_upper)
+   if(NOT PY_${module_upper})
+      if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
+         set(py_${module}_FIND_REQUIRED TRUE)
+      endif()
+      # A module's location is usually a directory, but for binary modules
+      # it's a .so file.
+      execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
+         "import re, ${module}; print(re.compile('/__init__.py.*').sub('',${module}.__file__))"
+         RESULT_VARIABLE _${module}_status
+         OUTPUT_VARIABLE _${module}_location
+         ERROR_VARIABLE _${module}_error
+         OUTPUT_STRIP_TRAILING_WHITESPACE
+         ERROR_STRIP_TRAILING_WHITESPACE)
+      if(NOT _${module}_status)
+         set(PY_${module_upper} ${_${module}_location} CACHE STRING "Location of Python module ${module}")
+      else(NOT _${module}_status)
+         message(STATUS "Failed to find Python module ${module}: ${_${module}_error}")
+      endif()
+   endif()
+   find_package_handle_standard_args(py_${module} DEFAULT_MSG PY_${module_upper})
+   set(PY_${module_upper}_FOUND ${PY_${module_upper}_FOUND} PARENT_SCOPE)
+endfunction()
+
+


New CMake option to force build w/o Phidgets

--- cmakemodules/script_phidget.cmake
+++ cmakemodules/script_phidget.cmake
@@ -1,17 +1,20 @@
 # Support for phidget Interface Kit with proximity sensor device :
 # =================================================================

-find_package(PHIDGETS QUIET)
-## Defines:
-## - PHIDGETS_FOUND
-## - PHIDGETS_INCLUDE_DIR
-## - PHIDGETS_LIBRARIES
-
+OPTION(DISABLE_PHIDGETS "Forces NOT using PHIDGETSlibs, even if they are found by CMake" "OFF")
+MARK_AS_ADVANCED(DISABLE_PHIDGETS)
 SET(CMAKE_MRPT_HAS_PHIDGET 0)
 SET(CMAKE_MRPT_HAS_PHIDGET_SYSTEM 0)

-IF(PHIDGETS_FOUND)
-	SET(CMAKE_MRPT_HAS_PHIDGET 1)
-	SET(CMAKE_MRPT_HAS_PHIDGET_SYSTEM 1)
-ENDIF(PHIDGETS_FOUND)
+IF(NOT PHIDGETS)
+	find_package(PHIDGETS QUIET)
+	## Defines:
+	## - PHIDGETS_FOUND
+	## - PHIDGETS_INCLUDE_DIR
+	## - PHIDGETS_LIBRARIES

+	IF(PHIDGETS_FOUND)
+		SET(CMAKE_MRPT_HAS_PHIDGET 1)
+		SET(CMAKE_MRPT_HAS_PHIDGET_SYSTEM 1)
+	ENDIF(PHIDGETS_FOUND)
+ENDIF()


Improve the path-finding for FindSUNDIALS.cmake.

This fixes an issue where if SUNDIALS_DIR is never set then SUN_INC is just
'/include/', which is usually not a directory.

--- cmake/modules/FindSUNDIALS.cmake
+++ cmake/modules/FindSUNDIALS.cmake
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2015-2016 by the deal.II authors
+## Copyright (C) 2017 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -18,9 +18,21 @@
 #
 # This module exports
 #
-#   SUNDIALS_LIBRARIES
-#   SUNDIALS_INCLUDE_DIRS
+#   SUNDIALS_LIB_IDA
+#   SUNDIALS_LIB_KINSOL
+#   SUNDIALS_LIB_PAR
+#   SUNDIALS_LIB_SER
+#   SUNDIALS_INCLUDE_DIR
 #
+# Note that, unlike most other packages, SUNDIALS headers are typically
+# installed in multiple directories; for example, a typical system installation
+# may distribute the headers in the following way:
+#
+# /usr/include/ida/ida.h
+# /usr/include/kinsol/kinsol.h
+# /usr/include/sundials/sundials_nvector.h
+#
+# so, in this case, SUNDIALS_INCLUDE_DIR would just be /usr/include/.

 SET(SUNDIALS_DIR "" CACHE PATH "An optional hint to a SUNDIALS_DIR installation")
 SET_IF_EMPTY(SUNDIALS_DIR "$ENV{SUNDIALS_DIR}")
@@ -40,7 +52,19 @@
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )

-SET(SUN_INC "${SUNDIALS_DIR}/include")
+#
+# only define the extra hint if ${SUNDIALS_DIR} is nonempty so that we do not
+# try to search through the top-level '/include/' directory, should it happen to
+# exist
+#
+STRING(COMPARE EQUAL "${SUNDIALS_DIR}" "" _sundials_dir_is_empty)
+IF(NOT ${_sundials_dir_is_empty})
+  SET(_sundials_include_hint_dir "${SUNDIALS_DIR}/include/")
+ENDIF()
+
+DEAL_II_FIND_PATH(SUNDIALS_INCLUDE_DIR sundials/sundials_nvector.h
+  HINTS ${SUNDIALS_DIR} "${_sundials_include_hint_dir}"
+)

 SET(_sundials_additional_libs)
 IF(DEAL_II_WITH_MPI)
@@ -55,8 +79,8 @@
   LIBRARIES REQUIRED
     SUNDIALS_LIB_IDA SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
     ${_sundials_additional_libs}
-  INCLUDE_DIRS REQUIRED SUN_INC
-  USER_INCLUDE_DIRS REQUIRED SUN_INC
+  INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
+  USER_INCLUDE_DIRS REQUIRED SUNDIALS_INCLUDE_DIR
   CLEAR
     SUNDIALS_LIB_IDA SUNDIALS_LIB_KINSOL SUNDIALS_LIB_SER SUNDIALS_LIB_PAR
     SUN_INC


cmake nuttx stackcheck fix for current master

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -204,7 +204,7 @@

 	# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
 	# note: CONFIG will be BOARD in the future evaluation of ${hw_stack_check_${CONFIG}
-	file(STRINGS "${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/${config_nuttx_config}/defconfig"
+	file(STRINGS "${CMAKE_SOURCE_DIR}/nuttx-configs/${CONFIG}/nsh/defconfig"
 		hw_stack_check_${CONFIG}
 		REGEX "CONFIG_ARMV7M_STACKCHECK=y"
 		)


Fix chromium_zlib as ZLIB (#75)

Fix chromium_zlib as ZLIB (#75)

--- cmake/projects/ZLIB/hunter.cmake
+++ cmake/projects/ZLIB/hunter.cmake
@@ -89,17 +89,23 @@
     PACKAGE_NAME
     ZLIB
     VERSION
-    "0.0.0-chromium-f87c2b10efb4-p1"
+    "0.0.0-chromium-f87c2b10efb4-p2"
     URL
-    "https://github.com/cpp-pm/chromium_zlib/archive/v0.0.0-f87c2b10efb4-p1.tar.gz"
+    "https://github.com/cpp-pm/chromium_zlib/archive/v0.0.0-f87c2b10efb4-p2.tar.gz"
     SHA1
-    c11a03c2db12d8af908c91a8dfd0f75e44c90e47
+    20019f1dbfb154956067aa1df0e73e5185d794fa
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(ZLIB)
 string(FIND "${HUNTER_ZLIB_VERSION}" "chromium" HUNTER_ZLIB_IS_CHROMIUM)
-if(HUNTER_ZLIB_IS_CHROMIUM EQUAL -1)
+if(NOT HUNTER_ZLIB_IS_CHROMIUM EQUAL -1)
+  # Is a chromium variant
+  hunter_download(PACKAGE_NAME ZLIB
+    PACKAGE_INTERNAL_DEPS_ID "1"
+  )
+else()
+  # Is a standard variant
   hunter_download(PACKAGE_NAME ZLIB
     PACKAGE_INTERNAL_DEPS_ID "1"
     PACKAGE_UNRELOCATABLE_TEXT_FILES


Remove tabs and trailing whitespaces

Remove tabs and trailing whitespaces

--- cmake/projects/half/hunter.cmake
+++ cmake/projects/half/hunter.cmake
@@ -15,11 +15,11 @@
     PACKAGE_NAME
     half
     VERSION
-	"1.1.0-p0"
+    "1.1.0-p0"
     URL
-	"https://github.com/headupinclouds/half/archive/v1.1.0-p0.tar.gz"
+    "https://github.com/headupinclouds/half/archive/v1.1.0-p0.tar.gz"
     SHA1
-	ad46279b4baf5e819881e66303bb20f88d6df916
+    ad46279b4baf5e819881e66303bb20f88d6df916
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


formatting

formatting

--- cmake/Cuti.cmake
+++ cmake/Cuti.cmake
@@ -25,8 +25,6 @@
 	get_filename_component(CUTI_SOURCE ${CUTI_TOP_DIR}src/Cuti.mm ABSOLUTE)
 	set_source_files_properties(${CUTI_SOURCE} PROPERTIES COMPILE_FLAGS "-x objective-c++")
 ENDIF(USE_CUTI_INTEGRATION AND APPLE)
-
-

 function(cuti_xctest_add_bundle target testee)
   if(NOT XCTest_FOUND)
@@ -77,9 +75,6 @@
   endif()
 endfunction(cuti_xctest_add_bundle)

-
-
-
 function(cuti_creates_test_target target testee)
 	IF(USE_CUTI_INTEGRATION AND APPLE)
 		find_package(XCTest REQUIRED)


CMake: add a warning when LLVM can't recognize the host CPU

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -590,6 +590,10 @@
   endif()
 endif()

+if(LLC_HOST_CPU MATCHES "unknown")
+  message(FATAL_ERROR "LLVM could not recognize your CPU model automatically. Please rerun cmake with -DLLC_HOST_CPU=<model> (to see a list of models, try: llc -mcpu help)")
+endif()
+
 set(LLC_HOST_CPU "${LLC_HOST_CPU}" CACHE STRING "The Host CPU to use with llc")

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


Add /bigobj MSVC option to compile OSPRayScriptHandler.cpp

--- cmake/msvc.cmake
+++ cmake/msvc.cmake
@@ -14,7 +14,7 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

-SET(COMMON_CXX_FLAGS "/EHsc /MP /GR ")
+SET(COMMON_CXX_FLAGS "/EHsc /MP /GR /bigobj ")

 SET(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} ${COMMON_CXX_FLAGS}")
 SET(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE}        ${COMMON_CXX_FLAGS} /Ox /fp:fast /Oi /Gy ")


valgrind tool flags

valgrind tool flags

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -299,8 +299,8 @@
       COMMAND "${VALGRIND_EXECUTABLE}"
               --tool=bbv
               --log-file="${EXECUTABLE_OUTPUT_PATH}/bbv.log.${testname}.${instance}"
-              --bb-log-file="${EXECUTABLE_OUTPUT_PATH}/bbv.bb.out.${testname}.${instance}"
-              --pc-log-file="${EXECUTABLE_OUTPUT_PATH}/bbv.pc.log.${testname}.${instance}"
+              --bb-out-file="${EXECUTABLE_OUTPUT_PATH}/bbv.bb.out.${testname}.${instance}"
+              --pc-out-file="${EXECUTABLE_OUTPUT_PATH}/bbv.pc.log.${testname}.${instance}"
               ${TEST_RUNNER}
               "${EXECUTABLE_OUTPUT_PATH}/test-${testname}"
               ${instance}


Fix borsch v2 script

Fix borsch v2 script

--- cmake/util.cmake
+++ cmake/util.cmake
@@ -85,11 +85,7 @@
         set(STATIC_PREFIX "static-")
     endif()

-    if(BUILD_SHARED_LIBS OR OSX_FRAMEWORK)
-        set(${name} ${PROJECT_NAME}-${STATIC_PREFIX}${ver}-${COMPILER} PARENT_SCOPE)
-    else()
-        set(${name} ${PROJECT_NAME}-${STATIC_PREFIX}${ver}-STATIC-${COMPILER} PARENT_SCOPE)
-    endif()
+    set(${name} ${PROJECT_NAME}-${STATIC_PREFIX}${ver}-${COMPILER} PARENT_SCOPE)
 endfunction()

 function(get_compiler_version ver)


Silence GCC 9 warnings coming from Google Test headers

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1439,6 +1439,10 @@
   foreach (lib gtest gtest_main gmock gmock_main)
     add_library(${lib} IMPORTED STATIC GLOBAL)
     add_dependencies(${lib} googletest)
+    if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
+        ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 9)
+      target_compile_options(${lib} INTERFACE -Wno-deprecated-copy)
+    endif()
   endforeach()
   set_property(TARGET gtest PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
   set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX})


Add comment

Add comment

[skip ci]

--- cmake/modules/hunter_generate_qt_info.cmake
+++ cmake/modules/hunter_generate_qt_info.cmake
@@ -8,6 +8,10 @@

 # See cmake/projects/Qt/generate.sh

+# Notes:
+# * We need full list of dependencies on configuration step (see `qt-configure`)
+#   hence the `depends_on` should contains implicit dependencies too
+#   (dependencies of dependencies).
 function(
     hunter_generate_qt_info
     component_name


Added tool check in UseBuzz.cmake.

Added tool check in UseBuzz.cmake.

--- src/utility/UseBuzz.cmake
+++ src/utility/UseBuzz.cmake
@@ -17,11 +17,15 @@
 # files that should trigger re-compilation if modified, the option
 # DEPENDENCIES should be used.
 #
+# ::
+#
 # The compilation process looks for include files using the path lists
 # specified in these variables:
 #
 # 1. the environment variable BUZZ_INCLUDE_PATH
 # 2. the CMake variable BUZZ_INCLUDE_PATH
+#
+# ::
 #
 # The Buzz tools are assumed already detected through
 # FindBuzz.cmake. However, you can also manually set following the
@@ -35,7 +39,14 @@
 # Copyright 2016 Carlo Pinciroli <carlo@pinciroli.net>
 #=============================================================================

+#
+# make_buzz() function definition
+#
 function(make_buzz _SCRIPT)
+  # Make sure tool paths have been set
+  if("${BUZZ_COMPILER}" STREQUAL "" OR "${BUZZ_PARSER}" STREQUAL "" OR "${BUZZ_ASSEMBLER}" STREQUAL "")
+    message(FATAL_ERROR "make_buzz('${_SCRIPT}'): use Find_Package(Buzz) to look for Buzz tools before calling make_buzz().")
+  endif(${BUZZ_COMPILER} STREQUAL "" OR ${BUZZ_PARSER} STREQUAL "" OR ${BUZZ_ASSEMBLER} STREQUAL "")
   # Make sure _SCRIPT ends with .bzz
   get_filename_component(_make_buzz_EXT "${_SCRIPT}" EXT)
   if(NOT _make_buzz_EXT STREQUAL ".bzz")


DOC: Add link to the IJ article in the module documentation.

--- itk-module.cmake
+++ itk-module.cmake
@@ -1,4 +1,11 @@
-set(DOCUMENTATION "This module implements Anisotropic Diffusion, using Lattice Basis Reduction.")
+set(DOCUMENTATION "This module implements Anisotropic Diffusion, using Lattice Basis Reduction.
+
+Documentation can be found in the Insight Journal article, 'Anisotropic
+Diffusion in ITK', by Mirebeau J., Fehrenbach J., Risser L., Tobji S.
+
+http://insight-journal.org/browse/publication/953
+http://hdl.handle.net/10380/3505
+")

 # itk_module() defines the module dependencies in ITKAnisotropicFastMarchingLBR;
 # ITKAnisotropicFastMarchingLBR depends on ITKCommon;


Switch back to vmtk/master

Switch back to vmtk/master

Regression that caused build errors was fixed.

--- SuperBuild/External_VMTK.cmake
+++ SuperBuild/External_VMTK.cmake
@@ -23,10 +23,8 @@

   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
-    #GIT_REPOSITORY "${git_protocol}://github.com/vmtk/vmtk.git"
-    #GIT_TAG "2cecfb427a45bbb5240de687929954c60ebab06f" # "more debugging test for mac os 10.13" (58c8829) commit broke Python wrapping, so we need to use the one before
-    GIT_REPOSITORY "${git_protocol}://github.com/rlizzo/vmtk"
-    GIT_TAG "slicer-fix"
+    GIT_REPOSITORY "${git_protocol}://github.com/vmtk/vmtk.git"
+    GIT_TAG "master"
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build
     CMAKE_CACHE_ARGS


Improve test info output some (#363, #702)

Makes it a little more clear what is going on with these checks.

--- utils/tests/run_wikize_ref_diff_test.cmake
+++ utils/tests/run_wikize_ref_diff_test.cmake
@@ -107,7 +107,7 @@
 if (NOT EXPECTED_OUTPUT_FILE STREQUAL "")
   diff_files("${EXPECTED_OUTPUT_FILE}" "${OUTPUT_FILE}")
 else()
-  message("Skipping diff of output file since none given!")
+  message("Skipping diff of output file since no expected output given!")
 endif()

 # E) Compared the saved input file
@@ -117,9 +117,10 @@
 if (COMPARE_SAVED_INPUT_FILE)
   diff_files( "${INPUT_FILE}" "${savedInputFileName}")
 else()
-  message("Ensure that saved input file '${savedInputFileName}' does not exist!")
   if (EXISTS "${savedInputFileName}")
     message(FATAL_ERROR "The saved input file '${savedInputFileName}' exists when it should not!")
+  else()
+    message("Saved input file '${savedInputFileName}' does not exist!")
   endif()
 endif()


ARROW-5219: [C++] Build protobuf_ep in parallel when using Ninja build

I noticed this when looking at ARROW-5192

Author: Wes McKinney <wesm+git@apache.org>

Closes #4208 from wesm/ARROW-5219 and squashes the following commits:

8c5560f1 <Wes McKinney> Build protobuf_ep in parallel when using Ninja build

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1047,6 +1047,9 @@
                       CONFIGURE_COMMAND
                       "./configure"
                       ${PROTOBUF_CONFIGURE_ARGS}
+                      BUILD_COMMAND
+                      ${MAKE}
+                      ${MAKE_BUILD_ARGS}
                       BUILD_IN_SOURCE
                       1
                       URL


ARROW-8104: [C++] Don't install bundled Thrift

If we don't specify nonexistent variable ("${THRIFT_COMPILER}") to
BUILD_BYPRODUCTS, install process for bundled Thrift always runs. It
means that "DESTDIR=/tmp/xxx ninja install" installs bundled Thrift to
"/tmp/xxx/...".

Closes #6606 from kou/cpp-dont-install-bundled-thrift

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1016,7 +1016,7 @@

 macro(build_thrift)
   message("Building Apache Thrift from source")
-  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep/src/thrift_ep-install")
+  set(THRIFT_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/thrift_ep-install")
   set(THRIFT_INCLUDE_DIR "${THRIFT_PREFIX}/include")
   set(THRIFT_CMAKE_ARGS
       ${EP_COMMON_CMAKE_ARGS}
@@ -1081,7 +1081,7 @@
   externalproject_add(thrift_ep
                       URL ${THRIFT_SOURCE_URL}
                       URL_HASH "MD5=${ARROW_THRIFT_BUILD_MD5_CHECKSUM}"
-                      BUILD_BYPRODUCTS "${THRIFT_STATIC_LIB}" "${THRIFT_COMPILER}"
+                      BUILD_BYPRODUCTS "${THRIFT_STATIC_LIB}"
                       CMAKE_ARGS ${THRIFT_CMAKE_ARGS}
                       DEPENDS ${THRIFT_DEPENDENCIES} ${EP_LOG_OPTIONS})


Rename the BALLView installer executable if RTfact is enabled

--- cmake/BALLPackageConfig.cmake
+++ cmake/BALLPackageConfig.cmake
@@ -19,6 +19,7 @@
 	SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}\\\\data\\\\graphics\\\\installer_header.bmp")
 	SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\BALLView.exe")
 	IF (BALL_HAS_RTFACT)
+		SET(CPACK_PACKAGE_NAME "BALL-RT")
 		SET(CPACK_NSIS_DISPLAY_NAME "BALLView-RT-${CPACK_PACKAGE_VERSION}")
 	ELSE()
 		SET(CPACK_NSIS_DISPLAY_NAME "BALLView-${CPACK_PACKAGE_VERSION}")


[cmake] Fix missing hiredis libs when using only REDIS_CLIENT

The CMake find_package() rule was being invoked only when REDIS_SERVER
was set, causing linking errors when libjson-rpc-cpp was built with
REDIS_CLIENT only:

../../lib/libjsonrpccpp-client.so.1.0.0: undefined reference to `freeReplyObject'
../../lib/libjsonrpccpp-client.so.1.0.0: undefined reference to `redisFree'
../../lib/libjsonrpccpp-client.so.1.0.0: undefined reference to `redisCommand'
../../lib/libjsonrpccpp-client.so.1.0.0: undefined reference to `redisConnect'
collect2: error: ld returned 1 exit status

Fix the logic to search for redis also when REDIS_CLIENT is set, so that
the variables are filled correctly in.

--- cmake/CMakeDependencies.cmake
+++ cmake/CMakeDependencies.cmake
@@ -53,7 +53,7 @@
 endif()

 # find hiredis
-if (${REDIS_SERVER})
+if (${REDIS_SERVER} OR ${REDIS_CLIENT})

     find_package(Hiredis REQUIRED)
     message(STATUS "Hiredis header: ${HIREDIS_INCLUDE_DIRS}")


[CMAKE] Make clang-tidy fail the build rather than trying to auto-fix

Summary:
The current behavior when the clang-tidy option is enabled is to attempt
to auto-fix the issues. This is not the best approach:
 - It does not work for all the rules;
 - It makes other warnings (not auto-fixable) difficult to spot.
This diff changes the behavior to cause clang-tidy to fail the build
when an issue is encountered, by promoting the warnings to errors. This
will prevent the user from missing a warning which is not auto-fixed.

Note: this option could be set in the .clang-tidy configuration file,
but it seems to have a bug and enable all the checks which is not the
expected behavior.

Test Plan:
  cmake -GNinja .. \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DENABLE_CLANG_TIDY=ON
  ninja all check
Add some braces issues, then:
  ninja
Check that the build fail with a clang-tidy error.

Reviewers: #bitcoin_abc, majcosta

Reviewed By: #bitcoin_abc, majcosta

Differential Revision: https://reviews.bitcoinabc.org/D7538

--- cmake/modules/ClangTidy.cmake
+++ cmake/modules/ClangTidy.cmake
@@ -16,7 +16,7 @@
 	message(STATUS "Using clang-tidy: ${CLANG_TIDY_EXE} (version ${CLANG_TIDY_VERSION})")
 endif()

-set(CLANG_TIDY_ARGS "${CLANG_TIDY_EXE}" -fix)
+set(CLANG_TIDY_ARGS "${CLANG_TIDY_EXE}" -warnings-as-errors=*)

 set(CMAKE_C_CLANG_TIDY ${CLANG_TIDY_ARGS})
 set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_ARGS})


[cmake][list] Add utilities to SwiftList.cmake for using cmake lists as sets.

This will allow for one to work with sets in cmake in a much cleaner
fashion.

--- cmake/modules/SwiftList.cmake
+++ cmake/modules/SwiftList.cmake
@@ -1,3 +1,5 @@
+include(SwiftUtils)
+
 function(list_subtract lhs rhs result_var_name)
   set(result)
   foreach(item IN LISTS lhs)
@@ -60,3 +62,33 @@
   set("${input_list}" "${replaced_list}" PARENT_SCOPE)
 endfunction()

+function(list_has_duplicates l outvar)
+  set(LCOPY "${l}")
+  list(REMOVE_DUPLICATES "${LCOPY}")
+  list(LENGTH l L_LENGTH)
+  list(LENGTH LCOPY LCOPY_LENGTH)
+
+  if (${L_LENGTH} EQUAL ${LCOPY_LENGTH})
+    set(${outvar} FALSE PARENT_SCOPE)
+  else()
+    set(${outvar} TRUE PARENT_SCOPE)
+  endif()
+endfunction()
+
+function(precondition_list_is_set l)
+  list_has_duplicates(${l} HAS_DUPLICATES)
+  precondition(HAS_DUPLICATES NEGATE
+    MESSAGE "List ${l} has duplicate elements and thus is not a set. Contents: ${${l}}")
+endfunction()
+
+function(precondition_list_is_disjoint)
+  set(TOP)
+  foreach(l ${ARGN})
+    # First do a precondition check that TOP and l are disjoint.
+    list_intersect(TOP l TOP_L_INTERSECTION)
+    list(LENGTH TOP_L_INTERSECTION TOP_L_INTERSECTION_LENGTH)
+    precondition_binary_op(EQUAL ${TOP_L_INTERSECTION_LENGTH} 0)
+    # Then union l into TOP so that we can check the next list.
+    list_union(TOP l TOP)
+  endforeach()
+endfunction()


* Merged changes ONLY eAthena 15107.

* Merged changes ONLY eAthena 15107.

git-svn-id: c1e39603916b71782cde5facdf0b79eff05c1414@16172 54d463be-8e91-2dee-dedb-b68131a5f0ec

--- 3rdparty/cmake/FindMYSQL.cmake
+++ 3rdparty/cmake/FindMYSQL.cmake
@@ -1,4 +1,4 @@
-# - Find mysqlclient
+# - Find libmysql/mysqlclient
 # Find the native MySQL includes and library
 #
 #  MYSQL_INCLUDE_DIRS - where to find mysql.h, etc.
@@ -15,7 +15,7 @@
 		"$ENV{SYSTEMDRIVE}/MySQL/*/include" )

 find_library( MYSQL_LIBRARIES
-	NAMES "mysqlclient" "mysqlclient_r"
+	NAMES "libmysql" "mysqlclient" "mysqlclient_r"
 	PATHS
 		"/usr/lib/mysql"
 		"/usr/local/lib/mysql"


add Mathematica 11.3 to list of supported versions

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -244,7 +244,10 @@
 	# Mathematica products in order of preference
 	set (_MathematicaApps "Mathematica" "gridMathematica Server")
 	# Mathematica product versions in order of preference
-	set (_MathematicaVersions "11.2" "11.1" "11.0" "10.4" "10.3" "10.2" "10.1" "10.0" "9.0" "8.0" "7.0" "6.0" "5.2")
+	set (_MathematicaVersions
+		"11.3" "11.2" "11.1" "11.0"
+		"10.4" "10.3" "10.2" "10.1" "10.0"
+		"9.0" "8.0" "7.0" "6.0" "5.2")
 	# search for explicitly requested application version first
 	if (Mathematica_FIND_VERSION AND Mathematica_FIND_VERSION_EXACT)
 		foreach (_product IN LISTS _MathematicaApps)


start version 3.3.0

start version 3.3.0

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -34,7 +34,7 @@
 cmake_policy(POP)

 set (Mathematica_CMAKE_MODULE_DIR "${CMAKE_CURRENT_LIST_DIR}")
-set (Mathematica_CMAKE_MODULE_VERSION "3.2.7")
+set (Mathematica_CMAKE_MODULE_VERSION "3.3.0")

 # activate select policies
 if (POLICY CMP0025)


Revert "BUG: #1761: fix openMP linker flag"

This reverts commit ec9dc6a9b858d68c8be3d442bd75efbc55149214.

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -288,8 +288,6 @@
     set(OTB_REQUIRED_CXX_FLAGS "${OTB_REQUIRED_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
     if(OpenMP_EXE_LINKER_FLAGS)
       set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
-    else()
-      set(OTB_REQUIRED_LINK_FLAGS "${OTB_REQUIRED_LINK_FLAGS} ${OpenMP_CXX_FLAGS}")
     endif()
   endif()


Propagate cmake vs platform related cmake variables to sub-projects

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -267,6 +267,9 @@
   CMAKE_GENERATOR_INSTANCE
   CMAKE_GENERATOR_PLATFORM
   CMAKE_GENERATOR_TOOLSET
+  CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE
+  CMAKE_VS_PLATFORM_TOOLSET_VERSION
+  CMAKE_VS_PLATFORM_TOOLSET
   CMAKE_EXTRA_GENERATOR
   MEMORYCHECK_COMMAND_OPTIONS
   MEMORYCHECK_SUPPRESSIONS_FILE


exporting TBB-targets when building static library

--- common/cmake/installTBB.cmake
+++ common/cmake/installTBB.cmake
@@ -1,5 +1,10 @@
 ## Copyright 2009-2020 Intel Corporation
 ## SPDX-License-Identifier: Apache-2.0
+
+IF (EMBREE_STATIC_LIB)
+  INSTALL(TARGETS TBB EXPORT TBB-targets)
+  INSTALL(EXPORT TBB-targets DESTINATION ${EMBREE_CMAKEEXPORT_DIR} COMPONENT devel)
+ENDIF()

 IF (EMBREE_INSTALL_DEPENDENCIES)
   IF (TARGET TBB::tbb)


[runSofa] FIX plugin config copy on Windows (#451)

* [runSofa] FIX plugin config copy on Windows

"${CMAKE_BINARY_DIR}/bin/$<CONFIG>/" does not exist
if using MSVC without Visual Studio IDE

* [runSofa] ADD comment for plugin config fix


Fix FindUrho3D.cmake module to consider MinGW as multilib compiler. Fix #1527.

--- CMake/Modules/FindUrho3D.cmake
+++ CMake/Modules/FindUrho3D.cmake
@@ -170,7 +170,7 @@
     set (URHO3D_LIB_TYPE_SAVED ${URHO3D_LIB_TYPE})  # We need this to reset the auto-discovered URHO3D_LIB_TYPE variable before looping
     foreach (ABI_64BIT RANGE ${URHO3D_64BIT} 0)
         # Break if the compiler is not multilib-capable and the ABI is not its native
-        if ((MSVC OR MINGW OR ANDROID OR ARM OR WEB) AND NOT ABI_64BIT EQUAL NATIVE_64BIT)
+        if ((MSVC OR ANDROID OR ARM OR WEB) AND NOT ABI_64BIT EQUAL NATIVE_64BIT)
             break ()
         endif ()
         # Set to search in 'lib' or 'lib64' based on the ABI being tested
@@ -223,7 +223,7 @@
         if (URHO3D_COMPILE_RESULT)
             break ()    # Use the cached result instead of redoing try_run() each time
         elseif (URHO3D_LIBRARIES)
-            if (NOT (MSVC OR MINGW OR ANDROID OR ARM OR WEB OR XCODE) AND NOT ABI_64BIT)
+            if (NOT (MSVC OR ANDROID OR ARM OR WEB OR XCODE) AND NOT ABI_64BIT)
                 set (COMPILER_32BIT_FLAG -m32)
             endif ()
             # Below variables are loop invariant but there is no harm to keep them here


SVN_SILENT made messages (.desktop file)

--- plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
+++ plugins/morse/ktpaccountskcm_plugin_morse.desktop.cmake
@@ -1,6 +1,12 @@
 [Desktop Entry]
 Encoding=UTF-8
 Comment=Custom account configuration user interface for accounts using the Morse connection manager.
+Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Morse.
+Comment[nl]=Gebruikersinterface voor aangepaste accountconfiguratie voor accounts die de Morse verbindingenbeheerder gebruiken.
+Comment[pt]=Interface de utilizador de configuração de contas personalizadas com o gestor de ligações Morse.
+Comment[sv]=Användargränssnitt för anpassad kontoinställning av konton som använder anslutningshanteraren Morse.
+Comment[uk]=Інтерфейс користувача для нетипового налаштовування облікового запису за допомогою керування з’єднаннями Morse.
+Comment[x-test]=xxCustom account configuration user interface for accounts using the Morse connection manager.xx
 Type=Service
 ServiceTypes=KTpAccountsKCM/AccountUiPlugin


query replace: clang => clang-omp

query replace: clang => clang-omp

--- libcxx-omp.cmake
+++ libcxx-omp.cmake
@@ -1,16 +1,16 @@
 # Copyright (c) 2013, Ruslan Baratov
 # All rights reserved.

-if(DEFINED POLLY_CLANG_LIBCXX_CXX11_CMAKE)
+if(DEFINED POLLY_CLANG_OMP_LIBCXX_CXX11_CMAKE)
   return()
 else()
-  set(POLLY_CLANG_LIBCXX_CXX11_CMAKE 1)
+  set(POLLY_CLANG_OMP_LIBCXX_CXX11_CMAKE 1)
 endif()

 include("${CMAKE_CURRENT_LIST_DIR}/utilities/polly_init.cmake")

 polly_init(
-    "clang / LLVM Standard C++ Library (libc++) / c++11 support"
+    "clang-omp / LLVM Standard C++ Library (libc++) / c++11 support"
     "Unix Makefiles"
 )


OSX: Introduce backwards compatibility to v10.7

* By optionally linking to the OS X v10.7 SDK, we can distribute
binaries that run from that OS version onwards

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -5,6 +5,19 @@

   option ( FRAMEWORK "Build OSX Framework instead of dylib" on )
   option ( UNIVERSAL "Build as an OSX Universal Library" off )
+
+  # Setup the SDK selection for backwards compatibility
+  set ( SDKVER "10.7" )
+  set ( DEVROOT "/Applications/Developer/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer" )
+  set ( SDKROOT "${DEVROOT}/SDKs/MacOSX${SDKVER}.sdk" )
+
+  if ( EXISTS ${SDKROOT} )
+    set ( CMAKE_OSX_SYSROOT "${SDKROOT}" )
+    set ( CMAKE_OSX_DEPLOYMENT_TARGET "${SDKVER}" )
+    set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${SDKVER}" )
+  else () # Mac OS X v10.5 SDK not found -- that's OK
+    message ( WARNING "Warning, Mac OS X ${SDKVER} SDK path not found: ${SDKROOT}" )
+  endif ( EXISTS ${SDKROOT} )

   # libc++ requires OSX v10.7+
   set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++" )
@@ -38,11 +51,10 @@

   message ( STATUS "Platform: Windows" )
 else () # Not Linux nor OSX
+
   set ( PLATFORM_UNKNOWN true )
+  message ( STATUS "Platform: Unknown" )

-  # Use whatever CMake gathers for us and pray for the best!
-
-  message ( STATUS "Platform: Unknown" )
 endif ( CMAKE_SYSTEM_NAME STREQUAL "Darwin" )

 message ( STATUS "Generating build files for: ${CMAKE_GENERATOR}" )
@@ -60,9 +72,9 @@
   set ( PLATFORM_ARCH "x86; x64" ) # Reserved for future use

 else ( NOT UNIVERSAL )
-  # TODO: We should probably consider bumping the architecture down to i386 $(ARCHS_STANDARD_32_BIT)
   set ( CMAKE_OSX_ARCHITECTURES x86_64 )
   set ( PLATFORM_ARCH "x64" ) # Reserved for future use
+
 endif ( UNIVERSAL )

 if ( PLATFORM_WINDOWS AND ARCH_32 )


Fix error with cmake 2.6

Fix error with cmake 2.6

--- cmake/readline.cmake
+++ cmake/readline.cmake
@@ -197,11 +197,11 @@
     # Handle mutual exclusion of WITH_READLINE/WITH_LIBEDIT variables
     # We save current setting to recognize when user switched between
     # WITH_READLINE and WITH_LIBEDIT
-    IF(WITH_READLINE AND SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
-      OR NOT SAVE_READLINE_SETTING )
+    IF(WITH_READLINE AND (SAVE_READLINE_SETTING MATCHES "WITH_LIBEDIT"
+      OR NOT SAVE_READLINE_SETTING))
       SET(WITH_LIBEDIT OFF CACHE BOOL "Use bundled libedit" FORCE)
-    ELSEIF(WITH_LIBEDIT AND SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
-      OR NOT SAVE_READLINE_SETTING )
+    ELSEIF(WITH_LIBEDIT AND (SAVE_READLINE_SETTING MATCHES "WITH_READLINE"
+      OR NOT SAVE_READLINE_SETTING))
       SET(WITH_READLINE OFF CACHE BOOL "Use bundled readline" FORCE)
     ENDIF()


From Torben Dannhauer, "originally I posted the addendum of 'freetype244MT', but that was wrong.
I updated it to the correct addendum of 'freetype244' yesterday, but supposedly that was not forwarded to you by the forum-to-mail-gateway.

Find attached the corrected CMake module. "

--- CMakeModules/Find3rdPartyDependencies.cmake
+++ CMakeModules/Find3rdPartyDependencies.cmake
@@ -59,7 +59,7 @@

 MACRO(SEARCH_3RDPARTY OSG_3RDPARTY_BIN)
         FIND_DEPENDENCY(TIFF tiff.h libtiff ${OSG_3RDPARTY_BIN} "D" "_i")
-        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244MT;" ${OSG_3RDPARTY_BIN} "d" "")
+        FIND_DEPENDENCY(FREETYPE ft2build.h "freetype;freetype2311MT;freetype234;freetype234MT;freetype235;freetype237;freetype238;freetype244;" ${OSG_3RDPARTY_BIN} "d" "")
         IF(FREETYPE_FOUND)
             #forcing subsequent FindFreeType stuff to not search for other variables.... kind of a hack
             SET(FREETYPE_INCLUDE_DIR_ft2build ${FREETYPE_INCLUDE_DIR} CACHE PATH "" FORCE)


Deactivated ToFImageRecorderTest

Deactivated ToFImageRecorderTest

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -19,7 +19,7 @@
   mitkToFCameraPMDPlayerDeviceTest.cpp
   mitkToFImageCsvWriterTest.cpp
   mitkToFImageGrabberTest.cpp
-  mitkToFImageRecorderTest.cpp
+  #mitkToFImageRecorderTest.cpp
   #mitkToFImageRecorderFilterTest.cpp
   mitkToFImageWriterTest.cpp
   #mitkToFNrrdImageWriterTest.cpp


set CTEST_SCM_TOOL variable only if git is found

--- ctest_ext.cmake
+++ ctest_ext.cmake
@@ -44,7 +44,7 @@
     return()
 endif()
 set(CTEST_EXT_INCLUDED TRUE)
-set(CTEST_EXT_VERSION  0.6.1)
+set(CTEST_EXT_VERSION  0.6.2)

 #
 # Auxiliary modules
@@ -180,9 +180,6 @@
     set_ifndef(CTEST_NOTES_LOG_FILE     "${CTEST_DASHBOARD_ROOT}/ctest_ext_notes_log.txt")

     set_ifndef(CTEST_WITH_UPDATE        FALSE)
-    if(EXISTS "${CTEST_SOURCE_DIRECTORY}/.git" OR DEFINED CTEST_PROJECT_GIT_URL)
-        set_ifndef(CTEST_SCM_TOOL       "GIT")
-    endif()

     #
     # Locate tools
@@ -193,6 +190,10 @@
         if(GIT_FOUND)
             ctest_ext_info("Found git : ${GIT_EXECUTABLE} (version ${GIT_VERSION_STRING})")
             set_ifndef(CTEST_GIT_COMMAND "${GIT_EXECUTABLE}")
+
+            if(EXISTS "${CTEST_SOURCE_DIRECTORY}/.git" OR DEFINED CTEST_PROJECT_GIT_URL)
+                set_ifndef(CTEST_SCM_TOOL       "GIT")
+            endif()
         endif()
     endif()