cmake: compile with -Wno-nullability-completeness

Summary:
When compiling with clang, also specify -Wno-nullability-completeness

We currently use this flag for internal Facebook builds using buck.  This
brings the CMake and buck compilation command lines closer in sync.  Even
though the folly code currently does not produce any nullability completeness
warnings, we are likely to break this in the future since we do not have
this warning enabled internally.

It also seems like `-Wnullability-completeness` results in code that cannot be
compiled successfully across various clang versions.  Recent versions of clang
complain about missing nullability specifiers on `std::unique_ptr` arguments,
while slightly older clang versions produce compilation errors if nullability
specifiers are listed on anything but raw pointers.

Reviewed By: igorsugak

Differential Revision: D6902930

fbshipit-source-id: 0b8cd5eca17cf8f9deda6b0c32f5838489542128

--- CMake/FollyConfigChecks.cmake
+++ CMake/FollyConfigChecks.cmake
@@ -35,6 +35,13 @@
   CHECK_CXX_COMPILER_FLAG(-Wno-noexcept-type COMPILER_HAS_W_NOEXCEPT_TYPE)
   if (COMPILER_HAS_W_NOEXCEPT_TYPE)
     list(APPEND FOLLY_CXX_FLAGS -Wno-noexcept-type)
+  endif()
+
+  CHECK_CXX_COMPILER_FLAG(
+      -Wno-nullability-completeness
+      COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
+  if (COMPILER_HAS_W_NULLABILITY_COMPLETENESS)
+    list(APPEND FOLLY_CXX_FLAGS -Wno-nullability-completeness)
   endif()

   CHECK_CXX_COMPILER_FLAG(-faligned-new COMPILER_HAS_F_ALIGNED_NEW)


updated the test image in the mitk-data repository

(cherry picked from commit ea5e7598253ce05bc331f2b453b92183cd6f9cf3)

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag b6cf7fd6) # first 8 characters of hash-tag
+  set(revision_tag 53189e8e) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Search for GLEWmx in default paths too

Search for GLEWmx in default paths too

Is there a reason the search needs to be limited to those specific locations? CMake now can't find the GLEW I installed under $HOME (even though I added it to CMAKE_SYSTEM_PREFIX_PATH).

--- CMakeModules/FindGLEWmx.cmake
+++ CMakeModules/FindGLEWmx.cmake
@@ -55,7 +55,6 @@
         /sw/lib
         /opt/local/lib
         ${GLEW_ROOT_DIR}/lib
-        NO_DEFAULT_PATH
         DOC "The GLEWmx library")

     SET(PX ${CMAKE_STATIC_LIBRARY_PREFIX})
@@ -72,7 +71,6 @@
         /sw/lib
         /opt/local/lib
         ${GLEW_ROOT_DIR}/lib
-        NO_DEFAULT_PATH
         DOC "The GLEWmx library")
     UNSET(PX)
     UNSET(SX)


Updating toolchain to reflect new target name

--- targets/target-kubos-linux-isis-gcc/CMake/toolchain.cmake
+++ targets/target-kubos-linux-isis-gcc/CMake/toolchain.cmake
@@ -1,8 +1,8 @@
 # Copyright (C) 2016 Kubos Corporation
-if (TARGET_KUBOS_ISIS_GCC_TOOLCHAIN_INCLUDED)
+if (TARGET_KUBOS_LINUX_ISIS_GCC_TOOLCHAIN_INCLUDED)
     return()
 endif()
-set(TARGET_KUBOS_ISIS_GCC_TOOLCHAIN_INCLUDED 1)
+set(TARGET_KUBOS_LINUX_ISIS_GCC_TOOLCHAIN_INCLUDED 1)

 set(CMAKE_SYSTEM_PROCESSOR "arm926ej-s")
 add_definitions("-DTOOLCHAIN_GCC_ARM")


COMP: mitkSurfaceVtkMapper2DTest is only build if the cmake flag is set.

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -109,13 +109,13 @@
   mitkImageToSurfaceFilterTest.cpp
   mitkEqualTest.cpp
   mitkLineTest.cpp
-  mitkSurfaceVtkMapper2DTest.cpp
 )

-if(MITK_ENABLE_RENDERING_TESTING) #since mitkInteractionTestHelper is currently creating a vtkRenderWindow
+if(MITK_ENABLE_RENDERING_TESTING)
 set(MODULE_TESTS
   ${MODULE_TESTS}
-  mitkPointSetDataInteractorTest.cpp
+  mitkPointSetDataInteractorTest.cpp #since mitkInteractionTestHelper is currently creating a vtkRenderWindow
+  mitkSurfaceVtkMapper2DTest.cpp #new rendering test in CppUnit style
 )
 endif()


Updating Swig superbuild version to 3.0.10

Change-Id: I45449b5341410dac5f03cdb868e3b8ddab6f7677

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -20,14 +20,14 @@

   if( USE_SWIG_FROM_GIT )
     set(SWIG_GIT_REPOSITORY "${git_protocol}://github.com/swig/swig.git" CACHE STRING "URL of swig git repo")
-    set(SWIG_GIT_TAG "rel-3.0.9" CACHE STRING "Tag in swig git repo")
+    set(SWIG_GIT_TAG "rel-3.0.10" CACHE STRING "Tag in swig git repo")
     mark_as_advanced(SWIG_GIT_REPO)
     mark_as_advanced(SWIG_GIT_TAG)
   endif()

-  set(SWIG_TARGET_VERSION "3.0.9" )
-  set(SWIG_DOWNLOAD_SOURCE_HASH "4bc5f46a6cdedbd8f579b25fafc96fd6")
-  set(SWIG_DOWNLOAD_WIN_HASH "811adf794d26a0cf54da578c2b9a14a3")
+  set(SWIG_TARGET_VERSION "3.0.10" )
+  set(SWIG_DOWNLOAD_SOURCE_HASH "bb4ab8047159469add7d00910e203124")
+  set(SWIG_DOWNLOAD_WIN_HASH "f229724fe856aa78df6128ecfefe6e0a")

   if(WIN32)
     # binary SWIG for windows


SK:

SK:

-SK: changed the delay time from 5 to 10 minutes for continuous builds

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -166,8 +166,8 @@
       ctest_submit()
     endif()

-    # Delay until at least 5 minutes past START_TIME
-    ctest_sleep( ${START_TIME} 300 ${CTEST_ELAPSED_TIME} )
+    # Delay until at least 10 minutes past START_TIME
+    ctest_sleep( ${START_TIME} 600 ${CTEST_ELAPSED_TIME} )
   endwhile()
 else()
   write_cache()


Propagate ITKV3_COMPATIBILITY to the ITK sub-build

Change-Id: Ie0e466c7e0ab2cb57501d444ed3d8ac6cd12b8a9

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -14,7 +14,10 @@
 get_cmake_property( _varNames VARIABLES )

 foreach (_varName ${_varNames})
-  if(_varName MATCHES "^ITK_" OR _varName MATCHES "FFTW" OR _varName MATCHES "^Module_ITK")
+  if(_varName MATCHES "^ITK_"
+      OR _varName MATCHES "^ITKV3"
+      OR _varName MATCHES "FFTW"
+      OR _varName MATCHES "^Module_ITK")
     message( STATUS "Passing variable \"${_varName}=${${_varName}}\" to ITK external project.")
     list(APPEND ITK_VARS ${_varName})
   endif()


Remove options to compile ITK Wrapping along side SimpleITK

The two wrapping and independent and there is not way to exchange data
between them.

Change-Id: I06d9a8b850c9a9a3f6c66cc7b7d386a1126d0b85

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -44,13 +44,12 @@
 # NOTE: it is very important to update the ITK_DIR path with the ITK version
 set(ITK_TAG_COMMAND GIT_TAG e234d4df432387f5cd667a91c958be9d79892815 )# ITK 4.11 post rc2

-if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
+if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )
 else()
   set( ITK_BUILD_SHARED_LIBS OFF )
   list( APPEND ep_itk_args"-DCMAKE_C_VISIBILITY_PRESET:STRING=hidden" "-DCMAKE_CXX_VISIBILITY_PRESET:STRING=hidden" )
 endif()
-

 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_itk_cache}\n${ep_common_cache}" )

@@ -78,22 +77,6 @@
   -DITK_BUILD_DEFAULT_MODULES:BOOL=ON
   -DModule_ITKReview:BOOL=ON
   -DITK_USE_GIT_PROTOCOL:BOOL=${ITK_USE_GIT_PROTOCOL}
-  -DITK_WRAP_float:BOOL=ON
-  -DITK_WRAP_unsigned_char:BOOL=ON
-  -DITK_WRAP_signed_short:BOOL=ON
-  -DITK_WRAP_unsigned_short:BOOL=ON
-  -DITK_WRAP_complex_float:BOOL=ON
-  -DITK_WRAP_vector_float:BOOL=ON
-  -DITK_WRAP_covariant_vector_float:BOOL=ON
-  -DITK_WRAP_rgb_signed_short:BOOL=ON
-  -DITK_WRAP_rgb_unsigned_char:BOOL=ON
-  -DITK_WRAP_rgb_unsigned_short:BOOL=ON
-  -DITK_WRAP_PYTHON:BOOL=${ITK_WRAPPING}
-  # Required as to not install into system
-  -DINSTALL_WRAP_ITK_COMPATIBILITY:BOOL=OFF
-  # Swig
-  -DSWIG_DIR:PATH=${SWIG_DIR}
-  -DSWIG_EXECUTABLE:PATH=${SWIG_EXECUTABLE}
   BUILD_COMMAND ${BUILD_COMMAND_STRING}
   DEPENDS
     ${ITK_DEPENDENCIES}
@@ -103,4 +86,3 @@

 ExternalProject_Get_Property(ITK install_dir)
 set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.11" )
-set(WrapITK_DIR "${ITK_DIR}/WrapITK")


FindLIBPORTAUDIO.cmake: Be more systematic

--- cmake/FindLIBPORTAUDIO.cmake
+++ cmake/FindLIBPORTAUDIO.cmake
@@ -5,24 +5,36 @@
 #  LIBPORTAUDIO_LIBRARIES - The libraries needed to use portaudio
 #  LIBPORTAUDIO_DEFINITIONS - Compiler switches required for using portaudio

+set(LIBPORTAUDIO_SEARCH_LIBS libportaudio portaudio libportaudio-2 portaudio-2
+	libportaudio19 portaudio19 libportaudio-19 portaudio-19 libportaudio2
+	portaudio2)
+set(LIBPORTAUDIO_SEARCH_HEADERS portaudio.h)
+
 if (MSVC)
-	set(LIBPORTAUDIO_ROOT $ENV{LIBPORTAUDIO_ROOT} CACHE PATH "Installation folder of portaudio")
+	set(LIBPORTAUDIO_ROOT $ENV{LIBPORTAUDIO_ROOT} CACHE
+		PATH "Installation folder of portaudio")
+
 	if (CMAKE_CL_64)
-		set(LIBPORTAUDIO_DIR ${LIBPORTAUDIO_ROOT}/x64)
+		set(_subdirs ${LIBPORTAUDIO_ROOT}/x64 ${LIBPORTAUDIO_ROOT}/x64/lib
+			${LIBPORTAUDIO_ROOT}/lib/x64 ${LIBPORTAUDIO_ROOT}/lib64
+			${LIBPORTAUDIO_ROOT}/lib ${LIBPORTAUDIO_ROOT})
 	else ()
-		set(LIBPORTAUDIO_DIR ${LIBPORTAUDIO_ROOT}/x86)
+		set(_subdirs ${LIBPORTAUDIO_ROOT}/x86 ${LIBPORTAUDIO_ROOT}/x86/lib
+			${LIBPORTAUDIO_ROOT}/lib/x86 ${LIBPORTAUDIO_ROOT}/lib32
+			${LIBPORTAUDIO_ROOT}/lib ${LIBPORTAUDIO_ROOT})
 	endif()

 #	message("LIBPORTAUDIO_DIR: ${LIBPORTAUDIO_DIR}")

-	find_library(LIBPORTAUDIO_LIBRARY NAMES portaudio portaudio19 portaudio2 libportaudio libportaudio19 libportaudio2
-		HINTS ${LIBPORTAUDIO_DIR}/lib )
+	find_library(LIBPORTAUDIO_LIBRARY
+		NAMES ${LIBPORTAUDIO_SEARCH_LIBS}
+		PATHS ${_subdirs})

 #	message("LIBPORTAUDIO_LIBRARY: ${LIBPORTAUDIO_LIBRARY}")

-	find_path(LIBPORTAUDIO_INCLUDE_DIR portaudio.h
-		HINTS ${LIBPORTAUDIO_DIR}/include
-		PATH_SUFFIXES portaudio )
+	find_path(LIBPORTAUDIO_INCLUDE_DIR ${LIBPORTAUDIO_SEARCH_HEADERS}
+		PATHS ${_subdirs}
+		PATH_SUFFIXES include portaudio include/portaudio)

 #	message("LIBPORTAUDIO_INCLUDE_DIR: ${LIBPORTAUDIO_LIBRARY}")

@@ -32,21 +44,21 @@
 	set(LIBPORTAUDIO_DEFINITIONS ${PC_LIBPORTAUDIO_CFLAGS_OTHER})

 	find_path(LIBPORTAUDIO_INCLUDE_DIR portaudio.h
-          HINTS ${PC_LIBPORTAUDIO_INCLUDEDIR} ${PC_LIBPORTAUDIO_INCLUDE_DIRS}
-          PATH_SUFFIXES portaudio )
+        HINTS ${PC_LIBPORTAUDIO_INCLUDEDIR} ${PC_LIBPORTAUDIO_INCLUDE_DIRS}
+        PATH_SUFFIXES portaudio)

 	find_library(LIBPORTAUDIO_LIBRARY NAMES libportaudio portaudio
-             HINTS ${PC_LIBPORTAUDIO_LIBDIR} ${PC_LIBPORTAUDIO_LIBRARY_DIRS} )
+        HINTS ${PC_LIBPORTAUDIO_LIBDIR} ${PC_LIBPORTAUDIO_LIBRARY_DIRS})

 endif()

-set(LIBPORTAUDIO_LIBRARIES ${LIBPORTAUDIO_LIBRARY} )
-set(LIBPORTAUDIO_INCLUDE_DIRS ${LIBPORTAUDIO_INCLUDE_DIR} )
+set(LIBPORTAUDIO_LIBRARIES ${LIBPORTAUDIO_LIBRARY})
+set(LIBPORTAUDIO_INCLUDE_DIRS ${LIBPORTAUDIO_INCLUDE_DIR})

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set LIBPORTAUDIO_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(Portaudio  DEFAULT_MSG
-                                  LIBPORTAUDIO_LIBRARIES LIBPORTAUDIO_INCLUDE_DIRS)
+find_package_handle_standard_args(LIBPORTAUDIO  DEFAULT_MSG
+                        LIBPORTAUDIO_LIBRARIES LIBPORTAUDIO_INCLUDE_DIRS)

 mark_as_advanced(LIBPORTAUDIO_INCLUDE_DIRS LIBPORTAUDIO_LIBRARIES)


cray: Do not assume that Cray compiler supports visibility attributes

