Package the looking glass plugin on Mac

Package the looking glass plugin on Mac

This does an install + fixup for the looking glass plugin on the Mac.

It also provides a little flexibility to add more plugins in the future.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -96,6 +96,51 @@
   "
   COMPONENT superbuild)

+install(CODE
+  "
+  set(_pv_plugins_to_install
+    LookingGlass
+  )
+
+  # Skip these names when installing plugins
+  set(_skip_names_list
+    vtk
+  )
+
+  set(_pv_plugin_paths)
+
+  foreach(plugin \${_pv_plugins_to_install})
+    file(GLOB plugin_files \"${superbuild_install_location}/lib/paraview-5.9/plugins/\${plugin}/*\")
+    foreach(plugin_path \${plugin_files})
+      get_filename_component(_name_without_dir \${plugin_path} NAME)
+      list (FIND _skip_names_list \${_name_without_dir} _index)
+      if (\${_index} GREATER -1)
+        continue()
+      endif()
+      list(APPEND _pv_plugin_paths \${plugin_path})
+    endforeach()
+  endforeach()
+
+  set(_name \"tomviz.app\")
+  foreach(plugin_path \${_pv_plugin_paths})
+    execute_process(
+      COMMAND \"${_superbuild_install_cmake_dir}/scripts/fixup_bundle.apple.py\"
+              --bundle      \"\${_name}\"
+              --destination \"\${CMAKE_INSTALL_PREFIX}\"
+              --manifest    \"${CMAKE_BINARY_DIR}/\${_name}.manifest\"
+              --location    \"Contents/Plugins\"
+              --type        module
+              \"\${plugin_path}\"
+      RESULT_VARIABLE res
+      ERROR_VARIABLE  err)
+
+    if (res)
+      message(FATAL_ERROR \"Failed to install \${_name}:\n\${err}\")
+    endif ()
+  endforeach()
+  "
+  COMPONENT superbuild)
+
 # This directory is not a python module (no __init__.py) so it is skipped by the packaging script
 # as not important (junk like numpy's headers).  However, ITK's python interface is completely broken
 # without it.


Fix Python install rules on OsX.

Fix Python install rules on OsX.

Add rules to install tomviz and ParaView Python module files
in the app bundle.

Also install PythonD.dylib files explicitly, since they
do not get installed automatically by fixup_bundle.

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -5,13 +5,25 @@

 install(CODE "
      file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}\" USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
-          \"${install_location}/Applications/TomViz.app\")
+          \"${install_location}/Applications/tomviz.app\")

-     file(WRITE \"\${CMAKE_INSTALL_PREFIX}/TomViz.app/Contents/Resources/qt.conf\"
+     file(WRITE \"\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Resources/qt.conf\"
                 \"\")
-     execute_process(
+
+    # install all python modules/packages from paraview.
+    file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Python\"
+         USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
+         \"${install_location}/Applications/paraview.app/Contents/Python/\")
+
+    # install all other libraries from paraview (this is needed for the PythonD-*.dylib files
+    # which don't get copied over by the fixup_bundle.py
+    file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Libraries\"
+         USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
+         \"${install_location}/Applications/paraview.app/Contents/Libraries/\")
+
+    execute_process(
        COMMAND ${CMAKE_CURRENT_LIST_DIR}/fixup_bundle.py
-               \"\${CMAKE_INSTALL_PREFIX}/TomViz.app\"
+               \"\${CMAKE_INSTALL_PREFIX}/tomviz.app\"
                \"${install_location}/lib\"
                \"${install_location}/plugins\")
    "


libRaptorQ: turn off LTO on MacOSX

libRaptorQ: turn off LTO on MacOSX

--- projects/libraptorq.cmake
+++ projects/libraptorq.cmake
@@ -49,8 +49,8 @@
     -DPROFILING=OFF
     -DBUILD_SHARED_LIB=ON
     )
-  if(${CMAKE_SYSTEM_NAME} STREQUAL SunOS)
-    # TODO: Solaris linker error when LTO turned ON
+  if(${CMAKE_SYSTEM_NAME} STREQUAL SunOS OR ${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
+    # TODO: Solaris and MacOSX linker error when LTO turned ON
     list(APPEND XP_CONFIGURE -DLTO=OFF)
   else()
     list(APPEND XP_CONFIGURE -DLTO=ON)


erthink-cmake: rework /EHsc & /EHa optionws for MSVC.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -475,9 +475,6 @@
 macro(setup_compile_flags)
   # save initial C/CXX flags
   if(NOT INITIAL_CMAKE_FLAGS_SAVED)
-    if(MSVC)
-      string(REGEX REPLACE "^(.*)(/EHsc)( *)(.*)$" "\\1/EHs\\3\\4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-    endif()
     set(INITIAL_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "Initial CMake's flags" FORCE)
     set(INITIAL_CMAKE_C_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "Initial CMake's flags" FORCE)
     set(INITIAL_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} CACHE STRING "Initial CMake's flags" FORCE)
@@ -501,6 +498,22 @@
   if(CC_HAS_FCXX_EXCEPTIONS)
     add_compile_flags("CXX" "-fcxx-exceptions -frtti")
   endif()
+  if(MSVC)
+    # checks for /EHa or /clr options exists,
+    # i.e. is enabled structured async WinNT exceptions
+    string(REGEX MATCH "^(.* )*[-/]EHc*a( .*)*$" msvc_async_eh_enabled "${CXX_FLAGS}" "${C_FLAGS}")
+    string(REGEX MATCH "^(.* )*[-/]clr( .*)*$" msvc_clr_enabled "${CXX_FLAGS}" "${C_FLAGS}")
+    # remote any /EH? options
+    string(REGEX REPLACE "( *[-/]-*EH[csa]+ *)+" "" CXX_FLAGS "${CXX_FLAGS}")
+    string(REGEX REPLACE "( *[-/]-*EH[csa]+ *)+" "" C_FLAGS "${C_FLAGS}")
+    if (msvc_clr_enabled STREQUAL "")
+      if(NOT msvc_async_eh_enabled STREQUAL "")
+        add_compile_flags("C;CXX" "/EHa")
+      else()
+        add_compile_flags("C;CXX" "/EHsc")
+      endif()
+    endif()
+  endif(MSVC)

   if(CC_HAS_WNO_ATTRIBUTES AND CMAKE_COMPILER_IS_GNU${CMAKE_PRIMARY_LANG}
       AND CMAKE_${CMAKE_PRIMARY_LANG}_COMPILER_VERSION VERSION_LESS 9)


cmake: Use specific instruction sets for extra CPU features

--- cmake/cpu_feat.cmake
+++ cmake/cpu_feat.cmake
@@ -1,2 +1,2 @@
-set(CAPABS "-march=native -mfpmath=sse")
+set(CAPABS "-mavx2 -maes -mfpmath=sse")
 message(STATUS "Using native CPU features. CAPABS = ${CAPABS}")


Compile own version of sdl2 to try fix dep problems on windows.

--- cmake/get-sdl2.cmake
+++ cmake/get-sdl2.cmake
@@ -7,51 +7,12 @@

 set(SDL2_VERSION "2.0.5")

-# For Windows it's faster to download the pre-compiled development binaries.
-if (WIN32)
-
-  if(MINGW) # download pre-compiled SDL2 dev package for MinGW 32/64-bit
-
-    ExternalProject_Add(
-      sdl2
-      PREFIX ${DEPENDENCY_EXTRACT_DIR}
-      DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
-      URL http://libsdl.org/release/SDL2-devel-${SDL2_VERSION}-mingw.tar.gz
-      URL_MD5 ecf8fb614d57e7d284086a36dae6878f
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND
-        COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/sdl2/lib     ${DEPENDENCY_INSTALL_DIR}/lib
-        COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/sdl2/include ${DEPENDENCY_INSTALL_DIR}/include/SDL2
-    )
-
-  endif(MINGW)
-
-  if(MSVC) # download pre-compiled SDL2 dev package for Visual C++ 32/64-bit
-
-    ExternalProject_Add(
-      sdl2
-      PREFIX ${DEPENDENCY_EXTRACT_DIR}
-      DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
-      URL http://libsdl.org/release/SDL2-devel-${SDL2_VERSION}-VC.zip
-      URL_MD5 b771f36bb640c173e53fa8259cdd3835
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND
-        COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/sdl2/lib     ${DEPENDENCY_INSTALL_DIR}/lib
-        COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDENCY_EXTRACT_DIR}/src/sdl2/include ${DEPENDENCY_INSTALL_DIR}/include/SDL2
-    )
-
-  endif(MSVC)
-
-else() # build from source
-
-  set(SDL2_CMAKE_ARGS
-      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-      -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-      -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
+set(SDL2_CMAKE_ARGS ${COMMON_CMAKE_ARGS}
+    -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+    -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+    -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+    -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
   )

   ExternalProject_Add(


patch from helping rmli overcome installation issues.

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@7992 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/lcmtypes.cmake
+++ cmake/lcmtypes.cmake
@@ -251,6 +251,10 @@
     find_package(Java REQUIRED)
     include(UseJava)

+    pods_find_pkg_config(lcm-java)
+    if (NOT lcm-java_FOUND)
+      message(FATAL_ERROR "Couldn't find lcm-java.pc.  Are you sure that LCM was compiled/installed with JAVA support enabled?")
+    endif()
     pods_use_pkg_config_classpath(lcm-java)

     add_jar(${LCMTYPES_JARNAME} ${LCMTYPES_JAVA_SOURCEFILES})


fix DEB and RPM dependeces syntax

fix DEB and RPM dependeces syntax

--- packaging/linux/LinuxPackaging.cmake
+++ packaging/linux/LinuxPackaging.cmake
@@ -55,7 +55,7 @@
     "dcmtk-inria, itk-inria-build, medinria-plugins, medinria-plugins-asclepios, medinria-visages-plugins, vtk-inria-build"
     )#TODO When we will not support old fedora it will not be necessary anymore.
   set(CPACK_RPM_PACKAGE_PROVIDES
-    "${CPACK_PACKAGE_NAME} \(=${CPACK_PACKAGE_VERSION}\)"
+    "${CPACK_PACKAGE_NAME} =${CPACK_PACKAGE_VERSION}"
     )
   set(CPACK_RPM_PACKAGE_LICENSE BSD)
   set (CPACK_RPM_PACKAGE_ARCHITECTURE ${ARCH})
@@ -68,7 +68,7 @@
   set(CPACK_DEBIAN_PACKAGE_HOMEPAGE http://med.inria.fr/)
   set(CPACK_DEBIAN_PACKAGE_NAME ${CPACK_PACKAGE_NAME})
   set(CPACK_DEBIAN_PACKAGE_PROVIDES
-    "${CPACK_PACKAGE_NAME} = ${CPACK_PACKAGE_VERSION}"
+    "${CPACK_PACKAGE_NAME} \(=${CPACK_PACKAGE_VERSION}\)"
     )
   set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
 endif()


Add default VESPA_CPU_ARCH_FLAGS setting when using clang on Fedora.


COMP: Update CIP project to ensure latest version of "develop" branch is used

--- SuperBuild/External_CIP.cmake
+++ SuperBuild/External_CIP.cmake
@@ -34,7 +34,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY "${git_protocol}://github.com/acil-bwh/ChestImagingPlatform.git"
-    GIT_TAG develop
+    GIT_TAG origin/develop
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build
     CMAKE_CACHE_ARGS


Fix setting using git vs https protocol for ITK superbuild

The variable was unset before.

Change-Id: I5b236b60f70bc3536a8aaee05361d2c6dd131ead

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -33,6 +33,11 @@

 set(proj ITK)  ## Use ITK convention of calling it ITK
 set(ITK_REPOSITORY "${git_protocol}://itk.org/ITK.git")
+
+set(ITK_USE_GIT_PROTOCOL 0)
+if("${git_protocol}" STREQUAL "git")
+  set(ITK_USE_GIT_PROTOCOL 1)
+endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
 set(ITK_TAG_COMMAND GIT_TAG  v4.10.0 )


COMP: Bump ITK superbuild version for SetNumberOfWorkUnits

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

 if( NOT ITK_TAG )
-  # 2018-05-25
-  set( ITK_TAG "v5.0a02" )
+  # 2018-08-13
+  set( ITK_TAG "6b41fe1cbf7a71a6003d4824e02a69b41a508cda" )
 endif()

 set( _vtk_args )


ENH: Bump ITK Superbuild version to 2016-09-20 master

Change-Id: Id631ea8d2b0bd8f614b5656471f6d70caed8196c

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

 if( NOT ITK_TAG )
-  # ITK 4.10.0
-  set( ITK_TAG "v4.10.0" )
+  # ITK master 2016-09-20
+  set( ITK_TAG "077527e86d96daf88663fda6bf7abeb1e92b9d9d" )
 endif()

 set( _vtk_args )


fix compiler options

fix compiler options

--- Template/CompilerOption.cmake
+++ Template/CompilerOption.cmake
@@ -21,9 +21,19 @@
 if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
     add_definitions(-Wall -Werror)

-    if(UNIX and NOT CYGWIN and not MINGW) {
+    if(NOT WIN32 AND NOT CYGWIN AND NOT MINGW)
+        add_definitions(-fPIC)
+    endif()
+
+    include(CheckCCompilerFlag)
+    message(STATUS "Check Flag: -rdynamic -- running")
+    CHECK_C_COMPILER_FLAG(-rdynamic, C_FLAGS_RDYNAMIC_AVAILABLE)
+    if(C_FLAGS_RDYNAMIC_AVAILABLE)
+        message(STATUS "Check Flag: -rdynamic -- yes")
         add_definitions(-rdynamic)
-    }
+    else()
+        message(STATUS "Check Flag: -rdynamic -- no")
+    endif()

     # gcc 4.9 编译输出颜色支持
     if ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.9.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.9.0" )
@@ -44,7 +54,7 @@
         set(CMAKE_CXX_STANDARD 11)
         message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c11/c++11.")
     elseif( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.4.0" OR CMAKE_CXX_COMPILER_VERSION  VERSION_EQUAL "4.4.0" )
-        set(CXX_FLAGS_IN_ONE_COMMON "${C_FLAGS_IN_ONE_COMMON} -std=c++0x")
+        set(CXX_FLAGS_IN_ONE_COMMON "${CMAKE_CXX_COMPILER_VERSION} -std=c++0x")
         message(STATUS "GCC Version ${CMAKE_CXX_COMPILER_VERSION} , using -std=c++0x.")
     endif()


Remove karabiner_version.h.in from common.cmake

--- src/common.cmake
+++ src/common.cmake
@@ -23,11 +23,6 @@
 file(READ ${CMAKE_CURRENT_LIST_DIR}/../version KARABINER_VERSION)
 string(STRIP ${KARABINER_VERSION} KARABINER_VERSION)

-configure_file (
-  ${CMAKE_CURRENT_LIST_DIR}/share/karabiner_version.h.in
-  ${CMAKE_CURRENT_LIST_DIR}/share/karabiner_version.h
-)
-
 # Variables to avoid string replacement in Info.plist

 set(PLIST_EXECUTABLE_NAME "$\{EXECUTABLE_NAME\}")


fix hdmarker VAD

fix hdmarker VAD

--- VAD_hdmarker.cmake
+++ VAD_hdmarker.cmake
@@ -15,8 +15,8 @@

   vad_deps(${ARGN})

-  if (NOT OpenCV_FOUND AND NOT Ceres_FOUND)
-    message("hdmarker: OpenCV or Ceres missing!")
+  if (NOT OPENCV_FOUND AND NOT CERES_FOUND)
+    message(FATAL_ERROR "hdmarker: OpenCV or Ceres missing!")
     return()
   endif()


Only build gtest if you have tests enabled

--- 3rdparty/3rdparty.cmake
+++ 3rdparty/3rdparty.cmake
@@ -38,11 +38,13 @@
 #####################
 # Setup google test #
 #####################
-set(INSTALL_GTEST OFF)
-set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib." FORCE)
-set(BUILD_GMOCK OFF CACHE BOOL "Build GMOCK shared library" FORCE)
-add_subdirectory(3rdparty/googletest)
-include(GoogleTest)
+if(NOVA_TEST)
+	set(INSTALL_GTEST OFF)
+	set(gtest_force_shared_crt ON CACHE BOOL "Use shared (DLL) run-time lib even when Google Test is built as static lib." FORCE)
+	set(BUILD_GMOCK OFF CACHE BOOL "Build GMOCK shared library" FORCE)
+	add_subdirectory(3rdparty/googletest)
+	include(GoogleTest)
+endif()

 #######################
 # Submodule libraries #


FIX (#3983): evaluate MOC_H_FILES again. Modules without a Testing subdirectory are broken

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -377,12 +377,14 @@
 MACRO(MITK_CREATE_MODULE_TESTS)
 MACRO_PARSE_ARGUMENTS(MODULE_TEST "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE" "" ${ARGN})
 IF(BUILD_TESTING AND MODULE_IS_ENABLED)
+  SET(OLD_MOC_H_FILES ${MOC_H_FILES})
+  SET(MOC_H_FILES)
   INCLUDE(files.cmake)
   INCLUDE_DIRECTORIES(.)

-  IF(DEFINED MODULE_TEST_MOC_H_FILES)
-    QT4_WRAP_CPP(MODULE_TEST_GENERATED_MOC_CPP ${MODULE_TEST_MOC_H_FILES})
-  ENDIF(DEFINED MODULE_TEST_MOC_H_FILES)
+  IF(DEFINED MOC_H_FILES)
+    QT4_WRAP_CPP(MODULE_TEST_GENERATED_MOC_CPP ${MOC_H_FILES})
+  ENDIF(DEFINED MOC_H_FILES)

   SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LogBackend::Register(); ${MODULE_TEST_EXTRA_DRIVER_INIT};")
   SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN "mitk::LogBackend::Unregister();")


ENH (#2122): new parameter for module test macro to add initializer code to test driver.

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -367,17 +367,28 @@
   ENDIF()
 ENDMACRO(MITK_INSTALL_TARGETS)

+#
+# Create tests and testdriver for this module
+#
+# Usage: MITK_CREATE_MODULE_TESTS( [EXTRA_DRIVER_INIT init_code]  )
+#
+# EXTRA_DRIVER_INIT is inserted as c++ code in the testdriver and will be executed before each test
+#
 MACRO(MITK_CREATE_MODULE_TESTS)
+MACRO_PARSE_ARGUMENTS(MODULE_TEST "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE" "" ${ARGN})
 IF(BUILD_TESTING AND MODULE_IS_ENABLED)
   INCLUDE(files.cmake)
   INCLUDE_DIRECTORIES(.)

-  SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LogBackend::Register();")
+  SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LogBackend::Register(); ${MODULE_TEST_EXTRA_DRIVER_INIT};")
   SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN "mitk::LogBackend::Unregister();")
-
+  IF(NOT MODULE_TEST_EXTRA_DRIVER_INCLUDE)
+    # this is necessary to make the LogBackend calls available if nothing else is included
+    SET(MODULE_TEST_EXTRA_DRIVER_INCLUDE "mitkLog.h")
+  ENDIF(NOT MODULE_TEST_EXTRA_DRIVER_INCLUDE)
   CREATE_TEST_SOURCELIST(MODULETEST_SOURCE ${MODULE_NAME}TestDriver.cpp
     ${MODULE_TESTS} ${MODULE_IMAGE_TESTS} ${MODULE_CUSTOM_TESTS}
-    EXTRA_INCLUDE mitkLog.h
+    EXTRA_INCLUDE ${MODULE_TEST_EXTRA_DRIVER_INCLUDE}
   )
   SET(TESTDRIVER ${MODULE_NAME}TestDriver)
   ADD_EXECUTABLE(${TESTDRIVER} ${MODULETEST_SOURCE})


Change the way abi_generator plugin is called in the build process

--- CMakeModules/wasm.cmake
+++ CMakeModules/wasm.cmake
@@ -100,19 +100,6 @@
       VERBATIM
     )
     set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${outfile}.bc)
-
-    add_custom_command(OUTPUT ${outfile}.abi-stamp
-      DEPENDS ${infile}.bc abi_generator
-      COMMAND ${WASM_CLANG} --std=c++14 --target=wasm32 -I ${INCLUDE_FOLDERS}
-              -Xclang -load -Xclang $<TARGET_FILE:abi_generator>
-              -Xclang -plugin -Xclang generate-abi ${infile}
-      IMPLICIT_DEPENDS CXX ${infile}
-      COMMENT "Extracting ABI information from ${outfile}"
-      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      VERBATIM
-    )
-    set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${outfile}.abi-stamp)
-
     list(APPEND outfiles ${outfile}.bc)

   endforeach(srcfile)
@@ -135,9 +122,25 @@
   )
   set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${target}.s)

+  add_custom_command(OUTPUT ${DESTINATION_FOLDER}/${target}.abi
+    DEPENDS ${target}.s abi_generator
+    COMMAND rm -f ${DESTINATION_FOLDER}/${target}.abi
+    COMMAND ${WASM_CLANG} -c --std=c++14 --target=wasm32 -I ${INCLUDE_FOLDERS} -fparse-all-comments
+            -Xclang -load -Xclang $<TARGET_FILE:abi_generator>
+            -Xclang -plugin -Xclang generate-abi ${SOURCE_FILES}
+            -Xclang -plugin-arg-generate-abi -Xclang -destination-file=${DESTINATION_FOLDER}/${target}.abi
+            -Xclang -plugin-arg-generate-abi -Xclang -context=${target}
+    COMMAND
+    COMMENT "Generating ABI ${target}.abi"
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    VERBATIM
+  )
+  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${DESTINATION_FOLDER}/${target}.abi)
+
   add_custom_command(OUTPUT ${DESTINATION_FOLDER}/${target}.wast
-    DEPENDS ${target}.s
-    COMMAND ${BINARYEN_BIN}/s2wasm -o ${DESTINATION_FOLDER}/${target}.wast -s 16384  ${target}.s
+    DEPENDS ${DESTINATION_FOLDER}/${target}.abi
+    COMMAND ${BINARYEN_BIN}/s2wasm -o ${DESTINATION_FOLDER}/${target}.wast -s 1024 ${target}.s
+
     COMMENT "Generating WAST ${target}.wast"
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     VERBATIM
@@ -169,6 +172,8 @@

   add_custom_target(${target} ALL DEPENDS ${DESTINATION_FOLDER}/${target}.wast.hpp ${extra_target_dependency})

+  set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${DESTINATION_FOLDER}/${target}.wast.hpp)
+
   set_property(TARGET ${target} PROPERTY INCLUDE_DIRECTORIES ${INCLUDE_FOLDERS})

   set(extra_target_dependency)


turn off -Woverloaded-virtual - incompatible with colladadom

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -208,7 +208,7 @@
     set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
   endif (NOT GCC_DISABLE_FATAL_WARNINGS)

-  set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
+  set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor")

   set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
   set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")


Backed out changeset 211aeed4e8f4 backing out "Switching to 10.5 SDK"

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -79,7 +79,7 @@
   # NOTE: wont have a distributable build unless you add this on the configure line with:
   # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
   #set(CMAKE_OSX_ARCHITECTURES i386;ppc)
-  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
+  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
   if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
     set(ARCH universal)
   else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")


STYLE: indent-region

STYLE: indent-region

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -1,105 +1,105 @@
-set(OPENCV_SEARCH_PATH)
-
-if(OpenCV_DIR)
-  get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" PATH)
-  if(OPENCV_SEARCH_PATH)
-    get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
-  endif()
-  if(OPENCV_SEARCH_PATH)
-    find_path(
-      opencv_INCLUDE_DIR
-      opencv/cv.h
-      PATHS "${OPENCV_SEARCH_PATH}"
-      PATH_SUFFIXES "include"
-      DOC "The directory where opencv/cv.h is installed")
-  endif()
-endif()
-
-if(NOT opencv_INCLUDE_DIR)
-  find_path(
-    opencv_INCLUDE_DIR
-    opencv/cv.h
-    PATHS "${OpenCV_DIR}"
-    PATH_SUFFIXES "include"
-    DOC "The directory where opencv/cv.h is installed")
-endif()
-
-if(NOT EXISTS ${opencv_INCLUDE_DIR}/opencv2/opencv.hpp)
-  message(FATAL_ERROR "${opencv_INCLUDE_DIR}/opencv2/opencv.hpp does not exists. "
-    "Make sure you have opencv 2.3 or higher. We had searched in ${OPENCV_SEARCH_PATHS}")
-endif()
-
-set(opencv_core_NAMES opencv_core)
-set(opencv_ml_NAMES opencv_ml)
-
-if ( opencv_INCLUDE_DIR )
-
-  set(OPENCV_INCLUDE_DIRS "${opencv_INCLUDE_DIR}")
-
-  if(NOT OpenCV_VERSION)
-    file(READ "${opencv_INCLUDE_DIR}/opencv2/core/version.hpp" _header_content)
-
-    string(REGEX MATCH  ".*# *define +CV_VERSION_EPOCH +([0-9]+).*" matched ${_header_content})
-    if( matched)
-      string(REGEX REPLACE ".*# *define +CV_VERSION_EPOCH +([0-9]+).*" "\\1"
-        OpenCV_VERSION_MAJOR ${_header_content})
-      string(REGEX REPLACE ".*# *define +CV_VERSION_MAJOR +([0-9]+).*" "\\1"
-        OpenCV_VERSION_MINOR ${_header_content})
-      string(REGEX REPLACE ".*# *define +CV_VERSION_MINOR +([0-9]+).*" "\\1"
-        OpenCV_VERSION_PATCH ${_header_content})
-      string(REGEX REPLACE ".*# *define +CV_VERSION_REVISION +([0-9]+).*" "\\1"
-        OpenCV_VERSION_TWEAK ${_header_content})
-    else()
-      #for opencv 2.3.x
-      string(REGEX REPLACE ".*# *define +CV_MAJOR_VERSION +([0-9]+).*" "\\1"
-        OpenCV_VERSION_MAJOR ${_header_content})
-      string(REGEX REPLACE ".*# *define +CV_MINOR_VERSION +([0-9]+).*" "\\1"
-        OpenCV_VERSION_MINOR ${_header_content})
-      string(REGEX REPLACE ".*# *define +CV_SUBMINOR_VERSION +([0-9]+).*" "\\1"
-        OpenCV_VERSION_PATCH ${_header_content})
-      set(OpenCV_VERSION_TWEAK)
-    endif()
-    set(OpenCV_VERSION
-      "${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
-  endif()
-
-  if(WIN32)
-    list(APPEND opencv_core_NAMES
-      "opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
-    list(APPEND opencv_ml_NAMES
-      "opencv_ml${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
-  endif()
-endif()
-
-
-# Prefer the static library.
-find_library(
-OPENCV_core_LIBRARY
-NAMES ${opencv_core_NAMES}
-PATHS ${OPENCV_SEARCH_PATH}
-PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-NO_DEFAULT_PATH
-DOC "Path to opencv_core library")
-
-find_library(
-OPENCV_ml_LIBRARY
-NAMES ${opencv_ml_NAMES}
-PATHS ${OPENCV_SEARCH_PATH}
-PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-NO_DEFAULT_PATH
-DOC "Path to opencv_ml library")
-
-set(OpenCV_FOUND FALSE)
-if ( OPENCV_core_LIBRARY AND OPENCV_ml_LIBRARY )
-  set(OPENCV_LIBRARIES "${OPENCV_core_LIBRARY};${OPENCV_ml_LIBRARY}")
-endif ()
-
-if( OPENCV_INCLUDE_DIRS AND OPENCV_LIBRARIES )
-  set(OpenCV_FOUND TRUE)
-  set(OPENCV_VERSION ${OpenCV_VERSION}) #for compatility
-endif()
-
-include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCV
-  REQUIRED_VARS OPENCV_core_LIBRARY OPENCV_INCLUDE_DIRS
-  VERSION_VAR OpenCV_VERSION)
+set(OPENCV_SEARCH_PATH)
+
+if(OpenCV_DIR)
+  get_filename_component(OPENCV_SEARCH_PATH "${OpenCV_DIR}" PATH)
+  if(OPENCV_SEARCH_PATH)
+    get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
+  endif()
+  if(OPENCV_SEARCH_PATH)
+    find_path(
+      opencv_INCLUDE_DIR
+      opencv/cv.h
+      PATHS "${OPENCV_SEARCH_PATH}"
+      PATH_SUFFIXES "include"
+      DOC "The directory where opencv/cv.h is installed")
+  endif()
+endif()
+
+if(NOT opencv_INCLUDE_DIR)
+  find_path(
+    opencv_INCLUDE_DIR
+    opencv/cv.h
+    PATHS "${OpenCV_DIR}"
+    PATH_SUFFIXES "include"
+    DOC "The directory where opencv/cv.h is installed")
+endif()
+
+if(NOT EXISTS ${opencv_INCLUDE_DIR}/opencv2/opencv.hpp)
+  message(FATAL_ERROR "${opencv_INCLUDE_DIR}/opencv2/opencv.hpp does not exists. "
+    "Make sure you have opencv 2.3 or higher. We had searched in ${OPENCV_SEARCH_PATHS}")
+endif()
+
+set(opencv_core_NAMES opencv_core)
+set(opencv_ml_NAMES opencv_ml)
+
+if ( opencv_INCLUDE_DIR )
+
+  set(OPENCV_INCLUDE_DIRS "${opencv_INCLUDE_DIR}")
+
+  if(NOT OpenCV_VERSION)
+    file(READ "${opencv_INCLUDE_DIR}/opencv2/core/version.hpp" _header_content)
+
+    string(REGEX MATCH  ".*# *define +CV_VERSION_EPOCH +([0-9]+).*" matched ${_header_content})
+    if( matched)
+      string(REGEX REPLACE ".*# *define +CV_VERSION_EPOCH +([0-9]+).*" "\\1"
+        OpenCV_VERSION_MAJOR ${_header_content})
+      string(REGEX REPLACE ".*# *define +CV_VERSION_MAJOR +([0-9]+).*" "\\1"
+        OpenCV_VERSION_MINOR ${_header_content})
+      string(REGEX REPLACE ".*# *define +CV_VERSION_MINOR +([0-9]+).*" "\\1"
+        OpenCV_VERSION_PATCH ${_header_content})
+      string(REGEX REPLACE ".*# *define +CV_VERSION_REVISION +([0-9]+).*" "\\1"
+        OpenCV_VERSION_TWEAK ${_header_content})
+    else()
+      #for opencv 2.3.x
+      string(REGEX REPLACE ".*# *define +CV_MAJOR_VERSION +([0-9]+).*" "\\1"
+        OpenCV_VERSION_MAJOR ${_header_content})
+      string(REGEX REPLACE ".*# *define +CV_MINOR_VERSION +([0-9]+).*" "\\1"
+        OpenCV_VERSION_MINOR ${_header_content})
+      string(REGEX REPLACE ".*# *define +CV_SUBMINOR_VERSION +([0-9]+).*" "\\1"
+        OpenCV_VERSION_PATCH ${_header_content})
+      set(OpenCV_VERSION_TWEAK)
+    endif()
+    set(OpenCV_VERSION
+      "${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH}")
+  endif()
+
+  if(WIN32)
+    list(APPEND opencv_core_NAMES
+      "opencv_core${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
+    list(APPEND opencv_ml_NAMES
+      "opencv_ml${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
+  endif()
+endif()
+
+
+# Prefer the static library.
+find_library(
+  OPENCV_core_LIBRARY
+  NAMES ${opencv_core_NAMES}
+  PATHS ${OPENCV_SEARCH_PATH}
+  PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
+  NO_DEFAULT_PATH
+  DOC "Path to opencv_core library")
+
+find_library(
+  OPENCV_ml_LIBRARY
+  NAMES ${opencv_ml_NAMES}
+  PATHS ${OPENCV_SEARCH_PATH}
+  PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
+  NO_DEFAULT_PATH
+  DOC "Path to opencv_ml library")
+
+set(OpenCV_FOUND FALSE)
+if ( OPENCV_core_LIBRARY AND OPENCV_ml_LIBRARY )
+  set(OPENCV_LIBRARIES "${OPENCV_core_LIBRARY};${OPENCV_ml_LIBRARY}")
+endif ()
+
+if( OPENCV_INCLUDE_DIRS AND OPENCV_LIBRARIES )
+  set(OpenCV_FOUND TRUE)
+  set(OPENCV_VERSION ${OpenCV_VERSION}) #for compatility
+endif()
+
+include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenCV
+  REQUIRED_VARS OPENCV_core_LIBRARY OPENCV_INCLUDE_DIRS
+  VERSION_VAR OpenCV_VERSION)


BUG: Fix 5174 itkIncludeDirectories.cmake sets includes for GDCM incorrectly. Thanks to Steve M. Robbins for patch

--- itkIncludeDirectories.cmake
+++ itkIncludeDirectories.cmake
@@ -135,8 +135,8 @@

 IF(NOT ITK_USE_SYSTEM_GDCM)
   SET(ITK_INCLUDE_DIRS_INSTALL_TREE ${ITK_INCLUDE_DIRS_INSTALL_TREE}
-    ${ITK_BINARY_DIR}/Utilities/gdcm
-    ${ITK_SOURCE_DIR}/Utilities/gdcm/src
+    ${ITK_INSTALL_INCLUDE_PATH}/gdcm
+    ${ITK_INSTALL_INCLUDE_PATH}/gdcm/src
     )
 ENDIF(NOT ITK_USE_SYSTEM_GDCM)


Check for and use C++14 when available, to get traits (enable_if_t for instance)

--- CompilerFeatures.cmake
+++ CompilerFeatures.cmake
@@ -5,11 +5,17 @@

 include(CheckCXXCompilerFlag)
 if(NOT MSVC)
+    check_cxx_compiler_flag("-std=c++14" COMPILER_SUPPORTS_CXX14)
+    check_cxx_compiler_flag("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
     check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
     check_cxx_compiler_flag("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
 endif()

-if(COMPILER_SUPPORTS_CXX11)
+if(COMPILER_SUPPORTS_CXX14)
+    set(CMAKE_REQUIRED_FLAGS "-std=c++14")
+elseif(COMPILER_SUPPORTS_CXX1Y)
+    set(CMAKE_REQUIRED_FLAGS "-std=c++1y")
+elseif(COMPILER_SUPPORTS_CXX11)
     set(CMAKE_REQUIRED_FLAGS "-std=c++11")
 elseif(COMPILER_SUPPORTS_CXX0X)
     set(CMAKE_REQUIRED_FLAGS "-std=c++0x")


CakeInstall removes cake root before cloning

--- CakeInstall.cmake
+++ CakeInstall.cmake
@@ -42,7 +42,6 @@
 #
 #     export CAKE_ROOT=$PWD/cake_root
 #     if test ! -f "$CAKE_ROOT/Cake.cmake" ; then
-#         rm -rf cake_root
 #         curl https://raw.githubusercontent.com/tamaskenez/cake/master/CakeInstall.cmake -o CakeInstall.cmake
 #         cmake -P CakeInstall.cmake
 #     fi
@@ -62,6 +61,7 @@

 find_package(Git REQUIRED)
 set(CAKE_ROOT ${CMAKE_CURRENT_LIST_DIR}/cake_root CACHE PATH "Cake install directory" FORCE)
+file(REMOVE_RECURSE ${CAKE_ROOT})
 if(DEFINED CMAKE_SCRIPT_MODE_FILE)
   message("Set the CAKE_ROOT environment variable to ${CAKE_ROOT}")
 else()


CommonCPack: add examples component

CommonCPack: add examples component

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -1,5 +1,5 @@

-# Copyright (c) 2012 Stefan Eilemann <eile@eyescale.ch>
+# Copyright (c) 2012-2013 Stefan Eilemann <eile@eyescale.ch>
 # Info: http://www.itk.org/Wiki/CMake:Component_Install_With_CPack

 if(NOT CPACK_PROJECT_NAME)
@@ -51,9 +51,9 @@
 # Default component definition
 if(NOT CPACK_COMPONENTS_ALL)
   if(RELEASE_VERSION)
-    set(CPACK_COMPONENTS_ALL lib dev apps)
+    set(CPACK_COMPONENTS_ALL lib dev apps examples)
   else()
-    set(CPACK_COMPONENTS_ALL unspecified lib dev apps)
+    set(CPACK_COMPONENTS_ALL unspecified lib dev apps examples)
   endif()

   set(CPACK_COMPONENT_UNSPECIFIED_DISPLAY_NAME "Unspecified")
@@ -72,6 +72,11 @@
   set(CPACK_COMPONENT_APPS_DISPLAY_NAME "${CPACK_PROJECT_NAME} Applications")
   set(CPACK_COMPONENT_APPS_DESCRIPTION "${CPACK_PROJECT_NAME} Applications")
   set(CPACK_COMPONENT_APPS_DEPENDS lib)
+
+  set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "${CPACK_PROJECT_NAME} Examples")
+  set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
+    "${CPACK_PROJECT_NAME} Example Source Code")
+  set(CPACK_COMPONENT_EXAMPLES_DEPENDS dev)
 elseif(CPACK_COMPONENTS_ALL STREQUAL "none")
   set(CPACK_COMPONENTS_ALL)
 endif()


Revert "Always do shallow clones"

Revert "Always do shallow clones"

Shallow clones for single commits (aka '--depth=1 --branch <foo>') only
work for foos which are branches or tags, not SHA1.

This reverts commit 9977f9ae28bb8b2b8b21c47a16a4dc9cd1b85d2c.

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -8,7 +8,7 @@
 #    update target to bump the tag to the master revision by
 #    recreating .gitexternals.
 #  * Provides function
-#      git_external(<directory> <giturl> <gittag> [VERBOSE]
+#      git_external(<directory> <giturl> <gittag> [VERBOSE,SHALLOW]
 #        [RESET <files>])
 #    which will check out directory in CMAKE_SOURCE_DIR (if relative)
 #    or in the given absolute path using the given repository and tag
@@ -18,6 +18,11 @@
 #  VERBOSE, when present, this option tells the function to output
 #    information about what operations are being performed by git on
 #    the repo.
+#  SHALLOW, when present, causes a shallow clone of depth 1 to be made
+#    of the specified repo. This may save considerable memory/bandwidth
+#    when only a specific branch of a repo is required and the full history
+#    is not required. Note that the SHALLOW option will only work for a branch
+#    or tag and cannot be used for an arbitrary SHA.
 #  OPTIONAL, when present, this option makes this operation optional.
 #    The function will output a warning and return if the repo could not be
 #    cloned.
@@ -72,7 +77,7 @@
 endfunction()

 function(GIT_EXTERNAL DIR REPO tag)
-  cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;OPTIONAL" "" "RESET" ${ARGN})
+  cmake_parse_arguments(GIT_EXTERNAL_LOCAL "VERBOSE;SHALLOW;OPTIONAL" "" "RESET" ${ARGN})
   set(TAG ${tag})
   if(GIT_EXTERNAL_TAG AND "${tag}" MATCHES "^[0-9a-f]+$")
     set(TAG ${GIT_EXTERNAL_TAG})
@@ -100,8 +105,14 @@

   if(NOT EXISTS "${DIR}")
     # clone
-    set(_clone_options --recursive --depth 1 --branch ${TAG})
-    message(STATUS "git clone ${REPO} ${DIR} [${TAG}]")
+    set(_clone_options --recursive)
+    if(GIT_EXTERNAL_LOCAL_SHALLOW)
+      list(APPEND _clone_options --depth 1 --branch ${TAG})
+    else()
+      set(_msg_tag "[${TAG}]")
+    endif()
+    JOIN("${_clone_options}" " " _msg_text)
+    message(STATUS "git clone ${_msg_text} ${REPO} ${DIR} ${_msg_tag}")
     execute_process(
       COMMAND "${GIT_EXECUTABLE}" clone ${_clone_options} ${REPO} ${DIR}
       RESULT_VARIABLE nok ERROR_VARIABLE error
@@ -113,6 +124,26 @@
       else()
         message(FATAL_ERROR "${DIR} clone failed: ${error}\n")
       endif()
+    endif()
+
+    # checkout requested tag
+    if(NOT GIT_EXTERNAL_LOCAL_SHALLOW)
+      execute_process(
+        COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
+        RESULT_VARIABLE nok ERROR_VARIABLE error
+        WORKING_DIRECTORY "${DIR}")
+      if(nok)
+        message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
+      endif()
+    endif()
+
+    # checkout requested tag
+    execute_process(
+      COMMAND "${GIT_EXECUTABLE}" checkout -q "${TAG}"
+      RESULT_VARIABLE nok ERROR_VARIABLE error
+      WORKING_DIRECTORY "${DIR}")
+    if(nok)
+      message(FATAL_ERROR "git checkout ${TAG} in ${DIR} failed: ${error}\n")
     endif()
   endif()


ENH: Updated dcmtk revision to be checked out for building dcmqi with Travis CI and CircleCI

--- CMakeExternals/DCMTK.cmake
+++ CMakeExternals/DCMTK.cmake
@@ -25,7 +25,7 @@
 endif()

 if(NOT DEFINED DCMTK_DIR AND NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj})
-  set(revision_tag d7deba3b3c98fd0d3c354da3d99c9cda5beb7833)
+  set(revision_tag f6cc20243fb3215b7e75307c94b05484203fb973)
   if(${proj}_REVISION_TAG)
     set(revision_tag ${${proj}_REVISION_TAG})
   endif()


Testing

Testing

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -9,7 +9,7 @@
 set(CTEST_PROJECT_NAME "libsqrl")
 set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

-set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_METHOD "https")
 set(CTEST_DROP_SITE "test.sqrlid.com")
 set(CTEST_DROP_LOCATION "/cdash/submit.php?project=libsqrl")
 set(CTEST_DROP_SITE_CDASH TRUE)


fix typo

fix typo

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -10,4 +10,4 @@
 set(CTEST_DROP_SITE "open.cdash.org")
 set(CTEST_DROP_LOCATION "/submit.php?project=ADIOS")
 set(CTEST_DROP_SITE_CDASH TRUE)
-set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/scripts/dashboard/nightly/valgrid-suppressions.txt)
+set(MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_SOURCE_DIR}/scripts/dashboard/nightly/valgrind-suppressions.txt)


Fix cpu architecture specification vs nvcc bug. (#578)

Fixes #575.

* Guard CPU architecture option for nvcc with generator expression.

--- cmake/CompilerOptions.cmake
+++ cmake/CompilerOptions.cmake
@@ -135,5 +135,12 @@
         endif()
     endif()

-    set("${optvar}" "${arch_opt}" PARENT_SCOPE)
+    # Prefix architecture options with `-Xcompiler=` when compiling CUDA sources, i.e.
+    # with nvcc.
+    set(arch_opt_cuda_guarded)
+    foreach(opt ${arch_opt})
+        list(APPEND arch_opt_cuda_guarded "$<$<COMPILE_LANGUAGE:CUDA>:-Xcompiler=>${opt}")
+    endforeach()
+
+    set("${optvar}" "${arch_opt_cuda_guarded}" PARENT_SCOPE)
 endfunction()


cmake: fix input variable name

cmake: fix input variable name

--- cmake/FileSystemUtils.cmake
+++ cmake/FileSystemUtils.cmake
@@ -22,9 +22,9 @@
     if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" STREQUAL "2.8"
         AND ${CMAKE_PATCH_VERSION} LESS 12)

-        get_filename_component(result ${OpenCV_DIR} PATH)
+        get_filename_component(result ${curpath} PATH)
     else()
-        get_filename_component(result ${OpenCV_DIR} DIRECTORY)
+        get_filename_component(result ${curpath} DIRECTORY)
     endif()
 ENDMACRO()


Cleaning up messages output when SuiteSparse is not found.

- Automatically generated failure message now provides more
  information as to which sub-modules are missing.

Change-Id: I6eed94af49263540b8f87917b75c41b8f49658a0

--- cmake/FindSuiteSparse.cmake
+++ cmake/FindSuiteSparse.cmake
@@ -121,6 +121,10 @@
   UNSET(SUITESPARSE_MAIN_VERSION)
   UNSET(SUITESPARSE_SUB_VERSION)
   UNSET(SUITESPARSE_SUBSUB_VERSION)
+  # Do NOT unset SUITESPARSE_FOUND_REQUIRED_VARS here, as it is used by
+  # FindPackageHandleStandardArgs() to generate the automatic error message on
+  # failure which highlights which components are missing.
+
   # Note <package>_FIND_[REQUIRED/QUIETLY] variables defined by FindPackage()
   # use the camelcase library name, not uppercase.
   IF (SuiteSparse_FIND_QUIETLY)
@@ -132,6 +136,8 @@
     # but continues configuration and allows generation.
     MESSAGE("-- Failed to find SuiteSparse - " ${REASON_MSG} ${ARGN})
   ENDIF (SuiteSparse_FIND_QUIETLY)
+
+  # Do not call RETURN(), s/t we keep processing if not called with REQUIRED.
 ENDMACRO(SUITESPARSE_REPORT_NOT_FOUND)

 # Specify search directories for include files and libraries (this is the union
@@ -157,12 +163,19 @@
   /usr/lib/suitesparse # Ubuntu
   /usr/lib)

+# Given the number of components of SuiteSparse, and to ensure that the
+# automatic failure message generated by FindPackageHandleStandardArgs()
+# when not all required components are found is helpful, we maintain a list
+# of all variables that must be defined for SuiteSparse to be considered found.
+UNSET(SUITESPARSE_FOUND_REQUIRED_VARS)
+
 # BLAS.
 FIND_PACKAGE(BLAS QUIET)
 IF (NOT BLAS_FOUND)
   SUITESPARSE_REPORT_NOT_FOUND(
     "Did not find BLAS library (required for SuiteSparse).")
 ENDIF (NOT BLAS_FOUND)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS BLAS_FOUND)

 # LAPACK.
 FIND_PACKAGE(LAPACK QUIET)
@@ -170,15 +183,18 @@
   SUITESPARSE_REPORT_NOT_FOUND(
     "Did not find LAPACK library (required for SuiteSparse).")
 ENDIF (NOT LAPACK_FOUND)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS LAPACK_FOUND)

 # AMD.
 SET(AMD_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS AMD_FOUND)
 FIND_LIBRARY(AMD_LIBRARY NAMES amd
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${AMD_LIBRARY})
   MESSAGE(STATUS "Found AMD library: ${AMD_LIBRARY}")
 ELSE (EXISTS ${AMD_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find AMD library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find AMD library (required SuiteSparse component).")
   SET(AMD_FOUND FALSE)
 ENDIF (EXISTS ${AMD_LIBRARY})
 MARK_AS_ADVANCED(AMD_LIBRARY)
@@ -188,19 +204,22 @@
 IF (EXISTS ${AMD_INCLUDE_DIR})
   MESSAGE(STATUS "Found AMD header in: ${AMD_INCLUDE_DIR}")
 ELSE (EXISTS ${AMD_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find AMD header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find AMD header (required SuiteSparse component).")
   SET(AMD_FOUND FALSE)
 ENDIF (EXISTS ${AMD_INCLUDE_DIR})
 MARK_AS_ADVANCED(AMD_INCLUDE_DIR)

 # CAMD.
 SET(CAMD_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CAMD_FOUND)
 FIND_LIBRARY(CAMD_LIBRARY NAMES camd
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${CAMD_LIBRARY})
   MESSAGE(STATUS "Found CAMD library: ${CAMD_LIBRARY}")
 ELSE (EXISTS ${CAMD_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CAMD library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CAMD library (required SuiteSparse component).")
   SET(CAMD_FOUND FALSE)
 ENDIF (EXISTS ${CAMD_LIBRARY})
 MARK_AS_ADVANCED(CAMD_LIBRARY)
@@ -210,19 +229,22 @@
 IF (EXISTS ${CAMD_INCLUDE_DIR})
   MESSAGE(STATUS "Found CAMD header in: ${CAMD_INCLUDE_DIR}")
 ELSE (EXISTS ${CAMD_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CAMD header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CAMD header (required SuiteSparse component).")
   SET(CAMD_FOUND FALSE)
 ENDIF (EXISTS ${CAMD_INCLUDE_DIR})
 MARK_AS_ADVANCED(CAMD_INCLUDE_DIR)

 # COLAMD.
 SET(COLAMD_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS COLAMD_FOUND)
 FIND_LIBRARY(COLAMD_LIBRARY NAMES colamd
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${COLAMD_LIBRARY})
   MESSAGE(STATUS "Found COLAMD library: ${COLAMD_LIBRARY}")
 ELSE (EXISTS ${COLAMD_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find COLAMD library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find COLAMD library (required SuiteSparse component).")
   SET(COLAMD_FOUND FALSE)
 ENDIF (EXISTS ${COLAMD_LIBRARY})
 MARK_AS_ADVANCED(COLAMD_LIBRARY)
@@ -232,19 +254,22 @@
 IF (EXISTS ${COLAMD_INCLUDE_DIR})
   MESSAGE(STATUS "Found COLAMD header in: ${COLAMD_INCLUDE_DIR}")
 ELSE (EXISTS ${COLAMD_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find COLAMD header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find COLAMD header (required SuiteSparse component).")
   SET(COLAMD_FOUND FALSE)
 ENDIF (EXISTS ${COLAMD_INCLUDE_DIR})
 MARK_AS_ADVANCED(COLAMD_INCLUDE_DIR)

 # CCOLAMD.
 SET(CCOLAMD_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CCOLAMD_FOUND)
 FIND_LIBRARY(CCOLAMD_LIBRARY NAMES ccolamd
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${CCOLAMD_LIBRARY})
   MESSAGE(STATUS "Found CCOLAMD library: ${CCOLAMD_LIBRARY}")
 ELSE (EXISTS ${CCOLAMD_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CCOLAMD library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CCOLAMD library (required SuiteSparse component).")
   SET(CCOLAMD_FOUND FALSE)
 ENDIF (EXISTS ${CCOLAMD_LIBRARY})
 MARK_AS_ADVANCED(CCOLAMD_LIBRARY)
@@ -254,19 +279,22 @@
 IF (EXISTS ${CCOLAMD_INCLUDE_DIR})
   MESSAGE(STATUS "Found CCOLAMD header in: ${CCOLAMD_INCLUDE_DIR}")
 ELSE (EXISTS ${CCOLAMD_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CCOLAMD header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CCOLAMD header (required SuiteSparse component).")
   SET(CCOLAMD_FOUND FALSE)
 ENDIF (EXISTS ${CCOLAMD_INCLUDE_DIR})
 MARK_AS_ADVANCED(CCOLAMD_INCLUDE_DIR)

 # CHOLMOD.
 SET(CHOLMOD_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS CHOLMOD_FOUND)
 FIND_LIBRARY(CHOLMOD_LIBRARY NAMES cholmod
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${CHOLMOD_LIBRARY})
   MESSAGE(STATUS "Found CHOLMOD library: ${CHOLMOD_LIBRARY}")
 ELSE (EXISTS ${CHOLMOD_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CHOLMOD library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CHOLMOD library (required SuiteSparse component).")
   SET(CHOLMOD_FOUND FALSE)
 ENDIF (EXISTS ${CHOLMOD_LIBRARY})
 MARK_AS_ADVANCED(CHOLMOD_LIBRARY)
@@ -276,19 +304,22 @@
 IF (EXISTS ${CHOLMOD_INCLUDE_DIR})
   MESSAGE(STATUS "Found CHOLMOD header in: ${CHOLMOD_INCLUDE_DIR}")
 ELSE (EXISTS ${CHOLMOD_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find CHOLMOD header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find CHOLMOD header (required SuiteSparse component).")
   SET(CHOLMOD_FOUND FALSE)
 ENDIF (EXISTS ${CHOLMOD_INCLUDE_DIR})
 MARK_AS_ADVANCED(CHOLMOD_INCLUDE_DIR)

 # SuiteSparseQR.
 SET(SUITESPARSEQR_FOUND TRUE)
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS SUITESPARSEQR_FOUND)
 FIND_LIBRARY(SUITESPARSEQR_LIBRARY NAMES spqr
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${SUITESPARSEQR_LIBRARY})
   MESSAGE(STATUS "Found SuiteSparseQR library: ${SUITESPARSEQR_LIBRARY}")
 ELSE (EXISTS ${SUITESPARSEQR_LIBRARY})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find SUITESPARSEQR library.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find SuiteSparseQR library (required SuiteSparse component).")
   SET(SUITESPARSEQR_FOUND FALSE)
 ENDIF (EXISTS ${SUITESPARSEQR_LIBRARY})
 MARK_AS_ADVANCED(SUITESPARSEQR_LIBRARY)
@@ -298,7 +329,8 @@
 IF (EXISTS ${SUITESPARSEQR_INCLUDE_DIR})
   MESSAGE(STATUS "Found SuiteSparseQR header in: ${SUITESPARSEQR_INCLUDE_DIR}")
 ELSE (EXISTS ${SUITESPARSEQR_INCLUDE_DIR})
-  SUITESPARSE_REPORT_NOT_FOUND("Did not find SUITESPARSEQR header.")
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Did not find SUITESPARSEQR header (required SuiteSparse component).")
   SET(SUITESPARSEQR_FOUND FALSE)
 ENDIF (EXISTS ${SUITESPARSEQR_INCLUDE_DIR})
 MARK_AS_ADVANCED(SUITESPARSEQR_INCLUDE_DIR)
@@ -351,17 +383,11 @@
 #
 # If SuiteSparse version is >= 4 then SuiteSparse_config is required.
 # For SuiteSparse 3, UFconfig.h is required.
-SET(SUITESPARSE_CONFIG_FOUND TRUE)
-SET(UFCONFIG_FOUND TRUE)
-
 FIND_LIBRARY(SUITESPARSE_CONFIG_LIBRARY NAMES suitesparseconfig
   PATHS ${SUITESPARSE_CHECK_LIBRARY_DIRS})
 IF (EXISTS ${SUITESPARSE_CONFIG_LIBRARY})
   MESSAGE(STATUS "Found SuiteSparse_config library: "
     "${SUITESPARSE_CONFIG_LIBRARY}")
-ELSE (EXISTS ${SUITESPARSE_CONFIG_LIBRARY})
-  MESSAGE(STATUS "Did not find SuiteSparse_config library (should be present "
-    "in SuiteSparse >= v4 installs).")
 ENDIF (EXISTS ${SUITESPARSE_CONFIG_LIBRARY})
 MARK_AS_ADVANCED(SUITESPARSE_CONFIG_LIBRARY)

@@ -370,15 +396,15 @@
 IF (EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
   MESSAGE(STATUS "Found SuiteSparse_config header in: "
     "${SUITESPARSE_CONFIG_INCLUDE_DIR}")
-  SET(UFCONFIG_FOUND FALSE)
-ELSE (EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
-  MESSAGE(STATUS "Did not find SuiteSparse_config header (should be present "
-    "in SuiteSparse >= v4 installs).")
 ENDIF (EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
 MARK_AS_ADVANCED(SUITESPARSE_CONFIG_INCLUDE_DIR)

+SET(SUITESPARSE_CONFIG_FOUND FALSE)
+SET(UFCONFIG_FOUND FALSE)
+
 IF (EXISTS ${SUITESPARSE_CONFIG_LIBRARY} AND
     EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
+  SET(SUITESPARSE_CONFIG_FOUND TRUE)
   # SuiteSparse_config (SuiteSparse version >= 4) requires librt library for
   # timing by default when compiled on Linux or Unix, but not on OSX (which
   # does not have librt).
@@ -396,24 +422,35 @@
     MARK_AS_ADVANCED(LIBRT_LIBRARY)
     LIST(APPEND SUITESPARSE_CONFIG_LIBRARY ${LIBRT_LIBRARY})
   ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR UNIX AND NOT APPLE)
+
 ELSE (EXISTS ${SUITESPARSE_CONFIG_LIBRARY} AND
       EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})
+  # Failed to find SuiteSparse_config (>= v4 installs), instead look for
+  # UFconfig header which should be present in < v4 installs.
   SET(SUITESPARSE_CONFIG_FOUND FALSE)
   FIND_PATH(UFCONFIG_INCLUDE_DIR NAMES UFconfig.h
     PATHS ${SUITESPARSE_CHECK_INCLUDE_DIRS})
   IF (EXISTS ${UFCONFIG_INCLUDE_DIR})
     MESSAGE(STATUS "Found UFconfig header in: ${UFCONFIG_INCLUDE_DIR}")
-  ELSE (EXISTS ${UFCONFIG_INCLUDE_DIR})
-    MESSAGE(STATUS "Did not find UFconfig header (should be present "
-      "in SuiteSparse < v4 installs)")
-    SET(UFCONFIG_FOUND FALSE)
+    SET(UFCONFIG_FOUND TRUE)
   ENDIF (EXISTS ${UFCONFIG_INCLUDE_DIR})
   MARK_AS_ADVANCED(UFCONFIG_INCLUDE_DIR)
 ENDIF (EXISTS ${SUITESPARSE_CONFIG_LIBRARY} AND
        EXISTS ${SUITESPARSE_CONFIG_INCLUDE_DIR})

+IF (NOT SUITESPARSE_CONFIG_FOUND AND
+    NOT UFCONFIG_FOUND)
+  SUITESPARSE_REPORT_NOT_FOUND(
+    "Failed to find either: SuiteSparse_config header & library (should be "
+    "present in all SuiteSparse >= v4 installs), or UFconfig header (should "
+    "be present in all SuiteSparse < v4 installs).")
+ENDIF (NOT SUITESPARSE_CONFIG_FOUND AND
+       NOT UFCONFIG_FOUND)
+
 # Extract the SuiteSparse version from the appropriate header (UFconfig.h for
 # <= v3, SuiteSparse_config.h for >= v4).
+LIST(APPEND SUITESPARSE_FOUND_REQUIRED_VARS SUITESPARSE_VERSION)
+
 IF (UFCONFIG_FOUND)
   # SuiteSparse version <= 3.
   SET(SUITESPARSE_VERSION_FILE ${UFCONFIG_INCLUDE_DIR}/UFconfig.h)
@@ -491,18 +528,16 @@
 ENDIF (EXISTS ${METIS_LIBRARY})
 MARK_AS_ADVANCED(METIS_LIBRARY)

-# Only mark SuiteSparse as found if all required dependencies have been found.
-SET(SUITESPARSE_FOUND FALSE)
-IF (AMD_FOUND AND
-    CAMD_FOUND AND
-    COLAMD_FOUND AND
-    CCOLAMD_FOUND AND
-    CHOLMOD_FOUND AND
-    SUITESPARSEQR_FOUND AND
-    (SUITESPARSE_CONFIG_FOUND OR UFCONFIG_FOUND) AND
-    BLAS_FOUND AND
-    LAPACK_FOUND)
-  SET(SUITESPARSE_FOUND TRUE)
+# Only mark SuiteSparse as found if all required components and dependencies
+# have been found.
+SET(SUITESPARSE_FOUND TRUE)
+FOREACH(REQUIRED_VAR ${SUITESPARSE_FOUND_REQUIRED_VARS})
+  IF (NOT ${REQUIRED_VAR})
+    SET(SUITESPARSE_FOUND FALSE)
+  ENDIF (NOT ${REQUIRED_VAR})
+ENDFOREACH(REQUIRED_VAR ${SUITESPARSE_FOUND_REQUIRED_VARS})
+
+IF (SUITESPARSE_FOUND)
   LIST(APPEND SUITESPARSE_INCLUDE_DIRS
     ${AMD_INCLUDE_DIR}
     ${CAMD_INCLUDE_DIR}
@@ -532,7 +567,9 @@
     ${CCOLAMD_LIBRARY}
     ${CAMD_LIBRARY}
     ${COLAMD_LIBRARY}
-    ${AMD_LIBRARY})
+    ${AMD_LIBRARY}
+    ${LAPACK_LIBRARIES}
+    ${BLAS_LIBRARIES})
   IF (SUITESPARSE_CONFIG_FOUND)
     LIST(APPEND SUITESPARSE_LIBRARIES
       ${SUITESPARSE_CONFIG_LIBRARY})
@@ -541,9 +578,6 @@
     LIST(APPEND SUITESPARSE_LIBRARIES
       ${METIS_LIBRARY})
   ENDIF (METIS_FOUND)
-ELSE()
-  SUITESPARSE_REPORT_NOT_FOUND(
-    "Failed to find some/all required components of SuiteSparse.")
 ENDIF()

 # Determine if we are running on Ubuntu with the package install of SuiteSparse
@@ -577,12 +611,16 @@

 # Handle REQUIRED and QUIET arguments to FIND_PACKAGE
 INCLUDE(FindPackageHandleStandardArgs)
-# A change to CMake after release 2.8.10.2 means that
-# FindPackageHandleStandardArgs() unsets <LibraryName>_FOUND without checking
-# if it is one of the variables passed whose existence & validity is verified
-# by FindPackageHandleStandardArgs() in conjunction with handling the REQUIRED
-# and QUIET optional arguments, as such we use an intermediary variable.
-SET(SUITESPARSE_FOUND_COPY ${SUITESPARSE_FOUND})
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SuiteSparse
-  REQUIRED_VARS SUITESPARSE_INCLUDE_DIRS SUITESPARSE_LIBRARIES SUITESPARSE_FOUND_COPY
-  VERSION_VAR SUITESPARSE_VERSION)
+IF (SUITESPARSE_FOUND)
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(SuiteSparse
+    REQUIRED_VARS ${SUITESPARSE_FOUND_REQUIRED_VARS}
+    VERSION_VAR SUITESPARSE_VERSION
+    FAIL_MESSAGE "Failed to find some/all required components of SuiteSparse.")
+ELSE (SUITESPARSE_FOUND)
+  # Do not pass VERSION_VAR to FindPackageHandleStandardArgs() if we failed to
+  # find SuiteSparse to avoid a confusing autogenerated failure message
+  # that states 'not found (missing: FOO) (found version: x.y.z)'.
+  FIND_PACKAGE_HANDLE_STANDARD_ARGS(SuiteSparse
+    REQUIRED_VARS ${SUITESPARSE_FOUND_REQUIRED_VARS}
+    FAIL_MESSAGE "Failed to find some/all required components of SuiteSparse.")
+ENDIF (SUITESPARSE_FOUND)


fix lib64 test=develop

fix lib64 test=develop

--- cmake/external/ngraph.cmake
+++ cmake/external/ngraph.cmake
@@ -69,7 +69,7 @@
     CMAKE_ARGS          -DNGRAPH_DEX_ONLY=TRUE
     CMAKE_ARGS          -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
     CMAKE_ARGS          -DMKLDNN_INCLUDE_DIR=${MKLDNN_INC_DIR}
-    CMAKE_ARGS          -DMKLDNN_LIB_DIR=${MKLDNN_INSTALL_DIR}/lib
+    CMAKE_ARGS          -DMKLDNN_LIB_DIR=${MKLDNN_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}
     CMAKE_ARGS          -DMKLML_LIB_DIR=${MKLML_INSTALL_DIR}/lib
 )


Update mkl-dnn to v0.20

Update mkl-dnn to v0.20

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -18,10 +18,10 @@

 # Includes blas 3.8.0 in mkldnn
 set(NGRAPH_MKLDNN_SHORT_VERSION 0)
-set(NGRAPH_MKLDNN_FULL_VERSION 0.19.0.0)
-set(NGRAPH_MKLDNN_VERSION "v0.19")
+set(NGRAPH_MKLDNN_FULL_VERSION 0.20.0.0)
+set(NGRAPH_MKLDNN_VERSION "v0.20")
 set(NGRAPH_MKLDNN_SUB_VERSION "2019.0.5.20190502")
-set(NGRAPH_MKLDNN_GIT_TAG "027de76")
+set(NGRAPH_MKLDNN_GIT_TAG "v0.20")

 #------------------------------------------------------------------------------
 # Fetch and install MKL-DNN


Revert "Fix llvm-lit script generation in libcxx."

This reverts commit 4ad71811d45268d81b60f27e3b8b2bcbc23bd7b9.

There is a bot that is checking out libcxx and lit with nothing
else and then running lit.py against the test tree.  Since there's
no LLVM source tree, there's no LLVM CMake.  CMake actually
reports this as a warning saying unsupported libcxx configuration,
but I guess someone is depending on it anyway.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -1130,11 +1130,11 @@
   # They below might not be the build tree but provided binary tree.
   set(LLVM_SOURCE_DIR ${LLVM_MAIN_SRC_DIR})
   set(LLVM_BINARY_DIR ${LLVM_BINARY_DIR})
-  string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}")
-  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLVM_LIBS_DIR  "${LLVM_LIBRARY_DIR}")
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLVM_TOOLS_DIR ${LLVM_TOOLS_BINARY_DIR})
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLVM_LIBS_DIR  ${LLVM_LIBRARY_DIR})

   # SHLIBDIR points the build tree.
-  string(REPLACE "${CMAKE_CFG_INTDIR}" "${LLVM_BUILD_MODE}" SHLIBDIR "${LLVM_SHLIB_OUTPUT_INTDIR}")
+  string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} SHLIBDIR "${LLVM_SHLIB_OUTPUT_INTDIR}")

   set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
   # FIXME: "ENABLE_SHARED" doesn't make sense, since it is used just for


Additional search path for TBB library

Additional search path for TBB library

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -169,7 +169,7 @@
 #    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set $ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
 #    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib")
 #endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-set(_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/lib")
+set(_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/lib" "${_TBB_INSTALL_DIR}/lib/${CMAKE_LIBRARY_ARCHITECTURE}")

 find_library(TBB_LIBRARY        ${_TBB_LIB_NAME}        ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
 find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)


Tweak commentary.

Tweak commentary.

svn path=/trunk/; revision=6759

--- cmake/modules/drivers.cmake
+++ cmake/modules/drivers.cmake
@@ -25,12 +25,11 @@
 # ENABLE_DYNDRIVERS (ON or OFF): whether to dynamically load device drivers.
 # PLD_devicename (ON or OFF): whether each PLplot-related device is enabled
 #   or not.  devicename is png, jpeg, etc.
-# PLD_devicename_INCLUDE_DIR: compile (e.g., -I) options for each individual
+# devicename_COMPILE_FLAGS: compile (e.g., -I) options for each individual
 #   device.
-# PLD_devicename_LIBRARIES: link options (e.g., -L  and -l) for each
+# devicename_LINK_FLAGS: link options (e.g., -L  and -l) for each
 #   individual device.
-# DRIVERS_INCLUDE_DIR: concatanated compile options for all devices
-# DRIVERS_LIBRARIES: concatanated link options for all devices
+# DRIVERS_LINK_FLAGS: concatanated link options for all devices
 # DEVICES_LIST: list of devices (e.g. png, jpeg),where PLD_devicename is ON
 # DRIVERS_LIST: list of device drivers (e.g., gd for the png and jpeg devices)
 #   where at least one of the associated devices is enabled.
@@ -47,7 +46,7 @@
 # Initialize device options (e.g., PLD_png is set to ON or OFF).
 include(drivers-init)

-# Find *_INC_DIR and *_LIBRARIES resources for device drivers that need them,
+# Find *_COMPILE_FLAGS and *_LINK_FLAGS resources for device drivers that need them,
 # and set appropriate PLD_devicename to OFF if the required resources are
 # not available.
 #include(cgm)


fix broken make test

fix broken make test

Change-Id: I1e0c2e0a38987eb5e7ed4c3a94fec2449ff6e9c3
Reviewed-on: http://review.couchbase.org/61213
Tested-by: Artem Stemkovski <15a0730a27c69f62ab86f2b6c639fca202166c02@couchbase.com>
Reviewed-by: Dave Finlay <7b10a9ed9f70e64c30b07607a671ae61c33f14c8@couchbase.com>

--- cmake_modules/do-test.cmake
+++ cmake_modules/do-test.cmake
@@ -24,7 +24,7 @@
   -pa "${COUCHDB_BIN_DIR}/src/mochiweb"
   -pa "${COUCHDB_BIN_DIR}/src/ejson"
   -noshell -kernel error_logger silent -shutdown_time 10000
-  -name "${NODE_NAME}"
+  -sname "${NODE_NAME}"
   -eval "\"application:start(sasl).\""
   -eval "\"case t:${TEST_TARGET}() of ok -> init:stop(); _ -> init:stop(1) end.\"")

@@ -34,7 +34,7 @@
   -pa "${COUCHDB_BIN_DIR}/src/mochiweb"
   -pa "${COUCHDB_BIN_DIR}/src/ejson"
   -noshell -kernel error_logger silent -shutdown_time 10000
-  -name "${NODE_NAME}"
+  -sname "${NODE_NAME}"
   -eval "application:start(sasl)."
   -eval "case t:${TEST_TARGET}() of ok -> init:stop(); _ -> init:stop(1) end.")
 IF (_failure)


Remove style tests for examples.

Remove style tests for examples.

These will now be jupyter notebooks

--- plugin.cmake
+++ plugin.cmake
@@ -26,10 +26,6 @@
   python_static_analysis_HistomicsTK_algorithms
   "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/histomicstk"
 )
-add_python_style_test(
-  python_static_analysis_HistomicsTK_examples
-  "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/examples"
-)

 add_python_test(example PLUGIN HistomicsTK)


fix enabling clang sanitizers

fix enabling clang sanitizers

--- toolchains/clang.cmake
+++ toolchains/clang.cmake
@@ -20,7 +20,8 @@
 # http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
 # http://clang.llvm.org/docs/AddressSanitizer.html
 # http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
-set( TNUN_linker_runtime_sanity_checks -fsanitize=undefined -fsanitize=address )
+set( TNUN_compiler_runtime_sanity_checks -fsanitize=undefined -fsanitize=address )
+set( TNUN_linker_runtime_sanity_checks ${TNUN_compiler_runtime_sanity_checks} )
 # -fsanitize=cfi disabled because of error:
 # clang-3.9: error: invalid argument '-fsanitize=cfi' only allowed with '-flto'


Clang: (re)disabled the stack sanitizer as it still misses (runtime) support on OSX.

--- toolchains/clang.cmake
+++ toolchains/clang.cmake
@@ -20,7 +20,7 @@
 # http://clang.llvm.org/docs/AddressSanitizer.html
 # http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
 if ( NOT iOS )
-  set( TNUN_linker_runtime_sanity_checks -fsanitize=undefined -fsanitize=address -fsanitize=safe-stack ) # AppleClang lag: -fsanitize=thread -fsanitize=memory -fsanitize=dataflow -fsanitize=cfi
+  set( TNUN_linker_runtime_sanity_checks -fsanitize=undefined -fsanitize=address ) # AppleClang lag:  -fsanitize=safe-stack -fsanitize=thread -fsanitize=memory -fsanitize=dataflow -fsanitize=cfi
 endif()
 set( TNUN_compiler_runtime_sanity_checks ${TNUN_linker_runtime_sanity_checks} -fno-omit-frame-pointer )
 set( TNUN_linker_runtime_integer_checks -fsanitize=integer )


cmake: use -isystem for Python/numpy include directories

--- modules/python/common.cmake
+++ modules/python/common.cmake
@@ -3,11 +3,11 @@

 ocv_add_module(${MODULE_NAME} BINDINGS PRIVATE_REQUIRED opencv_python_bindings_generator)

+include_directories(SYSTEM
+    "${${PYTHON}_INCLUDE_PATH}"
+    ${${PYTHON}_NUMPY_INCLUDE_DIRS}
+)
 ocv_module_include_directories(
-    "${${PYTHON}_INCLUDE_PATH}"
-)
-include_directories(
-    ${${PYTHON}_NUMPY_INCLUDE_DIRS}
     "${PYTHON_SOURCE_DIR}/src2"
     "${OPENCV_PYTHON_BINDINGS_DIR}"
 )


move options initialization into ctest_ext_init

--- ctest_ext.cmake
+++ ctest_ext.cmake
@@ -335,11 +335,55 @@
 # CTest Ext initialize
 #

-function(ctest_ext_init)
-    check_vars_def(
-        CTEST_STAGE
-        CTEST_TARGET_SYSTEM CTEST_MODEL
-        CTEST_DASHBOARD_ROOT CTEST_SOURCE_DIRECTORY CTEST_BINARY_DIRECTORY)
+macro(ctest_ext_init)
+    # Dashboard settings
+
+    site_name(SITE_NAME)
+
+    set_ifndef(CTEST_TARGET_SYSTEM                      "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}")
+    set_ifndef(CTEST_MODEL                              "Experimental")
+
+    set_ifndef(CTEST_SITE                               "${SITE_NAME}")
+    set_ifndef(CTEST_BUILD_NAME                         "${CTEST_TARGET_SYSTEM}-${CTEST_MODEL}")
+
+    set_ifndef(CTEST_DASHBOARD_ROOT                     "${CTEST_SCRIPT_DIRECTORY}/${CTEST_TARGET_SYSTEM}/${CTEST_MODEL}")
+    set_ifndef(CTEST_SOURCE_DIRECTORY                   "${CTEST_DASHBOARD_ROOT}/source")
+    set_ifndef(CTEST_BINARY_DIRECTORY                   "${CTEST_DASHBOARD_ROOT}/build")
+    set_ifndef(CTEST_NOTES_LOG_FILE                     "${CTEST_DASHBOARD_ROOT}/ctest_notes_log.txt")
+
+    # Repository settings
+
+    find_package(Git QUIET)
+
+    if(EXISTS "${GIT_EXECUTABLE}")
+        set_ifndef(CTEST_WITH_UPDATE                        TRUE)
+        set_ifndef(CTEST_GIT_COMMAND                        "${GIT_EXECUTABLE}")
+    else()
+        set_ifndef(CTEST_WITH_UPDATE                        FALSE)
+    endif()
+
+    # Find tools
+
+    if(NOT DEFINED CTEST_COVERAGE_COMMAND)
+        find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
+    endif()
+
+    if(NOT DEFINED CTEST_GCOVR_EXECUTABLE)
+        find_program(CTEST_GCOVR_EXECUTABLE NAMES gcovr)
+    endif()
+
+    if(NOT DEFINED CTEST_MEMORYCHECK_COMMAND)
+        find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
+    endif()
+
+    # Stage
+
+    set_ifndef(CTEST_STAGE "${CTEST_SCRIPT_ARG}")
+    if(NOT CTEST_STAGE)
+        set(CTEST_STAGE "Start;Configure;Build;Test;Coverage;MemCheck;Submit;Extra")
+    endif()
+
+    # Initialize

     set(HAVE_UPDATES TRUE)

@@ -382,7 +426,7 @@
     endif()

     set(HAVE_UPDATES ${HAVE_UPDATES} PARENT_SCOPE)
-endfunction()
+endmacro()

 #
 # CTest Ext set default vars
@@ -563,58 +607,3 @@
         ctest_submit()
     endif()
 endfunction()
-
-#
-# Dashboard settings
-#
-
-site_name(SITE_NAME)
-
-set_ifndef(CTEST_TARGET_SYSTEM                      "${CMAKE_SYSTEM}-${CMAKE_SYSTEM_PROCESSOR}")
-set_ifndef(CTEST_MODEL                              "Experimental")
-
-set_ifndef(CTEST_SITE                               "${SITE_NAME}")
-set_ifndef(CTEST_BUILD_NAME                         "${CTEST_TARGET_SYSTEM}-${CTEST_MODEL}")
-
-set_ifndef(CTEST_DASHBOARD_ROOT                     "${CTEST_SCRIPT_DIRECTORY}/${CTEST_TARGET_SYSTEM}/${CTEST_MODEL}")
-set_ifndef(CTEST_SOURCE_DIRECTORY                   "${CTEST_DASHBOARD_ROOT}/source")
-set_ifndef(CTEST_BINARY_DIRECTORY                   "${CTEST_DASHBOARD_ROOT}/build")
-set_ifndef(CTEST_NOTES_LOG_FILE                     "${CTEST_DASHBOARD_ROOT}/ctest_notes_log.txt")
-
-#
-# Repository settings
-#
-
-find_package(Git QUIET)
-
-if(EXISTS "${GIT_EXECUTABLE}")
-    set_ifndef(CTEST_WITH_UPDATE                        TRUE)
-    set_ifndef(CTEST_GIT_COMMAND                        "${GIT_EXECUTABLE}")
-else()
-    set_ifndef(CTEST_WITH_UPDATE                        FALSE)
-endif()
-
-#
-# Find tools
-#
-
-if(NOT DEFINED CTEST_COVERAGE_COMMAND)
-    find_program(CTEST_COVERAGE_COMMAND NAMES gcov)
-endif()
-
-if(NOT DEFINED CTEST_GCOVR_EXECUTABLE)
-    find_program(CTEST_GCOVR_EXECUTABLE NAMES gcovr)
-endif()
-
-if(NOT DEFINED CTEST_MEMORYCHECK_COMMAND)
-    find_program(CTEST_MEMORYCHECK_COMMAND NAMES valgrind)
-endif()
-
-#
-# Stage
-#
-
-set_ifndef(CTEST_STAGE "${CTEST_SCRIPT_ARG}")
-if(NOT CTEST_STAGE)
-    set(CTEST_STAGE "Start;Configure;Build;Test;Coverage;MemCheck;Submit;Extra")
-endif()


Fixed elif/elseif error that made highgui-windows fail on mac+cocoa.


FindGMock: fix typo: use _DIR instead of _DIRS

Because _DIRS is an output variable that doesn't (yet) exist.

--- cmake/modules/FindGMock.cmake
+++ cmake/modules/FindGMock.cmake
@@ -400,9 +400,9 @@
     IMPORTED_LOCATION "${GTEST_LIBRARY}"
     )

-if(GTEST_INCLUDE_DIRS)
+if(GTEST_INCLUDE_DIR)
     set_target_properties(GTest::GTest PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIRS}")
+        INTERFACE_INCLUDE_DIRECTORIES "${GTEST_INCLUDE_DIR}")
 endif()

 set_target_properties(GTest::Main PROPERTIES
@@ -415,9 +415,9 @@
     IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
     IMPORTED_LOCATION "${GMOCK_LIBRARY}")

-if(GMOCK_INCLUDE_DIRS)
+if(GMOCK_INCLUDE_DIR)
     set_target_properties(GMock::GMock PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIRS}")
+        INTERFACE_INCLUDE_DIRECTORIES "${GMOCK_INCLUDE_DIR}")
 endif()

 set_target_properties(GMock::Main PROPERTIES
@@ -426,7 +426,6 @@
     IMPORTED_LOCATION "${GMOCK_MAIN_LIBRARY}")

 if(GTEST_FOUND)
-
     set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
     set(GTEST_LIBRARIES ${GTEST_LIBRARY})
     set(GTEST_MAIN_LIBRARIES ${GTEST_MAIN_LIBRARY})


- svn:mime-type  - svn:eol-style

 - svn:mime-type
 - svn:eol-style

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@11156 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/add.boost.test.cmake
+++ rdo/packages/cmake/trunk/add.boost.test.cmake
@@ -1,29 +1,29 @@
-#==============================================================================
-# Copyright (c) 2011-2012 Evgeny Proydakov <lord.tiran@gmail.com>
-#==============================================================================
-
-MACRO(ADD_BOOST_TEST args)
-
-MESSAGE(STATUS "CREATE  ${ARGV0}")
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-INCLUDE_DIRECTORIES(${RDO_BASE_DIRECTORY})
-
-INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
-
-ADD_EXECUTABLE(${ARGV0} ${ARGN})
-SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES LINKER_LANGUAGE CXX)
-SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES FOLDER ${TESTS_FOLDERS})
-ADD_TEST(NAME ${ARGV0} COMMAND ${EXECUTABLE_OUTPUT_PATH}/${ARGV0})
-
-IF(MSVC)
-    SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES COMPILE_FLAGS "/EHa")
-ENDIF(MSVC)
-
-TARGET_LINK_LIBRARIES(${ARGV0} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
-SOURCE_GROUP(".test" FILES
-    ${ARGN}
-    )
-
-ENDMACRO(ADD_BOOST_TEST)
+#==============================================================================
+# Copyright (c) 2011-2012 Evgeny Proydakov <lord.tiran@gmail.com>
+#==============================================================================
+
+MACRO(ADD_BOOST_TEST args)
+
+MESSAGE(STATUS "CREATE  ${ARGV0}")
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
+INCLUDE_DIRECTORIES(${RDO_BASE_DIRECTORY})
+
+INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
+
+ADD_EXECUTABLE(${ARGV0} ${ARGN})
+SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES LINKER_LANGUAGE CXX)
+SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES FOLDER ${TESTS_FOLDERS})
+ADD_TEST(NAME ${ARGV0} COMMAND ${EXECUTABLE_OUTPUT_PATH}/${ARGV0})
+
+IF(MSVC)
+    SET_TARGET_PROPERTIES(${ARGV0} PROPERTIES COMPILE_FLAGS "/EHa")
+ENDIF(MSVC)
+
+TARGET_LINK_LIBRARIES(${ARGV0} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+
+SOURCE_GROUP(".test" FILES
+    ${ARGN}
+    )
+
+ENDMACRO(ADD_BOOST_TEST)


Disable non-fixable clang warning

Disable non-fixable clang warning

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -142,6 +142,7 @@
               mitkFunctionCheckCompilerFlags("/WX" module_compile_flags)
             else()
               mitkFunctionCheckCompilerFlags("-Werror" module_compile_flags)
+              mitkFunctionCheckCompilerFlags("-Wno-c++0x-static-nonintegral-init" module_compile_flags)
             endif()
           endif(MODULE_WARNINGS_AS_ERRORS)


update FindMKL to match the default installation behavior of MKL 11

--- bench/btl/cmake/FindMKL.cmake
+++ bench/btl/cmake/FindMKL.cmake
@@ -20,12 +20,23 @@
   PATHS
   $ENV{MKLLIB}
   /opt/intel/mkl/*/lib/em64t
+  /opt/intel/Compiler/*/*/mkl/lib/em64t
   ${LIB_INSTALL_DIR}
 )

-if(MKL_LIBRARIES)
-set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_lp64 mkl_sequential guide pthread)
-endif(MKL_LIBRARIES)
+find_library(MKL_GUIDE
+  guide
+  PATHS
+  $ENV{MKLLIB}
+  /opt/intel/mkl/*/lib/em64t
+  /opt/intel/Compiler/*/*/mkl/lib/em64t
+  /opt/intel/Compiler/*/*/lib/intel64
+  ${LIB_INSTALL_DIR}
+)
+
+if(MKL_LIBRARIES AND MKL_GUIDE)
+  set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_lp64 mkl_sequential ${MKL_GUIDE} pthread)
+endif()

 else(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")

@@ -34,12 +45,23 @@
   PATHS
   $ENV{MKLLIB}
   /opt/intel/mkl/*/lib/32
+  /opt/intel/Compiler/*/*/mkl/lib/32
   ${LIB_INSTALL_DIR}
 )

-if(MKL_LIBRARIES)
-set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_sequential guide pthread)
-endif(MKL_LIBRARIES)
+find_library(MKL_GUIDE
+  guide
+  PATHS
+  $ENV{MKLLIB}
+  /opt/intel/mkl/*/lib/32
+  /opt/intel/Compiler/*/*/mkl/lib/32
+  /opt/intel/Compiler/*/*/lib/intel32
+  ${LIB_INSTALL_DIR}
+)
+
+if(MKL_LIBRARIES AND MKL_GUIDE)
+  set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_sequential ${MKL_GUIDE} pthread)
+endif()

 endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")


