ENH (#4174): Added the TensorDerivedMeasurementsFilter to cmake.

--- Modules/DiffusionImaging/files.cmake
+++ Modules/DiffusionImaging/files.cmake
@@ -7,6 +7,7 @@
   # Algorithms
   Algorithms/itkDiffusionQballGeneralizedFaImageFilter.h
   Algorithms/itkDiffusionQballPrepareVisualizationImageFilter.h
+  Algorithms/itkTensorDerivedMeasurementsFilter.h

   # DicomImport
   DicomImport/mitkDicomDiffusionImageReader.cpp


REFAC: update gdal version in Superbuild to 3.1.0

--- SuperBuild/CMake/External_gdal.cmake
+++ SuperBuild/CMake/External_gdal.cmake
@@ -148,8 +148,8 @@

 ExternalProject_Add(GDAL
   PREFIX GDAL
-  URL "http://download.osgeo.org/gdal/3.0.2/gdal-3.0.2.tar.gz"
-  URL_MD5 8a31507806b26f070858558aaad42277
+  URL "http://download.osgeo.org/gdal/3.1.0/gdal-3.1.0.tar.gz"
+  URL_MD5 bda0f002cd63b51c8d2f1b1400daffa9
   SOURCE_DIR ${GDAL_SB_SRC}
   BINARY_DIR ${GDAL_SB_SRC}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


BUILD cmake module transport options detection fix

--- FindLibNETCONF2.cmake
+++ FindLibNETCONF2.cmake
@@ -71,9 +71,11 @@

   if (LIBNETCONF2_INCLUDE_DIR AND LIBNETCONF2_LIBRARY)
     set(LIBNETCONF2_FOUND TRUE)
-    # check compile flags
+    # check the configured options and make them available through cmake
+    list(INSERT CMAKE_REQUIRED_INCLUDES 0 "${LIBNETCONF2_INCLUDE_DIR}")
     check_symbol_exists("NC_ENABLED_SSH" "nc_client.h" LIBNETCONF2_ENABLED_SSH)
     check_symbol_exists("NC_ENABLED_TLS" "nc_client.h" LIBNETCONF2_ENABLED_TLS)
+    list(REMOVE_AT CMAKE_REQUIRED_INCLUDES 0)
   else (LIBNETCONF2_INCLUDE_DIR AND LIBNETCONF2_LIBRARY)
     set(LIBNETCONF2_FOUND FALSE)
   endif (LIBNETCONF2_INCLUDE_DIR AND LIBNETCONF2_LIBRARY)


Change download method of MatchPoint to Git clone

Also use the opportunity to upgrade to the latest commit.

--- CMakeExternals/MatchPoint.cmake
+++ CMakeExternals/MatchPoint.cmake
@@ -32,8 +32,8 @@
       set(download_step SOURCE_DIR ${MatchPoint_SOURCE_DIR})
     else()
       set(download_step
-          URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MatchPoint_rev_f7699d1e.tar.gz
-          URL_MD5 8a24fbdccd6f18f158f49a0ad4fa3faa
+          GIT_REPOSITORY https://github.com/MIC-DKFZ/MatchPoint.git
+          GIT_TAG e63dfdbb
          )
     endif()


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -15,7 +15,7 @@
 SET(KWSYS_DATE_STAMP_YEAR  2009)

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


I never used the same name for includes

I never used the same name for includes

--- FindICU.cmake
+++ FindICU.cmake
@@ -5,7 +5,7 @@
 #
 # The following variables will be defined for your use:
 #   - ICU_FOUND             : were all of your specified components found (include dependencies)?
-#   - ICU_INCLUDE_DIR       : ICU include directory
+#   - ICU_INCLUDE_DIRS      : ICU include directory
 #   - ICU_LIBRARIES         : ICU libraries
 #   - ICU_VERSION           : complete version of ICU (x.y.z)
 #   - ICU_MAJOR_VERSION     : major version of ICU
@@ -64,7 +64,7 @@
 ########## Public ##########
 set(ICU_FOUND TRUE)
 set(ICU_LIBRARIES )
-set(ICU_INCLUDES_DIR )
+set(ICU_INCLUDE_DIRS )
 set(ICU_DEFINITIONS )
 foreach(_icu_component ${IcuComponents})
     string(TOUPPER "${_icu_component}" _icu_upper_component)
@@ -86,7 +86,7 @@

 # Includes
 find_path(
-    ICU_INCLUDE_DIR
+    ICU_INCLUDE_DIRS
     NAMES unicode/utypes.h
     DOC "Include directories for ICU"
 )
@@ -131,8 +131,8 @@
 list(REMOVE_DUPLICATES ICU_LIBRARIES)

 if(ICU_FOUND)
-    if(EXISTS "${ICU_INCLUDE_DIR}/unicode/uvernum.h")
-        file(READ "${ICU_INCLUDE_DIR}/unicode/uvernum.h" _icu_contents)
+    if(EXISTS "${ICU_INCLUDE_DIRS}/unicode/uvernum.h")
+        file(READ "${ICU_INCLUDE_DIRS}/unicode/uvernum.h" _icu_contents)
 #     else()
 #         todo
     endif()
@@ -143,21 +143,21 @@
     set(ICU_VERSION "${ICU_MAJOR_VERSION}.${ICU_MINOR_VERSION}.${ICU_PATCH_VERSION}")
 endif(ICU_FOUND)

-if(ICU_INCLUDE_DIR)
+if(ICU_INCLUDE_DIRS)
     include(FindPackageHandleStandardArgs)
     if(ICU_FIND_REQUIRED AND NOT ICU_FIND_QUIETLY)
-        find_package_handle_standard_args(ICU REQUIRED_VARS ICU_LIBRARIES ICU_INCLUDE_DIR VERSION_VAR ICU_VERSION)
+        find_package_handle_standard_args(ICU REQUIRED_VARS ICU_LIBRARIES ICU_INCLUDE_DIRS VERSION_VAR ICU_VERSION)
     else()
-        find_package_handle_standard_args(ICU "ICU not found" ICU_LIBRARIES ICU_INCLUDE_DIR)
+        find_package_handle_standard_args(ICU "ICU not found" ICU_LIBRARIES ICU_INCLUDE_DIRS)
     endif()
-else(ICU_INCLUDE_DIR)
+else(ICU_INCLUDE_DIRS)
     if(ICU_FIND_REQUIRED AND NOT ICU_FIND_QUIETLY)
         message(FATAL_ERROR "Could not find ICU include directory")
     endif()
-endif(ICU_INCLUDE_DIR)
+endif(ICU_INCLUDE_DIRS)

 mark_as_advanced(
-    ICU_INCLUDES_DIR
+    ICU_INCLUDE_DIRS
     ICU_LIBRARIES
     ICU_DEFINITIONS
     ICU_VERSION
@@ -180,7 +180,7 @@
 icudebug("ICU_LE_FOUND")
 icudebug("ICU_LX_FOUND")
 # Linking
-icudebug("ICU_INCLUDE_DIR")
+icudebug("ICU_INCLUDE_DIRS")
 icudebug("ICU_LIBRARIES")
 # Version
 icudebug("ICU_MAJOR_VERSION")


Putting meta_support exclusion for Windows at the right location.

--- tensorflow/contrib/cmake/tf_core_kernels.cmake
+++ tensorflow/contrib/cmake/tf_core_kernels.cmake
@@ -76,7 +76,6 @@
    "${tensorflow_source_dir}/tensorflow/core/kernels/*testutil.h"
    "${tensorflow_source_dir}/tensorflow/core/kernels/*testutil.cc"
    "${tensorflow_source_dir}/tensorflow/core/kernels/*main.cc"
-   "${tensorflow_source_dir}/tensorflow/core/kernels/meta_support.*"
    "${tensorflow_source_dir}/tensorflow/core/kernels/*.cu.cc"
    "${tensorflow_source_dir}/tensorflow/core/kernels/debug_ops.h"  # stream_executor dependency
    "${tensorflow_source_dir}/tensorflow/core/kernels/debug_ops.cc"  # stream_executor dependency
@@ -90,6 +89,7 @@
       "${tensorflow_source_dir}/tensorflow/core/kernels/fact_op.cc"
       "${tensorflow_source_dir}/tensorflow/core/kernels/immutable_constant_op.cc"
       "${tensorflow_source_dir}/tensorflow/core/kernels/immutable_constant_op.h"
+      "${tensorflow_source_dir}/tensorflow/core/kernels/meta_support.*"
       "${tensorflow_source_dir}/tensorflow/core/kernels/sparse_matmul_op.cc"
       "${tensorflow_source_dir}/tensorflow/core/kernels/sparse_matmul_op.h"
       "${tensorflow_source_dir}/tensorflow/core/kernels/*quantiz*.h"


Add -ffreestanding to cflags under GCC.

Add -ffreestanding to cflags under GCC.

--- build/cmake/cflags.cmake
+++ build/cmake/cflags.cmake
@@ -48,6 +48,7 @@
     -Wnull-dereference
     -Wjump-misses-init
     -Wdouble-promotion
+    -ffreestanding
   )
 endif()


Windows: Added `userenv` import library.

This is used to check the system environment.

Review: https://reviews.apache.org/r/51234/

--- 3rdparty/libprocess/cmake/ProcessConfigure.cmake
+++ 3rdparty/libprocess/cmake/ProcessConfigure.cmake
@@ -127,6 +127,13 @@
   ${HTTP_PARSER_LFLAG}
   )

+if (WIN32)
+  set(PROCESS_LIBS
+    ${PROCESS_LIBS}
+    userenv
+    )
+endif (WIN32)
+
 if (NOT ENABLE_LIBEVENT)
   set(PROCESS_LIBS ${PROCESS_LIBS} ${LIBEV_LFLAG})
 elseif (ENABLE_LIBEVENT)


Clarified netCDF-C CMake build instructions, based on feedback from Stefan Mauerberger.

--- INSTALL.cmake
+++ INSTALL.cmake
@@ -1,6 +1,5 @@
 Documentation for building netCDF with CMake
 ********************************************************
-

 This document describes building the netCDF 4.3 C libraries
 using KitWare's CMake utility.  By integrating CMake, we are
@@ -69,8 +68,9 @@
 	> cmake --build . --target INSTALL

 Linux/Unix:
-  	> ./cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_NETCDF_4=OFF
-   	> make test install
+  	> cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_NETCDF_4=OFF
+   	> make
+	> make test install

 (Replace ``/home/ed/local'' with the name of the directory where
 netCDF is to be installed.)
@@ -87,7 +87,8 @@
 	> cmake --build . --target INSTALL

 Linux/Unix
-	> ./cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_DAP=OFF
+        > cmake -DCMAKE_INSTALL_PREFIX=/home/ed/local -DENABLE_DAP=OFF
+	> make
 	> make test install

@@ -114,7 +115,8 @@
 For parallel I/O to work, HDF5 must be installed with
 -DENABLE_PARALLEL=ON, and an MPI library (and related libraries) must be
 made available to the HDF5 configure. This can be accomplished with
-the mpicc wrapper script, in the case of MPICH2.
+the mpicc wrapper script, in the case of MPICH2 (assuming you are building
+within the `netcdf/build` directory).

   CC=mpicc cmake .. -DENABLE_PARALLEL=ON -DCMAKE_INSTALL_PREFIX=/shecky/local_par
   make check install


obsolete

obsolete

--- CMake/QmitkFunctionalityTemplate/AddToMITK.cmake
+++ CMake/QmitkFunctionalityTemplate/AddToMITK.cmake
@@ -1,2 +0,0 @@
-addExternalFunctionality(@FUNCTIONALITY_NAME@ @FUNCTIONALITY_DIR@)
-


ADIOS: Update FindADIOS to match upstream

Change-Id: I121cdd04a5a529696e30263a78dae00fbd5ee8a4

--- CMake/FindADIOS.cmake
+++ CMake/FindADIOS.cmake
@@ -123,10 +123,10 @@

 if(ADIOS_CONFIG)
     message(STATUS "Found 'adios_config': ${ADIOS_CONFIG}")
-else()
+else(ADIOS_CONFIG)
     set(ADIOS_FOUND FALSE)
     message(STATUS "Can NOT find 'adios_config' - set ADIOS_ROOT, ADIOS_DIR or INSTALL_PREFIX, or check your PATH")
-endif()
+endif(ADIOS_CONFIG)

 # check `adios_config` program ################################################
 if(ADIOS_FOUND)
@@ -147,7 +147,7 @@
         set(ADIOS_FOUND FALSE)
         message(STATUS "The directory provided by 'adios_config -d' does not exist: ${ADIOS_ROOT_DIR}")
     endif()
-endif()
+endif(ADIOS_FOUND)

 # option: use only static libs ################################################
 if(ADIOS_USE_STATIC_LIBS)
@@ -186,16 +186,16 @@
         string(REPLACE "-l" "" _LIB ${_LIB})

         # find static lib: absolute path in -L then default
-        find_library(_LIB_DIR NAMES ${_LIB} PATHS ${ADIOS_LIBRARY_DIRS})
+        find_library(_LIB_DIR NAMES ${_LIB} PATHS ${ADIOS_LIBRARY_DIRS} CMAKE_FIND_ROOT_PATH_BOTH)

         # found?
         if(_LIB_DIR)
             message(STATUS "Found ${_LIB} in ${_LIB_DIR}")
             list(APPEND ADIOS_LIBRARIES "${_LIB_DIR}")
-        else()
+        else(_LIB_DIR)
             set(ADIOS_FOUND FALSE)
             message(STATUS "ADIOS: Could NOT find library '${_LIB}'")
-        endif()
+        endif(_LIB_DIR)

         # clean cached var
         unset(_LIB_DIR CACHE)
@@ -211,13 +211,13 @@
                     OUTPUT_VARIABLE ADIOS_VERSION
                     OUTPUT_STRIP_TRAILING_WHITESPACE)

