Fix formatting FindNF_NativeAssemblies.cmake (#1813)

***NO_CI***

--- CMake/Modules/FindNF_NativeAssemblies.cmake
+++ CMake/Modules/FindNF_NativeAssemblies.cmake
@@ -163,229 +163,225 @@
 # 2. change the call to PerformSettingsForApiEntry() macro with the API name (doted naming)
 ############################################################################################

-# macro(ParseNativeAssemblies)
-
-    # Hardware.Esp32
-    if(API_Hardware.Esp32)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32")
-    endif()
-
-    # nanoFramework.Hardware.Esp32.Rmt
-    if(API_nanoFramework.Hardware.Esp32.Rmt)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32.Rmt")
-    endif()
-
-    # Hardware.Stm32
-    if(API_Hardware.Stm32)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Hardware.Stm32")
-    endif()
-
-    # nanoFramework.Devices.Can
-    if(API_nanoFramework.Devices.Can)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Devices.Can")
-    endif()
-
-    # nanoFramework.Graphics
-    if(API_nanoFramework.Graphics)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Graphics")
-    endif()
-
-    # nanoFramework.Devices.OneWire
-    if(API_nanoFramework.Devices.OneWire)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Devices.OneWire")
-    endif()
-
-    # nanoFramework.Networking.Sntp
-    if(API_nanoFramework.Networking.Sntp)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Networking.Sntp")
-    endif()
-
-    # nanoFramework.ResourceManager
-    if(API_nanoFramework.ResourceManager)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.ResourceManager")
-    endif()
-
-    # nanoFramework.System.Collections
-    if(API_nanoFramework.System.Collections)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.System.Collections")
-    endif()
-
-    # nanoFramework.System.Text
-    if(API_nanoFramework.System.Text)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.System.Text")
-    endif()
-
-    # nanoFramework.TI.EasyLink
-    if(API_nanoFramework.TI.EasyLink)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.TI.EasyLink")
-    endif()
-
-    # nanoFramework.Hardware.TI
-    if(API_nanoFramework.Hardware.TI)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Hardware.TI")
-    endif()
-
-    # nanoFramework.Runtime.Events
-    if(API_nanoFramework.Runtime.Events)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("nanoFramework.Runtime.Events")
-
-        # this one is special because it requires also another assembly for events that is internal (doens't have a managed end)
-
-        # append to list of declaration for Interop Assemblies table
-        list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs;")
-        # append to list of entries for Interop Assemblies table
-        list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs,")
-
-    endif()
-
-    # System.IO.FileSystem
-    if(API_System.IO.FileSystem)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.IO.FileSystem")
-    endif()
-
-    # System.Math
-    if(API_System.Math)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Math")
-    endif()
-
-    # System.Net
-    if(API_System.Net)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Net")
-    endif()
-
-    # Windows.Devices.Adc
-    if(API_Windows.Devices.Adc)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Adc")
-    endif()
-
-    # System.Device.Dac
-    if(API_System.Device.Dac)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Device.Dac")
-    endif()
-
-    # System.Device.Gpio
-    if(API_System.Device.Gpio)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Device.Gpio")
-    endif()
-
-    # Windows.Devices.Gpio
-    if(API_Windows.Devices.Gpio)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Gpio")
-    endif()
-
-	# Windows.Devices.I2c
-    if(API_Windows.Devices.I2c)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.I2c")
-    endif()
-
-	# System.Device.I2c
-    if(API_System.Device.I2c)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("System.Device.I2c")
-    endif()
-
-    # Windows.Devices.Pwm
-    if(API_Windows.Devices.Pwm)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Pwm")
-    endif()
-
-    # Windows.Devices.SerialCommunication
-    if(API_Windows.Devices.SerialCommunication)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.SerialCommunication")
-    endif()
+# Hardware.Esp32
+if(API_Hardware.Esp32)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32")
+endif()
+
+# nanoFramework.Hardware.Esp32.Rmt
+if(API_nanoFramework.Hardware.Esp32.Rmt)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Hardware.Esp32.Rmt")
+endif()
+
+# Hardware.Stm32
+if(API_Hardware.Stm32)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Hardware.Stm32")
+endif()
+
+# nanoFramework.Devices.Can
+if(API_nanoFramework.Devices.Can)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Devices.Can")
+endif()
+
+# nanoFramework.Graphics
+if(API_nanoFramework.Graphics)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Graphics")
+endif()
+
+# nanoFramework.Devices.OneWire
+if(API_nanoFramework.Devices.OneWire)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Devices.OneWire")
+endif()
+
+# nanoFramework.Networking.Sntp
+if(API_nanoFramework.Networking.Sntp)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Networking.Sntp")
+endif()
+
+# nanoFramework.ResourceManager
+if(API_nanoFramework.ResourceManager)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.ResourceManager")
+endif()
+
+# nanoFramework.System.Collections
+if(API_nanoFramework.System.Collections)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.System.Collections")
+endif()
+
+# nanoFramework.System.Text
+if(API_nanoFramework.System.Text)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.System.Text")
+endif()
+
+# nanoFramework.TI.EasyLink
+if(API_nanoFramework.TI.EasyLink)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.TI.EasyLink")
+endif()
+
+# nanoFramework.Hardware.TI
+if(API_nanoFramework.Hardware.TI)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Hardware.TI")
+endif()
+
+# nanoFramework.Runtime.Events
+if(API_nanoFramework.Runtime.Events)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("nanoFramework.Runtime.Events")
+
+    # this one is special because it requires also another assembly for events that is internal (doens't have a managed end)
+
+    # append to list of declaration for Interop Assemblies table
+    list(APPEND CLR_RT_NativeAssemblyDataList "extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs;")
+    # append to list of entries for Interop Assemblies table
+    list(APPEND CLR_RT_NativeAssemblyDataTableEntriesList "&g_CLR_AssemblyNative_nanoFramework_Runtime_Events_EventSink_DriverProcs,")
+
+endif()
+
+# System.IO.FileSystem
+if(API_System.IO.FileSystem)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.IO.FileSystem")
+endif()
+
+# System.Math
+if(API_System.Math)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.Math")
+endif()
+
+# System.Net
+if(API_System.Net)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.Net")
+endif()
+
+# Windows.Devices.Adc
+if(API_Windows.Devices.Adc)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.Adc")
+endif()
+
+# System.Device.Dac
+if(API_System.Device.Dac)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.Device.Dac")
+endif()
+
+# System.Device.Gpio
+if(API_System.Device.Gpio)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.Device.Gpio")
+endif()
+
+# Windows.Devices.Gpio
+if(API_Windows.Devices.Gpio)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.Gpio")
+endif()
+
+# Windows.Devices.I2c
+if(API_Windows.Devices.I2c)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.I2c")
+endif()
+
+# System.Device.I2c
+if(API_System.Device.I2c)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("System.Device.I2c")
+endif()
+
+# Windows.Devices.Pwm
+if(API_Windows.Devices.Pwm)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.Pwm")
+endif()
+
+# Windows.Devices.SerialCommunication
+if(API_Windows.Devices.SerialCommunication)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.SerialCommunication")
+endif()
+
+# Windows.Devices.Spi
+if(API_Windows.Devices.Spi)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.Spi")
+endif()
+
+# Windows.Networking.Sockets
+if(API_Windows.Networking.Sockets)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Networking.Sockets")
+endif()
+
+# Windows.Devices.Wifi
+if(API_Windows.Devices.Wifi)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Devices.Wifi")
+endif()
+
+# Windows.Storage
+if(API_Windows.Storage)
+    ##### API name here (doted name)
+    PerformSettingsForApiEntry("Windows.Storage")
+endif()
+
+# Interop assemblies
+ParseInteropAssemblies()
+
+
+# parse the declarations to have new lines and ';'
+string(REPLACE ";;" ";\n" CLR_RT_NativeAssemblyDataDeclarations "${CLR_RT_NativeAssemblyDataList}")
+# parse the list to have new lines, ',' and identation
+string(REPLACE ";" "\n    " CLR_RT_NativeAssemblyDataTableEntries "${CLR_RT_NativeAssemblyDataTableEntriesList}")
+
+
+# get the count of interop assemblies
+list(LENGTH CLR_RT_NativeAssemblyDataTableEntriesList CLR_RT_NativeAssembliesCount)
+
+
+# configure code file with Interop Assemblies table and...
+configure_file("${CMAKE_SOURCE_DIR}/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in"
+                "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp" @ONLY)
+# ... now add Interop Assemblies table to ChibiOS nanoCLR sources list
+list(APPEND NF_NativeAssemblies_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp")
+
+# output the list of APIs included
+list(LENGTH apiListing apiListingLenght)
+
+if(apiListingLenght GREATER 0)

-    # Windows.Devices.Spi
-    if(API_Windows.Devices.Spi)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Devices.Spi")
-    endif()
-
-    # Windows.Networking.Sockets
-    if(API_Windows.Networking.Sockets)
-        ##### API name here (doted name)
-        PerformSettingsForApiEntry("Windows.Networking.Sockets")
-    endif()
-
-    # Windows.Devices.Wifi
-    if(API_Windows.Devices.Wifi)
-       ##### API name here (doted name)
-       PerformSettingsForApiEntry("Windows.Devices.Wifi")
-    endif()
-
-    # Windows.Storage
-    if(API_Windows.Storage)
-       ##### API name here (doted name)
-       PerformSettingsForApiEntry("Windows.Storage")
-    endif()
-
-    # Interop assemblies
-    ParseInteropAssemblies()
-
-
-    # parse the declarations to have new lines and ';'
-    string(REPLACE ";;" ";\n" CLR_RT_NativeAssemblyDataDeclarations "${CLR_RT_NativeAssemblyDataList}")
-    # parse the list to have new lines, ',' and identation
-    string(REPLACE ";" "\n    " CLR_RT_NativeAssemblyDataTableEntries "${CLR_RT_NativeAssemblyDataTableEntriesList}")
-
-
-    # get the count of interop assemblies
-    list(LENGTH CLR_RT_NativeAssemblyDataTableEntriesList CLR_RT_NativeAssembliesCount)
-
-
-    # configure code file with Interop Assemblies table and...
-    configure_file("${CMAKE_SOURCE_DIR}/InteropAssemblies/CLR_RT_InteropAssembliesTable.cpp.in"
-                    "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp" @ONLY)
-    # ... now add Interop Assemblies table to ChibiOS nanoCLR sources list
-    list(APPEND NF_NativeAssemblies_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/CLR_RT_InteropAssembliesTable.cpp")
-
-    # output the list of APIs included
-    list(LENGTH apiListing apiListingLenght)
-
-    if(apiListingLenght GREATER 0)
-
-        # APIs included
-        message(STATUS "")
-        message(STATUS " *** APIs included ***")
-        message(STATUS "")
-
-        foreach(entry ${apiListing})
-            message(STATUS " ${entry}")
-        endforeach(entry ${})
-
-        message(STATUS "")
-        message(STATUS " ***  end of APIs  ***")
-        message(STATUS "")
-
-    else()
-        # no APIs were included
-        message(STATUS " *** NO APIs included ***")
-    endif()
-
-    include(FindPackageHandleStandardArgs)
-
-    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_NativeAssemblies DEFAULT_MSG NF_NativeAssemblies_INCLUDE_DIRS NF_NativeAssemblies_SOURCES)
+    # APIs included
+    message(STATUS "")
+    message(STATUS " *** APIs included ***")
+    message(STATUS "")
+
+    foreach(entry ${apiListing})
+        message(STATUS " ${entry}")
+    endforeach(entry ${})

-# endmacro()+    message(STATUS "")
+    message(STATUS " ***  end of APIs  ***")
+    message(STATUS "")
+
+else()
+    # no APIs were included
+    message(STATUS " *** NO APIs included ***")
+endif()
+
+include(FindPackageHandleStandardArgs)
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_NativeAssemblies DEFAULT_MSG NF_NativeAssemblies_INCLUDE_DIRS NF_NativeAssemblies_SOURCES)


Synchronize adm files

Synchronize adm files

--- adm_local_without_kernel/cmake_files/SalomeMacros.cmake
+++ adm_local_without_kernel/cmake_files/SalomeMacros.cmake
@@ -778,7 +778,7 @@
 MACRO(SALOME_APPEND_LIST_OF_LIST result element_list)
   SET(_tmp_res)
   STRING(REPLACE ";" "," _tmp_res "${${element_list}}")
-  LIST(APPEND ${result} ${_tmp_res})
+  SET(${result} "${${result}};${_tmp_res}")  # LIST(APPEND ...) doesn't handle well empty elements!?
 ENDMACRO(SALOME_APPEND_LIST_OF_LIST)

 #########################################################################
@@ -808,4 +808,4 @@
       SALOME_APPEND_LIST_OF_LIST(_PREREQ_COMPO_LIST Salome${_prereq}_COMPONENTS)
     ENDIF()
   ENDFOREACH()
-ENDMACRO(SALOME_CONFIGURE_PREPARE)+ENDMACRO(SALOME_CONFIGURE_PREPARE)


Removing RCSfile comment 'open-source-dev-0'

--- geometry/component_definitions.cmake
+++ geometry/component_definitions.cmake
@@ -1,11 +1,8 @@
-#
-# $RCSfile: component_definitions.cmake,v $ $Revision: 1.38 $ $Date: 2013/01/28 15:18:44 $
 #
 #
 # Copyright (c) 2013 Limit Point Systems, Inc.
 #
 #
-
 #
 # This file contains declarations and functions unique to this component.
 #


ERR: Removed use of FILE command and using WRITE_FILE instead.  We would still like CMake 1.6 to be able to build CMake CVS, and kwsys is used.

--- Utilities/kwsys/kwsysPlatformCxxTests.cmake
+++ Utilities/kwsys/kwsysPlatformCxxTests.cmake
@@ -7,11 +7,11 @@
       COMPILE_DEFINITIONS -DTEST_${var}
       OUTPUT_VARIABLE OUTPUT)
     IF(${var}_COMPILED)
