[compiler-rt CMake] NFC: Minor CMake refactoring.

Change macro to a function, and use a generic variable instead of
branching for handling multi-output build with
CMAKE_CONFIGURATION_TYPES.

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

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

--- cmake/Modules/CompilerRTCompile.cmake
+++ cmake/Modules/CompilerRTCompile.cmake
@@ -27,7 +27,7 @@
 # Compile a sanitizer test with a freshly built clang
 # for a given architecture, adding the result to the object list.
 #  - obj_list: output list of objects, populated by path
-#              of the generated object file.
+#              of a generated object file.
 #  - source:   source file of a test.
 #  - arch:     architecture to compile for.
 # sanitizer_test_compile(<obj_list> <source> <arch>
@@ -36,16 +36,12 @@
 #                        DEPS <list of dependencies>
 #                        CFLAGS <list of flags>
 # )
-macro(sanitizer_test_compile obj_list source arch)
+function(sanitizer_test_compile obj_list source arch)
   cmake_parse_arguments(TEST
       "" "" "KIND;COMPILE_DEPS;DEPS;CFLAGS" ${ARGN})
   get_filename_component(basename ${source} NAME)
-  if(CMAKE_CONFIGURATION_TYPES)
-    set(output_obj
-      "${CMAKE_CFG_INTDIR}/${obj_list}.${basename}.${arch}${TEST_KIND}.o")
-  else()
-    set(output_obj "${obj_list}.${basename}.${arch}${TEST_KIND}.o")
-  endif()
+  set(output_obj
+    "${CMAKE_CFG_RESOLVED_INTDIR}${obj_list}.${basename}.${arch}${TEST_KIND}.o")

   # Write out architecture-specific flags into TARGET_CFLAGS variable.
   get_target_flags_for_arch(${arch} TARGET_CFLAGS)
@@ -57,7 +53,8 @@
                 CFLAGS ${TEST_CFLAGS} ${TARGET_CFLAGS}
                 DEPS ${TEST_COMPILE_DEPS})
   list(APPEND ${obj_list} ${output_obj})
-endmacro()
+  set("${obj_list}" "${${obj_list}}" PARENT_SCOPE)
+endfunction()

 # Compile a source into an object file with COMPILER_RT_TEST_COMPILER using
 # a provided compile flags and dependenices.


I have just proved CMake 2.8.11.2 can unpack *.xz archives using the

cmake -E tar zxf *.xz

command.  Therefore, drop using a system tar workaround for this
special case which reduces the differences between the epa_build
version of ExternalProject.cmake and the CMake version (which is
a good direction to go because eventually we may be able to
completely drop the epa_build variant of ExternalProject.cmake

svn path=/trunk/; revision=12888

--- cmake/epa_build/ExternalProject.cmake
+++ cmake/epa_build/ExternalProject.cmake
@@ -636,18 +636,9 @@
 # Extract it:
 #
 message(STATUS \"extracting... [tar ${args}]\")
-if(filename MATCHES \"tar\\\\.xz$\")
-  # --force-local required so that drive-letter colon for filename on
-  # Windows platforms is not interpreted as a remote host.
-  find_program(TAR_EXECUTABLE tar)
-  execute_process(COMMAND \${TAR_EXECUTABLE} --force-local -Jxf \${filename}
-    WORKING_DIRECTORY \${ut_dir}
-    RESULT_VARIABLE rv)
-else(filename MATCHES \"tar\\\\.xz$\")
-  execute_process(COMMAND \${CMAKE_COMMAND} -E tar ${args} \${filename}
-    WORKING_DIRECTORY \${ut_dir}
-    RESULT_VARIABLE rv)
-endif(filename MATCHES \"tar\\\\.xz$\")
+execute_process(COMMAND \${CMAKE_COMMAND} -E tar ${args} \${filename}
+  WORKING_DIRECTORY \${ut_dir}
+  RESULT_VARIABLE rv)

 if(NOT rv EQUAL 0)
   message(STATUS \"extracting... [error clean up]\")


fix for subdirs in FindProtobuf.cmake

fix for subdirs in FindProtobuf.cmake

--- src/fnord/protobuf/FindProtobuf.cmake
+++ src/fnord/protobuf/FindProtobuf.cmake
@@ -62,13 +62,23 @@
   foreach(FIL ${ARGN})
     get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
     get_filename_component(FIL_WE ${FIL} NAME_WE)
-
-    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc")
-    list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h")
+
+    get_filename_component(ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} ABSOLUTE)
+    string(LENGTH ${ROOT_DIR} ROOT_DIR_LEN)
+
+    get_filename_component(FIL_DIR ${ABS_FIL} PATH)
+    string(LENGTH ${FIL_DIR} FIL_DIR_LEN)
+    math(EXPR FIL_DIR_REM "${FIL_DIR_LEN} - ${ROOT_DIR_LEN}")
+
+    string(SUBSTRING ${FIL_DIR} ${ROOT_DIR_LEN} ${FIL_DIR_REM} FIL_DIR_PREFIX)
+    set(FIL_WEPREFIX "${FIL_DIR_PREFIX}/${FIL_WE}")
+
+    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc")
+    list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h")

     add_custom_command(
-      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.cc"
-             "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.h"
+      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.cc"
+             "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WEPREFIX}.pb.h"
       COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
       ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} --proto_path ${PROTOBUF_INCLUDE_DIR} --proto_path ${FNORD_SOURCE_DIR}/fnord ${PROTOC_ARGS} ${ABS_FIL}
       DEPENDS ${ABS_FIL}


[CMake] Added namespace ROOT:: on exported targets in binary tree.

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -612,7 +612,7 @@
 set(ROOT_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")

 get_property(exported_targets GLOBAL PROPERTY ROOT_EXPORTED_TARGETS)
-export(TARGETS ${exported_targets} FILE ${PROJECT_BINARY_DIR}/ROOTConfig-targets.cmake)
+export(TARGETS ${exported_targets} NAMESPACE ROOT:: FILE ${PROJECT_BINARY_DIR}/ROOTConfig-targets.cmake)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/ROOTConfig.cmake.in
                ${CMAKE_BINARY_DIR}/ROOTConfig.cmake @ONLY NEWLINE_STYLE UNIX)
 configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/RootUseFile.cmake.in


fixes issue 869
+ only use $ENV{NUMBER_OF_PROCESSORS} if set

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@1537 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -239,7 +239,9 @@

   # Windows:
   if(WIN32)
-    set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
+    if ($ENV{NUMBER_OF_PROCESSORS})
+      set(PROCESSOR_COUNT "$ENV{NUMBER_OF_PROCESSORS}")
+    endif ()
   endif()
 endif()


i#1376 VS2013 support: add VS2013 to the set of auto-selected
generators in runsuite_common_pre.cmake.  We assume the user has a
recent-enough cmake to support its generator.

SVN-Revision: 2652

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -321,29 +321,43 @@
   if (arg_generator)
     set(vs_generator ${arg_generator})
   else ()
-    # Prefer the most recent version that's installed.  The user can use
-    # generator= to request an older version.
-    get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH)
-    # on failure getting weird results: "c:/registry", so we assume will have Studio
-    if ("${vs_dir}" MATCHES "Studio")
-      set(vs_generator "Visual Studio 11")
-    else ()
+    # Prefer the most recent version that's installed.  We assume the user has
+    # a recent-enough cmake to support the most recent VS version installed.
+    # The user can use generator= to request an older version.
+    set(vs_generator "NOTFOUND")
+    if (NOT vs_generator)
+      get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS;ProductDir] REALPATH)
+      # on failure getting weird results: "c:/registry", so we assume will have Studio
+      if ("${vs_dir}" MATCHES "Studio")
+        set(vs_generator "Visual Studio 12")
+      endif()
+    endif()
+    if (NOT vs_generator)
+      get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH)
+      if ("${vs_dir}" MATCHES "Studio")
+        set(vs_generator "Visual Studio 11")
+      endif ()
+    endif ()
+    if (NOT vs_generator)
       get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] REALPATH)
       if ("${vs_dir}" MATCHES "Studio")
         set(vs_generator "Visual Studio 10")