-endif()
+endif(ADIOS_FOUND)

 # unset checked variables if not found
 if(NOT ADIOS_FOUND)
     unset(ADIOS_INCLUDE_DIRS)
     unset(ADIOS_LIBRARIES)
-endif()
+endif(NOT ADIOS_FOUND)

 # restore CMAKE_FIND_LIBRARY_SUFFIXES if manipulated by this module ###########


CMake: Enable NugetRestore target only when not in in visual studio and run it at configure time.

--- CMake/Modules/UrhoCommon.cmake
+++ CMake/Modules/UrhoCommon.cmake
@@ -330,7 +330,11 @@
         set (CSHARP_SOLUTION ${Urho3D_SOURCE_DIR}/Urho3D.part.sln)
     endif ()

-    add_custom_target(NugetRestore COMMAND ${TERM_WORKAROUND} ${MSBUILD} ${CSHARP_SOLUTION} /t:restore)
+    execute_process(COMMAND ${TERM_WORKAROUND} ${MSBUILD} ${CSHARP_SOLUTION} /t:restore)
+    if (NOT MSVC)
+        add_custom_target(NugetRestore COMMAND ${TERM_WORKAROUND} ${MSBUILD} ${CSHARP_SOLUTION} /t:restore)
+        set_property(TARGET NugetRestore PROPERTY EXCLUDE_FROM_ALL ON)
+    endif ()

     # Strong name signatures
     find_program(SN sn PATHS PATHS /Library/Frameworks/Mono.framework/Versions/Current/bin ${MONO_PATH}/bin)
@@ -376,12 +380,12 @@

 macro (add_target_csharp TARGET PROJECT_FILE)
     if (WIN32 AND NOT URHO3D_WITH_MONO)
-        include_external_msproject(${TARGET} ${PROJECT_FILE} TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC ${ARGN} NugetRestore)
+        include_external_msproject(${TARGET} ${PROJECT_FILE} TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC ${ARGN})
     else ()
         add_custom_target(${TARGET}
             COMMAND ${TERM_WORKAROUND} ${MSBUILD} ${PROJECT_FILE} ${MSBUILD_COMMON_PARAMETERS}
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-            DEPENDS ${ARGN} NugetRestore
+            DEPENDS ${ARGN}
         )
         set_target_properties(${TARGET} PROPERTIES EXCLUDE_FROM_ALL OFF)
     endif ()


QtTesting: Update Git repository URL to fix invalid cert issues.

Since QtTesting development has been moved to Github, this commit
updates the URL accordingly.

The error occurred when using git protocol:

  git clone https://paraview.org/QtTesting.git
  Cloning into 'QtTesting'...
  fatal: unable to access 'https://paraview.org/QtTesting.git/': Unknown SSL protocol error in connection to paraview.org:443

  git clone https://paraview.org/QtTesting.git
  Cloning into 'QtTesting'...
  fatal: unable to access 'https://paraview.org/QtTesting.git/': SSL certificate problem: unable to get local issuer certificate

Reported-by: Sergey Aleshin <d9794fb0a0d1209f92ea757b11551a760312db72@gmail.com>
Thanks: Sergey Aleshin <d9794fb0a0d1209f92ea757b11551a760312db72@gmail.com>

--- CMakeExternals/QtTesting.cmake
+++ CMakeExternals/QtTesting.cmake
@@ -36,7 +36,7 @@
     set(location_args GIT_REPOSITORY ${${proj}_GIT_REPOSITORY}
                       GIT_TAG ${revision_tag})
   else()
-    set(location_args GIT_REPOSITORY "${git_protocol}://paraview.org/QtTesting.git"
+    set(location_args GIT_REPOSITORY "${git_protocol}://github.com/Kitware/QtTesting.git"
                       GIT_TAG ${revision_tag})
   endif()


updating to version number to 2.0.0

updating to version number to 2.0.0

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


Allow use ConfigureChecks outside the expat dir

--- 3rdparty/expat/ConfigureChecks.cmake
+++ 3rdparty/expat/ConfigureChecks.cmake
@@ -40,5 +40,5 @@
     set(SIZE_T "unsigned")
 endif(HAVE_SYS_TYPES_H)

-configure_file(expat_config.h.cmake expat_config.h)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/expat_config.h.cmake expat_config.h)
 add_definitions(-DHAVE_EXPAT_CONFIG_H)


Update FW

Update 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 "9703def7e436298c86dfbe1204a6ae4181784047")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "b19b9704cef5386f341fd4a4210b2ec003efc704")

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


Update FW with bilateral fix

Update FW with bilateral fix

--- 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 "a2baa42ba41f7b79dcbee987b34f24da075de196")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "eb3b3cfd94b306ae38f114c1c98b090cb3fe2671")

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


Pass through CMAKE_AR when building googletest

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1587,6 +1587,7 @@
                   -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
                   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
                   -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+                  -DCMAKE_AR=${CMAKE_AR}
                   -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
                   ${EXTRA_GTEST_OPTS}
     # Disable install step


wrap variable expantion with ${}

wrap variable expantion with ${}

--- contrib/10.readline/cmake/FindLibedit.cmake
+++ contrib/10.readline/cmake/FindLibedit.cmake
@@ -45,14 +45,13 @@
   )
   if (Libedit_EDITLINE_INCLUDE_DIR)
     set(Libedit_INCLUDE_DIR_SUFFIX editline)
-    set(Libedit_INCLUDE_DIR Libedit_EDITLINE_INCLUDE_DIR)
+    set(Libedit_INCLUDE_DIR ${Libedit_EDITLINE_INCLUDE_DIR})
   else (Libedit_EDITLINE_INCLUDE_DIR)
     find_path(Libedit_READLINE_INCLUDE_DIR
       NAMES
         readline.h
         history.h
       PATHS
-        ${_Libedit_INCLUDEDIR}/edit
         /usr/include/edit
         /usr/local/include/edit
         /opt/local/include/edit
@@ -62,7 +61,7 @@
         )
     if (Libedit_READLINE_INCLUDE_DIR)
       set(Libedit_INCLUDE_DIR_SUFFIX readline)
-      set(Libedit_INCLUDE_DIR Libedit_READLINE_INCLUDE_DIR)
+      set(Libedit_INCLUDE_DIR ${Libedit_READLINE_INCLUDE_DIR})
     endif (Libedit_READLINE_INCLUDE_DIR)
   endif (Libedit_EDITLINE_INCLUDE_DIR)


[numerics] Remove one unstable test with UMFPACK

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -361,6 +361,7 @@

   IF(WITH_UMFPACK)
     SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_CONSTANT_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)
+    SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_FORCED_ASYMMETRY_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)
     SET(fc3d__NSN_AC_Tol_5e-2_Max_1000_inTol_0_inMax_0_KaplasTower-i1061-4.hdf5_PROPERTIES WILL_FAIL TRUE)
   ENDIF()


ios: Add support for watchOS builds

ios: Add support for watchOS builds

--- platforms/ios-clang/ios.cmake
+++ platforms/ios-clang/ios.cmake
@@ -44,6 +44,10 @@
 #    SIMULATOR64 = Build for x64 iPhone simulator.
 #    TVOS = Build for Apple tvOS.
 #    SIMULATOR_TVOS = Build for x64 Apple TV Simulator.
+#    WATCHOS = Build for Apple watchOS.
+#    SIMULATOR_WATCHOS = Build for x86 watchOS Simulator.
+#    SIMULATOR64_WATCHOS = Build for x64 watchOS Simulator.
+# IOS_DEPLOYMENT_TARGET: Minimum version for deployment target.
 # CMAKE_OSX_SYSROOT: Path to the iOS SDK to use. By default this is
 #    automatically determined from IOS_PLATFORM and xcodebuild, but can also be
 #    manually specified (although this should not be required).
@@ -53,13 +57,16 @@
 #    should not be required).
 # ENABLE_BITCODE: (ON / OFF) Enables or disables bitcode support. Default: ON.
 # ENABLE_ARC: (ON / OFF) Enables or disables ARC support. Default: ON.
-# IOS_ARCH: (armv7 armv7s arm64 i386 x86_64) If specified, will override the
+# IOS_ARCH: (armv7 armv7s armv7k arm64 i386 x86_64) If specified, will override the
 #    default architectures for the given IOS_PLATFORM. Default architectures:
 #    OS = armv7 armv7s arm64
 #    SIMULATOR = i386
 #    SIMULATOR64 = x86_64
 #    TVOS = arm64
 #    SIMULATOR_TVOS = x86_64
+#    WATCHOS = armv7k
+#    SIMULATOR_WATCHOS = i386
+#    SIMULATOR64_WATCHOS = x86_64
 #
 # Copyright 2018, Alexander Saprykin <xelfium@gmail.com>
 #
@@ -134,6 +141,26 @@
         if (NOT IOS_ARCH)
                 set (IOS_ARCH "x86_64")
         endif()
+elseif (IOS_PLATFORM STREQUAL "WATCHOS")
+        set (XCODE_IOS_PLATFORM "watchos")
+
+        if (NOT IOS_ARCH)
+                set (IOS_ARCH "armv7k")
+        endif()
+elseif (IOS_PLATFORM STREQUAL "SIMULATOR_WATCHOS")
+        set (XCODE_IOS_PLATFORM "watchsimulator")
+        set (ENABLE_BITCODE OFF)
+
+        if (NOT IOS_ARCH)
+                set (IOS_ARCH "i386")
+        endif()
+elseif (IOS_PLATFORM STREQUAL "SIMULATOR64_WATCHOS")
+        set (XCODE_IOS_PLATFORM "watchsimulator")
+        set (ENABLE_BITCODE OFF)
+
+        if (NOT IOS_ARCH)
+                set (IOS_ARCH "x86_64")
+        endif()
 else()
         message (FATAL_ERROR "Invalid IOS_PLATFORM: ${IOS_PLATFORM}")
 endif()
@@ -158,8 +185,12 @@
 # Specify minimum version of deployment target.

 if (NOT DEFINED IOS_DEPLOYMENT_TARGET)
-        # Unless specified, SDK version 8.0 is used by default as minimum target version.
-        set (IOS_DEPLOYMENT_TARGET "8.0" CACHE STRING "Minimum iOS version to build for." )
+        if (IOS_PLATFORM MATCHES ".*WATCHOS")
+                set (IOS_DEPLOYMENT_TARGET "2.0" CACHE STRING "Minimum watchOS version to build for." )
+        else()
+                set (IOS_DEPLOYMENT_TARGET "8.0" CACHE STRING "Minimum iOS version to build for." )
+        endif()
+
         message (STATUS "Using the default min-version since IOS_DEPLOYMENT_TARGET not provided.")
 endif()

@@ -263,10 +294,10 @@
 set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
 set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

-if (NOT IOS_DEPLOYMENT_TARGET VERSION_LESS 11.0)
+if (NOT IOS_DEPLOYMENT_TARGET VERSION_LESS 11.0 AND NOT IOS_PLATFORM MATCHES ".*WATCHOS")
     # iOS 11 does not support 32-bit (armv7*).
     foreach (ARCH ${IOS_ARCH})
-        if (ARCH MATCHES "armv7*")
+        if (ARCH MATCHES "armv7.*")
             message (STATUS "iOS architecture removed from build: ${ARCH} is not supported by "
                             "the minimum deployment iOS version ${IOS_DEPLOYMENT_TARGET}."
             )
@@ -278,7 +309,7 @@
     set (IOS_ARCH ${VALID_IOS_ARCH})
 endif()