-      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeOutput.log
-        "${description} compiled with the following output:\n${OUTPUT}\n\n")
+      WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeOutput.log
+        "${description} compiled with the following output:\n${OUTPUT}\n\n" APPEND)
     ELSE(${var}_COMPILED)
-      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeError.log
-        "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
+      WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeError.log
+        "${description} failed to compile with the following output:\n${OUTPUT}\n\n" APPEND)
     ENDIF(${var}_COMPILED)
     IF(${invert} MATCHES INVERT)
       IF(${var}_COMPILED)


Suppress Wuffs compiler warnings

Suppress Wuffs compiler warnings

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -265,7 +265,7 @@
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-tautological-type-limit-compare>"
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-cast-qual>"
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-reserved-identifier>"
-            " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-missing-prototypes>"
+            " $<$<CXX_COMPILER_ID:Clang>: -Wno-missing-prototypes>"
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-suggest-override>"
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-used-but-marked-unused>"
             " $<$<NOT:$<CXX_COMPILER_ID:MSVC>>: -Wno-noexcept-type>")


CMake's exec_program is deprecated, revert back

This was changed in commit aa13f3 to use exec_program, but this
function is deprecated and execute_process should be preferred.

Change-Id: I45a85307c27eb204082f0176f28fff432af57257

--- CMake/GenerateExportHeader.cmake
+++ CMake/GenerateExportHeader.cmake
@@ -163,7 +163,7 @@
 macro(_test_compiler_hidden_visibility)

   if(CMAKE_COMPILER_IS_GNUCXX)
-    exec_program(${CMAKE_C_COMPILER} ARGS --version
+    execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version
       OUTPUT_VARIABLE _gcc_version_info
       ERROR_VARIABLE _gcc_version_info)
     string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]*"
@@ -181,7 +181,7 @@
   endif()

   if(CMAKE_CXX_COMPILER_ID MATCHES Intel)
-    exec_program(${CMAKE_CXX_COMPILER} ARGS -V
+    execute_process(COMMAND ${CMAKE_CXX_COMPILER} ARGS -V
       OUTPUT_VARIABLE _intel_version_info
       ERROR_VARIABLE _intel_version_info)
     string(REGEX REPLACE ".*Version ([0-9]+(\\.[0-9]+)+).*" "\\1"


FIX: handle multiple config files

FIX: handle multiple config files

--- tests/system_tests/run_system_tests.sh.cmake
+++ tests/system_tests/run_system_tests.sh.cmake
@@ -162,12 +162,16 @@

 function abs_path()
 {
-    local path=$1
-    if [ $(expr substr $path 1 1) = '/' ]; then
-		echo $path
-    else
-		echo $ORIGINAL_WD/$path
-    fi
+    local paths=$1
+	local ap=""
+	for path in $paths; do
+		if [ $(expr substr $path 1 1) = '/' ]; then
+			ap="$ap $path"
+		else
+			ap="$ap $ORIGINAL_WD/$path"
+		fi
+    done
+	echo $ap
 }

 function generate_empty_translation_configuration()
@@ -980,7 +984,7 @@
 				shift
 				;;
 			--config)
-				CONFIG_ARG=$(abs_path $2)
+				CONFIG_ARG=$(abs_path "$2")
 				shift 2
 				;;
 			--email)


-apply same patch as in kdelibs/cmake/modules/, don't append /lib to CMAKE_INSTALL_PREFIX, since
this is already part of PATH_SUFFIXES

Alex

--- cmake/FindAutomoc4.cmake
+++ cmake/FindAutomoc4.cmake
@@ -32,7 +32,7 @@
              PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4
              PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${CMAKE_SYSTEM_PREFIX_PATH}
                    ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH}
-                   ${CMAKE_INSTALL_PREFIX}/lib
+                   ${CMAKE_INSTALL_PREFIX}
              NO_DEFAULT_PATH )
 endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")


Fix GNU readline detection for OS X

Fix GNU readline detection for OS X

--- cmake/FindReadline.cmake
+++ cmake/FindReadline.cmake
@@ -30,9 +30,14 @@
 set(READLINE_LIBRARIES ${READLINE_LIBRARY})

 IF (READLINE_FOUND)
-  IF (EXISTS ${READLINE_INCLUDE_DIR}/readline/rlconf.h)
-    set(HAVE_GNU_READLINE 1)
-  ENDIF ()
+  if(EXISTS ${READLINE_INCLUDE_DIR}/readline/rlconf.h)
+      check_library_exists(${READLINE_LIBRARY} rl_catch_sigwinch ""
+          HAVE_GNU_READLINE)
+      if(HAVE_GNU_READLINE)
+          find_package_message(GNU_READLINE "Detected GNU Readline"
+              "${HAVE_GNU_READLINE}")
+      endif()
+  endif()
   IF (TERMCAP_FOUND)
     SET (READLINE_LIBRARIES ${READLINE_LIBRARIES} ${TERMCAP_LIBRARIES})
     SET (READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIRS} ${TERMCAP_INCLUDE_DIRS})


Restored tests dependencies processing

Restored tests dependencies processing

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -1132,7 +1132,7 @@
       source_group("Src" FILES "${${the_target}_pch}")
       ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
       ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}")
-      ocv_target_link_libraries(${the_target} LINK_PRIVATE ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
+      ocv_target_link_libraries(${the_target} LINK_PRIVATE ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS} ${OPENCV_PERF_${the_module}_DEPS})
       add_dependencies(opencv_perf_tests ${the_target})

       set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};PerfTest")
@@ -1175,7 +1175,7 @@
 endfunction()

 # this is a command for adding OpenCV accuracy/regression tests to the module
-# ocv_add_accuracy_tests([FILES <source group name> <list of sources>] [DEPENDS_ON] <list of extra dependencies>)
+# ocv_add_accuracy_tests(<list of extra dependencies>)
 function(ocv_add_accuracy_tests)
   ocv_debug_message("ocv_add_accuracy_tests(" ${ARGN} ")")

@@ -1211,7 +1211,7 @@
       source_group("Src" FILES "${${the_target}_pch}")
       ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
       ocv_target_include_modules(${the_target} ${test_deps} "${test_path}")
-      ocv_target_link_libraries(${the_target} LINK_PRIVATE ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
+      ocv_target_link_libraries(${the_target} LINK_PRIVATE ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS} ${OPENCV_TEST_${the_module}_DEPS})
       add_dependencies(opencv_tests ${the_target})

       set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};AccuracyTest")


Implement QUIET for FindHWLOC

Implement QUIET for FindHWLOC

--- FindHWLOC.cmake
+++ FindHWLOC.cmake
@@ -12,11 +12,13 @@
   set(ENV{PKG_CONFIG_PATH} "${HWLOC_ROOT}/lib/pkgconfig")
 endif()

-if(NOT HWLOC_FIND_QUIETLY)
+if(HWLOC_FIND_QUIETLY)
+  set(_hwloc_QUIET QUIET)
+else()
   set(_hwloc_output 1)
 endif()

-pkg_check_modules(HWLOC hwloc)
+pkg_check_modules(HWLOC hwloc ${_hwloc_QUIET})

 if(HWLOC_FOUND)
   find_library(HWLOC_LIBRARY hwloc


Windows: fix build with MSYS2 (#743)

Windows: fix build with MSYS2 (#743)

--- third_party/skcms.cmake
+++ third_party/skcms.cmake
@@ -35,7 +35,7 @@
       PRIVATE /FI${CMAKE_CURRENT_SOURCE_DIR}/../lib/jxl/enc_jxl_skcms.h)
   else()
     target_compile_options(skcms-obj
-      PRIVATE -include${CMAKE_CURRENT_SOURCE_DIR}/../lib/jxl/enc_jxl_skcms.h)
+      PRIVATE -include ${CMAKE_CURRENT_SOURCE_DIR}/../lib/jxl/enc_jxl_skcms.h)
   endif()
 endif()


CSharp: Install samples to SDK.

CSharp: Install samples to SDK.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -183,7 +183,7 @@
 macro (add_sample TARGET)
     if ("${ARGN}" STREQUAL CSHARP)
         add_target_csharp(${TARGET} ${CMAKE_CURRENT_SOURCE_DIR}/${TARGET}.csproj Urho3DNet)
-        #install (FILES ${NET_OUTPUT_DIRECTORY}/${BIND_MANAGED_TARGET}.dll DESTINATION ${DEST_LIBRARY_DIR})
+        install (FILES ${CMAKE_BINARY_DIR}/${DEST_BIN_DIR_CONFIG}/${TARGET}.exe DESTINATION ${DEST_BIN_DIR})
     else ()
         file (GLOB SOURCE_FILES *.cpp *.h)
         if (NOT URHO3D_WIN32_CONSOLE)


STYLE: Capture stderr/stdout for eigen3 config

The eigen3 internal configuration was writting to
stderr and stdout which corrupted the ncurses
interface of ccmake.  Capture those items and
report as cmake info messages.

--- CMake/itkExternal_Eigen3.cmake
+++ CMake/itkExternal_Eigen3.cmake
@@ -49,9 +49,14 @@
     "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
     ${_additional_external_project_args}
     WORKING_DIRECTORY ${_eigen3_build_dir}
+    OUTPUT_VARIABLE ITKEigen3Config_STDOUT
+    ERROR_VARIABLE ITKEigen3Config_STDERR
     )
   set(ITKInternalEigen3_DIR ${_eigen3_build_dir})
   find_package( ITKInternalEigen3 )
+  if(NOT ITKInternalEigen3_FOUND)
+    message(FATAL_ERROR "ITKInternalEigen3 configuration faileed\nREPORT:\n${ITKEigen3Config_STDOUT}\n${ITKEigen3Config_STDERR}")
+  endif()
   install(CODE
   "execute_process(
     COMMAND


Fixed to pick debug or release version of TinyXML, also writing to TINYXML_LIBRARY instead of LIBRARIES

--- CMakeModules/FindTinyXML.cmake
+++ CMakeModules/FindTinyXML.cmake
@@ -3,7 +3,7 @@
 #
 # TINYXML_FOUND - True if TinyXML found.
 # TINYXML_INCLUDE_DIR - where to find tinyxml.h, etc.
-# TINYXML_LIBRARIES - List of libraries when using TinyXML.
+# TINYXML_LIBRARY - List of libraries when using TinyXML.
 #

 IF( TINYXML_INCLUDE_DIR )
@@ -15,11 +15,18 @@
   PATHS ${TINYXML_ROOT} ${TINYXML_ROOT}/tinyxml)

 IF(WIN32)