Removed debug log

Removed debug log

--- client/client-multi/client-cpp/Modules/FindBotan.cmake
+++ client/client-multi/client-cpp/Modules/FindBotan.cmake
@@ -60,7 +60,7 @@
     ${BOTAN_LIBRARY_DIRS})

 include(FindPackageHandleStandardArgs)
-message(STATUS "Include directory: ${BOTAN_INCLUDE_DIR}")
+
 # handle the QUIETLY and REQUIRED arguments and set BOTAN_FOUND to TRUE
 # if all listed variables are TRUE
 find_package_handle_standard_args(Botan


Apply CTEST_BUILD_CONFIGURATION on Unix

Apply CTEST_BUILD_CONFIGURATION on Unix

--- CMake/MITKDashboardScript.download.cmake
+++ CMake/MITKDashboardScript.download.cmake
@@ -556,6 +556,10 @@
   "-D" "MITK_CTEST_SCRIPT_MODE:STRING=${CTEST_DASHBOARD_MODEL}"
 # "-D" "SUPERBUILD_EXCLUDE_MITKBUILD_TARGET:BOOL=TRUE"
 )
+
+if(NOT WIN32)
+  list(APPEND options "-D" "CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
+endif()

 if(extension_dirs)
   string (REPLACE ";" "\\\;" extension_dirs "${extension_dirs}")


BUG: When test fails it should set VTK_EXPLICIT_TEMPLATES to 0, not VTK_EXPLICIT_TEMPLATES_BOOL.

--- CMake/vtkTestExplicitInstantiation.cmake
+++ CMake/vtkTestExplicitInstantiation.cmake
@@ -41,10 +41,14 @@
   IF(VTK_EXPLICIT_TEMPLATES)
     MESSAGE(STATUS "Checking support for C++ explicit template instantiation -- yes")
     SET(VTK_EXPLICIT_TEMPLATES 1 CACHE INTERNAL "Support for C++ explict templates")
+    WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeOutput.log
+      "Determining if the C++ compiler supports explict template instantiation "
+      "passed with the following output:\n"
+      "${OUTPUT}\n" APPEND)
   ELSE(VTK_EXPLICIT_TEMPLATES)
     MESSAGE(STATUS "Checking support for C++ explicit template instantiation -- no")