-message (STATUS "Building for minimum iOS version: ${IOS_DEPLOYMENT_TARGET} (SDK version: ${IOS_SDK_VERSION})")
+message (STATUS "Building for minimum OS version: ${IOS_DEPLOYMENT_TARGET} (SDK version: ${IOS_SDK_VERSION})")

 # Note that only Xcode 7+ supports the newer more specific:
 # -m${XCODE_IOS_PLATFORM}-version-min flags, older versions of Xcode use:
@@ -294,6 +325,10 @@
         set (XCODE_IOS_PLATFORM_VERSION_FLAGS "-mtvos-version-min=${IOS_DEPLOYMENT_TARGET}")
 elseif (IOS_PLATFORM STREQUAL "SIMULATOR_TVOS")
         set (XCODE_IOS_PLATFORM_VERSION_FLAGS "-mtvos-simulator-version-min=${IOS_DEPLOYMENT_TARGET}")
+elseif (IOS_PLATFORM STREQUAL "WATCHOS")
+        set (XCODE_IOS_PLATFORM_VERSION_FLAGS "-mwatchos-version-min=${IOS_DEPLOYMENT_TARGET}")
+elseif (IOS_PLATFORM STREQUAL "SIMULATOR_WATCHOS" OR IOS_PLATFORM STREQUAL "SIMULATOR64_WATCHOS")
+        set (XCODE_IOS_PLATFORM_VERSION_FLAGS "-mwatchos-simulator-version-min=${IOS_DEPLOYMENT_TARGET}")
 else()
         # SIMULATOR or SIMULATOR64 both use -mios-simulator-version-min.
         set (XCODE_IOS_PLATFORM_VERSION_FLAGS "-mios-simulator-version-min=${IOS_DEPLOYMENT_TARGET}")


change thread-mt to thread

change thread-mt to thread

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -2,7 +2,7 @@
 set(Peloton_LINKER_LIBS "")

 # ---[ Boost
-find_package(Boost 1.46 REQUIRED COMPONENTS system filesystem thread-mt)
+find_package(Boost 1.46 REQUIRED COMPONENTS system filesystem thread)
 include_directories(SYSTEM ${Boost_INCLUDE_DIR})
 list(APPEND Peloton_LINKER_LIBS ${Boost_LIBRARIES})


try to fix finding fifechan on win, ref. #938

find_path uses CMAKE_PREFIX_PATH to find stuff,
the include folder is added there (, but fifechan.hpp is not inside the includes folder on windows)
let define PATH_SUFFIXES, which means to search in a subfolder, too
https://cmake.org/cmake/help/v3.6/command/find_path.html

--- cmake/FindFifeChan.cmake
+++ cmake/FindFifeChan.cmake
@@ -25,7 +25,7 @@
 #                       Find FIFECHAN_INCLUDE_DIR
 #------------------------------------------------------------------------------

-find_path(FIFECHAN_INCLUDE_DIR NAMES fifechan.hpp)
+find_path(FIFECHAN_INCLUDE_DIR NAMES fifechan.hpp PATH_SUFFIXES fifechan)

 #------------------------------------------------------------------------------
 #                       Find FIFECHAN_LIBRARY
@@ -77,4 +77,4 @@
 #message(STATUS "FIFECHAN_INCLUDE_DIR  = '${FIFECHAN_INCLUDE_DIR}'")
 #message(STATUS "FIFECHAN_LIBRARIES    = '${FIFECHAN_LIBRARIES}'")

-mark_as_advanced(FIFECHAN_INCLUDE_DIR FIFECHAN_LIBRARY)+mark_as_advanced(FIFECHAN_INCLUDE_DIR FIFECHAN_LIBRARY)


Remove unused file

Remove unused file

--- cmake/FindSDL2_ttf.cmake
+++ cmake/FindSDL2_ttf.cmake
@@ -1,98 +0,0 @@
-# Locate SDL_image library
-#
-# This module defines:
-#
-# ::
-#
-#   SDL_TTF_LIBRARIES, the name of the library to link against
-#   SDL_TTF_INCLUDE_DIRS, where to find the headers
-#   SDL_TTF_FOUND, if false, do not try to link against
-#   SDL_F_VERSION_STRING - human-readable string containing the version of SDL_ttf
-#
-#
-#
-# For backward compatiblity the following variables are also set:
-#
-# ::
-#
-#   SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
-#   SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
-#   SDLTTF_FOUND (same value as SDL_TTF_FOUND)
-#
-#
-#
-# $SDLDIR is an environment variable that would correspond to the
-# ./configure --prefix=$SDLDIR used in building SDL.
-#
-# Created by Eric Wing.  This was influenced by the FindSDL.cmake
-# module, but with modifications to recognize OS X frameworks and
-# additional Unix paths (FreeBSD, etc).
-
-#=============================================================================
-# Copyright 2005-2009 Kitware, Inc.
-# Copyright 2012 Benjamin Eikel
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-find_path(SDL2_TTF_INCLUDE_DIR SDL_ttf.h
-        HINTS
-        ENV SDL2TTFDIR
-        ENV SDL2DIR
-        PATH_SUFFIXES SDL2
-        # path suffixes to search inside ENV{SDLDIR}
-        include/SDL2 include
-        PATHS ${SDL2_PATH}
-        )
-
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-  set(VC_LIB_PATH_SUFFIX lib/x64)
-else ()
-  set(VC_LIB_PATH_SUFFIX lib/x86)
-endif ()
-
-find_library(SDL2_TTF_LIBRARY
-        NAMES SDL2_ttf
-        HINTS
-        ENV SDL2TTFDIR
-        ENV SDL2DIR
-        PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX}
-        PATHS ${SDL2_PATH}
-        )
-
-if (SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h")
-  file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_TTF_MINOR_VERSION[ \t]+[0-9]+$")
-  file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_TTF_PATCHLEVEL[ \t]+[0-9]+$")
-  string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MAJOR "${SDL2_TTF_VERSION_MAJOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MINOR "${SDL2_TTF_VERSION_MINOR_LINE}")
-  string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_PATCH "${SDL2_TTF_VERSION_PATCH_LINE}")
-  set(SDL2_TTF_VERSION_STRING ${SDL2_TTF_VERSION_MAJOR}.${SDL2_TTF_VERSION_MINOR}.${SDL2_TTF_VERSION_PATCH})
-  unset(SDL2_TTF_VERSION_MAJOR_LINE)
-  unset(SDL2_TTF_VERSION_MINOR_LINE)
-  unset(SDL2_TTF_VERSION_PATCH_LINE)
-  unset(SDL2_TTF_VERSION_MAJOR)
-  unset(SDL2_TTF_VERSION_MINOR)
-  unset(SDL2_TTF_VERSION_PATCH)
-endif ()
-
-set(SDL2_TTF_LIBRARIES ${SDL2_TTF_LIBRARY})
-set(SDL2_TTF_INCLUDE_DIRS ${SDL2_TTF_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_ttf
-        REQUIRED_VARS SDL2_TTF_LIBRARIES SDL2_TTF_INCLUDE_DIRS
-        VERSION_VAR SDL2_TTF_VERSION_STRING)
-
-# for backward compatiblity
-#set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})
-#set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
-#set(SDLTTF_FOUND ${SDL_TTF_FOUND})


cmake: Convert tabs to spaces

cmake: Convert tabs to spaces

--- cmake/StdargDetect.cmake
+++ cmake/StdargDetect.cmake
@@ -1,49 +1,49 @@
 function (plibsys_detect_va_copy result)
-	#
-	# On platforms that supports va_start() and al.
-	# there is sometimes the need to do va_copy() when
-	# calling another va_list aware function.
-	#
-	# This means that va_copy() is not needed (thus not available)
-	# everywhere.
-	#
-	# We depend on stdarg.h in any case, stdio.h in some cases.
-	#
-	# Known implementations vary from va_copy to __va_copy (old proposed name).
-	# We check the _va_copy eventually.
-	#
-	set (P_VA_COPY FALSE)
-	foreach (KEYWORD "va_copy" "_va_copy" "__va_copy")
-		check_c_source_compiles ("
-					 #include <stdio.h>
-					 #include <stdarg.h>
+    #
+    # On platforms that supports va_start() and al.
+    # there is sometimes the need to do va_copy() when
+    # calling another va_list aware function.
+    #
+    # This means that va_copy() is not needed (thus not available)
+    # everywhere.
+    #
+    # We depend on stdarg.h in any case, stdio.h in some cases.
+    #
+    # Known implementations vary from va_copy to __va_copy (old proposed name).
+    # We check the _va_copy eventually.
+    #
+    set (P_VA_COPY FALSE)
+    foreach (KEYWORD "va_copy" "_va_copy" "__va_copy")
+        check_c_source_compiles ("
+                     #include <stdio.h>
+                     #include <stdarg.h>

-					 void f (int i, ...) {
-						va_list args1, args2;
+                     void f (int i, ...) {
+                        va_list args1, args2;

-						va_start (args1, i);
-						${KEYWORD}(args2, args1);
-						if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) {
-							exit (1);
-						}
-						va_end (args1);
-						va_end (args2);
-					 }
+                        va_start (args1, i);
+                        ${KEYWORD}(args2, args1);
+                        if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) {
+                            exit (1);
+                        }
+                        va_end (args1);
+                        va_end (args2);
+                     }

-					 int main() {
-						f (0, 42);
-						exit(0);
-					 }"
-					PLIBSYS_${KEYWORD}
-		)
+                     int main() {
+                        f (0, 42);
+                        exit(0);
+                     }"
+                    PLIBSYS_${KEYWORD}
+        )

-		if (PLIBSYS_${KEYWORD})
-			set (P_VA_COPY ${KEYWORD})
-			break()
-		endif()
-	endforeach()
+        if (PLIBSYS_${KEYWORD})
+            set (P_VA_COPY ${KEYWORD})
+            break()
+        endif()
+    endforeach()

-	# Assign result
-	set (${result} ${P_VA_COPY} PARENT_SCOPE)
+    # Assign result
+    set (${result} ${P_VA_COPY} PARENT_SCOPE)

 endfunction (plibsys_detect_va_copy)


handle empty extensions

handle empty extensions

--- cmake/fips_private.cmake
+++ cmake/fips_private.cmake
@@ -232,15 +232,17 @@
         # add to current source group
         source_group("${CurGroup}" FILES ${cur_file})