--- cmake/VisibilityDetect.cmake
+++ cmake/VisibilityDetect.cmake
@@ -7,10 +7,10 @@

         # Check GCC
         check_c_source_compiles ("int main () {
-                                        #if (__GNUC__ >= 4) && \\\\
+                                        #if (__GNUC__ >= 4) && !defined(_CRAYC) && \\\\
                                             !defined(__sun)  && !defined(sun)  && \\\\
                                             !defined(__hpux) && !defined(hpux) && \\\\
-                                            !defined(_AIX) && !defined(__CYGWIN__) && !defined(__MSYS__)
+                                            !defined(_AIX)   && !defined(__CYGWIN__) && !defined(__MSYS__)
                                         return 0;
                                         #else
                                         stop_compile_here


Refuse to build a non-homogeneous workspace.

non-homogeneous meaning contains catkin and
non-catkin packages in the same workspace.

--- cmake/catkin_workspace.cmake
+++ cmake/catkin_workspace.cmake
@@ -35,6 +35,7 @@
   include(${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/order_packages.cmake)

   if(CATKIN_ORDERED_PACKAGES)
+    set(CATKIN_NONHOMOGENEOUS_WORKSPACE FALSE)
     message(STATUS "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
     message(STATUS "~~  traversing packages in topological order:")
     list(LENGTH CATKIN_ORDERED_PACKAGES count)
@@ -44,21 +45,31 @@
       list(GET CATKIN_ORDERED_PACKAGES_IS_META ${index} is_meta)
       list(GET CATKIN_ORDERED_PACKAGES_BUILD_TYPE ${index} build_type)
       if(${is_meta})
+        # If metapackage
         message(STATUS "~~  - ${name} (metapackage)")
       else()
         if(${build_type} MATCHES catkin)
+          # If catkin (default if not set)
           message(STATUS "~~  - ${name}")
-        endif()
-        if(${build_type} MATCHES cmake)
-          message(STATUS "~~  - ${name} (non-catkin)")
-        endif()
-        if(NOT ${build_type} MATCHES catkin AND
-           NOT ${build_type} MATCHES cmake)
-          message(FATAL_ERROR "Unknown build type '${build_type}' for package '${path}'")
+        else()
+          # Else non-homogeneous
+          set(CATKIN_NONHOMOGENEOUS_WORKSPACE TRUE)
+          # If cmake
+          if(${build_type} MATCHES cmake)
+            message(STATUS "~~  - ${name} (plain cmake)")
+          else()
+            # Else unknown
+            message(STATUS "~~  - ${name} (unknown)")
+            message(WARNING "Unknown build type '${build_type}' for package '${name}'")
+          endif()
         endif()
       endif()
     endforeach()
     message(STATUS "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
+
+    if(${CATKIN_NONHOMOGENEOUS_WORKSPACE})
+      message(FATAL_ERROR "This workspace contains non-catkin packages in it, and catkin cannot build a non-homogeneous workspace without isolation.")
+    endif()

     foreach(index RANGE ${range})
       list(GET CATKIN_ORDERED_PACKAGES ${index} name)
@@ -72,13 +83,8 @@
           message(STATUS "+++ processing catkin package: '${name}'")
           message(STATUS "==> add_subdirectory(${path})")
           add_subdirectory(${path})
-        endif()
-        if(${build_type} MATCHES cmake)
-          message(STATUS "+++ skipping plain cmake package: '${name}'")
-        endif()
-        if(NOT ${build_type} MATCHES catkin AND
-           NOT ${build_type} MATCHES cmake)
-          message(FATAL_ERROR "Unknown build type '${build_type}' for package '${path}'")
+        else()
+          message(FATAL_ERROR "Non-catkin package found, non-homogeneous workspaces are not supported.")
         endif()
       endif()
     endforeach()


build: pass the Windows headers properly

The Windows headers are the system (sysroot) headers.  They are not
consumed by swift but the clang importer.  Furthermore, they should be
treated as system headers.  Correct the flags used for the invocation.
This fixes the build of the SDK overlay for Windows.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -818,7 +818,6 @@
   endif()

   if("${SWIFTLIB_SINGLE_SDK}" STREQUAL "WINDOWS")
-    swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
     if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
       swift_windows_generate_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS)
       foreach(flag ${SWIFTLIB_SINGLE_VFS_OVERLAY_FLAGS})
@@ -826,8 +825,9 @@
         list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS ${flag})
       endforeach()
     endif()
+    swift_windows_include_for_arch(${SWIFTLIB_SINGLE_ARCHITECTURE} SWIFTLIB_INCLUDE)
     foreach(directory ${SWIFTLIB_INCLUDE})
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-I${directory})
+      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-isystem;-Xcc;${directory})
     endforeach()
     if("${SWIFTLIB_SINGLE_ARCHITECTURE}" MATCHES arm)
       list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xcc;-D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE)


