Avoid new options from mtx downloads external project

--- test/CMakeModules/download_sparse_datasets.cmake
+++ test/CMakeModules/download_sparse_datasets.cmake
@@ -20,13 +20,9 @@
       ${extproj_name}
       PREFIX "${path_prefix}"
       URL "${URL}/MM/${group}/${name}.tar.gz"
-      DOWNLOAD_NO_EXTRACT False
-      DOWNLOAD_NO_PROGRESS False
-      LOG_DOWNLOAD True
-      LOG_DIR ${PREFIX}
-      CONFIGURE_COMMAND ${CMAKE_COMMAND} -E make_directory "${mtx_data_dir}/${group}"
-      BINARY_DIR "${mtx_data_dir}/${group}"
-      BUILD_COMMAND ${CMAKE_COMMAND} -E tar xzf "${path_prefix}/src/${name}.tar.gz"
+      SOURCE_DIR "${mtx_data_dir}/${group}/${name}"
+      CONFIGURE_COMMAND ""
+      BUILD_COMMAND ""
       INSTALL_COMMAND ""
     )
   add_dependencies(mtxDownloads mtxDownload-${group}-${name})


shifted SIRF tag to 4ad0ce6 (copied FFFTW3.cmake from ISMRMRD)

--- version_config.cmake
+++ version_config.cmake
@@ -190,7 +190,8 @@
   set(DEFAULT_CCPi-Regularisation-Toolkit_TAG origin/master)

 else()
-  set(DEFAULT_SIRF_TAG v3.0.0)
+  set(DEFAULT_SIRF_TAG 4ad0ce6d5fb34713e53328d0f559b4e42b347d8f)
+#  set(DEFAULT_SIRF_TAG v3.0.0)

   ## STIR
   set(DEFAULT_STIR_URL https://github.com/UCL/STIR )


std=c++11 instead of c++14

std=c++11 instead of c++14

--- cmake/CxxCompilerSetup.cmake
+++ cmake/CxxCompilerSetup.cmake
@@ -4,12 +4,12 @@
 # Compiler information
 #===============================================================================
 include(CheckCXXCompilerFlag)
-CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
+CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX14)

 if(COMPILER_SUPPORTS_CXX14)
-  set(CXX_COMPILER_FLAG_STD "-std=c++14")
+  set(CXX_COMPILER_FLAG_STD "-std=c++11")
 else()
-  message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++14 support. Please use a different C++ compiler.")
+  message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
 endif()

 if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel")


fix git tag openvino linux

fix git tag openvino linux

--- cmake/ExternalOpenVINO.cmake
+++ cmake/ExternalOpenVINO.cmake
@@ -52,7 +52,7 @@
 ExternalProject_Add(OpenVINO
         PREFIX ${FAST_EXTERNAL_BUILD_DIR}/OpenVINO
         GIT_REPOSITORY "https://github.com/openvinotoolkit/openvino.git"
-        GIT_TAG "2020.3"
+        GIT_TAG "2020.3.0"
         UPDATE_COMMAND
             git submodule update --init --recursive
         CMAKE_ARGS


/apicontainer added to linker flags on WinRT to fix api test issues.

--- cmake/OpenCVCRTLinkage.cmake
+++ cmake/OpenCVCRTLinkage.cmake
@@ -36,6 +36,9 @@

 if (HAVE_WINRT)
   add_definitions(/DWINVER=0x0602 /DNTDDI_VERSION=NTDDI_WIN8 /D_WIN32_WINNT=0x0602)
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /appcontainer")
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /appcontainer")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /appcontainer")
 endif()

 if(NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT)


cmake: fix typo in CUDA_GENERATION=Auto cache

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -198,7 +198,7 @@

       if(${status} EQUAL 0)
         # cache detected values
-        set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${result_list}} CACHE INTERNAL "")
+        set(OPENCV_CACHE_CUDA_ACTIVE_CC ${${output}} CACHE INTERNAL "")
         set(OPENCV_CACHE_CUDA_ACTIVE_CC_check "${__cache_key_check}" CACHE INTERNAL "")
       endif()
     endif()


fix build error of automatic CC detection

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -101,7 +101,7 @@
     else()
       set(CC_LIST ${ARGN})
       foreach(target_arch ${CC_LIST})
-        string(REPLACE "." "" target_arch_short ${target_arch})
+        string(REPLACE "." "" target_arch_short "${target_arch}")
         set(NVCC_OPTION "-gencode;arch=compute_${target_arch_short},code=sm_${target_arch_short}")
         execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${NVCC_OPTION} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu"
                          WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
@@ -111,7 +111,7 @@
           set(${result_list} "${${result_list}} ${target_arch}")
         endif()
       endforeach()
-      string(STRIP ${${result_list}} ${result_list})
+      string(STRIP "${${result_list}}" ${result_list})
       set(CUDA_SUPPORTED_CC ${${result_list}} CACHE INTERNAL "List of supported compute capability")
     endif()
   endmacro()
@@ -124,7 +124,7 @@
   endmacro()

   macro(ocv_wipeout_deprecated _arch_bin_list)
-    string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} ${${_arch_bin_list}})
+    string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list}}")
   endmacro()

   set(__cuda_arch_ptx "")


Comment GUILE_SITE_DIR related condition

--- cmake/OpenCogFunctions.cmake
+++ cmake/OpenCogFunctions.cmake
@@ -14,6 +14,12 @@
 #   for it be importable, as per guile's specification. See reference
 #   links above.

+# By default Guile return the path to its installation location.
+# Such path will not work for users who wants to compile and install
+# the project with a custom CMAKE_INSTALL_PREFIX. Compiling with
+# custom PREFIX is a common practice. To support custom PREFIX
+# this condition is added to override GUILE_SITE_DIR value using
+# `cmake -DGUILE_SITE_DIR=...`.
 IF (NOT DEFINED GUILE_SITE_DIR)
     IF(HAVE_GUILE)
         EXECUTE_PROCESS(COMMAND guile -c "(display (%site-dir))"


Ensure `SWIFT_DARWIN_PLATFORMS` is defined when loading stdlib options

This was missed when working on #40723 and will prevent
`SWIFT_STDLIB_HAS_ASL` having a wrong default.

--- stdlib/cmake/modules/StdlibOptions.cmake
+++ stdlib/cmake/modules/StdlibOptions.cmake
@@ -2,6 +2,7 @@

 include(${CMAKE_CURRENT_LIST_DIR}/../../../cmake/modules/SwiftUtils.cmake)
 precondition(SWIFT_HOST_VARIANT_SDK)
+precondition(SWIFT_DARWIN_PLATFORMS)

 if("${SWIFT_HOST_VARIANT_SDK}" MATCHES "CYGWIN")
   set(SWIFT_STDLIB_SUPPORTS_BACKTRACE_REPORTING_default FALSE)


Bug 775: propagate generator when workingaround cmake bug 9220

--- cmake/language_support.cmake
+++ cmake/language_support.cmake
@@ -33,7 +33,7 @@
   file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt
     ${text})
   execute_process(
-    COMMAND ${CMAKE_COMMAND} .
+    COMMAND ${CMAKE_COMMAND} . -G "${CMAKE_GENERATOR}"
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}
     RESULT_VARIABLE return_code
     OUTPUT_QUIET
@@ -64,3 +64,4 @@
 #message("CXX_language_works = ${CXX_language_works}")
 #workaround_9220(CXXp CXXp_language_works)
 #message("CXXp_language_works = ${CXXp_language_works}")
+


[build][gardening] adjust one more framework path (#29529)

This is a follow to #29507 addressing one more place in which we need to
collate -F with the framework path

Addresses rdar://problem/58934566

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2133,7 +2133,10 @@

         list(APPEND swiftlib_swift_compile_flags_all "-Fsystem" "${ios_support_frameworks_path}")
         list(APPEND swiftlib_c_compile_flags_all "-iframework" "${ios_support_frameworks_path}")
-        list(APPEND swiftlib_link_flags_all "-F" "${ios_support_frameworks_path}")
+        # We collate -F with the framework path to avoid unwanted deduplication
+        # of options by target_compile_options -- this way no undesired
+        # side effects are introduced should a new search path be added.
+        list(APPEND swiftlib_link_flags_all "-F${ios_support_frameworks_path}")
       endif()

       if(sdk IN_LIST SWIFT_APPLE_PLATFORMS AND SWIFTLIB_IS_SDK_OVERLAY)


Fixup Windows specific compiler flags passed to MSVC/Clang-cl

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -201,16 +201,24 @@
   endif()

   if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
-    list(APPEND result -Xclang;--dependent-lib=oldnames)
-    # TODO(compnerd) handle /MT, /MTd, /MD, /MDd
-    if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
-      list(APPEND result "-D_MD")
-      list(APPEND result -Xclang;--dependent-lib=msvcrt)
-    else()
-      list(APPEND result "-D_MDd")
-      list(APPEND result -Xclang;--dependent-lib=msvcrtd)
-    endif()
-    list(APPEND result -fno-pic)
+    # MSVC doesn't support -Xclang. We don't need to manually specify
+    # -D_MD or D_MDd either, as CMake does this automatically.
+    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+      list(APPEND result -Xclang;--dependent-lib=oldnames)
+      # TODO(compnerd) handle /MT, /MTd, /MD, /MDd
+      if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
+        list(APPEND result "-D_MD")
+        list(APPEND result -Xclang;--dependent-lib=msvcrt)
+      else()
+        list(APPEND result "-D_MDd")
+        list(APPEND result -Xclang;--dependent-lib=msvcrtd)
+      endif()
+    endif()
+
+    # MSVC/clang-cl don't support -fno-pic.
+    if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+      list(APPEND result -fno-pic)
+    endif()
   endif()

   if("${CFLAGS_SDK}" STREQUAL "WINDOWS")
@@ -221,7 +229,10 @@
     list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
     # TODO(compnerd) handle /MT
     list(APPEND result "-D_DLL")
-    list(APPEND result "-fms-compatibility-version=1900")
+
+    if(NOT "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
+      list(APPEND result "-fms-compatibility-version=1900")
+    endif()
   endif()

   if(CFLAGS_ENABLE_ASSERTIONS)


build: fix mismatch of MSVCRT in release mode

When building RelWithDebInfo, we would accidentally link against the debug
MSVCRT library rather than the release mode one resulting in memory corruptions.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -821,10 +821,10 @@
     endif()
     list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;oldnames)
     # TODO(compnerd) handle /MT and /MTd
-    if("${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
+    if(CMAKE_BUILD_TYPE MATCHES Debug)
+      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;msvcrtd)
+    else()
       list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;msvcrt)
-    else()
-      list(APPEND SWIFTLIB_SINGLE_SWIFT_COMPILE_FLAGS -Xfrontend;-autolink-library;-Xfrontend;msvcrtd)
     endif()
   endif()


Always set UUID_LIBRARIES to UUID_LIBRARY if it's defined

Before, UUID_LIBRARIES would only get set to UUID_LIBRARY
if not already set by the user.

--- cmake/modules/Finduuid.cmake
+++ cmake/modules/Finduuid.cmake
@@ -44,8 +44,11 @@
   check_library_exists("uuid" "uuid_generate_random" "" _have_libuuid)
   if(_have_libuuid)
     set(UUID_LIBRARY "uuid")
-    set(UUID_LIBRARIES ${UUID_LIBRARY})
   endif()
+endif()
+
+if(UUID_LIBRARY)
+  set(UUID_LIBRARIES ${UUID_LIBRARY})
 endif()

 unset(CMAKE_REQUIRED_INCLUDES)


[CMake] Remove target to build native tablegen

This was once needed so that multiple tablegen binaries don't compile
the library concurrently. However, this isn't needed anymore since
adding USES_TERMINAL to the custom_command.
This is supported by the fact that the target was only building
LLVMSupport since some cleanups a year ago. If this dependency had
really been needed, we would have seen complaints.

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

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -110,19 +110,6 @@
   set(LLVM_COMMON_DEPENDS ${LLVM_COMMON_DEPENDS} ${target} PARENT_SCOPE)
 endfunction()

-if(LLVM_USE_HOST_TOOLS AND NOT TARGET NATIVE_LIB_LLVMTABLEGEN)
-  llvm_ExternalProject_BuildCmd(tblgen_build_cmd LLVMSupport
-    ${LLVM_NATIVE_BUILD}
-    CONFIGURATION Release)
-  add_custom_command(OUTPUT LIB_LLVMTABLEGEN
-      COMMAND ${tblgen_build_cmd}
-      DEPENDS CONFIGURE_LLVM_NATIVE
-      WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
-      COMMENT "Building libLLVMTableGen for native TableGen..."
-      USES_TERMINAL)
-  add_custom_target(NATIVE_LIB_LLVMTABLEGEN DEPENDS LIB_LLVMTABLEGEN)
-endif()
-
 macro(add_tablegen target project)
   set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
   set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
@@ -166,7 +153,7 @@
                                     CONFIGURATION Release)
       add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
         COMMAND ${tblgen_build_cmd}
-        DEPENDS ${target} NATIVE_LIB_LLVMTABLEGEN
+        DEPENDS CONFIGURE_LLVM_NATIVE ${target}
         WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
         COMMENT "Building native TableGen..."
         USES_TERMINAL)


Removed CMake cache upgrade code from 2011

Summary:
This code was added in r141266 to make a breaking change to CMake, but
still be compatible with existing cache files.  The cache files from
2011 are irrelevant today in 2019.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -119,15 +119,6 @@
   set(${project}_TABLEGEN "${target}" CACHE
       STRING "Native TableGen executable. Saves building one when cross-compiling.")