-        if (FIPS_OSX AND ${f_ext})
-            # mark .m as .c file for older cmake versions (bug is fixed in cmake 3.1+)
-            if (${f_ext} STREQUAL ".m")
-                set_source_files_properties(${cur_file} PROPERTIES LANGUAGE C)
-            endif()
-
-            # handle plist files special
-            if (${f_ext} STREQUAL ".plist")
-                set(FIPS_OSX_PLIST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${cur_file}")
+        if (FIPS_OSX)
+            if (${f_ext})
+                # mark .m as .c file for older cmake versions (bug is fixed in cmake 3.1+)
+                if (${f_ext} STREQUAL ".m")
+                    set_source_files_properties(${cur_file} PROPERTIES LANGUAGE C)
+                endif()
+
+                # handle plist files special
+                if (${f_ext} STREQUAL ".plist")
+                    set(FIPS_OSX_PLIST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${cur_file}")
+                endif()
             endif()
         endif()


CMake: Prevent CMake error if list is empty on message

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -38,6 +38,7 @@
 #--------------------------------------------------------------------
 # Only output error messages
 function(message)
+if( GET )
   list(GET ARGV 0 MessageType)
   if(MessageType STREQUAL FATAL_ERROR OR
      MessageType STREQUAL SEND_ERROR OR
@@ -46,6 +47,7 @@
     list(REMOVE_AT ARGV 0)
     _message(STATUS "${ARGV}")
   endif()
+endif()
 endfunction()
 function(ivw_message)
     _message(${ARGV})


Fix build_project source files list.

Fix build_project source files list.

--- backends/cmake/project.cmake
+++ backends/cmake/project.cmake
@@ -102,12 +102,14 @@

 endfunction(show_available_mcus)

-function (build_project source_files)
+function (build_project)
 	if (NOT mcu)
 		show_available_mcus()
 		message(FATAL_ERROR "No MCU selected ! Use -Dmcu=")
 		return()
 	endif(NOT mcu)
+
+	set(source_files ${ARGV})

 	add_executable(${PROJECT_NAME}.elf ${source_files} $<TARGET_OBJECTS:syscall>)
 	target_link_libraries(${PROJECT_NAME}.elf hal_${mcu} ${mcu} ${${MCU}_LINK_FLAGS} -T${LDSCRIPT})


added address sanitizer cmake option for clang

--- common/cmake/clang.cmake
+++ common/cmake/clang.cmake
@@ -74,6 +74,7 @@
 ELSE()

   OPTION(EMBREE_IGNORE_CMAKE_CXX_FLAGS "When enabled Embree ignores default CMAKE_CXX_FLAGS." ON)
+  OPTION(EMBREE_ADDRESS_SANITIZER "Enabled CLANG address sanitizer." OFF)
   IF (EMBREE_IGNORE_CMAKE_CXX_FLAGS)
     SET(CMAKE_CXX_FLAGS "")
   ENDIF()
@@ -99,6 +100,10 @@
     ENDIF()
   ENDMACRO()

+  IF (EMBREE_ADDRESS_SANITIZER)
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize-address-use-after-scope -fno-omit-frame-pointer -fno-optimize-sibling-calls")
+  ENDIF()
+
   SET(CMAKE_CXX_FLAGS_DEBUG "")
   SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")          # enable assertions
   SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTBB_USE_DEBUG")  # configure TBB in debug mode
@@ -119,7 +124,9 @@
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7")   # makes sure code runs on older MacOSX versions
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")             # link against libc++ which supports C++11 features
   ELSE(APPLE)
-    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
+    IF (NOT EMBREE_ADDRESS_SANITIZER) # for address sanitizer this causes link errors
+      SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") # issues link error for undefined symbols in shared library
+    ENDIF()
     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack")     # we do not need an executable stack
     SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z relro -z now")    # re-arranges data sections to increase security
     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")           # we do not need an executable stack


Added a condition so the msvc debug flags are only included for msvc.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -18,7 +18,7 @@
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -${GCC_DEBUG_OPTIMIZATION_LEVEL}")
   endif ()

-  if (MSVC_DEBUG_FLAGS)
+  if (MSVC AND MSVC_DEBUG_FLAGS)
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${MSVC_DEBUG_FLAGS}")
   endif ()


Fix spelling error in cmake message.

Fix spelling error in cmake message.

--- build/cmake/macros/GlibcDetect.cmake
+++ build/cmake/macros/GlibcDetect.cmake
@@ -44,7 +44,7 @@
 	dprint("GLIBC_VERSION=${GLIBC_VERSION}")
 	set(${_VERSION} ${GLIBC_VERSION})
 else()
-	message(STATUS "NOTE: Could not detect GLIBC_VERSION from copiler")
+	message(STATUS "NOTE: Could not detect GLIBC_VERSION from compiler")
 endif()


Fix compile on windows

Fix compile on windows

--- storage/rocksdb/build_rocksdb.cmake
+++ storage/rocksdb/build_rocksdb.cmake
@@ -337,6 +337,7 @@
     port/win/env_default.cc
     port/win/port_win.cc
     port/win/win_logger.cc
+    port/win/win_thread.cc
     port/win/xpress_win.cc)
 else()
   list(APPEND ROCKSDB_SOURCES


One of the tests needs a context device to render

Change-Id: I3dad8993e7057782897ddbe1a232e2df376a91b5

--- Infovis/BoostGraphAlgorithms/module.cmake
+++ Infovis/BoostGraphAlgorithms/module.cmake
@@ -3,7 +3,7 @@
     vtkInfovisCore
     vtkCommonExecutionModel
   TEST_DEPENDS
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingContext${VTK_RENDERING_BACKEND}
     vtkTestingRendering
     vtkInteractionStyle
     vtkIOInfovis


Avoid unnecessary dictionary generation to improve build time

Do not rebuild dictionary if dependant headers did not change

--- cmake/BioDynaMo.cmake
+++ cmake/BioDynaMo.cmake
@@ -77,11 +77,28 @@
   endforeach()
   #---Actual command----------------------------------------
   file(WRITE ${ARG_DICT} "")
+  # determine when dictionary should be rebuilt
+  # solves problem that add_custom_command does not have a target name that
+  # can be used in add_dependencies and add_custom_target is always executed
+  # if CMake configuration changes always rebuild dictionary -> remove file
+  file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/rebuild_${TARGET})
+  add_custom_command(
+    OUTPUT rebuild_${TARGET}
+    COMMAND echo 1 >rebuild_${TARGET}
+    DEPENDS ${headerfiles}
+    COMMENT "Build dictionary ${TARGET}")
+  # invoke genreflex only if rebuild_${TARGET} file does not contain a 0.
+  # Had issues with if [[ ]] statement; used grep instead
+  # if grep does not find the pattern it has a non zero exit code
+  # --> grep 0 file || command
+  #   command is executed if pattern 0 is not found in file
   add_custom_target(${TARGET}
-    COMMAND ${GENREFLEX_EXECUTABLE} ${headerfiles} -o ${ARG_DICT} ${rootmapopts} --select=${selectionfile}
+    COMMAND grep 0 ${CMAKE_CURRENT_BINARY_DIR}/rebuild_${TARGET} >/dev/null ||
+            ${GENREFLEX_EXECUTABLE} ${headerfiles} -o ${ARG_DICT} ${rootmapopts} --select=${selectionfile}
             ${ARG_OPTIONS} ${includedirs} ${definitions} -v >${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.log 2>&1
+    COMMAND echo 0 > ${CMAKE_CURRENT_BINARY_DIR}/rebuild_${TARGET}
     WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
-    DEPENDS ${ARG_DEPENDS})
+    DEPENDS ${ARG_DEPENDS} ${CMAKE_CURRENT_BINARY_DIR}/rebuild_${TARGET})
 endfunction(bdm_generate_dictionary)


[cmake] fix dependency check target names, closes #177 (again)

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -55,7 +55,7 @@
 MACRO( DEPENDENCYCHECK )
     ADD_CUSTOM_TARGET( dependenycheck SOURCES ${ARGN} )
     FOREACH( HEADER ${ARGN} )
-        GET_FILENAME_COMPONENT( fn ${HEADER} NAME )
+	string(REPLACE "/" "_" fn ${HEADER})
         SET( TEST_NAME "dependenycheck_${fn}")
         TO_LIST_SPACES( MY_CXX_FLAGS TEST_NAME_FLAGS )
         SET(XARGS ${TEST_NAME_FLAGS} -DHAVE_CONFIG_H -H -c ${HEADER} -w)


mute 'runtime library file does not exist' cmake warning, when using express editions of MSVC

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@4477 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -58,6 +58,10 @@
   endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
 endif()

+# By default, do not warn when built on machines using only VS Express:
+if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
+  set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
+endif()
 include(InstallRequiredSystemLibraries)

 set(PCL_CPACK_CFG_FILE "${PCL_BINARY_DIR}/cpack_options.cmake")


specify group, display name and description of the documentation component

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@3110 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -69,6 +69,9 @@
     # add documentation
     if(BUILD_documentation)
         set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} doc")
+        set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_GROUP \"PCL\")\n")
+        set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_DISPLAY_NAME \"Documentation\")\n")
+        set(PCL_CPACK_COMPONENTS "${PCL_CPACK_COMPONENTS}\nset(CPACK_COMPONENT_DOC_DESCRIPTION \"API documentation and tutorials\")\n")
     endif(BUILD_documentation)
     # add PCLConfig
     set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL} pclconfig")


Remove -lgcc and -nostdlib from compiler options.

--- cmake/toolchain.cmake
+++ cmake/toolchain.cmake
@@ -5,7 +5,7 @@
         set(CMAKE_CXX_COMPILER "arm-none-eabi-g++")
         set(CMAKE_ASM_COMPILER "arm-none-eabi-as")

-        set(COMMON_FLAGS "-mcpu=cortex-a8 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fno-common -ffunction-sections -fdata-sections -static -lgcc -Wall -Wextra -nostartfiles -nostdinc -nostdlib")
+        set(COMMON_FLAGS "-mcpu=cortex-a8 -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -fno-common -ffunction-sections -fdata-sections -static -Wall -Wextra -nostartfiles -nostdinc")
         set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
         set(CMAKE_EXECUTABLE_SUFFIX ".elf")


Detect openmp::openmp target correctly when deciding on default mkl threading layer

Former-commit-id: d24d9e71fd3cbe9cbc8156235633dec4c87735e2

--- cmake-modules/SetupMKL.cmake
+++ cmake-modules/SetupMKL.cmake
@@ -28,13 +28,14 @@
     endif()
     set(MKL_THREAD_DEFAULT none)
     if(TARGET openmp::openmp)
-        if(OMP_LIBNAME MATCHES gomp|libomp)
+        if(OMP_LIBNAME MATCHES iomp)
+            set(MKL_THREAD_DEFAULT intel)
+        elseif(OMP_LIBNAME MATCHES gomp|libomp|CXX)
             set(MKL_THREAD_DEFAULT gnu)
-        elseif(OMP_LIBNAME MATCHES iomp)
-            set(MKL_THREAD_DEFAULT intel)
         endif()
     endif()
-
+    message(STATUS "MKL_THREAD_DEFAULT: ${MKL_THREAD_DEFAULT}")
+    message(STATUS "OMP_LIBNAME       : ${OMP_LIBNAME}")
     # Make an "enum" for valid download methods
     set(MKL_THREADING_VALID none gnu intel tbb)
     set(MKL_THREADING_LAYER ${MKL_THREAD_DEFAULT} CACHE STRING "Intel MKL Threading Layer")


pluginprocess: try fixing asan on clang

pluginprocess: try fixing asan on clang

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -120,11 +120,13 @@
 #
 if (ENABLE_ASAN)
 	set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer")
-	set (ASAN_LIBRARY "-lasan") # this is needed for GIR to put asan in front
+	set (ASAN_LIBRARY "-lubsan") # this is needed for GIR to put asan in front

 	if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
 		set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize=integer")
 		set (EXTRA_FLAGS "${EXTRA_FLAGS} -fsanitize-blacklist=\"${CMAKE_SOURCE_DIR}/tests/sanitizer.blacklist\"")
+		# on some systems clang does not link the asan/ubsan libraries, so enforce it
+		set (CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lubsan")
 	endif ()

 	if (CMAKE_COMPILER_IS_GNUCXX)


GRPC libraries were in wrong order

GRPC libraries were in wrong order

--- cmake/Modules/FindGRPC.cmake
+++ cmake/Modules/FindGRPC.cmake
@@ -44,5 +44,5 @@

 if(GRPC_FOUND)
     set(GRPC_INCLUDE_DIRS ${GRPC_INCLUDE_DIR})
-    set(GRPC_LIBRARIES ${GRPC_LIBRARY} ${GRPCP_UNSECURE_LIBRARY} ${GPR_LIBRARY})
+    set(GRPC_LIBRARIES ${GRPCP_UNSECURE_LIBRARY} ${GRPC_LIBRARY} ${GPR_LIBRARY})
 endif()


New SIZE_VERBOSE option for firmware and example targets.

If selected, it will print something like

AVR Memory Usage
----------------
Device: atmega32u4

Program:   19780 bytes (60.4% Full)
(.text + .data + .bootloader)

Data:       1949 bytes (76.1% Full)
(.data + .bss + .noinit)

This helps to understand, how much memory is left for code and how much RAM is available for stack.

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -10,7 +10,8 @@
 #      [PROGRAMMER programmer_id]
 #      [AFLAGS flags]
 #      [NO_AUTOLIBS]
-#      [MANUAL])
+#      [MANUAL]
+#      [SIZE_VERBOSE])
 #=============================================================================#
 #
 #   generaters firmware and libraries for Arduino devices
@@ -28,7 +29,8 @@
 #      PROGRAMMER     # Programmer id (enables programmer support)
 #      AFLAGS         # Avrdude flags for target
 #      NO_AUTOLIBS    # Disables Arduino library detection
-#      MANUAL     # (Advanced) Only use AVR Libc/Includes
+#      MANUAL         # (Advanced) Only use AVR Libc/Includes
+#      SIZE_VERBOSE   # (Advanced) Show verbose size info
 #
 # Here is a short example for a target named test:
 #
@@ -95,7 +97,8 @@
 #                          [PORT port]
 #                          [SERIAL serial command]
 #                          [PORGRAMMER programmer_id]
-#                          [AFLAGS avrdude_flags])
+#                          [AFLAGS avrdude_flags]
+#                          [SIZE_VERBOSE])
 #=============================================================================#
 #
 #        name         - The name of the library example        [REQUIRED]
@@ -106,6 +109,7 @@
 #        SERIAL       - Serial command [optional]
 #        PROGRAMMER   - Programmer id (enables programmer support)
 #        AFLAGS       - Avrdude flags for target
+#        SIZE_VERBOSE - (Advanced) Show verbose size info
 #
 # Creates a example from the specified library.
 #
@@ -288,9 +292,9 @@
 function(GENERATE_ARDUINO_FIRMWARE INPUT_NAME)
     message(STATUS "Generating ${INPUT_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
-                              "NO_AUTOLIBS;MANUAL"            # Options
-                              "BOARD;PORT;SKETCH;PROGRAMMER"  # One Value Keywords
-                              "SERIAL;SRCS;HDRS;LIBS;AFLAGS"  # Multi Value Keywords
+                              "NO_AUTOLIBS;MANUAL;SIZE_VERBOSE"   # Options
+                              "BOARD;PORT;SKETCH;PROGRAMMER"      # One Value Keywords
+                              "SERIAL;SRCS;HDRS;LIBS;AFLAGS"      # Multi Value Keywords
                               ${ARGN})

     if(NOT INPUT_BOARD)
@@ -341,9 +345,9 @@
     endif()

     list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})