-      else ()
-        get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH)
-        if ("${vs_dir}" MATCHES "Studio")
-          set(vs_generator "Visual Studio 9 2008")
-        else ()
-          get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH)
-          if ("${vs_dir}" MATCHES "Studio")
-            set(vs_generator "Visual Studio 8 2005")
-          else ()
-            message(FATAL_ERROR "Cannot determine Visual Studio version")
-          endif ()
-        endif ()
-      endif ()
+      endif ()
+    endif ()
+    if (NOT vs_generator)
+      get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH)
+      if ("${vs_dir}" MATCHES "Studio")
+        set(vs_generator "Visual Studio 9 2008")
+      endif ()
+    endif ()
+    if (NOT vs_generator)
+      get_filename_component(vs_dir [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH)
+      if ("${vs_dir}" MATCHES "Studio")
+        set(vs_generator "Visual Studio 8 2005")
+      endif ()
+    endif ()
+    if (NOT vs_generator)
+      message(FATAL_ERROR "Cannot determine Visual Studio version")
     endif ()
   endif ()
   message("Using ${vs_generator} generators")


Detect x64 kernels in the suite and disable x64 builds for ia32 kernels

On Linux, we could try to support building an x64 package from an ia32
system, but for now it's unsupported.

Review URL: https://codereview.appspot.com/6709050

git-svn-id: ed337ca7cdb08c0ba29d8fe58632bb7686892c2d@1669 49cc7528-f6fd-11dd-9d1a-b59b2e1864b6

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -259,6 +259,38 @@
 set(CTEST_CMAKE_COMMAND "${CMAKE_EXECUTABLE_NAME}")
 # outer file should set CTEST_PROJECT_NAME
 set(CTEST_COMMAND "${CTEST_EXECUTABLE_NAME}")
+
+# Detect if the kernel is ia32 or x64.  If the kernel is ia32, there's no sense
+# in trying to run any x64 code.  On Windows, the x64 toolchain is built as x64
+# code, so we can't even build.  On Linux, it's possible to have an ia32
+# toolchain that targets x64, but we don't currently support it.
+if (NOT DEFINED KERNEL_IS_X64)  # Allow variable override.
+  if (WIN32)
+    # Check both PROCESSOR_ARCHITECTURE and PROCESSOR_ARCHITEW6432 in case CMake
+    # was built x64.
+    if ("$ENV{PROCESSOR_ARCHITECTURE}" MATCHES "AMD64" OR
+        "$ENV{PROCESSOR_ARCHITEW6432}" MATCHES "AMD64")
+      set(KERNEL_IS_X64 ON)
+    else ()
+      set(KERNEL_IS_X64 OFF)
+    endif ()
+  else ()
+    # uname -m is what the kernel supports.
+    execute_process(COMMAND uname -m
+      OUTPUT_VARIABLE machine
+      RESULT_VARIABLE cmd_result)
+    # If for some reason uname fails (not on PATH), assume the kernel is x64
+    # anyway.
+    if (cmd_result OR "${machine}" MATCHES "x86_64")
+      set(KERNEL_IS_X64 ON)
+    else ()
+      set(KERNEL_IS_X64 OFF)
+    endif ()
+  endif ()
+endif ()
+if (NOT KERNEL_IS_X64)
+  message("WARNING: Kernel is not x64, skipping x64 builds")
+endif ()

 if (arg_use_ninja)
   set(CTEST_CMAKE_GENERATOR "Ninja")
@@ -352,6 +384,12 @@
 function(testbuild_ex name is64 initial_cache test_only_in_long
     add_to_package build_args)
   set(CTEST_BUILD_NAME "${name}")
+
+  # Skip x64 builds on a true ia32 machine.
+  if (is64 AND NOT KERNEL_IS_X64)
+    return()
+  endif ()
+
   if (NOT arg_use_nmake AND NOT arg_use_make AND NOT arg_use_ninja)
     # we need a separate generator for 64-bit as well as the PATH
     # env var changes below (since we run cl directly)


edit FindOpenCL.cmake

edit FindOpenCL.cmake

--- FindOpenCL.cmake
+++ FindOpenCL.cmake
@@ -30,6 +30,9 @@
 #   OpenCL_INCLUDE_DIR    - the OpenCL include directory
 #   OpenCL_LIBRARY        - the path to the OpenCL library
 #
+# Accepts the following variable as CMake or environment variable:
+#
+#   OPENCL_ROOT - The root directory of the OpenCL implementation found

 function(_FIND_OPENCL_VERSION)
   include(CheckSymbolExists)
@@ -70,6 +73,7 @@
   NAMES
     CL/cl.h OpenCL/cl.h
   HINTS
+    ${OPENCL_ROOT}/include
     $ENV{K1_TOOLCHAIN_DIR}/include
   PATHS
     ENV "PROGRAMFILES(X86)"
@@ -91,7 +95,8 @@
     find_library(OpenCL_LIBRARY
       NAMES OpenCL
       HINTS
-        $ENV{K1_TOOLCHAIN_DIR}/lib64
+      ${OPENCL_ROOT}/lib
+        $ENV{K1_TOOLCHAIN_DIR}/lib
       PATHS
         ENV "PROGRAMFILES(X86)"
         ENV AMDAPPSDKROOT
@@ -105,12 +110,12 @@
         lib/x86
         lib/Win32
         lib
-        lib64
         OpenCL/common/lib/Win32)
   elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
     find_library(OpenCL_LIBRARY
       NAMES OpenCL
       HINTS
+        ${OPENCL_ROOT}/lib64
         $ENV{K1_TOOLCHAIN_DIR}/lib64
       PATHS
         ENV "PROGRAMFILES(X86)"
@@ -124,7 +129,6 @@
         "AMD APP/lib/x86_64"
         lib/x86_64
         lib/x64
-        lib
         lib64
         OpenCL/common/lib/x64)
   endif()
@@ -132,6 +136,7 @@
   find_library(OpenCL_LIBRARY
     NAMES OpenCL
     HINTS
+        ${OPENCL_ROOT}/lib64
         $ENV{K1_TOOLCHAIN_DIR}/lib64
     PATHS
       ENV AMDAPPSDKROOT


ENH: Updated to latest TubeTK that supports itk::BooleanStdVector

ITK has updated the API for PDE functions since ITKv5.3rc03.  This
pull requests updates ITK to use the version of TubeTK that supports
those changes to the PDE functions.   This should allow TubeTK wheels
to be built from this version of ITK, when ITKv5.3rc04 is released.

This version of ITK+TubeTK no longer supports building wheels that
are compatible with ITKv5.3rc03.

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -48,5 +48,5 @@
   "http://www.tubetk.org"
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG 8cb12a20f4bd3d86aa8911a66bd9b008f3ca6d34
+  GIT_TAG 7d643c7fc6e7e6d08b3a1a1eba5696c8718adb64
   )


COMP: missing addStep code

COMP: missing addStep code

--- SuperBuild/CMake/External_ossim.cmake
+++ SuperBuild/CMake/External_ossim.cmake
@@ -1,83 +1,97 @@
-set(proj OSSIM)
-
-if(NOT __EXTERNAL_${proj}__)
-set(__EXTERNAL_${proj}__ 1)
-
-message(STATUS "Setup Ossim...")
-
-# OSGeo4W provides an "ossim" package : use it otherwise if it is installed and not used by OTB
-# we get conflicts (because OSGeo4W include dir is included for other dependencies
-#if(WIN32)
-#  set(DEFAULT_USE_SYSTEM_OSSIM  ON)
-#endif()
-
-if(USE_SYSTEM_OSSIM)
-  find_package ( Ossim )
-  message(STATUS "  Using OSSIM system version")
-else()
-  SETUP_SUPERBUILD(PROJECT ${proj})
-  message(STATUS "  Using OSSIM SuperBuild version")
-
-  # declare dependencies
-  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} TIFF GEOTIFF GEOS JPEG OPENTHREADS FREETYPE)
-
-  INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
-  # set proj back to its original value
-  set(proj OSSIM)
-
-  ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
-  ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_LIBRARY)
-  ADD_SUPERBUILD_CMAKE_VAR(GEOS_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(GEOS_LIBRARY)
-  ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
-  ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_LIBRARY)
-  ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_INCLUDE_DIR)
-  ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_LIBRARY)
-
-  set(OSSIM_CXX_FLAGS  -D__STDC_CONSTANT_MACROS)
-
-  if(MSVC)
-    set(OSSIM_CXX_FLAGS /EHsc)
-  endif()
-
-  # archive version
-  ExternalProject_Add(${proj}
-    PREFIX ${proj}
-    URL "https://www.orfeo-toolbox.org/packages/ossim-minimal-r23537.tar.gz"
-    URL_MD5 f77d574ab2817bcc36633f77824facb5
-    BINARY_DIR ${OSSIM_SB_BUILD_DIR}
-    INSTALL_DIR ${SB_INSTALL_PREFIX}
-    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    CMAKE_CACHE_ARGS
-    -DProject_WC_REVISION:STRING=23537
-    -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
-    -DCMAKE_BUILD_TYPE:STRING=Release
-    -DCMAKE_CXX_FLAGS:STRING=${OSSIM_CXX_FLAGS}
-    -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
-    -DBUILD_OSSIM_FREETYPE_SUPPORT:BOOL=ON
-    -DBUILD_OSSIM_APPS:BOOL=OFF
-    -DBUILD_OSSIM_TEST_APPS:BOOL=OFF
-    -DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
-    -DBUILD_WMS:BOOL=OFF
-    -DINSTALL_ARCHIVE_DIR:STRING=lib
-    -DINSTALL_LIBRARY_DIR:STRING=lib
-    -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
-    ${OSSIM_SB_CONFIG}
-    DEPENDS ${${proj}_DEPENDENCIES}
-    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
-    )
-
-  set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
-  if(WIN32)
-    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/ossim.lib)
-  elseif(UNIX)
-    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libossim${CMAKE_SHARED_LIBRARY_SUFFIX})
-  endif()
-
-endif()
-
-endif()
+set(proj OSSIM)
+
+if(NOT __EXTERNAL_${proj}__)
+set(__EXTERNAL_${proj}__ 1)
+
+message(STATUS "Setup Ossim...")
+
+# OSGeo4W provides an "ossim" package : use it otherwise if it is installed and not used by OTB
+# we get conflicts (because OSGeo4W include dir is included for other dependencies
+#if(WIN32)
+#  set(DEFAULT_USE_SYSTEM_OSSIM  ON)
+#endif()
+
+if(USE_SYSTEM_OSSIM)
+  find_package ( Ossim )
+  message(STATUS "  Using OSSIM system version")
+else()
+  SETUP_SUPERBUILD(PROJECT ${proj})
+  message(STATUS "  Using OSSIM SuperBuild version")
+
+  # declare dependencies
+  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(${proj} TIFF GEOTIFF GEOS JPEG OPENTHREADS FREETYPE)
+
+  INCLUDE_SUPERBUILD_DEPENDENCIES(${${proj}_DEPENDENCIES})
+  # set proj back to its original value
+  set(proj OSSIM)
+
+  ADD_SUPERBUILD_CMAKE_VAR(TIFF_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(TIFF_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(GEOTIFF_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(GEOS_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(GEOS_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(JPEG_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(JPEG_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(OPENTHREADS_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(FREETYPE_LIBRARY)
+
+  set(OSSIM_CXX_FLAGS  -D__STDC_CONSTANT_MACROS)
+
+  if(MSVC)
+    set(OSSIM_CXX_FLAGS /EHsc)
+  endif()
+
+  # archive version
+  ExternalProject_Add(${proj}
+    PREFIX ${proj}
+    URL "https://www.orfeo-toolbox.org/packages/ossim-minimal-r23537.tar.gz"
+    URL_MD5 f77d574ab2817bcc36633f77824facb5
+    BINARY_DIR ${OSSIM_SB_BUILD_DIR}
+    INSTALL_DIR ${SB_INSTALL_PREFIX}
+    DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
+    CMAKE_CACHE_ARGS
+    -DProject_WC_REVISION:STRING=23537
+    -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
+    -DCMAKE_BUILD_TYPE:STRING=Release
+    -DCMAKE_CXX_FLAGS:STRING=${OSSIM_CXX_FLAGS}
+    -DBUILD_OSSIM_MPI_SUPPORT:BOOL=OFF
+    -DBUILD_OSSIM_FREETYPE_SUPPORT:BOOL=ON
+    -DBUILD_OSSIM_APPS:BOOL=OFF
+    -DBUILD_OSSIM_TEST_APPS:BOOL=OFF
+    -DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
+    -DBUILD_WMS:BOOL=OFF
+    -DINSTALL_ARCHIVE_DIR:STRING=lib
+    -DINSTALL_LIBRARY_DIR:STRING=lib
+    -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
+    ${OSSIM_SB_CONFIG}
+    DEPENDS ${${proj}_DEPENDENCIES}
+    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
+    )
+
+  if(MSVC)
+    ExternalProject_Add_Step(${proj} patch_ossim_src
+      COMMAND ${CMAKE_COMMAND} -E copy_directory
+      ${CMAKE_SOURCE_DIR}/patches/ossim/src ${OSSIM_SB_SRC}/src
+      DEPENDEES patch_ossim_include
+      DEPENDERS configure )
+
+    ExternalProject_Add_Step(${proj} patch_ossim_include
+      COMMAND ${CMAKE_COMMAND} -E copy_directory
+      ${CMAKE_SOURCE_DIR}/patches/ossim/include ${OSSIM_SB_SRC}/include
+      DEPENDEES patch
+      DEPENDERS patch_ossim_src )
+  endif()
+
+  set(_SB_${proj}_INCLUDE_DIR ${SB_INSTALL_PREFIX}/include)
+  if(WIN32)
+    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/ossim.lib)
+  elseif(UNIX)
+    set(_SB_${proj}_LIBRARY ${SB_INSTALL_PREFIX}/lib/libossim${CMAKE_SHARED_LIBRARY_SUFFIX})
+  endif()
+
+endif()
+
+endif()


OSSIM: fix build on superbuild

OSSIM: fix build on superbuild

--- SuperBuild/CMake/External_ossim.cmake
+++ SuperBuild/CMake/External_ossim.cmake
@@ -48,12 +48,13 @@
   ExternalProject_Add(${proj}
     PREFIX ${proj}
     URL "http://download.osgeo.org/ossim/source/ossim-1.8.20/ossim-1.8.20-1.tar.gz"
-    URL_MD5 87c861c005a180343a2fdaf1d54d9b58
+    URL_MD5 19bd40f12d65c2e5b2963466dc838854
     BINARY_DIR ${OSSIM_SB_BUILD_DIR}
     INSTALL_DIR ${SB_INSTALL_PREFIX}
     DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-    CMAKE_CACHE_ARGS
+    CONFIGURE_COMMAND ${SB_CMAKE_COMMAND} ${OSSIM_SB_SRC}/ossim
     -DProject_WC_REVISION:STRING=23537
+    -DSUBVERSION_FOUND:BOOL=FALSE
     -DCMAKE_INSTALL_PREFIX:STRING=${SB_INSTALL_PREFIX}
     -DCMAKE_BUILD_TYPE:STRING=Release
     -DCMAKE_CXX_FLAGS:STRING=${OSSIM_CXX_FLAGS}
@@ -62,40 +63,24 @@
     -DBUILD_OSSIM_APPS:BOOL=OFF
     -DBUILD_OSSIM_TEST_APPS:BOOL=OFF
     -DBUILD_OSSIM_FRAMEWORKS:BOOL=OFF
-    -DBUILD_OMS:BOOL=OFF
-    -DBUILD_CSMAPI:BOOL=OFF
-    -DBUILD_OSSIMGUI:BOOL=OFF
-    -DBUILD_OSSIMPLANET:BOOL=OFF
-    -DBUILD_OSSIMPLANETQT:BOOL=OFF
-    -DBUILD_OSSIMPREDATOR:BOOL=OFF
-    -DBUILD_OSSIMQT:BOOL=OFF
-    -DBUILD_WMS:BOOL=OFF
     -DINSTALL_ARCHIVE_DIR:STRING=lib
     -DINSTALL_LIBRARY_DIR:STRING=lib
+    -DCMAKE_MODULE_PATH:PATH=${OSSIM_SB_SRC}/ossim_package_support/cmake/CMakeModules
     -DCMAKE_PREFIX_PATH:STRING=${SB_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
     ${OSSIM_SB_CONFIG}
     DEPENDS ${${proj}_DEPENDENCIES}
-    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
-
-  ExternalProject_Add_Step(${proj} patch_cmakelist
-      COMMAND ${CMAKE_COMMAND} -E copy
-      ${OSSIM_SB_SRC}/ossim_package_support/cmake/CMakeLists.txt ${OSSIM_SB_SRC}
-      COMMAND ${CMAKE_COMMAND} -E copy_directory
-      ${OSSIM_SB_SRC}/ossim_package_support/cmake/CMakeModules ${OSSIM_SB_SRC}/CMakeModules
-      DEPENDEES patch
-      DEPENDERS configure )

   if(MSVC)
     ExternalProject_Add_Step(${proj} patch_ossim_src
       COMMAND ${CMAKE_COMMAND} -E copy_directory
-      ${CMAKE_SOURCE_DIR}/patches/ossim/src ${OSSIM_SB_SRC}/src
+      ${CMAKE_SOURCE_DIR}/patches/ossim/src ${OSSIM_SB_SRC}/ossim/src
       DEPENDEES patch_ossim_include
       DEPENDERS configure )

     ExternalProject_Add_Step(${proj} patch_ossim_include
       COMMAND ${CMAKE_COMMAND} -E copy_directory
-      ${CMAKE_SOURCE_DIR}/patches/ossim/include ${OSSIM_SB_SRC}/include
+      ${CMAKE_SOURCE_DIR}/patches/ossim/include ${OSSIM_SB_SRC}/ossim/include
       DEPENDEES patch
       DEPENDERS patch_ossim_src )
   endif()


STYLE: Update BRAINSTools repository

STYLE: Update BRAINSTools repository

--- SuperBuild/External_BRAINSTools.cmake
+++ SuperBuild/External_BRAINSTools.cmake
@@ -167,7 +167,7 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY "${git_protocol}://github.com/BRAINSia/BRAINSTools.git")
-  set(${proj}_GIT_TAG 4aef8f72e4ee2f26020e75c73580f56a9eda3a97 )
+  set(${proj}_GIT_TAG b5e27412868ec9834814318fac3b04e3de95b451 )
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


set edison_sdk_root to upper case

set edison_sdk_root to upper case

--- client/client-multi/client-cpp/toolchains/edison.cmake
+++ client/client-multi/client-cpp/toolchains/edison.cmake
@@ -8,25 +8,25 @@
 set(CMAKE_SYSTEM_VERSION 3.10.17-poky-edison+)
 set(CMAKE_SYSTEM_PROCESSOR i686)

-if(NOT DEFINED edison_sdk_root AND WIN32)
+if(NOT DEFINED EDISON_SDK_ROOT AND WIN32)
 	if(${SDK_32bits})
-		set(edison_sdk_root C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2)
+		set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-i686-edison-image-core2-32-toolchain-1.7.2)
 	else()
-		set(edison_sdk_root C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2)
+		set(EDISON_SDK_ROOT C:/Edison/poky-edison-eglibc-x86_64-edison-image-core2-32-toolchain-1.7.2)
 	endif()
-else(NOT DEFINED edison_sdk_root)
-	set(edison_sdk_root /opt/poky-edison/1.7.2)
+else(NOT DEFINED EDISON_SDK_ROOT)
+	set(EDISON_SDK_ROOT /opt/poky-edison/1.7.2)
 endif()

 #Set the host parameters
 if(WIN32)
     	#Windows host
 	if(${SDK_32bits})
-		set(cross_compiler_sysroot ${edison_sdk_root}/sysroots/i686-pokysdk-mingw32)
+		set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-mingw32)
 		#MinGW make
 		set(CMAKE_MAKE_PROGRAM "C:/Program Files/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe")
 	else()
-		set(cross_compiler_sysroot ${edison_sdk_root}/sysroots/x86_64-pokysdk-mingw32)
+		set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-mingw32)
 		#MinGW make
 		set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/mingw/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/mingw32-make.exe")
 	endif()
@@ -35,16 +35,16 @@
 else()
 	#Linux host
 	if(${SDK_32bits})
-		set(cross_compiler_sysroot ${edison_sdk_root}/sysroots/i686-pokysdk-linux)
+		set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/i686-pokysdk-linux)
 	else()
-		set(cross_compiler_sysroot ${edison_sdk_root}/sysroots/x86_64-pokysdk-linux)
+		set(cross_compiler_sysroot ${EDISON_SDK_ROOT}/sysroots/x86_64-pokysdk-linux)
 	endif()
 	set(CMAKE_C_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-gcc)
 	set(CMAKE_CXX_COMPILER ${cross_compiler_sysroot}/usr/bin/i586-poky-linux/i586-poky-linux-g++)
 endif()

-set(CMAKE_SYSROOT ${edison_sdk_root}/sysroots/core2-32-poky-linux)
+set(CMAKE_SYSROOT ${EDISON_SDK_ROOT}/sysroots/core2-32-poky-linux)
 set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT})
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)


SVN_SILENT more unneeded files removed.

SVN_SILENT more unneeded files removed.

svn path=/trunk/KDE/kdepim/akonadi/akonadi-prefix.h.cmake; revision=1061733

--- akonadi-prefix.h.cmake
+++ akonadi-prefix.h.cmake
@@ -1,7 +0,0 @@
-/* This file contains all the paths that change when changing the installation prefix */
-
-#define AKONADIPREFIX "${CMAKE_INSTALL_PREFIX}"
-#define AKONADIDATA   "${SHARE_INSTALL_PREFIX}"
-#define AKONADICONFIG "${CONFIG_INSTALL_DIR}"
-// the below is hardcoded to what FindKDE4Internal.cmake sets it to, since we have no way of finding that
-#define AKONADIBUNDLEPATH "/Applications/KDE4"


ENH: Remove zlib empty variable warning

ENH: Remove zlib empty variable warning

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -285,7 +285,7 @@
   )

 if( ${LOCAL_PROJECT_NAME}_BUILD_SLICER_EXTENSION )