-  # Upgrade existing LLVM_TABLEGEN setting.
-  if(${project} STREQUAL LLVM)
-    if(${LLVM_TABLEGEN} STREQUAL tblgen)
-      set(LLVM_TABLEGEN "${target}" CACHE
-          STRING "Native TableGen executable. Saves building one when cross-compiling."
-          FORCE)
-    endif()
-  endif()
-
   # Effective tblgen executable to be used:
   set(${project}_TABLEGEN_EXE ${${project}_TABLEGEN} PARENT_SCOPE)
   set(${project}_TABLEGEN_TARGET ${${project}_TABLEGEN} PARENT_SCOPE)


tidy up.

tidy up.

--- cmake/packaging_bundle.cmake
+++ cmake/packaging_bundle.cmake
@@ -1,6 +1,7 @@
-set(CPACK_PACKAGE_NAME "ArangoDB-CLI")
+message("enabling MacOSX 'Bundle' package")
+set(CPACK_PACKAGE_NAME           "ArangoDB-CLI")
 set(CPACK_BUNDLE_NAME            "${CPACK_PACKAGE_NAME}")
-configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
 set(CPACK_BUNDLE_PLIST           "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
 set(CPACK_BUNDLE_ICON            "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/icon.icns")
 set(CPACK_BUNDLE_STARTUP_COMMAND "${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/arangodb-cli.sh")
+configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")


Add extra possible locations for CGAL config

Recent versions of CGAL install the CGALConfig.cmake
file under a 'cmake' subdirectory, so add these locations
to the set of paths to check by default.

--- cmake_modules/FindCGAL.cmake
+++ cmake_modules/FindCGAL.cmake
@@ -50,8 +50,11 @@

     # Look in standard UNIX install locations.
     /usr/local/lib/CGAL
+    /usr/local/lib/cmake/CGAL
     /usr/lib64/CGAL
+    /usr/lib64/cmake/CGAL
     /usr/lib/CGAL
+    /usr/lib/cmake/CGAL

     # Read from the CMakeSetup registry entries.  It is likely that
     # CGAL will have been recently built.


Update compiler.cmake

Update compiler.cmake

-Wno-unused-result added for windows clang build

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -76,7 +76,7 @@
      elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
      else()
-         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11")
+         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")


Install obmm binary (for forcefield) and libinchi (#169)

Signed-off-by: Geoff Hutchison <9cf35bacc9f8512ca007341c9e919cf5dc03e0c7@gmail.com>

--- cmake/AvogadroCPack.cmake
+++ cmake/AvogadroCPack.cmake
@@ -45,7 +45,8 @@

   find_program(OBABEL_EXE obabel)
   if(OBABEL_EXE)
-    install(FILES ${OBABEL_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
+    find_program(OBMM_EXE obmm)
+    install(FILES ${OBABEL_EXE} ${OBMM_EXE} DESTINATION ${INSTALL_RUNTIME_DIR}
       PERMISSIONS
         OWNER_READ OWNER_EXECUTE
         GROUP_READ GROUP_EXECUTE
@@ -62,6 +63,8 @@
       install(DIRECTORY "${BABEL_DIR}/data"
         DESTINATION ${INSTALL_RUNTIME_DIR})
     elseif(APPLE)
+      file(GLOB LIBINCHI ${BABEL_DIR}/../lib/libinchi.*)
+      install(FILES ${LIBINCHI} DESTINATION ${INSTALL_LIBRARY_DIR}/../Frameworks/)
       install(DIRECTORY "${BABEL_DIR}/../lib/openbabel"
         DESTINATION ${INSTALL_LIBRARY_DIR})
       install(DIRECTORY "${BABEL_DIR}/../share/openbabel"


Fix MKL linkage with enabled OpenMP

Fix MKL linkage with enabled OpenMP

--- cmake/OpenCVFindMKL.cmake
+++ cmake/OpenCVFindMKL.cmake
@@ -107,7 +107,7 @@
         if(MSVC)
             list(APPEND mkl_lib_list mkl_intel_thread libiomp5md)
         else()
-            list(APPEND mkl_lib_list libmkl_gnu_thread)
+            list(APPEND mkl_lib_list mkl_gnu_thread)
         endif()
     else()
         list(APPEND mkl_lib_list mkl_sequential)


update balboa dependency

update balboa dependency

--- cmake/custom/balboa.cmake
+++ cmake/custom/balboa.cmake
@@ -4,7 +4,7 @@
     balboa
     PREFIX "${PROJECT_BINARY_DIR}/balboa"
     GIT_REPOSITORY https://github.com/bast/balboa.git
-    GIT_TAG a4cbe0cf7d7f9e0c6e0c22644ea8a8010a33701a
+    GIT_TAG b7fc688e890ad728e07d505802eedbaf54a1ad9e
     INSTALL_COMMAND true  # currently no install command
     CMAKE_ARGS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
     )
@@ -23,5 +23,5 @@
     libbalboa.${_dyn_lib_suffix}
     )

-include_directories(${PROJECT_BINARY_DIR}/balboa/src/balboa/api)
+include_directories(${PROJECT_BINARY_DIR}/balboa/src/balboa/balboa)
 include_directories(${PROJECT_BINARY_DIR}/balboa/src/balboa-build/include)


Fix build issue if an incompatible local version of libunwind is installed.

--- cmake/glog/Download.cmake
+++ cmake/glog/Download.cmake
@@ -36,6 +36,7 @@
 set(WITH_GFLAGS OFF CACHE BOOL "" FORCE)
 set(HAVE_LIB_GFLAGS 1)

+set(WITH_UNWIND OFF CACHE BOOL "" FORCE)
 set(UNWIND_LIBRARY FALSE)
 set(HAVE_PWD_H FALSE)


Don't create test helpers if QI_WITH_TESTS is OFF

Change-Id: I4b459b55d60c30d18930a1bdcc87d7d7f8e2291a
Reviewed-on: http://gerrit.aldebaran.lan/56137
Tested-by: gerrit
Reviewed-by: ncornu <13ba26b8f12d26c819f48749c65f2f7f5c1d13db@aldebaran.com>
Tested-by: ncornu <13ba26b8f12d26c819f48749c65f2f7f5c1d13db@aldebaran.com>

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -50,6 +50,10 @@
 #
 # Arguments are the same as :cmake:function:`qi_create_bin`
 function(qi_create_test_helper name)
+  if(NOT QI_WITH_TESTS)
+    return()
+  endif()
+
   qi_create_bin(${name} NO_INSTALL ${ARGN})
   if(TARGET ${name})
     install(TARGETS ${name}


copy_directory will only glob C/C++/OpenCL files

--- cmake/vSMCFunctions.cmake
+++ cmake/vSMCFunctions.cmake
@@ -48,7 +48,9 @@
 ENDFUNCTION (COPY_FILE)

 FUNCTION (COPY_DIRECTORY basename dirname fullpath)
-    FILE (GLOB_RECURSE dirfiles ${fullpath}/*)
+    FILE (GLOB_RECURSE dirfiles
+        ${fullpath}/*.h ${fullpath}/*.hpp
+        ${fullpath}/*.c ${fullpath}/*.cpp ${fullpath}/*.cl)
     ADD_CUSTOM_COMMAND (
         OUTPUT ${PROJECT_BINARY_DIR}/${dirname} DEPENDS ${dirfiles}
         COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory


Fix detection of the XDR under Windows platform.

--- adm_local/cmake_files/FindXDR.cmake
+++ adm_local/cmake_files/FindXDR.cmake
@@ -24,7 +24,7 @@

 IF(WIN32)
   FIND_LIBRARY(XDR_LIBRARIES xdr)                 # To get the .lib file from XDR
-  FIND_PATH(XDR_INCLUDE_DIRS2 src/msvc/stdint.h)  # To get the stdint.h from XDR (needed by types.h)
+  FIND_PATH(XDR_INCLUDE_DIRS2 stdint.h PATH_SUFFIXES src/msvc)  # To get the stdint.h from XDR (needed by types.h)
   IF(XDR_INCLUDE_DIRS)
     IF(XDR_INCLUDE_DIRS2)
       LIST(APPEND XDR_INCLUDE_DIRS "${XDR_INCLUDE_DIRS2}")


vivox is cleared for open source distribution
removing conditional install

reviewed by cg

--- indra/cmake/ViewerMiscLibs.cmake
+++ indra/cmake/ViewerMiscLibs.cmake
@@ -4,8 +4,6 @@
 if (NOT STANDALONE)
   use_prebuilt_binary(libstdc++)
   use_prebuilt_binary(libuuid)
-  if(INSTALL_PROPRIETARY)
-    use_prebuilt_binary(vivox)
-  endif(INSTALL_PROPRIETARY)
+  use_prebuilt_binary(vivox)
 endif(NOT STANDALONE)


CMake: don't modify global C_FLAGS and CXX_FLAGS

--- build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
+++ build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
@@ -9,13 +9,13 @@
     if (_C)
         CHECK_C_COMPILER_FLAG(${_flag} C_FLAG_${varname})
         if (C_FLAG_${varname})
-            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}" CACHE INTERNAL "C Flags")
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}" PARENT_SCOPE)
         endif ()
     endif ()
     if (_CXX)
         CHECK_CXX_COMPILER_FLAG(${_flag} CXX_FLAG_${varname})
         if (CXX_FLAG_${varname})
-            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" CACHE INTERNAL "CXX Flags")
+            set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}" PARENT_SCOPE)
         endif ()
     endif ()
 endfunction()
@@ -69,8 +69,7 @@
         separate_arguments(${flag_var})
         list(REMOVE_DUPLICATES ${flag_var})
         string(REPLACE ";" " " ${flag_var} "${${flag_var}}")
-        set(${flag_var} "${${flag_var}}" CACHE STRING "common build flags" FORCE)
-    ENDFOREACH (flag_var)
+    ENDFOREACH (flag_var)

     if (MSVC)
         # Replace /MT to /MD flag
@@ -81,19 +80,7 @@
                  CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
             STRING(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
             STRING(REGEX REPLACE "/O2" "/Ox" ${flag_var} "${${flag_var}}")
-        ENDFOREACH (flag_var)
+        ENDFOREACH (flag_var)
     endif ()

-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" CACHE STRING "Updated flags" FORCE)
-
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL}" CACHE STRING "Updated flags" FORCE)
-    set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}" CACHE STRING "Updated flags" FORCE)
-
 ENDMACRO(ADD_ZSTD_COMPILATION_FLAGS)


Change VS to use the default fp:precise

Change VS to use the default fp:precise

--- Tools/CMake/basics.cmake
+++ Tools/CMake/basics.cmake
@@ -365,7 +365,7 @@
     set(TORQUE_CXX_FLAGS_LIBS "/W0" CACHE TYPE STRING)
     mark_as_advanced(TORQUE_CXX_FLAGS_LIBS)

-    set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:fast /fp:except- /GR /Zc:wchar_t-" )
+    set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "-DUNICODE -D_UNICODE -D_CRT_SECURE_NO_WARNINGS /MP /O2 /Ob2 /Oi /Ot /Oy /GT /Zi /W4 /nologo /GF /EHsc /GS- /Gy- /Qpar- /fp:precise /fp:except- /GR /Zc:wchar_t-" )
     if( TORQUE_CPU_X32 )
        set(TORQUE_CXX_FLAGS_COMMON_DEFAULT "${TORQUE_CXX_FLAGS_COMMON_DEFAULT} /arch:SSE2")
     endif()


Add support for modules and libraries to CMake.

--- Tools/CMake/basics.cmake
+++ Tools/CMake/basics.cmake
@@ -72,6 +72,53 @@
     #message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
     target_link_libraries(${PROJECT_NAME} "${lib}")
 endmacro()
+
+# adds a library dependency. Are processed on addExecutable or addStaticLib
+macro(addRequiredLibrary lib)
+    #message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
+    LIST( APPEND ${PROJECT_NAME}_required_library ${lib} )
+endmacro()
+
+# adds a link dependency. Are processed on addExecutable or addStaticLib
+macro(addRequiredLink lib)
+    #message(STATUS "${PROJECT_NAME} : add lib : ${lib}")
+    LIST( APPEND ${PROJECT_NAME}_required_link ${lib} )
+endmacro()
+
+macro( _processProjectLibrary )
+   # Append currect project to PROJECT_STACK
+   LIST( APPEND PROJECT_STACK "${PROJECT_NAME}" )
+
+   foreach( lib ${${PROJECT_NAME}_required_library} )
+       #message( "adding library dependency: ${lib}" )
+       include( ${lib} )
+   endforeach()
+
+   #clear required libraries
+   set( ${PROJECT_NAME}_required_library )
+
+   # pop currect project form PROJECT_STACK
+   LIST(REMOVE_AT PROJECT_STACK -1)
+
+   # get currect project form stack
+   if( PROJECT_STACK )
+      LIST(GET PROJECT_STACK -1 TEMP_PROJECT)
+      project( ${TEMP_PROJECT} )
+   endif()
+
+
+endmacro()
+
+macro( _processProjectLinks )
+   #message( "_processProjectLinks: ${PROJECT_NAME}" )
+   foreach( lib ${${PROJECT_NAME}_required_link} )
+       addLib( ${lib} )
+   endforeach()
+
+   #clear required libraries
+   set( ${PROJECT_NAME}_required_link )
+endmacro()
+

 # adds a path to search for libs
 macro(addLibPath dir)
@@ -146,6 +193,9 @@
     #foreach(dir ${${PROJECT_NAME}_paths})
     addInclude("${firstDir}")
     #endforeach()
+
+    _processProjectLinks()
+    _processProjectLibrary()
 endmacro()

 # macro to add an executable
@@ -161,6 +211,9 @@
     add_executable("${PROJECT_NAME}" WIN32 ${${PROJECT_NAME}_files})
     # omg - only use the first folder ... otehrwise we get lots of header name collisions
     addInclude("${firstDir}")
+
+    _processProjectLinks()
+    _processProjectLibrary()
 endmacro()

 macro(setupVersionNumbers)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   31)
+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 11)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

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

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp


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   30)
+SET(KWSYS_DATE_STAMP_DAY   31)


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 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 08)

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


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   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 05)

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


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   01)
+SET(KWSYS_DATE_STAMP_DAY   02)


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 09)

 # 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 12)

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


BUG: Fix Cmake warning

BUG: Fix Cmake warning

DTIProcess/CMake/SlicerExtensionsConfigureMacros.cmake:144:28
Argument not separated from preceding token by whitespace.

DTIProcess/CMake/SlicerExtensionsConfigureMacros.cmake:174:50
Argument not separated from preceding token by whitespace.

--- CMake/SlicerExtensionsConfigureMacros.cmake
+++ CMake/SlicerExtensionsConfigureMacros.cmake
@@ -141,7 +141,7 @@
     )
   foreach( var ${TMP_NAMES} )
     if( TMP_VERBOSE )
-      message( "Unsetting "${var} - old value: ${${var}} )
+      message( "Unsetting ${var} - old value: ${${var}}" )
     endif()
     set( ${var}_TMP ${${var}} )
     unset( ${var} CACHE )
@@ -171,7 +171,7 @@
       set( ${var} ${${var}_TMP} CACHE PATH "${var} PATH" FORCE )
       unset( ${var}_TMP )
       if( TMP_VERBOSE )
-        message( "resetting ${var} - new value: "${${var}} )
+        message( "resetting ${var} - new value: ${${var}}" )
       endif()
     endif()
   endforeach()


make NODE_INCLUDE_DIR part of reqVars in use script

--- projects/use/usexp-node-config.cmake
+++ projects/use/usexp-node-config.cmake
@@ -16,14 +16,15 @@
 endif()
 unset(${PRJ}_INCLUDE_DIR CACHE)
 find_path(${PRJ}_INCLUDE_DIR node/node.h PATHS ${XP_ROOTDIR}/include/node${ver} NO_DEFAULT_PATH)
+set(reqVars ${PRJ}_INCLUDE_DIR)
 if(MSVC)
   set(${PRJ}_LIBRARIES ${XP_ROOTDIR}/node${ver}/lib/node.lib)
   set(${PRJ}_EXE ${XP_ROOTDIR}/node${ver}/bin/node.exe)
-  set(reqVars ${PRJ}_LIBRARIES ${PRJ}_EXE)
+  list(APPEND reqVars ${PRJ}_LIBRARIES ${PRJ}_EXE)
 else()
   set(${PRJ}_LIBRARIES)
   set(${PRJ}_EXE ${XP_ROOTDIR}/node${ver}/bin/node)
-  set(reqVars ${PRJ}_EXE)
+  list(APPEND reqVars ${PRJ}_EXE)
 endif()
 set(${PRJ}_NPM ${XP_ROOTDIR}/node${ver}/npm/bin/npm-cli.js)
 list(APPEND reqVars ${PRJ}_NPM)


Dev Checkpoint 080820180108

Dev Checkpoint 080820180108

--- FindImpactSockets.cmake
+++ FindImpactSockets.cmake
@@ -20,7 +20,6 @@
   /usr/local/include/sockets
   NAMES basic_socket
 )
-message("Library: ${SOCKETS_INCLUDE_DIR}")
 mark_as_advanced(SOCKETS_INCLUDE_DIR)

 # Look for the library (sorted from most current/relevant entry to least).


UploadPPA tweaks

UploadPPA tweaks

[ ] May break build
[ ] May break existing applications (see CHANGES.txt)
[ ] Bugfix
[ ] New Feature
[x] Cleanup
[ ] Optimization
[ ] Documentation

--- UploadPPA.cmake
+++ UploadPPA.cmake
@@ -9,11 +9,11 @@
 find_program(DPUT_EXECUTABLE dput)

 if(NOT DEBUILD_EXECUTABLE)
-  message(WARNING "debuild not found")
+  message(STATUS "debuild not found")
   return()
 endif()
 if(NOT DPUT_EXECUTABLE)
-  message(WARNING "dput not found")
+  message(STATUS "dput not found")
   return()
 endif()


cmake: mandate clang-format > 7.0.0

cmake: mandate clang-format > 7.0.0

--- cmake/ClangFormat.cmake
+++ cmake/ClangFormat.cmake
@@ -1,10 +1,22 @@
 if(NOT CLANG_FORMAT_COMMAND)
-    set(CLANG_FORMAT_COMMAND "clang-format-9" "clang-format-8" "clang-format-7" "clang-format-6.0" "clang-format")
+    set(CLANG_FORMAT_COMMAND "clang-format-9" "clang-format-8" "clang-format-7" "clang-format")
 endif()

 find_program(CLANG_FORMAT_PROGRAM NAMES ${CLANG_FORMAT_COMMAND})
+
+execute_process(COMMAND "${CLANG_FORMAT_PROGRAM}" "--version"
+                OUTPUT_VARIABLE CLANG_TIDY_VERSION_FULL_STRING)
+string(REGEX MATCH [=[[0-9]\.[0-9].[0-9]]=] VERSION ${CLANG_TIDY_VERSION_FULL_STRING})
+if(VERSION VERSION_LESS "7.0.0")
+    message(STATUS "clang-format version ${VERSION} is not greater or equal to 7.0.0")
+    set(CLANG_FORMAT_TERMINATE On)
+endif()
 if(NOT CLANG_FORMAT_PROGRAM)
     message(STATUS "clang-format not found")
+    set(CLANG_FORMAT_TERMINATE On)
+endif()
+if(CLANG_FORMAT_TERMINATE)
+    message(STATUS "Disabling formatting.")
     function(format)
         # no-op
     endfunction()
@@ -12,6 +24,7 @@
 endif()

 message(STATUS "Found clang-format at ${CLANG_FORMAT_PROGRAM}")
+
 add_custom_target(format VERBATIM)
 add_custom_target(reformat VERBATIM)


Set number of processors required by tests

--- cmake/UnitTesting.cmake
+++ cmake/UnitTesting.cmake
@@ -19,6 +19,9 @@
         add_test(
             NAME ${TEST_NAME}_cpp_${NPROC}
             COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NPROC} ./${TEST_NAME}.exe
+        )
+        set_tests_properties(${TEST_NAME}_cpp_${NPROC} PROPERTIES
+            PROCESSORS ${NPROC}
         )
     endforeach()
 endfunction()
@@ -54,7 +57,9 @@
             )
         endif()
         set_tests_properties(${TEST_NAME}_py_${NPROC} PROPERTIES
-            ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH}")
+            ENVIRONMENT "PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH}"
+            PROCESSORS ${NPROC}
+        )
     endforeach()
 endfunction()


added coverage support

added coverage support

--- cmake/modes/debug.cmake
+++ cmake/modes/debug.cmake
@@ -1,3 +1,11 @@
+add_compile_options(-g3 -ggdb)
+
+if("${COVERAGE}" STREQUAL "yes")
+  message(STATUS "enabing coverage counting")
+  add_compile_options(--coverage)
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
+endif()
+
 add_compile_options(-g3 -ggdb)
 if("${SANITIZE}" STREQUAL "address")
   message(STATUS "enabling address sanitizer")


Comment out the ll40ls (LidarLite) driver from the fmu-v2 build.

--- boards/px4/fmu-v2/default.cmake
+++ boards/px4/fmu-v2/default.cmake
@@ -29,7 +29,7 @@
 		#differential_pressure # all available differential pressure drivers
 		differential_pressure/ms4525
 		#distance_sensor # all available distance sensor drivers
-		distance_sensor/ll40ls
+		#distance_sensor/ll40ls
 		#distance_sensor/sf0x
 		gps
 		#heater


fixed mistake in providing eigen3 include dir

Former-commit-id: 644a814a4ed875fcd73d177c7d179093ae1beab8

--- cmake-modules/Fetch_h5pp.cmake
+++ cmake-modules/Fetch_h5pp.cmake
@@ -18,9 +18,10 @@
     include(${PROJECT_SOURCE_DIR}/cmake-modules/BuildDependency.cmake)
     if(TARGET Eigen3::Eigen)
         get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
-        list(APPEND H5PP_CMAKE_OPTIONS  -DEIGEN3_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/Eigen3/include/eigen3)
+        list(APPEND H5PP_CMAKE_OPTIONS  -DEIGEN3_INCLUDE_DIR:PATH=${EIGEN3_INCLUDE_DIR})
     endif()
     list(APPEND H5PP_CMAKE_OPTIONS  -DH5PP_DIRECTORY_HINTS:PATH=${CMAKE_INSTALL_PREFIX})
+    list(APPEND H5PP_CMAKE_OPTIONS  -DEIGEN3_DIRECTORY_HINTS:PATH=${CMAKE_INSTALL_PREFIX}/Eigen3)
     list(APPEND H5PP_CMAKE_OPTIONS  -DH5PP_DOWNLOAD_METHOD:BOOL=${DMRG_DOWNLOAD_METHOD})
     list(APPEND H5PP_CMAKE_OPTIONS  -DH5PP_PREFER_CONDA_LIBS:BOOL=${DMRG_PREFER_CONDA_LIBS})
     build_dependency(h5pp "${CMAKE_INSTALL_PREFIX}" "${H5PP_CMAKE_OPTIONS}")


Update lodepng to latest version.

Update lodepng to latest version.

This speeds up PNG loading significantly.

PiperOrigin-RevId: 457431911
Change-Id: I28da22a1fdbfc912d187a40cd731d9c04b83e07c

--- cmake/MujocoDependencies.cmake
+++ cmake/MujocoDependencies.cmake
@@ -19,7 +19,7 @@
 # unless BUILD_SHARED_LIBS is set.

 set(MUJOCO_DEP_VERSION_lodepng
-    48e5364ef48ec2408f44c727657ac1b6703185f8
+    b4ed2cd7ecf61d29076169b49199371456d4f90b
     CACHE STRING "Version of `lodepng` to be fetched."
 )
 set(MUJOCO_DEP_VERSION_tinyxml2


remove colon in code coverage

remove colon in code coverage

--- cmake/coverallsGcovJsons.cmake
+++ cmake/coverallsGcovJsons.cmake
@@ -134,7 +134,7 @@
 	# If -p is not specified then the file is named only "the_file.c.gcov"
 	#
 	execute_process(
-		COMMAND "${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA}"
+		COMMAND ${GCOV_EXECUTABLE} -p -o ${GCDA_DIR} ${GCDA} >/dev/null
 		WORKING_DIRECTORY ${GCDA_DIR}
 	)
 endforeach()


Add support for aravis-0.6 as a dependency

--- cmake/modules/FindAravis.cmake
+++ cmake/modules/FindAravis.cmake
@@ -11,6 +11,7 @@

 # Use pkg-config to get hints about paths
 libfind_pkg_check_modules(aravis_PKGCONF aravis-0.4)
+libfind_pkg_check_modules(aravis0_6_PKGCONF aravis-0.6)

 # Include dir
 find_path(aravis_INCLUDE_DIR
@@ -18,21 +19,27 @@
 	arv.h
 	PATHS
 	${aravis_PKGCONF_INCLUDE_DIRS}
+	${aravis0_6_PKGCONF_INCLUDE_DIRS}
 	/usr/local/include
 	/usr/local/include/aravis-0.4
+	/usr/local/include/aravis-0.6
 	/usr/include
 	/usr/include/aravis-0.4
+	/usr/include/aravis-0.6
 )

 # Finally the library itself
 find_library(aravis_LIBRARY
 	NAMES
 	libaravis-0.4
+	libaravis-0.6
 	aravis
 	aravis-0.4
+	aravis-0.6
 	libaravis
 	PATHS
 	${aravis_PKGCONF_LIBRARY_DIRS}
+	${aravis0_6_PKGCONF_LIBRARY_DIRS}
 	/usr/local/lib
 	/usr/lib
 )


fix FindLibSPG.cmake

fix FindLibSPG.cmake

--- cmake/modules/FindLibSPG.cmake
+++ cmake/modules/FindLibSPG.cmake
@@ -4,8 +4,8 @@
 include(FindPackageHandleStandardArgs)

 find_path(LIBSPG_INCLUDE_DIR
-  NAMES spglib.h
-  PATH_SUFFIXES include/spglib
+  NAMES spglib/spglib.h
+  PATH_SUFFIXES include
   HINTS
   ENV EBROOTSPGLIB
   ENV SPG_DIR


cmake: Enable process_vm_readv detection on android

Only android and linux can have this function as far as I am aware, but
it seems cleaner to enable this code for all platforms.

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

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -334,28 +334,26 @@
   list(APPEND system_libs ${CMAKE_DL_LIBS})
 endif()

-if (CMAKE_SYSTEM_NAME MATCHES "Linux")
-    # Check for syscall used by lldb-server on linux.
-    # If these are not found, it will fall back to ptrace (slow) for memory reads.
-    check_cxx_source_compiles("
-        #include <sys/uio.h>
-        int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
-        HAVE_PROCESS_VM_READV)
-
-    if (HAVE_PROCESS_VM_READV)
-        add_definitions(-DHAVE_PROCESS_VM_READV)
-    else()
-        # If we don't have the syscall wrapper function, but we know the syscall number, we can
-        # still issue the syscall manually
-        check_cxx_source_compiles("
-            #include <sys/syscall.h>
-            int main() { return __NR_process_vm_readv; }"
-            HAVE_NR_PROCESS_VM_READV)
-
-        if (HAVE_NR_PROCESS_VM_READV)
-            add_definitions(-DHAVE_NR_PROCESS_VM_READV)
-        endif()
-    endif()
+# Check for syscall used by lldb-server on linux.
+# If these are not found, it will fall back to ptrace (slow) for memory reads.
+check_cxx_source_compiles("
+  #include <sys/uio.h>
+  int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
+  HAVE_PROCESS_VM_READV)
+
+if (HAVE_PROCESS_VM_READV)
+  add_definitions(-DHAVE_PROCESS_VM_READV)
+else()
+  # If we don't have the syscall wrapper function, but we know the syscall number, we can
+  # still issue the syscall manually
+  check_cxx_source_compiles("
+      #include <sys/syscall.h>
+      int main() { return __NR_process_vm_readv; }"
+      HAVE_NR_PROCESS_VM_READV)
+
+  if (HAVE_NR_PROCESS_VM_READV)
+      add_definitions(-DHAVE_NR_PROCESS_VM_READV)
+  endif()
 endif()

 # Figure out if lldb could use lldb-server.  If so, then we'll


Update doc string and formatting for ROOT_MODULE_LIBRARY()

The DLLEXPORT option is not processed, only LIBRARIES is
a valid option.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -878,13 +878,13 @@
 endfunction()

 #---------------------------------------------------------------------------------------------------
-#---ROOT_MODULE_LIBRARY( <name> source1 source2 ... [DLLEXPORT] LIBRARIES library1 library2 ...)
+#---ROOT_MODULE_LIBRARY(<library> source1 source2 ... LIBRARIES library1 library2 ...)
 #---------------------------------------------------------------------------------------------------
 function(ROOT_MODULE_LIBRARY library)
   CMAKE_PARSE_ARGUMENTS(ARG "" "" "LIBRARIES" ${ARGN})
   ROOT_GET_SOURCES(lib_srcs src ${ARG_UNPARSED_ARGUMENTS})
   include_directories(BEFORE ${CMAKE_BINARY_DIR}/include)
-  add_library( ${library} SHARED ${lib_srcs})
+  add_library(${library} SHARED ${lib_srcs})
   add_dependencies(${library} move_headers)
   set_target_properties(${library}  PROPERTIES ${ROOT_LIBRARY_PROPERTIES})
   # Do not add -Dname_EXPORTS to the command-line when building files in this


Fix pkg-config handling of libraries for the case where the optimized / debug tags are present in the cmake libraries list. Currently this is just the output of FindQt4 when CMAKE_BUILD_TYPE is set.

svn path=/trunk/; revision=9942

--- cmake/modules/pkg-config.cmake
+++ cmake/modules/pkg-config.cmake
@@ -101,9 +101,19 @@
   # output pkg-config (*.pc) files.
   # N.B. ${_link_flags_in} must be a string and not a list.

+  # First strip out optimized / debug options which are not needed
+  # Currently only FindQt4 seems to need this.
+  if(CMAKE_BUILD_TYPE MATCHES "Debug")
+    string(REGEX REPLACE "(^|;)optimized;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}")
+    string(REGEX REPLACE "(^|;)debug;" "\\1" ${_link_flags_out} "${${_link_flags_out}}")
+  else(CMAKE_BUILD_TYPE MATCHES "Debug")
+    string(REGEX REPLACE "(^|;)debug;[^;]*;" "\\1" ${_link_flags_out} "${_link_flags_in}")
+    string(REGEX REPLACE "(^|;)optimized;" "\\1" ${_link_flags_out} "${${_link_flags_out}}")
+  endif(CMAKE_BUILD_TYPE MATCHES "Debug")
+
   #message("(original link flags) = ${_link_flags_in}")
   # Convert link flags to a blank-delimited string.
-  string(REGEX REPLACE ";" " " ${_link_flags_out} "${_link_flags_in}")
+  string(REGEX REPLACE ";" " " ${_link_flags_out} "${${_link_flags_out}}")
   #message("(blanks) ${_link_flags_out} = ${${_link_flags_out}}")

   # Replace actual library names with the -LPATHNAME and -lLIBRARYNAME form


Dependencies.cmake: update zlib to 1.2.10 as zlib 1.2.8 is gone

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -98,9 +98,9 @@
     if(MSVC OR EMSCRIPTEN) # other platforms ship zlib
         message(STATUS "Building zlib")
         file(DOWNLOAD
-            http://zlib.net/zlib-1.2.8.tar.gz
-            ./zlib-1.2.8.tar.gz)
-        execute_process(COMMAND cmake -E tar xf zlib-1.2.8.tar.gz)
+            http://zlib.net/zlib-1.2.10.tar.gz
+        ./zlib-1.2.10.tar.gz)
+        execute_process(COMMAND cmake -E tar xf zlib-1.2.10.tar.gz)
         execute_process(COMMAND cmake
             -DCMAKE_INSTALL_PREFIX=${OGREDEPS_PATH}
             -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -108,8 +108,8 @@
             -G ${CMAKE_GENERATOR}
             ${CROSS}
             .
-            WORKING_DIRECTORY zlib-1.2.8)
-        execute_process(COMMAND cmake --build zlib-1.2.8 --target install)
+            WORKING_DIRECTORY zlib-1.2.10)
+        execute_process(COMMAND cmake --build zlib-1.2.10 --target install)
     endif()

     message(STATUS "Building ZZIPlib")


New boost version

New boost version


fbcode_builder: update ThriftCppLibrary to use fb_cmake_parse_args()

Summary:
Change ThriftCppLibrary to use `fb_cmake_parse_args()`

This code doesn't really care much about handling empty arguments, so we could
use the standard `cmake_parse_arguments()` function here instead of
`fb_cmake_parse_args()`.  However, it is slightly more convenient that
`fb_cmake_parse_args()` automatically errors out on unhandled arguments, so
that we don't have to check for this ourselves.

Reviewed By: wez

Differential Revision: D16738445

fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,34 +1,13 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
 # NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
 # needs to be changed.  TODO: this should be handled via shipit.
+
+include(FBCMakeParseArgs)
+
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(SERVICES)
-  set(DEPENDS)
-  set(GEN_ARGS)
-  set(mode "UNSET")
-  foreach(arg IN LISTS ARGN)
-    if("${arg}" STREQUAL "SERVICES")
-      set(mode "SERVICES")
-    elseif("${arg}" STREQUAL "DEPENDS")
-      set(mode "DEPENDS")
-    elseif("${arg}" STREQUAL "OPTIONS")
-      set(mode "OPTIONS")
-    else()
-      if("${mode}" STREQUAL "SERVICES")
-        list(APPEND SERVICES "${arg}")
-      elseif("${mode}" STREQUAL "DEPENDS")
-        list(APPEND DEPENDS "${arg}")
-      elseif("${mode}" STREQUAL "OPTIONS")
-        list(APPEND GEN_ARGS "${arg}")
-      else()
-        message(
-          FATAL_ERROR
-          "expected SERVICES, DEPENDS, or OPTIONS argument, found ${arg}"
-        )
-      endif()
-    endif()
-  endforeach()
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -42,11 +21,11 @@
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)

   if (NOT "${include_prefix}" STREQUAL "")
-    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+    list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
   endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
-  string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
+  string(REPLACE ";" "," GEN_ARG_STR "${ARG_OPTIONS}")

   # Compute the list of generated files
   list(APPEND generated_headers
@@ -61,7 +40,7 @@
     ${output_dir}/gen-cpp2/${base}_data.cpp
     ${output_dir}/gen-cpp2/${base}_types.cpp
   )
-  foreach(service IN LISTS SERVICES)
+  foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers
       ${output_dir}/gen-cpp2/${service}.h
       ${output_dir}/gen-cpp2/${service}.tcc
@@ -77,7 +56,7 @@
   endforeach()

   list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
-  foreach(depends IN LISTS DEPENDS)
+  foreach(depends IN LISTS ARG_DEPENDS)
     get_property(thrift_include_directory
       TARGET ${depends}
       PROPERTY THRIFT_INCLUDE_DIRECTORY)
@@ -114,7 +93,7 @@
     MAIN_DEPENDENCY
       ${THRIFT_FILE}
     DEPENDS
-      ${DEPENDS}
+      ${ARG_DEPENDS}
   )

   # Now emit the library rule to compile the sources
@@ -139,7 +118,7 @@
   target_link_libraries(
     ${LIB_NAME}
     PUBLIC
-      ${DEPENDS}
+      ${ARG_DEPENDS}
       FBThrift::thriftcpp2
       Folly::folly
   )


Bump the ParaView SHA for Python 3 fixes

--- versions.cmake
+++ versions.cmake
@@ -80,7 +80,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "9d53375abd79403a01d2a0c91bfd0ea425c77d57")
+  set(_paraview_revision "8b6579f108a35e7cf18ccb6d19381e3256f66cd1")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


opus: update to 1.3-beta

opus: update to 1.3-beta

--- packages/opus.cmake
+++ packages/opus.cmake
@@ -1,7 +1,7 @@
 ExternalProject_Add(opus
     DEPENDS gcc
-    URL "https://archive.mozilla.org/pub/opus/opus-1.2.1.tar.gz"
-    URL_HASH SHA256=cfafd339ccd9c5ef8d6ab15d7e1a412c054bf4cb4ecbbbcc78c12ef2def70732
+    URL "https://archive.mozilla.org/pub/opus/opus-1.3-beta.tar.gz"
+    URL_HASH SHA256=7f56e058c9549d03ae35511ad9e16ef6d1eb257836830d54abff0f495f17e187
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND ${EXEC} <SOURCE_DIR>/configure
         --host=${TARGET_ARCH}


dbi: added SQLITE_THREADSAFE=1 for compiling sqlite

--- src/yuni/cmake/dbi.cmake
+++ src/yuni/cmake/dbi.cmake
@@ -6,6 +6,8 @@
 # only for sqlite
 LIBYUNI_CONFIG_LIB("both" "dbi"  "dl")

+
+add_definitions("-DSQLITE_THREADSAFE=1")

 # Sources for parsing JSON are imported from nany and no relative paths
 # is currently provided


Fix for newer versions of CMake not taking "--parallel" during configure

Former-commit-id: 32a61fa12f40b4e7e5f86d1e950e68b640652913

--- cmake-modules/BuildDependency.cmake
+++ cmake-modules/BuildDependency.cmake
@@ -21,7 +21,6 @@
     execute_process( COMMAND  ${CMAKE_COMMAND} -E make_directory ${build_dir})
     execute_process(
             COMMAND  ${CMAKE_COMMAND}
-            --parallel ${num_threads}
             # CMake flags
             -DCMAKE_POLICY_DEFAULT_CMP0074=NEW
             -DCMAKE_EXE_LINKER_FLAGS_INIT=${CMAKE_EXE_LINKER_FLAGS}


slightly more informative output when the target arch is changed

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -14,9 +14,9 @@
    set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
-      message(STATUS "${TARGET_ARCHITECTURE} changed")
+      message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
       set(_force FORCE)
-   endif(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
+   endif()
    set(_last_target_arch "${TARGET_ARCHITECTURE}" CACHE STRING "" FORCE)
    mark_as_advanced(_last_target_arch)
    string(TOLOWER "${TARGET_ARCHITECTURE}" TARGET_ARCHITECTURE)


disabling mosra tests too

disabling mosra tests too

--- cmake/mtao_fetch_dependencies.cmake
+++ cmake/mtao_fetch_dependencies.cmake
@@ -8,7 +8,6 @@
         GIT_TAG ${GIT_TAG}
         )
     if(ADD_SUBDIR)
-        set(BUILD_TESTING OFF)
         if(${CMAKE_VERSION} VERSION_LESS 3.14)
             FetchContent_Populate(${REPO_NAME})
             add_subdirectory(${${REPO_NAME}_SOURCE_DIR} ${${REPO_NAME}_BINARY_DIR})
@@ -23,6 +22,7 @@
 endfunction()

 if(NOT Eigen3_FOUND)
+        set(BUILD_TESTING OFF)
 fetch_dep(eigen https://gitlab.com/libeigen/eigen.git bcbaad6d874d451817457ae0603f953cda3c0c06 ON)

 ENDIF()
@@ -62,6 +62,7 @@
 endif()

 if(MTAO_USE_OPENGL)
+    set(BUILD_TESTS OFF)
     if(NOT Corrade_FOUND)
         fetch_dep(corrade https://github.com/mosra/corrade v2019.10 ON)
     endif()
@@ -70,8 +71,8 @@
         fetch_dep(magnum https://github.com/mosra/magnum v2019.10 ON)
     endif()
     if(NOT MagnumIntegration_FOUND)
-        option(WITH_EIGEN "Build EigenIntegration library" ON)
-        option(WITH_IMGUI "Build ImGuiIntegration library" ON)
+        option(WITH_EIGEN "MagnumIntegration Build EigenIntegration library" ON)
+        option(WITH_IMGUI "MagnumIntegration Build ImGuiIntegration library" ON)
         fetch_dep(magnum-integration https://github.com/mosra/magnum-integration v2019.10 ON)
     endif()
 endif()


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -263,4 +263,4 @@
 endif()

 hunter_cacheable(OpenSSL)
-hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 6)
+hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID 7)


OpenSSL: ++PACKAGE_INTERNAL_DEPS_ID

OpenSSL: ++PACKAGE_INTERNAL_DEPS_ID

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -318,4 +318,4 @@
 endif()

 hunter_cacheable(OpenSSL)
-hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "13")
+hunter_download(PACKAGE_NAME OpenSSL PACKAGE_INTERNAL_DEPS_ID "14")


[cmake] restore manpage generation for 'siconos' script

--- cmake/siconos_find_common_dep.cmake
+++ cmake/siconos_find_common_dep.cmake
@@ -286,13 +286,18 @@
   endif()
 endif()

-
 # SiconosConfig.h generation and include
 if(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
   configure_file(${CMAKE_SOURCE_DIR}/config.h.cmake
     ${CMAKE_BINARY_DIR}/SiconosConfig.h)
 endif()

+# man pages
+IF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/man)
+  CONFIGURE_FILE(man/siconos.1.in man/siconos.1)
+  INSTALL(FILES ${CMAKE_BINARY_DIR}/man/siconos.1 DESTINATION share/man/man1)
+ENDIF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/man)
+
 set(${PROJECT_NAME}_LOCAL_INCLUDE_DIRECTORIES
   ${${PROJECT_NAME}_LOCAL_INCLUDE_DIRECTORIES}
   ${CMAKE_BINARY_DIR}


CDRIVER-299 more output when cmake finds sasl lib

--- build/cmake/FindSASL2.cmake
+++ build/cmake/FindSASL2.cmake
@@ -1,6 +1,6 @@
 include(CheckSymbolExists)

-message ("Searching for sasl/sasl.h")
+message (STATUS "Searching for sasl/sasl.h")
 find_path (
     SASL2_INCLUDE_DIR NAMES sasl/sasl.h
     PATHS /include /usr/include /usr/local/include /usr/share/include /opt/include
@@ -8,9 +8,11 @@

 if (SASL2_INCLUDE_DIR)
     message (STATUS "  Found in ${SASL2_INCLUDE_DIR}")
+else ()
+    message (STATUS "  Not found (specify -DCMAKE_INCLUDE_PATH=C:/path/to/sasl/include for SASL support)")
 endif ()

-message ("Searching for libsasl2")
+message (STATUS "Searching for libsasl2")
 find_library(
     SASL2_LIBRARY NAMES sasl2
     PATHS /usr/lib /lib /usr/local/lib /usr/share/lib /opt/lib /opt/share/lib /var/lib
@@ -18,6 +20,8 @@

 if (SASL2_LIBRARY)
     message (STATUS "  Found ${SASL2_LIBRARY}")
+else ()
+    message (STATUS "  Not found (specify -DCMAKE_LIBRARY_PATH=C:/path/to/sasl/lib for SASL support)")
 endif ()

 if (SASL2_INCLUDE_DIR AND SASL2_LIBRARY)


cmake: gcc: Use --sysroot with gcc when SYSROOT_DIR is provided

When SYSROOT_DIR is provided, gcc should use it through the --sysroot=
option otherwise some commands won't work as expected.

For example, in the Yocto environment when cross compiling,
--print-libgcc-file-name prints only "libgcc.a" instead of the full
path to it and the subsequent assert_exists(LIBGCC_FILE_NAME) will
fail.

Fixes #45578
Signed-off-by: Luca Fancellu <42e9678da03ff0f0455459bc75b0f3b90bcef2e6@arm.com>

--- cmake/compiler/gcc/target.cmake
+++ cmake/compiler/gcc/target.cmake
@@ -71,6 +71,22 @@
   include(${CMAKE_CURRENT_LIST_DIR}/target_mips.cmake)
 endif()

+if(SYSROOT_DIR)
+  # The toolchain has specified a sysroot dir, pass it to the compiler
+  list(APPEND TOOLCHAIN_C_FLAGS
+    --sysroot=${SYSROOT_DIR}
+    )
+
+  # Use sysroot dir to set the libc path's
+  execute_process(
+    COMMAND ${CMAKE_C_COMPILER} ${TOOLCHAIN_C_FLAGS} --print-multi-directory
+    OUTPUT_VARIABLE NEWLIB_DIR
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+
+  set(LIBC_LIBRARY_DIR "\"${SYSROOT_DIR}\"/lib/${NEWLIB_DIR}")
+endif()
+
 # This libgcc code is partially duplicated in compiler/*/target.cmake
 execute_process(
   COMMAND ${CMAKE_C_COMPILER} ${TOOLCHAIN_C_FLAGS} --print-libgcc-file-name
@@ -86,18 +102,6 @@

 LIST(APPEND LIB_INCLUDE_DIR "-L\"${LIBGCC_DIR}\"")
 LIST(APPEND TOOLCHAIN_LIBS gcc)
-
-if(SYSROOT_DIR)
-  # The toolchain has specified a sysroot dir that we can use to set
-  # the libc path's
-  execute_process(
-    COMMAND ${CMAKE_C_COMPILER} ${TOOLCHAIN_C_FLAGS} --print-multi-directory
-    OUTPUT_VARIABLE NEWLIB_DIR
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-    )
-
-  set(LIBC_LIBRARY_DIR "\"${SYSROOT_DIR}\"/lib/${NEWLIB_DIR}")
-endif()

 # For CMake to be able to test if a compiler flag is supported by the
 # toolchain we need to give CMake the necessary flags to compile and


cmake distro finder also looks in /etc/os-release.

--- cmake/linux-distro-helper.cmake
+++ cmake/linux-distro-helper.cmake
@@ -7,14 +7,25 @@
   if(CMAKE_SYSTEM_NAME STREQUAL "Linux")

     find_program(LSB_RELEASE_EXEC lsb_release)
+    mark_as_advanced(LSB_RELEASE_EXEC)

     if(LSB_RELEASE_EXEC)
       execute_process(COMMAND ${LSB_RELEASE_EXEC} -is
         OUTPUT_VARIABLE GEARSHIFFT_LINUX_DISTRO
         OUTPUT_STRIP_TRAILING_WHITESPACE
         )
+    else()
+      find_path(OS_RELEASE
+        NAMES "os-release"
+        PATHS /etc
+        NO_DEFAULT_PATH)
+      if(OS_RELEASE)
+        execute_process(COMMAND "awk -F= '/^NAME/{print $2}' /etc/os-release"
+          OUTPUT_VARIABLE GEARSHIFFT_LINUX_DISTRO
+          OUTPUT_STRIP_TRAILING_WHITESPACE
+          )
+      endif()
     endif()
-    mark_as_advanced(LSB_RELEASE_EXEC)
   endif()

 endmacro()


Resolve conflict.

Resolve conflict.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -418,13 +418,11 @@
 #              to CLASSPATH as-is
 #       TEST_ONLY - (optional) Jar file is for testcases only and should not
 #              be installed
-
 MACRO (DECLARE_ZORBA_JAR)
   PARSE_ARGUMENTS (JAR "FILE" "" "TEST_ONLY;EXTERNAL" ${ARGN})
   IF (NOT JAR_FILE)
     MESSAGE (FATAL_ERROR "'FILE' argument is required for DECLARE_ZORBA_JAR")
   ENDIF (NOT JAR_FILE)
-
   # Initialize classpath file and set up copy rule (once per project)
   SET (_CP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
   GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-jars")
@@ -437,10 +435,6 @@

   # Iterate over all supplied jar files
   FOREACH (_jar_file ${JAR_FILE})
-    IF (NOT IS_ABSOLUTE "${_jar_file}")
-      SET (_jar_file "${CMAKE_CURRENT_BINARY_DIR}}/${_jar_file}")
-    ENDIF (NOT IS_ABSOLUTE "${_jar_file}")
-
     IF (JAR_EXTERNAL)
       # Put absolute path into classpath file
       FILE (APPEND "${_CP_FILE}" "${_jar_file}\n")
@@ -448,12 +442,13 @@
       # Copy jar to jars/ directory and add relative path to classpath file
       GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
       ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" "" ""
-	1 "${JAR_TEST_ONLY}")
+  1 "${JAR_TEST_ONLY}")
       FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
     ENDIF (JAR_EXTERNAL)

   ENDFOREACH (_jar_file)
 ENDMACRO (DECLARE_ZORBA_JAR)
+

 # Utility macro for setting up a build rule to copy a file to a


Revert "reverting some tweaks"

Revert "reverting some tweaks"

This reverts commit 53641170afc9e9699fda3af67730b5c073872e51.

--- cmake/FindSuiteSparse.cmake
+++ cmake/FindSuiteSparse.cmake
@@ -1,12 +1,14 @@
-# Based on code from:
+# Based on the file with the same name from:
 #
 # Ceres Solver - A fast non-linear least squares minimizer
 # http://code.google.com/p/ceres-solver/
 #
-# With tweaks by: Dan Foreman-Mackey danfm@nyu.edu
+# With tweaks by: Dan Foreman-Mackey - danfm@nyu.edu
+#
+# Original license:
 #
 # Copyright 2013 Google Inc. All rights reserved.
-
+#
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
 #
@@ -156,6 +158,20 @@
   /usr/local/homebrew/lib # Mac OS X
   /usr/local/lib
   /usr/local/lib/suitesparse)
+
+# # BLAS.
+# FIND_PACKAGE(BLAS QUIET)
+# IF (NOT BLAS_FOUND)
+#   SUITESPARSE_REPORT_NOT_FOUND(
+#     "Did not find BLAS library (required for SuiteSparse).")
+# ENDIF (NOT BLAS_FOUND)
+#
+# # LAPACK.
+# FIND_PACKAGE(LAPACK QUIET)
+# IF (NOT LAPACK_FOUND)
+#   SUITESPARSE_REPORT_NOT_FOUND(
+#     "Did not find LAPACK library (required for SuiteSparse).")
+# ENDIF (NOT LAPACK_FOUND)

 # AMD.
 SET(AMD_FOUND TRUE)
@@ -437,12 +453,7 @@
   # SuiteSparse version >= 4.
   SET(SUITESPARSE_VERSION_FILE
     ${SUITESPARSE_CONFIG_INCLUDE_DIR}/SuiteSparse_config.h)
-  IF (NOT EXISTS ${SUITESPARSE_VERSION_FILE})
-    SUITESPARSE_REPORT_NOT_FOUND(
-      "Could not find file: ${SUITESPARSE_VERSION_FILE} containing version "
-      "information for >= v4 SuiteSparse installs, but SuiteSparse_config was "
-      "found (only present in >= v4 installs).")
-  ELSE (NOT EXISTS ${SUITESPARSE_VERSION_FILE})
+  IF (EXISTS ${SUITESPARSE_VERSION_FILE})
     FILE(READ ${SUITESPARSE_VERSION_FILE} SUITESPARSE_CONFIG_CONTENTS)

     STRING(REGEX MATCH "#define SUITESPARSE_MAIN_VERSION [0-9]+"
@@ -464,7 +475,7 @@
     # elements and insert ';' separators which would result in 4.;2.;1 nonsense.
     SET(SUITESPARSE_VERSION
       "${SUITESPARSE_MAIN_VERSION}.${SUITESPARSE_SUB_VERSION}.${SUITESPARSE_SUBSUB_VERSION}")
-  ENDIF (NOT EXISTS ${SUITESPARSE_VERSION_FILE})
+  ENDIF (EXISTS ${SUITESPARSE_VERSION_FILE})
 ENDIF (SUITESPARSE_CONFIG_FOUND)

 # METIS (Optional dependency).
@@ -484,8 +495,7 @@
     COLAMD_FOUND AND
     CCOLAMD_FOUND AND
     CHOLMOD_FOUND AND
-    SUITESPARSEQR_FOUND AND
-    (SUITESPARSE_CONFIG_FOUND OR UFCONFIG_FOUND))
+    SUITESPARSEQR_FOUND)
   SET(SUITESPARSE_FOUND TRUE)
   LIST(APPEND SUITESPARSE_INCLUDE_DIRS
     ${AMD_INCLUDE_DIR}


Fix weird FindGDK behavior

Fix weird FindGDK behavior

Don't set GDK_LIBRARY_RELEASE to the value of GDK_LIBRARY_DEBUG if release
build is not found, and vice versa. Just leave it empty.

--- cmake/Modules/FindGDK.cmake
+++ cmake/Modules/FindGDK.cmake
@@ -34,20 +34,14 @@
 if(GDK_LIBRARY_DEBUG AND GDK_LIBRARY_RELEASE)
   if(CMAKE_CONFIGURATIONS OR CMAKE_BUILD_TYPE)
     set(GDK_LIBRARY debug     ${GDK_LIBRARY_DEBUG}
-                     optimized ${GDK_LIBRARY_RELEASE})
+                    optimized ${GDK_LIBRARY_RELEASE})
   else()
     set(GDK_LIBRARY ${GDK_LIBRARY_RELEASE})
   endif()
-endif()
-
-if(GDK_LIBRARY_DEBUG AND NOT GDK_LIBRARY_RELEASE)
-  set(GDK_LIBRARY         ${GDK_LIBRARY_DEBUG})
-  set(GDK_LIBRARY_RELEASE ${GDK_LIBRARY_DEBUG})
-endif()
-
-if(GDK_LIBRARY_RELEASE AND NOT GDK_LIBRARY_DEBUG)
-  set(GDK_LIBRARY         ${GDK_LIBRARY_RELEASE})
-  set(GDK_LIBRARY_DEBUG   ${GDK_LIBRARY_RELEASE})
+elseif(GDK_LIBRARY_DEBUG AND NOT GDK_LIBRARY_RELEASE)
+  set(GDK_LIBRARY ${GDK_LIBRARY_DEBUG})
+elseif(GDK_LIBRARY_RELEASE AND NOT GDK_LIBRARY_DEBUG)
+  set(GDK_LIBRARY ${GDK_LIBRARY_RELEASE})
 endif()

 set(GDK_LIBRARY ${GDK_LIBRARY} CACHE FILEPATH "GDK library")


cmake: add -fcheck-new to cxx_compile_flags

GCC assumes that operator new never returns null, but throws an exception
instead. This is defined by the C++ standard, and thus ok. But we disable
exceptions with -fno-exceptions, so we break this assumption. GCC then goes
ahead and removes some of our nullptr checks. This flag removes the
assumption.

This adds ~1.4kB to the binary size of the px4fmu-v4 target.

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -643,6 +643,7 @@
 	set(cxx_compile_flags
 		-g
 		-fno-exceptions
+		-fcheck-new
 		-fno-rtti
 		-std=gnu++0x
 		-fno-threadsafe-statics


Fix cmake warning test=develop

Fix cmake warning test=develop

--- cmake/external/ngraph.cmake
+++ cmake/external/ngraph.cmake
@@ -37,7 +37,7 @@
 INCLUDE(ExternalProject)

 SET(NGRAPH_PROJECT         "extern_ngraph")
-SET(NGRAPH_GIT_TAG         "08851c2c45fcf9fa9c74871dd3dbc3fe38f37cc9")
+SET(NGRAPH_GIT_TAG         "20bd8bbc79ae3a81c57313846a2be7313e5d1dab")
 SET(NGRAPH_SOURCES_DIR     ${THIRD_PARTY_PATH}/ngraph)
 SET(NGRAPH_INSTALL_DIR     ${THIRD_PARTY_PATH}/install/ngraph)
 SET(NGRAPH_INC_DIR         ${NGRAPH_INSTALL_DIR}/include)


dont build spdlog examples

dont build spdlog examples

--- cmake/external/spdlog.cmake
+++ cmake/external/spdlog.cmake
@@ -19,7 +19,7 @@
 	CMAKE_ARGS
 	-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
 	-DCMAKE_POSITION_INDEPENDENT_CODE=ON
-	-DSPDLOG_BUILD_EXAMPLE=OFF
+	-DSPDLOG_BUILD_EXAMPLES=OFF
 	-DSPDLOG_BUILD_BENCH=OFF
 	-DSPDLOG_BUILD_TESTS=OFF
 	INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory ${spdlog_SOURCE_DIR}/include ${spdlog_INCLUDE_DIR}


Address: https://github.com/intel/mkl-dnn/pull/483 (#3080)

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -21,7 +21,7 @@
 set(NGRAPH_MKLDNN_FULL_VERSION 0.19.0.0)
 set(NGRAPH_MKLDNN_VERSION "v0.19")
 set(NGRAPH_MKLDNN_SUB_VERSION "2019.0.5.20190502")
-set(NGRAPH_MKLDNN_GIT_TAG "v0.19")
+set(NGRAPH_MKLDNN_GIT_TAG "027de76")

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


Remove yet another buried and hidden implicit dependency: every single
sub-library for the targets depended on the core target CodeGen library.
This completely undermined the careful work to separate the those
libraries, especially the MC-layer ones. This surfaced as circular
dependencies when the libraries were built as shared libraries where
CMake doesn't allow cycles.

This should fix PR10537. I'll watch the bots to see if there is fallout
on other platforms.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -23,13 +23,6 @@
     install(TARGETS ${name}
       LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
       ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
-  endif()
-  # The LLVM Target library shall be built before its sublibraries
-  # (asmprinter, etc) because those may use tablegenned files which
-  # generation is triggered by the main LLVM target library. Necessary
-  # for parallel builds:
-  if( CURRENT_LLVM_TARGET )
-    add_dependencies(${name} ${CURRENT_LLVM_TARGET})
   endif()
   set_target_properties(${name} PROPERTIES FOLDER "Libraries")
 endmacro(add_llvm_library name)


Fix the missing link dependencies for tbb on Linux

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -290,6 +290,11 @@
           IMPORTED_LOCATION_MINSIZEREL     ${TBB_LIBRARIES_RELEASE}
           )
     endif()
+
+    if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+       find_package(Threads QUIET REQUIRED)
+       set_target_properties(TBB::tbb PROPERTIES INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS};Threads::Threads")
+    endif()
   endif()

   mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES)


remove FindVLC (not used anymore and superseded by FindLIBVLC)

--- cmake/modules/FindVLC.cmake
+++ cmake/modules/FindVLC.cmake
@@ -1,58 +0,0 @@
-# - Try to find VLC library
-# Once done this will define
-#
-#  VLC_FOUND - system has VLC
-#  VLC_INCLUDE_DIR - The VLC include directory
-#  VLC_LIBRARIES - The libraries needed to use VLC
-#  VLC_DEFINITIONS - Compiler switches required for using VLC
-#
-# Copyright (C) 2008, Tanguy Krotoff <tkrotoff@gmail.com>
-# Copyright (C) 2008, Lukas Durfina <lukas.durfina@gmail.com>
-# Copyright (c) 2009, Fathi Boudra <fboudra@gmail.com>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-if(VLC_INCLUDE_DIR AND VLC_LIBRARIES)
-   # in cache already
-   set(VLC_FIND_QUIETLY TRUE)
-endif(VLC_INCLUDE_DIR AND VLC_LIBRARIES)
-
-set( VLC_VERSION_OK = True )
-
-# use pkg-config to get the directories and then use these values
-# in the FIND_PATH() and FIND_LIBRARY() calls
-#if(NOT WIN32)
-#  find_package(PkgConfig)
-#  pkg_check_modules(VLC libvlc>=1.1.0)
-#  set(VLC_DEFINITIONS ${VLC_CFLAGS})
-#  set(VLC_LIBRARIES ${VLC_LDFLAGS})
-#  # TODO add argument support to pass version on find_package
-#  include(MacroEnsureVersion)
-#  macro_ensure_version(1.1.0 ${VLC_VERSION} VLC_VERSION_OK)
-#endif(NOT WIN32)
-
-
-if(VLC_VERSION_OK)
-  set(VLC_FOUND TRUE)
-  message(STATUS "VLC library found")
-else(VLC_VERSION_OK)
-  set(VLC_FOUND FALSE)
-  message(FATAL_ERROR "VLC library not found")
-endif(VLC_VERSION_OK)
-
-find_path(VLC_INCLUDE_DIR
-          NAMES vlc.h
-          PATHS ${VLC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/../../include/vlc/
-          PATH_SUFFIXES vlc)
-
-find_library(VLC_LIBRARIES
-             NAMES vlc
-             PATHS ${VLC_LIBRARY_DIRS})
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(VLC DEFAULT_MSG VLC_INCLUDE_DIR VLC_LIBRARIES)
-
-# show the VLC_INCLUDE_DIR and VLC_LIBRARIES variables only in the advanced view
-mark_as_advanced(VLC_INCLUDE_DIR VLC_LIBRARIES)


Fix FindXcb not doing version checks for components

Version checks for FindXcb only make sense if all components have the
same version or only a single component is specified

--- cmake/modules/FindXcb.cmake
+++ cmake/modules/FindXcb.cmake
@@ -26,6 +26,13 @@
     message(FATAL_ERROR "Unknow component \"${_comp}\" of XCB")
   endif()

+  # Forward the different find options set for FindXcb to the individual
+  # components. This is required because find_package_handle_standard_args in
+  # find_package_impl uses these variables for version checks and other things.
+  set(Xcb_${_comp}_FIND_VERSION ${Xcb_FIND_VERSION})
+  set(Xcb_${_comp}_FIND_QUIETLY ${Xcb_FIND_QUIETLY})
+  set(Xcb_${_comp}_FIND_REQUIRED ${Xcb_FIND_REQUIRED})
+
   # Bypass developer warning that the first argument to
   # find_package_handle_standard_args (Xcb_...) does not match the name of the
   # calling package (Xcb)


update repo versions after latest release from ST


change CMake logic to determine env var name for library path

--- ament_cmake_test/cmake/ament_add_test.cmake
+++ ament_cmake_test/cmake/ament_add_test.cmake
@@ -93,13 +93,13 @@
   endif()
   if(ARG_APPEND_LIBRARY_DIRS)
     if(WIN32)
-      set(_library_dirs_env_var PATH)
-    endif()
-    if(UNIX AND NOT APPLE)
-      set(_library_dirs_env_var LD_LIBRARY_PATH)
-    endif()
-    if(APPLE)
-      set(_library_dirs_env_var DYLD_LIBRARY_PATH)
+      set(_library_dirs_env_var "PATH")
+    elseif(APPLE)
+      set(_library_dirs_env_var "DYLD_LIBRARY_PATH")
+    elseif(UNIX)
+      set(_library_dirs_env_var "LD_LIBRARY_PATH")
+    else()
+      message(FATAL_ERROR "Unknown platform for environment variable to find libraries")
     endif()
     foreach(_dir ${ARG_APPEND_LIBRARY_DIRS})
       list(APPEND ARG_APPEND_ENV "${_library_dirs_env_var}=${_dir}")


Add /usr/local/opt/icu4c to CMAKE_PREFIX_PATH for Darwin.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -43,7 +43,7 @@
   else()
     set(DEFAULT_VESPA_LLVM_VERSION "10" PARENT_SCOPE)
   endif()
-  set(DEFAULT_CMAKE_PREFIX_PATH "${VESPA_DEPS}" "/usr/local/opt/bison" "/usr/local/opt/flex" "/usr/local/opt/openssl@1.1" "/usr/local/opt/openblas" PARENT_SCOPE)
+  set(DEFAULT_CMAKE_PREFIX_PATH "${VESPA_DEPS}" "/usr/local/opt/bison" "/usr/local/opt/flex" "/usr/local/opt/openssl@1.1" "/usr/local/opt/openblas" "/usr/local/opt/icu4c" PARENT_SCOPE)
   set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib" "/usr/local/opt/bison/lib" "/usr/local/opt/flex/lib" "/usr/local/opt/icu4c/lib" "/usr/local/opt/openssl@1.1/lib" "/usr/local/opt/openblas/lib")
   if(DEFINED DEFAULT_LLVM_LINK_DIRECTORY)
     list(APPEND DEFAULT_EXTRA_LINK_DIRECTORY "${DEFAULT_LLVM_LINK_DIRECTORY}")


fix MySQL CMake include directory search

--- cmake/FindMySQLCAPI.cmake
+++ cmake/FindMySQLCAPI.cmake
@@ -21,6 +21,7 @@
     find_path(
 		MYSQLCAPI_INCLUDE_DIR
 		NAMES
+		"mariadb_version.h"
 		"mysql_version.h"
 		HINTS
 		${MYSQLCAPI_ROOT_DIR}


Fix LibSMV being searched when NEKTAR_USE_SMV is OFF

--- cmake/ThirdPartySMV.cmake
+++ cmake/ThirdPartySMV.cmake
@@ -16,6 +16,8 @@
     MARK_AS_ADVANCED(SMV)
     LINK_DIRECTORIES(${TPSRC}/dist/lib)
 ELSE (THIRDPARTY_BUILD_SMV)
-    INCLUDE(FindSMV)
+    IF (NEKTAR_USE_SMV)
+        INCLUDE(FindSMV)
+    ENDIF (NEKTAR_USE_SMV)
 ENDIF (THIRDPARTY_BUILD_SMV)


cmake qi_stage_cmake : use qi_install_cmake

Change-Id: Iad7583a135d6527e0138f587401e3316657b7c26

--- cmake/qibuild/stage.cmake
+++ cmake/qibuild/stage.cmake
@@ -124,9 +124,8 @@
        DESTINATION
        "${QI_SDK_DIR}/${QI_SDK_CMAKE_MODULES}/")

-  install(FILES "${module_file}"
-      DESTINATION
-      "${QI_SDK_CMAKE}/${_module_name}/")
+  qi_install_cmake("${module_file}" SUBFOLDER "${_module_name}")
+
 endfunction()


qibuild/test.cmake: CMake lover came here :)

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -12,76 +12,67 @@
 # This cmake module provide function to interface gtest with ctest.

-set(_TESTS_RESULTS_FOLDER "${CMAKE_BINARY_DIR}/tests-results" CACHE INTERNAL "" FORCE)
+set(_TESTS_RESULTS_FOLDER "${CMAKE_SOURC_DIR}/tests-results" CACHE INTERNAL "" FORCE)
 # create tests_results folder if it does not exist
 file(MAKE_DIRECTORY "${_TESTS_RESULTS_FOLDER}")

+#! Add a test using a binary that was created by qi_create_bin
+# The only difference with add_test() is that qi_add_test will deal with
+# the fact that the the binary is in sdk/ directory, and than it is named
+# with _d on visual studio.
+# \param:TIMETOUT the timeout of the test
+# \group:ARGUMENTS arguments to pass to add_test
+function(qi_add_test test_name target_name)
+  cmake_parse_arguments(ARG "" "TIMEOUT;ARGUMENTS" "" ${ARGN})
+  if(NOT ARG_TIMEOUT)
+    set(ARG_TIMEOUT 20)
+  endif()
+  if(WIN32)
+    if (${CMAKE_BUILD_TYPE} STREQUAL "DEBUG")
+      add_test(${test_name} ${QI_SDK_DIR}/${target_name}_d ${ARG_ARGUMENTS})
+    else()
+      add_test(${test_name} ${QI_SDK_DIR}/${target_name} ${ARG_ARGUMENTS})
+    endif()
+  else()
+    # Not on windows, no need to make a distinction:
+    add_test(${test_name} ${QI_SDK_DIR}/${target_name} ${ARG_ARGUMENTS})
+  endif()
+  set_tests_properties(${test_name} PROPERTIES
+    TIMEOUT ${ARG_TIMEOUT}
+  )
+endfunction()
+
+
+
 #! This compiles and add_test's a C++ test that uses gtest.
 # (so that the test can be run by CTest)
-# When run, the C++ test outputs a xUnit xml file in CMAKE_SOURCE_DIR/test_name.xml.
+# When run, the C++ test outputs a xUnit xml file in
+# ${CMAKE_SOURCE_DIR}/test-results/${test_name}.xml
 #
 # \flag:NO_ADD_TEST do not call add_test, just create the binary
 # \param:TIMEOUT the timeout of the test
 # \group:SRC sources
 # \group:DEPENDS dependencies to pass to use_lib
 # \group:ARGUMENTS arguments to pass to add_test (to your test program)
-function(qi_create_gtest name)
-  qi_debug("qi_create_gtest(${name})")
+function(qi_create_gtest test_name target_name)
   cmake_parse_arguments(ARG "NO_ADD_TEST" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})

-  if (NOT TARGET "autotest")
-    add_custom_target("autotest")
+  # First, create the target
+  qi_create_bin(${target_name} SRC ${ARG_SRC})
+  qi_use_lib(${target_name} ${ARG_DEPENDS})
+
+
+  # Build a correct xml output name
+  set(xml_output "${_TESTS_RESULTS_FOLDER}/${test_name}.xml")
+
+  if (WIN32)
+    string(REPLACE "/" "\\\\" xml_output ${xml_output})
   endif()

-  if(NOT ARG_TIMEOUT)
-    set(ARG_TIMEOUT 20)
-  endif()
-
-  # Create the binary test, link with dependencies.
-  if (BUILD_TESTS)
-    qi_create_bin("${name}_bin" ${ARG_SRC} NO_INSTALL)
-  else()
-    qi_create_bin("${name}_bin" EXCLUDE_FROM_ALL ${ARG_SRC} NO_INSTALL)
-  endif()
-  add_dependencies("autotest" "${name}_bin")
-  qi_use_lib("${name}_bin" ${ARG_DEPENDS})
-
-  if (ARG_NO_ADD_TEST)
-    return()
-  endif()
-
-  #TODO: get this back
-  return()
-
-  # use sdk trampoline (.bat on windows) to set all environment variables correctly.
-  if(WIN32)
-    #TODO: get this back
-    #qi_create_insource_launcher("${name}_bin" "${name}.bat")
-    qi_add_gtest("${name}.bat" ${name} ARGUMENTS ${_arguments})
-  else()
-    #TODO: get this back
-    #qi_create_insource_launcher("${name}_bin" ${name})
-    qi_add_gtest(${name} ${name} ARGUMENTS ${_arguments})
-  endif()
-  set_tests_properties(${name} PROPERTIES TIMEOUT ${_timeout})
+  # Call qi_add_test with correct arguments:
+  qi_add_test({test_name} ${target_name}
+    TIMEOUT ${ARG_TIMEOUT}
+    ARGUMENTS --gest_output=xml:${_xml_output} ${ARG_ARGUMENTS}
+  )
 endfunction()
-
-
-#! add a gtest program to ctest.
-# Xml output (test_name.xml) will be in build/tests_results
-#
-# \arg:executable_name the executable
-# \arg:test_case_name the test's name
-# \argn: program arguments
-function(qi_add_gtest executable_name test_name)
-  set(xml_output_name "${_TESTS_RESULTS_FOLDER}/${_test_name}.xml")
-
-  # Replaces / for windows, and remove .bat from xml name:
-  if (WIN32)
-    string(REPLACE "/" "\\\\" xml_output_name ${xml_output_name})
-  endif()
-
-  # Add gtest for ctest with xml output file.
-  add_test(${test_name} ${SDK_DIR}/bin/${executable_name} --gtest_output=xml:${xml_output_name} ${ARGN})
-endfunction()


Extend Common module

Extend Common module

--- Common.cmake
+++ Common.cmake
@@ -35,9 +35,14 @@

 # Compiler setting
 if(CMAKE_COMPILER_IS_GNUCXX)
+  include(EqCompilerVersion)
+  EQ_COMPILER_DUMPVERSION(GCC_COMPILER_VERSION)
+  if(GCC_COMPILER_VERSION VERSION_LESS 4.1)
+    message(ERROR "GCC 4.1 or later required, found ${GCC_COMPILER_VERSION}")
+  endif()
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Winvalid-pch -Wnon-virtual-dtor -Wsign-promo -Wshadow -Winit-self -Wno-unknown-pragmas -Wno-unused-parameter -Wno-write-strings")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wuninitialized")
-  if(NOT WIN32 AND NOT XCODE_VERSION)
+  if(NOT WIN32 AND NOT XCODE_VERSION AND NOT RELEASE_VERSION)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
   endif()
 endif(CMAKE_COMPILER_IS_GNUCXX)
@@ -49,15 +54,34 @@
     /wd4244 # conversion from X to Y, possible loss of data
     /wd4800 # forcing value to bool 'true' or 'false' (performance warning)
     )
+
+  # http://www.ogre3d.org/forums/viewtopic.php?f=2&t=60015&start=0
+  if(RELEASE_VERSION)
+    set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /Zm500 /EHsc /GR")
+  else()
+    set(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /Zm500 /EHsc /GR /WX")
+  endif()
 endif(MSVC)

-if(LINUX)
-  add_definitions(-fPIC) # 64bit Linux wants this
+if(CMAKE_SYSTEM_NAME MATCHES "Linux")
+  set(LINUX TRUE)
+  add_definitions(-fPIC)
+
+  if(REDHAT AND CMAKE_SYSTEM_PROCESSOR MATCHES "64$")
+    set(LIB_SUFFIX 64 CACHE STRING "Library directory suffix")
+  endif()
+  set(LIBRARY_DIR lib${LIB_SUFFIX})
 endif(LINUX)

 if(APPLE)
-  set(CMAKE_OSX_ARCHITECTURES "i386;x86_64")
+  if(_CMAKE_OSX_MACHINE MATCHES "ppc")
+    set(OSX_ARCHITECTURES "ppc;ppc64" CACHE STRING "Build architectures")
+  else()
+    set(OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures")
+  endif()
+  set(CMAKE_OSX_ARCHITECTURES ${OSX_ARCHITECTURES})
   set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
   set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
+  message(STATUS "Building for ${CMAKE_OSX_ARCHITECTURES}")
 endif(APPLE)


Add assert_file_contains assertion.

Add assert_file_contains assertion.

This assertion opens a file specified and checks if it contains a
particular substring.

--- CMakeUnit.cmake
+++ CMakeUnit.cmake
@@ -534,3 +534,48 @@
     endif (RESULT)

 endfunction (assert_file_does_not_exist)
+
+function (_file_contains_substring FILE SUBSTRING RESULT_VARIABLE)
+
+    file (READ ${FILE} CONTENTS)
+
+    _string_contains (${CONTENTS} ${SUBSTRING} RESULT)
+
+    # PARENT_SCOPE only propogates up one level so we need to
+    # propogate the result here too
+    set (${RESULT_VARIABLE} ${RESULT} PARENT_SCOPE)
+
+endfunction (_file_contains_substring)
+
+# assert_file_contains:
+#
+# Throws a non-fatal error if the file specified by FILE
+# does not contain the substring SUBSTRING
+function (assert_file_contains FILE SUBSTRING)
+
+    _file_contains_substring (${FILE} ${SUBSTRING} RESULT)
+
+    if (NOT RESULT)
+
+        message (SEND_ERROR "The file ${FILE} does not contain the string "
+                 " ${SUBSTRING}")
+
+    endif (NOT RESULT)
+
+endfunction (assert_file_contains)
+
+# assert_file_does_not_contain:
+#
+# Throws a non-fatal error if the file specified by FILE
+# contains the substring SUBSTRING
+function (assert_file_does_not_contain FILE SUBSTRING)
+
+    _file_contains_substring (${FILE} ${SUBSTRING} RESULT)
+
+    if (RESULT)
+
+        message (SEND_ERROR "The file ${FILE} contains the string ${SUBSTRING}")
+
+    endif (RESULT)
+
+endfunction (assert_file_does_not_contain)


Make directed tests linking depend upon HIP_PATH/lib/*

Change-Id: I35203fc655325428e241a541f64c103fb2004b6e

--- tests/hit/HIT.cmake
+++ tests/hit/HIT.cmake
@@ -130,6 +130,7 @@
 #-------------------------------------------------------------------------------

 # Macro: HIT_ADD_FILES used to scan+add multiple files for testing.
+file(GLOB HIP_LIB_FILES ${HIP_PATH}/lib/*)
 macro(HIT_ADD_FILES _dir _label)
     foreach (file ${ARGN})
         # Build tests
@@ -148,7 +149,7 @@
             else()
                 set_source_files_properties(${_sources} PROPERTIES HIP_SOURCE_PROPERTY_FORMAT 1)
                 hip_add_executable(${target} ${_sources} HIPCC_OPTIONS ${_hipcc_options} HCC_OPTIONS ${_hcc_options} NVCC_OPTIONS ${_nvcc_options})
-                set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target} RUNTIME_OUTPUT_DIRECTORY ${_label})
+                set_target_properties(${target} PROPERTIES OUTPUT_NAME ${_target} RUNTIME_OUTPUT_DIRECTORY ${_label} LINK_DEPENDS "${HIP_LIB_FILES}")
             endif()
         endforeach()


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 "0d506533dd0fafd88d30b7f4d3e5843017afca71")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "0582bfa0a5cb21ffab8317f8c8feb54d0318dbf8")

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


Updated FW with device EEPROM handling fixes

--- 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 "2531b4af4fc4724a9bd5cfa0f8aed6441c96ac7a")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "7279adec35030e586dc8b81390f58178b4b34ae9")

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


Update FW, fix CI build: depthai-shared PR merged

--- 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 "49ca8b9d035ef51c3442d860ebf2e9d701807e44")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "3b51648b0d96c9391d878eede0fd5fd9b44084ca")

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


Update FW: support for new devices with 3x 4-lane cam ports, TMP: enable RGB-depth alignment for 12MP full FoV (hardcoded)

--- 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 "077fa75ba35a83d8c42156c40718d412a5825b77")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "47e069cc7f16d29b37e17b2923322bc9824ebed4")

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


Update FW/mdk: Merge confidence_map_alignment_opt into develop

--- 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 "3aef66802d697e1f5b3c77830455379e46d9d426")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "e12f6d102f5600ff660708235ef9c52e3b2a1656")

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


Update device FW with fixes for RGB: - fix crash with RGB 12MP + depth - fix the cropping for 4K (make it centered)

--- 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 "725fe5000ce2e6abdc3bc0caf29ef0ad11389d4c")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "140e154fc21a851daeb1d2ecee29d5dfb16f6847")

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


added lib dir for apple target

added lib dir for apple target

--- cmake/Modules/DefineInstallationPaths.cmake
+++ cmake/Modules/DefineInstallationPaths.cmake
@@ -6,7 +6,8 @@
 		SET(FRAMEWORK_DIR ${BUNDLE_DIR}/Contents/Frameworks)

 		set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE})
-
+		set(LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+
 		SET(PHAPI_PLUGIN_INSTALL_DIR ${FRAMEWORK_DIR}/phapi-plugins
 			CACHE PATH "PhApi plugin installation path")
 		SET(DATA_INSTALL_DIR ${RESOURCE_DIR}


correct error message when GSL is not found. One has to set GSL_ROOT_DIR and not GSL_DIR (See FindGSL documentation)


Fix qi_set_qt_plugin_properties to not lose previous compile definitions

Change-Id: Ife2b87597fe43dc0c664550e7d3a746b1cfdd3be
Reviewed-on: http://gerrit.aldebaran.lan/62687
Reviewed-by: gvallat <7d83891388e041c562501668fa177e847ace2b0a@aldebaran-robotics.com>
Tested-by: gerrit

--- cmake/qibuild/modules/qt-tools-common.cmake
+++ cmake/qibuild/modules/qt-tools-common.cmake
@@ -4,15 +4,18 @@

 function(qi_set_qt_plugin_properties target)
   if(CMAKE_MAJOR_VERSION LESS 3)
+    get_target_property(RELEASE_DEF "${target}" COMPILE_DEFINITIONS_RELEASE)
+    get_target_property(DEBUG_DEF "${target}" COMPILE_DEFINITIONS_DEBUG)
     set_target_properties("${target}"
       PROPERTIES
-      COMPILE_DEFINITIONS_RELEASE "QT_SHARED;QT_PLUGIN;QT_NO_DEBUG"
-      COMPILE_DEFINITIONS_DEBUG "QT_SHARED;QT_PLUGIN;QT_DEBUG"
+      COMPILE_DEFINITIONS_RELEASE "${RELEASE_DEF};QT_SHARED;QT_PLUGIN;QT_NO_DEBUG"
+      COMPILE_DEFINITIONS_DEBUG "${DEBUG_DEF};QT_SHARED;QT_PLUGIN;QT_DEBUG"
     )
   else()
+    get_target_property(DEF "${target}" COMPILE_DEFINITIONS)
     set_target_properties("${target}"
       PROPERTIES
-      COMPILE_DEFINITIONS "QT_SHARED;QT_PLUGIN;$<$<CONFIG:Release>:QT_NO_DEBUG>$<$<CONFIG:Debug>:QT_DEBUG>"
+      COMPILE_DEFINITIONS "${DEF};QT_SHARED;QT_PLUGIN;$<$<CONFIG:Release>:QT_NO_DEBUG>$<$<CONFIG:Debug>:QT_DEBUG>"
     )
   endif()
 endfunction()


wrap Connext libraries in --no-as-needed

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -305,6 +305,8 @@
   endif()

   if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    set(Connext_LIBRARIES "-Wl,--no-as-needed" ${Connext_LIBRARIES} "-Wl,--as-needed")
+
     # check with which ABI the Connext libraries are built
     configure_file(
       "${connext_cmake_module_DIR}/check_abi.cmake"


[STATS] Add libm.so to lib dependencies for stats library

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

--- runtime/cmake/LibompMicroTests.cmake
+++ runtime/cmake/LibompMicroTests.cmake
@@ -211,6 +211,7 @@
     libomp_append(libomp_expected_library_deps libhwloc.so.5 LIBOMP_USE_HWLOC)
   endif()
   libomp_append(libomp_expected_library_deps libstdc++.so.6 LIBOMP_USE_STDCPPLIB)
+  libomp_append(libomp_expected_library_deps libm.so.6 LIBOMP_STATS)
 endif()
 # Perl script expects comma separated list
 string(REPLACE ";" "," libomp_expected_library_deps "${libomp_expected_library_deps}")


CMake: Bugfix

CMake: Bugfix

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@29181 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_cpack.cmake
+++ deal.II/cmake/setup_cpack.cmake
@@ -34,14 +34,16 @@
 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")

 SET(CPACK_SOURCE_GENERATOR TGZ ZIP) # TBZ2
-SET(CPACK_SOURCE_IGNORE_FILES "/\\.svn/;\\.swp$;.*~$")
+SET(CPACK_SOURCE_IGNORE_FILES "/\\\\.svn/;\\\\.swp$;.*~$")

-SET(CPACK_GENERATOR TGZ TBZ2 ZIP) # TBZ2
+SET(CPACK_GENERATOR TGZ ZIP) # TBZ2

 #
 # Generator specific configuration:
 #

+SET(CPACK_ARCHIVE_COMPONENT_INSTALL TRUE)
+
 # TODO

 #INCLUDE(InstallRequiredSystemLibraries)


Look for mpich2-c.pc if openpa.pc not found

--- src/util/CMake/FindOPA.cmake
+++ src/util/CMake/FindOPA.cmake
@@ -6,6 +6,12 @@

 find_package(PkgConfig)
 pkg_check_modules(PC_OPA QUIET openpa)
+# If openpa.pc cannot be found, try to look for mpich2-c.pc
+if(NOT PC_OPA_INCLUDEDIRS)
+  pkg_check_modules(PC_MPICH2_C QUIET mpich2-c)
+  set(PC_OPA_INCLUDEDIR ${PC_MPICH2_C_INCLUDEDIR})
+  set(PC_OPA_LIBDIR ${PC_MPICH2_C_LIBDIR})
+endif()

 find_path(OPA_INCLUDE_DIR opa_primitives.h
   HINTS ${PC_OPA_INCLUDEDIR} ${PC_OPA_INCLUDE_DIRS})


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   13)
+SET(KWSYS_DATE_STAMP_DAY   14)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   16)
+SET(KWSYS_DATE_STAMP_DAY   17)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/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   17)
+SET(KWSYS_DATE_STAMP_DAY   18)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 12)

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


-update FindAutomoc4.cmake to include documentation, same as in kdelibs/cmake/modules/FindAutomoc4.cmake

Alex

--- cmake/FindAutomoc4.cmake
+++ cmake/FindAutomoc4.cmake
@@ -3,19 +3,41 @@
 #
 #  AUTOMOC4_FOUND - automoc4 has been found
 #  AUTOMOC4_EXECUTABLE - the automoc4 tool
+#  AUTOMOC4_VERSION - the full version of automoc4
+#  AUTOMOC4_VERSION_MAJOR, AUTOMOC4_VERSION_MINOR, AUTOMOC4_VERSION_PATCH - AUTOMOC4_VERSION
+#                     broken into its components
 #
 # It also adds the following macros
 #  AUTOMOC4(<target> <SRCS_VAR>)
 #    Use this to run automoc4 on all files contained in the list <SRCS_VAR>.
 #
-#  AUTOMOC4_MOC_HEADERS(<target> header1.h header2.h)
+#  AUTOMOC4_MOC_HEADERS(<target> header1.h header2.h ...)
 #    Use this to add more header files to be processed with automoc4.
+#
+#  AUTOMOC4_ADD_EXECUTABLE(<target_NAME> src1 src2 ...)
+#    This macro does the same as ADD_EXECUTABLE, but additionally
+#    adds automoc4 handling for all source files.
+#
+# AUTOMOC4_ADD_LIBRARY(<target_NAME> src1 src2 ...)
+#    This macro does the same as ADD_LIBRARY, but additionally
+#    adds automoc4 handling for all source files.
+
+# Internal helper macro, may change or be removed anytime:
+# _ADD_AUTOMOC4_TARGET(<target_NAME> <SRCS_VAR>)
+#
+# Since version 0.9.88:
+# The following two macros are only to be used for KDE4 projects
+# and do something which makes sure automoc4 works for KDE. Don't
+# use them anywhere else.
+# _AUTOMOC4_KDE4_PRE_TARGET_HANDLING(<target_NAME> <SRCS_VAR>)
+# _AUTOMOC4_KDE4_POST_TARGET_HANDLING(<target_NAME>)

-# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
+# Copyright (c) 2008-2009, Alexander Neundorf, <neundorf@kde.org>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+

 # check if we are inside KDESupport and automoc is enabled
 if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")


fix linker argements for HIP-clang

fix linker argements for HIP-clang

Each architecture must be passed as separate option.

--- cmake/alpakaCommon.cmake
+++ cmake/alpakaCommon.cmake
@@ -791,7 +791,9 @@
     endif()
     if(ALPAKA_HIP_PLATFORM MATCHES "clang")
         # GFX600, GFX601, GFX700, GFX701, GFX702, GFX703, GFX704, GFX801, GFX802, GFX803, GFX810, GFX900, GFX902
-        target_link_options(alpaka INTERFACE "--amdgpu-target=gfx803 --amdgpu-target=gfx900 --amdgpu-target=gfx906")
+        target_link_options(alpaka INTERFACE "--amdgpu-target=gfx803")
+        target_link_options(alpaka INTERFACE "--amdgpu-target=gfx900")
+        target_link_options(alpaka INTERFACE "--amdgpu-target=gfx906")
     endif()
 endif()


Fix AVX512 test always returning false due to missing compiler option

--- cmake/system_check.cmake
+++ cmake/system_check.cmake
@@ -78,7 +78,7 @@

 if (X86_64 OR X86)
   file(WRITE ${PROJECT_BINARY_DIR}/avx512.tmp "#include <immintrin.h>\n\nint main(void){ __asm__ volatile(\"vbroadcastss -4 * 4(%rsi), %zmm2\"); }")
-execute_process(COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512)
+execute_process(COMMAND ${CMAKE_C_COMPILER} -march=skylake-avx512 -c -v -o ${PROJECT_BINARY_DIR}/avx512.o -x c ${PROJECT_BINARY_DIR}/avx512.tmp OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE NO_AVX512)
 if (NO_AVX512 EQUAL 1)
 set (CCOMMON_OPT "${CCOMMON_OPT} -DNO_AVX512")
 endif()


Small change to ADIOS

Small change to ADIOS

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -119,15 +119,16 @@
       BUILD_BYPRODUCTS "<INSTALL_DIR>/${ADIOS2_LIB}" "<INSTALL_DIR>/${ADIOS2_IMPORT_LIB}"
       CMAKE_ARGS
         -DBUILD_TESTING=OFF
-        -DADIOS2_USE_BZip2=OFF
+        -DADIOS2_USE_BZip2=OFF
         -DADIOS2_USE_Fortran=OFF
-        -DADIOS2_USE_HDF5=OFF
+        -DADIOS2_USE_HDF5=OFF
         -DADIOS2_USE_Python=OFF
-        -DADIOS2_USE_SST=OFF
+        -DADIOS2_USE_SST=OFF
         -DADIOS2_USE_SZ=OFF
-        -DADIOS2_USE_SysVShMem=OFF
+        -DADIOS2_USE_SysVShMem=OFF
         -DADIOS2_USE_ZFP=OFF
-        -DADIOS2_USE_ZeroMQ=OFF
+        -DADIOS2_USE_ZeroMQ=OFF
+        -DADIOS2_USE_Profiling=OFF
         -DMPI_GUESS_LIBRARY_NAME=${MPI_GUESS_LIBRARY_NAME})

     add_external_library(adios2


added: seqan_add_cuda_test_executable

added: seqan_add_cuda_test_executable

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -337,6 +337,10 @@
     include_directories(${BOOST_INCLUDE_DIRS})
   endif (Boost_FOUND)

+  if (CUDA_FOUND)
+    add_definitions(-DSEQAN_HAS_CUDA=1)
+  endif (CUDA_FOUND)
+
   include(CheckIncludeFiles)
   check_include_files(execinfo.h HAVE_EXECINFO)
   if (HAVE_EXECINFO)
@@ -465,17 +469,9 @@
 endmacro (seqan_add_test_executable TARGET_NAME)

 # ---------------------------------------------------------------------------
-# Function seqan_add_cuda_testexecutable (TARGET_NAME source1.cu source2.[cu|cpp|h])
-#          seqan_add_cuda_testexecutable (TARGET_NAME)
-# ---------------------------------------------------------------------------
-
-# Create a SeqAn CUDA executable from the given source files.  If no such
-# files are given then all files in the current directory will be used.
-#
-# Also the test will be registered with add_test and depend on the current
-# test target, i.e. from closest seqan_setup_tests(TEST_TARGET_NAME) call.
-#
-# Only adds target if CUDA_FOUND is set to true.
+# Function seqan_add_cuda_executable (TARGET_NAME source1.cu source2.[cu|cpp|h])
+#          seqan_add_cuda_executable (TARGET_NAME)
+# ---------------------------------------------------------------------------

 function (seqan_add_cuda_executable TARGET_NAME)
     if (CUDA_FOUND)
@@ -517,6 +513,61 @@
       	endif (BZIP2_FOUND)
     endif (CUDA_FOUND)
 endfunction (seqan_add_cuda_executable TARGET_NAME)
+
+# ---------------------------------------------------------------------------
+# Function seqan_add_cuda_test_executable (TARGET_NAME source1.cu source2.[cu|cpp|h])
+#          seqan_add_cuda_test_executable (TARGET_NAME)
+# ---------------------------------------------------------------------------
+
+# Create a SeqAn CUDA executable from the given source files.  If no such
+# files are given then all files in the current directory will be used.
+#
+# Also the test will be registered with add_test and depend on the current
+# test target, i.e. from closest seqan_setup_tests(TEST_TARGET_NAME) call.
+#
+# Only adds target if CUDA_FOUND is set to true.
+
+function (seqan_add_cuda_test_executable TARGET_NAME)
+    if (CUDA_FOUND)
+        # TODO(holtgrew): Use all files in directory if ${ARGC} == 0
+
+        # -------------------------------------------------------------------
+        # Set CUDA variables
+        # -------------------------------------------------------------------
+        set (CUDA_PROPAGATE_HOST_FLAGS OFF)
+        set (CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)
+        #set (CUDA_NVCC_FLAGS "-pg")
+        list (APPEND CMAKE_CXX_SOURCE_FILE_EXTENSIONS "cu")
+        cuda_include_directories(${CUDA_CUT_INCLUDE_DIR})
+        #string (REGEX REPLACE "\\-(W( |all)|pedantic)" "" CUDA_CXX_FLAGS ${CUDA_NVCC_FLAGS} ${CMAKE_CXX_FLAGS})
+        string (REGEX REPLACE "\\-pedantic" "" CUDA_CXX_FLAGS ${CUDA_NVCC_FLAGS} ${CMAKE_CXX_FLAGS})
+
+        # -------------------------------------------------------------------
+        # Go on normally as in apps.
+        # -------------------------------------------------------------------
+        # message(STATUS "cuda_add_executable (${ARGV})")
+        cuda_add_executable (${ARGV})
+        add_test(test_${ARGV0} ${ARGV0})
+
+        # Link against librt on Linux.
+      	if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+        	target_link_libraries (${TARGET_NAME} rt)
+      	endif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+
+      	# Dependencies on all registered seqan extensions.
+      	add_dependencies(${ARGV0} ${SEQAN_LIBRARY_TARGETS})
+
+      	# Link against zlib and bzlib if found.
+      	if (ZLIB_FOUND)
+      	    include_directories (${ZLIB_INCLUDE_DIR})
+      	    target_link_libraries (${TARGET_NAME} ${ZLIB_LIBRARIES})
+      	endif (ZLIB_FOUND)
+      	if (BZIP2_FOUND)
+      	    include_directories (${BZIP2_INCLUDE_DIR})
+      	    target_link_libraries (${TARGET_NAME} ${BZIP2_LIBRARIES})
+      	endif (BZIP2_FOUND)
+    endif (CUDA_FOUND)
+endfunction (seqan_add_cuda_test_executable TARGET_NAME)

 # ---------------------------------------------------------------------------
 # Macro seqan_add_all_executables ([TARGET])


update gadgetron version

update gadgetron version

--- version_config.cmake
+++ version_config.cmake
@@ -91,7 +91,7 @@

 ## Gadgetron
 set(DEFAULT_Gadgetron_URL https://github.com/gadgetron/gadgetron )
-set(DEFAULT_Gadgetron_TAG e03b8a254eb25ff158175ac453500aa8b3c6199c)
+set(DEFAULT_Gadgetron_TAG b6191eaaa72ccca6c6a5fe4c0fa3319694f512ab)

 option (DEVEL_BUILD "Developer Build" OFF)
 mark_as_advanced(DEVEL_BUILD)