-    SET(VTK_EXPLICIT_TEMPLATES_BOOL 0 CACHE INTERNAL "Support for C++ explict templates")
-    WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
+    SET(VTK_EXPLICIT_TEMPLATES 0 CACHE INTERNAL "Support for C++ explict templates")
+    WRITE_FILE(${CMAKE_BINARY_DIR}/CMakeError.log
       "Determining if the C++ compiler supports explict template instantiation "
       "failed with the following output:\n"
       "${OUTPUT}\n" APPEND)


Added support for detection of CPU BLAS libraries OpenBLAS, BLIS and Accelerate on OS X

--- cmake/Modules/FindCBLAS.cmake
+++ cmake/Modules/FindCBLAS.cmake
@@ -37,7 +37,10 @@
 find_path(CBLAS_INCLUDE_DIRS
   NAMES cblas.h
   HINTS ${CBLAS_HINTS}
-  PATH_SUFFIXES include inc include/x86_64 include/x64 openblas/include
+  PATH_SUFFIXES
+    include inc include/x86_64 include/x64
+    openblas/include include/blis blis/include blis/include/blis
+    Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Versions/Current/Headers
   PATHS ${CBLAS_PATHS}
   DOC "Netlib BLAS include header cblas.h"
 )
@@ -45,9 +48,11 @@

 # Finds the library
 find_library(CBLAS_LIBRARIES
-  NAMES blas openblas atlas mkl accelerate
+  NAMES blas mkl blis openblas atlas accelerate
   HINTS ${CBLAS_HINTS}
-  PATH_SUFFIXES lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32 lib/import lib64/import openblas/lib
+  PATH_SUFFIXES
+    lib lib64 lib/x86_64 lib/x64 lib/x86 lib/Win32 lib/import lib64/import
+    openblas/lib blis/lib
   PATHS ${CBLAS_PATHS}
   DOC "Netlib BLAS library"
 )