-  unsetForSlicer( NAMES VTK_DIR SlicerExecutionModel_DIR DCMTK_DIR ITK_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS zlib_DIR ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+  unsetForSlicer( NAMES VTK_DIR SlicerExecutionModel_DIR DCMTK_DIR ITK_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   # Create fake imported target to avoid importing Slicer target: See SlicerConfig.cmake:line 820
   add_library(SlicerBaseLogic SHARED IMPORTED)
   find_package(Slicer REQUIRED)
@@ -293,7 +293,7 @@
   if(BUILD_TESTING)
     add_subdirectory(Testing)
   endif()
-  resetForSlicer( NAMES VTK_DIR ITK_DIR SlicerExecutionModel_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS zlib_DIR ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
+  resetForSlicer( NAMES VTK_DIR ITK_DIR SlicerExecutionModel_DIR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_CXX_FLAGS CMAKE_C_FLAGS)
   set( NOCLI_INSTALL_DIR ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION}/../ExternalBin)
   set( EXTENSION_NO_CLI asc2meta asc2vtk BYU2VTK MeshMath Meta2STL Meta2VTK SpharmTool STL2Meta VTK2Meta )
   foreach( VAR ${EXTENSION_NO_CLI})


sort intel composer dirs to always find the most recent install

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -46,6 +46,8 @@
 set(MIC_NATIVE_FOUND false)

 file(GLOB _intel_dirs "/opt/intel/*")
+list(SORT _intel_dirs)
+list(REVERSE _intel_dirs)
 find_path(MIC_SDK_DIR bin/intel64_mic/icpc PATHS
    "$ENV{MIC_SDK_DIR}"
    ${_intel_dirs}


Detect RPM version

Detect RPM version

Some RPM probes are driven by variables like HAVE_RPM46 and HAVE_RPM47.
This variables are set in root CMakeLists by checking of RPM46_FOUND
and RPM47_FOUND and are exported to config.h during configuration.
However the FindRPM.cmake module didn't define these variables.

--- cmake/FindRPM.cmake
+++ cmake/FindRPM.cmake
@@ -26,6 +26,10 @@
 	PATHS ${RPM_PKGCONF_LIBRARY_DIRS}
 )

+set(RPM_VERSION ${RPM_PKGCONF_VERSION})
+string(COMPARE GREATER "4.6" ${RPM_VERSION} RPM46_FOUND)
+string(COMPARE GREATER "4.7" ${RPM_VERSION} RPM47_FOUND)
+
 # Set the include dir variables and the libraries and let libfind_process do the rest.
 # NOTE: Singular variables for this library, plural for libraries this this lib depends on.
 set(RPM_PROCESS_INCLUDES RPM_INCLUDE_DIR)


Better package file name

Better package file name

--- cmake/dtkPack.cmake
+++ cmake/dtkPack.cmake
@@ -24,14 +24,17 @@
 ## #################################################################

 set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
-
 if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-  execute_process(COMMAND uname -r
-    COMMAND sed "s/\\.PAE//" # Getting of any PAE keyword
-    COMMAND sed "s/.*\\.\\(\\w*\\.\\w*\\)$/\\1/"
-    OUTPUT_VARIABLE PACKAGE_EXTENSION
+  #GET distribution id
+  execute_process(COMMAND lsb_release -irs
+    COMMAND sed "s/ //"
+    COMMAND sed "s/Fedora/fc/"
+    OUTPUT_VARIABLE DISTRIB
     OUTPUT_STRIP_TRAILING_WHITESPACE)
-  set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${PACKAGE_EXTENSION}")
+  execute_process(COMMAND arch
+    OUTPUT_VARIABLE ARCH
+    OUTPUT_STRIP_TRAILING_WHITESPACE)
+  set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}-${DISTRIB}-${ARCH}")
 else("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
   set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${${PROJECT_NAME}_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")
 endif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")


Allow building both shared and static libs in one make.

One can now set ${NAME}_LIBRARY_TYPE to a list containing both SHARED
and STATIC for common_library(), which will then build both. The first
entry corresponds to the library that will be associated with the
target ${NAME}; the second entry <TYPE> will be associated with the
target ${NAME}_<TYPE>.

Examples:

1. Original behaviour:

set(FOO_LIBRARY_TYPE SHARED)
common_library(foo)

Builds shared library libfoo.so only; target_link_libraries(target foo)
will link target with libfoo.so.

2. New behaviour:

set(FOO_LIBRARY_TYPE SHARED STATIC)
common_library(foo)

Builds both libfoo.so and libfoo.a; target_link_libraries(target foo)
will link against libfoo.so since 'SHARED' is first in the list. To link
explicitly against the static lib, use target_link_libraries(target foo_STATIC).

--- CommonLibrary.cmake
+++ CommonLibrary.cmake
@@ -12,6 +12,10 @@
 # * PROJECT_INCLUDE_NAME for the include directory and project include header
 # * VERSION for the API version
 # * VERSION_ABI for the ABI version
+#
+# If NAME_LIBRARY_TYPE is a list, libraries are built of each specified
+# (i.e. shared and static) type. Whichever is first becomes the library
+# target associated with <Name>.
 #
 # Builds libName and installs it. Installs the public headers to include/name.
 # Generates a PROJECT_INCLUDE_NAME/PROJECT_INCLUDE_NAME.h including all public
@@ -64,15 +68,21 @@
   if (NOT ${NAME}_LIBRARY_TYPE)
     set(${NAME}_LIBRARY_TYPE SHARED)
   endif()
-  add_library(${Name} ${${NAME}_LIBRARY_TYPE} ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
-  target_link_libraries(${Name} ${LINK_LIBRARIES})
-  set_target_properties(${Name}
-    PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_ABI})
+  foreach(LIBRARY_TYPE ${${NAME}_LIBRARY_TYPE})
+    set(LIBNAME ${Name})
+    if (TARGET ${Name})
+	set(LIBNAME "${Name}_${LIBRARY_TYPE}")
+    endif()
+    add_library(${LIBNAME} ${LIBRARY_TYPE} ${SOURCES} ${HEADERS} ${PUBLIC_HEADERS})
+    set_target_properties(${LIBNAME}
+      PROPERTIES VERSION ${VERSION} SOVERSION ${VERSION_ABI} OUTPUT_NAME ${Name})
+    target_link_libraries(${LIBNAME} ${LINK_LIBRARIES})
+    install(TARGETS ${LIBNAME}
+      ARCHIVE DESTINATION lib COMPONENT dev
+      RUNTIME DESTINATION bin COMPONENT lib
+      LIBRARY DESTINATION lib COMPONENT lib)
+  endforeach()

-  install(TARGETS ${Name}
-    ARCHIVE DESTINATION lib COMPONENT dev
-    RUNTIME DESTINATION bin COMPONENT lib
-    LIBRARY DESTINATION lib COMPONENT lib)
   if(MSVC)
     install(FILES ${CMAKE_BINARY_DIR}/bin/Debug/${Name}.pdb
       DESTINATION bin COMPONENT lib CONFIGURATIONS Debug)


Replace + by P in package names for define.h generation

--- CommonPackage.cmake
+++ CommonPackage.cmake
@@ -132,6 +132,7 @@
     # for defines.h
     set(__use_package_define "${UPPER_PROJECT_NAME}_USE_${PACKAGE_NAME}")
     string(REGEX REPLACE "-" "_" __use_package_define ${__use_package_define})
+    string(REGEX REPLACE "+" "P" __use_package_define ${__use_package_define})
     list(APPEND COMMON_PACKAGE_DEFINES ${__use_package_define})

     # for CommonPackageConfig.cmake


Installing OIS dependency didn't work on RelWithDebInfo with MingW

--HG--
branch : v1-7

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -90,7 +90,9 @@
 	  endif ()
 	  if (MINGW)
 		install(FILES ${OIS_LIBRARY_DBG} DESTINATION lib/debug CONFIGURATIONS Debug)
+		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
 		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/release CONFIGURATIONS Release)
+		install(FILES ${OIS_LIBRARY_REL} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
 	  endif ()
 	elseif(APPLE)
 	  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/libOIS.a)


Apparently the tuple directory is needed to by some of the boost threading headers.  Don't exclude it when installing dependencies.

--HG--
branch : v1-7

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
 		PATTERN "system" EXCLUDE
 		PATTERN "test" EXCLUDE
 		PATTERN "tr1" EXCLUDE
-		PATTERN "tuple" EXCLUDE
 		PATTERN "typeof" EXCLUDE
 		PATTERN "units" EXCLUDE
 		PATTERN "unordered" EXCLUDE


COMP: CMakeExternals/QtMobility.cmake - Use CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY instead of hardcoded path

--- CMakeExternals/QtMobility.cmake
+++ CMakeExternals/QtMobility.cmake
@@ -48,7 +48,7 @@
   ExternalProject_Add(${proj}
     URL ${CTK_SOURCE_DIR}/Utilities/QtMobility/qt-mobility-servicefw-opensource-src-1.0.0.tar.gz
     PATCH_COMMAND ${CMAKE_COMMAND} -P ${qtmobility_patchscript}
-    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CMAKE_BINARY_DIR}/CTK-build/bin -no-docs -modules ${qtmobility_modules}
+    CONFIGURE_COMMAND <SOURCE_DIR>/configure -${qtmobility_build_type} -libdir ${CTK_CMAKE_LIBRARY_OUTPUT_DIRECTORY} -no-docs -modules ${qtmobility_modules}
     BUILD_COMMAND ${qtmobility_make_cmd}
     INSTALL_COMMAND ${qtmobility_make_cmd} install
     BUILD_IN_SOURCE 1


ENH: update remote module RTK

ENH: update remote module RTK

git shortlog cf109ba..f43ecb2 | grep -v "Merge pull request" gives:

Antoine Robert (8):
BUG: Use real image type as input of Hilbert filter
COMP: Fix wrapping when building ITK with dimension 1
ENH: wrap image file reader and writer for dimension 1
ENH: wrap NumpyBridge for dimension 1
ENH: Add quadratic penalization to OSEM algorithm
STYLE: Use override instead of ITK_OVERRIDE
STYLE: Use default member initialization
BUG: Change member type from float to double in Zeng projectors

Aurélien Coussat (7):
PERF: reduced size of application tests
STYLE: fixed format in rtkIterationCommands.h
ENH: ProgressReporter for FDK reconstruction
BUG: solve memory leak in rtkcheckimagequality
ENH: filters check whether their geometry is set
ENH: default projectors for all iterative filters
ENH: set division threshold for SART

Lucas Gandel (5):
ENH: Add rtkSimulatedGeometry python application
COMP: Set latest available itk version in setup.py
ENH: Add ITK clang-format linter check
ENH: Apply clang-format to PR with tag action:ApplyClangFormat
STYLE: Exclude gengetopt and lpsolve folders from clang formatting

Simon Rit (31):
STYLE: remove unused kernel parameter in Cuda forward projection
DOC: change CMake variable name for RTK git tag
SYTLE: remove unused examples/CMakeLists.txt
ENH: use latest ITK v5.1 version for python packages
COMP: remove MacOS and Windows self-hosted Cuda python packages
ENH: wrap RTK image IO
BUG: minimize disk space in Linux Azure pipelines to avoid saturation
BUG: wrong target libraries in FirstReconstruction examples
COMP: fix wrong header guard for rtkProgressCommands.h
STYLE: fix ITK clang-format to a few RTK source files
COMP: fix missing ITKGDCM dependency
BUG: fix wrappings for 1D and double
STYLE: fix ITK clang-format
COMP: remove warnings due to unhandled enum value

--- Modules/Remote/RTK.remote.cmake
+++ Modules/Remote/RTK.remote.cmake
@@ -41,5 +41,5 @@
     "Reconstruction Toolkit (RTK) http://www.openrtk.org/"
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/SimonRit/RTK.git
-  GIT_TAG cf109ba95fb81a9f37a21895c0e455367aeddac0
+  GIT_TAG "f43ecb2a8c4438cc7abb47f371e4981f0f07b67e"
 )


Correctly add Controller and ControllerStub files to project in files.cmake

--- Modules/ToFHardware/files.cmake
+++ Modules/ToFHardware/files.cmake
@@ -24,6 +24,7 @@
   mitkToFCameraPMDMITKPlayerController.cpp
   mitkToFCameraPMDCamCubeController.cpp
   mitkToFCameraPMDController.cpp
+  mitkToFCameraPMDPlayerController.cpp
 )
 IF(WIN32)
   IF(CMAKE_CL_64)
@@ -35,13 +36,25 @@
     SET(CPP_FILES ${CPP_FILES} mitkToFCameraPMDPlayerControllerStub.cpp)
 ENDIF(WIN32)
 ELSE()
-SET(CPP_FILES ${CPP_FILES}
-  mitkToFCameraPMDPlayerControllerStub.cpp
+SET(CPP_FILES ${CPP_FILES}
   mitkToFCameraPMDMITKPlayerControllerStub.cpp
   mitkToFCameraPMDCamCubeControllerStub.cpp
+  mitkToFCameraPMDPlayerControllerStub.cpp
+)
+ENDIF(MITK_USE_TOF_PMDCAMCUBE)
+
+IF(MITK_USE_TOF_PMDCAMBOARD)
+SET(CPP_FILES ${CPP_FILES}
+  mitkToFCameraPMDCamBoardController.cpp
+  mitkToFCameraPMDController.cpp
+)
+ELSE()
+SET(CPP_FILES ${CPP_FILES}
+  mitkToFCameraPMDCamBoardControllerStub.cpp
   mitkToFCameraPMDControllerStub.cpp
 )
-ENDIF(MITK_USE_TOF_PMDCAMCUBE)
+ENDIF(MITK_USE_TOF_PMDCAMBOARD)
+

 IF(MITK_USE_TOF_PMDO3)
 SET(CPP_FILES ${CPP_FILES}


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

 # 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

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

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


to be merged with progress bar

to be merged with progress bar

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -79,7 +79,7 @@
     BINARY_DIR ${${proj}_DIR}
     PREFIX ${proj}${ep_suffix}
     GIT_REPOSITORY "git://public.kitware.com/Bender/Slicer.git"
-    GIT_TAG "7190ef8ba2f0ba50a67f363377ca064f4660d3b0"
+    GIT_TAG "45ae5240b7d9a0139a09682c2d43db6a87d5d8b6"
     ${bender_external_update}
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}


Remove unused appinfo.h, if needed it can be retrieved later.

--- src/appinfo.h.in.cmake
+++ src/appinfo.h.in.cmake
@@ -1,74 +0,0 @@
-// <Copyright Holder>. Copyright (C) <Copyright Year(s)>. <License>.
-#ifndef HEADER_SRC_APPINFO_H_INCLUDED
-#define HEADER_SRC_APPINFO_H_INCLUDED
-
-#include <boost/preprocessor/stringize.hpp>
-
-/*
- * AUTO-GENERATION WARNING:
- *     This file has been automatically generated from "appinfo.h.in.cmake".
- *     DO NOT edit this file, as any changes will be automatically discarded.
- */
-
-#cmakedefine APPLICATION_NAME               "@APPLICATION_NAME@"
-#cmakedefine APPLICATION_CODENAME           "@APPLICATION_CODENAME@"
-#cmakedefine APPLICATION_COPYRIGHT_YEARS    "@APPLICATION_COPYRIGHT_YEARS@"
-#cmakedefine APPLICATION_VERSION_MAJOR      @APPLICATION_VERSION_MAJOR@
-#cmakedefine APPLICATION_VERSION_MINOR      @APPLICATION_VERSION_MINOR@
-#cmakedefine APPLICATION_VERSION_PATCH      @APPLICATION_VERSION_PATCH@
-#cmakedefine APPLICATION_VERSION_TYPE       "@APPLICATION_VERSION_TYPE@"
-#cmakedefine APPLICATION_VERSION_STRING     "@APPLICATION_VERSION_STRING@"
-#cmakedefine APPLICATION_VENDOR_ID          "@APPLICATION_VENDOR_ID@"
-#cmakedefine APPLICATION_VENDOR_NAME        "@APPLICATION_VENDOR_NAME@"
-#cmakedefine APPLICATION_VENDOR_URL         "@APPLICATION_VENDOR_URL@"
-#cmakedefine APPLICATION_ID                 "@APPLICATION_VENDOR_ID@"
-
-#ifndef APPLICATION_NAME
-#   error "Please specify the application name in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_CODENAME
-#   error "Please specify the application codename in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_COPYRIGHT_YEARS
-#   error "Please specify the application copyright years (years during which this application was created, edited, or modified) in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_VERSION_MAJOR
-#   define APPLICATION_VERSOIN_MAJOR 0
-#endif
-
-#ifndef APPLICATION_VERSION_MINOR
-#   define APPLICATION_VERSION_MINOR 0
-#endif
-
-#ifndef APPLICATION_VERSION_PATCH
-#   define APPLICATION_VERSION_PATCH 0
-#endif
-
-#ifndef APPLICATION_VERSION_TYPE
-#   define APPLICATION_VERSION_TYPE "SNAPSHOT"
-#endif
-
-#ifndef APPLICATION_VERSION_STRING
-#   define APPLICATION_VERSION_STRING BOOST_PP_STRINGIZE(APPLICATION_VERSION_MAJOR) "." BOOST_PP_STRINGIZE(APPLICATION_VERSION_MINOR) "." BOOST_PP_STRINGIZE(APPLICATION_VERSION_PATCH) "-" APPLICATION_VERSION_TYPE
-#endif
-
-#ifndef APPLICATION_VENDOR_ID
-#   error "Please specify the application vendor id in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_VENDOR_NAME
-#   error "Please specify the application vendor name in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_VENDOR_URL
-#   error "Please specify the application vendor URL in the top-level CMakeLists.txt file."
-#endif
-
-#ifndef APPLICATION_ID
-#   define APPLICATION_ID APPLICATION_VENDOR_ID "." APPLICATION_CODENAME
-#endif
-
-#endif


No need for extension in the rootmap file

--- cmake/CMakeALICE.cmake
+++ cmake/CMakeALICE.cmake
@@ -69,14 +69,14 @@
         if(ext)
             set(LOCAL_DEPS ${LOCAL_DEPS} ${file})
         else()
-            set(LOCAL_DEPS ${LOCAL_DEPS} lib${file}.so)
+            set(LOCAL_DEPS ${LOCAL_DEPS} lib${file})
         endif()
     endforeach()

 #    message(STATUS "Generating ROOT map for ${LIBNAME}")
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap
                        COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_LIBMAP}
-                       ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap -l lib${LIBNAME}.so -d ${LOCAL_DEPS} -c ${LINKDEF}
+                       ARGS -o ${CMAKE_CURRENT_BINARY_DIR}/lib${LIBNAME}.rootmap -l lib${LIBNAME} -d ${LOCAL_DEPS} -c ${LINKDEF}
                        DEPENDS ${LIBNAME}
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM
                       )