-
-    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD} "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" "${INPUT_MANUAL}")
-
+
+    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD} "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" "${INPUT_MANUAL}" "${INPUT_SIZE_VERBOSE}")
+
     if(INPUT_PORT)
         setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT} "${INPUT_PROGRAMMER}" "${INPUT_AFLAGS}")
     endif()
@@ -361,7 +365,7 @@
 function(GENERATE_ARDUINO_EXAMPLE INPUT_NAME)
     message(STATUS "Generating example ${LIBRARY_NAME}-${EXAMPLE_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
-                              ""                                       # Options
+                              "SIZE_VERBOSE"                           # Options
                               "LIBRARY;EXAMPLE;BOARD;PORT;PROGRAMMER"  # One Value Keywords
                               "SERIAL;AFLAGS"                          # Multi Value Keywords
                               ${ARGN})
@@ -402,7 +406,7 @@

     list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})

-    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD}  "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" FALSE)
+    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD}  "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" FALSE "${INPUT_SIZE_VERBOSE}")

     if(INPUT_PORT)
         setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT} "${INPUT_PROGRAMMER}" "${INPUT_AFLAGS}")
@@ -741,11 +745,12 @@
 #        COMPILE_FLAGS - Compile flags
 #        LINK_FLAGS    - Linker flags
 #        MANUAL - (Advanced) Only use AVR Libc/Includes
+#        SIZE_VERBOSE - (Advanced) Show verbose size info
 #
 # Creates an Arduino firmware target.
 #
 #=============================================================================#
-function(setup_arduino_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS MANUAL)
+function(setup_arduino_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS MANUAL SIZE_VERBOSE)

     add_executable(${TARGET_NAME} ${ALL_SRCS})
     set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".elf")
@@ -775,21 +780,42 @@
                         COMMENT "Generating HEX image"
                         VERBATIM)

-    # Display target size
-    add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
-                        COMMAND ${CMAKE_COMMAND}
-                        ARGS    -DFIRMWARE_IMAGE=${TARGET_PATH}.hex
-                                -P ${ARDUINO_SIZE_SCRIPT}
-                        COMMENT "Calculating image size"
-                        VERBATIM)
-
-    # Create ${TARGET_NAME}-size target
-    add_custom_target(${TARGET_NAME}-size
-                        COMMAND ${CMAKE_COMMAND}
-                                -DFIRMWARE_IMAGE=${TARGET_PATH}.hex
-                                -P ${ARDUINO_SIZE_SCRIPT}
-                        DEPENDS ${TARGET_NAME}
-                        COMMENT "Calculating ${TARGET_NAME} image size")
+    if (${SIZE_VERBOSE})
+        # Display target size (verbose)
+        add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
+                            COMMAND ${CMAKE_COMMAND}
+                            ARGS    -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
+                                    -DMCU=${${BOARD_ID}.build.mcu}
+                                    -P ${ARDUINO_VERBOSE_SIZE_SCRIPT}
+                            COMMENT "Calculating image size (verbose)"
+                            VERBATIM)
+
+        # Create ${TARGET_NAME}-size-verbose target
+        add_custom_target(${TARGET_NAME}-size-verbose
+                            COMMAND ${CMAKE_COMMAND}
+                                    -DFIRMWARE_IMAGE=${TARGET_PATH}.elf
+                                    -DMCU=${${BOARD_ID}.build.mcu}
+                                    -P ${ARDUINO_VERBOSE_SIZE_SCRIPT}
+                            DEPENDS ${TARGET_NAME}
+                            COMMENT "Calculating ${TARGET_NAME} image size (verbose)")
+    else()
+        # Display target size
+        add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
+                            COMMAND ${CMAKE_COMMAND}
+                            ARGS    -DFIRMWARE_IMAGE=${TARGET_PATH}.hex
+                                    -P ${ARDUINO_SIZE_SCRIPT}
+                            COMMENT "Calculating image size"
+                            VERBATIM)
+
+        # Create ${TARGET_NAME}-size target
+        add_custom_target(${TARGET_NAME}-size
+                            COMMAND ${CMAKE_COMMAND}
+                                    -DFIRMWARE_IMAGE=${TARGET_PATH}.hex
+                                    -P ${ARDUINO_SIZE_SCRIPT}
+                            DEPENDS ${TARGET_NAME}
+                            COMMENT "Calculating ${TARGET_NAME} image size")
+    endif()
+
 endfunction()

 #=============================================================================#
@@ -1545,6 +1571,32 @@
 #=============================================================================#
 # [PRIVATE/INTERNAL]
 #
+# setup_arduino_verbose_size_script(OUTPUT_VAR)
+#
+#        OUTPUT_VAR - Output variable that will contain the script path
+#
+# Generates script used to display the firmware size.
+#=============================================================================#
+function(SETUP_ARDUINO_VERBOSE_SIZE_SCRIPT OUTPUT_VAR)
+    set(ARDUINO_VERBOSE_SIZE_SCRIPT_PATH ${CMAKE_BINARY_DIR}/CMakeFiles/FirmwareSizeVerbose.cmake)
+
+    file(WRITE ${ARDUINO_VERBOSE_SIZE_SCRIPT_PATH} "
+        set(AVRSIZE_PROGRAM ${AVRSIZE_PROGRAM})
+        set(AVRSIZE_FLAGS -C --mcu=\${MCU})
+
+        execute_process(COMMAND \${AVRSIZE_PROGRAM} \${AVRSIZE_FLAGS} \${FIRMWARE_IMAGE}
+                        OUTPUT_VARIABLE SIZE_OUTPUT)
+
+        string(STRIP \"\${SIZE_OUTPUT}\" SIZE_OUTPUT)
+        message(\"\${SIZE_OUTPUT}\")
+    ")
+
+    set(${OUTPUT_VAR} ${ARDUINO_VERBOSE_SIZE_SCRIPT_PATH} PARENT_SCOPE)
+endfunction()
+
+#=============================================================================#
+# [PRIVATE/INTERNAL]
+#
 #  arduino_debug_on()
 #
 # Enables Arduino module debugging.
@@ -1820,6 +1872,9 @@

     setup_arduino_size_script(ARDUINO_SIZE_SCRIPT)
     set(ARDUINO_SIZE_SCRIPT ${ARDUINO_SIZE_SCRIPT} CACHE INTERNAL "Arduino Size Script")
+
+    setup_arduino_verbose_size_script(ARDUINO_VERBOSE_SIZE_SCRIPT)
+    set(ARDUINO_VERBOSE_SIZE_SCRIPT ${ARDUINO_VERBOSE_SIZE_SCRIPT} CACHE INTERNAL "Arduino Verbose Size Script")

     load_board_settings()
     load_programmers_settings()


Added functions to easily create AVR (non-Arduino) firmware and libraries

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -50,6 +50,52 @@
 # All variables need to be prefixed with the target name (${TARGET_NAME}_${OPTION}).
 #
 #=============================================================================#
+# generate_avr_firmware(name
+#      [BOARD board_id]
+#       SRCS  src1 src2 ... srcN]
+#      [HDRS  hdr1 hdr2 ... hdrN]
+#      [LIBS  lib1 lib2 ... libN]
+#      [PORT  port]
+#      [SERIAL serial_cmd]
+#      [PROGRAMMER programmer_id]
+#      [AFLAGS flags])
+#=============================================================================#
+#
+#   generaters firmware and libraries for AVR devices
+#   it simply calls generate_arduino_firmware() with NO_AUTOLIBS and MANUAL
+#
+# The arguments are as follows:
+#
+#      name           # The name of the firmware target         [REQUIRED]
+#      BOARD          # Board name (such as uno, mega2560, ...) [REQUIRED]
+#      SRCS           # Sources                                 [REQUIRED]
+#      HDRS           # Headers
+#      LIBS           # Libraries to link
+#      PORT           # Serial port (enables upload support)
+#      SERIAL         # Serial command for serial target
+#      PROGRAMMER     # Programmer id (enables programmer support)
+#      AFLAGS         # Avrdude flags for target
+#
+# Here is a short example for a target named test:
+#
+#       generate_avr_firmware(
+#           NAME test
+#           SRCS test.cpp
+#                test2.cpp
+#           HDRS test.h test2.h
+#           BOARD uno)
+#
+# Alternatively you can specify the option by variables:
+#
+#       set(test_SRCS test.cpp test2.cpp)
+#       set(test_HDRS test.h test2.h
+#       set(test_BOARD uno)
+#
+#       generate_avr_firmware(test)
+#
+# All variables need to be prefixed with the target name (${TARGET_NAME}_${OPTION}).
+#
+#=============================================================================#
 # generate_arduino_library(name
 #      [BOARD board_id]
 #      [SRCS  src1 src2 ... srcN]
@@ -90,6 +136,43 @@
 # All variables need to be prefixed with the target name (${TARGET_NAME}_${OPTION}).
 #
 #=============================================================================#
+# generate_avr_library(name
+#      [BOARD board_id]
+#      [SRCS  src1 src2 ... srcN]
+#      [HDRS  hdr1 hdr2 ... hdrN]
+#      [LIBS  lib1 lib2 ... libN])
+#=============================================================================#
+#   generaters firmware and libraries for AVR devices
+#   it simply calls generate_arduino_library() with NO_AUTOLIBS and MANUAL
+#
+# The arguments are as follows:
+#
+#      name           # The name of the firmware target         [REQUIRED]
+#      BOARD          # Board name (such as uno, mega2560, ...) [REQUIRED]
+#      SRCS           # Sources                                 [REQUIRED]
+#      HDRS           # Headers
+#      LIBS           # Libraries to link
+#
+# Here is a short example for a target named test:
+#
+#       generate_avr_library(
+#           NAME test
+#           SRCS test.cpp
+#                test2.cpp
+#           HDRS test.h test2.h
+#           BOARD uno)
+#
+# Alternatively you can specify the option by variables:
+#
+#       set(test_SRCS test.cpp test2.cpp)
+#       set(test_HDRS test.h test2.h
+#       set(test_BOARD uno)
+#
+#       generate_avr_library(test)
+#
+# All variables need to be prefixed with the target name (${TARGET_NAME}_${OPTION}).
+#
+#=============================================================================#
 # generate_arduino_example(name
 #                          LIBRARY library_name
 #                          EXAMPLE example_name
@@ -281,6 +364,41 @@
                 LINK_FLAGS "${ARDUINO_LINK_FLAGS} ${LINK_FLAGS}")

     target_link_libraries(${INPUT_NAME} ${ALL_LIBS} "-lc -lm")
+endfunction()
+
+#=============================================================================#
+# [PUBLIC/USER]
+# see documentation at top
+#=============================================================================#
+function(GENERATE_AVR_LIBRARY INPUT_NAME)
+    message(STATUS "Generating ${INPUT_NAME}")
+    parse_generator_arguments(${INPUT_NAME} INPUT
+                              "NO_AUTOLIBS;MANUAL"                  # Options
+                              "BOARD"                               # One Value Keywords
+                              "SRCS;HDRS;LIBS"                      # Multi Value Keywords
+                              ${ARGN})
+
+    if(NOT INPUT_BOARD)
+        set(INPUT_BOARD ${ARDUINO_DEFAULT_BOARD})
+    endif()
+
+    required_variables(VARS INPUT_SRCS INPUT_BOARD MSG "must define for target ${INPUT_NAME}")
+
+    if(INPUT_HDRS)
+        set( INPUT_HDRS "SRCS ${INPUT_HDRS}" )
+    endif()
+    if(INPUT_LIBS)
+        set( INPUT_LIBS "LIBS ${INPUT_LIBS}" )
+    endif()
+
+    generate_arduino_library( ${INPUT_NAME}
+        NO_AUTOLIBS
+        MANUAL
+        BOARD ${INPUT_BOARD}
+        SRCS ${INPUT_SRCS}
+        ${INPUT_HDRS}
+        ${INPUT_LIBS} )
+
 endfunction()

 #=============================================================================#
@@ -354,6 +472,57 @@
         setup_serial_target(${INPUT_NAME} "${INPUT_SERIAL}" "${INPUT_PORT}")
     endif()

+endfunction()
+
+#=============================================================================#
+# [PUBLIC/USER]
+# see documentation at top
+#=============================================================================#
+function(GENERATE_AVR_FIRMWARE INPUT_NAME)
+    message(STATUS "Generating ${INPUT_NAME}")
+    parse_generator_arguments(${INPUT_NAME} INPUT
+                              "NO_AUTOLIBS;MANUAL"            # Options
+                              "BOARD;PORT;PROGRAMMER"  # One Value Keywords
+                              "SERIAL;SRCS;HDRS;LIBS;AFLAGS"  # Multi Value Keywords
+                              ${ARGN})
+
+    if(NOT INPUT_BOARD)
+        set(INPUT_BOARD ${ARDUINO_DEFAULT_BOARD})
+    endif()
+    if(NOT INPUT_PORT)
+        set(INPUT_PORT ${ARDUINO_DEFAULT_PORT})
+    endif()
+    if(NOT INPUT_SERIAL)
+        set(INPUT_SERIAL ${ARDUINO_DEFAULT_SERIAL})
+    endif()
+    if(NOT INPUT_PROGRAMMER)
+        set(INPUT_PROGRAMMER ${ARDUINO_DEFAULT_PROGRAMMER})
+    endif()
+
+    required_variables(VARS INPUT_BOARD INPUT_SRCS MSG "must define for target ${INPUT_NAME}")
+
+    if(INPUT_HDRS)
+        set( INPUT_HDRS "SRCS ${INPUT_HDRS}" )
+    endif()
+    if(INPUT_LIBS)
+        set( INPUT_LIBS "LIBS ${INPUT_LIBS}" )
+    endif()
+    if(INPUT_AFLAGS)
+        set( INPUT_AFLAGS "AFLAGS ${INPUT_AFLAGS}" )
+    endif()
+
+    generate_arduino_firmware( ${INPUT_NAME}
+        NO_AUTOLIBS
+        MANUAL
+        BOARD ${INPUT_BOARD}
+        PORT ${INPUT_PORT}
+        PROGRAMMER ${INPUT_PROGRAMMER}
+        SERIAL ${INPUT_SERIAL}
+        SRCS ${INPUT_SRCS}
+        ${INPUT_HDRS}
+        ${INPUT_LIBS}
+        ${INPUT_AFLAGS} )
+
 endfunction()

 #=============================================================================#


Ammend variable name from NATIVE_AVR to manual to be consistent with issue #44

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -10,7 +10,7 @@
 #      [PROGRAMMER programmer_id]
 #      [AFLAGS flags]
 #      [NO_AUTOLIBS]
-#      [NATIVE_AVR])
+#      [MANUAL])
 #=============================================================================#
 #
 #   generaters firmware and libraries for Arduino devices
@@ -28,7 +28,7 @@
 #      PROGRAMMER     # Programmer id (enables programmer support)
 #      AFLAGS         # Avrdude flags for target
 #      NO_AUTOLIBS    # Disables Arduino library detection
-#      NATIVE_AVR     # (Advanced) Only use AVR Libc/Includes
+#      MANUAL     # (Advanced) Only use AVR Libc/Includes
 #
 # Here is a short example for a target named test:
 #
@@ -227,20 +227,25 @@
 function(GENERATE_ARDUINO_LIBRARY INPUT_NAME)
     message(STATUS "Generating ${INPUT_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
-                              "NO_AUTOLIBS"                         # Options
+                              "NO_AUTOLIBS;MANUAL"                  # Options
                               "BOARD"                               # One Value Keywords
                               "SRCS;HDRS;LIBS"                      # Multi Value Keywords
                               ${ARGN})

     if(NOT INPUT_BOARD)
         set(INPUT_BOARD ${ARDUINO_DEFAULT_BOARD})
+    endif()
+    if(NOT INPUT_MANUAL)
+        set(INPUT_MANUAL FALSE)
     endif()
     required_variables(VARS INPUT_SRCS INPUT_BOARD MSG "must define for target ${INPUT_NAME}")

     set(ALL_LIBS)
     set(ALL_SRCS ${INPUT_SRCS} ${INPUT_HDRS})

-    setup_arduino_core(CORE_LIB ${INPUT_BOARD})
+    if(NOT INPUT_MANUAL)
+      setup_arduino_core(CORE_LIB ${INPUT_BOARD})
+    endif()

     find_arduino_libraries(TARGET_LIBS "${ALL_SRCS}")
     set(LIB_DEP_INCLUDES)
@@ -256,7 +261,7 @@

     add_library(${INPUT_NAME} ${ALL_SRCS})

-    get_arduino_flags(ARDUINO_COMPILE_FLAGS ARDUINO_LINK_FLAGS  ${INPUT_BOARD} FALSE)
+    get_arduino_flags(ARDUINO_COMPILE_FLAGS ARDUINO_LINK_FLAGS  ${INPUT_BOARD} ${INPUT_MANUAL})

     set_target_properties(${INPUT_NAME} PROPERTIES
                 COMPILE_FLAGS "${ARDUINO_COMPILE_FLAGS} ${COMPILE_FLAGS} ${LIB_DEP_INCLUDES}"
@@ -272,7 +277,7 @@
 function(GENERATE_ARDUINO_FIRMWARE INPUT_NAME)
     message(STATUS "Generating ${INPUT_NAME}")
     parse_generator_arguments(${INPUT_NAME} INPUT
-                              "NO_AUTOLIBS;NATIVE_AVR"              # Options
+                              "NO_AUTOLIBS;MANUAL"              # Options
                               "BOARD;PORT;SKETCH;SERIAL;PROGRAMMER" # One Value Keywords
                               "SRCS;HDRS;LIBS;AFLAGS"               # Multi Value Keywords
                               ${ARGN})
@@ -289,8 +294,8 @@
     if(NOT INPUT_PROGRAMMER)
         set(INPUT_SERIAL ${ARDUINO_DEFAULT_PROGRAMMER})
     endif()
-    if(NOT INPUT_NATIVE_AVR)
-        set(INPUT_NATIVE_AVR FALSE)
+    if(NOT INPUT_MANUAL)
+        set(INPUT_MANUAL FALSE)
     endif()
     required_variables(VARS INPUT_BOARD MSG "must define for target ${INPUT_NAME}")

@@ -298,7 +303,7 @@
     set(ALL_SRCS ${INPUT_SRCS} ${INPUT_HDRS})
     set(LIB_DEP_INCLUDES)

-    if(NOT INPUT_NATIVE_AVR)
+    if(NOT INPUT_MANUAL)
       setup_arduino_core(CORE_LIB ${INPUT_BOARD})
     endif()

@@ -321,7 +326,7 @@

     list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS})

-    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD} "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" "${INPUT_NATIVE_AVR}")
+    setup_arduino_target(${INPUT_NAME} ${INPUT_BOARD} "${ALL_SRCS}" "${ALL_LIBS}" "${LIB_DEP_INCLUDES}" "" "${INPUT_MANUAL}")

     if(INPUT_PORT)
         setup_arduino_upload(${INPUT_BOARD} ${INPUT_NAME} ${INPUT_PORT} "${INPUT_PROGRAMMER}" "${INPUT_AFLAGS}")