CMake: reverted some in `cmake/environmentchecks.cmake`.

For some reasons, this was added, but has nothing to do with the issue at hand.

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -33,30 +33,19 @@
 find_program(VALGRIND_EXE NAMES ${PREFERRED_VALGRIND_NAMES} valgrind)

 if(Python_Interpreter_FOUND)
-  if(NOT DEFINED PYTHON_COVERAGE_TEST_PERFORMED OR NOT PYTHON_COVERAGE_FOUND)
-    if(NOT DEFINED PYTHON_COVERAGE_TEST_PERFORMED)
-      message(STATUS "Performing Test HAVE_COVERAGE")
-    endif()
+  if(NOT DEFINED TEST_COVERAGE_RESULT)
+    set(TEST_COVERAGE_RESULT -1 CACHE INTERNAL "Result of testing for Python coverage.")
+    message(STATUS "Performing Test HAVE_COVERAGE")
     get_filename_component(PYTHON_DIR ${Python_EXECUTABLE} DIRECTORY)
     execute_process(COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/python_package_check.py exclude-until-coverage-plugin
       RESULT_VARIABLE TEST_COVERAGE_RESULT OUTPUT_QUIET ERROR_QUIET)
-
     if(TEST_COVERAGE_RESULT EQUAL 0)
       set(HAVE_COVERAGE TRUE)