Fix typo

Fix typo

--- cmake/DARTMacros.cmake
+++ cmake/DARTMacros.cmake
@@ -73,7 +73,7 @@
 macro(dt_issue_303 _name _output_name)
   if (FILESYSTEM_CASE_SENSITIVE)
     if (${DART_VERSION} VERSION_GREATER 4.3)
-      message(WARNING "Installing deprecated ${_name}.hh. This should be removed after DART 4.3")
+      message(WARNING "Installing deprecated ${_name}.h. This should be removed in DART 5.0.")
     endif()
     set(generated_file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.h")
     execute_process(


Properly pass the build configuration to the sub-cmake

--- cmake/DaemonGame.cmake
+++ cmake/DaemonGame.cmake
@@ -76,7 +76,7 @@
                 CMAKE_ARGS
                     -DFORK=2
                     -DCMAKE_TOOLCHAIN_FILE=${Daemon_SOURCE_DIR}/cmake/toolchain-pnacl.cmake
-                    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+                    -DCMAKE_BUILD_TYPE=$<CONFIG>
                     -DDEPS_DIR=${DEPS_DIR}
                     -DBUILD_CGAME=${BUILD_CGAME}
                     -DBUILD_SGAME=${BUILD_SGAME}
@@ -90,7 +90,7 @@
             )
             ExternalProject_Add_Step(${vm} forcebuild
                 COMMAND ${CMAKE_COMMAND} -E remove
-                    ${CMAKE_CURRENT_BINARY_DIR}/${vm}-prefix/src/${vm}-stamp/${vm}-build
+                    ${CMAKE_CURRENT_BINARY_DIR}/${vm}-prefix/src/${vm}-stamp/${vm}-configure
                 COMMENT "Forcing build step for '${vm}'"
                 DEPENDEES build
                 ALWAYS 1


do not confuse Eigen3 or beta versions of Eigen3 with Eigen2

--- cmake/FindEigen2.cmake
+++ cmake/FindEigen2.cmake
@@ -39,11 +39,11 @@
   set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}")

   set(EIGEN2_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION})
-  if(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+  if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION}))
     set(EIGEN2_VERSION_OK FALSE)