-  FIND_LIBRARY( TINYXML_LIBRARIES
+  FIND_LIBRARY( TINYXML_LIBRARY_RELEASE
     NAMES "tinyxml_STL"
     PATHS ${TINYXML_ROOT} ${TINYXML_ROOT}/Release_STL )
+  FIND_LIBRARY( TINYXML_LIBRARY_DEBUG
+    NAMES "tinyxmld_STL"
+    PATHS ${TINYXML_ROOT} ${TINYXML_ROOT}/Debug_STL )
+
+    #this is used to pick between RELEASE and DEBUG library
+    include(SelectLibraryConfigurations)
+    select_library_configurations(TINYXML)
 ELSE(WIN32)
-  FIND_LIBRARY( TINYXML_LIBRARIES
+  FIND_LIBRARY( TINYXML_LIBRARY
     NAMES "tinyxml"
     PATHS ${TINYXML_ROOT} )
 ENDIF(WIN32)
@@ -27,7 +34,7 @@
 # handle the QUIETLY and REQUIRED arguments and set TINYXML_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE( "FindPackageHandleStandardArgs" )
-FIND_PACKAGE_HANDLE_STANDARD_ARGS( "TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
+FIND_PACKAGE_HANDLE_STANDARD_ARGS( "TinyXML" DEFAULT_MSG TINYXML_INCLUDE_DIR TINYXML_LIBRARY )

-MARK_AS_ADVANCED( TINYXML_INCLUDE_DIR TINYXML_LIBRARIES )
+MARK_AS_ADVANCED( TINYXML_INCLUDE_DIR TINYXML_LIBRARY )


enable vicon-drc external

enable vicon-drc external

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -153,7 +153,7 @@
   fovis-git
   estimate-pose
   vicon
-  #vicon-drc
+  vicon-drc
   #camunits-wrapper
   #camunits-extra-wrapper
   apriltags


don't run the sim attribute test when threads are on - simModSuite is not thread safe

--- test/testing.cmake
+++ test/testing.cmake
@@ -333,8 +333,10 @@
   add_test(NAME chef8
     COMMAND diff -r -x .svn out_mesh/ good_mesh/
     WORKING_DIRECTORY ${MDIR})
-  set(MDIR ${MESHES}/phasta/simModelAndAttributes)
-  cook(chef9 ${CMAKE_CURRENT_BINARY_DIR}/chef 2 1 ${MDIR})
+  if(NOT ENABLE_THREADS)
+    set(MDIR ${MESHES}/phasta/simModelAndAttributes)
+    cook(chef9 ${CMAKE_CURRENT_BINARY_DIR}/chef 1 2 ${MDIR})
+  endif()
   set(MDIR ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20/run)
   add_test(NAME chefReadUrPrep
     COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4


Added audio/prs.sid MIME type (C64 SID tune).

--- MimeTypes.cmake
+++ MimeTypes.cmake
@@ -20,6 +20,7 @@
     audio/mpeg
     audio/mpeg2
     audio/mpeg3
+    audio/prs.sid
     audio/vnd.rn-realaudio
     audio/vnd.rn-realmedia
     audio/wav


Bump to Version-1.0.0

Bump to Version-1.0.0

Signed-off-by: Gopal, Puunithaaraj <10308ab826b56f8bbce1ec0c10bd609cace363da@intel.com>

--- cmake/ProjectInfo.cmake
+++ cmake/ProjectInfo.cmake
@@ -1,5 +1,5 @@
-set(GstMfx_VERSION_MAJOR   0)
-set(GstMfx_VERSION_MINOR   1)
+set(GstMfx_VERSION_MAJOR   1)
+set(GstMfx_VERSION_MINOR   0)
 set(GstMfx_VERSION_PATCH   0)
 set(GstMfx_PACKAGE         "gstmfx")
 set(GstMfx_PACKAGE_NAME    "GStreamer Media SDK")


CMake: Add comment for ivw_deploy_qt

CMake: Add comment for ivw_deploy_qt

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -953,6 +953,10 @@
     set(${retval} ${res} PARENT_SCOPE)
 endfunction()

+#-----------------------------------------------------------------------
+# Uses QT's windeployqt.exe to copy necessary QT-dependencies (dlls etc)
+# for the given target to the build folder.
+# Does nothing on platforms other than Windows.
 function(ivw_deploy_qt target)
     if(WIN32)
         find_program(WINDEPLOYQT_EXECUTABLE NAMES windeployqt HINTS ${QTDIR} ENV QTDIR PATH_SUFFIXES bin)
@@ -963,4 +967,4 @@
                             COMMAND ${WINDEPLOYQT_EXECUTABLE} --no-compiler-runtime --verbose 1 $<TARGET_FILE:${target}>
             )
     endif()
-endfunction()+endfunction()


Fix dependency evaluation

Fix dependency evaluation

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -110,10 +110,10 @@
         if(SUBSYS_EXT_DEPS)
         foreach(_dep ${SUBSYS_EXT_DEPS})
             string(TOUPPER "${_dep}_found" EXT_DEP_FOUND)
-            if(NOT ${EXT_DEP_FOUND} OR (NOT (${EXT_DEP_FOUND} STREQUAL "TRUE")))
+            if(NOT ${EXT_DEP_FOUND} AND (NOT (${EXT_DEP_FOUND} STREQUAL "TRUE")))
                 set(${_var} FALSE)
                 PCL_SET_SUBSYS_STATUS(${_name} FALSE "Requires external library ${_dep}.")
-            endif(NOT ${EXT_DEP_FOUND} OR (NOT (${EXT_DEP_FOUND} STREQUAL "TRUE")))
+            endif(NOT ${EXT_DEP_FOUND} AND (NOT (${EXT_DEP_FOUND} STREQUAL "TRUE")))
         endforeach(_dep)
         endif(SUBSYS_EXT_DEPS)
         if(SUBSYS_OPT_DEPS)
@@ -165,10 +165,10 @@
         if(SUBSUBSYS_EXT_DEPS)
         foreach(_dep ${SUBSUBSYS_EXT_DEPS})
             string(TOUPPER "${_dep}_found" EXT_DEP_FOUND)
-            if(NOT ${EXT_DEP_FOUND} OR (NOT ("${EXT_DEP_FOUND}" STREQUAL "TRUE")))
+            if(NOT ${EXT_DEP_FOUND} AND (NOT ("${EXT_DEP_FOUND}" STREQUAL "TRUE")))
                 set(${_var} FALSE)
                 PCL_SET_SUBSYS_STATUS(${_parent}_${_name} FALSE "Requires external library ${_dep}.")
-            endif(NOT ${EXT_DEP_FOUND} OR (NOT ("${EXT_DEP_FOUND}" STREQUAL "TRUE")))
+            endif(NOT ${EXT_DEP_FOUND} AND (NOT ("${EXT_DEP_FOUND}" STREQUAL "TRUE")))
         endforeach(_dep)
         endif(SUBSUBSYS_EXT_DEPS)
     endif(${_var} AND (NOT ("${subsys_status}" STREQUAL "AUTO_OFF")))


Fixed mistakes in last change.

Fixed mistakes in last change.

--- Tests/VisualTests/PostTest.cmake
+++ Tests/VisualTests/PostTest.cmake
@@ -8,9 +8,10 @@

 if (UNIX)
   # escape spaces
-  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
+  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOME}")
 elseif (WIN32)
-  string(REPLACE "\\" "/" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
+  # make sure we've got backslashes
+  string(REPLACE "/" "\\" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 # other platforms?
 endif ()

@@ -18,6 +19,6 @@
 if (UNIX)
   exec_program("rm ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
 elseif (WIN32)
-  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\TestResults_*RenderingSubsystem.txt\"")
+  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\\TestResults_*RenderingSubsystem.txt\"")
 # other platforms?
 endif ()


XGBoost: remove a workaround made obsolete by the bug being fixed upstream.

--- VAD_XGBoost.cmake
+++ VAD_XGBoost.cmake
@@ -12,7 +12,7 @@
   add_library(_VAD_XGBoost_STUB INTERFACE)
   list(APPEND _XGBoost_INCLUDE_DIRS "${VAD_EXTERNAL_ROOT}/XGBoost/include" "${VAD_EXTERNAL_ROOT}/XGBoost/dmlc-core/include" "${VAD_EXTERNAL_ROOT}/XGBoost/rabit/include")
   set_property(TARGET _VAD_XGBoost_STUB PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_XGBoost_INCLUDE_DIRS})
-  set_property(TARGET _VAD_XGBoost_STUB PROPERTY INTERFACE_LINK_LIBRARIES rabit libxgboost dmlccore)
+  set_property(TARGET _VAD_XGBoost_STUB PROPERTY INTERFACE_LINK_LIBRARIES rabit xgboost dmlccore)

   add_library(XGBoost::XGBoost ALIAS _VAD_XGBoost_STUB)
 endfunction()


updated findcyclopts.cmake to reflect include folder. deleted my cmakecache but had to blast the build dir to find that bug..

--- examples/src/CMake/FindCYCLOPTS.cmake
+++ examples/src/CMake/FindCYCLOPTS.cmake
@@ -1,6 +1,11 @@

+# if installed in a non-standard location,
+# the include directory must be added to the PATH variable
 FIND_PATH(CYCLOPTS_INCLUDE_DIR cyclopts/Variable.h
 )
+
+set(CYCLOPTS_INCLUDE_DIR ${CYCLOPTS_INCLUDE_DIR}/cyclopts)
+#MESSAGE("\tCYCLOPTS Include Dir: ${CYCLOPTS_INCLUDE_DIR}")

 FIND_LIBRARY(CYCLOPTS_LIBRARY
   NAMES cyclopts libcyclopts


COMP: fixed hashtag

COMP: fixed hashtag

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

 if(BUILD_TESTING)

-  set(revision_tag 7c04beab)
+  set(revision_tag d383b3f5)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


Add Paths to FindOpenCL for linux

Add Paths to FindOpenCL for linux

* Was failing to find OpenCL_LIBRARY with AMDAPPSDK 3.0

--- CMakeModules/FindOpenCL.cmake
+++ CMakeModules/FindOpenCL.cmake
@@ -34,23 +34,23 @@
 # Copyright 2000-2014 Kitware, Inc.
 # Copyright 2000-2011 Insight Software Consortium
 # All rights reserved.
-#
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions
 # are met:
-#
+#
 # * Redistributions of source code must retain the above copyright
 # notice, this list of conditions and the following disclaimer.
-#
+#
 # * Redistributions in binary form must reproduce the above copyright
 # notice, this list of conditions and the following disclaimer in the
 # documentation and/or other materials provided with the distribution.
-#
+#
 # * Neither the names of Kitware, Inc., the Insight Software Consortium,
 # nor the names of their contributors may be used to endorse or promote
 # products derived from this software without specific prior written
 # permission.
-#
+#
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -149,7 +149,29 @@
   endif()
 else()
   find_library(OpenCL_LIBRARY
-    NAMES OpenCL)
+    NAMES OpenCL
+    PATHS
+        ENV LD_LIBRARY_PATH
+        ENV AMDAPPSDKROOT
+        ENV INTELOCLSDKROOT
+        ENV CUDA_PATH
+        ENV NVSDKCOMPUTE_ROOT
+        ENV ATISTREAMSDKROOT
+        /usr/lib64
+        /usr/lib
+        /usr/local/lib64
+        /usr/local/lib
+        /sw/lib
+        /opt/local/lib
+    PATH_SUFFIXES
+        "AMD APP/lib/x86_64"
+        lib/x86_64
+        lib/x64
+        lib/
+        lib64/
+        x86_64-linux-gnu
+        arm-linux-gnueabihf
+    )
 endif()

 set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})


adjusted diffusion app plugins

adjusted diffusion app plugins

--- CMake/BuildConfigurations/mitkDiffusion.cmake
+++ CMake/BuildConfigurations/mitkDiffusion.cmake
@@ -58,18 +58,14 @@
   org.mitk.gui.qt.segmentation
   org.mitk.gui.qt.volumevisualization
   org.mitk.gui.qt.diffusionimaging
-  org.mitk.gui.qt.diffusionimaging.connectomics
-  org.mitk.gui.qt.diffusionimaging.denoising
   org.mitk.gui.qt.diffusionimaging.fiberfox
   org.mitk.gui.qt.diffusionimaging.fiberprocessing
   org.mitk.gui.qt.diffusionimaging.ivim
   org.mitk.gui.qt.diffusionimaging.odfpeaks
-  org.mitk.gui.qt.diffusionimaging.partialvolume
   org.mitk.gui.qt.diffusionimaging.preprocessing
   org.mitk.gui.qt.diffusionimaging.reconstruction
-  org.mitk.gui.qt.diffusionimaging.registration
-  org.mitk.gui.qt.diffusionimaging.tbss
   org.mitk.gui.qt.diffusionimaging.tractography
+  org.mitk.gui.qt.diffusionimaging.connectomics
   org.mitk.gui.qt.imagenavigator
   org.mitk.gui.qt.moviemaker
   org.mitk.gui.qt.basicimageprocessing


made rendering tests custom only

made rendering tests custom only

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -72,14 +72,6 @@
   mitkPropertyDescriptionsTest.cpp
   mitkPropertyExtensionsTest.cpp
   mitkPropertyFiltersTest.cpp
-  mitkLabelOverlay3DRendering2DTest.cpp
-  mitkLabelOverlay3DRendering3DTest.cpp
-  mitkTextOverlay2DRenderingTest.cpp
-  mitkTextOverlay2DLayouterRenderingTest.cpp
-  #mitkTextOverlay2DSymbolsRenderingTest.cpp
-  mitkTextOverlay3DRendering2DTest.cpp
-  mitkTextOverlay3DRendering3DTest.cpp
-  mitkTextOverlay3DColorRenderingTest.cpp
 )

 # test with image filename as an extra command line parameter
@@ -138,6 +130,13 @@
     mitkPointSetVtkMapper2DTest.cpp
     mitkPointSetVtkMapper2DImageTest.cpp
     mitkPointSetVtkMapper2DGlyphTypeTest.cpp
+    mitkLabelOverlay3DRendering2DTest.cpp
+    mitkLabelOverlay3DRendering3DTest.cpp
+    mitkTextOverlay2DRenderingTest.cpp
+    mitkTextOverlay2DLayouterRenderingTest.cpp
+    mitkTextOverlay3DRendering2DTest.cpp
+    mitkTextOverlay3DRendering3DTest.cpp
+    mitkTextOverlay3DColorRenderingTest.cpp
 )

 set(MODULE_RESOURCE_FILES


Updated to develop FW

Updated to develop FW

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "cd9d9c66a6000f9cedd16d64ae243aa56ab119d1")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "33ff0b2b5287df25573690438374f44a59529429")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