-      set(_RESULT_TEXT Success)
+      message(STATUS "Performing Test HAVE_COVERAGE - Success")
     else()
       set(HAVE_COVERAGE FALSE)
-      set(_RESULT_TEXT Failed)
+      message(STATUS "Performing Test HAVE_COVERAGE - Failed")
     endif()
-    if(PYTHON_COVERAGE_TEST_PERFORMED AND NOT PYTHON_COVERAGE_FOUND AND HAVE_COVERAGE)
-      set(_PRINT_SUMMARY_MESSAGE TRUE)
-      message(STATUS "Performing Test HAVE_COVERAGE")
-    endif()
-    if(NOT DEFINED PYTHON_COVERAGE_TEST_PERFORMED OR _PRINT_SUMMARY_MESSAGE)
-      message(STATUS "Performing Test HAVE_COVERAGE - ${_RESULT_TEXT}")
-    endif()
-    set(PYTHON_COVERAGE_FOUND ${HAVE_COVERAGE} CACHE INTERNAL "Python coverage was found." FORCE)
-    set(PYTHON_COVERAGE_TEST_PERFORMED TRUE CACHE INTERNAL "Testing for Python coverage has occured.")
   endif()
 endif()


[cmake] Also create lowercase extension WinSDK symlinks

Some projects rely on using libraries from the Windows SDK with their
original casing, just with a lowercase extension. E.g. the WinSock2 lib
is named WS2_32.Lib in the Windows SDK, and we would previously only
create a ws2_32.lib symlink for it (i.e. all lowercase). Also create a
WS2_32.lib symlink (i.e. original casing with lowercase extension) to
cover users of this casing. As a drive-by fix, only create these
symlinks when they differ from the original name to reduce the amount of
noise in the library symlinks directory.

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