-  else(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+  else()
     set(EIGEN2_VERSION_OK TRUE)
-  endif(${EIGEN2_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})
+  endif()

   if(NOT EIGEN2_VERSION_OK)


Fix "Libcaf" casing issue in FindLibcaf.cmake.

find_package_handle_standard_args() expects the first argument to be the
name of the Find-module in original casing.  If it's not, it may fail to
do things like abort with a FATAL_ERROR message if REQUIRED was supplied
to the original find_package().

--- cmake/FindLibcaf.cmake
+++ cmake/FindLibcaf.cmake
@@ -87,7 +87,7 @@

 # final steps to tell CMake we're done
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(libcaf
+find_package_handle_standard_args(Libcaf
                                   DEFAULT_MSG
                                   LIBCAF_LIBRARIES
                                   LIBCAF_INCLUDE_DIRS)


Fix error missing $ for cmake variables

Fix error missing $ for cmake variables

--- cmake/FindSphinx.cmake
+++ cmake/FindSphinx.cmake
@@ -64,55 +64,55 @@
     set( _dependencies ${_dependencies} ${arg} )
   endforeach()

-  if( SPHINX_HTML_OUTPUT )
+  if( ${SPHINX_HTML_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_html html ${conf} ${source} ${base_destination}/html )

     add_dependencies( ${target_base_name}_html _dependencies )
   endif()

-  if( SPHINX_DIRHTML_OUTPUT )
+  if( ${SPHINX_DIRHTML_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_dirhtml dirhtml ${conf} ${source} ${base_destination}/dirhtml )

     add_dependencies( ${target_base_name}_dirhtml _dependencies )
   endif()

-  if( SPHINX_QTHELP_OUTPUT )
+  if( ${SPHINX_QTHELP_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_qthelp qthelp ${conf} ${source} ${base_destination}/qthelp )

     add_dependencies( ${target_base_name}_qthelp _dependencies )
   endif()

-  if( SPHINX_DEVHELP_OUTPUT )
+  if( ${SPHINX_DEVHELP_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_devhelp devhelp ${conf} ${source} ${base_destination}/devhelp )

     add_dependencies( ${target_base_name}_devhelp _dependencies )
   endif()

-  if( SPHINX_EPUB_OUTPUT )
+  if( ${SPHINX_EPUB_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_epub epub ${conf} ${source} ${base_destination}/epub )

     add_dependencies( ${target_base_name}_epub _dependencies )
   endif()

-  if( SPHINX_LATEX_OUTPUT )
+  if( ${SPHINX_LATEX_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_latex latex ${conf} ${source} ${base_destination}/latex )

     add_dependencies( ${target_base_name}_latex _dependencies )
   endif()

-  if( SPHINX_MAN_OUTPUT )
+  if( ${SPHINX_MAN_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_man man ${conf} ${source} ${base_destination}/man )

     add_dependencies( ${target_base_name}_man _dependencies )
   endif()

-  if( SPHINX_TEXT_OUTPUT )
+  if( ${SPHINX_TEXT_OUTPUT} )
     Sphinx_add_target( ${target_base_name}_text text ${conf} ${source} ${base_destination}/text )

     add_dependencies( ${target_base_name}_text _dependencies )
   endif()

-  if( BUILD_TESTING )
+  if( ${BUILD_TESTING} )
     sphinx_add_target( ${target_base_name}_linkcheck linkcheck ${conf} ${source} ${base_destination}/linkcheck )

     add_dependencies( ${target_base_name}_linkcheck _dependencies )


replaced the FindlibSVM test file by something more appropriate (taken from vtk.org). Now manages to correctly identify the location of libsvm under Darwin -- hopefully it doesn't break anywhere else...

--- cmake/FindlibSVM.cmake
+++ cmake/FindlibSVM.cmake
@@ -1,30 +1,183 @@
-# - Try to find LIBSVM
-# Once done, this will define
+#  -- Try to find LibSVM
 #
-#  LIBSVM_FOUND - system has LIBSVM
-#  LIBSVM_INCLUDE_DIRS - the LIBSVM include directories
-#  LIBSVM_LIBRARIES - link these to use LIBSVM
+#  LibSVM is a Library for Support Vector Machines
+#  available at http://www.csie.ntu.edu.tw/~cjlin/libsvm/
+#
+#  ------------------------------------------------------------------
+#
+#  -- Library usage example :
+#
+#  find_package (LibSVM 2.9.0)
+#  if (LIBSVM_FOUND)
+#     include_directories (${LIBSVM_INCLUDE_DIRS})
+#     add_executable (foo foo.cpp)
+#     target_link_libraries (foo ${LIBSVM_LIBRARIES})
+#  endif ()
+#
+#  -- Show some debug information :
+#
+#  set (LIBSVM_DEBUG TRUE)
+#  find_package (LibSVM)
+#
+#  -------------------------------------------------------------------
+#
+#  -- This module defines :
+#
+#  LIBSVM_FOUND - the system has LibSVM
+#  LIBSVM_INCLUDE_DIR - where to find svm.h
+#  LIBSVM_INCLUDE_DIRS libsvm includes
+#  LIBSVM_LIBRARY - where to find the LibSVM library
+#  LIBSVM_LIBRARIES - aditional libraries
+#  LIBSVM_VERSION - version
+#  LIBSVM_MAJOR_VERSION - major version
+#  LIBSVM_MINOR_VERSION - minor version
+#  LIBSVM_SUBMINOR_VERSION - subminor version
+#  LIBSVM_ROOT_DIR - root dir (ex. /usr/local)
+#
+#  ------------------------------------------------------------------
+#
+#  Copyright (c) 2010 Julien Schueller <schueller at phimeca dot com>
+#
+#  Redistribution and use is allowed according to the terms of the New
+#  BSD license.
+#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#

-INCLUDE(LibFindMacros)
+# check for math header
+if (NOT HAVE_MATH_H)
+  include (CheckIncludeFile)
+  check_include_file (math.h HAVE_MATH_H)
+endif ()

-# Use pkg-config to get hints about paths
-LIBFIND_PKG_CHECK_MODULES(LIBSVM_PKGCONF libsvm)

-# Include dir
-FIND_PATH(LIBSVM_INCLUDE_DIR
-  NAMES svm.h
-	  PATHS ${LIBSVM_PKGCONF_INCLUDE_DIRS}
-		PATH_SUFFIXES libsvm libsvm-2.0/libsvm
+# set LIBSVM_INCLUDE_DIR
+if (NOT LIBSVM_INCLUDE_DIR)
+  find_path (LIBSVM_INCLUDE_DIR
+    NAMES
+      svm.h
+    PATHS
+      ${LIBSVM_ROOT_DIR}/include
+    PATH_SUFFIXES
+      libsvm
+      libsvm-2.0/libsvm
+    DOC
+      "LibSVM include directory"
+  )
+endif ()
+
+
+# set LIBSVM_INCLUDE_DIR
+if (NOT LIBSVM_INCLUDE_DIRS)
+  set (LIBSVM_INCLUDE_DIRS ${LIBSVM_INCLUDE_DIR})
+endif ()
+
+
+# version
+if (NOT LIBSVM_VERSION)
+  set (LIBSVM_MAJOR_VERSION 0)
+  set (LIBSVM_MINOR_VERSION 0)
+  set (LIBSVM_SUBMINOR_VERSION 0)
+  if (LIBSVM_INCLUDE_DIR)
+    # LIBSVM_VERSION macro defined in svm.h since version 2.8.9
+    file (STRINGS "${LIBSVM_INCLUDE_DIR}/svm.h" _VERSION_STRING REGEX ".*LIBSVM_VERSION.*")
+    if (_VERSION_STRING)
+      string (REGEX REPLACE ".*_VERSION[ ]+([0-9]+)" "\\1" _VERSION_NUMBER "${_VERSION_STRING}")
+      math (EXPR LIBSVM_MAJOR_VERSION "${_VERSION_NUMBER} / 100")
+      math (EXPR LIBSVM_MINOR_VERSION "(${_VERSION_NUMBER} % 100 ) / 10")
+      math (EXPR LIBSVM_SUBMINOR_VERSION "${_VERSION_NUMBER} % 10")
+    endif ()
+  endif ()
+  set (LIBSVM_VERSION "${LIBSVM_MAJOR_VERSION}.${LIBSVM_MINOR_VERSION}.${LIBSVM_SUBMINOR_VERSION}")
+endif ()
+
+
+
+# check version
+set (_LIBSVM_VERSION_MATCH TRUE)
+set (_REQUIRED_VERSION "${LibSVM_FIND_VERSION_MAJOR}.${LibSVM_FIND_VERSION_MINOR}.${LibSVM_FIND_VERSION_PATCH}")
+if (LibSVM_FIND_VERSION AND _VERSION_STRING)
+  if (LibSVM_FIND_VERSION_EXACT)
+    if ("${_REQUIRED_VERSION}" VERSION_EQUAL "${LIBSVM_VERSION}")
+    else()
+      set (_LIBSVM_VERSION_MATCH FALSE)
+    endif ()
+  else ()
+    if ("${_REQUIRED_VERSION}" VERSION_GREATER "${LIBSVM_VERSION}")
+      set (_LIBSVM_VERSION_MATCH FALSE)
+    endif ()
+  endif ()
+endif ()
+
+
+# set LIBSVM_LIBRARY
+if(NOT LIBSVM_LIBRARY)
+  find_library (LIBSVM_LIBRARY
+    NAMES
+      svm
+    PATHS
+      ${LIBSVM_ROOT_DIR}/lib
+    DOC
+      "LibSVM library location"
+  )
+endif ()
+
+
+# set LIBSVM_LIBRARIES
+if (NOT LIBSVM_LIBRARIES)
+  set (LIBSVM_LIBRARIES ${LIBSVM_LIBRARY})
+
+  # link with math library on unix
+  if (UNIX)
+    list (APPEND LIBSVM_LIBRARIES "-lm")
+  endif ()
+endif ()
+
+
+# root dir
+if (NOT LIBSVM_ROOT_DIR)
+  # try to guess root dir from include dir
+  if (LIBSVM_INCLUDE_DIR)
+    string (REGEX REPLACE "(.*)/include.*" "\\1" LIBSVM_ROOT_DIR ${LIBSVM_INCLUDE_DIR})
+
+  # try to guess root dir from library dir
+  elseif (LIBSVM_LIBRARY)
+    string (REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" LIBSVM_ROOT_DIR ${LIBSVM_LIBRARY})
+  endif ()
+endif ()
+
+
+# debug
+if (LIBSVM_DEBUG)
+  message (STATUS "LIBSVM_LIBRARY: ${LIBSVM_LIBRARY}")
+  message (STATUS "LIBSVM_LIBRARIES: ${LIBSVM_LIBRARIES}")
+  message (STATUS "LIBSVM_INCLUDE_DIR: ${LIBSVM_INCLUDE_DIR}")
+  message (STATUS "LIBSVM_INCLUDE_DIRS: ${LIBSVM_INCLUDE_DIRS}")
+  message (STATUS "LIBSVM_ROOT_DIR: ${LIBSVM_ROOT_DIR}")
+  message (STATUS "LIBSVM_VERSION: ${LIBSVM_VERSION}")
+  message (STATUS "LIBSVM_MAJOR_VERSION: ${LIBSVM_MAJOR_VERSION}")
+  message (STATUS "LIBSVM_MINOR_VERSION: ${LIBSVM_MINOR_VERSION}")
+  message (STATUS "LIBSVM_SUBMINOR_VERSION: ${LIBSVM_SUBMINOR_VERSION}")
+endif ()
+
+
+# handle REQUIRED and QUIET options
+include (FindPackageHandleStandardArgs)
+find_package_handle_standard_args (LibSVM DEFAULT_MSG LIBSVM_LIBRARY
+  _LIBSVM_VERSION_MATCH
+  HAVE_MATH_H
+  LIBSVM_INCLUDE_DIR
+  LIBSVM_INCLUDE_DIRS
+  LIBSVM_LIBRARIES
+  LIBSVM_ROOT_DIR
+  LIBSVM_VERSION
 )

-# Finally the library itself
-FIND_LIBRARY(LIBSVM_LIBRARY
-  NAMES svm libsvm
-	  PATHS ${LIBSVM_PKGCONF_LIBRARY_DIRS}
+
+mark_as_advanced (
+  LIBSVM_LIBRARY
+  LIBSVM_LIBRARIES
+  LIBSVM_INCLUDE_DIR
+  LIBSVM_INCLUDE_DIRS
+  LIBSVM_ROOT_DIR
+  LIBSVM_VERSION
 )
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-SET(LIBSVM_PROCESS_INCLUDES LIBSVM_INCLUDE_DIR)
-SET(LIBSVM_PROCESS_LIBS LIBSVM_LIBRARY)
-LIBFIND_PROCESS(LIBSVM)


Update cmake/Sanitizers.cmake

Update cmake/Sanitizers.cmake

Co-authored-by: Amin Yahyaabadi <34c51606669eac7555bdd33601d965a6eded8607@gmail.com>

--- cmake/Sanitizers.cmake
+++ cmake/Sanitizers.cmake
@@ -36,7 +36,7 @@

     option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE)
     if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")
-      message(WARNING "Memory sanitizer reports false positives when running against libraries that are not MSan-instrumented (including libc++)")
+      message(WARNING "Memory sanitizer requires all the code (including libc++) to be MSan-instrumented otherwise it reports false positives")
       if("address" IN_LIST SANITIZERS
          OR "thread" IN_LIST SANITIZERS
          OR "leak" IN_LIST SANITIZERS)


new cmake macro: add_unit_tests

new cmake macro: add_unit_tests

This allows adding tests involving multiple source files

--- cmake/TestHelper.cmake
+++ cmake/TestHelper.cmake
@@ -30,6 +30,23 @@
 add_library(gtest_main STATIC IMPORTED)
 set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${GTEST_MAIN_LIBRARY})

+macro(add_unit_tests test_name)
+    set(src_files ${ARGN})
+    add_executable(${test_name} ${src_files} ${COMMON_SOURCES})
+    target_link_libraries(${test_name} ${TEST_LIBS} gtest gtest_main)
+    add_dependencies(${test_name} gtest160)
+    if($ENV{BC_UNIT_TEST_VG})
+        add_test(
+            NAME ${test_name}
+            COMMAND valgrind --leak-check=full --error-exitcode=1 $<TARGET_FILE:${test_ame}>
+            )
+    else()
+        add_test(NAME ${test_name} COMMAND ${test_name})
+    endif()
+
+    set_tests_properties(${test_name} PROPERTIES LABELS unit)
+endmacro(add_unit_tests test_name src_files)
+
 macro(def_test testName)
     add_executable(Test${testName} Test${testName}.cpp ${COMMON_SOURCES})
     target_link_libraries(Test${testName} ${TEST_LIBS} gtest gtest_main)


Changing suffix on mac.

Changing suffix on mac.

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -28,6 +28,13 @@
       LINK_FLAGS -shared-libgcc
       PREFIX ""
       )
+    if(APPLE)
+      set_target_properties(${NAME}_ectomodule
+        PROPERTIES
+        #LINK_FLAGS "-bundle -flat_namespace -undefined dynamic_lookup"
+        SUFFIX .so
+      )
+    endif(APPLE)
   elseif(WIN32)
     execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('SO')"
       RESULT_VARIABLE PYTHON_PY_PROCESS


do not install google test

do not install google test

--- cmake/googletest.cmake
+++ cmake/googletest.cmake
@@ -25,9 +25,10 @@
             ${_download_root}
         )

-    # adds the targers: gtest, gtest_main, gmock, gmock_main
+	# adds the targets: gtest, gtest_main, gmock, gmock_main
+	# but do not install them
     add_subdirectory(
         ${_download_root}/googletest-src
         ${_download_root}/googletest-build
-        )
-endmacro()+		EXCLUDE_FROM_ALL)
+endmacro()


link boost random

link boost random

--- cmake/unit-tests.cmake
+++ cmake/unit-tests.cmake
@@ -1,4 +1,4 @@
-find_package(Boost COMPONENTS system filesystem unit_test_framework REQUIRED)
+find_package(Boost COMPONENTS system filesystem unit_test_framework random REQUIRED)

 file(GLOB TEST_SOURCES
     "test/*.cpp"
@@ -19,4 +19,4 @@
 add_executable(unit-tests ${TEST_SOURCES})
 add_dependencies(unit-tests bitcrypto)

-target_link_libraries(unit-tests bitcrypto ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${GMP_LIBRARY})
+target_link_libraries(unit-tests bitcrypto ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_RANDOM_LIBRARY} ${GMP_LIBRARY})


Fix git revision extraction

Fix git revision extraction

--- cmake/GetGitRevisionDescription.cmake
+++ cmake/GetGitRevisionDescription.cmake
@@ -41,18 +41,31 @@

 function(get_git_head_revision _refspecvar _hashvar)
     set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}")
-    set(GIT_DIR "${GIT_PARENT_DIR}/.git")
-    while(NOT EXISTS "${GIT_DIR}/HEAD")  # .git dir not found, search parent directories
+
+    while(NOT EXISTS "${GIT_PARENT_DIR}/.git")  # .git dir not found, search parent directories
         set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}")
         get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} DIRECTORY)
         if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT)
             # We have reached the root directory, we are not in git
-            set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
-            set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE)
+            set(${_refspecvar} "000000000000" PARENT_SCOPE)
+            set(${_hashvar} "000000000000" PARENT_SCOPE)
             return()
         endif()
-        set(GIT_DIR "${GIT_PARENT_DIR}/.git")
     endwhile()
+
+    if (IS_DIRECTORY "${GIT_PARENT_DIR}/.git")
+	# common case
+	set(GIT_DIR "${GIT_PARENT_DIR}/.git")
+    else()
+	# submodule case
+	file(STRINGS "${GIT_PARENT_DIR}/.git" contents LIMIT_COUNT 1)
+	message(STATUS "${contents}")
+	string(SUBSTRING "${contents}" 8 -1 SUBMODULE_GIT_DIR)
+	message(STATUS "${SUBMODULE_GIT_DIR}")
+	set(GIT_DIR "${GIT_PARENT_DIR}/${SUBMODULE_GIT_DIR}")
+	message(STATUS "${GIT_DIR}")
+    endif()
+
     set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data")
     if(NOT EXISTS "${GIT_DATA}")
         file(MAKE_DIRECTORY "${GIT_DATA}")


A few fixes to allow build DEB or RPM with cpack or "make package" work on Ubuntu

--- cmake/Modules/DefineCPackConfig.cmake
+++ cmake/Modules/DefineCPackConfig.cmake
@@ -5,7 +5,7 @@

 ### general settings
 set(CPACK_PACKAGE_NAME ${APPLICATION_NAME})
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The simple unit testint framework")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The simple unit testing framework")
 set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README")
 set(CPACK_PACKAGE_VENDOR "The CGreen Development Team")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