@@ -477,17 +482,17 @@
 #=============================================================================#
 # [PRIVATE/INTERNAL]
 #
-# get_arduino_flags(COMPILE_FLAGS LINK_FLAGS BOARD_ID NATIVE_AVR)
+# get_arduino_flags(COMPILE_FLAGS LINK_FLAGS BOARD_ID MANUAL)
 #
 #       COMPILE_FLAGS_VAR -Variable holding compiler flags
 #       LINK_FLAGS_VAR - Variable holding linker flags
 #       BOARD_ID - The board id name
-#       NATIVE_AVR - (Advanced) Only use AVR Libc/Includes
+#       MANUAL - (Advanced) Only use AVR Libc/Includes
 #
 # Configures the the build settings for the specified Arduino Board.
 #
 #=============================================================================#
-function(get_arduino_flags COMPILE_FLAGS_VAR LINK_FLAGS_VAR BOARD_ID NATIVE_AVR)
+function(get_arduino_flags COMPILE_FLAGS_VAR LINK_FLAGS_VAR BOARD_ID MANUAL)

     set(BOARD_CORE ${${BOARD_ID}.build.core})
     if(BOARD_CORE)
@@ -508,13 +513,13 @@

         # output
         set(COMPILE_FLAGS "-DF_CPU=${${BOARD_ID}.build.f_cpu} -DARDUINO=${ARDUINO_VERSION_DEFINE} -mmcu=${${BOARD_ID}.build.mcu}")
-        if(NOT NATIVE_AVR)
+        if(NOT MANUAL)
           set(COMPILE_FLAGS "${COMPILE_FLAGS} -I${ARDUINO_CORES_PATH}/${BOARD_CORE} -I${ARDUINO_LIBRARIES_PATH}")
         endif()
         set(LINK_FLAGS "-mmcu=${${BOARD_ID}.build.mcu}")
         if(ARDUINO_SDK_VERSION VERSION_GREATER 1.0 OR ARDUINO_SDK_VERSION VERSION_EQUAL 1.0)
             set(PIN_HEADER ${${BOARD_ID}.build.variant})
-            if(NOT NATIVE_AVR)
+            if(NOT MANUAL)
               set(COMPILE_FLAGS "${COMPILE_FLAGS} -I${ARDUINO_VARIANTS_PATH}/${PIN_HEADER}")
             endif()
         endif()
@@ -711,7 +716,7 @@
 #=============================================================================#
 # [PRIVATE/INTERNAL]
 #
-# setup_arduino_target(TARGET_NAME ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS NATIVE_AVR)
+# setup_arduino_target(TARGET_NAME ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS MANUAL)
 #
 #        TARGET_NAME - Target name
 #        BOARD_ID    - Arduino board ID
@@ -719,17 +724,17 @@
 #        ALL_LIBS    - All libraries
 #        COMPILE_FLAGS - Compile flags
 #        LINK_FLAGS    - Linker flags
-#        NATIVE_AVR - (Advanced) Only use AVR Libc/Includes
+#        MANUAL - (Advanced) Only use AVR Libc/Includes
 #
 # Creates an Arduino firmware target.
 #
 #=============================================================================#
-function(setup_arduino_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS NATIVE_AVR)
+function(setup_arduino_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS COMPILE_FLAGS LINK_FLAGS MANUAL)

     add_executable(${TARGET_NAME} ${ALL_SRCS})
     set_target_properties(${TARGET_NAME} PROPERTIES SUFFIX ".elf")

-    get_arduino_flags(ARDUINO_COMPILE_FLAGS ARDUINO_LINK_FLAGS  ${BOARD_ID} ${NATIVE_AVR})
+    get_arduino_flags(ARDUINO_COMPILE_FLAGS ARDUINO_LINK_FLAGS  ${BOARD_ID} ${MANUAL})

     set_target_properties(${TARGET_NAME} PROPERTIES
                 COMPILE_FLAGS "${ARDUINO_COMPILE_FLAGS} ${COMPILE_FLAGS}"


Removing clang compiler option of -stdlib=stdlibc++ since it fails on some systems. Detecting if libstdc++ is installed (instead of libc++) is something I will eventually look into but dont have the time right now.

--- cmake/compiler_options.cmake
+++ cmake/compiler_options.cmake
@@ -29,13 +29,13 @@
   # Check version. If empty, warn. If too old, error out:
   if ("${CMAKE_CXX_COMPILER_VERSION}" STREQUAL "")
     message(WARNING "Clang compiler version is unknown, proceed at your own risk!")
-  elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)
-    message(FATAL_ERROR "Clang compiler version must be at least 3.6 (current version: ${CMAKE_CXX_COMPILER_VERSION})!")
+  elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.4)
+    message(FATAL_ERROR "Clang compiler version must be at least 3.4 (current version: ${CMAKE_CXX_COMPILER_VERSION})!")
   endif()

   # Set compiler/linker specific flags:
-  set(CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11 -stdlib=libc++")
-  set(CMAKE_CXX_FLAGS_RELEASE "-w -O3 -std=c++11 -stdlib=libc++")
+  set(CMAKE_CXX_FLAGS_DEBUG "-Wall -ggdb -std=c++11")
+  set(CMAKE_CXX_FLAGS_RELEASE "-w -O3 -std=c++11")

 elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")


Remove unused method add_swift_llvm_loadable_module

This function was discovered to be unused during the review of #435. It
was requested that it be removed as a subsequent pull.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1847,37 +1847,3 @@
       ${SWIFTEXE_DONT_STRIP_NON_MAIN_SYMBOLS_FLAG}
       ${SWIFTEXE_DISABLE_ASLR_FLAG})
 endfunction()