set template depth on MAC OS

set template depth on MAC OS

--- cmake/checks/check_02_system_features.cmake
+++ cmake/checks/check_02_system_features.cmake
@@ -89,6 +89,12 @@
   # TODO: MM: Check whether this is still necessary...
   #
   STRIP_FLAG(DEAL_II_LINKER_FLAGS "-rdynamic")
+
+  #
+  # At least on Clang 5.0.0 the template depth is set to 128, which is too low
+  # to compile parts of the library. Fix this by setting a large value.
+  #
+  ENABLE_IF_SUPPORTED(DEAL_II_CXX_FLAGS "-ftemplate-depth=1024")
 ENDIF()


Create /include before a link

Create /include before a link

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1302,6 +1302,7 @@
   endif()
   if(Vc_FOUND)
     # FIXME - The altenative is to add include_dirs to all packages that include any Math headers
+    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include)
     execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${Vc_INCLUDE_DIR}/Vc ${CMAKE_BINARY_DIR}/include/Vc)
   endif()
 endif()
@@ -1380,6 +1381,7 @@
   endif()
   if(VecCore_FOUND)
     # FIXME - The altenative is to add include_dirs to all packages that include any Math headers
+    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include)
     execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${VecCore_INCLUDE_DIR}/VecCore ${CMAKE_BINARY_DIR}/include/VecCore)
   endif()
 endif()


Update build recipe for Vc external project

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1,6 +1,8 @@
 #---Check for installed packages depending on the build options/components eamnbled -
 include(ExternalProject)
 include(FindPackageHandleStandardArgs)
+
+set(lcgpackages http://lcgpackages.web.cern.ch/lcgpackages/tarFiles/sources)
 set(repository_tarfiles http://service-spi.web.cern.ch/service-spi/external/tarFiles)

 #---On MacOSX, try to find frameworks after standard libraries or headers------------
@@ -1252,38 +1254,68 @@
 endif()

 #---Check for Vc---------------------------------------------------------------------
-if(vc OR builtin_vc)
-  if(NOT builtin_vc)
-    message(STATUS "Looking for Vc")
-    find_package(Vc 1.0 CONFIG QUIET)
+if(builtin_vc)
+  unset(Vc_FOUND)
+  unset(Vc_FOUND CACHE)
+  set(vc ON CACHE BOOL "" FORCE)
+elseif(vc)
+  if(fail-on-missing)
+    find_package(Vc 1.3.0 CONFIG QUIET REQUIRED)
+  else()
+    find_package(Vc 1.3.0 CONFIG QUIET)
     if(NOT Vc_FOUND)
-      if(fail-on-missing)
-        message(FATAL_ERROR "Vc not found. Ensure that the installation of Vc is in the CMAKE_PREFIX_PATH")
-      else()
-        message(STATUS "Vc not found. Ensure that the installation of Vc is in the CMAKE_PREFIX_PATH")
-        message(STATUS "              Alternatively, you can also enable the option 'builtin_vc' to build the Vc libraries internally")
-        message(STATUS "              For the time being switching OFF 'vc' option")
-        set(vc OFF CACHE BOOL "" FORCE)
-      endif()
-    endif()
-    set(VC_INCLUDE_DIRS ${Vc_INCLUDE_DIR})    # Missing from VcConfig.cmake
-    set(VC_LIBRARIES ${Vc_LIBRARIES})         # ROOT project name is "VC"; upstream uses "Vc".
-  endif()
-  if(builtin_vc)
-    set(vc_version 1.1.0)
-    set(VC_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX})
-    ExternalProject_Add(
-      VC
-      URL ${repository_tarfiles}/Vc-${vc_version}.tar.gz
-      INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-      LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
-      BUILD_BYPRODUCTS ${VC_LIBRARIES}
-    )
-    set(VC_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include)
-    set(VC_TARGET VC)
-    set(vc ON CACHE BOOL "" FORCE)
-  endif()
+      message(STATUS  "Vc library not found, support for it disabled.")
+      message(STATUS  "Please enable the option 'builtin_vc' to build Vc internally.")
+      set(vc OFF CACHE BOOL "" FORCE)
+    endif()
+  endif()
+endif()
+
+if(vc AND NOT Vc_FOUND)
+  set(Vc_VERSION "1.3.0")
+  set(Vc_PROJECT "Vc-${Vc_VERSION}")
+  set(Vc_SRC_URI "${lcgpackages}/${Vc_PROJECT}.tar.gz")
+  set(Vc_SRC_MD5 "a248e904f0b1a330ad8f37ec50cbad30")
+  set(Vc_DESTDIR "${CMAKE_BINARY_DIR}/externals/install/${Vc_PROJECT}")
+  set(Vc_ROOTDIR "${Vc_DESTDIR}/${CMAKE_INSTALL_PREFIX}")
+  set(Vc_LIBNAME "${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  set(Vc_LIBRARY "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/${Vc_LIBNAME}")
+
+  ExternalProject_Add(${Vc_PROJECT}
+    PREFIX externals
+    URL     ${Vc_SRC_URI}
+    URL_MD5 ${Vc_SRC_MD5}
+    BUILD_IN_SOURCE 0
+    BUILD_BYPRODUCTS ${Vc_LIBRARY}
+    CMAKE_ARGS -G ${CMAKE_GENERATOR}
+               -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+               -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+               -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
+               -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+               -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+               -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+    INSTALL_COMMAND env DESTDIR=${Vc_DESTDIR} ${CMAKE_COMMAND} --build . --target install
+  )
+
+  add_library(Vc STATIC IMPORTED)
+  set_property(TARGET Vc PROPERTY IMPORTED_LOCATION ${Vc_LIBRARY})
+  add_dependencies(Vc ${Vc_PROJECT})
+
+  set(Vc_LIBRARIES Vc)
+  set(Vc_INCLUDE_DIR "${Vc_ROOTDIR}/include")
+  set(Vc_CMAKE_MODULES_DIR "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/cmake/Vc")
+
+  find_package_handle_standard_args(Vc
+    FOUND_VAR Vc_FOUND
+    REQUIRED_VARS Vc_INCLUDE_DIR Vc_LIBRARIES Vc_CMAKE_MODULES_DIR
+    VERSION_VAR Vc_VERSION)
+
+  install(DIRECTORY ${Vc_ROOTDIR}/ DESTINATION ".")
+endif()
+
+if(Vc_FOUND)
+	# Missing from VcConfig.cmake
+	set(Vc_INCLUDE_DIRS ${Vc_INCLUDE_DIR})
 endif()

 #---Check for Vdt--------------------------------------------------------------------


new macro didnt install wrappers

new macro didnt install wrappers

--- CMake/mitkMacroInstallPython.cmake
+++ CMake/mitkMacroInstallPython.cmake
@@ -46,11 +46,7 @@
 function(MITK_INSTALL_VTK_PYTHON)
   find_package(VTK REQUIRED)

-  # all libs with a python loader module and
-  # wrapping related libraries
-  set(_VTK_PYTHON_TARGETS
-      vtkWrappingPythonCore
-      vtkWrappingTools )
+  set(_VTK_PYTHON_TARGETS )

   # find all vtk python wrapped targets
   foreach(_lib ${VTK_LIBRARIES})
@@ -58,7 +54,7 @@
     if(${_lib} MATCHES "^vtk.+")
       # use only python wrapped modules
       if(TARGET ${_lib}PythonD)
-        list(APPEND _VTK_PYTHON_TARGETS ${_lib}PythonD)
+        list(APPEND _VTK_PYTHON_TARGETS ${_lib}Python)
       endif()
     endif()
   endforeach()
@@ -66,15 +62,18 @@
   # install the python modules and loaders
   foreach(_target ${_VTK_PYTHON_TARGETS})
     # get target properties
-    get_target_property(_target_lib_debug   "${_target}" IMPORTED_LOCATION_DEBUG)
-    get_target_property(_target_lib_release "${_target}" IMPORTED_LOCATION_RELEASE)
+    get_target_property(_target_lib_debug   "${_target}D" IMPORTED_LOCATION_DEBUG)
+    get_filename_component(_filepath_debug "${_target_lib_debug}" PATH)
+    get_target_property(_target_lib_release "${_target}D" IMPORTED_LOCATION_RELEASE)
+    get_filename_component(_filepath_release "${_target_lib_release}" PATH)

+    MESSAGE("${_filepath_debug}/${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}")
     if(_target_lib_debug)
-      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_target_lib_debug}" "Debug")
+      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_filepath_debug}/${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}" "Debug")
     endif()

     if(_target_lib_release)
-      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_target_lib_release}" "Release")
+      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_filepath_release}/$${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}" "Release")
     endif()
   endforeach()


Fixed spacing of message

Fixed spacing of message

--- CMakeModules/FindOpenThreads.cmake
+++ CMakeModules/FindOpenThreads.cmake
@@ -60,6 +60,6 @@
 SET(OPENTHREADS_FOUND "NO")
 IF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)
 	SET(OPENTHREADS_FOUND "YES")
-        MESSAGE("---Found OpenThreads: "${OPENTHREADS_LIBRARY})
+        MESSAGE("-- Found OpenThreads: "${OPENTHREADS_LIBRARY})
 ENDIF(OPENTHREADS_INCLUDE_DIR AND OPENTHREADS_LIBRARY)


FindVOTCA_TOOLS.cmake: fixed a typo

FindVOTCA_TOOLS.cmake: fixed a typo

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -54,7 +54,7 @@
   include(CheckLibraryExists)
   check_library_exists("${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" VotcaToolsFromC "" FOUND_VOTCA_TOOLS_VERSION)
   if(NOT FOUND_VOTCA_TOOLS_VERSION)
-    message(FATAL_ERROR "Could not find VotcaToolsFromC in ${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set VOTCA_TOOLS_LIBRARY and VOTCA_TOOLS_DEP_LIBRARIES by hand, which set votca_tools lib  it's depencies (i.e. -DVOTCA_TOOLS_LIBRARY='/path/to/libvotca_tools.so" -VOTCA_TOOLS_DEP_LIBRARIES="/path/to/libgsl.so;/path/to/libm.so') !")
+    message(FATAL_ERROR "Could not find VotcaToolsFromC in ${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}, take look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you don't have pkg-config installed you will most likely have to set VOTCA_TOOLS_LIBRARY and VOTCA_TOOLS_DEP_LIBRARIES by hand, which set votca_tools lib  it's depencies (i.e. -DVOTCA_TOOLS_LIBRARY='/path/to/libvotca_tools.so' -DVOTCA_TOOLS_DEP_LIBRARIES='/path/to/libgsl.so;/path/to/libm.so') !")
   endif(NOT FOUND_VOTCA_TOOLS_VERSION)
 endif (VOTCA_TOOLS_FOUND)


more clang/gcc conditional warning suppression

--- rosidl_typesupport_connext_cpp/cmake/rosidl_typesupport_connext_cpp_generate_interfaces.cmake
+++ rosidl_typesupport_connext_cpp/cmake/rosidl_typesupport_connext_cpp_generate_interfaces.cmake
@@ -68,11 +68,18 @@

 # If not on Windows, disable some warnings with Connext's generated code
 if(NOT WIN32)