--- cmake/platforms/WinMsvc.cmake
+++ cmake/platforms/WinMsvc.cmake
@@ -136,11 +136,25 @@
   execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
   file(GLOB libraries RELATIVE "${winsdk_um_lib_dir}" "${winsdk_um_lib_dir}/*")
   foreach(library ${libraries})
-    string(TOLOWER "${library}" symlink_name)
-    execute_process(COMMAND "${CMAKE_COMMAND}"
-                            -E create_symlink
-                            "${winsdk_um_lib_dir}/${library}"
-                            "${output_dir}/${symlink_name}")
+    string(TOLOWER "${library}" all_lowercase_symlink_name)
+    if(NOT library STREQUAL all_lowercase_symlink_name)
+      execute_process(COMMAND "${CMAKE_COMMAND}"
+                              -E create_symlink
+                              "${winsdk_um_lib_dir}/${library}"
+                              "${output_dir}/${all_lowercase_symlink_name}")
+    endif()
+
+    get_filename_component(name_we "${library}" NAME_WE)
+    get_filename_component(ext "${library}" EXT)
+    string(TOLOWER "${ext}" lowercase_ext)
+    set(lowercase_ext_symlink_name "${name_we}${lowercase_ext}")
+    if(NOT library STREQUAL lowercase_ext_symlink_name AND
+       NOT all_lowercase_symlink_name STREQUAL lowercase_ext_symlink_name)
+      execute_process(COMMAND "${CMAKE_COMMAND}"
+                              -E create_symlink
+                              "${winsdk_um_lib_dir}/${library}"
+                              "${output_dir}/${lowercase_ext_symlink_name}")
+    endif()
   endforeach()
 endfunction()