-
-function(add_swift_llvm_loadable_module name)
-  add_llvm_loadable_module(${name} ${ARGN})
-  set(sdk "${SWIFT_HOST_VARIANT_SDK}")
-  set(arch "${SWIFT_HOST_VARIANT_ARCH}")
-
-  # Determine compiler flags.
-  set(c_compile_flags)
-  _add_variant_c_compile_flags(
-      "${sdk}"
-      "${arch}"
-      "${CMAKE_BUILD_TYPE}"
-      "${LLVM_ENABLE_ASSERTIONS}"
-      FALSE
-      c_compile_flags)
-
-  set(link_flags)
-  _add_variant_link_flags(
-      "${sdk}"
-      "${arch}"
-      "${CMAKE_BUILD_TYPE}"
-      "${LLVM_ENABLE_ASSERTIONS}"
-      FALSE
-      link_flags)
-
-  # Convert variables to space-separated strings.
-  _list_escape_for_shell("${c_compile_flags}" c_compile_flags)
-  _list_escape_for_shell("${link_flags}" link_flags)
-
-  set_property(TARGET ${name} APPEND_STRING PROPERTY
-      COMPILE_FLAGS " ${c_compile_flags}")
-  set_property(TARGET ${name} APPEND_STRING PROPERTY
-      LINK_FLAGS " ${link_flags}")
-endfunction()


fix for x86 android build break (#5088)

fix for x86 android build break (#5088)

--- cmake/onnxruntime_mlas.cmake
+++ cmake/onnxruntime_mlas.cmake
@@ -176,7 +176,11 @@
     set(mlas_platform_srcs_avx
       ${ONNXRUNTIME_ROOT}/core/mlas/lib/x86/SgemmKernelAvx.S
     )
-    set_source_files_properties(${mlas_platform_srcs_avx} PROPERTIES COMPILE_FLAGS "-mavx")
+    if (CMAKE_SYSTEM_NAME STREQUAL "Android")
+      set_source_files_properties(${mlas_platform_srcs_avx} PROPERTIES COMPILE_FLAGS "-mavx -fno-integrated-as")
+    else()
+      set_source_files_properties(${mlas_platform_srcs_avx} PROPERTIES COMPILE_FLAGS "-mavx")
+    endif()

     set(mlas_platform_srcs
       ${mlas_platform_srcs_sse2}


Updated LIBXSMM.

Updated LIBXSMM.

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -13,8 +13,8 @@

   FetchContent_Declare(
     xsmm
-    URL https://github.com/libxsmm/libxsmm/archive/efa1502f13f7ed0c447351496c66abd0e729e80c.tar.gz
-    URL_HASH SHA256=ca5a508c6127d78ea068a73c632035a30583bba96dd5f0514238d249c60dedfc
+    URL https://github.com/libxsmm/libxsmm/archive/ab955d900b07875f36ef66f9a3d8b93e6a3102ec.tar.gz
+    URL_HASH SHA256=d3201906775fe53fc0afe9f927432635186944e7356d7df171d62db50510d717
   )

   FetchContent_GetProperties(xsmm)


Fixed MXML configuration

Fixed MXML configuration

--- cmake_include/FindMXML.cmake
+++ cmake_include/FindMXML.cmake
@@ -26,22 +26,30 @@
 #==============================================================================

-if(CMAKE_HOST_UNIX)
-    find_module(MXML
-                LIB_NAMES mxml
-                HEADER_NAMES mxml.h
-                MOD_NAME mxml)
+#------------------------------------------------------------------------------
+# find the runtime binaries of the MXML library
+#------------------------------------------------------------------------------
+find_library(MXML_LIBRARY NAMES mxml mxml1)
+
+
+if(MXML_LIBRARY MATCHES MXML_LIBRARY-NOTFOUND)
+    message(FATAL_ERROR "Could not find MXML library!")
 else()
-    find_module(MXML
-                LIB_NAMES mxml mxml1
-                HEADER_NAMES mxml.h
-                MOD_NAME mxml)
+    get_filename_component(MXML_LIBRARY_DIRS ${MXML_LIBRARY} PATH)
+    message(STATUS "Found MXML library: ${MXML_LIBRARY}")
+    message(STATUS "MXML libary path: ${MXML_LIBRARY_DIRS}")
 endif()

-if(NOT HAVE_MXML)
-    #the user has explicitely requested to build with MXML - as we could not
-    #find the library we have to exit the configuration
-    message(FATAL_ERROR "User requested MXML not found!")
+#------------------------------------------------------------------------------
+# find the MXML header file
+#------------------------------------------------------------------------------
+find_path(MXML_INCLUDE_DIRS mxml.h)
+
+if(MXML_INCLUDE_DIRS MATCHES MXML_INCLUDE_DIRS-NOTFOUND)
+    message(FATAL_ERROR "Could not find MXML header files")
+else()
+    message(STATUS "Found MXML header files in: ${MXML_INCLUDE_DIRS}")
 endif()

-list(APPEND NAPI_LINK_LIBS ${MXML_LIBFILES})
+include_directories(${MXML_INCLUDE_DIRS})
+list(APPEND NAPI_LINK_LIBS ${MXML_LIBRARY})


Correctly set HAVE_BSD_REGS_T flag during configure.

Currently the test sets a flag which is found nowhere else in the code.

    $ grep -R " BSD_REGS" * | wc -l
    0

This fixes a bunch of issues when trying to build on FreeBSD.

--- src/pal/src/configure.cmake
+++ src/pal/src/configure.cmake
@@ -67,7 +67,7 @@
 check_struct_has_member ("ucontext_t" uc_mcontext.gregs[0] ucontext.h HAVE_GREGSET_T)

 set(CMAKE_EXTRA_INCLUDE_FILES machine/reg.h)
-check_type_size("struct regs" BSD_REGS_T)
+check_type_size("struct regs" HAVE_BSD_REGS_T)
 set(CMAKE_EXTRA_INCLUDE_FILES)
 set(CMAKE_EXTRA_INCLUDE_FILES asm/ptrace.h)
 check_type_size("struct pt_regs" PT_REGS)


Add dashboard_git_branch support to set branch to build


Use the .a files where openssl have been merged in

--- CMake/RealmCore.cmake
+++ CMake/RealmCore.cmake
@@ -325,8 +325,13 @@
     ExternalProject_Get_Property(realm-sync-lib SOURCE_DIR)
     set(sync_directory ${SOURCE_DIR})

-    set(sync_library_debug ${sync_directory}/src/realm/librealm-sync${platform}-dbg.a)
-    set(sync_library_release ${sync_directory}/src/realm/librealm-sync${platform}.a)
+    if(REALM_PLATFORM STREQUAL "Android")
+        set(sync_library_debug ${sync_directory}/android-lib/librealm-sync${platform}-dbg.a)
+        set(sync_library_release ${sync_directory}/android-lib/librealm-sync${platform}.a)
+    else()
+        set(sync_library_debug ${sync_directory}/src/realm/librealm-sync${platform}-dbg.a)
+        set(sync_library_release ${sync_directory}/src/realm/librealm-sync${platform}.a)
+    endif()
     set(sync_libraries ${sync_library_debug} ${sync_library_release})

     ExternalProject_Add_Step(realm-sync-lib ensure-libraries
@@ -346,8 +351,13 @@
     set_property(TARGET realm-sync PROPERTY INTERFACE_LINK_LIBRARIES ${SSL_LIBRARIES})

     # Sync server library is built as part of the sync library build
-    set(sync_server_library_debug ${sync_directory}/src/realm/librealm-server${platform}-dbg.a)
-    set(sync_server_library_release ${sync_directory}/src/realm/librealm$-server${platform}.a)
+    if(REALM_PLATFORM STREQUAL "Android")
+        set(sync_server_library_debug ${sync_directory}/android-lib/librealm-server${platform}-dbg.a)
+        set(sync_server_library_release ${sync_directory}/android-lib/librealm$-server${platform}.a)
+    else()
+        set(sync_server_library_debug ${sync_directory}/src/realm/librealm-server${platform}-dbg.a)
+        set(sync_server_library_release ${sync_directory}/src/realm/librealm$-server${platform}.a)
+    endif()
     set(sync_server_libraries ${sync_server_library_debug} ${sync_server_library_release})

     ExternalProject_Add_Step(realm-sync-lib ensure-server-libraries


Boost log link dynamic sous UNIX uniquement

--- CMake/DependenciesXsilium.cmake
+++ CMake/DependenciesXsilium.cmake
@@ -209,8 +209,13 @@
 endif()

 if(Boost_VERSION GREATER 105200)
-	# Use boost threading version 4 for boost 1.53 and above
+	if(UNIX)
+	#boost threading version 4 et Boost log dynamic
 	add_definitions( -DBOOST_LOG_DYN_LINK -DBOOST_THREAD_VERSION=4 )
+	else()
+	#boost threading version 4
+	add_definitions( -DBOOST_THREAD_VERSION=4 )
+	endif()
 endif()

 if(Boost_FOUND AND NOT WIN32)


Fixed install path of dependency binaries in CMake script

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -22,30 +22,30 @@
 option(OGRE_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)

 macro(install_debug INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
+      install(FILES ${OGRE_DEP_DIR}/bin/debug/${INPUT} DESTINATION lib/debug CONFIGURATIONS Debug)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/debug/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/debug/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()

 macro(install_release INPUT)
-  if (EXISTS ${OGRE_DEP_DIR}/lib/release/${INPUT})
-    if (IS_DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT})
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(DIRECTORY ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+  if (EXISTS ${OGRE_DEP_DIR}/bin/release/${INPUT})
+    if (IS_DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT})
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(DIRECTORY ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     else ()
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
-      install(FILES ${OGRE_DEP_DIR}/lib/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/release CONFIGURATIONS Release None "")
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/relwithdebinfo CONFIGURATIONS RelWithDebInfo)
+      install(FILES ${OGRE_DEP_DIR}/bin/release/${INPUT} DESTINATION lib/minsizerel CONFIGURATIONS MinSizeRel)
     endif ()
   else()
-    message(send_error "${OGRE_DEP_DIR}/lib/release/${INPUT} did not exist, can't install!")
+    message(send_error "${OGRE_DEP_DIR}/bin/release/${INPUT} did not exist, can't install!")
   endif ()
 endmacro()


Added custom moc options again when moc'ing plug-in headers.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -182,7 +182,7 @@
       # this is a workaround for Visual Studio. The relative include paths in the generated
       # moc files can get very long and can't be resolved by the MSVC compiler.
       foreach(moc_src ${MY_MOC_SRCS})
-        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} -DHAVE_QT5 TARGET ${lib_name})
+        QT5_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} -DHAVE_QT5 ${MY_MOC_OPTIONS} TARGET ${lib_name})
       endforeach()
     endif()
     QT5_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})
@@ -194,7 +194,7 @@
       # this is a workaround for Visual Studio. The relative include paths in the generated
       # moc files can get very long and can't be resolved by the MSVC compiler.
       foreach(moc_src ${MY_MOC_SRCS})
-        QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} TARGET ${lib_name})
+        QT4_WRAP_CPP(MY_MOC_CPP ${moc_src} OPTIONS -f${moc_src} ${MY_MOC_OPTIONS} TARGET ${lib_name})
       endforeach()
     endif()
     QT4_WRAP_UI(MY_UI_CPP ${MY_UI_FORMS})


cmake: improved FindHDF5 heuristics

cmake: improved FindHDF5 heuristics

--- config/FindHDF5.cmake
+++ config/FindHDF5.cmake
@@ -33,8 +33,8 @@
     # Only configure HDF5 if a suitable version of the library was found
     if(HDF5_SUFFICIENT_VERSION)

-        FIND_LIBRARY(HDF5_CORE_LIBRARY NAMES hdf5dll hdf5  )
-        FIND_LIBRARY(HDF5_HL_LIBRARY NAMES hdf5_hldll hdf5_hl  )
+        FIND_LIBRARY(HDF5_CORE_LIBRARY NAMES hdf5dll hdf5 PATH_SUFFIXES hdf5/serial )
+        FIND_LIBRARY(HDF5_HL_LIBRARY NAMES hdf5_hldll hdf5_hl PATH_SUFFIXES hdf5/serial )

         # FIXME: as of version 1.8.9 and 1.8.10-patch1 (but NOT 1.8.10), these flags are
         #        already set correctly => remove or set conditionally according to version


Fix cmake build with `Dtensorflow_BUILD_ALL_KERNELS=OFF` error