-  set(_connext_compile_flags
-    "-Wno-tautological-compare "
-    "-Wno-return-type-c-linkage "
-    "-Wno-deprecated-register "
-  )
+  if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    set(_connext_compile_flags
+      "-Wno-tautological-compare "
+      "-Wno-return-type-c-linkage "
+      "-Wno-deprecated-register "
+    )
+  elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+    set(_connext_compile_flags
+      "-Wno-unused-variable "
+      "-Wno-unused-but-set-variable "
+    )
+  endif()
   string(REPLACE ";" " " _connext_compile_flags ${_connext_compile_flags})
   foreach(_gen_file ${_generated_msg_files} ${_generated_srv_files})
     set_source_files_properties("${_gen_file}"


ARROW-4052: [C++] Linker errors with glog and gflags

After #3196, a potential bug appears.
If we use glog installed instead of downloading one at build time and the installed glog is linked to gflags, linker error can be occurred.

I modified ThirdpartyToolchain.cmake to add a dependency from glog to gflag.

Author: Kousuke Saruta <sarutak@oss.nttdata.com>

Closes #3234 from sarutak/ARROW-4052 and squashes the following commits:

3c65cbee6 <Kousuke Saruta> Modified ThirdpartyToolchain.cmake to add a dependency from glog to gflag

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -534,10 +534,67 @@
 message(STATUS "double-conversion static library: ${DOUBLE_CONVERSION_STATIC_LIB}")

 # ----------------------------------------------------------------------
-# Google gtest & gflags
-
-if(ARROW_BUILD_TESTS OR ARROW_GANDIVA_BUILD_TESTS
-   OR ARROW_BUILD_BENCHMARKS)
+# gflags
+
+if(ARROW_BUILD_TESTS OR
+   ARROW_BUILD_BENCHMARKS OR
+   (ARROW_USE_GLOG AND GLOG_HOME))
+  # gflags (formerly Googleflags) command line parsing
+  if("${GFLAGS_HOME}" STREQUAL "")
+    set(GFLAGS_CMAKE_CXX_FLAGS ${EP_CXX_FLAGS})
+
+    set(GFLAGS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gflags_ep-prefix/src/gflags_ep")
+    set(GFLAGS_HOME "${GFLAGS_PREFIX}")
+    set(GFLAGS_INCLUDE_DIR "${GFLAGS_PREFIX}/include")
+    if(MSVC)
+      set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/gflags_static.lib")
+    else()
+      set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/libgflags.a")
+    endif()
+    set(GFLAGS_VENDORED 1)
+    set(GFLAGS_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+                          -DCMAKE_INSTALL_PREFIX=${GFLAGS_PREFIX}
+                          -DBUILD_SHARED_LIBS=OFF
+                          -DBUILD_STATIC_LIBS=ON
+                          -DBUILD_PACKAGING=OFF
+                          -DBUILD_TESTING=OFF
+                          -DBUILD_CONFIG_TESTS=OFF
+                          -DINSTALL_HEADERS=ON
+                          -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}
+                          -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS}
+                          -DCMAKE_CXX_FLAGS=${GFLAGS_CMAKE_CXX_FLAGS})
+
+    ExternalProject_Add(gflags_ep
+      URL ${GFLAGS_SOURCE_URL}
+      ${EP_LOG_OPTIONS}
+      BUILD_IN_SOURCE 1
+      BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
+      CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
+  else()
+    set(GFLAGS_VENDORED 0)
+    find_package(GFlags REQUIRED)
+  endif()
+
+  message(STATUS "GFlags include dir: ${GFLAGS_INCLUDE_DIR}")
+  message(STATUS "GFlags static library: ${GFLAGS_STATIC_LIB}")
+  include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR})
+  ADD_THIRDPARTY_LIB(gflags
+    STATIC_LIB ${GFLAGS_STATIC_LIB})
+  if(MSVC)
+    set_target_properties(gflags_static
+      PROPERTIES
+      INTERFACE_LINK_LIBRARIES "shlwapi.lib")
+  endif()
+
+  if(GFLAGS_VENDORED)
+    add_dependencies(gflags_static gflags_ep)
+  endif()
+endif()
+
+# ----------------------------------------------------------------------
+# Google gtest
+
+if(ARROW_BUILD_TESTS OR ARROW_BUILD_BENCHMARKS)
   if("${GTEST_HOME}" STREQUAL "")
     if(APPLE)
       set(GTEST_CMAKE_CXX_FLAGS "-fPIC -DGTEST_USE_OWN_TR1_TUPLE=1 -Wno-unused-value -Wno-ignored-attributes")
@@ -582,57 +639,6 @@
   if(GTEST_VENDORED)
     add_dependencies(gtest_static googletest_ep)
     add_dependencies(gtest_main_static googletest_ep)
-  endif()
-
-  # gflags (formerly Googleflags) command line parsing
-  if("${GFLAGS_HOME}" STREQUAL "")
-    set(GFLAGS_CMAKE_CXX_FLAGS ${EP_CXX_FLAGS})
-
-    set(GFLAGS_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/gflags_ep-prefix/src/gflags_ep")
-    set(GFLAGS_HOME "${GFLAGS_PREFIX}")
-    set(GFLAGS_INCLUDE_DIR "${GFLAGS_PREFIX}/include")
-    if(MSVC)
-      set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/gflags_static.lib")
-    else()
-      set(GFLAGS_STATIC_LIB "${GFLAGS_PREFIX}/lib/libgflags.a")
-    endif()
-    set(GFLAGS_VENDORED 1)
-    set(GFLAGS_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-                          -DCMAKE_INSTALL_PREFIX=${GFLAGS_PREFIX}
-                          -DBUILD_SHARED_LIBS=OFF
-                          -DBUILD_STATIC_LIBS=ON
-                          -DBUILD_PACKAGING=OFF
-                          -DBUILD_TESTING=OFF
-                          -DBUILD_CONFIG_TESTS=OFF
-                          -DINSTALL_HEADERS=ON
-                          -DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}
-                          -DCMAKE_C_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_C_FLAGS}
-                          -DCMAKE_CXX_FLAGS=${GFLAGS_CMAKE_CXX_FLAGS})
-
-    ExternalProject_Add(gflags_ep
-      URL ${GFLAGS_SOURCE_URL}
-      ${EP_LOG_OPTIONS}
-      BUILD_IN_SOURCE 1
-      BUILD_BYPRODUCTS "${GFLAGS_STATIC_LIB}"
-      CMAKE_ARGS ${GFLAGS_CMAKE_ARGS})
-  else()
-    set(GFLAGS_VENDORED 0)
-    find_package(GFlags REQUIRED)
-  endif()
-
-  message(STATUS "GFlags include dir: ${GFLAGS_INCLUDE_DIR}")
-  message(STATUS "GFlags static library: ${GFLAGS_STATIC_LIB}")
-  include_directories(SYSTEM ${GFLAGS_INCLUDE_DIR})
-  ADD_THIRDPARTY_LIB(gflags
-    STATIC_LIB ${GFLAGS_STATIC_LIB})
-  if(MSVC)
-    set_target_properties(gflags_static
-      PROPERTIES
-      INTERFACE_LINK_LIBRARIES "shlwapi.lib")
-  endif()
-
-  if(GFLAGS_VENDORED)
-    add_dependencies(gflags_static gflags_ep)
   endif()
 endif()

@@ -1506,10 +1512,14 @@
   message(STATUS "Glog static library: ${GLOG_STATIC_LIB}")

   include_directories(SYSTEM ${GLOG_INCLUDE_DIR})
-  ADD_THIRDPARTY_LIB(glog
-    STATIC_LIB ${GLOG_STATIC_LIB})

   if (GLOG_VENDORED)
+    ADD_THIRDPARTY_LIB(glog
+      STATIC_LIB ${GLOG_STATIC_LIB})
     add_dependencies(glog_static glog_ep)
-  endif()
-endif()
+  else()
+    ADD_THIRDPARTY_LIB(glog
+      STATIC_LIB ${GLOG_STATIC_LIB}
+      DEPS gflags_static)
+  endif()
+endif()


DataTypes.h.cmake (MSVC): Protect some #define's and use specific
suffixes for integer types.

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

--- include/llvm/System/DataTypes.h.cmake
+++ include/llvm/System/DataTypes.h.cmake
@@ -109,41 +109,59 @@
 typedef signed char int8_t;
 typedef unsigned char uint8_t;
 typedef signed int ssize_t;
-#define INT8_MAX 127
-#define INT8_MIN -128
-#define UINT8_MAX 255
-#define INT16_MAX 32767
-#define INT16_MIN -32768
-#define UINT16_MAX 65535
-#define INT32_MAX 2147483647
-#define INT32_MIN -2147483648
-#define UINT32_MAX 4294967295U
+#ifndef INT8_MAX
+# define INT8_MAX 127
+#endif
+#ifndef INT8_MIN
+# define INT8_MIN -128
+#endif
+#ifndef UINT8_MAX
+# define UINT8_MAX 255
+#endif
+#ifndef INT16_MAX
+# define INT16_MAX 32767
+#endif
+#ifndef INT16_MIN
+# define INT16_MIN -32768
+#endif
+#ifndef UINT16_MAX
+# define UINT16_MAX 65535
+#endif
+#ifndef INT32_MAX
+# define INT32_MAX 2147483647
+#endif
+#ifndef INT32_MIN
+# define INT32_MIN -2147483648
+#endif
+#ifndef UINT32_MAX
+# define UINT32_MAX 4294967295U
+#endif
 /* Certain compatibility updates to VC++ introduce the `cstdint'
  * header, which defines the INT*_C macros. On default installs they
  * are absent. */
 #ifndef INT8_C
-# define INT8_C(C)   C
+# define INT8_C(C)   C##i8
 #endif
 #ifndef UINT8_C
-# define UINT8_C(C)  C
+# define UINT8_C(C)  C##ui8
 #endif
 #ifndef INT16_C
-# define INT16_C(C)  C
+# define INT16_C(C)  C##i16
 #endif
 #ifndef UINT16_C
-# define UINT16_C(C) C
+# define UINT16_C(C) C##ui16
 #endif
 #ifndef INT32_C
-# define INT32_C(C)  C
+# define INT32_C(C)  C##i32
 #endif
 #ifndef UINT32_C
-# define UINT32_C(C) C ## U
+# define UINT32_C(C) C##ui32
 #endif
 #ifndef INT64_C
-# define INT64_C(C)  ((int64_t) C ## LL)
+# define INT64_C(C)  C##i64
 #endif
 #ifndef UINT64_C
-# define UINT64_C(C) ((uint64_t) C ## ULL)
+# define UINT64_C(C) C##ui64
 #endif
 #endif /* _MSC_VER */


Fix Cmake settings

Fix Cmake settings

--- src/Common.cmake
+++ src/Common.cmake
@@ -1,13 +1,13 @@
 # Common.cmake

 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Clang|GNU|Intel)")
-	set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall -W -msse2 -fno-rtti -pthread")
-	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Ofast -DNDEBUG -fno-exceptions")
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -W -msse2 -fno-rtti -pthread")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Ofast -DNDEBUG -fno-exceptions")
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /WX- /nologo /D WIN32 /D _CONSOLE /Oy- /Gm- /Gd /GS- /MT /fp:precise /arch:SSE2")
-	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Ox /Ot /D NDEBUG")
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Zi /Od /D")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /Ot /D NDEBUG")
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Zi /Od /D")
 	find_library(WSOCK32_LIBRARY wsock32)
 endif()


ENH: Update Hippo options

ENH: Update Hippo options

--- Hippo_Kitware_TubeTK_Nightly.cmake
+++ Hippo_Kitware_TubeTK_Nightly.cmake
@@ -174,11 +174,6 @@
 set( CMAKE_GENERATOR "${SITE_CMAKE_GENERATOR}" )
 set( QT_QMAKE_EXECUTABLE "${SITE_QMAKE_COMMAND}" )

-set( TubeTK_USE_CTK ${SITE_USE_CTK} )
-set( TubeTK_USE_QT ${SITE_USE_QT} )
-set( TubeTK_USE_SimpleITK ${SITE_USE_SIMPLEITK} )
-set( TubeTK_USE_VTK ${SITE_USE_VTK} )
-
 if( NOT EXISTS "${TUBETK_SOURCE_DIR}/CMakeLists.txt" )
   execute_process( COMMAND "${SITE_GIT_COMMAND}" clone "${TUBETK_GIT_REPOSITORY}" "${TUBETK_SOURCE_DIR}" )
   ctest_run_script()


ENH: Upgrade version of TubeTK

ENH: Upgrade version of TubeTK

This new version of TubeTK features
* Directory structure and build process mirrors ITKModuleTemplate
* Builds without special requirements beyond -DModule_TubeTK=On
* Does not rely on LibSVM or RandomForest - those options are now
   eliminated because they did not add functionality
* Improved example scripts
* Only builds one library (TubeTK) - eliminating other TubeTKLibs
   enables  packaging, installation, and usage outide of ITK

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -49,5 +49,5 @@
 "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG 707fa9f67d073739a14cd9b3d05b680271022240
+  GIT_TAG "a570e993fca02ffa0019c9f23f99239c8b3cae97"
   )


cmake: quote optimization flag for compiler check

Reference: https://github.com/stnava/ANTs/issues/234
Signed-off-by: Igor Gnatenko <c869b0bfe2cf1da26c2efd33f6d6d74ddcbbdd2b@gmail.com>

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -278,7 +278,7 @@
     set(ITK_CXX_DISABLE_OPTIMIZATION_FLAG "-O0")
   endif()
   if(DEFINED ITK_CXX_DISABLE_OPTIMIZATION_FLAG)