Suppress Clang12 -Watomic-implicit-seq-cst warning

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -118,6 +118,7 @@
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-c++98-c++11-compat-pedantic>
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-float-equal>
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated-declarations>
+            $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-atomic-implicit-seq-cst>

             # Clang 10 also throws up warnings we need to investigate (ours)
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-old-style-cast>
@@ -127,8 +128,7 @@
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-shift-sign-overflow>
             $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-format-nonliteral>

-            $<$<CXX_COMPILER_ID:Clang>:-Wdocumentation>)
-
+           $<$<CXX_COMPILER_ID:Clang>:-Wdocumentation>)

     target_link_options(${NAME}
         PRIVATE


BUG: Update MGHImageIO for header guarder style

Addresses failing KWStyle test.

Remove usage of reserved "__" prefix.

Change-Id: Ic92657fa61d1c78c0168b8fa7317d2de6bb98ec2

--- Modules/Remote/MGHIO.remote.cmake
+++ Modules/Remote/MGHIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(MGHIO
   "MGHIO ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/Slicer/itkMGHImageIO.git
-  GIT_TAG f4e475c47f5c246b1ebf0529e052f65b73c7d13d
+  GIT_TAG a7fe91bbc8f06e57c3d988862ae02ba313049042
   )


LLDBStandalone.cmake: set path to llvm-lit inside of llvm build dir

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -58,6 +58,7 @@
   set(LLVM_DIR ${LLVM_OBJ_ROOT}/cmake/modules/CMakeFiles CACHE PATH "Path to LLVM build tree CMake files")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+  set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")

   find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
     NO_DEFAULT_PATH)


added version 20151201 to ippicv project

--- cmake/projects/ippicv/hunter.cmake
+++ cmake/projects/ippicv/hunter.cmake
@@ -10,6 +10,41 @@
 include(hunter_add_version)
 include(hunter_download)
 include(hunter_pick_scheme)
+
+if(APPLE)
+  hunter_add_version(
+      PACKAGE_NAME
+      ippicv
+      VERSION
+      "20151201"
+      URL
+      "https://raw.githubusercontent.com/Itseez/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_macosx_20151201.tgz"
+      SHA1
+      d3f641c05708aaa2e0e91f2a10e34c80bc217cde
+  )
+elseif(UNIX)
+  hunter_add_version(
+      PACKAGE_NAME
+      ippicv
+      VERSION
+      "20151201"
+      URL
+      "https://raw.githubusercontent.com/Itseez/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_linux_20151201.tgz"
+      SHA1
+      2252c08aa3107f8e4194263e668ccff8c6e3783a
+  )
+elseif(WIN32)
+  hunter_add_version(
+      PACKAGE_NAME
+      ippicv
+      VERSION
+      "20151201"
+      URL
+      "https://raw.githubusercontent.com/Itseez/opencv_3rdparty/81a676001ca8075ada498583e4166079e5744668/ippicv/ippicv_windows_20151201.zip"
+      SHA1
+      3e596c7d798028699ae0ea870902288088a51a6d
+  )
+endif()

 if(APPLE)
   hunter_add_version(


CMake: Enable example compilation by default

--- cmake/setup_cached_variables.cmake
+++ cmake/setup_cached_variables.cmake
@@ -348,7 +348,7 @@

 OPTION(DEAL_II_COMPILE_EXAMPLES
   "If set to ON, all configurable example executables will be built and installed as well. If set to OFF, the examples component only installs the source code of example steps."
-  OFF
+  ON
   )
 MARK_AS_ADVANCED(DEAL_II_COMPILE_EXAMPLES)


python.cmake: Support both mac and linux.

--- python.cmake
+++ python.cmake
@@ -23,6 +23,18 @@

 message ("Installing ${python_NAME} into FlyEM build area: ${FLYEM_BUILD_DIR} ...")

+if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    # On Mac, we build a "Framework" build which has all the power of a "normal" build,
+    #  plus it can be used from a native GUI.
+    # See http://svn.python.org/projects/python/trunk/Mac/README
+    set (PYTHON_BUILD_TYPE_ARG "--enable-framework=${FLYEM_BUILD_DIR}/Frameworks")
+    set (PYTHON_PREFIX ${FLYEM_BUILD_DIR}/Frameworks/Python.framework/Versions/2.7)
+else()
+    # On linux, PYTHON_PREFIX is the same as the general prefix.
+    set (PYTHON_BUILD_TYPE_ARG "--enable-shared")
+    set (PYTHON_PREFIX ${FLYEM_BUILD_DIR})
+endif()
+
 ExternalProject_Add(${python_NAME}
     DEPENDS             ${zlib_NAME}
     PREFIX              ${FLYEM_BUILD_DIR}
@@ -32,16 +44,15 @@
     PATCH_COMMAND       ""
     CONFIGURE_COMMAND   ${FLYEM_ENV_STRING} ${python_SRC_DIR}/configure
         --prefix=${FLYEM_BUILD_DIR}
-        --enable-framework=${FLYEM_BUILD_DIR}/Frameworks
+        ${PYTHON_BUILD_TYPE_ARG}
         LDFLAGS=${FLYEM_LDFLAGS}
         CPPFLAGS=-I${FLYEM_BUILD_DIR}/include
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
     INSTALL_COMMAND     ${FLYEM_ENV_STRING} make install
-    BUILD_IN_SOURCE 1
+    BUILD_IN_SOURCE 1 # Required for Mac
 )

-set (PYTHON_PREFIX ${FLYEM_BUILD_DIR}/Frameworks/Python.framework/Versions/2.7)
-set (PYTHON_INCLUDE_PATH ${FLYEM_BUILD_DIR}/Frameworks/Python.framework/Versions/2.7/include/python2.7)
-set (PYTHON_EXE ${FLYEM_BUILD_DIR}/Frameworks/Python.framework/Versions/2.7/bin/python)
+set (PYTHON_INCLUDE_PATH ${PYTHON_PREFIX}/include/python2.7)
+set (PYTHON_EXE ${PYTHON_PREFIX}/bin/python)

 endif (NOT python_NAME)


update CMake module to work with Connext 5.2

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -213,8 +213,12 @@
     set(Connext_DEFINITIONS "RTI_LINUX" "RTI_UNIX")
     if(EXISTS "${Connext_HOME}/bin/rtiddsgen2")
       set(Connext_DDSGEN2 "${Connext_HOME}/bin/rtiddsgen2")
+    elseif(EXISTS "${Connext_HOME}/scripts/rtiddsgen2")
+      set(Connext_DDSGEN2 "${Connext_HOME}/scripts/rtiddsgen2")
+    elseif(EXISTS "${Connext_HOME}/bin/rtiddsgen")
+      set(Connext_DDSGEN2 "${Connext_HOME}/bin/rtiddsgen")
     else()
-      set(Connext_DDSGEN2 "${Connext_HOME}/scripts/rtiddsgen2")
+      message(FATAL_ERROR "Could not find executable 'rtiddsgen(2)'")
     endif()
   endif()
   set(Connext_FOUND TRUE)


there is no svd3x3 anymore

there is no svd3x3 anymore

--- tutorial/cmake/FindSVD3X3.cmake
+++ tutorial/cmake/FindSVD3X3.cmake
@@ -1,29 +0,0 @@
-# - Try to find the SVD3X3 library
-# Once done this will define
-#
-#  SVD3X3_FOUND - system has SVD3X3
-#  SVD3X3_INCLUDE_DIR - the SVD3X3 include directory
-
-FIND_PATH(SVD3X3_INCLUDE_DIR Singular_Value_Decomposition_Givens_QR_Factorization_Kernel.hpp
-   /usr/include
-   /usr/local/include
-   ${PROJECT_SOURCE_DIR}/../libigl/external/Singular_Value_Decomposition/
-   ${PROJECT_SOURCE_DIR}/../../external/Singular_Value_Decomposition/
-   ${PROJECT_SOURCE_DIR}/../external/Singular_Value_Decomposition/
-   NO_DEFAULT_PATH
-)
-
-SET(SVD3X3_FOUND "NO")
-IF (SVD3X3_INCLUDE_DIR)
-	SET(SVD3X3_FOUND "YES")
-ENDIF (SVD3X3_INCLUDE_DIR)
-
-if(SVD3X3_INCLUDE_DIR)
-   message(STATUS "Found SVD3X3: ${SVD3X3_INCLUDE_DIR}")
-else(SVD3X3_INCLUDE_DIR)
-  if (NOT SVD3X3_FIND_QUIETLY)
-   message(FATAL_ERROR "could NOT find SVD3X3")
- endif(NOT SVD3X3_FIND_QUIETLY)
-endif(SVD3X3_INCLUDE_DIR)
-
-MARK_AS_ADVANCED(SVD3X3_INCLUDE_DIR SVD3X3_LIBRARIES)


COMP: Fixed patch failures (CUSTOMBUILD : error : reg-lib/cpu/_reg_maths.h: patch does not apply), as we did before in ExternalITK.cmake

--- SuperBuild/ExternalNiftyreg.cmake
+++ SuperBuild/ExternalNiftyreg.cmake
@@ -28,7 +28,7 @@
   GIT_REPOSITORY ${NIFTYREG_GIT_REPOSITORY}
   GIT_TAG ${NIFTYREG_GIT_TAG}
   UPDATE_COMMAND ""
-  PATCH_COMMAND "${GIT_EXECUTABLE}" apply "${CMAKE_SOURCE_DIR}/Patches/nifty_strtof.patch"
+  PATCH_COMMAND "${GIT_EXECUTABLE}" reset --hard && "${GIT_EXECUTABLE}" clean --force && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/nifty_strtof.patch"
   SOURCE_DIR ${proj}
   BINARY_DIR ${proj}-build
   CMAKE_GENERATOR ${gen}


fix wrong comments about location of rosconfig.cmake

--- core/rosbuild/rosconfig.cmake
+++ core/rosbuild/rosconfig.cmake
@@ -8,7 +8,7 @@
 #    content before the invocation of rosbuild_init()),
 #    which is how we get here
 #  - read this file
-#  - if present, read $(ROS_ROOT)/rosconfig.cmake
+#  - if present, read $(ROS_ROOT)/core/rosbuild/rosconfig.cmake
 #  - if present, read rosconfig.cmake from the current packages's top-level
 #      directory.

@@ -20,7 +20,7 @@
 set(PROJECTCONFIG PROJECTCONFIG-NOTFOUND)

 #############################################################
-# look for user's override in $ROS_ROOT/rosconfig.cmake
+# look for user's override in $ROS_ROOT/core/rosbuild/rosconfig.cmake
 find_file(USERCONFIG
           rosconfig.cmake
           PATHS ENV ROS_ROOT


Removing GPU architecture flags completely so it will be decided on compile time

--- CMake/GOMCCUDASetup.cmake
+++ CMake/GOMCCUDASetup.cmake
@@ -1,16 +1,7 @@
 # Find CUDA is enabled, set it up

 set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-DGOMC_CUDA)
-set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-Wno-deprecated-gpu-targets)
 set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -std=c++11")
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_30,code=sm_30)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_35,code=sm_35)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode arch=compute_50,code=sm_50)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_61,code=sm_61)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_70,code=sm_70)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_70,code=compute_70)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_75,code=sm_75)
-#set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-gencode=arch=compute_75,code=compute_75)
 include_directories(src/GPU)
 #set(CUDA_VERBOSE_BUILD ON)
 set(CUDA_SEPARABLE_COMPILATION ON)