build: rename prefix for `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -693,37 +693,36 @@
 # source1 ...
 #   Sources to add into this library
 function(_add_swift_host_library_single target)
-  set(SWIFTLIB_SINGLE_options
+  set(options
         SHARED
         STATIC)
-  set(SWIFTLIB_SINGLE_single_parameter_options)
-  set(SWIFTLIB_SINGLE_multiple_parameter_options
+  set(single_parameter_options)
+  set(multiple_parameter_options
         GYB_SOURCES
         LLVM_LINK_COMPONENTS)

-  cmake_parse_arguments(SWIFTLIB_SINGLE
-                        "${SWIFTLIB_SINGLE_options}"
-                        "${SWIFTLIB_SINGLE_single_parameter_options}"
-                        "${SWIFTLIB_SINGLE_multiple_parameter_options}"
+  cmake_parse_arguments(ASHLS
+                        "${options}"
+                        "${single_parameter_options}"
+                        "${multiple_parameter_options}"
                         ${ARGN})
-
-  set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_UNPARSED_ARGUMENTS})
-
-  translate_flags(SWIFTLIB_SINGLE "${SWIFTLIB_SINGLE_options}")
-
-  if(NOT SWIFTLIB_SINGLE_SHARED AND NOT SWIFTLIB_SINGLE_STATIC)
+  set(ASHLS_SOURCES ${ASHLS_UNPARSED_ARGUMENTS})
+
+  translate_flags(ASHLS "${options}")
+
+  if(NOT ASHLS_SHARED AND NOT ASHLS_STATIC)
     message(FATAL_ERROR "Either SHARED or STATIC must be specified")
   endif()

   # Determine the subdirectory where this library will be installed.
-  set(SWIFTLIB_SINGLE_SUBDIR
+  set(ASHLS_SUBDIR
     "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}/${SWIFT_HOST_VARIANT_ARCH}")

   # Include LLVM Bitcode slices for iOS, Watch OS, and Apple TV OS device libraries.
   set(embed_bitcode_arg)
   if(SWIFT_EMBED_BITCODE_SECTION)
     if(SWIFT_HOST_VARIANT_SDK MATCHES "(I|TV|WATCH)OS")
-      list(APPEND SWIFTLIB_SINGLE_C_COMPILE_FLAGS "-fembed-bitcode")
+      list(APPEND ASHLS_C_COMPILE_FLAGS "-fembed-bitcode")
       set(embed_bitcode_arg EMBED_BITCODE)
     endif()
   endif()
@@ -731,39 +730,37 @@
   if(XCODE)
     string(REGEX MATCHALL "/[^/]+" split_path ${CMAKE_CURRENT_SOURCE_DIR})
     list(GET split_path -1 dir)
-    file(GLOB_RECURSE SWIFTLIB_SINGLE_HEADERS
+    file(GLOB_RECURSE ASHLS_HEADERS
       ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.h
       ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.def
       ${CMAKE_CURRENT_SOURCE_DIR}/*.def)

-    file(GLOB_RECURSE SWIFTLIB_SINGLE_TDS
+    file(GLOB_RECURSE ASHLS_TDS
       ${SWIFT_SOURCE_DIR}/include/swift${dir}/*.td)

-    set_source_files_properties(${SWIFTLIB_SINGLE_HEADERS} ${SWIFTLIB_SINGLE_TDS}
+    set_source_files_properties(${ASHLS_HEADERS} ${ASHLS_TDS}
       PROPERTIES
       HEADER_FILE_ONLY true)
-    source_group("TableGen descriptions" FILES ${SWIFTLIB_SINGLE_TDS})
-
-    set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_SOURCES} ${SWIFTLIB_SINGLE_HEADERS} ${SWIFTLIB_SINGLE_TDS})
-  endif()
-
-  if(SWIFTLIB_SINGLE_SHARED)
+    source_group("TableGen descriptions" FILES ${ASHLS_TDS})
+
+    set(ASHLS_SOURCES ${ASHLS_SOURCES} ${ASHLS_HEADERS} ${ASHLS_TDS})
+  endif()
+
+  if(ASHLS_SHARED)
     set(libkind SHARED)
-  elseif(SWIFTLIB_SINGLE_STATIC)
+  elseif(ASHLS_STATIC)
     set(libkind STATIC)
   endif()

-  if(SWIFTLIB_SINGLE_GYB_SOURCES)
+  if(ASHLS_GYB_SOURCES)
     handle_gyb_sources(
         gyb_dependency_targets
-        SWIFTLIB_SINGLE_GYB_SOURCES
+        ASHLS_GYB_SOURCES
         "${SWIFT_HOST_VARIANT_ARCH}")
-    set(SWIFTLIB_SINGLE_SOURCES ${SWIFTLIB_SINGLE_SOURCES}
-      ${SWIFTLIB_SINGLE_GYB_SOURCES})
-  endif()
-
-  add_library("${target}" ${libkind}
-              ${SWIFTLIB_SINGLE_SOURCES})
+      set(ASHLS_SOURCES ${ASHLS_SOURCES} ${ASHLS_GYB_SOURCES})
+  endif()
+
+  add_library("${target}" ${libkind} ${ASHLS_SOURCES})
   _set_target_prefix_and_suffix("${target}" "${libkind}" "${SWIFT_HOST_VARIANT_SDK}")

   if("${SWIFT_HOST_VARIANT_SDK}" STREQUAL "WINDOWS")
@@ -818,18 +815,18 @@
         ${LLVM_COMMON_DEPENDS})

   # Call llvm_config() only for libraries that are part of the compiler.
-  swift_common_llvm_config("${target}" ${SWIFTLIB_SINGLE_LLVM_LINK_COMPONENTS})
+  swift_common_llvm_config("${target}" ${ASHLS_LLVM_LINK_COMPONENTS})

   # Collect compile and link flags for the static and non-static targets.
   # Don't set PROPERTY COMPILE_FLAGS or LINK_FLAGS directly.
-  set(c_compile_flags ${SWIFTLIB_SINGLE_C_COMPILE_FLAGS})
+  set(c_compile_flags ${ASHLS_C_COMPILE_FLAGS})
   set(link_flags)

   set(library_search_subdir "${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
   set(library_search_directories
-      "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
-      "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
-      "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
+    "${SWIFTLIB_DIR}/${ASHLS_SUBDIR}"
+    "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${ASHLS_SUBDIR}"
+    "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")

   # In certain cases when building, the environment variable SDKROOT is set to override
   # where the sdk root is located in the system. If that environment variable has been
@@ -840,7 +837,7 @@
   endif()

   _add_variant_c_compile_flags(
-  SDK "${SWIFT_HOST_VARIANT_SDK}"
+    SDK "${SWIFT_HOST_VARIANT_SDK}"
     ARCH "${SWIFT_HOST_VARIANT_ARCH}"
     BUILD_TYPE ${CMAKE_BUILD_TYPE}
     ENABLE_ASSERTIONS ${LLVM_ENABLE_ASSERTIONS}
@@ -874,9 +871,9 @@
       ${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE})

     if(NOT ${CMAKE_C_COMPILER_ID} STREQUAL MSVC)
-      swift_windows_get_sdk_vfs_overlay(SWIFTLIB_SINGLE_VFS_OVERLAY)
+      swift_windows_get_sdk_vfs_overlay(ASHLS_VFS_OVERLAY)
       target_compile_options(${target} PRIVATE
-        "SHELL:-Xclang -ivfsoverlay -Xclang ${SWIFTLIB_SINGLE_VFS_OVERLAY}")
+        "SHELL:-Xclang -ivfsoverlay -Xclang ${ASHLS_VFS_OVERLAY}")

       # MSVC doesn't support -Xclang. We don't need to manually specify
       # the dependent libraries as `cl` does so.


Fix for ROOT-7650 - Complete the 'hdfs' option with CMake

--- cmake/modules/Findhdfs.cmake
+++ cmake/modules/Findhdfs.cmake
@@ -7,7 +7,7 @@
 #  HDFS_LIBRARIES

 find_path(HDFS_INCLUDE_DIR NAMES hdfs.h  HINTS ${HDFS_DIR}/include $ENV{HDFS_DIR}/include /usr/include/hadoop)
-find_library(HDFS_LIBRARY NAMES hdfs HINTS ${HDFS_DIR}/lib/native $ENV{HDFS_DIR}/lib/native)
+find_library(HDFS_LIBRARY NAMES hdfs PATH_SUFFIXES native HINTS ${HDFS_DIR}/lib $ENV{HDFS_DIR}/lib)

 set(HDFS_INCLUDE_DIRS ${HDFS_INCLUDE_DIR})
 set(HDFS_LIBRARIES ${HDFS_LIBRARY})


QcaMacro.cmake - fix installing pdb files on Windows

Fix the CMake error:
"CMake Error at cmake/modules/QcaMacro.cmake:73
(get_target_property): The LOCATION property may not be read
from target "qca-qt5". Use the target name directly with
add_custom_command, or use the generator"

resurrects code from 1137ed5f

--- cmake/modules/QcaMacro.cmake
+++ cmake/modules/QcaMacro.cmake
@@ -70,13 +70,8 @@

 macro(install_pdb TARGET INSTALL_PATH)
   if(MSVC)
-    get_target_property(LOCATION ${TARGET} LOCATION_DEBUG)
-    string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}")
-    install(FILES ${LOCATION} DESTINATION ${INSTALL_PATH} CONFIGURATIONS Debug)
-
-    get_target_property(LOCATION ${TARGET} LOCATION_RELWITHDEBINFO)
-    string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}")
-    install(FILES ${LOCATION} DESTINATION ${INSTALL_PATH} CONFIGURATIONS RelWithDebInfo)
+    install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION ${INSTALL_PATH} CONFIGURATIONS Debug)
+    install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION ${INSTALL_PATH} CONFIGURATIONS RelWithDebInfo)
   endif()
 endmacro(install_pdb)


fix(build): fix civetweb linking in cmake module

Signed-off-by: Luca Guerra <a05bd890c4868ea1807f8564055d1fba77c6ba81@guerra.sh>
Co-authored-by: Federico Di Pierro <6c3e26470d5343bb7a522873746c21bb7fcc0d20@gmail.com>

--- cmake/modules/civetweb.cmake
+++ cmake/modules/civetweb.cmake
@@ -12,8 +12,8 @@
 #

 set(CIVETWEB_SRC "${PROJECT_BINARY_DIR}/civetweb-prefix/src/civetweb/")
-set(CIVETWEB_LIB "${CIVETWEB_SRC}/install/${CMAKE_INSTALL_LIBDIR}/libcivetweb.a")
-SET(CIVETWEB_CPP_LIB "${CIVETWEB_SRC}/install/${CMAKE_INSTALL_LIBDIR}/libcivetweb-cpp.a")
+set(CIVETWEB_LIB "${CIVETWEB_SRC}/install/lib/libcivetweb.a")
+SET(CIVETWEB_CPP_LIB "${CIVETWEB_SRC}/install/lib/libcivetweb-cpp.a")
 set(CIVETWEB_INCLUDE_DIR "${CIVETWEB_SRC}/install/include")
 message(STATUS "Using bundled civetweb in '${CIVETWEB_SRC}'")
 if (USE_BUNDLED_OPENSSL)
@@ -25,6 +25,7 @@
             INSTALL_DIR ${CIVETWEB_SRC}/install
             CMAKE_ARGS
             -DBUILD_TESTING=off
+            -DCMAKE_INSTALL_LIBDIR=lib
             -DCIVETWEB_BUILD_TESTING=off
             -DCIVETWEB_ENABLE_CXX=on
             -DCIVETWEB_ENABLE_SERVER_EXECUTABLE=off


COMP: muparserx headers are under include/muparserx

--- SuperBuild/CMake/External_muparserx.cmake
+++ SuperBuild/CMake/External_muparserx.cmake
@@ -29,4 +29,4 @@
 #Patch mpParserMessageProvider.cpp. This patch is integrated upstream but not yet released (last release is 4.0.7)
 SUPERBUILD_PATCH_SOURCE(MUPARSERX)

-SUPERBUILD_UPDATE_CMAKE_VARIABLES(MUPARSERX FALSE)
+SUPERBUILD_UPDATE_CMAKE_VARIABLES(MUPARSERX FALSE muparserx muparserx)


Correct spacing on reused tag.

Correct spacing on reused tag.

--- CPM.cmake
+++ CPM.cmake
@@ -1227,7 +1227,7 @@
   if ((DEFINED CPM_SHOW_HIERARCHY) AND (CPM_SHOW_HIERARCHY))
     set(_cpm_is_module_resued_var)
     if (DEFINED CPM_KV_SOURCE_ADDED_MAP_${__CPM_FULL_UNID})
-      set(_cpm_is_module_resued_var " (reused)")
+      set(_cpm_is_module_resued_var "(reused)")
     endif()
     if(__CPM_USING_GIT)
       _cpm_print_with_hierarchy_level("${name} ${_cpm_is_module_resued_var} - GIT - Tag: ${__CPM_NEW_GIT_TAG} - Unid: ${__CPM_FULL_UNID}")


APP-142: [C] Disable check C++ compiler

APP-142: [C] Disable check C++ compiler

--- client/client-multi/client-c/toolchains/esp8266.cmake
+++ client/client-multi/client-c/toolchains/esp8266.cmake
@@ -23,6 +23,7 @@
 include(CMakeForceCompiler)

 set(XTENSA_GCC_COMPILER "xtensa-lx106-elf-gcc${CMAKE_EXECUTABLE_SUFFIX}")
+set(XTENSA_GXX_COMPILER "xtensa-lx106-elf-g++${CMAKE_EXECUTABLE_SUFFIX}")

 if(NOT DEFINED ESP8266_TOOLCHAIN_PATH)
     # Check if GCC is reachable.
@@ -38,6 +39,7 @@
 endif()

 cmake_force_c_compiler(${ESP8266_TOOLCHAIN_PATH}/bin/${XTENSA_GCC_COMPILER} GNU)
+cmake_force_cxx_compiler(${ESP8266_TOOLCHAIN_PATH}/bin/${XTENSA_G++_COMPILER} GNU)

 set(CMAKE_OBJCOPY ${ESP8266_TOOLCHAIN_PATH}/bin/xtensa-lx106-elf-objcopy CACHE PATH "")


fixed: missed from last commit (debugrt target)

git-svn-id: 6c7e10cdde2c115f53707ba8ec4efe535f92d362@1644 4683daeb-ad0f-0410-a623-93161e962ae5

--- CMake/UpdateCompiler.cmake
+++ CMake/UpdateCompiler.cmake
@@ -51,3 +51,71 @@
     ENDIF(LINUX)

 ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF(MSVC)
+
+    IF(CMAKE_BUILD_TYPE STREQUAL "DebugRT")
+
+        MESSAGE(STATUS "Apply DebugRT settings")
+
+        STRING(REPLACE " msvcprt.lib msvcrt.lib" ""
+               TMP_CXX_STANDARD_LIBRARIES ${CMAKE_CXX_STANDARD_LIBRARIES})
+
+        STRING(REPLACE " msvcrt.lib" ""
+               TMP_C_STANDARD_LIBRARIES ${CMAKE_C_STANDARD_LIBRARIES})
+
+        STRING(REGEX MATCH "msvcprtd.lib msvcrtd.lib"
+                           MSVC_CXX_RES ${TMP_CXX_STANDARD_LIBRARIES})
+
+        STRING(REGEX MATCH " msvcrtd.lib"
+                           MSVC_C_RES ${TMP_C_STANDARD_LIBRARIES})
+
+        IF(NOT MSVC_CXX_RES)
+            SET(TMP_CXX_STANDARD_LIBRARIES "${TMP_CXX_STANDARD_LIBRARIES} msvcprtd.lib msvcrtd.lib")
+
+
+            SET(CMAKE_CXX_STANDARD_LIBRARIES ${TMP_CXX_STANDARD_LIBRARIES}
+                                             CACHE STRING "OpenSG defaults" FORCE )
+        ENDIF(NOT MSVC_CXX_RES)
+
+        IF(NOT MSVC_C_RES)
+            SET(TMP_C_STANDARD_LIBRARIES "${TMP_C_STANDARD_LIBRARIES} msvcrtd.lib")
+
+            SET(CMAKE_C_STANDARD_LIBRARIES ${TMP_C_STANDARD_LIBRARIES}
+                                           CACHE STRING "OpenSG defaults" FORCE )
+        ENDIF(NOT MSVC_C_RES)
+
+    ELSE(CMAKE_BUILD_TYPE STREQUAL "DebugRT")
+
+        MESSAGE(STATUS "Apply Debug/Release settings")
+
+        STRING(REPLACE " msvcprtd.lib msvcrtd.lib" ""
+               TMP_CXX_STANDARD_LIBRARIES ${CMAKE_CXX_STANDARD_LIBRARIES})
+
+        STRING(REPLACE " msvcrtd.lib" ""
+               TMP_C_STANDARD_LIBRARIES ${CMAKE_C_STANDARD_LIBRARIES})
+
+        STRING(REGEX MATCH "msvcprt.lib msvcrt.lib"
+                           MSVC_CXX_RES ${TMP_CXX_STANDARD_LIBRARIES})
+
+        STRING(REGEX MATCH "msvcrt.lib"
+                           MSVC_C_RES ${TMP_C_STANDARD_LIBRARIES})
+
+        IF(NOT MSVC_CXX_RES)
+            SET(TMP_CXX_STANDARD_LIBRARIES "${TMP_CXX_STANDARD_LIBRARIES} msvcprt.lib msvcrt.lib")
+
+
+            SET(CMAKE_CXX_STANDARD_LIBRARIES ${TMP_CXX_STANDARD_LIBRARIES}
+                                             CACHE STRING "OpenSG defaults" FORCE )
+        ENDIF(NOT MSVC_CXX_RES)
+
+        IF(NOT MSVC_C_RES)
+            SET(TMP_C_STANDARD_LIBRARIES "${TMP_C_STANDARD_LIBRARIES} msvcrt.lib")
+
+            SET(CMAKE_C_STANDARD_LIBRARIES ${TMP_C_STANDARD_LIBRARIES}
+                                           CACHE STRING "OpenSG defaults" FORCE )
+        ENDIF(NOT MSVC_C_RES)
+
+    ENDIF(CMAKE_BUILD_TYPE STREQUAL "DebugRT")
+
+ENDIF(MSVC)


Do not set tagged layout on Windows.

Do not set tagged layout on Windows.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -39,6 +39,7 @@

     if(WIN32)
       set(_shell_extension .bat)
+      set(_boost_layout)
       if(MSVC)
         if(MSVC_VERSION EQUAL 1600)
           set(_boost_toolset "msvc-10.0")
@@ -51,6 +52,7 @@
       set(_install_lib_dir "--libdir=<INSTALL_DIR>/bin")
     else()
       set(_shell_extension .sh)
+      set(_boost_layout "--layout=tagged")
     endif()

     set (APPLE_SYSROOT_FLAG)
@@ -81,7 +83,7 @@

     set(_build_cmd "<SOURCE_DIR>/b2"
         ${APPLE_SYSROOT_FLAG}
-        --layout=tagged
+        ${_boost_layout}
         "--prefix=<INSTALL_DIR>"
         ${_install_lib_dir}
         ${_with_boost_libs}


Fix maximum number of characters in DCMQI's float serialization

--- CMakeExternals/DCMQI.cmake
+++ CMakeExternals/DCMQI.cmake
@@ -27,7 +27,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       GIT_REPOSITORY https://github.com/kislinsk/dcmqi.git # T28127
-      GIT_TAG v1.2.3-hotfix
+      GIT_TAG v1.2.3-hotfix-v2
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Enable MPI for jenkins

Enable MPI for jenkins

--- Testing/jenkins_mercury.cmake
+++ Testing/jenkins_mercury.cmake
@@ -83,7 +83,7 @@
 MERCURY_USE_BOOST_PP:BOOL=OFF
 MERCURY_USE_XDR:BOOL=OFF
 NA_USE_BMI:BOOL=OFF
-NA_USE_MPI:BOOL=OFF
+NA_USE_MPI:BOOL=ON
 MPIEXEC_MAX_NUMPROCS:STRING=2
 ")


ENH: Update Tcl/Tk 8.5

ENH: Update Tcl/Tk 8.5

--- CMake/FindTCL.cmake
+++ CMake/FindTCL.cmake
@@ -37,18 +37,26 @@

 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH "${TCL_TCLSH}" PATH)
 GET_FILENAME_COMPONENT(TCL_TCLSH_PATH_PARENT "${TCL_TCLSH_PATH}" PATH)
+STRING(REGEX REPLACE
+  "^.*tclsh([0-9]\\.*[0-9]).*$" "\\1" TCL_TCLSH_VERSION "${TCL_TCLSH}")

 GET_FILENAME_COMPONENT(TK_WISH_PATH "${TK_WISH}" PATH)
 GET_FILENAME_COMPONENT(TK_WISH_PATH_PARENT "${TK_WISH_PATH}" PATH)
+STRING(REGEX REPLACE
+  "^.*wish([0-9]\\.*[0-9]).*$" "\\1" TK_WISH_VERSION "${TK_WISH}")

 GET_FILENAME_COMPONENT(TCL_INCLUDE_PATH_PARENT "${TCL_INCLUDE_PATH}" PATH)
 GET_FILENAME_COMPONENT(TK_INCLUDE_PATH_PARENT "${TK_INCLUDE_PATH}" PATH)

 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH "${TCL_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TCL_LIBRARY_PATH_PARENT "${TCL_LIBRARY_PATH}" PATH)
+STRING(REGEX REPLACE
+  "^.*tcl([0-9]\\.*[0-9]).*$" "\\1" TCL_LIBRARY_VERSION "${TCL_LIBRARY}")

 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH "${TK_LIBRARY}" PATH)
 GET_FILENAME_COMPONENT(TK_LIBRARY_PATH_PARENT "${TK_LIBRARY_PATH}" PATH)
+STRING(REGEX REPLACE
+  "^.*tk([0-9]\\.*[0-9]).*$" "\\1" TK_LIBRARY_VERSION "${TK_LIBRARY}")

 SET(TCLTK_POSSIBLE_LIB_PATHS
   "${TCL_INCLUDE_PATH_PARENT}/lib"
@@ -81,7 +89,9 @@
 ENDIF(WIN32)

 FIND_LIBRARY(TCL_LIBRARY
-  NAMES tcl
+  NAMES
+  tcl
+  tcl${TK_LIBRARY_VERSION} tcl${TCL_TCLSH_VERSION} tcl${TK_WISH_VERSION}
   tcl86 tcl8.6
   tcl85 tcl8.5
   tcl84 tcl8.4
@@ -92,7 +102,9 @@
   )

 FIND_LIBRARY(TK_LIBRARY
-  NAMES tk
+  NAMES
+  tk
+  tk${TCL_LIBRARY_VERSION} tk${TCL_TCLSH_VERSION} tk${TK_WISH_VERSION}
   tk86 tk8.6
   tk85 tk8.5
   tk84 tk8.4
@@ -135,6 +147,8 @@
   "${TK_WISH_PATH_PARENT}/include"
   /usr/include
   /usr/local/include
+  /usr/include/tcl${TK_LIBRARY_VERSION}
+  /usr/include/tcl${TCL_LIBRARY_VERSION}
   /usr/include/tcl8.6
   /usr/include/tcl8.5
   /usr/include/tcl8.4


[CMake] Fix add_sanitizer_rt_symbols on multi-config CMake generators.

Patch by Brad King.

When using a multi-config generator with CMake, such as for VS or Xcode,
the LOCATION target property value contains a placeholder such as
"$(Configuration)" that is meant for substitution by the native build
tool. The install(FILES) command does not understand this name and will
not install the symbols file correctly when using these generators.

Teach add_sanitizer_rt_symbols to read the more-specific target property
LOCATION_<CONFIG> that has a per-configuration value and no placeholder.
On single-configuration generators (Makefile, Ninja), CMAKE_BUILD_TYPE
contains the name of the one configuration to be built.  On multi-config
generators (VS, Xcode), CMAKE_CONFIGURATION_TYPES contains the list of
possible configurations.  In the latter case, loop over the configs and
add a configuration-specific install(FILES) rule for each one.

Place the code block inside an if(TRUE) block so it can be made
conditional in a following change without updating indentation.

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

--- cmake/Modules/SanitizerUtils.cmake
+++ cmake/Modules/SanitizerUtils.cmake
@@ -25,7 +25,20 @@
   add_custom_target(${name}-symbols ALL
     DEPENDS ${symsfile}
     SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN})
-  install(FILES ${symsfile} DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+
+  if(TRUE)
+    # Per-config install location.
+    if(CMAKE_CONFIGURATION_TYPES)
+      foreach(c ${CMAKE_CONFIGURATION_TYPES})
+        get_target_property(libfile ${name} LOCATION_${c})
+        install(FILES ${libfile}.syms CONFIGURATIONS ${c}
+          DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+      endforeach()
+    else()
+      get_target_property(libfile ${name} LOCATION_${CMAKE_BUILD_TYPE})
+      install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+    endif()
+  endif()
 endmacro()

 # Add target to check code style for sanitizer runtimes.


suppress warnings on Visual Studio 2013 and earlier


Copy the Clang resource directly directly from the clang build

When building a toolchain version of LLDB, build-script will not
create the Swift resource dir. Get the Clang headers directly from
the Clang build.

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -98,8 +98,13 @@

 # Copy vendor-specific headers from clang (without staging).
 if(NOT IOS)
+  execute_process(
+     COMMAND ${LLDB_PATH_TO_CLANG_BUILD}/bin/clang -print-resource-dir
+     OUTPUT_VARIABLE CLANG_RESOURCE_PATH
+     OUTPUT_STRIP_TRAILING_WHITESPACE)
+
   add_custom_command(TARGET lldb-framework-headers POST_BUILD
-    COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_PATH_TO_SWIFT_BUILD}/lib/swift/clang/ $<TARGET_FILE_DIR:liblldb>/Resources/Clang
+    COMMAND ${CMAKE_COMMAND} -E copy_directory ${CLANG_RESOURCE_PATH}/include $<TARGET_FILE_DIR:liblldb>/Resources/Clang/include
     COMMAND ${CMAKE_COMMAND} -E copy_directory ${LLDB_PATH_TO_SWIFT_BUILD}/lib/swift $<TARGET_FILE_DIR:liblldb>/Resources/Swift
     COMMENT "LLDB.framework: copy clang vendor-specific headers"
   )


Install generated man pages in the correct subdirectory (man/man1)

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1576,5 +1576,5 @@
       ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py ${input} ${output}
   )

-  install(FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR})
-endfunction()
+  install(FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+endfunction()


Refreshed cnats

Refreshed cnats

--- cmake/projects/cnats/hunter.cmake
+++ cmake/projects/cnats/hunter.cmake
@@ -12,9 +12,9 @@
     VERSION
     "1.5.0"
     URL
-    "https://github.com/dmpriso/cnats/archive/dmpriso1.tar.gz"
+    "https://github.com/dmpriso/cnats/archive/dmpriso2.tar.gz"
     SHA1
-    83DC3BD1B5DAEB141AA705CA3C8C843AE3599283
+    2ACCBEABE5FD3CC52EB15D6403E0C3EFF06DD849
 )

 # Probably more versions for real packages...


[Build][Doc] Factorised the CMake-related helpers for the documentation (HTML, PDF and manual pages).

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -108,6 +108,11 @@
       set (${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
     endif ()
   endforeach (_path_type)
+
+  # Define STDAIR_SAMPLE_DIR if the project is STDAIR
+  if ("${PROJECT_NAME}" STREQUAL "stdair")
+    set (STDAIR_SAMPLE_DIR ${INSTALL_SAMPLE_DIR})
+  endif ("${PROJECT_NAME}" STREQUAL "stdair")

   ##
   # Basic documentation (i.e., AUTHORS, NEWS, README, INSTALL)
@@ -378,7 +383,7 @@
   set (Boost_USE_MULTITHREADED ON)
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS
-    program_options date_time iostreams serialization filesystem
+    regex program_options date_time iostreams serialization filesystem
     unit_test_framework python)

   # The first check is for the required components.
@@ -395,18 +400,19 @@

     # Update the list of dependencies for the project
     list (APPEND PROJ_DEP_LIBS_FOR_LIB
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
-    list (APPEND PROJ_DEP_LIBS_FOR_BIN ${Boost_PROGRAM_OPTIONS_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PYTHON_LIBRARY})
+    list (APPEND PROJ_DEP_LIBS_FOR_BIN
+	  ${Boost_REGEX_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
     list (APPEND PROJ_DEP_LIBS_FOR_TST ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

     # For display purposes
     set (BOOST_REQUIRED_LIBS
-      ${Boost_IOSTREAMS_LIBRARY} ${Boost_SERIALIZATION_LIBRARY}
-      ${Boost_FILESYSTEM_LIBRARY} ${Boost_DATE_TIME_LIBRARY}
-      ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}
-      ${Boost_PYTHON_LIBRARY})
+      ${Boost_REGEX_LIBRARY} ${Boost_IOSTREAMS_LIBRARY}
+	  ${Boost_SERIALIZATION_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}
+	  ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}
+	  ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY} ${Boost_PYTHON_LIBRARY})
   endif (Boost_FOUND)

 endmacro (get_boost)
@@ -600,7 +606,8 @@
   set (pkgdatadir    ${datarootdir}/${PACKAGE})
   set (sampledir     ${STDAIR_SAMPLE_DIR})
   set (docdir        ${datarootdir}/doc/${PACKAGE}-${PACKAGE_VERSION})
-  set (htmldir       ${docdir})
+  set (htmldir       ${docdir}/html)
+  set (pdfdir        ${htmldir})
   set (mandir        ${datarootdir}/man)
   set (infodir       ${datarootdir}/info)
   set (pkgincludedir ${includedir}/stdair)
@@ -1120,11 +1127,227 @@
 ###################################################################
 ##                         Documentation                         ##
 ###################################################################
+##
+# HTML pages and PDF reference manual
+##
+#
 macro (handle_html_doc)
   if (${INSTALL_DOC} STREQUAL "ON")
 	add_subdirectory (doc)
   endif (${INSTALL_DOC} STREQUAL "ON")
 endmacro (handle_html_doc)
+
+# Define the substitutes for the variables present in the Doxygen
+# configuration files. Note that PACKAGE, PACKAGE_NAME and PACKAGE_VERSION
+# are defined in the main CMakeLists.txt (of the top root directory).
+macro (doc_set_directories)
+  set (OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+  set (top_srcdir ${CMAKE_SOURCE_DIR})
+  set (srcdir ${CMAKE_CURRENT_SOURCE_DIR})
+endmacro (doc_set_directories)
+
+#
+macro (doc_add_web_pages)
+  # Set the documentation directories for the Doxygen configuration file
+  doc_set_directories()
+
+  # Convert the Doxygen configuration files (basically, just replace
+  # the @<variable>@ variables).
+  set (DOXYGEN_CFG_SRC doxygen_html.cfg.in)
+  set (DOXYGEN_CFG ${CMAKE_CURRENT_BINARY_DIR}/doxygen_html.cfg)
+  configure_file (${DOXYGEN_CFG_SRC} ${DOXYGEN_CFG} @ONLY)
+
+  ## Documentation sources
+  # (CSS) Style sheets
+  set (docstyles_DIR ${CMAKE_CURRENT_SOURCE_DIR}/styles)
+  set (style_SOURCES ${CPACK_PACKAGE_NAME}.css)
+  set (docstyles_SOURCES ${docstyles_DIR}/${style_SOURCES})
+  # Images
+  set (docimages_DIR ${CMAKE_CURRENT_SOURCE_DIR}/images)
+  set (image_SOURCES ${CPACK_PACKAGE_NAME}_logo.png sfx_logo.png favicon.ico)
+  set (docimages_SOURCES "")
+  foreach (_doc_img_src ${image_SOURCES})
+	list (APPEND docimages_SOURCES ${docimages_DIR}/${_doc_img_src})
+  endforeach (_doc_img_src ${image_SOURCES})
+  # Tutorial
+  FILE (GLOB doctutorial_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/tutorial/*.doc)
+  # Local
+  FILE (GLOB doclocaldoc_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/local/*.doc)
+  FILE (GLOB doclocalhtml_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/local/*.html)
+  set (doclocal_SOURCES ${doclocaldoc_SOURCES} ${doclocalhtml_SOURCES})
+  # Aggregating all the documentation sources
+  set (doc_SOURCES ${doctutorial_SOURCES} ${doclocal_SOURCES}
+	${docstyles_SOURCES} ${docimages_SOURCES})
+
+  # Latex reference manual source (.tex file), generated by Doxygen
+  set (REFMAN refman)
+  set (TEX_GEN_DIR ${CMAKE_CURRENT_BINARY_DIR}/latex)
+  set (REFMAN_TEX ${REFMAN}.tex)
+  set (REFMAN_TEX_FULL ${TEX_GEN_DIR}/${REFMAN_TEX})
+
+  # Add the build rule for Doxygen
+  set (DOXYGEN_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html)
+  add_custom_command (OUTPUT ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
+	COMMAND ${DOXYGEN_EXECUTABLE} ARGS ${DOXYGEN_CFG}
+	DEPENDS ${DOXYGEN_CFG} ${doc_SOURCES}
+	COMMENT "Generating documentation with Doxygen, from '${DOXYGEN_CFG}'...")
+  # Add the 'doc' target, depending on the generated HTML documentation
+  add_custom_target (doc ALL DEPENDS ${DOXYGEN_OUTPUT})
+
+  ##
+  # Copy the needed files into the generated HTML directory
+  set (htmldoc_DIR ${CMAKE_CURRENT_BINARY_DIR}/html)
+  set (pdfdoc_DIR ${CMAKE_CURRENT_BINARY_DIR}/latex)
+
+  # (CSS) Style sheets
+  foreach (style_SRC ${style_SOURCES})
+	set (CSS_SRC_FULL_DIR ${docstyles_DIR}/${style_SRC})
+	set (CSS_GEN_FULL_DIR ${htmldoc_DIR}/${style_SRC})
+	add_custom_command (OUTPUT ${CSS_GEN_FULL_DIR}
+	  COMMAND ${CMAKE_COMMAND}
+	  ARGS -E copy ${CSS_SRC_FULL_DIR} ${CSS_GEN_FULL_DIR}
+	  DEPENDS ${DOXYGEN_OUTPUT} ${CSS_SRC_FULL_DIR}
+	  COMMENT "Copying style '${CSS_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+	add_custom_target (css_${style_SRC} ALL DEPENDS ${CSS_GEN_FULL_DIR})
+  endforeach (style_SRC)
+
+  # Images
+  foreach (image_SRC ${image_SOURCES})
+	set (IMG_SRC_FULL_DIR ${docimages_DIR}/${image_SRC})
+	set (IMG_GEN_FULL_DIR ${htmldoc_DIR}/${image_SRC})
+	add_custom_command (OUTPUT ${IMG_GEN_FULL_DIR}
+	  COMMAND ${CMAKE_COMMAND}
+	  ARGS -E copy ${IMG_SRC_FULL_DIR} ${IMG_GEN_FULL_DIR}
+	  DEPENDS ${DOXYGEN_OUTPUT} ${IMG_SRC_FULL_DIR}
+	  COMMENT "Copying image '${IMG_SRC_FULL_DIR}' into '${htmldoc_DIR}'...")
+	add_custom_target (img_${image_SRC} ALL DEPENDS ${IMG_GEN_FULL_DIR})
+  endforeach (image_SRC)
+
+  ##
+  # PDF, generated by (Pdf)Latex from the Latex source file, itself generated
+  # by Doxygen (see above)
+  set (REFMAN_IDX ${REFMAN}.idx)
+  set (REFMAN_IDX_FULL ${TEX_GEN_DIR}/${REFMAN_IDX})
+  set (REFMAN_PDF ${REFMAN}.pdf)
+  set (REFMAN_PDF_FULL ${TEX_GEN_DIR}/${REFMAN_PDF})
+  # Note the "|| echo" addition to the pdflatex command, as that latter returns
+  # as if there were an error.
+  add_custom_command (OUTPUT ${REFMAN_IDX_FULL} ${REFMAN_PDF_FULL}
+	DEPENDS ${DOXYGEN_OUTPUT} ${REFMAN_TEX_FULL}
+	COMMAND ${CMAKE_COMMAND}
+	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "First PDF generation done."
+	COMMAND ${CMAKE_COMMAND}
+	ARGS -E chdir ${TEX_GEN_DIR} makeindex -q ${REFMAN_IDX}
+	COMMAND ${CMAKE_COMMAND}
+	ARGS -E chdir ${TEX_GEN_DIR} pdflatex -interaction batchmode ${REFMAN_TEX} || echo "Second PDF generation done."
+	COMMENT "Generating PDF Reference Manual ('${REFMAN_PDF}')..."
+	COMMAND ${CMAKE_COMMAND}
+	ARGS -E chdir ${TEX_GEN_DIR} test -f ${REFMAN_PDF} || echo "Warning: the PDF reference manual \\\('${REFMAN_PDF_FULL}'\\\) has failed to build. You can perform a simple re-build \\\('make' in the 'doc/latex' sub-directory\\\)."
+	COMMENT "Checking whether the PDF Reference Manual ('${REFMAN_PDF}') has been built...")
+  # Add the 'pdf' target, depending on the generated PDF manual
+  add_custom_target (pdf ALL DEPENDS ${REFMAN_PDF_FULL})
+
+  # Clean-up $build/html and $build/latex on 'make clean'
+  set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
+	${htmldoc_DIR} ${pdfdoc_DIR})
+
+  ##
+  # Installation of the HTML documentation
+  set (DOC_PATH share/doc/${PROJECT_NAME}-${CPACK_PACKAGE_VERSION})
+  # HTML pages
+  install (DIRECTORY ${htmldoc_DIR} DESTINATION ${DOC_PATH})
+  # PDF reference manual
+  # Note: the 'OPTIONAL' ensures that even when the PDF file fails to be
+  # generated, the install process does not complain. If the PDF build fails,
+  # a simple re-build ('make' in the 'doc/latex' sub-directory) is usually
+  # enough.
+  install (FILES ${REFMAN_PDF_FULL} DESTINATION ${DOC_PATH}/html OPTIONAL)
+endmacro (doc_add_web_pages)
+
+##
+# Manual pages
+##
+macro (doc_add_man_pages)
+  # Specify the relative path where the manual pages are to be installed.
+  # That path is relative to the installation prefix. By default, the prefix
+  # is '/usr', and the manual page installation directory is therefore
+  # /usr/share/man
+  set (MAN_PATH "share/man")
+
+  # Specify the list of manual sections, e.g.:
+  #  * Section 1 (general commands)
+  #  * Section 3 (development)
+  set (man_section_list 1 2 3 4 5 6 7 8 9)
+
+  # Initialise the lists gathering information for each valid manual section
+  set (man_doxy_output_list "")
+  set (man_dir_list "")
+
+  # Parse the arguments
+  set (options "")
+  set (oneValueArgs "")
+
+  # Added one argument option for every manual section
+  foreach (man_sect ${man_section_list})
+	list (APPEND multiValueArgs MAN${man_sect})
+  endforeach (man_sect ${man_section_list})
+
+  cmake_parse_arguments (_man_arg "${options}" "${oneValueArgs}"
+	"${multiValueArgs}" ${ARGN})
+
+  # Set the documentation directories for the Doxygen configuration file
+  doc_set_directories()
+
+  # Browse all the manual sections
+  foreach (man_sect ${man_section_list})
+	# If the (current) macro was passed arguments for the current manual
+	# section, process the generation of manual pages (with Doxygen).
+	if (NOT "${_man_arg_MAN${man_sect}}" STREQUAL "")
+
+	  # Specify in which sub-directory the manual pages are to be found
+	  set (man${man_sect}_DIR ${CMAKE_CURRENT_BINARY_DIR}/man${man_sect})
+	  # Add that sub-directory to the dedicated list
+	  list (APPEND man_dir_list ${man${man_sect}_DIR})
+
+	  # Convert the Doxygen configuration files (basically, just replace
+	  # the @<variable>@ variables).
+	  set (man_doxy_cfg doxygen_man${man_sect}.cfg)
+	  set (DOXYGEN_CFG${man_sect}_SRC ${man_doxy_cfg}.in)
+	  set (DOXYGEN_CFG${man_sect} ${CMAKE_CURRENT_BINARY_DIR}/${man_doxy_cfg})
+	  configure_file (${DOXYGEN_CFG${man_sect}_SRC}
+		${DOXYGEN_CFG${man_sect}} @ONLY)
+
+	  # Manual page sources for the current manual section
+	  foreach (_doc_src ${_man_arg_MAN${man_sect}})
+		list (APPEND man${man_sect}_SOURCES ${_doc_src}.doc)
+	  endforeach (_doc_src ${_man_arg_MAN${man_sect}})
+
+	  # Add the build rule for Doxygen for section 1 manual pages
+	  set (DOXYGEN_OUTPUT${man_sect}
+		${man${man_sect}_DIR}/stdair-config.${man_sect})
+	  add_custom_command (OUTPUT ${DOXYGEN_OUTPUT${man_sect}}
+		COMMAND ${DOXYGEN_EXECUTABLE} ARGS ${DOXYGEN_CFG${man_sect}}
+		DEPENDS ${DOXYGEN_CFG${man_sect}} ${man${man_sect}_SOURCES}
+		COMMENT "Generating section ${man_sect} manual pages with Doxygen, from '${DOXYGEN_CFG${man_sect}}'...")
+
+	  # Add the current manual section output to the dedicated list,
+	  # so that it can then be added to the corresponding target (see below).
+	  list (APPEND man_doxy_output_list ${DOXYGEN_OUTPUT${man_sect}})
+
+	  # Specifiy what to do for the installation of the manual pages
+	  install (DIRECTORY "${man${man_sect}_DIR}" DESTINATION ${MAN_PATH})
+
+	endif (NOT "${_man_arg_MAN${man_sect}}" STREQUAL "")
+  endforeach (man_sect ${man_section_list})
+
+  # Add the 'man' target, depending on the generated manual page documentation
+  add_custom_target (man ALL DEPENDS ${man_doxy_output_list})
+
+  # Clean-up $build/man1 and $build/man3 on 'make clean'
+  set_property (DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
+	${man_dir_list})
+
+endmacro (doc_add_man_pages)

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


Apple:  - disabled Clang sanitizers on iOS (as the runtime seems to be missing)  - enabled the safe-stack sanitizer on OSX (as it seems to work now with Xcode 8.1).

--- toolchains/clang.cmake
+++ toolchains/clang.cmake
@@ -19,7 +19,9 @@
 # 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 ) # AppleClang lag: -fsanitize=thread -fsanitize=memory -fsanitize=dataflow -fsanitize=cfi -fsanitize=safe-stack
+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
+endif()
 set( TNUN_compiler_runtime_sanity_checks ${TNUN_linker_runtime_sanity_checks} -fno-omit-frame-pointer )
 set( TNUN_linker_runtime_integer_checks -fsanitize=integer )
 set( TNUN_compiler_runtime_integer_checks ${TNUN_compiler_runtime_integer_checks} )


cmake: pass extra dtc flags to python scripts

Pass arguments as command line from cmake to python. Extra DTC flags are
used later on to check errors in python.

Signed-off-by: Andrei Gansari <f1330555a90b7a22d81843f3c4366f58b50eae34@nxp.com>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -195,6 +195,7 @@

   set(CMD_NEW_EXTRACT ${PYTHON_EXECUTABLE} ${ZEPHYR_BASE}/scripts/dts/gen_defines.py
   --dts ${BOARD}.dts.pre.tmp
+  --dtc-flags '${EXTRA_DTC_FLAGS}'
   --bindings-dirs ${DTS_ROOT_BINDINGS}
   --conf-out ${DEVICETREE_CONF}
   --header-out ${DEVICETREE_UNFIXED_H}


Use gcc found by cmake for version check

otherwise CC / CMAKE_CXX_COMPILER / ... are ignored for version

--- cmake/gcc.cmake
+++ cmake/gcc.cmake
@@ -35,18 +35,10 @@
 SET(OSPRAY_ARCH_AVX2   "-mf16c -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
 SET(OSPRAY_ARCH_AVX512 "-mavx512f -mavx512pf -mavx512er -mavx512cd")

+
 # check whether gcc is new enough for AVX, AVX2
-IF (NOT GCC_EXECUTABLE)
-  FIND_PROGRAM(GCC_EXECUTABLE gcc DOC "Path to the GCC executable.")
-  IF (NOT GCC_EXECUTABLE)
-    MESSAGE(FATAL_ERROR "GCC not found.")
-  ELSE()
-    MARK_AS_ADVANCED(GCC_EXECUTABLE)
-  ENDIF()
-ENDIF()
-
 IF(NOT GCC_VERSION)
-  EXECUTE_PROCESS(COMMAND ${GCC_EXECUTABLE} -dumpversion OUTPUT_VARIABLE GCC_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
+  EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
   SET(GCC_VERSION ${GCC_OUTPUT} CACHE STRING "GCC Version")
   MARK_AS_ADVANCED(GCC_VERSION)
 ENDIF()


Change lua check #25

Change lua check #25

--- cmake/lua.cmake
+++ cmake/lua.cmake
@@ -1,12 +1,12 @@
 message(STATUS "Looking for Lua 5.2")
 find_package(Lua52 QUIET)
-if(NOT ${LUA_FOUND})
+if(NOT DEFINED LUA_INCLUDE_DIR)
   message(STATUS "Looking for Lua 5.1")
   find_package(Lua51 QUIET)
-  if(NOT ${LUA_FOUND})
+  if(NOT DEFINED LUA_INCLUDE_DIR)
     message(STATUS "Looking for any Lua")
     find_package(Lua QUIET)
-    if(NOT ${LUA_FOUND})
+    if(NOT DEFINED LUA_INCLUDE_DIR)
       message(FATAL_ERROR "Lua was not found but is required")
     endif()
   endif()


fatal_error back to warning, since many people actually don't have the same compiler (I didn't on my ubuntu install). will talk it over with folks back in lab.

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

--- cmake/mex.cmake
+++ cmake/mex.cmake
@@ -199,12 +199,12 @@

 compare_compilers(compilers_match "${MEX_CC}" "${CMAKE_C_COMPILER}")
 if (NOT compilers_match)
-   message(FATAL_ERROR "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
+   message(WARNING "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
 endif()

 compare_compilers(compilers_match ${MEX_CXX} ${CMAKE_CXX_COMPILER})
 if (NOT compilers_match)
-   message(FATAL_ERROR "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
+   message(WARNING "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
 endif()

 # NOTE:  would like to check LD also, but it appears to be difficult with cmake  (there is not explicit linker executable variable, only the make rule), and  even my mex code assumes that LD==LDCXX for simplicity.


build: fix qemu target for rpi

build: fix qemu target for rpi

--- build/cmake/arch-arm-rpi.cmake
+++ build/cmake/arch-arm-rpi.cmake
@@ -26,7 +26,7 @@

 add_custom_target(qemu
   COMMAND ${QEMU_FLAGS}
-  DEPENDS raptor.bin
+  DEPENDS kernel
 )

 if(NOT RPI_BOOT_PART STREQUAL "")


Options edited to speed up ITK compilation

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -54,6 +54,9 @@
         -DCMAKE_INCLUDE_PATH=${SUPERBUILD_INSTALL_DIR}
         -DCMAKE_INSTALL_PREFIX=${${proj}_Install_Dir}
 	      -DBUILD_SHARED_LIBS=true
+        -DCMAKE_BUILD_TYPE=release
+        -DBUILD_TESTING=false
+        -DBUILD_EXAMPLES=false
 	  INSTALL_DIR ${${proj}_Install_Dir}
     DEPENDS ${${proj}_DEPENDENCIES}
   )


Explicitly set SimpleITKFilter git hash

Explicitly set SimpleITKFilter git hash

The module update include a fix to the initialization to the
DICOMOrientImageFilter's array parameters.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -23,6 +23,7 @@
   set(Module_SimpleITKFilters ON)
 endif()

+set(Module_SimpleITKFilters_GIT_TAG c8c42430626f0123e7ec401c17c72c7d5ce82669 )

 get_cmake_property( _varNames VARIABLES )


Fix standalone build configuring VTK with CMAKE_POSITION_INDEPENDENT_CODE set 1

--- SuperBuild/External_VTK.cmake
+++ SuperBuild/External_VTK.cmake
@@ -108,6 +108,7 @@
       -DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD}
       -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}
       -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS}
+      -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
       -DBUILD_TESTING:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DBUILD_SHARED_LIBS:BOOL=OFF


ENH: Bump ITK to v4.10.0.

ENH: Bump ITK to v4.10.0.

Change-Id: I3b85690697d60b944c51bab84bfe62c1d5527746

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

 if( NOT ITK_TAG )
-  # ITK master 2016-02-09
-  set( ITK_TAG "9473a5128cbb1fdefd530ffa269e847385610abd" )
+  # ITK 4.10.0
+  set( ITK_TAG "v4.10.0" )
 endif()

 set( _vtk_args )


Remove unused variable

Remove unused variable

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -87,8 +87,6 @@
 # Wraps add_custom_command to print out the COMMAND line on generators that
 # wont print that even when verbose mode is enabled.
 function (add_custom_command)
-
-    set (INSIDE_ADD_CUSTOM_COMMAND_WRAPPER TRUE)

     set (CMAKE_UNIT_ACC_MULTIVAR_ARGS COMMAND DEPENDS)
     cmake_parse_arguments (ACC


Configure darwin build to use c++14

Configure darwin build to use c++14

--- toolchains/darwin.cmake
+++ toolchains/darwin.cmake
@@ -1,5 +1,5 @@
 # options
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -stdlib=libc++ -std=c++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -stdlib=libc++ -std=c++14")
 set(CXX_FLAGS_DEBUG "-g -O0")
 set(EXECUTABLE_NAME "tangram")


BUG:  Error in automatically setting the FFTWF_LIB and FFTWD_LIB variables as options.  This implies that they are boolean, but they need to be strings to the full path of the libraries.

--- CMake/FindFFTW.cmake
+++ CMake/FindFFTW.cmake
@@ -40,9 +40,9 @@
     /usr/local/lib/fftw
   )

-  MARK_AS_ADVANCED(FFTWD_LIB)
-  OPTION(FFTWD_LIB "The full path to the fftw3 library (including the library)" )
   IF(USE_FFTWD)
+    MARK_AS_ADVANCED(FFTWD_LIB)
+#   OPTION(FFTWD_LIB "The full path to the fftw3 library (including the library)" )
     FIND_LIBRARY(FFTWD_LIB fftw3 ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib
     FIND_LIBRARY(FFTWD_THREADS_LIB fftw3_threads ${FFTW_LIB_SEARCHPATH}) #Double Precision Lib only if compiled with threads support

@@ -57,10 +57,9 @@
     ENDIF(FFTWD_LIB)
   ENDIF(USE_FFTWD)

-  MARK_AS_ADVANCED(FFTWF_LIB)
-  OPTION(FFTWF_LIB "The full path to the fftw3f library (including the library)" )
-
   IF(USE_FFTWF)
+    MARK_AS_ADVANCED(FFTWF_LIB)
+#   OPTION(FFTWF_LIB "The full path to the fftw3f library (including the library)" )
     FIND_LIBRARY(FFTWF_LIB fftw3f ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib
     FIND_LIBRARY(FFTWF_THREADS_LIB fftw3f_threads ${FFTW_LIB_SEARCHPATH}) #Single Precision Lib only if compiled with threads support


correct fix for cmake CMP0011

correct fix for cmake CMP0011

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -5,9 +5,9 @@
 IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
 	cmake_policy(SET CMP0005 OLD)
 	cmake_policy(SET CMP0003 OLD)
-	IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
+	if(POLICY CMP0011)
 		cmake_policy(SET CMP0011 OLD)
-	ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.6)
+	endif(POLICY CMP0011)
 	include(${OLXROOTDIR}/PCHSupport_26.cmake)
 ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)


Attempting to uncover scoping issue.

Attempting to uncover scoping issue.

--- CPM.cmake
+++ CPM.cmake
@@ -687,6 +687,8 @@
   # Setup the project.
   add_subdirectory("${__CPM_MODULE_SOURCE_DIR}" "${__CPM_MODULE_BIN_DIR}")

+  message("CPM module: ${CPM_LAST_MODULE_NAME}")
+
   # Parse the arguments once again after adding the subdirectory (since we
   # cleared them all).
   _cpm_parse_arguments(CPM_AddModule _CPM_ "${ARGN}")


fix glslang linker errors

fix glslang linker errors

--- CompileOptions.cmake
+++ CompileOptions.cmake
@@ -17,8 +17,10 @@
     option(VKE_USE_DIRECTXTEX "Enable image supported by DirectXTex" ON)
     option(VKE_USE_DEVIL "Enable image supported by DevIL" OFF)
     option(VKE_USE_DIRECTXSHADERCOMPILER "Enable DirectXShaderCompiler" ON)
+    option(VKE_USE_GLSL_COMPILER "Enable glslang compiler" OFF)
 else()
     option(VKE_USE_DIRECTXTEX "Enable image supported by DirectXTex" OFF)
     option(VKE_USE_DEVIL "Enable image supported by DevIL" ON)
     option(VKE_USE_DIRECTXSHADERCOMPILER "Enable DirectXShaderCompiler" OFF)
+    option(VKE_USE_GLSL_COMPILER "Enable glslang compiler" ON)
 endif()


Reduce size of build name by using temporary directory with very short name because paths are too long (thanks Jussi)
Fix clean on end test script for nightly build

git-svn-id: ed1ce8e5c168003d808aec37bc6fda77b178f7bb@3409 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- trunk/test/openVibeTests.cmake
+++ trunk/test/openVibeTests.cmake
@@ -47,15 +47,19 @@
   SET(MODEL Experimental)
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Experimental)

+# create a temporary directory with very short name to host build
+exec_program("mktemp" ARGS "--tmpdir -d ov.XXX" OUTPUT_VARIABLE OV-ROOT-DIR)
+
+####
+
+## -- SRC Dir
+set(CTEST_SOURCE_DIRECTORY              "${OV-ROOT-DIR}/trunk")
+
+## -- BIN Dir
+set(CTEST_BINARY_DIRECTORY              "${OV-ROOT-DIR}/bin")
+
 ## -- DashBoard Root
 set(CTEST_DASHBOARD_ROOT                "${CMAKE_CURRENT_SOURCE_DIR}")
-
-## -- SRC Dir
-set(CTEST_SOURCE_DIRECTORY              "${CTEST_DASHBOARD_ROOT}/${CTEST_BUILD_NAME}/trunk")
-
-## -- BIN Dir
-set(CTEST_BINARY_DIRECTORY              "${CTEST_DASHBOARD_ROOT}/${CTEST_SITE}/${CTEST_BUILD_NAME}/bin")
-

 # -----------------------------------------------------------
 # -- commands
@@ -154,6 +158,8 @@
 IF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
 	message(" -- clean ${MODEL}  - ${CTEST_BUILD_NAME} --")
 	ctest_empty_binary_directory(${CTEST_SOURCE_DIRECTORY})
+	ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
+	exec_program("rm" ARGS "-rf ${CTEST_SOURCE_DIRECTORY}" OUTPUT_VARIABLE "cleanScript")
 ENDIF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
-exec_program("rm" ARGS "-rf ${CTEST_SOURCE_DIRECTORY}" OUTPUT_VARIABLE "cleanScript")

+


Change STRING_LEFTMOST_NOTMATCH_INDEX and STRING_RIGHTMOST_NOT_MATCH_INDEX to functions

--- Modules/ManageString.cmake
+++ Modules/ManageString.cmake
@@ -42,9 +42,9 @@
 IF(NOT DEFINED _MANAGE_STRING_CMAKE_)
     SET(_MANAGE_STRING_CMAKE_ "DEFINED")

-    # Return (index of lefttmost non match character) +1
-    # Return _strLen if all characters are trimmable
-    MACRO(STRING_LEFTMOST_NOTMATCH_INDEX var str regex)
+    # Return (index of lefttmost non match character)
+    # Return _strLen if all characters matches regex
+    FUNCTION(STRING_LEFTMOST_NOTMATCH_INDEX var str regex)
 	STRING(LENGTH "${str}" _strLen)
 	SET(_index 0)
 	SET(_ret ${_strLen})
@@ -58,13 +58,13 @@

 	    MATH(EXPR _index ${_index}+1)
 	ENDWHILE(_index LESS _strLen)
-	SET(${var} ${_ret})
-    ENDMACRO(STRING_LEFTMOST_NOTMATCH_INDEX var str)
+	SET(${var} ${_ret} PARENT_SCOPE)
+    ENDFUNCTION(STRING_LEFTMOST_NOTMATCH_INDEX var str)

     # Return (index of rightmost non match character) +1
-    # Return 0 if all characters are trimmable
+    # Return 0 if all characters matches regex
     #
-    MACRO(STRING_RIGHTMOST_NOTMATCH_INDEX var str regex)
+    FUNCTION(STRING_RIGHTMOST_NOTMATCH_INDEX var str regex)
 	STRING(LENGTH "${str}" _strLen)
 	MATH(EXPR _index ${_strLen})
 	SET(_ret 0)
@@ -79,8 +79,8 @@
 	    ENDIF(NOT "${_strCursor}" MATCHES "${regex}")
 	    MATH(EXPR _index ${_index}-1)
 	ENDWHILE(_index GREATER 0)
-	SET(${var} ${_ret})
-    ENDMACRO(STRING_RIGHTMOST_NOTMATCH_INDEX var str)
+	SET(${var} ${_ret} PARENT_SCOPE)
+    ENDFUNCTION(STRING_RIGHTMOST_NOTMATCH_INDEX var str)

     MACRO(STRING_TRIM var str)
 	#STRING_ESCAPE(_ret "${str}" ${ARGN})


Tweak alphabetization by driver (not device).

svn path=/trunk/; revision=8108

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -108,9 +108,9 @@
 # (psttf and pscairo) to get modern fonts for postscript results.
 "pstex:pstex:OFF"
 "psttf:psttf:ON"
+"svg:svg:ON"
 "xterm:tek:OFF" "tek4010:tek:OFF" "tek4107:tek:OFF" "mskermit:tek:OFF"
 "versaterm:tek:OFF" "vlt:tek:OFF" "conex:tek:OFF" "tek4010f:tek:OFF"
-"svg:svg:ON"
 "tek4107f:tek:OFF"
 "tk:tk:ON"
 "tkwin:tkwin:ON"


Add comment tex -> doc

Add comment tex -> doc

--- cmake/DevBasePandocMacro.cmake
+++ cmake/DevBasePandocMacro.cmake
@@ -1,3 +1,9 @@
+# TODO
+# convert_latex
+#
+# e.g.: latex to word:
+#     pandoc article.tex -o article.docx --bibliography bibliography.bib
+
 function(convert_markdown)
     set(OPTIONS GITHUB_FLAVORED)
     set(ONE_VALUE_ARGUMENTS TARGET FORMAT DESTINATIONS)


cmake: cython detection now uses the module

Before it looked for the `cython` binary

--- cmake/Modules/FindCython.cmake
+++ cmake/Modules/FindCython.cmake
@@ -3,14 +3,36 @@
 # defines
 #
 # CYTHON_FOUND - system has cython
-# CYTHON_EXECUTABLE - where to find 'cython'
+# CYTHON_VERSION - cython version

-FIND_PROGRAM (CYTHON_EXECUTABLE cython)

-SET (CYTHON_FOUND FALSE CACHE INTERNAL "")
-
-if(CYTHON_EXECUTABLE)
-    SET (CYTHON_FOUND TRUE CACHE INTERNAL "")
+# Finding cython involves calling the Python interpreter
+if(CYTHON_FIND_REQUIRED)
+    find_package(PythonInterp REQUIRED)
+else()
+    find_package(PythonInterp)
 endif()

-MARK_AS_ADVANCED(CYTHON_EXECUTABLE)+if(NOT PYTHONINTERP_FOUND)
+    set(CYTHON_FOUND FALSE)
+    return()
+endif()
+
+execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" "import cython; print(cython.__version__);"
+        RESULT_VARIABLE _CYTHON_VERSION_RESULT
+        OUTPUT_VARIABLE CYTHON_VERSION
+        ERROR_VARIABLE _CYTHON_ERROR_VALUE
+        OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+if(NOT _CYTHON_VERSION_RESULT MATCHES 0)
+    if(CYTHON_FIND_REQUIRED)
+        message(FATAL_ERROR
+                "CYTHON import failure:\n${_CYTHON_ERROR_VALUE}")
+    endif()
+    set(CYTHON_FOUND FALSE)
+    return()
+else()
+    set(CYTHON_FOUND TRUE)
+endif()
+
+find_package_message(CYTHON "Found Cython: version \"${CYTHON_VERSION}\"" "${CYTHON_VERSION}")


Fix: remove annoying messages

Fix: remove annoying messages

--- cmake/Modules/FindPXCAPI.cmake
+++ cmake/Modules/FindPXCAPI.cmake
@@ -6,14 +6,11 @@
 # PXCAPI_INCLUDE_DIRS - Directories containing the PXCAPI include files.
 # PXCAPI_LIBRARIES - Libraries needed to use PXCAPI.

-#MESSAGE("Searching for PXCAPI in: ${PXCAPI_DIR}")
-
 if(PXCAPI_DIR)
   set(PXCAPI_INCLUDE_DIRS ${PXCAPI_DIR}/include ${PXCAPI_DIR}/sample/common/include)
   set(PXCAPI_LIB_DIRS ${PXCAPI_DIR}/lib/x64 ${PXCAPI_DIR}/sample/common/lib/x64/v100)
   set(PXCAPI_LIBS ${PXCAPI_DIR}/lib/x64/libpxc.lib ${PXCAPI_DIR}/sample/common/lib/x64/v100/libpxcutils.lib)
 else()
-  MESSAGE("Searching PXCAPI includes: ${PXCAPI_DIR}")
   find_path(PXCAPI_DIR include/pxcimage.h
     PATHS "${PXCAPI_DIR}" "C:/Program Files/Intel/PCSDK" "C:/Program Files (x86)/Intel/PCSDK"
     DOC "PXCAPI include directories")
@@ -27,9 +24,6 @@
   endif()
 endif()

-MESSAGE("PXCAPI_INCLUDE_DIR: ${PXCAPI_INCLUDE_DIRS}")
-MESSAGE("PXCAPI_LIBS: ${PXCAPI_LIBS}")
-
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(PXCAPI DEFAULT_MSG
                                   PXCAPI_LIBS PXCAPI_INCLUDE_DIRS PXCAPI_LIB_DIRS)


CMake: Use DEAL_II_FEATURES in setup_write_config.cmake

This is a first step to avoid the variables introspection done in this
setup file.

--- cmake/setup_write_config.cmake
+++ cmake/setup_write_config.cmake
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2014 - 2015 by the deal.II authors
+## Copyright (C) 2014 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -164,22 +164,15 @@
 _both("DEAL_II_ALLOW_AUTODETECTION = ${DEAL_II_ALLOW_AUTODETECTION}):\n")

-GET_CMAKE_PROPERTY(_variables VARIABLES)
-FOREACH(_var ${_variables})
-  IF(_var MATCHES "DEAL_II_WITH")
-    LIST(APPEND _features "${_var}")
-  ELSEIF(_var MATCHES "DEAL_II_COMPONENT")
-    LIST(APPEND _components "${_var}")
-  ENDIF()
-ENDFOREACH()
-
-FOREACH(_var ${_features})
+SET(_deal_ii_features_sorted ${DEAL_II_FEATURES})
+LIST(SORT _deal_ii_features_sorted)
+FOREACH(_feature ${_deal_ii_features_sorted})
+  SET(_var DEAL_II_WITH_${_feature})
+
   IF(${${_var}})
-
     #
     # The feature is enabled:
     #
-    STRING(REGEX REPLACE "^DEAL_II_WITH_" "" _feature ${_var})
     IF(FEATURE_${_feature}_EXTERNAL_CONFIGURED)
       _both("#        ${_var} set up with external dependencies\n")
     ELSEIF(FEATURE_${_feature}_BUNDLED_CONFIGURED)
@@ -236,6 +229,13 @@
 _both(
   "#\n#  Component configuration:\n"
   )
+
+GET_CMAKE_PROPERTY(_variables VARIABLES)
+FOREACH(_var ${_variables})
+  IF(_var MATCHES "DEAL_II_COMPONENT")
+    LIST(APPEND _components "${_var}")
+  ENDIF()
+ENDFOREACH()
 FOREACH(_var ${_components})
   IF(_var MATCHES "DEAL_II_COMPONENT")
     IF(${${_var}})


PARQUET-938: Fix a typo

PARQUET-938: Fix a typo

Author: Kouhei Sutou <kou@clear-code.com>

Closes #284 from kou/fix-a-typo and squashes the following commits:

436a46c [Kouhei Sutou] Fix a typo

--- cmake_modules/FindSnappy.cmake
+++ cmake_modules/FindSnappy.cmake
@@ -22,7 +22,7 @@
 #
 #  Snappy_HOME - When set, this path is inspected instead of standard library
 #                locations as the root of the Snappy installation.
-#                The environment variable SNAPPY_HOME overrides this veriable.
+#                The environment variable SNAPPY_HOME overrides this variable.
 #
 # This module defines
 #  SNAPPY_INCLUDE_DIR, directory containing headers


[cmake_modules] fix linker probing on macOS

Fixed linkage on macOS: as of now, using system ld64 linker.  It turned
out that LLD linker from thirdparty ld64.lld not fully functional yet
to link Kudu binaries.  At least, it doesn't support the -U flag which
is used for the KRB5_REALM_OVERRIDE hack.

This is a follow-up to 638d95d295da0bddf3fa157792ec7de8889ac919.

Change-Id: I5c0ef0104388438f444b1f8ac76ca5ebf4cc2928
Reviewed-on: http://gerrit.cloudera.org:8080/15107
Tested-by: Alexey Serbin <864f6b82bd94e8dda64141d4274519ee66e0102e@cloudera.com>
Reviewed-by: Andrew Wong <b68e4fdc6430321a6b47400732ff97d7ae91234e@cloudera.com>

--- cmake_modules/KuduLinker.cmake
+++ cmake_modules/KuduLinker.cmake
@@ -20,13 +20,20 @@
   # Search candidate linkers in the order of decreasing speed and functionality.
   # In particular, lld is the best choice since it's quite fast and supports
   # ThinLTO, etc.
-  foreach(candidate_linker lld "${THIRDPARTY_TOOLCHAIN_DIR}/bin/ld.lld" gold default)
+  #
+  # On macOS, LLD from third-party ${THIRDPARTY_TOOLCHAIN_DIR}/bin/ld64.lld
+  # isn't fully functional yet: it doesn't support -U option, etc.
+  if (NOT APPLE)
+    set(linkers "lld" "${THIRDPARTY_TOOLCHAIN_DIR}/bin/ld.lld" "gold")
+  endif()
+  list(APPEND linkers "default")
+  foreach(candidate_linker ${linkers})
     if(candidate_linker STREQUAL "default")
-      set(candidate_flag "")
+      set(candidate_flags "")
     else()
-      set(candidate_flag "-fuse-ld=${candidate_linker}")
+      set(candidate_flags "-fuse-ld=${candidate_linker}")
     endif()
-    GET_LINKER_VERSION("${candidate_flag}")
+    GET_LINKER_VERSION("${candidate_flags}")
     if(NOT LINKER_FOUND)
       continue()
     endif()
@@ -72,7 +79,7 @@
       message(WARNING "Cannot use lld < 10.0.0 with TSAN/ASAN/UBSAN. Skipping...")
       continue()
     endif()
-    set(linker_flags "${candidate_flag}")
+    set(linker_flags "${candidate_flags}")
     break()
   endforeach()

@@ -90,65 +97,85 @@
 #
 # Sets the following variables:
 #   LINKER_FOUND: true/false
-#   LINKER_FAMILY: lld/ld/gold
+# When LINKER_FOUND is true, additionally sets the following variables:
+#   LINKER_FAMILY: lld/ld/gold on Linux, ld64 on macOS
 #   LINKER_VERSION: version number of the linker
 # Any additional arguments are passed verbatim into the C++ compiler invocation.
 function(GET_LINKER_VERSION)
   if(ARGN)
-    message(STATUS "Checking linker version with cflags: ${ARGN}")
+    message(STATUS "Checking linker version with flags: ${ARGN}")
   else()
     message(STATUS "Checking linker version when not specifying any flags")
   endif()
-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} "-Wl,--version" ${ARGN}
-    ERROR_QUIET
-    OUTPUT_VARIABLE LINKER_OUTPUT)
-  if (LINKER_OUTPUT MATCHES "GNU gold")
-    # We're expecting LINKER_OUTPUT to look like one of these:
+  if (APPLE)
+    set(ld_version_flag "-v,-bundle")
+  else()
+    set(ld_version_flag "--version")
+  endif()
+  execute_process(
+    COMMAND ${CMAKE_CXX_COMPILER} "-Wl,${ld_version_flag}" ${ARGN}
+    ERROR_VARIABLE LINKER_STDERR
+    OUTPUT_VARIABLE LINKER_STDOUT
+    RESULT_VARIABLE LINKER_EXITCODE)
+  if (NOT LINKER_EXITCODE EQUAL 0)
+    set(LINKER_FOUND FALSE)
+  elseif (LINKER_STDOUT MATCHES "GNU gold")
+    # We're expecting LINKER_STDOUT to look like one of these:
     #   GNU gold (version 2.24) 1.11
     #   GNU gold (GNU Binutils for Ubuntu 2.30) 1.15
-    if (NOT "${LINKER_OUTPUT}" MATCHES "GNU gold \\([^\\)]*\\) (([0-9]+\\.?)+)")
+    if (NOT "${LINKER_STDOUT}" MATCHES "GNU gold \\([^\\)]*\\) (([0-9]+\\.?)+)")
       message(SEND_ERROR "Could not extract GNU gold version. "
-        "Linker version output: ${LINKER_OUTPUT}")
+        "Linker version output: ${LINKER_STDOUT}")
     endif()
+    set(LINKER_FOUND TRUE)
     set(LINKER_FAMILY "gold")
     set(LINKER_VERSION "${CMAKE_MATCH_1}")
-    set(LINKER_FOUND TRUE)
-  elseif (LINKER_OUTPUT MATCHES "GNU ld")
-    # We're expecting LINKER_OUTPUT to look like one of these:
+  elseif (LINKER_STDOUT MATCHES "GNU ld")
+    # We're expecting LINKER_STDOUT to look like one of these:
     #   GNU ld (GNU Binutils for Ubuntu) 2.30
     #   GNU ld version 2.20.51.0.2-5.42.el6 20100205
     #   GNU ld version 2.25.1-22.base.el7
-    if (NOT "${LINKER_OUTPUT}" MATCHES "GNU ld version (([0-9]+\\.?)+)" AND
-        NOT "${LINKER_OUTPUT}" MATCHES "GNU ld \\([^\\)]*\\) (([0-9]+\\.?)+)")
+    if (NOT "${LINKER_STDOUT}" MATCHES "GNU ld version (([0-9]+\\.?)+)" AND
+        NOT "${LINKER_STDOUT}" MATCHES "GNU ld \\([^\\)]*\\) (([0-9]+\\.?)+)")
       message(SEND_ERROR "Could not extract GNU ld version. "
-        "Linker version output: ${LINKER_OUTPUT}")
+        "Linker version output: ${LINKER_STDOUT}")
     endif()
+    set(LINKER_FOUND TRUE)
     set(LINKER_FAMILY "ld")
     set(LINKER_VERSION "${CMAKE_MATCH_1}")
-    set(LINKER_FOUND TRUE)
-  elseif (LINKER_OUTPUT MATCHES "LLD")
+  elseif (LINKER_STDOUT MATCHES "LLD")
     # Sample:
     #   LLD 9.0.0 (example.com:kudu.git a5848a4c3c8c72a1ac823182e87cd1f6c31ddc15) (compatible with GNU linkers)
-    if (NOT "${LINKER_OUTPUT}" MATCHES "LLD (([0-9]+\\.?)+)")
+    if (NOT "${LINKER_STDOUT}" MATCHES "LLD (([0-9]+\\.?)+)")
       message(SEND_ERROR "Could not extract lld version. "
-        "Linker version output: ${LINKER_OUTPUT}")
+        "Linker version output: ${LINKER_STDOUT}")
     endif()
+    set(LINKER_FOUND TRUE)
     set(LINKER_FAMILY "lld")
     set(LINKER_VERSION "${CMAKE_MATCH_1}")
+  elseif (LINKER_STDERR MATCHES "PROJECT:ld64")
+    # ld64 outputs the versioning information into stderr.
+    # Sample:
+    #   @(#)PROGRAM:ld  PROJECT:ld64-409.12
+    if (NOT "${LINKER_STDERR}" MATCHES "PROJECT:ld64-([0-9]+\\.[0-9]+)")
+      message(SEND_ERROR "Could not extract ld64 version. "
+        "Linker version output: ${LINKER_STDOUT}")
+    endif()
     set(LINKER_FOUND TRUE)
+    set(LINKER_FAMILY "ld64")
+    set(LINKER_VERSION "${CMAKE_MATCH_1}")
   else()
-    set(LINKER_FAMILY "")
-    set(LINKER_VERSION "")
     set(LINKER_FOUND FALSE)
   endif()

-  if(LINKER_FOUND)
+  # Propagate the results to the caller.
+  set(LINKER_FOUND "${LINKER_FOUND}" PARENT_SCOPE)
+  set(LINKER_FAMILY "${LINKER_FAMILY}" PARENT_SCOPE)
+  set(LINKER_VERSION "${LINKER_VERSION}" PARENT_SCOPE)
+
+  if (LINKER_FOUND)
     message(STATUS "Found linker: ${LINKER_FAMILY} version ${LINKER_VERSION}")
   else()
     message(STATUS "Linker not found")
   endif()
-  # Propagate the results to the caller.
-  set(LINKER_FOUND "${LINKER_FOUND}" PARENT_SCOPE)
-  set(LINKER_FAMILY "${LINKER_FAMILY}" PARENT_SCOPE)
-  set(LINKER_VERSION "${LINKER_VERSION}" PARENT_SCOPE)
 endfunction()


add ITK as external package

add ITK as external package


cmdline for manual run has full diff file: updated message to instruct to pull out just header to temp file

SVN-Revision: 524

--- make/codereview.cmake
+++ make/codereview.cmake
@@ -493,7 +493,7 @@
       endif (arg MATCHES " ")
     endforeach(arg ${upload_cmd})
     if (NOT EXISTS "${cookie_file}")
-      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run:\n\t${upload_cmd_str}")
+      message(STATUS "It looks like upload.py does not have cookies in place and will prompt you for a password.  To do so you must run it separately (and then use -DCR_ISSUE=<issue#> arg with future invocations of this script in order to update the same issue).\nPlease run this command, but copy the header only\nof ${DIFF_FILE} to a new temp file and point -f at it:\n\t${upload_cmd_str}")
     else (NOT EXISTS "${cookie_file}")
       message(STATUS "running ${upload_cmd_str}")
       execute_process(COMMAND ${upload_cmd}


Remove unused OrbitUtils/utils.cmake

Remove unused OrbitUtils/utils.cmake

As far as I can tell, this is very old and completely unused.

--- src/OrbitUtils/utils.cmake
+++ src/OrbitUtils/utils.cmake
@@ -1,32 +0,0 @@
-cmake_minimum_required(VERSION 3.6)
-
-# To enable PrintVars output, set PRINT_VAR_OUTPUT to ON
-set(PRINT_VAR_OUTPUT OFF)
-
-# Print all variables containing "var"
-function(PrintVars var)
-if(PRINT_VAR_OUTPUT)
-message("/=== ${var} ===")
-string( TOLOWER ${var} var_lower )
-get_cmake_property(_variableNames VARIABLES)
-list (SORT _variableNames)
-foreach (_variableName ${_variableNames})
-    string( TOLOWER ${_variableName} cmake_var_lower)
-    if(${cmake_var_lower} MATCHES ${var_lower})
-        message(STATUS "${_variableName}=${${_variableName}}")
-    endif()
-endforeach()
-message("\\=== ${var} ===\n")
-endif(PRINT_VAR_OUTPUT)
-endfunction()
-
-# Print all cmake variables
-function(PrintAllVars)
-message("==== ALL VARS ====")
-get_cmake_property(_variableNames VARIABLES)
-list (SORT _variableNames)
-foreach (_variableName ${_variableNames})
-    message(STATUS "${_variableName}=${${_variableName}}")
-endforeach()
-message("^=== /ALL VARS ====")
-endfunction(PrintAllVars)


Updated the CTestConfig.cmake file so that the CTEST_NIGHTLY_START_TIME is at 1:OO CDT

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -3,7 +3,7 @@
 ##   INCLUDE(CTest)

 set(CTEST_PROJECT_NAME "FRENSIE")
-set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 CDT")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cdash.ep.wisc.edu")


Update CTestConfig for CDash.

Update CTestConfig for CDash.

http://testing.csync.org/

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,8 +1,14 @@
-SET (UPDATE_TYPE "true")
+set(UPDATE_TYPE "true")
+set(CTEST_CUSTOM_MEMCHECK_IGNORE
+  ${CTEST_CUSTOM_MEMCHECK_IGNORE}
+  check_std_c_jhash
+)
+
 set(CTEST_PROJECT_NAME "csync")
-set(CTEST_DROP_METHOD "xmlrpc" )
-set(CTEST_DROP_SITE "http://csync.org/")
-set(CTEST_DROP_LOCATION "csync")
-set(COMPRESS_SUBMISSON ON)
-#set (CTEST_TRIGGER_SITE "http://${CTEST_DROP_SITE}/cgi-bin/Submit-cSync-TestingResults.pl")
+set(CTEST_NIGHTLY_START_TIME "23:00:00 CET")

+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "testing.csync.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=${CTEST_PROJECT_NAME}")
+set(CTEST_DROP_SITE_CDASH TRUE)
+


ignore warnings in Qt4 headers

ignore warnings in Qt4 headers

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -15,6 +15,7 @@
    "warning: the mangled name of .*typename Vc::{anonymous}::Decltype.* will change in a future version of GCC"
    "^\\*\\*\\* WARNING non-zero return value in ctest from: make" # Ignore output from ctest
    "ipo: warning #11010:" # Ignore warning about incompatible libraries with ICC -m32 on 64-bit system
+   "include/qt4" # -Wuninitialized in QWeakPointer(X *ptr)
    )

 set(CTEST_CUSTOM_ERROR_EXCEPTION ${CTEST_CUSTOM_ERROR_EXCEPTION}


refs #5127 ignore some more compiler warnings in jemalloc

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -226,6 +226,7 @@
   "clang: warning: unknown warning option"
   # don't complain about warnings in jemalloc source
   "jemalloc-3.2.0/src"
+  "jemalloc/internal/jemalloc_internal.h"
   # don't complain about ranlib or libtool on empty archive
   "has no symbols"
   "the table of contents is empty"


Made building the docu for installing optional

This patch flags the documentation to be optional for installing.
For this the doc/html folder needs to be created in the
CMAKE_BINARY_DIR.

--- cmake/BALLDoc.cmake
+++ cmake/BALLDoc.cmake
@@ -2,6 +2,8 @@
 #create Doxyfiles for html documentation
 SET(CF_BALL_BIN_PATH ${PROJECT_BINARY_DIR})
 SET(CF_BALL_SRC_PATH ${PROJECT_SOURCE_DIR})
+
+FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/doc/html)

 FIND_PACKAGE(Doxygen)
 FIND_PACKAGE(LATEX)
@@ -44,8 +46,10 @@
 					COMPONENT   "${COMPONENT_DOCUMENTATION_HTML}"
   )
 	INSTALL(FILES       "${PROJECT_SOURCE_DIR}/doc/classes"
-		DESTINATION "${BALL_DOCUMENTATION_INSTALL_DIRECTORY}/"
-		COMPONENT   "${COMPONENT_DOCUMENTATION_HTML}")
+	        DESTINATION "${BALL_DOCUMENTATION_INSTALL_DIRECTORY}/"
+	        COMPONENT   "${COMPONENT_DOCUMENTATION_HTML}"
+	        OPTIONAL
+	)

 	#######################################################################
 	## doc_tidy
@@ -116,6 +120,7 @@
 	INSTALL(FILES   ${PROJECT_BINARY_DIR}/doc/tutorial.pdf
 	        DESTINATION "${BALL_DOCUMENTATION_INSTALL_DIRECTORY}/TUTORIAL"
 					COMPONENT   "${COMPONENT_DOCUMENTATION_PDF}"
+					OPTIONAL
   )

 ELSE()


SWDEV-273235 - build hip samples in Windows (#2513)

Change-Id: I90f06ef058a3a8b54726b86d72f36b2ba7f94d4c

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -50,8 +50,8 @@

 get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)

-# HIP is supported on Linux only
-if(UNIX AND NOT APPLE AND NOT CYGWIN)
+# HIP is currently not supported for apple
+if(NOT APPLE)
     # Search for HIP installation
     if(NOT HIP_ROOT_DIR)
         # Search in user specified path first
@@ -94,7 +94,6 @@
         # Now search in default paths
         find_program(HIP_HIPCC_EXECUTABLE hipcc)
     endif()
-    mark_as_advanced(HIP_HIPCC_EXECUTABLE)

     # Find HIPCONFIG executable
     find_program(
@@ -113,7 +112,12 @@
         # Now search in default paths
         find_program(HIP_HIPCONFIG_EXECUTABLE hipconfig)
     endif()
+    if(NOT UNIX)
+        set(HIP_HIPCONFIG_EXECUTABLE "${HIP_HIPCONFIG_EXECUTABLE}.bat")
+        set(HIP_HIPCC_EXECUTABLE "${HIP_HIPCC_EXECUTABLE}.bat")
+    endif()
     mark_as_advanced(HIP_HIPCONFIG_EXECUTABLE)
+    mark_as_advanced(HIP_HIPCC_EXECUTABLE)

     # Find HIPCC_CMAKE_LINKER_HELPER executable
     find_program(


Document the ZMQ_DIR variables

Document the ZMQ_DIR variables

--- cmake/FindZMQ.cmake
+++ cmake/FindZMQ.cmake
@@ -1,4 +1,9 @@
 # - Finds ZeroMQ 3.x or 4.x
+#
+# This script is run by the command find_package(ZMQ), and will attempt to
+# locate installed ZeroMQ libraries and header files. A CMake variable or
+# environment variable named ZMQ_DIR may be used to provide an explicit
+# location. (If both are set, the CMake variable takes precedence.)
 #
 # The following variables are set if ZeroMQ is found:
 #
@@ -10,8 +15,8 @@
 #                         target.
 #   ZMQ_VERSION_STRING  - The version of ZeroMQ which was found
 #
-# If ZeroMQ was not found, ZMQ_FOUND is set to false.
-#
+# If ZeroMQ is not found, ZMQ_FOUND is set to false.
+
 cmake_minimum_required (VERSION 2.8.11)
 set (ZMQ_DIR "${ZMQ_DIR}" CACHE FILEPATH
     "The directory where ZeroMQ is installed, i.e., the parent directory of the 'bin', 'lib' and 'include' directories that contain the ZeroMQ libraries and headers."


Version 0.1.7

Version 0.1.7

--- cmake/Version.cmake
+++ cmake/Version.cmake
@@ -13,7 +13,7 @@
 # The PATCH version can be incremented whenever it is necessary.  The patch version should be
 # incremented whenever there is a "release" in any form, but can also be incremented periodically
 # for testing purposes.
-set(CGUL_VERSION_PATCH 6)
+set(CGUL_VERSION_PATCH 7)

 # Combined version
 set(CGUL_VERSION ${CGUL_VERSION_MAJOR}.${CGUL_VERSION_MINOR}.${CGUL_VERSION_PATCH})


Try on setting RPM dependencies -- seems to vary with Linux distribution

--- cmake/package.cmake
+++ cmake/package.cmake
@@ -162,6 +162,20 @@
     SET(CPACK_GENERATOR TGZ)
     SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
   ELSE()
+    IF(${OSPRAY_TASKING_SYSTEM} STREQUAL "TBB")
+      SET(TBB_REQ "tbb >= 3.0")
+    ENDIF()
+    IF(CMAKE_VERSION VERSION_LESS "3.4.0")
+      MESSAGE(WARNING "You need at least v3.4.0 of CMake for generating RPMs")
+      SET(CPACK_RPM_PACKAGE_REQUIRES ${TBB_REQ})
+    ELSE()
+      # needs to use COMPONENT names in original capitalization (i.e. lowercase)
+      SET(CPACK_RPM_lib_PACKAGE_REQUIRES ${TBB_REQ})
+      SET(CPACK_RPM_lib_mic_PACKAGE_REQUIRES "ospray-lib = ${OSPRAY_VERSION}")
+      SET(CPACK_RPM_apps_PACKAGE_REQUIRES "ospray-lib >= ${OSPRAY_VERSION}, qt = 4")
+      SET(CPACK_RPM_devel_PACKAGE_REQUIRES "ospray-lib = ${OSPRAY_VERSION}")
+      #SET(CPACK_RPM_PACKAGE_DEBUG ON)
+    ENDIF()
     SET(CPACK_GENERATOR RPM)
     SET(CPACK_RPM_PACKAGE_RELEASE 1) # scripts/release_linux.sh assumes "1"
     SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${CPACK_RPM_PACKAGE_RELEASE}.x86_64")


remove accidentally added cmake_install.cmake

--- cmake_install.cmake
+++ cmake_install.cmake
@@ -1,47 +0,0 @@
-# Install script for directory: /Users/rider/workspace/cachelot
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  if(BUILD_TYPE)
-    string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  else()
-    set(CMAKE_INSTALL_CONFIG_NAME "")
-  endif()
-  message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
-  if(COMPONENT)
-    message(STATUS "Install component: \"${COMPONENT}\"")
-    set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  else()
-    set(CMAKE_INSTALL_COMPONENT)
-  endif()
-endif()
-
-if(NOT CMAKE_INSTALL_LOCAL_ONLY)
-  # Include the install script for each subdirectory.
-  include("/Users/rider/workspace/cachelot/src/cachelot/cmake_install.cmake")
-  include("/Users/rider/workspace/cachelot/src/unit_test/cmake_install.cmake")
-  include("/Users/rider/workspace/cachelot/src/benchmark/cmake_install.cmake")
-
-endif()
-
-if(CMAKE_INSTALL_COMPONENT)
-  set(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-else()
-  set(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-endif()
-
-file(WRITE "/Users/rider/workspace/cachelot/${CMAKE_INSTALL_MANIFEST}" "")
-foreach(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  file(APPEND "/Users/rider/workspace/cachelot/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-endforeach()


ENH: add tinyXML dependency in Ice

ENH: add tinyXML dependency in Ice

--- CMake/External_Ice.cmake
+++ CMake/External_Ice.cmake
@@ -38,6 +38,16 @@
   list(APPEND ${proj}_DEPENDENCIES ITK)
 endif()

+if(USE_SYSTEM_TINYXML)
+  set(ICE_SB_TINYXML_CONFIG)
+else()
+  set(ICE_SB_TINYXML_CONFIG
+    -DTINYXML_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
+    -DTINYXML_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libtinyXML${CMAKE_SHARED_LIBRARY_SUFFIX}
+    )
+  list(APPEND ${proj}_DEPENDENCIES TINYXML)
+endif()
+
 if(MSVC)
   set(ICE_SB_ITK_CONFIG)
   set(ICE_SB_GLEW_CONFIG)
@@ -61,7 +71,8 @@
     -DOTB_DIR:PATH=${CMAKE_INSTALL_PREFIX}/lib/otb
     ${ICE_SB_ITK_CONFIG}
     ${ICE_SB_GLFW_CONFIG}
-    ${ICE_SB_GLEW_CONFIG}
+    ${ICE_SB_GLEW_CONFIG}
+    ${ICE_SB_TINYXML_CONFIG}
    )

 message(STATUS "  Using Ice SuperBuild version")


COMP: use new enablement option for QT4

COMP: use new enablement option for QT4

--- CMake/External_OTB.cmake
+++ CMake/External_OTB.cmake
@@ -22,19 +22,19 @@

 if(ENABLE_QT4)
   if(USE_SYSTEM_QT4)
-    set(OTB_SB_WRAP_QT_CONFIG -DOTB_WRAP_QT:BOOL=ON)
+    set(OTB_SB_WRAP_QT_CONFIG -DOTB_USE_QT4:BOOL=ON)
   else()
     if(MSVC)
-      set(OTB_SB_WRAP_QT_CONFIG -DOTB_WRAP_QT:BOOL=ON)
+      set(OTB_SB_WRAP_QT_CONFIG -DOTB_USE_QT4:BOOL=ON)
       list(APPEND ${proj}_DEPENDENCIES QT4)
     else(UNIX)
        #TODO: use must have Qt4
        message(STATUS "  Qt4 is not built by SuperBuild. You need to install it via package manager.")
-      set(OTB_SB_WRAP_QT_CONFIG -DOTB_WRAP_QT:BOOL=OFF)
+      set(OTB_SB_WRAP_QT_CONFIG -DOTB_USE_QT4:BOOL=OFF)
     endif()
   endif()
 else()
-  set(OTB_SB_WRAP_QT_CONFIG -DOTB_WRAP_QT:BOOL=OFF)
+  set(OTB_SB_WRAP_QT_CONFIG -DOTB_USE_QT4:BOOL=OFF)
 endif()

 if(USE_SYSTEM_GDAL)


Updated CTK version to official one

Updated CTK version to official one

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,10 +15,10 @@

   if(NOT DEFINED CTK_DIR)

-    SET(revision_tag 2b5ab7c42c0e180c21922cf09c5ccd465477cca8)
-    IF(${proj}_REVISION_TAG)
-      SET(revision_tag ${${proj}_REVISION_TAG})
-    ENDIF()
+    set(revision_tag 2b5ab7c4)
+    #IF(${proj}_REVISION_TAG)
+    #  SET(revision_tag ${${proj}_REVISION_TAG})
+    #ENDIF()

     set(ctk_optional_cache_args )
     if(MITK_USE_Python)
@@ -45,13 +45,11 @@
     ENDFOREACH()

     ExternalProject_Add(${proj}
-      GIT_REPOSITORY http://github.com/Miluba154/CTK.git
-      GIT_TAG ${revision_tag}
       SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}-src
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 e214b632dc876592923d5d8ca77296d5
+      URL_MD5 2352b3078d045387232ac148c63b1c3a
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Use http protocol for CTK clone in superbuild

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -28,7 +28,7 @@
     ENDFOREACH()

     ExternalProject_Add(${proj}
-      GIT_REPOSITORY git://github.com/commontk/CTK.git
+      GIT_REPOSITORY http://github.com/commontk/CTK.git
       GIT_TAG ${revision_tag}
       BINARY_DIR ${proj}-build
       UPDATE_COMMAND ""
@@ -40,6 +40,7 @@
         -DDESIRED_QT_VERSION:STRING=4
         -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         -DCTK_LIB_DICOM/Widgets:BOOL=ON
+        -DCTK_USE_GIT_PROTOCOL:BOOL=OFF
       DEPENDS ${proj_DEPENDENCIES}
      )
   SET(CTK_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}-build)


Make sure -s USE_SDL=2 is part of compiler command line when building Urho3D library

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -352,6 +352,7 @@
     set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof")
     if (EMSCRIPTEN)
         set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-warn-absolute-paths")
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_SDL=2")
     endif ()
     if (ANDROID)
         # Most of the flags are already setup in android.toolchain.cmake module


Search for all modules of gloperate in find script

--- gloperate-config.cmake
+++ gloperate-config.cmake
@@ -8,6 +8,21 @@
 # GLOPERATE_LIBRARY_RELEASE
 # GLOPERATE_LIBRARY_DEBUG
 # GLOPERATE_INCLUDE_DIR
+
+# GLOPERATE_QT_LIBRARY
+# GLOPERATE_QT_LIBRARY_RELEASE
+# GLOPERATE_QT_LIBRARY_DEBUG
+# GLOPERATE_QT_INCLUDE_DIR
+
+# GLOPERATE_GLFW_LIBRARY
+# GLOPERATE_GLFW_LIBRARY_RELEASE
+# GLOPERATE_GLFW_LIBRARY_DEBUG
+# GLOPERATE_GLFW_INCLUDE_DIR
+
+# GLOPERATE_OSG_LIBRARY
+# GLOPERATE_OSG_LIBRARY_RELEASE
+# GLOPERATE_OSG_LIBRARY_DEBUG
+# GLOPERATE_OSG_INCLUDE_DIR

 include(FindPackageHandleStandardArgs)

@@ -40,21 +55,11 @@
     /opt/local/lib64
 )

-macro (LIST_CONTAINS var value)
-    set (${var} FALSE)
-    string(TOUPPER ${value} VALUE_UPPER)
-    foreach (value2 ${ARGN})
-        string(TOUPPER ${value2} VALUE2_UPPER)
-        if (${VALUE_UPPER} STREQUAL ${VALUE2_UPPER})
-            set (${var} TRUE)
-        endif ()
-    endforeach ()
-endmacro ()
-
 macro (find LIB_NAME HEADER)
     set(HINT_PATHS ${ARGN})

     string(TOUPPER ${LIB_NAME} LIB_NAME_UPPER)
+    string(REPLACE "-" "_" LIB_NAME_UPPER ${LIB_NAME_UPPER})

     find_path(${LIB_NAME_UPPER}_INCLUDE_DIR ${HEADER}
         ${ENVGLOPERATE_DIR}/include
@@ -86,16 +91,19 @@
     endif()

     # DEBUG
-    # message("${LIB_NAME_UPPER}_INCLUDE_DIR     = ${${LIB_NAME_UPPER}_INCLUDE_DIR}")
-    # message("${LIB_NAME_UPPER}_LIBRARY_RELEASE = ${${LIB_NAME_UPPER}_LIBRARY_RELEASE}")
-    # message("${LIB_NAME_UPPER}_LIBRARY_DEBUG   = ${${LIB_NAME_UPPER}_LIBRARY_DEBUG}")
-    # message("${LIB_NAME_UPPER}_LIBRARY         = ${${LIB_NAME_UPPER}_LIBRARY}")
+    message("${LIB_NAME_UPPER}_INCLUDE_DIR     = ${${LIB_NAME_UPPER}_INCLUDE_DIR}")
+    message("${LIB_NAME_UPPER}_LIBRARY_RELEASE = ${${LIB_NAME_UPPER}_LIBRARY_RELEASE}")
+    message("${LIB_NAME_UPPER}_LIBRARY_DEBUG   = ${${LIB_NAME_UPPER}_LIBRARY_DEBUG}")
+    message("${LIB_NAME_UPPER}_LIBRARY         = ${${LIB_NAME_UPPER}_LIBRARY}")

     list(APPEND GLOPERATE_INCLUDES ${${LIB_NAME_UPPER}_INCLUDE_DIR})
     list(APPEND GLOPERATE_LIBRARIES ${${LIB_NAME_UPPER}_LIBRARY})
 endmacro()

 find(gloperate gloperate/gloperate_api.h ${LIB_PATHS})
+find(gloperate-qt gloperate-qt/gloperate-qt_api.h ${LIB_PATHS})
+find(gloperate-glfw gloperate-glfw/gloperate-glfw_api.h ${LIB_PATHS})
+find(gloperate-osg gloperate-osg/gloperate-osg_api.h ${LIB_PATHS})

 # add dependencies
 find_package(globjects REQUIRED)
@@ -103,8 +111,8 @@
 list(APPEND GLOPERATE_LIBRARIES ${GLOBJECTS_LIBRARIES})

 # DEBUG
-# message("GLOPERATE_INCLUDES  = ${GLOPERATE_INCLUDES}")
-# message("GLOPERATE_LIBRARIES = ${GLOPERATE_LIBRARIES}")
+message("GLOPERATE_INCLUDES  = ${GLOPERATE_INCLUDES}")
+message("GLOPERATE_LIBRARIES = ${GLOPERATE_LIBRARIES}")

 find_package_handle_standard_args(GLOPERATE DEFAULT_MSG GLOPERATE_LIBRARIES GLOPERATE_INCLUDES)
 mark_as_advanced(GLOPERATE_FOUND)


set compiler ID in ios toolchain

set compiler ID in ios toolchain

CMAKE_CXX_COMPILER_ID variable is set to AppleClang too late, causing
apple.cmake to not load properties from clang.cmake (reproduced on build_fat.sh
script for building OpenCV for iOS)

--- toolchains/ios.toolchain.cmake
+++ toolchains/ios.toolchain.cmake
@@ -17,6 +17,8 @@
 #
 ################################################################################

+set(CMAKE_C_COMPILER_ID   AppleClang)
+set(CMAKE_CXX_COMPILER_ID AppleClang)

 include( "${CMAKE_CURRENT_LIST_DIR}/apple.cmake" )
 unset( TNUN_native_optimization ) # This makes no sense when cross-compiling.


cmake: Fixed search path for mingw toolchain

--- .cmake/Toolchains/Toolchain-mingw-w64.cmake
+++ .cmake/Toolchains/Toolchain-mingw-w64.cmake
@@ -13,7 +13,7 @@
     SET(CMAKE_C_COMPILER "C:/msys64/mingw${BITS}/bin/gcc.exe")
     SET(CMAKE_CXX_COMPILER "C:/msys64/mingw${BITS}/bin/g++.exe")
     SET(CMAKE_RC_COMPILER "C:/msys64/mingw${BITS}/bin/windres.exe")
-    SET(CMAKE_FIND_ROOT_PATH "C:/msys64/mingw${BITS}/bin")
+    SET(CMAKE_FIND_ROOT_PATH "C:/msys64/mingw${BITS}" "C:/msys64/mingw${BITS}/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32")
 else ()
     # which compilers to use for C and C++
     SET(CMAKE_C_COMPILER ${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-gcc)


CLion friendly layout

CLion friendly layout


Fixed physx3 linux cmake build

Fixed physx3 linux cmake build

--- Tools/CMake/modules/module_physx3.cmake
+++ Tools/CMake/modules/module_physx3.cmake
@@ -108,6 +108,7 @@
    FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 1 ${PHYSX3_BASE_PATH}/PxShared/Lib/)

    if(NOT PHYSX3_CORE_LIBRARY)
+      message(FATAL_ERROR "Could not find core PhysX lib")
       return()
    endif()

@@ -153,29 +154,29 @@
 	  FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 0 ${PHYSX3_PATH}/Lib/)
       FIND_PHYSX3_LIBRARY(FOUNDATION PxFoundation 0 ${PHYSX3_BASE_PATH}/PxShared/lib/)
       FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 0 ${PHYSX3_BASE_PATH}/PxShared/lib/)
-  elseif() #linux
+  else() #linux
       FIND_PHYSX3_LIBRARY(CORE PhysX3 1 ${PHYSX3_PATH}/Bin/)
       FIND_PHYSX3_LIBRARY(COMMON PhysX3Common 1 ${PHYSX3_PATH}/Bin/)
+      FIND_PHYSX3_LIBRARY(GPU PhysX3Gpu 1 ${PHYSX3_PATH}/Bin/)
       FIND_PHYSX3_LIBRARY(CHARACTER PhysX3CharacterKinematic 1 ${PHYSX3_PATH}/Bin/)
       FIND_PHYSX3_LIBRARY(COOKING PhysX3Cooking 1 ${PHYSX3_PATH}/Bin/)
       FIND_PHYSX3_LIBRARY(FOUNDATION PxFoundation 1 ${PHYSX3_BASE_PATH}/PxShared/bin/)
       FIND_PHYSX3_LIBRARY(PVD PxPvdSDK 1 ${PHYSX3_BASE_PATH}/PxShared/bin/)
-	  FIND_PHYSX3_LIBRARY(CUDA PxCudaContextManager 0 ${PHYSX3_BASE_PATH}/PxShared/lib/)
-	  FIND_PHYSX3_LIBRARY(GPU PhysX3Gpu 1 ${PHYSX3_PATH}/Bin/)
 	  FIND_PHYSX3_LIBRARY(XML PsFastXml 0 ${PHYSX3_BASE_PATH}/PxShared/lib/)
    endif()

    if(NOT PHYSX3_CORE_LIBRARY)
+      message(FATAL_ERROR "Could not find core PhysX lib")
       return()
    endif()

    #Add the libs
    set(PHYSX_LIBRARIES
       ${PHYSX3_CORE_LIBRARY}
-      ${PHYSX3_GPU_LIBRARY}
       ${PHYSX3_CHARACTER_LIBRARY}
       ${PHYSX3_COOKING_LIBRARY}
       ${PHYSX3_COMMON_LIBRARY}
+      ${PHYSX3_GPU_LIBRARY}
       ${PHYSX3_EXTENSIONS_LIBRARY}
       ${PHYSX3_CONTROLLER_LIBRARY}
       ${PHYSX3_SCENEQUERY_LIBRARY}
@@ -184,7 +185,6 @@
       ${PHYSX3_LOWLEVEL_DYNAMICS_LIBRARY}
       ${PHYSX3_LOWLEVEL_CLOTH_LIBRARY}
       ${PHYSX3_LOWLEVEL_PARTICLES_LIBRARY}
-      ${PHYSX3_CUDA_LIBRARY}
       ${PHYSX3_TASK_LIBRARY}
       ${PHYSX3_XML_LIBRARY}
       ${PHYSX3_FOUNDATION_LIBRARY}
@@ -193,10 +193,10 @@

    set(PHYSX_LIBRARIES_DEBUG
       ${PHYSX3_CORE_LIBRARY_DEBUG}
-      ${PHYSX3_GPU_LIBRARY_DEBUG}
       ${PHYSX3_CHARACTER_LIBRARY_DEBUG}
       ${PHYSX3_COOKING_LIBRARY_DEBUG}
       ${PHYSX3_COMMON_LIBRARY_DEBUG}
+      ${PHYSX3_GPU_LIBRARY_DEBUG}
       ${PHYSX3_EXTENSIONS_LIBRARY_DEBUG}
       ${PHYSX3_CONTROLLER_LIBRARY_DEBUG}
       ${PHYSX3_SCENEQUERY_LIBRARY_DEBUG}
@@ -205,7 +205,6 @@
       ${PHYSX3_LOWLEVEL_DYNAMICS_LIBRARY_DEBUG}
       ${PHYSX3_LOWLEVEL_CLOTH_LIBRARY_DEBUG}
       ${PHYSX3_LOWLEVEL_PARTICLES_LIBRARY_DEBUG}
-      ${PHYSX3_CUDA_LIBRARY_DEBUG}
       ${PHYSX3_TASK_LIBRARY_DEBUG}
       ${PHYSX3_XML_LIBRARY_DEBUG}
       ${PHYSX3_FOUNDATION_LIBRARY_DEBUG}


SVN_SILENT made messages (.desktop file)

--- plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
+++ plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
@@ -26,6 +26,7 @@
 Comment[sv]=Användargränssnitt för anpassad kontoinställning av konton som använder anslutningshanteraren Sipe.
 Comment[uk]=Інтерфейс користувача для нетипового налаштовування облікового запису за допомогою керування з’єднаннями sipe.
 Comment[x-test]=xxCustom account configuration user interface for accounts using the sipe connection manager.xx
+Comment[zh_TW]=對使用 sipe 連線管理員的帳號自訂帳號設定使用者介面。
 Icon=blockdevice
 Name=Sipe Account Configuration User Interface
 Name[bs]=Korisnički interfejs za konfiguraciju korisničkih naloga Sipe
@@ -53,6 +54,7 @@
 Name[sv]=Användargränssnitt för inställning av Sipe-konton
 Name[uk]=Інтерфейс користувача для налаштовування sipe
 Name[x-test]=xxSipe Account Configuration User Interfacexx
+Name[zh_TW]=Sipe 帳號設定使用者介面
 Type=Service
 ServiceTypes=KTpAccountsKCM/AccountUiPlugin


Fix file permissions

Fix file permissions