-    CHECK_CXX_SOURCE_COMPILES(${ITK_CXX_DISABLE_OPTIMIZATION_FLAG} CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
+    CHECK_CXX_SOURCE_COMPILES("${ITK_CXX_DISABLE_OPTIMIZATION_FLAG}" CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
   endif()
 endmacro()#End the platform check function


COMP: Remove unnecessary clang compiler option

With the commit of the patch http://review.source.kitware.com/#/c/6025/
"COMP: Avoid C++0x constexpr error" the suppression
of this class of compiler warnings is no longer necessary
on the clang compiler. The code is now compliant with the
C++ standard without special compiler extensions.

Change-Id: I025e69e8b1e9a1fabffd1bbbdf5af0c9329cc2e9

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -275,13 +275,6 @@
   if(DEFINED ITK_CXX_DISABLE_OPTIMIZATION_FLAG)
     CHECK_CXX_SOURCE_COMPILES(${ITK_CXX_DISABLE_OPTIMIZATION_FLAG} CXX_HAS_DISABLE_OPTIMIZATION_FLAG)
   endif()
-
-  #----------------------------------------------------------------------------
-  # Allowing GNU extensions with CLang throws a zillion warnings in vnl_math.h
-  # which has (optionally) in-class const float member variable initialization
-  if(${CMAKE_CXX_COMPILER} MATCHES "clang.*$")
-    set(ITK_REQUIRED_CXX_FLAGS "${ITK_REQUIRED_CXX_FLAGS} -Werror=gnu")
-  endif()
 endmacro()#End the platform check function

 #-----------------------------------------------------------------------------


For Travis CI - revert back the multiplier as it is still not enough. Instead set the EMRUN timeout to the maximum value possible before the testing process being timeout by Travis CI itself.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -1127,7 +1127,13 @@
         endif ()
         list (APPEND ARG_OPTIONS -timeout ${URHO3D_TEST_TIMEOUT})
         if (EMSCRIPTEN)
-            math (EXPR EMRUN_TIMEOUT "5 * ${URHO3D_TEST_TIMEOUT}")
+            if (DEFINED ENV{CI})
+                # The latency on Travis CI server could be very high at time, so set it to the maximum allowed by Travis CI before the process being timed out by Travis CI itself
+                set (EMRUN_TIMEOUT 590)     # 10 minutes (Travis CI timeout) - 10 seconds
+            else ()
+                # Non-CI test
+                math (EXPR EMRUN_TIMEOUT "2 * ${URHO3D_TEST_TIMEOUT}")
+            endif ()
             add_test (NAME ${ARG_NAME} COMMAND ${EMRUN} --browser ${EMSCRIPTEN_EMRUN_BROWSER} --timeout ${EMRUN_TIMEOUT} --timeout_returncode 1 --kill_exit ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET_NAME}.html ${ARG_OPTIONS})
         else ()
             add_test (NAME ${ARG_NAME} COMMAND ${TARGET_NAME} ${ARG_OPTIONS})


PKG: check MVD and OTB dependencies only if OTB_OF_SOURCE_BUILD is false

--- SuperBuild/Packaging/PMacros.cmake
+++ SuperBuild/Packaging/PMacros.cmake
@@ -57,18 +57,27 @@
       COMMAND ${CMAKE_COMMAND} --build "." --target install
       WORKING_DIRECTORY "${Monteverdi_BINARY_DIR}"
       )
-  else() #Unxies Using SuperBuild
-    if(ENABLE_MONTEVERDI)
+  else() #Using SuperBuild
+    #For out of source build,
+    #we assume the otb is built correctly with superbuild
+    if(OUT_OF_SOURCE_BUILD)
       add_custom_target(PACKAGE-${pkg}-check
-        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
-	DEPENDS MVD
-        )
+        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check")
+    else(OUT_OF_SOURCE_BUILD)
+      if(ENABLE_MONTEVERDI)
+        add_custom_target(PACKAGE-${pkg}-check
+          COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
+	  DEPENDS MVD
+          WORKING_DIRECTORY ${SUPERBUILD_BINARY_DIR}
+          )
       else(ENABLE_MONTEVERDI)
-      add_custom_target(PACKAGE-${pkg}-check
-        COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
-	DEPENDS OTB
-        )
-    endif(ENABLE_MONTEVERDI)
+        add_custom_target(PACKAGE-${pkg}-check
+          COMMAND ${CMAKE_COMMAND} -E echo "Building PACKAGE-${pkg}-check"
+	  DEPENDS OTB
+          WORKING_DIRECTORY ${SUPERBUILD_BINARY_DIR}
+          )
+      endif(ENABLE_MONTEVERDI)
+    endif(OUT_OF_SOURCE_BUILD)
   endif()

   add_dependencies(PACKAGE-${pkg}-check PACKAGE-TOOLS)


COMP: VTkGlue linker errors

COMP: VTkGlue linker errors

Recent changes cause the following link error when
Module_ITKLevelSetsv4Visualization:BOOL=ON

Linking CXX executable ../../../../bin/ITKLevelSetsv4VisualizationTestDriver
/usr/bin/ld: CMakeFiles/ITKLevelSetsv4VisualizationTestDriver.dir/itkVTKVisualizeLevelSetsInteractivePauseTest.cxx.o:
undefined reference to symbol
'_ZNK3itk18VTKImageExportBase32GetPropagateUpdateExtentCallbackEv'
/usr/bin/ld: note:
'_ZNK3itk18VTKImageExportBase32GetPropagateUpdateExtentCallbackEv' is
defined in DSO /home/lorensen/ProjectsGIT/ITKGerrit-linux/lib/libITKVTK-4.9.so.1
so try adding it to the linker command line
/home/lorensen/ProjectsGIT/ITKGerrit-linux/lib/libITKVTK-4.9.so.1:
could not read symbols: Invalid operation
collect2: error: ld returned 1 exit status
make[2]: *** [bin/ITKLevelSetsv4VisualizationTestDriver] Error 1
make[1]: *** [Modules/Segmentation/LevelSetsv4Visualization/test/CMakeFiles/ITKLevelSetsv4VisualizationTestDriver.dir/all]
Error 2

----------------------------------
git bisect commit identified this commit:

Author: Zach Williamson <zachary-williamson@uiowa.edu>
Date:   Wed Jul 15 10:39:04 2015 -0500

    ENH: Use new linking system macros

    This is a work-in-progress to demonstrate using the new linking system
    (DEPENDS, COMPILE_DEPENDS, PRIVATE_DEPENDS etc.)

    Most changes so far are using private_depends where applicable to reduce the
    total number of links being created (since public dependencies are linked
    recursively while private dependencies are not)

    Change-Id: I41bed74b8d6ed508f2014163854799ed0ef17919

Change-Id: I7aa45520ae4da8d85246c661bc5b0c741d1e31cb

--- Modules/Bridge/VtkGlue/itk-module.cmake
+++ Modules/Bridge/VtkGlue/itk-module.cmake
@@ -3,7 +3,7 @@

 itk_module(ITKVtkGlue
   ENABLE_SHARED
-  PRIVATE_DEPENDS
+  DEPENDS
     ITKCommon
     ITKVTK
   COMPILE_DEPENDS


[FIX] added CUDA support in CMake under Linux and Mac (Windows not tested yet)

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13025 e6417c60-b987-48fd-844e-b20f0fcc1017


another occurence of that little cmake fix

--HG--
extra : convert_revision : svn%3A283d02a7-25f6-0310-bc7c-ecb5cbfe19da/branches/work/eigen2%40831625

--- bench/btl/cmake/FindMTL4.cmake
+++ bench/btl/cmake/FindMTL4.cmake
@@ -17,14 +17,14 @@

 else (MTL4_INCLUDE_DIR)

-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MTL4 DEFAULT_MSG MTL4_INCLUDE_DIR)
-
 find_path(MTL4_INCLUDE_DIR NAMES boost/numeric/mtl/mtl.hpp
      PATHS
      ${INCLUDE_INSTALL_DIR}
    )

+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(MTL4 DEFAULT_MSG MTL4_INCLUDE_DIR)
+
 mark_as_advanced(MTL4_INCLUDE_DIR)

 endif(MTL4_INCLUDE_DIR)


Quote the component

Quote the component

--- conf/sprokit-macro-targets.cmake
+++ conf/sprokit-macro-targets.cmake
@@ -207,7 +207,7 @@
       DESTINATION "lib${LIB_SUFFIX}${library_subdir}${library_subdir_suffix}"
     RUNTIME
       DESTINATION "bin${library_subdir}${library_subdir_suffix}"
-    COMPONENT     ${component})
+    COMPONENT     "${component}")
 endfunction ()

 function (sprokit_add_plugin name define)


added call to summarize_results

added call to summarize_results

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -1,13 +1,22 @@
+# Create a global test target that we hang per-project targets from
+if(NOT CATKIN_TEST_TARGET_CREATED)
+  set(CATKIN_TEST_TARGET_CREATED TRUE)
+  add_custom_target(test)
+endif()
+
 macro(append_project_cache CACHENAME)
   set(cachefile ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}.${CACHENAME})
   if(NOT ${PROJECT_NAME}_CACHE)
     file(WRITE ${cachefile} "#\n# This is ${cachefile}\n#\n")
-    set(${PROJECT_NAME}_CACHE TRUE)
+    set(${PROJECT_NAME}_CACHE TRUE PARENT_SCOPE)
     # TODO: find catkin somehow
-    set(runtests_path ${CMAKE_SOURCE_DIR}/catkin/scripts/runtests.py)
+    set(catkin_path ${CMAKE_SOURCE_DIR}/catkin)
+    # TODO: find rosunit somehow
+    set(rosunit_path ${CMAKE_SOURCE_DIR}/ros/tools/rosunit)
+    # One test target per project
     add_custom_target(${PROJECT_NAME}_run_tests
-                      COMMAND ${runtests_path} ${cachefile})
-    add_custom_target(test)
+                      COMMAND ${catkin_path}/scripts/runtests.py ${cachefile}
+                      COMMAND ${rosunit_path}/scripts/summarize_results.py --nodeps ${PROJECT_NAME})
     add_dependencies(test ${PROJECT_NAME}_run_tests)
   endif()


Refactored cmake utilities

Refactored cmake utilities

 - CMake functions to get target include directories and other target
   properties are refactored to rely in a common
   get_target_dependencies() function that takes the full (recursive)
   list of target dependencies (Targets, binaries, etc).

 - New functions about target properties and deps: Gettings target
   binary dependencies (for example, the list of dlls the target depends
   on).

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -29,76 +29,6 @@
     sourcetree_relative(relpath)
     set(includedir "${CMAKE_SOURCE_DIR}/include/siplasplas/${relpath}")
     set(${RESULT}  "${includedir}" PARENT_SCOPE)
-endfunction()
-
-function(_copy_dll_dependencies ROOT_TARGET TARGET)
-    if((NOT WIN32) OR (NOT (TARGET ${TARGET})))
-        return()
-    endif()
-    get_target_property(target_type ${TARGET} TYPE)
-    get_target_property(root_target_type ${ROOT_TARGET} TYPE)
-    if((target_type STREQUAL INTERFACE_LIBRARY) OR
-       (NOT (root_target_type STREQUAL EXECUTABLE)))
-        return()
-    endif()
-    get_target_property(dependencies ${TARGET} LINK_LIBRARIES)
-    if(NOT dependencies)
-        return()
-    endif()
-
-    message(STATUS " => dlls of target '${TARGET}' for target '${ROOT_TARGET}'")
-
-    set(dest_directory $<TARGET_FILE_DIR:${ROOT_TARGET}>)
-
-    foreach(lib ${dependencies})
-        if(TARGET ${lib})
-            if(NOT (lib STREQUAL TARGET))
-                get_target_property(target_type ${lib} TYPE)
-                if(target_type STREQUAL SHARED_LIBRARY)
-                    set(dllfile $<TARGET_FILE_DIR:${lib}>/$<TARGET_FILE_NAME:${lib}>)
-                endif()
-            endif()
-        elseif(lib MATCHES ".+\\.dll")
-            set(dllfile "${lib}")
-        endif()
-
-        if(SIPLASPLAS_VERBOSE_CONFIG)
-            set(log COMMAND ${CMAKE_COMMAND} -E echo " - ${dllfile}")
-        endif()
-
-        if(dllfile)
-            list(APPEND copy_command
-                ${log}
-                COMMAND ${CMAKE_COMMAND} -E copy
-                    \"${dllfile}\"
-                    \"${dest_directory}\"
-            )
-        endif()
-    endforeach()
-
-    if(copy_command)
-        add_custom_command(TARGET ${ROOT_TARGET} POST_BUILD
-            ${copy_command}
-            COMMENT "Copying dll dependencies of target ${TARGET}..."
-        )
-    endif()
-
-    foreach(dep ${dependencies})
-       _copy_dll_dependencies(${ROOT_TARGET} "${dep}")
-    endforeach()
-endfunction()
-
-
-# Copies dll dependencies of a target to its runtime
-# directory.
-#
-# Recursivelly scans for dll dependencies, so all needed
-# dlls are placed within the target output binary (usually
-# an executable). This helps to run/debug executables directly
-# in the buildtree, without installing them.
-#
-function(copy_dll_dependencies TARGET)
-    _copy_dll_dependencies(${TARGET} ${TARGET})
 endfunction()

 # Unzips a library list so libraries tagged as
@@ -134,6 +64,38 @@
     set(GENERAL_LIBS   ${_gen_libs}       PARENT_SCOPE)
 endfunction()

+function(get_target_common_property RESULT TARGET PROPERTY)
+    if(NOT TARGET ${TARGET})
+        set(${RESULT} PARENT_SCOPE)
+        return()
+    endif()
+
+    get_target_property(type ${TARGET} TYPE)
+
+    if(type STREQUAL "INTERFACE_LIBRARY")
+        get_target_property(value ${TARGET} INTERFACE_${PROPERTY})
+    else()
+        get_target_property(interface-value ${TARGET} INTERFACE_${PROPERTY})
+        get_target_property(value ${TARGET} ${PROPERTY})
+
+        if(interface-value)
+            if(value)
+                set(value ${value} ${interface-value})
+            else()
+                set(value ${interface-value})
+            endif()
+        endif()
+    endif()
+
+    if(NOT value)
+        set(value) # clear -NOTFOUND entries
+    else()
+        list(REMOVE_DUPLICATES value)
+    endif()
+
+    set(${RESULT} ${value} PARENT_SCOPE)
+endfunction()
+
 # Gets the set of target include directories, recusivelly scanning
 # dependencies and checking kind of target
 function(get_target_include_directories TARGET RESULT)