@@ -27,13 +27,14 @@
 if (WIN32)
   ### nsis generator
   set(CPACK_GENERATOR "NSIS")
-  set(CPACK_NSIS_DISPLAY_NAME "The simple unit testing framework")
+  set(CPACK_NSIS_DISPLAY_NAME ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
   set(CPACK_NSIS_COMPRESSOR "/SOLID zlib")
-  set(CPACK_NSIS_MENU_LINKS "http://www.lastcraft.com/cgreen.php" "cgreen homepage")
+  set(CPACK_NSIS_MENU_LINKS "http://cgreen.sourceforge.net" "Cgreen Homepage")
   set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
 else()
   set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
-  set(CPACK_GENERATOR "TGZ")
+  set(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
+  set(CPACK_PACKAGE_CONTACT "cgreen@cgreen.org")
 endif(WIN32)

 set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1)


[cmake] [unittests] include googletest headers to Xcode project header search paths

add target include directories on AddSwiftUnittests.cmake module.
currently generated Xcode project doesn't include googletest headers after https://reviews.llvm.org/D86616

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -9,6 +9,9 @@
   # *NOTE* Even though "add_unittest" does not have llvm in its name, it is a
   # function defined by AddLLVM.cmake.
   add_unittest(SwiftUnitTests ${test_dirname} ${ARGN})
+
+  target_include_directories(${test_dirname} PUBLIC ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include)
+  target_include_directories(${test_dirname} PUBLIC ${LLVM_MAIN_SRC_DIR}/utils/unittest/googlemock/include)

   # TODO: _add_variant_c_compile_link_flags and these tests should share some
   # sort of logic.


qibuild.cmake : version 3

qibuild.cmake : version 3

clean up a little.

--- cmake/qibuild/templates/qibuild.cmake
+++ cmake/qibuild/templates/qibuild.cmake
@@ -8,20 +8,7 @@
 # This file is part of the qibuild project    #
 ###############################################

-set(QIBUILD_BOOTSTRAP_VERSION 2)
-
-find_program(QI_BUILD_EXECUTABLE qibuild)
-if(NOT QI_BUILD_EXECUTABLE)
-  message(STATUS
-    "
-    Could not find qibuild executable.
-
-    Please check your setup.
-
-    "
-  )
-  message(FATAL_ERROR "")
-endif()
+set(QIBUILD_BOOTSTRAP_VERSION 3)

 ##
@@ -29,12 +16,41 @@
 # and include it.
 # This allow us to find all qibuild/qibuild.cmake
 function(bootstrap)
-  message(STATUS "blam: ${QI_BUILD_EXECUTABLE}")
+  find_program(PYTHON_EXECUTABLE NAMES python2 python python.exe)
+  find_program(QI_BUILD_EXECUTABLE qibuild)
+
+  if(NOT PYTHON_EXECUTABLE)
+    message(STATUS
+      "
+      Could not find python executable.
+
+      Please check your setup.
+
+      "
+    )
+    message(FATAL_ERROR "")
+  endif()
+
+  if(NOT QI_BUILD_EXECUTABLE)
+    message(STATUS
+      "
+      Could not find qibuild executable.
+
+      Please check your setup.
+
+      "
+    )
+    message(FATAL_ERROR "")
+  endif()
+
+  set(_cmd ${PYTHON_EXECUTABLE} ${QI_BUILD_EXECUTABLE} configure --single --bootstrap
+     "--build-directory=${CMAKE_BINARY_DIR}")
   execute_process(
-      COMMAND "${QI_BUILD_EXECUTABLE}" configure --single --bootstrap "--build-directory=${CMAKE_BINARY_DIR}"
+      COMMAND ${_cmd}
       RESULT_VARIABLE  _retcode
-      # OUTPUT_VARIABLE  _stdout
-      # ERROR_VARIABLE   _stderr
+      OUTPUT_VARIABLE  _stdout
+      ERROR_VARIABLE   _stderr
+      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
       )
   if(NOT ${_retcode} EQUAL 0)
     message(STATUS
@@ -42,7 +58,7 @@
         qibuild bootstrap fail!
         Log:
         ====
-        ${QI_BUILD} bootstrap ${CMAKE_BINARY_DIR}
+        ${_cmd}
         ${_stdout}
         ${_stderr}


[t:4814] fix cmake error

[t:4814] fix cmake error

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@43368 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -66,7 +66,7 @@
       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
     endif ()
   endforeach(flag)
-endfunction(set_flag_if_exists)
+endfunction(set_cflags_if_supported)

 ## disable some warnings
 set_cflags_if_supported(


Simplified header only dependencies.

Simplified header only dependencies.

--- cmake_scripts/external-projects.cmake
+++ cmake_scripts/external-projects.cmake
@@ -7,37 +7,40 @@
 set(EXTERNAL_PROJECTS_PREFIX ${CMAKE_BINARY_DIR}/external-projects)
 set(EXTERNAL_PROJECTS_INSTALL_PREFIX ${EXTERNAL_PROJECTS_PREFIX}/installed)

-include(GNUInstallDirs)
-
-# MUST be called before any add_executable() # https://stackoverflow.com/a/40554704/8766845
-link_directories(${EXTERNAL_PROJECTS_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
-include_directories($<BUILD_INTERFACE:${EXTERNAL_PROJECTS_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}>)
-
 include(ExternalProject)

-ExternalProject_Add(externalRapidJson
+ExternalProject_Add(
+    externalRapidJson
     PREFIX "${EXTERNAL_PROJECTS_PREFIX}"
     GIT_REPOSITORY "https://github.com/Tencent/rapidjson.git"
     GIT_TAG "master"
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_INSTALL_PREFIX}
-        -DRAPIDJSON_BUILD_DOC=OFF
-        -DRAPIDJSON_BUILD_EXAMPLES=OFF
-        -DRAPIDJSON_BUILD_TESTS=OFF
-        -DRAPIDJSON_BUILD_THIRDPARTY_GTEST=OFF
-        )
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND ""
+    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
+        <SOURCE_DIR>/include ${CMAKE_BINARY_DIR}/installed/include
+    LOG_DOWNLOAD ON
+    LOG_INSTALL ON
+    )

 set(EXTERNAL_RAPIDJSON_INCLUDE_DIR ${EXTERNAL_PROJECTS_INSTALL_PREFIX}/include/rapidjson)

-ExternalProject_Add(externalLest
+ExternalProject_Add(
+    externalLest
     PREFIX "${EXTERNAL_PROJECTS_PREFIX}"
     GIT_REPOSITORY "https://github.com/martinmoene/lest.git"
     GIT_TAG "master"
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_INSTALL_PREFIX} -DLEST_BUILD_EXAMPLE=OFF
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND ""
+    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
+        <SOURCE_DIR>/include ${CMAKE_BINARY_DIR}/installed/include
+    LOG_DOWNLOAD ON
+    LOG_INSTALL ON
     )
-

 message(STATUS "EXTERNAL_RAPIDJSON_INCLUDE_DIR: ${EXTERNAL_RAPIDJSON_INCLUDE_DIR}")

 if (INSTALL_RAPIDJSON_HEADERS)
     install(DIRECTORY ${EXTERNAL_RAPIDJSON_INCLUDE_DIR} DESTINATION include)
 endif()
+
+include_directories(${CMAKE_BINARY_DIR}/installed/include)


Removing one last case of DENABLE_JSC_MULTIPLE_THREADS -- the cmake folder doesn't seem to have a ChangeLog

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@95515 bbb929c8-8fbe-4397-9dbb-9b2b20218538

--- Source/cmake/OptionsWinCE.cmake
+++ Source/cmake/OptionsWinCE.cmake
@@ -4,7 +4,6 @@
 ADD_DEFINITIONS(-DWTF_USE_WININET=1)
 ADD_DEFINITIONS(-DWTF_CPU_ARM_TRADITIONAL -DWINCEBASIC)
 ADD_DEFINITIONS(-DJS_NO_EXPORT)
-ADD_DEFINITIONS(-DENABLE_JSC_MULTIPLE_THREADS=0)
 ADD_DEFINITIONS(-DHAVE_ACCESSIBILITY=0)
 ADD_DEFINITIONS(-DUSE_SYSTEM_MALLOC=1)
 ADD_DEFINITIONS(-DJSCCOLLECTOR_VIRTUALMEM_RESERVATION=0x200000)


Update ITKv4 commitid to pull in MINC/libnifti confusion fix

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -161,8 +161,8 @@

   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git)
-  set(${proj}_GIT_TAG fc03bcc92b11326b87c232c14eb234fc1f791f9f) ##
-  set(ITK_VERSION_ID ITK-4.9) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID
+  set(${proj}_GIT_TAG f60bbd3aadc4b9fbf2cff1cf7227cef1e92b979a) ##
+  set(ITK_VERSION_ID ITK-4.10) ### NOTE: When updating GIT_TAG, also update ITK_VERSION_ID

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


COMP: provide nvcc location to CMake package CUDAToolkit

nvcc is found by find_language(CUDA) but the language is not immediately
set to let cmake check CMake and CUDA version

--- itk-module-init.cmake
+++ itk-module-init.cmake
@@ -9,6 +9,7 @@
 # Determine default value for RTK_USE_CUDA
 set(RTK_USE_CUDA_DEFAULT OFF)
 if (CMAKE_CUDA_COMPILER)
+  set(CUDAToolkit_NVCC_EXECUTABLE ${CMAKE_CUDA_COMPILER})
   find_package(CUDAToolkit)
   if(NOT CUDAToolkit_FOUND)
     message(WARNING "CUDAToolkit not found (available since CMake v3.17). RTK_USE_CUDA set to OFF.")


Complex division requires libm on NetBSD, add it.

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

--- runtime/cmake/LibompHandleFlags.cmake
+++ runtime/cmake/LibompHandleFlags.cmake
@@ -154,6 +154,9 @@
   if(${IA32})
     libomp_append(libflags_local -lirc_pic LIBOMP_HAVE_IRC_PIC_LIBRARY)
   endif()
+  IF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
+    libomp_append(libflags_local -lm)
+  ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
   set(libflags_local ${libflags_local} ${LIBOMP_LIBFLAGS})
   libomp_setup_flags(libflags_local)
   set(${libflags} ${libflags_local} PARENT_SCOPE)


Fix typo in FindHIP.cmake

Fix typo in FindHIP.cmake

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -36,7 +36,7 @@
 set(CMAKE_SHARED_LIBRARY_LINK_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS})
 set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
 set(CMAKE_SHARED_LIBRARY_RUNTIME_HIP_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
-set(CMAKE_SHARED_LIBRARY_LINK_STATIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LIN$K_STATIC_CXX_FLAGS})
+set(CMAKE_SHARED_LIBRARY_LINK_STATIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_STATIC_CXX_FLAGS})
 set(CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_HIP_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_DYNAMIC_CXX_FLAGS})

 # Set the CMake Flags to use the HCC Compilier.


update cmake toolchain...

update cmake toolchain...

--- cmake/android.cmake
+++ cmake/android.cmake
@@ -3,8 +3,8 @@
 ################################
 #  Usage Linux:
 #   $ export JAVA_HOME=/absolute/path/to/java/home
-#   $ export ANDROID_NDK_ROOT=/absolute/path/to/the/android-ndk
-#   $ export ANDROID_SDK_ROOT=/absolute/path/to/the/android-sdk
+#   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
+#   $ export ANDROID_SDK=/absolute/path/to/the/android-sdk-linux
 #   $ mkdir build && cd build
 #   $ cmake -DCMAKE_TOOLCHAIN_FILE=path/to/the/android.cmake ..
 #   $ make -j8
@@ -22,48 +22,44 @@
 endif()
 message(STATUS "build type: ${CMAKE_BUILD_TYPE}")

+# Find JAVA
 set(JAVA_HOME $ENV{JAVA_HOME})
 if(NOT JAVA_HOME)
     message(FATAL_ERROR "The JAVA_HOME environment variable is not set. Please set it to the root directory of the JDK.")
 endif()
 message(STATUS "java: ${JAVA_HOME}")

+# Find NDK
 set(ANDROID_NDK $ENV{ANDROID_NDK})
 if(NOT ANDROID_NDK)
 	message(FATAL_ERROR "The ANDROID_NDK environment variable is not set. Please set it.")
 endif()
 message(STATUS "ndk: ${ANDROID_NDK}")

+# Find SDK
 set(ANDROID_SDK $ENV{ANDROID_SDK})
 if(NOT ANDROID_SDK)
 	message(FATAL_ERROR "The ANDROID_SDK environment variable is not set. Please set it.")
 endif()
 message(STATUS "sdk: ${ANDROID_SDK}")