new pods.cmake resolves my build issue

new pods.cmake resolves my build issue

git-svn-id: 3bdc50f1ba932488e36d0c1d1e7fc079467b8f9b@7339 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/viewer/cmake/pods.cmake
+++ software/viewer/cmake/pods.cmake
@@ -26,7 +26,7 @@
 #
 # ----
 # File: pods.cmake
-# Distributed with pods version: 12.01.11
+# Distributed with pods version: 12.09.21

 # pods_install_headers(<header1.h> ... DESTINATION <subdir_name>)
 #
@@ -305,9 +305,10 @@
         ${PKG_CONFIG_EXECUTABLE} --libs ${ARGN}
         OUTPUT_VARIABLE _pods_pkg_ldflags)
     string(STRIP ${_pods_pkg_ldflags} _pods_pkg_ldflags)
-    #    message("ldflags: ${_pods_pkg_ldflags}")
+    # message("ldflags: ${_pods_pkg_ldflags}")
     include_directories(${_pods_pkg_include_flags})
-    target_link_libraries(${target} ${_pods_pkg_ldflags})
+    string(REPLACE " " ";" TMP ${_pods_pkg_ldflags}) #covert to a list
+    target_link_libraries(${target} ${TMP})

     # make the target depend on libraries that are cmake targets
     if (_pods_pkg_ldflags)
@@ -316,7 +317,7 @@
                 string(REGEX REPLACE "^-l" "" __depend_target_name ${__ldflag})
                 get_target_property(IS_TARGET ${__depend_target_name} LOCATION)
                 if (NOT IS_TARGET STREQUAL "IS_TARGET-NOTFOUND")
-                    #message("---- ${target} depends on  ${libname}")
+                    #message("---- ${target} depends on  ${__depend_target_name}")
                     add_dependencies(${target} ${__depend_target_name})
                 endif()
         endforeach()


Allow to build 64bit NSIS installers

Allow to build 64bit NSIS installers

--- cmake/BALLPackageConfig.cmake
+++ cmake/BALLPackageConfig.cmake
@@ -11,6 +11,9 @@
 SET(CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/cmake/installer/Welcome.rtf")

 IF (WIN32 AND NOT UNIX)
+	IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
+		SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
+	ENDIF()
 	SET(CPACK_NSIS_MUI_ICON "${PROJECT_SOURCE_DIR}\\\\data\\\\graphics\\\\ballview.ico")
 	SET(CPACK_NSIS_MUI_UNIICON "${PROJECT_SOURCE_DIR}\\\\data\\\\graphics\\\\ballview.ico")
 	SET(CPACK_PACKAGE_ICON "${PROJECT_SOURCE_DIR}\\\\data\\\\graphics\\\\installer_header.bmp")


Add color when using Ninja

Add color when using Ninja

--- cmake/LIEFCompilerFlags.cmake
+++ cmake/LIEFCompilerFlags.cmake
@@ -60,6 +60,11 @@
   ADD_FLAG_IF_SUPPORTED("-fexceptions"              EXCEPTION)
   ADD_FLAG_IF_SUPPORTED("-fvisibility=hidden"       VISIBILITY)
   ADD_FLAG_IF_SUPPORTED("-Wno-expansion-to-defined" NO_EXPANSION_TO_DEFINED)
+
+  ADD_FLAG_IF_SUPPORTED("-fdiagnostics-color=always" DIAGNOSTICS_COLOR)
+  ADD_FLAG_IF_SUPPORTED("-fcolor-diagnostics"        COLOR_DIAGNOSTICS)
+
+
 endif()
 #ADD_FLAG_IF_SUPPORTED("-Wduplicated-cond"         HAS_DUPLICATED_COND)
 #ADD_FLAG_IF_SUPPORTED("-Wduplicated-branches"     HAS_DUPLICATED_BRANCHES)


Potential fix for wxWidgets problem on windows.

svn path=/trunk/; revision=12533

--- cmake/modules/wxwidgets.cmake
+++ cmake/modules/wxwidgets.cmake
@@ -70,12 +70,12 @@
     "-D${wxWidgets_DEFINITIONS}"
     )
   set(wxWidgets_DEFINITIONS_DEBUG_wD "")
-  if(wxWidgets_DEFINITIONS_DEBUG)
+  if(wxWidgets_DEFINITIONS_DEBUG AND CMAKE_BUILD_TYPE MATCHES "Debug")
     string(REGEX REPLACE ";" " -D"
       wxWidgets_DEFINITIONS_DEBUG_wD
       "-D${wxWidgets_DEFINITIONS_DEBUG}"
       )
-  endif(wxWidgets_DEFINITIONS_DEBUG)
+  endif(wxWidgets_DEFINITIONS_DEBUG AND CMAKE_BUILD_TYPE MATCHES "Debug")
   string(REGEX REPLACE ";" " "
     wxwidgets_COMPILE_FLAGS
     ${wxwidgets_COMPILE_FLAGS}


[cmake] Add support for case-sensitive Windows SDKs

When the Windows SDK is hosted on a case-sensitive filesystem (e.g. when
compiling on Linux and not using ciopfs), we can automatically generate
a VFS overlay for headers and symlinks for libraries.

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

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

--- cmake/platforms/WinMsvc.cmake
+++ cmake/platforms/WinMsvc.cmake
@@ -80,18 +80,9 @@
 #
 # IMPORTANT: In order for this to work, you will need a valid copy of the Windows
 # SDK and C++ STL headers and libraries on your host.  Additionally, since the
-# Windows libraries and headers are not case-correct, you will need to have these
-# mounted in a case-insensitive mount.  This requires one command to set up.
-#
-# ~/src: mkdir winsdk
-# ~/src: mkdir winsdk.icase
-# ~/src: ciopfs winsdk/ winsdk.icase
-#
-# Now copy or otherwise install your headers and libraries to the winsdk.icase folder
-# and use *that* folder as the path when configuring CMake.
-#
-# TODO: We could also provide a CMake option -DUSE_ICASE_VFS_OVERLAY=ON/OFF that would
-# make this optional.  For now, we require ciopfs.
+# Windows libraries and headers are not case-correct, this toolchain file sets
+# up a VFS overlay for the SDK headers and case-correcting symlinks for the
+# libraries when running on a case-sensitive filesystem.

 # When configuring CMake with a toolchain file against a top-level CMakeLists.txt,
@@ -110,6 +101,49 @@
   endif()
 endfunction()

+function(generate_winsdk_vfs_overlay winsdk_include_dir output_path)
+  set(include_dirs)
+  file(GLOB_RECURSE entries LIST_DIRECTORIES true "${winsdk_include_dir}/*")
+  foreach(entry ${entries})
+    if(IS_DIRECTORY "${entry}")
+      list(APPEND include_dirs "${entry}")
+    endif()
+  endforeach()
+
+  file(WRITE "${output_path}"  "version: 0\n")
+  file(APPEND "${output_path}" "case-sensitive: false\n")
+  file(APPEND "${output_path}" "roots:\n")
+
+  foreach(dir ${include_dirs})
+    file(GLOB headers RELATIVE "${dir}" "${dir}/*.h")
+    if(NOT headers)
+      continue()
+    endif()
+
+    file(APPEND "${output_path}" "  - name: \"${dir}\"\n")
+    file(APPEND "${output_path}" "    type: directory\n")
+    file(APPEND "${output_path}" "    contents:\n")
+
+    foreach(header ${headers})
+      file(APPEND "${output_path}" "      - name: \"${header}\"\n")
+      file(APPEND "${output_path}" "        type: file\n")
+      file(APPEND "${output_path}" "        external-contents: \"${dir}/${header}\"\n")
+    endforeach()
+  endforeach()
+endfunction()
+
+function(generate_winsdk_lib_symlinks winsdk_um_lib_dir output_dir)
+  execute_process(COMMAND "${CMAKE_COMMAND}" -E make_directory "${output_dir}")
+  file(GLOB libraries RELATIVE "${winsdk_um_lib_dir}" "${winsdk_um_lib_dir}/*")
+  foreach(library ${libraries})
+    string(TOLOWER "${library}" symlink_name)
+    execute_process(COMMAND "${CMAKE_COMMAND}"
+                            -E create_symlink
+                            "${winsdk_um_lib_dir}/${library}"
+                            "${output_dir}/${symlink_name}")
+  endforeach()
+endfunction()
+
 set(CMAKE_SYSTEM_NAME Windows)
 set(CMAKE_SYSTEM_VERSION 10.0)
 set(CMAKE_SYSTEM_PROCESSOR AMD64)
@@ -170,6 +204,13 @@
           "Windows SDK installation")
 endif()

+if(NOT EXISTS "${WINSDK_INCLUDE}/um/Windows.h")
+  message(SEND_ERROR "Cannot find Windows.h")
+endif()
+if(NOT EXISTS "${WINSDK_INCLUDE}/um/WINDOWS.H")
+  set(case_sensitive_filesystem TRUE)
+endif()
+
 set(CMAKE_C_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
 set(CMAKE_CXX_COMPILER "${LLVM_NATIVE_TOOLCHAIN}/bin/clang-cl" CACHE FILEPATH "")
 set(CMAKE_LINKER "${LLVM_NATIVE_TOOLCHAIN}/bin/lld-link" CACHE FILEPATH "")
@@ -195,6 +236,18 @@
     -imsvc "${WINSDK_INCLUDE}/um"
     -imsvc "${WINSDK_INCLUDE}/winrt")

+if(case_sensitive_filesystem)
+  # Ensure all sub-configures use the top-level VFS overlay instead of generating their own.
+  init_user_prop(winsdk_vfs_overlay_path)
+  if(NOT winsdk_vfs_overlay_path)
+    set(winsdk_vfs_overlay_path "${CMAKE_BINARY_DIR}/winsdk_vfs_overlay.yaml")
+    generate_winsdk_vfs_overlay("${WINSDK_BASE}/Include/${WINSDK_VER}" "${winsdk_vfs_overlay_path}")
+    init_user_prop(winsdk_vfs_overlay_path)
+  endif()
+  list(APPEND COMPILE_FLAGS
+       -Xclang -ivfsoverlay -Xclang "${winsdk_vfs_overlay_path}")
+endif()
+
 string(REPLACE ";" " " COMPILE_FLAGS "${COMPILE_FLAGS}")

 # We need to preserve any flags that were passed in by the user. However, we
@@ -217,6 +270,18 @@
     -libpath:"${WINSDK_LIB}/ucrt/${WINSDK_ARCH}"
     -libpath:"${WINSDK_LIB}/um/${WINSDK_ARCH}")

+if(case_sensitive_filesystem)
+  # Ensure all sub-configures use the top-level symlinks dir instead of generating their own.
+  init_user_prop(winsdk_lib_symlinks_dir)
+  if(NOT winsdk_lib_symlinks_dir)
+    set(winsdk_lib_symlinks_dir "${CMAKE_BINARY_DIR}/winsdk_lib_symlinks")
+    generate_winsdk_lib_symlinks("${WINSDK_BASE}/Lib/${WINSDK_VER}/um/${WINSDK_ARCH}" "${winsdk_lib_symlinks_dir}")
+    init_user_prop(winsdk_lib_symlinks_dir)
+  endif()
+  list(APPEND LINK_FLAGS
+       -libpath:"${winsdk_lib_symlinks_dir}")
+endif()
+
 string(REPLACE ";" " " LINK_FLAGS "${LINK_FLAGS}")

 # See explanation for compiler flags above for the _INITIAL variables.