@@ -142,22 +104,30 @@
         return()
     endif()

-    get_target_property(type ${TARGET} TYPE)
-
-    if(type STREQUAL "INTERFACE_LIBRARY")
-        get_target_property(dependencies ${TARGET} INTERFACE_LINK_LIBRARIES)
-        get_target_property(includes     ${TARGET} INTERFACE_INCLUDE_DIRECTORIES)
-    else()
-        get_target_property(dependencies            "${TARGET}" LINK_LIBRARIES)
-        get_target_property(includes                "${TARGET}" INCLUDE_DIRECTORIES)
-    endif()
-
-    if(NOT includes)
-        set(includes)
-    endif()
-
-    if(dependencies)
-        set(deps_copy ${dependencies})
+    get_target_dependencies(${TARGET} dependencies)
+
+    foreach(dep ${dependencies})
+        get_target_common_property(dep_includes ${dep} INCLUDE_DIRECTORIES)
+        list(APPEND includes ${dep_includes})
+    endforeach()
+
+    if(includes)
+        list(REMOVE_DUPLICATES includes)
+    endif()
+    set(${RESULT} ${includes} PARENT_SCOPE)
+endfunction()
+
+# Gets a list of target dependencies
+function(get_target_dependencies TARGET RESULT)
+    if(NOT TARGET ${TARGET})
+        set(${RESULT} PARENT_SCOPE)
+        return()
+    endif()
+
+    get_target_common_property(link_libraries ${TARGET} LINK_LIBRARIES)
+
+    if(link_libraries)
+        set(deps_copy ${link_libraries})
         set(dependencies)
         foreach(dep ${deps_copy})
             if(NOT (dep STREQUAL "${TARGET}"))
@@ -166,42 +136,6 @@
         endforeach()

         foreach(dep ${dependencies})
-            get_target_include_directories(${dep} dep_includes)
-            list(APPEND includes ${dep_includes})
-        endforeach()
-    endif()
-
-    if(includes)
-        list(REMOVE_DUPLICATES includes)
-    endif()
-    set(${RESULT} ${includes} PARENT_SCOPE)
-endfunction()
-
-# Gets a list of target dependencies
-function(get_target_dependencies TARGET RESULT)
-    if(NOT TARGET ${TARGET})
-        set(${RESULT} PARENT_SCOPE)
-        return()
-    endif()
-
-    get_target_property(type ${TARGET} TYPE)
-
-    if(type STREQUAL "INTERFACE_LIBRARY")
-        get_target_property(dependencies ${TARGET} INTERFACE_LINK_LIBRARIES)
-    else()
-        get_target_property(dependencies            "${TARGET}" LINK_LIBRARIES)
-    endif()
-
-    if(dependencies)
-        set(deps_copy ${dependencies})
-        set(dependencies)
-        foreach(dep ${deps_copy})
-            if(NOT (dep STREQUAL "${TARGET}") AND TARGET "${dep}")
-                list(APPEND dependencies "${dep}")
-            endif()
-        endforeach()
-
-        foreach(dep ${dependencies})
             get_target_dependencies(${dep} deps)
             list(APPEND dependencies ${deps})
         endforeach()
@@ -214,6 +148,38 @@
         set(dependencies)
     endif()
     set(${RESULT} ${dependencies} PARENT_SCOPE)
+endfunction()
+
+function(get_target_binary TARGET RESULT)
+    if(NOT TARGET ${TARGET})
+        message(FATAL_ERROR "${TARGET} is not a CMake target")
+    endif()
+
+    get_target_property(type ${TARGET} TYPE)
+
+    if(type MATCHES INTERFACE_LIBRARY)
+        message(FATAL_ERROR "Interface libraries have no binary output (Library: ${TARGET})")
+    else()
+        set(binary "$<TARGET_FILE_DIR:${TARGET}>/$<TARGET_FILE_NAME:${TARGET}>")
+    endif()
+
+    if(binary)
+        set(${RESULT} "${binary}" PARENT_SCOPE)
+    else()
+        message(FATAL_ERROR "Failed getting binary of target ${TARGET}")
+    endif()
+endfunction()
+
+function(get_target_dependencies_targets_only TARGET RESULT)
+    get_target_dependencies(${TARGET} dependencies)
+
+    foreach(dep ${dependencies})
+        if(TARGET ${dep})
+            list(APPEND target_dependencies ${dep})
+        endif()
+    endforeach()
+
+    set(${RESULT} ${target_dependencies} PARENT_SCOPE)
 endfunction()

 function(add_prebuild_command)
@@ -241,7 +207,55 @@

     # Here we force the command target to be the uppermost dependency of the TARGET, so
     # the command is run only after building all other TARGET dependencies
-    get_target_dependencies(${PC_TARGET} deps)
+    get_target_dependencies_targets_only(${PC_TARGET} deps)
     add_dependencies(${PC_NAME} ${deps})
     add_dependencies(${PC_TARGET} ${PC_NAME})
 endfunction()
+
+# Copies dll dependencies of a target to its runtime
+# directory.
+#
+# Recursivelly scans for dll dependencies, so all needed
+# dlls are placed within the target output binary (usually
+# an executable). This helps to run/debug executables directly
+# in the buildtree, without installing them.
+#
+function(copy_dll_dependencies TARGET)
+    get_target_dependencies(${TARGET} dependencies)
+
+    set(dest_directory $<TARGET_FILE_DIR:${ROOT_TARGET}>)
+    foreach(dep ${dependencies})
+        if(TARGET ${dep})
+            get_target_property(type ${dep} TYPE)
+
+            if(NOT type MATCHES INTERFACE_LIBRARY)
+                get_target_binary(${dep} lib)
+                set(dllfile "${lib}")
+            else()
+                set(dllfile)
+            endif()
+        else()
+            set(dllfile)
+        endif()
+
+        if(SIPLASPLAS_VERBOSE_CONFIG)
+            set(log COMMAND ${CMAKE_COMMAND} -E echo " - ${dllfile}")
+        endif()
+
+        if(dllfile)
+            list(APPEND copy_command
+                ${log}
+                COMMAND ${CMAKE_COMMAND} -E copy
+                    \"${dllfile}\"
+                    \"${dest_directory}\"
+            )
+        endif()
+    endforeach()
+
+    if(copy_command)
+        add_custom_target(copy-${TARGET}-dlls
+            ${copy_command}
+            COMMENT "Copying dll dependencies of target ${TARGET}..."
+        )
+    endif()
+endfunction()


ExternalData: Update documentation to match CMake copy

Change-Id: Id6dc7c1b665191804641b3796d5ed7728d3c2257

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -1,144 +1,309 @@
-# - Manage data files stored outside source tree
-# Use this module to unambiguously reference data files stored outside the
-# source tree and fetch them at build time from arbitrary local and remote
-# content-addressed locations.  Functions provided by this module recognize
-# arguments with the syntax "DATA{<name>}" as references to external data,
-# replace them with full paths to local copies of those data, and create build
-# rules to fetch and update the local copies.
-#
-# The DATA{} syntax is literal and the <name> is a full or relative path
-# within the source tree.  The source tree must contain either a real data
-# file at <name> or a "content link" at <name><ext> containing a hash of the
-# real file using a hash algorithm corresponding to <ext>.  For example, the
-# argument "DATA{img.png}" may be satisfied by either a real "img.png" file in
-# the current source directory or a "img.png.md5" file containing its MD5 sum.
-#
-# The 'ExternalData_Expand_Arguments' function evaluates DATA{} references
-# in its arguments and constructs a new list of arguments:
-#  ExternalData_Expand_Arguments(
-#    <target>   # Name of data management target
-#    <outVar>   # Output variable
-#    [args...]  # Input arguments, DATA{} allowed
+#.rst:
+# ExternalData
+# ------------
+#
+# .. only:: html
+#
+#    .. contents::
+#
+# Manage data files stored outside source tree
+#
+# Introduction
+# ^^^^^^^^^^^^
+#
+# Use this module to unambiguously reference data files stored outside
+# the source tree and fetch them at build time from arbitrary local and
+# remote content-addressed locations.  Functions provided by this module
+# recognize arguments with the syntax ``DATA{<name>}`` as references to
+# external data, replace them with full paths to local copies of those
+# data, and create build rules to fetch and update the local copies.
+#
+# For example:
+#
+# .. code-block:: cmake
+#
+#  include(ExternalData)
+#  set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
+#                                 "file:////host/share/%(algo)/%(hash)"
+#                                 "http://data.org/%(algo)/%(hash)")
+#  ExternalData_Add_Test(MyData
+#    NAME MyTest
+#    COMMAND MyExe DATA{MyInput.png}
 #    )