+# Find Last build-tools
 file(GLOB tools RELATIVE ${ANDROID_SDK}/build-tools ${ANDROID_SDK}/build-tools/*)
 list(SORT tools)
 list(REVERSE tools)
 list(GET tools 0 ANDROID_BUILD_TOOL)
 message(STATUS "build-tool: ${ANDROID_BUILD_TOOL}")

+# Force to use API 19
 set(ANDROID_API 19)
-message(STATUS "api: ${ANDROID_API}")
-
-set(ANDROID_QT $ENV{ANDROID_QT})
-if(NOT ANDROID_QT)
-	message(FATAL_ERROR "The ANDROID_QT environment variable is not set. Please set it.")
-endif()
-message(STATUS "qt: ${ANDROID_QT}")
-file(GLOB children ${ANDROID_QT}/lib/cmake/*)
-foreach(child ${children})
-	if(IS_DIRECTORY ${child})
-		list(APPEND CMAKE_PREFIX_PATH ${child})
-	endif()
-endforeach()
-
+message(STATUS "android api: ${ANDROID_API}")
+
+# Force to use arm eabi
 set(ANDROID_TOOLCHAIN_MACHINE_NAME "arm-linux-androideabi")
 message(STATUS "toolchain prefix: ${ANDROID_TOOLCHAIN_MACHINE_NAME}")

+# Force to use gnustdc++
+message(STATUS "stl: gnu-libstdc++")
 set(gnu-libstdc++ "${ANDROID_NDK}/sources/cxx-stl/gnu-libstdc++")
 file(GLOB version RELATIVE ${gnu-libstdc++}	${gnu-libstdc++}/4.*)
 list(SORT version)
@@ -77,12 +73,11 @@
 file(GLOB ANDROID_NDK_HOST RELATIVE ${ANDROID_TOOLCHAIN} ${ANDROID_TOOLCHAIN}/*)
 message(STATUS "ndk-host: ${ANDROID_NDK_HOST}")

-set(ANDROID_ABI armeabi-v7a)
-message(STATUS "target-architecture: ${ANDROID_ABI}")
+set(ANDROID_EABI armeabi-v7a)
+message(STATUS "target-architecture: ${ANDROID_EABI}")

 set(CMAKE_SYSTEM_NAME Linux)
 set(CMAKE_SYSTEM_VERSION 1)
-set(CMAKE_SYSTEM_PROCESSOR "armv7-a")

 # setup the cross-compiler
 set(ANDROID_TOOLCHAIN "${ANDROID_TOOLCHAIN}/${ANDROID_NDK_HOST}")
@@ -107,42 +102,41 @@

 # CXX_FLAGS
 set(ANDROID_SYSROOT	"${ANDROID_NDK}/platforms/android-${ANDROID_API}/arch-arm")
+message(STATUS "sysroot: ${ANDROID_SYSROOT}")
 set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} --sysroot=${ANDROID_SYSROOT}")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables")
+set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=armv7-a -fpic")
+set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -funwind-tables -fstack-protector")
 set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mthumb -fomit-frame-pointer -fno-strict-aliasing")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fsigned-char") # good/necessary when porting desktop libraries
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -march=${CMAKE_SYSTEM_PROCESSOR} -mfloat-abi=softfp")
+set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -finline-limit=64 -fsigned-char") # good/necessary when porting desktop libraries
+set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfloat-abi=softfp")
 #set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=neon")
 set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -mfpu=vfp")
 set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fdata-sections -ffunction-sections")
 set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -Wa,--noexecstack")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fpic")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -frtti")
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -fexceptions")
-set(ANDROID_C_FLAGS "${ANDROID_C_FLAGS} -fpic")
-set(ANDROID_C_FLAGS "${ANDROID_C_FLAGS} -fexceptions")
-
-# GNU STL
-set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -std=gnu++11")
+set(ANDROID_C_FLAGS "${ANDROID_C_FLAGS} ${ANDROID_CXX_FLAGS}")
+set(ANDROID_CXX_FLAGS "${ANDROID_CXX_FLAGS} -std=gnu++11 -frtti -fexceptions")
+
+# GNU STL and sysroot include
 set(ANDROID_STL	"${gnu-libstdc++}/${ANDROID_COMPILER_VERSION}")
 set(ANDROID_STL_INCLUDE_DIRS
 	"${ANDROID_STL}/include"
 	"${ANDROID_STL}/include/backward"
-	"${ANDROID_STL}/libs/${ANDROID_ABI}/include")
+	"${ANDROID_STL}/libs/${ANDROID_EABI}/include")
 include_directories(SYSTEM
 	"${ANDROID_SYSROOT}/usr/include"
 	"${ANDROID_STL_INCLUDE_DIRS}")
-#set(__libstl "${ANDROID_STL}/libs/${ANDROID_ABI}/thumb/libgnustl_static.a")
-#set(__libsupcxx "${ANDROID_STL}/libs/${ANDROID_ABI}/thumb/libsupc++.a")
+# Using Static STL
+#set(__libstl "${ANDROID_STL}/libs/${ANDROID_EABI}/thumb/libgnustl_static.a")
+#set(__libsupcxx "${ANDROID_STL}/libs/${ANDROID_EABI}/thumb/libsupc++.a")
 #set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${__libstl}")
 #set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${__libsupcxx}")
-set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -L${ANDROID_STL}/libs/${ANDROID_ABI}")
+# Using Shared one (already on target)
+set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -L${ANDROID_STL}/libs/${ANDROID_EABI}")
 set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -lgnustl_shared")

 # LINKER flags
 set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -lm -lz")
-set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--fix-cortex-a8")
+set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
 set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--no-undefined")
 set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,-allow-shlib-undefined")
 set(ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} -Wl,--gc-sections")
@@ -161,19 +155,28 @@

 # finish flags
 set( CMAKE_CXX_FLAGS           "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
-set( CMAKE_C_FLAGS             "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}")
+set( CMAKE_C_FLAGS             "${ANDROID_C_FLAGS} ${CMAKE_C_FLAGS}")
 set( CMAKE_SHARED_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}")
 set( CMAKE_MODULE_LINKER_FLAGS "${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}")
 set( CMAKE_EXE_LINKER_FLAGS    "${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}")

-# set these global flags for cmake client scripts to change behavior
-set(ANDROID True)
+# Find Qt5 android_armv7
+set(ANDROID_QT $ENV{ANDROID_QT})
+if(NOT ANDROID_QT)
+	message(FATAL_ERROR "The ANDROID_QT environment variable is not set. Please set it.")
+endif()
+message(STATUS "qt: ${ANDROID_QT}")
+list(APPEND CMAKE_PREFIX_PATH "${ANDROID_QT}/lib/cmake")
+message(STATUS "cmake prefix: ${CMAKE_PREFIX_PATH}")

 # where is the target environment
 set(CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN}/bin" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}")
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+
+# set these global flags for cmake client scripts to change behavior
+set(ANDROID True)

 # Macro to create APK using Qt SDK
 macro(generate_apk TARGET SOURCE_TARGET PACKAGE_NAME)
@@ -194,12 +197,12 @@
 		COMMAND ${CMAKE_COMMAND} -E echo " \"tool-prefix\": \"${ANDROID_TOOLCHAIN_MACHINE_NAME}\"," >> qtdeploy.json
 		COMMAND ${CMAKE_COMMAND} -E echo " \"toolchain-version\": \"${ANDROID_COMPILER_VERSION}\"," >> qtdeploy.json
 		COMMAND ${CMAKE_COMMAND} -E echo " \"ndk-host\": \"${ANDROID_NDK_HOST}\"," >> qtdeploy.json
-		COMMAND ${CMAKE_COMMAND} -E echo " \"target-architecture\": \"${ANDROID_ABI}\"," >> qtdeploy.json
+		COMMAND ${CMAKE_COMMAND} -E echo " \"target-architecture\": \"${ANDROID_EABI}\"," >> qtdeploy.json
 		COMMAND ${CMAKE_COMMAND} -E echo " \"application-binary\": \"$<TARGET_FILE:${SOURCE_TARGET}>\"" >> qtdeploy.json
 		COMMAND ${CMAKE_COMMAND} -E echo "}" >> qtdeploy.json
 		# 2) copy lib (gradle/androiddeployqt issue?)
-		COMMAND  ${CMAKE_COMMAND} -E make_directory android-build/libs/${ANDROID_ABI}/
-		COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SOURCE_TARGET}> android-build/libs/${ANDROID_ABI}/
+		COMMAND  ${CMAKE_COMMAND} -E make_directory android-build/libs/${ANDROID_EABI}/
+		COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${SOURCE_TARGET}> android-build/libs/${ANDROID_EABI}/
 		# 3) Run androiddeployqt
 		COMMAND ${ANDROID_QT}/bin/androiddeployqt
 		--input ${CMAKE_CURRENT_BINARY_DIR}/qtdeploy.json


cmake: use MESSAGE1, not MESSAGE

cmake: use MESSAGE1, not MESSAGE

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -143,10 +143,10 @@
 FOREACH(dir "BIN" "LIB" "PC" "INCLUDE" "DOCS"  "PLUGIN")
   SET(INSTALL_${dir}DIR ${INSTALL_${dir}DIR_${INSTALL_LAYOUT}})
   MARK_AS_ADVANCED(INSTALL_${dir}DIR)
-  MESSAGE(STATUS "MariaDB Connector C: INSTALL_${dir}DIR=${INSTALL_${dir}DIR}")
+  MESSAGE1(INSTALL_${dir}DIR "MariaDB Connector C: INSTALL_${dir}DIR=${INSTALL_${dir}DIR}")
 ENDFOREACH()

 SET(LIBMARIADB_STATIC_NAME ${LIBMARIADB_STATIC_${INSTALL_LAYOUT}})
 MARK_AS_ADVANCED(LIBMARIADB_STATIC_NAME)

-MESSAGE(STATUS "MariaDB Connector C: LIBMARIADB_STATIC_NAME ${LIBMARIADB_STATIC_NAME}")
+MESSAGE1(LIBMARIADB_STATIC_NAME "MariaDB Connector C: LIBMARIADB_STATIC_NAME ${LIBMARIADB_STATIC_NAME}")


ARROW-12130: [C++] Don't enable Neon if -DARROW_SIMD_LEVEL=NONE

Closes #9830 from cyb70289/neon-simd-none

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

--- cpp/cmake_modules/SetupCxxFlags.cmake
+++ cpp/cmake_modules/SetupCxxFlags.cmake
@@ -451,7 +451,9 @@
   endif()
   set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} ${ARROW_ARMV8_ARCH_FLAG}")

-  add_definitions(-DARROW_HAVE_NEON)
+  if(NOT ARROW_SIMD_LEVEL STREQUAL "NONE")
+    add_definitions(-DARROW_HAVE_NEON)
+  endif()

   if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
      AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.4")


IPython: Also install notebook dependencies

--- CMake/Externals/External_IPython.cmake
+++ CMake/Externals/External_IPython.cmake
@@ -30,7 +30,7 @@
     BUILD_IN_SOURCE 1
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
-    INSTALL_COMMAND ${PIP_EXECUTABLE} install -e .
+    INSTALL_COMMAND ${PIP_EXECUTABLE} install -e .[notebook]
     DEPENDS
       ${${proj}_DEPENDENCIES}
     )


Fix issue #46: Disable the build of CompareVolumes

CompareVolumes is a Remote Module of Slicer.

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -130,6 +130,7 @@
       # Slicer remote modules
       -DSlicer_BUILD_BRAINSTOOLS:BOOL=OFF
       -DSlicer_BUILD_ChangeTrackerPy:BOOL=OFF
+      -DSlicer_BUILD_CompareVolumes:BOOL=OFF
       -DSlicer_BUILD_EMSegment:BOOL=OFF
       -DSlicer_BUILD_DataStore:BOOL=OFF
       -DSlicer_BUILD_LandmarkRegistration:BOOL=OFF


Use ${IREE_HOST_SCRIPT_EXT} in CMake iree_py_test. (#2609)

This gets the CMake Python tests closer to running/passing on Windows. There was no regression in https://github.com/google/iree/pull/2590, the old `iree_py_test.cmake` also had this issue.

`ctest -L bindings/python -V` output before:

```
353: Test command: D:\dev\projects\iree\build_tools\cmake\run_test.sh "C:/Users/Scott/scoop/shims/python3.exe" "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py"
353: Environment variables:
353:  PYTHONPATH=D:/dev/projects/iree-build-py/bindings/python:
353:  TEST_TMPDIR=bindings_python_pyiree_compiler_compiler_test_DEFAULT_test_tmpdir
353: Test timeout computed to be: 10000000
Process not started
 D:/dev/projects/iree/build_tools/cmake/run_test.sh
[unknown error]
5/5 Test #353: bindings/python/pyiree/compiler:compiler_test__DEFAULT ...***Not Run   0.00 sec
```

`ctest -L bindings/python -V` output after:

```
353: Test command: D:\dev\projects\iree\build_tools\cmake\run_test.bat "C:/Users/Scott/scoop/shims/python3.exe" "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py"
353: Environment variables:
353:  PYTHONPATH=D:/dev/projects/iree-build-py/bindings/python:
353:  TEST_TMPDIR=bindings_python_pyiree_compiler_compiler_test_DEFAULT_test_tmpdir
353: Test timeout computed to be: 10000000
353: Running test:
353: C:/Users/Scott/scoop/shims/python3.exe D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py
353: Traceback (most recent call last):
353:   File "D:/dev/projects/iree/bindings/python/pyiree/compiler/compiler_test.py", line 17, in <module>
353:     from pyiree import compiler
353: ModuleNotFoundError: No module named 'pyiree'
5/5 Test #353: bindings/python/pyiree/compiler:compiler_test__DEFAULT ...***Failed    0.44 sec
```

--- build_tools/cmake/iree_multipy.cmake
+++ build_tools/cmake/iree_multipy.cmake
@@ -292,7 +292,10 @@
     set(VER_NAME "${_NAME_PATH}__${V}")
     add_test(
       NAME ${VER_NAME}
-      COMMAND ${CMAKE_SOURCE_DIR}/build_tools/cmake/run_test.sh "${IREE_MULTIPY_${V}_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRCS}"
+      COMMAND
+        "${CMAKE_SOURCE_DIR}/build_tools/cmake/run_test.${IREE_HOST_SCRIPT_EXT}"
+        "${IREE_MULTIPY_${V}_EXECUTABLE}"
+        "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRCS}"
       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     )


Don't configure sanitizers if CMake is less than 3.13

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/config/OpenVDBBuildTypes.cmake
+++ cmake/config/OpenVDBBuildTypes.cmake
@@ -1,6 +1,3 @@
-
-# Requires add_link_options from 3.13
-cmake_minimum_required(VERSION 3.13)

 # Build Types
 set(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE}
@@ -16,6 +13,15 @@

 # DebugNoInfo - An internal build type only used by the OpenVDB CI. no optimizations, no symbols, asserts enabled
 set(CMAKE_CXX_FLAGS_DebugNoInfo "" CACHE STRING "Flags used by the C++ compiler during DebugNoInfo builds.")
+
+# Requires add_link_options from 3.13
+if(${CMAKE_VERSION} VERSION_LESS 3.13)
+  if(${CMAKE_BUILD_TYPE} IN_LIST EXTRA_BUILD_TYPES)
+    message(FATAL_ERROR "Build type ${CMAKE_BUILD_TYPE} requires CMake version 3.13 or higher.")
+  endif()
+  return()
+endif()
+cmake_minimum_required(VERSION 3.13)

 foreach(TYPE ${EXTRA_BUILD_TYPES})
   set(CMAKE_CXX_FLAGS_${U_TYPE} "" CACHE STRING "Flags used by the C++ compiler during ${TYPE} builds.")


[CMAKE] Enable ccache by default on ARM

[CMAKE] Enable ccache by default on ARM

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -90,7 +90,11 @@
 ROOT_BUILD_OPTION(libcxx OFF "Build using libc++, requires cxx11 option (MacOS X only, for the time being)")
 ROOT_BUILD_OPTION(cxxmodules "Compile with C++ modules enabled." OFF)
 ROOT_BUILD_OPTION(castor ON "CASTOR support, requires libshift from CASTOR >= 1.5.2")
-ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
+if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+  ROOT_BUILD_OPTION(ccache ON "Enable ccache usage for speeding up builds")
+else()
+  ROOT_BUILD_OPTION(ccache OFF "Enable ccache usage for speeding up builds")
+endif()
 ROOT_BUILD_OPTION(chirp ON "Chirp support (Condor remote I/O), requires libchirp_client")
 ROOT_BUILD_OPTION(cling ON "Enable new CLING C++ interpreter")
 ROOT_BUILD_OPTION(cocoa OFF "Use native Cocoa/Quartz graphics backend (MacOS X only)")


[NFC] Typo in comment.

[NFC] Typo in comment.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -56,7 +56,7 @@

 #--------------------------------------------------------------------------------------------------
-#---Full list of options with their descriptios and default values
+#---Full list of options with their descriptions and default values
 #   The default value can be changed as many times as we wish before calling ROOT_APPLY_OPTIONS()
 #--------------------------------------------------------------------------------------------------


Revert "Add BUILD_SHARED_LIBS build option to ROOT"

This reverts commit 1d9eddb9d0d97c1ef3cb47759eb7f60016ba890f.

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -194,8 +194,6 @@

 set(gcctoolchain "" CACHE PATH "Set path to GCC toolchain used to build llvm/clang")

-option(BUILD_SHARED_LIBS "Build shared libraries by default" ON)
-
 if (runtime_cxxmodules)
   set(pch_defvalue OFF)
 endif(runtime_cxxmodules)


cmake: Prevent infinite recursion

cmake: Prevent infinite recursion

If SDK_VERSION for whatever reason is unset cmake will end up in an
inifite recursion loop, which for me crashed using cmake version
3.13.4 and exits with an error using 3.14.1.

This may happen if ZEPHYR_TOOLCHAIN_VARIANT is set to "zephyr", but
ZEPHYR_SDK_INSTALL_DIR is invalid (or unset).

Signed-off-by: Jacob Siverskog <f862f167b85d41b225785c70d70808bc7337c1fe@teenage.engineering>

--- cmake/toolchain/zephyr/generic.cmake
+++ cmake/toolchain/zephyr/generic.cmake
@@ -1,3 +1,7 @@
 # SPDX-License-Identifier: Apache-2.0

+if(NOT DEFINED SDK_VERSION)
+  message(FATAL_ERROR "SDK_VERSION must be set")
+endif()
+
 include(${ZEPHYR_BASE}/cmake/toolchain/zephyr/${SDK_VERSION}/generic.cmake)


fixing build script

fixing build script

--- linux-toolchain.cmake
+++ linux-toolchain.cmake
@@ -5,7 +5,7 @@
 SET (CMAKE_CXX_COMPILER g++)
 SET (CMAKE_CXX_FLAGS "-Wall -g -mavx -std=c++11 -Wno-sign-compare" CACHE STRING "-Wall -g -O2 -std=c++11 -Wno-sign-compare")
 SET (CMAKE_CXX_FLAGS_RELEASE "-Wall -DNDEBUG -O2 -std=c++11" CACHE STRING "release build")
-SET (CMAKE_CXX_FLAGS_DEBUG "-Wall -mavx -std=c++11 -Wno-sign-compare" CACHE STRING "-Wall -O2 -std=c++11 -Wno-sign-compare")
+SET (CMAKE_CXX_FLAGS_DEBUG "-Wall -mavx -g -std=c++11 -Wno-sign-compare" CACHE STRING "debug build")

 SET (CMAKE_EXPORT_COMPILE_COMMANDS 1)
 SET (CMAKE_EXPORT_COMPILE_COMMANDS "${CMAKE_EXPORT_COMPILE_COMMANDS}" CACHE STRING "export compile_commands.json")


Add replacement of Files and Data Structures navetree links to
CMake_rundoxygen.cmake, which we export for other tools.
Xref Dr. Memory i#1409.

SVN-Revision: 2448

--- api/docs/CMake_rundoxygen.cmake
+++ api/docs/CMake_rundoxygen.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2012 Google, Inc.    All rights reserved.
+# Copyright (c) 2012-2013 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -40,6 +40,8 @@
 # + version_number      : version number to put in the docs
 # + module_string_long  : replacement text for Modules
 # + module_string_short : replacement text for Module
+# + files_string        : replacement text for Files; optional
+# + structs_string      : replacement text for Data Structures; optional
 # + home_url            : home page URL
 # + home_title          : home page title
 # + logo_imgfile        : image file with logo
@@ -49,6 +51,12 @@
 # Any quotes carry over and it's simplest to assume not there.
 string(REPLACE "\"" "" module_string_long ${module_string_long})
 string(REPLACE "\"" "" module_string_short ${module_string_short})
+if (DEFINED files_string)
+  string(REPLACE "\"" "" files_string ${files_string})
+endif ()
+if (DEFINED structs_string)
+  string(REPLACE "\"" "" structs_string ${structs_string})
+endif ()
 string(REPLACE "\"" "" home_url ${home_url})
 string(REPLACE "\"" "" home_title ${home_title})
 string(REPLACE "\"" "" logo_imgfile ${logo_imgfile})
@@ -171,6 +179,14 @@
     "\\}\n*$"
     "${add_logo}\n}"
     string "${string}")
+  # While we're here we replace Files and Data Structures, if requested
+  if (DEFINED files_string)
+    string(REGEX REPLACE "\"Files\"" "\"${files_string}\"" string "${string}")
+  endif ()
+  if (DEFINED structs_string)
+    string(REGEX REPLACE "\"Data Structures\"" "\"${structs_string}\""
+      string "${string}")
+  endif ()
   file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/html/navtree.js "${string}")
 endif ()


Change plimage to c_plimage in pragma statement. plimage is part of
the common api. Fixes link error with ada examples on Ubuntu.

svn path=/trunk/; revision=8370

--- bindings/ada/plplot_thin.ads.cmake
+++ bindings/ada/plplot_thin.ads.cmake
@@ -1392,7 +1392,7 @@
     plimage( data : Long_Float_Pointer_Array; nx : PLINT; ny : PLINT;
          xmin : PLFLT; xmax : PLFLT; ymin : PLFLT; ymax : PLFLT; zmin : PLFLT; zmax : PLFLT;
          Dxmin : PLFLT; Dxmax : PLFLT; Dymin : PLFLT; Dymax : PLFLT);
-    pragma Import(C, plimage, "plimage");
+    pragma Import(C, plimage, "c_plimage");

     -- Set up a new line style


refs #6566 Improve xz source clone code, cleanup xz subproject

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@55449 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuThirdParty.cmake
+++ cmake_modules/TokuThirdParty.cmake
@@ -54,34 +54,25 @@
 FILE(GLOB XZ_ALL_FILES ${XZ_SOURCE_DIR}/*)
 if (CMAKE_GENERATOR STREQUAL Ninja)
   ## ninja doesn't understand "$(MAKE)"
-  ExternalProject_Add(build_lzma
+  set(SUBMAKE_COMMAND make)
+else ()
+  ## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
+  ## seem to break Xcode...
+  set(SUBMAKE_COMMAND $(MAKE))
+endif ()
+
+ExternalProject_Add(build_lzma
     PREFIX xz
     DOWNLOAD_COMMAND
-        cd ${XZ_SOURCE_DIR} && cp -ru "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
+        cp -au "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
     CONFIGURE_COMMAND
         "<SOURCE_DIR>/configure" ${xz_configure_opts}
         "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
     BUILD_COMMAND
-        make -C src/liblzma
+        ${SUBMAKE_COMMAND} -C src/liblzma
     INSTALL_COMMAND
-        make -C src/liblzma install
-    )
-else ()
-  ## use "$(MAKE)" for submakes so they can use the jobserver, doesn't
-  ## seem to break Xcode...
-  ExternalProject_Add(build_lzma
-    PREFIX xz
-    DOWNLOAD_COMMAND
-        cd ${XZ_SOURCE_DIR} && cp -ru "${XZ_ALL_FILES}" "<SOURCE_DIR>/"
-    CONFIGURE_COMMAND
-        "<SOURCE_DIR>/configure" ${xz_configure_opts}
-        "--prefix=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/xz"
-    BUILD_COMMAND
-        $(MAKE) -C src/liblzma
-    INSTALL_COMMAND
-        $(MAKE) -C src/liblzma install
-    )
-endif ()
+        ${SUBMAKE_COMMAND} -C src/liblzma install
+)
 FILE(GLOB_RECURSE XZ_ALL_FILES_RECURSIVE ${XZ_SOURCE_DIR}/*)
 ExternalProject_Add_Step(build_lzma reclone_src # Names of project and custom step
     COMMENT "(re)cloning xz source..."     # Text printed when step executes


[cmake] fix for FindOpenGV

[cmake] fix for FindOpenGV

--- src/cmakeFindModules/FindOpenGV.cmake
+++ src/cmakeFindModules/FindOpenGV.cmake
@@ -5,7 +5,7 @@
 #   OPENGV_FOUND        - TRUE if the openGV headers and libs are found
 #   OPENGV_INCLUDE_DIRS - The path to openGV headers
 #
-#   OPENGV_LIBRARIES    - All openGV libraries
+#   OPENGV_LIBRARY      - The opengv library
 #   OPENGV_LIBRARY_DIR  - The directory where the libraries are located
 #
 # Accepts the following variables as input:


BUG: URL for NETCDF changed

BUG: URL for NETCDF changed

--- SuperBuild/CMake/External_netcdf.cmake
+++ SuperBuild/CMake/External_netcdf.cmake
@@ -36,8 +36,8 @@

 ExternalProject_Add(NETCDF
   PREFIX NETCDF
-  URL "https://www.unidata.ucar.edu/downloads/netcdf/ftp/netcdf-c-4.7.4.tar.gz"
-  URL_MD5 3e0a97e6abb9a989f8a8a2e395473597
+  URL "https://github.com/Unidata/netcdf-c/archive/refs/tags/v4.7.4.tar.gz"
+  URL_MD5 33979e8f0cf4ee31323fc0934282111b
   SOURCE_DIR ${NETCDF_SB_SRC}
   BINARY_DIR ${NETCDF_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


Use the sanitized branch name for standardese branch documentation links

--- doc/process_standardese_output.cmake
+++ doc/process_standardese_output.cmake
@@ -35,12 +35,13 @@
     foreach(branch ${branches})
         if(IS_DIRECTORY "${ROOT_DIR}/${branch}")
             # Get back the branch name from the encoded directory name:
+            set(sanitized_branch "${branch}")
             string(REGEX REPLACE "__slash__" "/" branch "${branch}")

             message(STATUS " - branch '${branch}'")

             set(index "${index}
- - [`${branch}` branch documentation](${standardese_doc_url}/${branch}/)")
+ - [`${branch}` branch documentation](${standardese_doc_url}/${sanitized_branch}/)")
         endif()
     endforeach()


Respect the INTR_QTDIR (env)variable

Respect the INTR_QTDIR (env)variable

--- cmake/FindQt5.cmake
+++ cmake/FindQt5.cmake
@@ -12,6 +12,8 @@
     NAMES qmake qmake5 qmake-qt5
     PATH_SUFFIXES bin
     PATHS
+      ${INTR_QTDIR}
+      $ENV{INTR_QTDIR}
       ${QT_SEARCH_PATH}
       $ENV{QTDIR}
       ~/Library/Frameworks


modified timeout value on windows and mac (#26690)

--- cmake/generic.cmake
+++ cmake/generic.cmake
@@ -385,7 +385,11 @@
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true)
     set_property(TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true)
     # No unit test should exceed 2 minutes.
-    set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)
+    if (APPLE OR WIN32)
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
+    else()
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)
+    endif()
   endif()
 endfunction()

@@ -742,9 +746,14 @@
                ${PYTHON_EXECUTABLE} -u ${py_test_SRCS} ${py_test_ARGS}
                WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
     endif()
-
-    # No unit test should exceed 2 minutes.
-    set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)
+
+    if (APPLE OR WIN32)
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 600)
+    else()
+        # No unit test should exceed 2 minutes in Linux.
+        set_tests_properties(${TARGET_NAME} PROPERTIES TIMEOUT 120)
+    endif()
+
   endif()
 endfunction()