This fix tries to address the issue raised in #11975 where cmake
with `Dtensorflow_BUILD_ALL_KERNELS=OFF` will throw out an error:
```
[ 93%] Building CXX object CMakeFiles/tf_tools_transform_graph_lib.dir/workspace/tensorflow/tools/graph_transforms/freeze_requantization_ranges.cc.o
CMakeFiles/tf_core_cpu.dir/workspace/tensorflow/core/grappler/costs/measuring_cost_estimator.cc.o: In function `tensorflow::grappler::MeasuringCostEstimator::MeasuringCostEstimator(tensorflow::grappler::Cluster*, int, int)':
measuring_cost_estimator.cc:(.text+0x18c): undefined reference to `tensorflow::SanitizeThreadSuffix(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status
make[2]: *** [benchmark_model] Error 1
CMakeFiles/benchmark_model.dir/build.make:949: recipe for target 'benchmark_model' failed
make[1]: *** [CMakeFiles/benchmark_model.dir/all] Error 2
CMakeFiles/Makefile2:6884: recipe for target 'CMakeFiles/benchmark_model.dir/all' failed
make[1]: *** Waiting for unfinished jobs....
```

The issue is casued by `ops_util.cc` which is needed even if all kernels are OFF.

This fix fixes the issue with cmake file update.

This fix fixes 11975.

Signed-off-by: Yong Tang <765086fe2e0c1f980161f127fec596800f327f62@outlook.com>

--- tensorflow/contrib/cmake/tf_core_kernels.cmake
+++ tensorflow/contrib/cmake/tf_core_kernels.cmake
@@ -33,6 +33,8 @@
      "${tensorflow_source_dir}/tensorflow/core/kernels/matmul_op.cc"
      "${tensorflow_source_dir}/tensorflow/core/kernels/no_op.h"
      "${tensorflow_source_dir}/tensorflow/core/kernels/no_op.cc"
+     "${tensorflow_source_dir}/tensorflow/core/kernels/ops_util.h"
+     "${tensorflow_source_dir}/tensorflow/core/kernels/ops_util.cc"
      "${tensorflow_source_dir}/tensorflow/core/kernels/sendrecv_ops.h"
      "${tensorflow_source_dir}/tensorflow/core/kernels/sendrecv_ops.cc"
   )


[UBSan] Also use blacklist for 'Address; Undefined' setting

It looks like currently the UBSan blacklist is only applied when "Undefined" is selected.
This patch updates the cmake file to apply it whenever Undefined is selected
 (e.g. 'Address; Undefined' ). This  allows us to use the workaround added in
rL335525 when using AddressSan and UBSan together.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -670,11 +670,6 @@
       append_common_sanitizer_flags()
       append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-      set(BLACKLIST_FILE "${CMAKE_SOURCE_DIR}/utils/sanitizers/ubsan_blacklist.txt")
-      if (EXISTS "${BLACKLIST_FILE}")
-        append("-fsanitize-blacklist=${BLACKLIST_FILE}"
-	              CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-      endif()
     elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
       append_common_sanitizer_flags()
       append("-fsanitize=thread" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
@@ -706,6 +701,13 @@
   if (LLVM_USE_SANITIZE_COVERAGE)
     append("-fsanitize=fuzzer-no-link" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endif()
+  if (LLVM_USE_SANITIZER MATCHES ".*Undefined.*")
+    set(BLACKLIST_FILE "${CMAKE_SOURCE_DIR}/utils/sanitizers/ubsan_blacklist.txt")
+    if (EXISTS "${BLACKLIST_FILE}")
+      append("-fsanitize-blacklist=${BLACKLIST_FILE}"
+             CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    endif()
+  endif()
 endif()

 # Turn on -gsplit-dwarf if requested


[CMake] Enable a bunch of Xcode build settings that correspond to warnings that are for the most part enabled by default either by Clang or -Wall.

I personally build with these settings enabled all the time, and it
is clearer to see the actual warning flags (e.g., -Wuninitialized)
get passed by Xcode rather than seeing -Wno-uninitialized followed
by -Wall (the latter canceling out the former) and figuring out
what is going on.

Xcode will ignore build settings it doesn't understand, so this will
work on possibly older versions of Xcode that don't support all
of these settings.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -173,6 +173,29 @@
   endif( LLVM_BUILD_32_BITS )
 endif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WIN32 )

+if( XCODE )
+  # For Xcode enable several build settings that correspond to
+  # many warnings that are on by default in Clang but are
+  # not enabled for historical reasons.  For versions of Xcode
+  # that do not support these options they will simply
+  # be ignored.
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_RETURN_TYPE "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VALUE "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_VARIABLE "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_SIGN_COMPARE "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNUSED_FUNCTION "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_UNINITIALIZED_AUTOS "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_BOOL_CONVERSION "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_EMPTY_BODY "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_ENUM_CONVERSION "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_INT_CONVERSION "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_CLANG_WARN_CONSTANT_CONVERSION "YES")
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_WARN_NON_VIRTUAL_DESTRUCTOR "YES")
+endif()
+
 # On Win32 using MS tools, provide an option to set the number of parallel jobs
 # to use.
 if( MSVC_IDE )


#6 append -fimplicit-templates because we want them

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -91,6 +91,12 @@
   -fno-exceptions
   )
 ## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
+
+# must append this because mysql sets -fno-implicit-templates and we need to override it
+check_cxx_compiler_flag(-fimplicit-templates HAVE_CXX_-fimplicit-templates)
+if (HAVE_CXX_-fimplicit-templates)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fimplicit-templates")
+endif ()

 ## Clang has stricter POD checks.  So, only enable this warning on our other builds (Linux + GCC)
 if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)


More refactoring, this time actually tested

Former-commit-id: 9f0a01e3d2c105ba981d4323bff47e154802c310

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -20,6 +20,24 @@
   endif()
 endfunction()

+function(halide_generator_add_exec_generator_target EXEC_TARGET)
+  set(options )
+  set(oneValueArgs GENERATOR_TARGET GENFILES_DIR)
+  set(multiValueArgs OUTPUTS GENERATOR_ARGS)
+  cmake_parse_arguments(args "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+  halide_generator_get_exec_path(${args_GENERATOR_TARGET} EXEC_PATH)
+
+  add_custom_command(
+    OUTPUT ${args_OUTPUTS}
+    DEPENDS ${args_GENERATOR_TARGET}
+    COMMAND ${EXEC_PATH} ${args_GENERATOR_ARGS}
+    WORKING_DIRECTORY ${args_GENFILES_DIR}
+  )
+
+  add_custom_target(${EXEC_TARGET} DEPENDS ${args_OUTPUTS})
+  set_target_properties(${EXEC_TARGET} PROPERTIES FOLDER "generator")
+endfunction()

 # This function adds custom build steps to invoke a Halide generator exectuable
 # and produce a static library containing the generated code.
@@ -79,26 +97,13 @@
   # GENERATOR_ARGS always come last
   list(APPEND GENERATOR_EXEC_ARGS ${args_GENERATOR_ARGS})

-  halide_generator_get_exec_path(${args_GENERATOR_TARGET} GENERATOR_EXEC_PATH)
-
-  # Add a custom target to invoke the GENERATOR_TARGET and output the Halide
-  # generated library.
-  add_custom_command(
-    OUTPUT "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
-    DEPENDS "${args_GENERATOR_TARGET}"
-    COMMAND "${GENERATOR_EXEC_PATH}" ${GENERATOR_EXEC_ARGS}
-    WORKING_DIRECTORY "${GENFILES_DIR}"
+  halide_generator_add_exec_generator_target(
+    "${AOT_LIBRARY_TARGET}.exec_generator"
+    GENERATOR_TARGET ${args_GENERATOR_TARGET}
+    GENERATOR_ARGS   "${GENERATOR_EXEC_ARGS}"
+    GENFILES_DIR     ${GENFILES_DIR}
+    OUTPUTS          "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
   )
-
-  # Use a custom target to force it to run the generator before the
-  # object file for the runner.
-  set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
-  add_custom_target(${EXEC_GENERATOR_TARGET}
-                    DEPENDS "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}")
-
-  # Place the target in a special folder in IDEs
-  set_target_properties(${EXEC_GENERATOR_TARGET} PROPERTIES FOLDER "generator")
-
 endfunction(halide_add_aot_library)

 # Usage:
@@ -106,11 +111,9 @@
 function(halide_add_aot_library_dependency TARGET AOT_LIBRARY_TARGET)
     halide_generator_genfiles_dir(${AOT_LIBRARY_TARGET} GENFILES_DIR)

+    add_dependencies("${TARGET}" "${AOT_LIBRARY_TARGET}.exec_generator")
+
     set(FILTER_LIB "${AOT_LIBRARY_TARGET}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-
-    set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
-    add_dependencies("${TARGET}" "${EXEC_GENERATOR_TARGET}")
-
     target_link_libraries("${TARGET}" PRIVATE "${GENFILES_DIR}/${FILTER_LIB}")
     target_include_directories("${TARGET}" PRIVATE "${GENFILES_DIR}")

@@ -124,7 +127,6 @@
     else()
       target_link_libraries("${TARGET}" PRIVATE dl pthread z)
     endif()
-
 endfunction(halide_add_aot_library_dependency)

 function(halide_add_generator NAME)


openvibe-kernel :
 * added debug/release test in the find openmask script => choses libs accordingly

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

--- openvibe-kernel-omk/trunc/src/FindOpenMASK.cmake
+++ openvibe-kernel-omk/trunc/src/FindOpenMASK.cmake
@@ -26,16 +26,16 @@
 IF(WIN32)
 	FIND_PATH(PATH_OPENMASK include/OpenMASK.h PATHS $ENV{OpenMASKDIR})
 	IF(PATH_OPENMASK)
-		MESSAGE(STATUS "  Found OpenMASK...")
 		SET(OMK_FOUND TRUE)
 		SET(OMK_INC ${PATH_OPENMASK}/include)
 		SET(OMK_INCFLAGS "")
-		# SET(OMK_LIBS 3DVisD OpenMASKD SimpleLoaderD SoundD UserTypesD XmlLoaderD)
-		SET(OMK_LIBS OpenMASK SimpleLoader UserTypes)
+		IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
+			SET(OMK_LIBS OpenMASKD SimpleLoaderD UserTypesD)
+		ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
+			SET(OMK_LIBS OpenMASK SimpleLoader UserTypes)
+		ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
 		SET(OMK_LIBFLAGS "")
 		SET(OMK_LIBDIR ${PATH_OPENMASK}/lib)
-	ELSE(PATH_OPENMASK)
-		MESSAGE(STATUS "  FAILED to find OpenMASK...")
 	ENDIF(PATH_OPENMASK)
 ENDIF(WIN32)


minor

minor

--- src/gcc_version.cmake
+++ src/gcc_version.cmake
@@ -7,7 +7,7 @@
       ${CMAKE_CXX_COMPILER}
       ARGS                    --version
       OUTPUT_VARIABLE _compiler_output)
-	  string(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1"
+      string(REGEX REPLACE ".*([0-9]\\.[0-9]\\.[0-9]).*" "\\1"
       gcc_compiler_version
       "${_compiler_output}"
       )
@@ -15,11 +15,11 @@
   message(STATUS "C++ compiler version: ${gcc_compiler_version} [${CMAKE_CXX_COMPILER}]")

   IF(${gcc_compiler_version} MATCHES ".*4\\.[6789]\\.[0-9].*")
-	#MESSAGE("gcc >= 4.6")
-	set(GCC_4_6 TRUE)
+    #MESSAGE("gcc >= 4.6")
+    set(GCC_4_6 TRUE)
   ELSE(${gcc_compiler_version} MATCHES ".*4\\.[6789]\\.[0-9].*")
-	#MESSAGE("gcc < 4.6")
-	set(GCC_4_6 FALSE)
+    #MESSAGE("gcc < 4.6")
+    set(GCC_4_6 FALSE)
   ENDIF(${gcc_compiler_version} MATCHES ".*4\\.[6789]\\.[0-9].*")

 endif(CMAKE_COMPILER_IS_GNUCXX)


cmake: Create the compile command database by default.

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@samba.org>

--- cmake/Modules/DefineCMakeDefaults.cmake
+++ cmake/Modules/DefineCMakeDefaults.cmake
@@ -25,3 +25,6 @@
       "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
   )
 endif (NOT CMAKE_BUILD_TYPE)
+
+# Create the compile command database for clang by default
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)


Commented out CONFIG_SMEM until it is working again

There is an unresolved symbol when building with CONFIG_SMEM enabled

Signed-off-by: Mark Charlebois <f1891e7fc976ae1bd489627e2954fb730751d728@gmail.com>

--- cmake/configs/posix_eagle_default.cmake
+++ cmake/configs/posix_eagle_default.cmake
@@ -3,7 +3,7 @@
 set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake)
 include(${CMAKE_SOURCE_DIR}/cmake/cmake_hexagon/qurt_app.cmake)

-set(CONFIG_SHMEM "1")
+#set(CONFIG_SHMEM "1")

 set(config_module_list
 	drivers/device