-# It replaces each DATA{} reference in an argument with the full path of a
-# real data file on disk that will exist after the <target> builds.
-#
-# The 'ExternalData_Add_Test' function wraps around the CMake add_test()
-# command but supports DATA{} references in its arguments:
-#  ExternalData_Add_Test(
-#    <target>   # Name of data management target
-#    ...        # Arguments of add_test(), DATA{} allowed
-#    )
-# It passes its arguments through ExternalData_Expand_Arguments and then
-# invokes add_test() using the results.
-#
-# The 'ExternalData_Add_Target' function creates a custom target to manage
-# local instances of data files stored externally:
-#  ExternalData_Add_Target(
-#    <target>   # Name of data management target
-#    )
-# It creates custom commands in the target as necessary to make data files
-# available for each DATA{} reference previously evaluated by other functions
-# provided by this module.  A list of URL templates must be provided in the
-# variable ExternalData_URL_TEMPLATES using the placeholders "%(algo)" and
-# "%(hash)" in each template.  Data fetch rules try each URL template in order
-# by substituting the hash algorithm name for "%(algo)" and the hash value for
-# "%(hash)".
-#
-# The following hash algorithms are supported:
-#    %(algo)     <ext>     Description
-#    -------     -----     -----------
-#    MD5         .md5      Message-Digest Algorithm 5, RFC 1321
-# Note that the hashes are used only for unique data identification and
-# download verification.  This is not security software.
-#
-# Example usage:
-#   include(ExternalData)
-#   set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
-#                                  "http://data.org/%(algo)/%(hash)")
-#   ExternalData_Add_Test(MyData
-#     NAME MyTest
-#     COMMAND MyExe DATA{MyInput.png}
-#     )
-#   ExternalData_Add_Target(MyData)
-# When test "MyTest" runs the "DATA{MyInput.png}" argument will be replaced by
-# the full path to a real instance of the data file "MyInput.png" on disk.  If
-# the source tree contains a content link such as "MyInput.png.md5" then the
-# "MyData" target creates a real "MyInput.png" in the build tree.
-#
-# The DATA{} syntax can be told to fetch a file series using the form
-# "DATA{<name>,:}", where the ":" is literal.  If the source tree contains a
-# group of files or content links named like a series then a reference to one
-# member adds rules to fetch all of them.  Although all members of a series
-# are fetched, only the file originally named by the DATA{} argument is
-# substituted for it.  The default configuration recognizes file series names
-# ending with "#.ext", "_#.ext", ".#.ext", or "-#.ext" where "#" is a sequence
-# of decimal digits and ".ext" is any single extension.  Configure it with a
-# regex that parses <number> and <suffix> parts from the end of <name>:
+#  ExternalData_Add_Target(MyData)
+#
+# When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be
+# replaced by the full path to a real instance of the data file
+# ``MyInput.png`` on disk.  If the source tree contains a content link
+# such as ``MyInput.png.md5`` then the ``MyData`` target creates a real
+# ``MyInput.png`` in the build tree.
+#
+# Module Functions
+# ^^^^^^^^^^^^^^^^
+#
+# .. command:: ExternalData_Expand_Arguments
+#
+#   The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}``
+#   references in its arguments and constructs a new list of arguments::
+#
+#     ExternalData_Expand_Arguments(
+#       <target>   # Name of data management target
+#       <outVar>   # Output variable
+#       [args...]  # Input arguments, DATA{} allowed
+#       )
+#
+#   It replaces each ``DATA{}`` reference in an argument with the full path of
+#   a real data file on disk that will exist after the ``<target>`` builds.
+#
+# .. command:: ExternalData_Add_Test
+#
+#   The ``ExternalData_Add_Test`` function wraps around the CMake
+#   :command:`add_test` command but supports ``DATA{}`` references in
+#   its arguments::
+#
+#     ExternalData_Add_Test(
+#       <target>   # Name of data management target
+#       ...        # Arguments of add_test(), DATA{} allowed
+#       )
+#
+#   It passes its arguments through ``ExternalData_Expand_Arguments`` and then
+#   invokes the :command:`add_test` command using the results.
+#
+# .. command:: ExternalData_Add_Target
+#
+#   The ``ExternalData_Add_Target`` function creates a custom target to
+#   manage local instances of data files stored externally::
+#
+#     ExternalData_Add_Target(
+#       <target>   # Name of data management target
+#       )
+#
+#   It creates custom commands in the target as necessary to make data
+#   files available for each ``DATA{}`` reference previously evaluated by
+#   other functions provided by this module.
+#   Data files may be fetched from one of the URL templates specified in
+#   the ``ExternalData_URL_TEMPLATES`` variable, or may be found locally
+#   in one of the paths specified in the ``ExternalData_OBJECT_STORES``
+#   variable.
+#
+# Module Variables
+# ^^^^^^^^^^^^^^^^
+#
+# The following variables configure behavior.  They should be set before
+# calling any of the functions provided by this module.
+#
+# .. variable:: ExternalData_BINARY_ROOT
+#
+#   The ``ExternalData_BINARY_ROOT`` variable may be set to the directory to
+#   hold the real data files named by expanded ``DATA{}`` references.  The
+#   default is ``CMAKE_BINARY_DIR``.  The directory layout will mirror that of
+#   content links under ``ExternalData_SOURCE_ROOT``.
+#
+# .. variable:: ExternalData_CUSTOM_SCRIPT_<key>
+#
+#   Specify a full path to a ``.cmake`` custom fetch script identified by
+#   ``<key>`` in entries of the ``ExternalData_URL_TEMPLATES`` list.
+#   See `Custom Fetch Scripts`_.
+#
+# .. variable:: ExternalData_LINK_CONTENT
+#
+#   The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a
+#   supported hash algorithm to enable automatic conversion of real data
+#   files referenced by the ``DATA{}`` syntax into content links.  For each
+#   such ``<file>`` a content link named ``<file><ext>`` is created.  The
+#   original file is renamed to the form ``.ExternalData_<algo>_<hash>`` to
+#   stage it for future transmission to one of the locations in the list
+#   of URL templates (by means outside the scope of this module).  The
+#   data fetch rule created for the content link will use the staged
+#   object if it cannot be found using any URL template.
+#
+# .. variable:: ExternalData_OBJECT_STORES
+#
+#   The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local
+#   directories that store objects using the layout ``<dir>/%(algo)/%(hash)``.
+#   These directories will be searched first for a needed object.  If the
+#   object is not available in any store then it will be fetched remotely
+#   using the URL templates and added to the first local store listed.  If
+#   no stores are specified the default is a location inside the build
+#   tree.
+#
+# .. variable:: ExternalData_SERIES_PARSE
+#               ExternalData_SERIES_PARSE_PREFIX
+#               ExternalData_SERIES_PARSE_NUMBER
+#               ExternalData_SERIES_PARSE_SUFFIX
+#               ExternalData_SERIES_MATCH
+#
+#   See `Referencing File Series`_.
+#
+# .. variable:: ExternalData_SOURCE_ROOT
+#
+#   The ``ExternalData_SOURCE_ROOT`` variable may be set to the highest source
+#   directory containing any path named by a ``DATA{}`` reference.  The
+#   default is ``CMAKE_SOURCE_DIR``.  ``ExternalData_SOURCE_ROOT`` and
+#   ``CMAKE_SOURCE_DIR`` must refer to directories within a single source
+#   distribution (e.g.  they come together in one tarball).
+#
+# .. variable:: ExternalData_TIMEOUT_ABSOLUTE
+#
+#   The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download
+#   absolute timeout, in seconds, with a default of ``300`` seconds.
+#   Set to ``0`` to disable enforcement.
+#
+# .. variable:: ExternalData_TIMEOUT_INACTIVITY
+#
+#   The ``ExternalData_TIMEOUT_INACTIVITY`` variable sets the download
+#   inactivity timeout, in seconds, with a default of ``60`` seconds.
+#   Set to ``0`` to disable enforcement.
+#
+# .. variable:: ExternalData_URL_ALGO_<algo>_<key>
+#
+#   Specify a custom URL component to be substituted for URL template
+#   placeholders of the form ``%(algo:<key>)``, where ``<key>`` is a
+#   valid C identifier, when fetching an object referenced via hash
+#   algorithm ``<algo>``.  If not defined, the default URL component
+#   is just ``<algo>`` for any ``<key>``.
+#
+# .. variable:: ExternalData_URL_TEMPLATES
+#
+#   The ``ExternalData_URL_TEMPLATES`` may be set to provide a list of
+#   of URL templates using the placeholders ``%(algo)`` and ``%(hash)``
+#   in each template.  Data fetch rules try each URL template in order
+#   by substituting the hash algorithm name for ``%(algo)`` and the hash
+#   value for ``%(hash)``.  Alternatively one may use ``%(algo:<key>)``
+#   with ``ExternalData_URL_ALGO_<algo>_<key>`` variables to gain more
+#   flexibility in remote URLs.
+#
+# Referencing Files
+# ^^^^^^^^^^^^^^^^^
+#
+# Referencing Single Files
+# """"""""""""""""""""""""
+#
+# The ``DATA{}`` syntax is literal and the ``<name>`` is a full or relative path
+# within the source tree.  The source tree must contain either a real
+# data file at ``<name>`` or a "content link" at ``<name><ext>`` containing a
+# hash of the real file using a hash algorithm corresponding to ``<ext>``.
+# For example, the argument ``DATA{img.png}`` may be satisfied by either a
+# real ``img.png`` file in the current source directory or a ``img.png.md5``
+# file containing its MD5 sum.
+#
+# Referencing File Series
+# """""""""""""""""""""""
+#
+# The ``DATA{}`` syntax can be told to fetch a file series using the form
+# ``DATA{<name>,:}``, where the ``:`` is literal.  If the source tree
+# contains a group of files or content links named like a series then a
+# reference to one member adds rules to fetch all of them.  Although all
+# members of a series are fetched, only the file originally named by the
+# ``DATA{}`` argument is substituted for it.  The default configuration
+# recognizes file series names ending with ``#.ext``, ``_#.ext``, ``.#.ext``,
+# or ``-#.ext`` where ``#`` is a sequence of decimal digits and ``.ext`` is
+# any single extension.  Configure it with a regex that parses ``<number>``
+# and ``<suffix>`` parts from the end of ``<name>``::
+#
 #  ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
-# For more complicated cases set:
+#
+# For more complicated cases set::
+#
 #  ExternalData_SERIES_PARSE = regex with at least two () groups
 #  ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any
 #  ExternalData_SERIES_PARSE_NUMBER = <number> regex group number
 #  ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number
+#
 # Configure series number matching with a regex that matches the
-# <number> part of series members named <prefix><number><suffix>:
+# ``<number>`` part of series members named ``<prefix><number><suffix>``::
+#
 #  ExternalData_SERIES_MATCH = regex matching <number> in all series members
-# Note that the <suffix> of a series does not include a hash-algorithm
+#
+# Note that the ``<suffix>`` of a series does not include a hash-algorithm
 # extension.
 #
-# The DATA{} syntax can alternatively match files associated with the named
-# file and contained in the same directory.  Associated files may be specified
-# by options using the syntax DATA{<name>,<opt1>,<opt2>,...}.  Each option may
-# specify one file by name or specify a regular expression to match file names
-# using the syntax REGEX:<regex>.  For example, the arguments
-#   DATA{MyData/MyInput.mhd,MyInput.img}                   # File pair
-#   DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
-# will pass MyInput.mha and MyFrames00.png on the command line but ensure
-# that the associated files are present next to them.
-#
-# The DATA{} syntax may reference a directory using a trailing slash and a
-# list of associated files.  The form DATA{<name>/,<opt1>,<opt2>,...} adds
-# rules to fetch any files in the directory that match one of the associated
-# file options.  For example, the argument DATA{MyDataDir/,REGEX:.*} will pass
-# the full path to a MyDataDir directory on the command line and ensure that
-# the directory contains files corresponding to every file or content link in
-# the MyDataDir source directory.
-#
-# The variable ExternalData_LINK_CONTENT may be set to the name of a supported
-# hash algorithm to enable automatic conversion of real data files referenced
-# by the DATA{} syntax into content links.  For each such <file> a content
-# link named "<file><ext>" is created.  The original file is renamed to the
-# form ".ExternalData_<algo>_<hash>" to stage it for future transmission to
-# one of the locations in the list of URL templates (by means outside the
-# scope of this module).  The data fetch rule created for the content link
-# will use the staged object if it cannot be found using any URL template.
-#
-# The variable ExternalData_OBJECT_STORES may be set to a list of local
-# directories that store objects using the layout <dir>/%(algo)/%(hash).
-# These directories will be searched first for a needed object.  If the object
-# is not available in any store then it will be fetched remotely using the URL
-# templates and added to the first local store listed.  If no stores are
-# specified the default is a location inside the build tree.
-#
-# The variable ExternalData_SOURCE_ROOT may be set to the highest source
-# directory containing any path named by a DATA{} reference.  The default is
-# CMAKE_SOURCE_DIR.  ExternalData_SOURCE_ROOT and CMAKE_SOURCE_DIR must refer
-# to directories within a single source distribution (e.g. they come together
-# in one tarball).
-#
-# The variable ExternalData_BINARY_ROOT may be set to the directory to hold
-# the real data files named by expanded DATA{} references.  The default is
-# CMAKE_BINARY_DIR.  The directory layout will mirror that of content links
-# under ExternalData_SOURCE_ROOT.
-#
-# Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIMEOUT_ABSOLUTE
-# set the download inactivity and absolute timeouts, in seconds.  The defaults
-# are 60 seconds and 300 seconds, respectively.  Set either timeout to 0
-# seconds to disable enforcement.
+# Referencing Associated Files
+# """"""""""""""""""""""""""""
+#
+# The ``DATA{}`` syntax can alternatively match files associated with the
+# named file and contained in the same directory.  Associated files may
+# be specified by options using the syntax
+# ``DATA{<name>,<opt1>,<opt2>,...}``.  Each option may specify one file by
+# name or specify a regular expression to match file names using the
+# syntax ``REGEX:<regex>``.  For example, the arguments::
+#
+#  DATA{MyData/MyInput.mhd,MyInput.img}                   # File pair
+#  DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
+#
+# will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but
+# ensure that the associated files are present next to them.
+#
+# Referencing Directories
+# """""""""""""""""""""""
+#
+# The ``DATA{}`` syntax may reference a directory using a trailing slash and
+# a list of associated files.  The form ``DATA{<name>/,<opt1>,<opt2>,...}``
+# adds rules to fetch any files in the directory that match one of the
+# associated file options.  For example, the argument
+# ``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir``
+# directory on the command line and ensure that the directory contains
+# files corresponding to every file or content link in the ``MyDataDir``
+# source directory.
+#
+# Hash Algorithms
+# ^^^^^^^^^^^^^^^
+#
+# The following hash algorithms are supported::
+#
+#  %(algo)     <ext>     Description
+#  -------     -----     -----------
+#  MD5         .md5      Message-Digest Algorithm 5, RFC 1321
+#  SHA1        .sha1     US Secure Hash Algorithm 1, RFC 3174
+#  SHA224      .sha224   US Secure Hash Algorithms, RFC 4634
+#  SHA256      .sha256   US Secure Hash Algorithms, RFC 4634
+#  SHA384      .sha384   US Secure Hash Algorithms, RFC 4634
+#  SHA512      .sha512   US Secure Hash Algorithms, RFC 4634
+#
+# Note that the hashes are used only for unique data identification and
+# download verification.
+#
+# .. _`ExternalData Custom Fetch Scripts`:
+#
+# Custom Fetch Scripts
+# ^^^^^^^^^^^^^^^^^^^^
+#
+# When a data file must be fetched from one of the URL templates
+# specified in the ``ExternalData_URL_TEMPLATES`` variable, it is
+# normally downloaded using the :command:`file(DOWNLOAD)` command.
+# One may specify usage of a custom fetch script by using a URL
+# template of the form ``ExternalDataCustomScript://<key>/<loc>``.
+# The ``<key>`` must be a C identifier, and the ``<loc>`` must
+# contain the ``%(algo)`` and ``%(hash)`` placeholders.
+# A variable corresponding to the key, ``ExternalData_CUSTOM_SCRIPT_<key>``,
+# must be set to the full path to a ``.cmake`` script file.  The script
+# will be included to perform the actual fetch, and provided with
+# the following variables:
+#
+# .. variable:: ExternalData_CUSTOM_LOCATION
+#
+#   When a custom fetch script is loaded, this variable is set to the
+#   location part of the URL, which will contain the substituted hash
+#   algorithm name and content hash value.
+#
+# .. variable:: ExternalData_CUSTOM_FILE
+#
+#   When a custom fetch script is loaded, this variable is set to the
+#   full path to a file in which the script must store the fetched
+#   content.  The name of the file is unspecified and should not be
+#   interpreted in any way.
+#
+# The custom fetch script is expected to store fetched content in the
+# file or set a variable:
+#
+# .. variable:: ExternalData_CUSTOM_ERROR
+#
+#   When a custom fetch script fails to fetch the requested content,
+#   it must set this variable to a short one-line message describing
+#   the reason for failure.

 #=============================================================================
-# Copyright 2010-2013 Kitware, Inc.
+# Copyright 2010-2015 Kitware, Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without