Support USE_PERL fallback for gensymbol

Support USE_PERL fallback for gensymbol

--- cmake/export.cmake
+++ cmake/export.cmake
@@ -50,6 +50,7 @@
   set(ONLY_CBLAS_IN ${ONLY_CBLAS})
 endif()

+if (NOT DEFINED USE_PERL)
 add_custom_command(
   OUTPUT ${PROJECT_BINARY_DIR}/openblas.def
   #TARGET ${OpenBLAS_LIBNAME} PRE_LINK
@@ -57,5 +58,13 @@
   ARGS "win2k" "${ARCH_IN}" "dummy" "${EXPRECISION_IN}" "${NO_CBLAS_IN}" "${NO_LAPACK_IN}" "${NO_LAPACKE_IN}" "${NEED2UNDERSCORES_IN}" "${ONLY_CBLAS_IN}" "${SYMBOLPREFIX}" "${SYMBOLSUFFIX}" > "${PROJECT_BINARY_DIR}/openblas.def"
   COMMENT "Create openblas.def file"
   VERBATIM)
-
+else
+add_custom_command(
+  OUTPUT ${PROJECT_BINARY_DIR}/openblas.def
+  #TARGET ${OpenBLAS_LIBNAME} PRE_LINK
+  COMMAND perl
+  ARGS "${PROJECT_SOURCE_DIR}/exports/gensymbol" "win2k" "${ARCH_IN}" "dummy" "${EXPRECISION_IN}" "${NO_CBLAS_IN}" "${NO_LAPACK_IN}" "${NO_LAPACKE_IN}" "${NEED2UNDERSCORES_IN}" "${ONLY_CBLAS_IN}" "${SYMBOLPREFIX}" "${SYMBOLSUFFIX}" > "${PROJECT_BINARY_DIR}/openblas.def"
+  COMMENT "Create openblas.def file"
+  VERBATIM)
+endif()
 endif()


Use @loader_path/../lib

Use @loader_path/../lib

A solo `@loader_path/` breaks plugin tests on OSX when building
out-of-tree. Going up then back down into lib shouldn't change the case
when @loader_path = /usr/local/lib or something simliar, but will fix
the case when @loader_path = /usr/local/bin or whatnot.

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -118,7 +118,7 @@
         LIBRARY DESTINATION ${PDAL_LIB_INSTALL_DIR}
         ARCHIVE DESTINATION ${PDAL_LIB_INSTALL_DIR})
     if (APPLE)
-        set_target_properties(${${_name}} PROPERTIES INSTALL_NAME_DIR "@loader_path/")
+        set_target_properties(${${_name}} PROPERTIES INSTALL_NAME_DIR "@loader_path/../lib")
     endif()
 endmacro(PDAL_ADD_PLUGIN)


BODHI-CLIENT and ManageReleaseFedora should share the executable cache

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -45,11 +45,11 @@
 #
 # Defines following variables:
 #   - CMAKE_FEDORA_CONF: Path to cmake_fedora.conf
-#   - FEDPKG_CMD: Path to fedpkg
-#   - KOJI_CMD: Path to koji
-#   - GIT_CMD: Path to git
-#   - BODHI_CMD: Path to bodhi
-#   - KOJI_BUILD_SCRATCH_CMD: Path to koji-build-scratch
+#   - FEDPKG_EXECUTABLE: Path to fedpkg
+#   - KOJI_EXECUTABLE: Path to koji
+#   - GIT_EXECUTABLE: Path to git
+#   - BODHI_EXECUTABLE: Path to bodhi
+#   - KOJI_BUILD_SCRATCH_EXECUTABLE: Path to koji-build-scratch
 #   - FEDPKG_DIR: Dir for FedPkg checkout.
 #       It will use environment variable FEDPKG_DIR, then use
 #       ${CMAKE_FEDORA_TMP_DIR}/FedPkg.
@@ -133,15 +133,15 @@

 RELEASE_FEDORA_FIND_DEPENDENCY(FEDORA_UPLOAD_CA_CERT
     .fedora-upload-ca.cert PATHS $ENV{HOME})
-RELEASE_FEDORA_FIND_DEPENDENCY(FEDPKG_CMD fedpkg)
-RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_CMD koji)
-RELEASE_FEDORA_FIND_DEPENDENCY(GIT_CMD git)
-RELEASE_FEDORA_FIND_DEPENDENCY(BODHI_CMD bodhi)
-RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_KOJI_CMD cmake-fedora-koji
+RELEASE_FEDORA_FIND_DEPENDENCY(FEDPKG_ fedpkg)
+RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_EXECUTABLE koji)
+RELEASE_FEDORA_FIND_DEPENDENCY(GIT_EXECUTABLE git)
+RELEASE_FEDORA_FIND_DEPENDENCY(BODHI-CLIENT_EXECUTABLE bodhi)
+RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_KOJI_EXECUTABLE cmake-fedora-koji
     PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH} NO_DEFAULT_PATH)
-RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_FEDPKG_CMD cmake-fedora-fedpkg
+RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_FEDPKG_EXECUTABLE cmake-fedora-fedpkg
    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH})
-RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_BUILD_SCRATCH_CMD koji-build-scratch
+RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_BUILD_SCRATCH_EXECUTABLE koji-build-scratch
    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH})

 ## Set variables
@@ -166,7 +166,7 @@
 	RETURN()
     ENDIF(_manage_release_fedora_dependencies_missing)
     ADD_CUSTOM_TARGET(koji_build_scratch
-	COMMAND ${KOJI_BUILD_SCRATCH_CMD} ${PRJ_SRPM_FILE} ${ARGN}
+	COMMAND ${KOJI_BUILD_SCRATCH_EXECUTABLE} ${PRJ_SRPM_FILE} ${ARGN}
 	DEPENDS "${PRJ_SRPM_FILE}"
 	COMMENT "koji_build_scratch: SRPM=${PRJ_SRPM_FILE}"
 	VERBATIM
@@ -194,7 +194,7 @@
     ENDIF(NOT REDHAT_BUGZILLA STREQUAL "")

     ADD_CUSTOM_TARGET(fedpkg_build
-	COMMAND ${CMAKE_FEDORA_FEDPKG_CMD} -d "${FEDPKG_DIR}"
+	COMMAND ${CMAKE_FEDORA_FEDPKG_EXECUTABLE} -d "${FEDPKG_DIR}"
 	-m "${CHANGE_SUMMARY}"
 	${_cmdOpts} "${PRJ_SRPM_FILE}" ${ARGN}
 	VERBATIM


Changed method of cleaning up output files to work with Windows.

--- Tests/VisualTests/PostTest.cmake
+++ Tests/VisualTests/PostTest.cmake
@@ -7,10 +7,17 @@
 #-------------------------------------------------------------------

 if (UNIX)
-  set(USER_HOME_DIRECTORY $ENV{HOME})
+  # escape spaces
+  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 elseif (WIN32)
   string(REPLACE "\\" "/" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 # other platforms?
 endif ()

-exec_program("cmake -E remove ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
+# Use platform-specific utils, since 'cmake -E remove' didn't seem to handle wildcards in Windows
+if (UNIX)
+  exec_program("rm ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
+elseif (WIN32)
+  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\TestResults_*RenderingSubsystem.txt\"")
+# other platforms?
+endif ()


Fixed compiler flags for debug builds

Fixed compiler flags for debug builds

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -62,27 +62,27 @@

   # Other optimizations
   if(ENABLE_OMIT_FRAME_POINTER)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fomit-frame-pointer")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -fomit-frame-pointer")
   else()
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -fno-omit-frame-pointer")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -fno-omit-frame-pointer")
   endif()
   if(ENABLE_FAST_MATH)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -ffast-math")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -ffast-math")
   endif()
   if(ENABLE_POWERPC)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mcpu=G3 -mtune=G5")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mcpu=G3 -mtune=G5")
   endif()
   if(ENABLE_SSE)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -msse")
   endif()
   if(ENABLE_SSE2)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse2")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -msse2")
   endif()

   # SSE3 and further should be disabled under MingW because it generates compiler errors
   if(NOT MINGW)
     if(ENABLE_SSE3)
-      set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse3")
+      set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -msse3")
     endif()

     if(${CMAKE_OPENCV_GCC_VERSION_NUM} GREATER 402)
@@ -94,14 +94,14 @@

     if(HAVE_GCC42_OR_NEWER OR APPLE)
       if(ENABLE_SSSE3)
-        set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mssse3")
+        set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mssse3")
       endif()
       if(HAVE_GCC43_OR_NEWER)
         if(ENABLE_SSE41)
-           set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.1")
+           set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -msse4.1")
         endif()
         if(ENABLE_SSE42)
-           set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -msse4.2")
+           set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -msse4.2")
         endif()
       endif()
     endif()
@@ -110,16 +110,16 @@
   if(X86 OR X86_64)
     if(NOT APPLE AND CMAKE_SIZEOF_VOID_P EQUAL 4)
        if(ENABLE_SSE2)
-         set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=sse")# !! important - be on the same wave with x64 compilers
+         set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mfpmath=sse")# !! important - be on the same wave with x64 compilers
        else()
-         set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -mfpmath=387")
+         set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -mfpmath=387")
        endif()
     endif()
   endif()

   # Profiling?
   if(ENABLE_PROFILING)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} -pg -g")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -pg -g")
     # turn off incompatible options
     foreach(flags CMAKE_CXX_FLAGS CMAKE_C_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG OPENCV_EXTRA_C_FLAGS_RELEASE)
       string(REPLACE "-fomit-frame-pointer" "" ${flags} "${${flags}}")
@@ -141,20 +141,20 @@
   # 64-bit MSVC compiler uses SSE/SSE2 by default
   if(NOT MSVC64)
     if(ENABLE_SSE)
-      set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE")
+      set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE")
     endif()
     if(ENABLE_SSE2)
-      set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE2")
+      set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE2")
     endif()
   endif()
   if(ENABLE_SSE3)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE3")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE3")
   endif()
   if(ENABLE_SSE4_1)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /arch:SSE4.1")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /arch:SSE4.1")
   endif()
   if(ENABLE_SSE OR ENABLE_SSE2 OR ENABLE_SSE3 OR ENABLE_SSE4_1)
-    set(OPENCV_EXTRA_C_FLAGS_RELEASE "${OPENCV_EXTRA_C_FLAGS_RELEASE} /Oi")
+    set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /Oi")
   endif()
 endif()


cmake: avoid duplication of -Winit-self flag

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -120,7 +120,6 @@
   add_extra_compiler_option(-Wshadow)
   add_extra_compiler_option(-Wsign-promo)
   add_extra_compiler_option(-Wuninitialized)
-  add_extra_compiler_option(-Winit-self)
   if(CV_GCC AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0))
     add_extra_compiler_option(-Wno-psabi)
   endif()


[CMake][Fuchsia] Enable hermetic static libunwind for Fuchsia

In addition to libc++abi and libc++, we also want to use hermetic
static libunwind on Fuchsia.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@352584 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -114,6 +114,7 @@
     set(RUNTIMES_${target}-fuchsia_CMAKE_SYSROOT ${FUCHSIA_${target}_SYSROOT} CACHE PATH "")
     set(RUNTIMES_${target}-fuchsia_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+    set(RUNTIMES_${target}-fuchsia_LIBUNWIND_HERMETIC_STATIC_LIBRARY ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBUNWIND_INSTALL_STATIC_LIBRARY OFF CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
     set(RUNTIMES_${target}-fuchsia_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")


Fix for ROOT-6459

Fix for ROOT-6459

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -120,7 +120,7 @@
     endif()
     if(files)
       foreach(s ${files})
-        if(fp MATCHES "[*]" AND s MATCHES "(^|/)G__") # Eliminate G__* files only when using wildcards
+        if(s MATCHES "${cwd}/G__") # Eliminate G__* files only when using wildcards
         else()
           set(sources ${sources} ${s})
         endif()


Do not add a non-existent target to the list of dependencies.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -268,8 +268,6 @@
       list(APPEND headerfiles ${fp})
       if(headerFile)
         list(APPEND fullheaderfiles ${headerFile})
-      else()
-        list(APPEND fullheaderfiles ${fp})
       endif()
       unset(headerFile CACHE)
     endif()


cmake: compat: few fixes

cmake: compat: few fixes

--- cmake/qibuild/compat/compat.cmake
+++ cmake/qibuild/compat/compat.cmake
@@ -97,9 +97,9 @@

 function(create_gtest)
   qi_deprecated("create_gtest is deprecated:
-    use qi_create_gtest instead")
+    use qi_add_gtest instead")
   _fix_flags(_new_args DEPENDENCIES DEPENDS ${ARGN})
-  qi_create_gtest(${_new_args})
+  qi_add_gtest(${_new_args})
 endfunction()

 function(create_cmake _NAME)
@@ -196,9 +196,9 @@
       argument if not equals to the upper-version of the first
       argument is not supported anymore.
       Old:
+        stage_lib(${_targetname} ${_name})
+      New:
         stage_lib(${_targetname} ${_U_targetname})
-      New:
-        stage_lib(${_targetname} ${_name})
     "
     )
     # FIXME: stage the lib with an other name ...


boards: usb_kw24d512: add support for DAPLink based adapters

Add support for using DAPLink based adapters through pyOCD.

Signed-off-by: Johann Fischer <b39b26e1812eb092eb217277792f3735321fa456@phytec.de>

--- boards/arm/usb_kw24d512/board.cmake
+++ boards/arm/usb_kw24d512/board.cmake
@@ -1,3 +1,5 @@
 board_runner_args(jlink "--device=MKW24D512xxx5" "--speed=4000")
+board_runner_args(pyocd "--target=kw24d5")

 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)


COMP: Update MeshLib to fix build warnings

List of changes:

$ git shortlog f7d13df..a63a13a --no-merges
Jean-Christophe Fillion-Robin (2):
      COMP: Fix -Wmismatched-new-delete warnings
      COMP: Fix -Wdelete-non-virtual-dtor warning in GW_TriangularInterpolation_ABC

--- SuperBuild/External_MeshLib.cmake
+++ SuperBuild/External_MeshLib.cmake
@@ -28,7 +28,7 @@

   ExternalProject_SetIfNotDefined(
     ${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG
-    "f7d13dfcab714a4f9f10f722ebcddc5e7f4566ee" # slicersalt-0.0.0-2017-12-11-9eb4d15ce
+    "a63a13a19018cf331942c1192ef2ebf9b37b2020" # slicersalt-0.0.0-2017-12-11-9eb4d15ce
     QUIET
     )


Add LD_PRELOAD for asan RT if used (#1461)

--- Tensile/cmake/TensileConfig.cmake
+++ Tensile/cmake/TensileConfig.cmake
@@ -1,5 +1,5 @@
 ################################################################################
-# Copyright 2016-2020 Advanced Micro Devices, Inc. All rights reserved.
+# Copyright 2016-2022 Advanced Micro Devices, Inc. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -190,7 +190,7 @@
         target_compile_definitions( TensileHost PUBLIC -DTENSILE_YAML=1)
     endif()
   endif()
-
+
   if(Tensile_ARCHITECTURE)
     string (REPLACE ";" "_" archString "${Tensile_ARCHITECTURE}")
     # uses _ separator to avoid cmake ; list interpretation, either ; or _ decoded in TensileCreateLibrary
@@ -218,6 +218,17 @@

       set(Tensile_MANIFEST_FILE_PATH "${Tensile_OUTPUT_PATH}/library/TensileManifest.txt")
       message(STATUS "Tensile_MANIFEST_FILE_PATH: ${Tensile_MANIFEST_FILE_PATH}")
+
+      if($ENV{ENABLE_ADDRESS_SANITIZER})
+        # Must populate LD_PRELOAD with ASAN runtime if ASAN is being used.
+        # Find the ASAN RT with compiler and update env for Tensile call.
+        execute_process(
+          COMMAND ${CMAKE_CXX_COMPILER} --print-file-name=libclang_rt.asan-x86_64.so
+          OUTPUT_VARIABLE ASAN_LIB_PATH
+          COMMAND_ECHO STDOUT)
+        string(STRIP ${ASAN_LIB_PATH} ASAN_LIB_PATH)
+        set(CommandLine env LD_PRELOAD=${ASAN_LIB_PATH} ${CommandLine})
+      endif()

       # Create the manifest file of the output libraries.
       set(Tensile_CREATE_MANIFEST_COMMAND ${CommandLine} "--generate-manifest-and-exit")


CMake: improve FindHeeksCAD module

CMake: improve FindHeeksCAD module

  * Use a cleaner method to find from multiple paths
  * Add "/usr/local/share/heekscad" to searched paths: HeeksCAD now install its sources there (with default prefix: /usr/local)
  * Add "/usr/share/heekscad" to searched paths: HeeksCAD now install its sources there (with most linux distributions prefix: /usr)

--- cmake/Modules/FindHeeksCAD.cmake
+++ cmake/Modules/FindHeeksCAD.cmake
@@ -9,19 +9,18 @@
 #

 IF(NOT HeeksCAD_FOUND)
-   # Will try to find at standard locations
-   FIND_PATH(HeeksCAD_SRC_DIR src/Geom.h PATH_SUFFIXES heekscad)
+  SET( SEARCH_PATHS
+    "/usr/local/share/heekscad"
+    "/usr/share/heekscad"
+    "${CMAKE_SOURCE_DIR}/heekscad"
+    "${CMAKE_SOURCE_DIR}/.."
+    "${CMAKE_SOURCE_DIR}/../heekscad"
+  )
+
+  FIND_PATH( HeeksCAD_SRC_DIR interface/Geom.cpp PATHS ${SEARCH_PATHS} DOC "Path to HeeksCAD includes" )
+  IF( NOT HeeksCAD_SRC_DIR )
+      MESSAGE( FATAL_ERROR "Cannot find HeeksCAD sources dir." )
+  ENDIF( NOT HeeksCAD_SRC_DIR )
+
+  MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )
 ENDIF(NOT HeeksCAD_FOUND)
-
-MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )
-
-IF( HeeksCAD_SRC_DIR STREQUAL HeeksCAD_SRC_DIR-NOTFOUND )
-  # try to find at heekscad/ location then ../
-  FIND_PATH( HeeksCAD_SRC_DIR src/Geom.h PATHS "${CMAKE_SOURCE_DIR}/heekscad" "${CMAKE_SOURCE_DIR}/.." "${CMAKE_SOURCE_DIR}/../heekscad"DOC "Path to HeeksCAD includes" )
-  #FIND_PATH( HeeksCAD_SRC_DIR src/Geom.h PATHS "${CMAKE_SOURCE_DIR}/heekscad" DOC "Path to HeeksCAD includes" )
-  IF( HeeksCAD_SRC_DIR STREQUAL Geom.h-NOTFOUND )
-    MESSAGE( FATAL_ERROR "Cannot find HeeksCAD sources dir." )
-   ENDIF( HeeksCAD_SRC_DIR STREQUAL Geom.h-NOTFOUND )
-ENDIF(HeeksCAD_SRC_DIR STREQUAL HeeksCAD_SRC_DIR-NOTFOUND )
-
-MESSAGE( STATUS "HeeksCAD_SRC_DIR:     " ${HeeksCAD_SRC_DIR} )


cmake: Fix dependency on cmocka

cmake: Fix dependency on cmocka

This fixes an error in the Makefile-dependency of unittests, introduced
in commit ad40427a864a7436953b319fbfdb2c04ccb7bdab.

From the perspective of Waffle's CMake, libcmocka.so is an *imported*
library. In other words, it's a virtual target, represented by
a '.PHONY' target in Unix Makefiles.

To guarantee that libcmocka.so gets built, CMake must declare that the
.PHONY 'cmocka' target depends on another .PHONY target, which does the
actual building. Making 'cmocka' depend on a non-PHONY target doesn't
work.

Reported-by: Shazia Rahman <93b7641f33ede7a2f82071a1cfd58ba158893cff@nvidia.com>
Reported-by: Paul Berry <de21b9f22e6dd0bdf7890875d6e07ef4967c44ce@gmail.com>
Tested-by: Paul Berry <de21b9f22e6dd0bdf7890875d6e07ef4967c44ce@gmail.com>
Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

--- cmake/Modules/WaffleCMocka.cmake
+++ cmake/Modules/WaffleCMocka.cmake
@@ -43,7 +43,7 @@
     PROPERTIES
         IMPORTED_LOCATION ${cmocka_library_location}
 )
-add_dependencies(cmocka ${cmocka_library_location})
+add_dependencies(cmocka cmocka-build)
 add_custom_command(
     OUTPUT ${cmocka_library_location}
     WORKING_DIRECTORY ${cmocka_build_dir}


Let the 'indent' custom target print a better message.

The existing message displays the command that is being executed. Instead
say what it *does*.

--- cmake/setup_custom_targets.cmake
+++ cmake/setup_custom_targets.cmake
@@ -1,6 +1,6 @@
 ## ---------------------------------------------------------------------
 ##
-## Copyright (C) 2013 - 2015 by the deal.II authors
+## Copyright (C) 2013 - 2016 by the deal.II authors
 ##
 ## This file is part of the deal.II library.
 ##
@@ -96,6 +96,7 @@
 ADD_CUSTOM_TARGET(indent
   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
   COMMAND ./contrib/utilities/indent
+  COMMENT "Indenting all files in the deal.II directories"
   )


Revision optimisation

Revision optimisation

--- revision.cmake
+++ revision.cmake
@@ -1,4 +1,8 @@
 # Copyright (c) 2011 Stefan Eilemann <eile@eyescale.ch>
+
+if(GIT_REVISION)
+  return()
+endif()

 set(GIT_REVISION 0)


updated findcycluscore.cmake to correctly apply the given hint CYCLUS_ROOT_DIR

--- src/CMake/Findcycluscore.cmake
+++ src/CMake/Findcycluscore.cmake
@@ -2,25 +2,35 @@
 #  CYCLUS_CORE_INCLUDE_DIR - the Cyclus include directory
 #  CYCLUS_CORE_LIBRARIES - The libraries needed to use the Cyclus Core Library

-IF(NOT DEFINED CYCLUS_ROOT_DIR)
-  SET(CYCLUS_ROOT_DIR "$ENV{CYCLUS_ROOT_DIR}")
-ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
+# Check if we have an environment variable to cyclus root
+IF(DEFINED ENV{CYCLUS_ROOT_DIR})
+  IF(NOT DEFINED CYCLUS_ROOT_DIR)
+    SET(CYCLUS_ROOT_DIR "$ENV{CYCLUS_ROOT_DIR}")
+  ELSE(NOT DEFINED CYCLUS_ROOT_DIR)
+    # Yell if both exist
+    MESSAGE(STATUS "\tTwo CYCLUS_ROOT_DIRs have been found:")
+    MESSAGE(STATUS "\t\tThe defined cmake variable CYCLUS_ROOT_DIR: ${CYCLUS_ROOT_DIR}")
+    MESSAGE(STATUS "\t\tThe environment variable CYCLUS_ROOT_DIR: $ENV{CYCLUS_ROOT_DIR}")
+  ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
+ENDIF(DEFINED ENV{CYCLUS_ROOT_DIR})

-# Look for the header files
+# Let the user know if we're using a hint
+IF(DEFINED CYCLUS_ROOT_DIR)
+  MESSAGE(STATUS "CYCLUS_ROOT_DIR hint is : ${CYCLUS_ROOT_DIR}")
+ELSE(DEFINED CYCLUS_ROOT_DIR)
+  MESSAGE(STATUS "No hint is used for CYCLUS_ROOT_DIR")
+ENDIF(DEFINED CYCLUS_ROOT_DIR)
+
+# Set the include dir, this will be the future basis for other
+# defined dirs
 FIND_PATH(CYCLUS_CORE_INCLUDE_DIR suffix.h
   HINTS "${CYCLUS_ROOT_DIR}" "${CYCLUS_ROOT_DIR}/cyclus"
   /usr/local/cyclus /opt/local/cyclus
   PATH_SUFFIXES cyclus/include include)

-MESSAGE(STATUS "CYCLUS_ROOT_DIR hint is : ${CYCLUS_ROOT_DIR}")
-
 # Add the root dir to the hints
-IF(CYCLUS_ROOT_DIR MATCHES "/")
-ELSE(CYCLUS_ROOT_DIR MATCHES "/")
-  SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/..")
-  MESSAGE(STATUS "CYCLUS_ROOT_DIR hint has been set to : ${CYCLUS_ROOT_DIR}")
-ENDIF(CYCLUS_ROOT_DIR MATCHES "/")
-
+SET(CYCLUS_ROOT_DIR "${CYCLUS_CORE_INCLUDE_DIR}/..")
+MESSAGE(STATUS "CYCLUS_ROOT_DIR hint has been set to : ${CYCLUS_ROOT_DIR}")

 # Look for the header files
 FIND_PATH(CYCLUS_CORE_SHARE_DIR cyclus.rng.in


refactor

refactor

--- cmaki.cmake
+++ cmaki.cmake
@@ -1,6 +1,15 @@
 option(FIRST_ERROR "stop on first compilation error" FALSE)
 option(COVERAGE "active coverage (only clang)" FALSE)
 option(SANITIZER "active sanitizers (address,address-full,memory,thread) (only clang)" "")
+
+macro(cmaki_setup)
+
+	enable_modern_cpp()
+	enable_testing()
+	# default install prefix
+	set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/bin)
+
+endmacro()

 macro(GENERATE_CLANG)
 	# Generate .clang_complete for full completation in vim + clang_complete
@@ -15,127 +24,6 @@
 	endforeach()
 	STRING(REGEX REPLACE ";" "\n" extra_parameters "${extra_parameters}")
 	FILE(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/.clang_complete" "${extra_parameters}\n")
-endmacro()
-
-macro(common_flags)
-	if(SANITIZER)
-		add_definitions(-g3)
-		# "address-full" "memory" "thread"
-		SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZER}")
-		SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER}")
-		add_definitions(-fsanitize=${SANITIZER})
-	endif()
-	IF(COVERAGE)
-		if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
-		else()
-			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
-			SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -lgcov")
-		endif()
-	endif()
-
-	if(NOT WIN32)
-		SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -pthread" )
-		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-			SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lpthread" )
-		endif()
-	endif()
-
-	# include_directories(BEFORE ${TOOLCHAIN_ROOT}/include)
-	# link_directories(${TOOLCHAIN_ROOT}/lib)
-	# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ltcmalloc")
-endmacro()
-
-macro(cmaki_setup)
-
-    if(WIN32)
-        add_definitions(/EHsc)
-        #add_definitions(/GR-)
-        #add_definitions(/D_HAS_EXCEPTIONS=0)
-    else()
-        # add_definitions(-fno-rtti -fno-exceptions )
-		# activate all warnings and convert in errors
-        # add_definitions(-Weffc++)
-        add_definitions(-Wall -pedantic -pedantic-errors -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion)
-        add_definitions(-Wdisabled-optimization -Werror -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k)
-        add_definitions(-Wimport  -Winit-self  -Winline -Winvalid-pch -Wlong-long -Wmissing-field-initializers -Wmissing-format-attribute)
-		add_definitions(-Wmissing-include-dirs -Wpacked -Wpointer-arith -Wredundant-decls -Wshadow)
-        add_definitions(-Wstack-protector -Wunreachable-code -Wunused)
-        add_definitions(-Wunused-parameter -Wvariadic-macros -Wwrite-strings)
-        add_definitions(-Wdelete-non-virtual-dtor)
-		add_definitions(-Wswitch-default -Wswitch-enum)
-		# only gcc
-		# convert error in warnings
-		add_definitions(-Wno-error=shadow)
-		add_definitions(-Wno-error=long-long)
-		add_definitions(-Wno-error=aggregate-return)
-		add_definitions(-Wno-error=aggregate-return)
-		add_definitions(-Wno-error=unused-variable)
-		add_definitions(-Wno-error=unused-parameter)
-		add_definitions(-Wno-error=deprecated-declarations)
-		add_definitions(-Wno-error=sign-conversion)
-		add_definitions(-Wno-error=switch-enum)
-
-		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
-			add_definitions(-Wno-error=suggest-attribute=noreturn)
-			add_definitions(-Wno-aggregate-return)
-			add_definitions(-Wno-long-long)
-			add_definitions(-Wno-shadow)
-			add_definitions(-Wno-strict-aliasing)
-			add_definitions(-Wno-error=inline)
-		else()
-			add_definitions(-Wstrict-aliasing=2)
-		endif()
-
-		# no export symbols by default
-		add_definitions(-fvisibility=hidden)
-		add_definitions(-fvisibility-inlines-hidden)
-
-		# stop in first error
-		if(FIRST_ERROR)
-			add_definitions(-Wfatal-errors)
-		endif()
-
-    endif()
-
-	if (NOT DEFINED EXTRA_DEF)
-		if(NOT WIN32)
-		    include(CheckCXXCompilerFlag)
-		    #CHECK_CXX_COMPILER_FLAG("-std=c++1z" COMPILER_SUPPORTS_CXX1Z)
-		    CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
-		    CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
-		    CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
-		    CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
-
-		    #if(COMPILER_SUPPORTS_CXX1Z)
-		    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z")
-		    #message("-- C++1z Enabled")
-		    if(COMPILER_SUPPORTS_CXX14)
-			    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
-			    message("-- C++14 Enabled")
-		    #elseif(COMPILER_SUPPORTS_CXX1Y)
-			    #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y")
-			    #message("-- C++1y Enabled")
-		    elseif(COMPILER_SUPPORTS_CXX11)
-			    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-			    message("-- C++11 Enabled")
-		    elseif(COMPILER_SUPPORTS_CXX0X)
-			    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
-			    message("-- C++0x Enabled")
-		    else()
-			    message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
-		    endif()
-		endif()
-	else()
-		add_definitions(${EXTRA_DEF})
-	endif()
-
-	# enable testing
-	enable_testing()
-
-	# default install prefix
-	set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/bin)
-
 endmacro()

 macro(generate_vcxproj_user _EXECUTABLE_NAME)
@@ -365,3 +253,338 @@

 endfunction()

+macro(common_flags)
+
+	if(SANITIZER)
+		add_definitions(-g3)
+		# "address-full" "memory" "thread"
+		SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZER}")
+		SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER}")
+		add_definitions(-fsanitize=${SANITIZER})
+	endif()
+	IF(COVERAGE)
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
+		else()
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
+			SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -lgcov")
+		endif()
+	endif()
+
+	if(NOT WIN32)
+		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+			SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lpthread" )
+		endif()
+		add_compile_options(-pthread)
+
+		# if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+		# 	# enable OpenMP (need gomp dev)
+		# 	SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fopenmp")
+		# 	SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lgomp -lrt")
+		# endif()
+	else()
+		# c++ exceptions and RTTI
+		#add_definitions(/D_HAS_EXCEPTIONS=0)
+		#add_definitions(/GR-)
+		add_definitions(/wd4251)
+		add_definitions(/wd4275)
+		# Avoid warning as error with / WX / W4
+		# conversion from 'std::reference_wrapper<Chunk>' to 'std::reference_wrapper<Chunk> &
+		add_definitions(/wd4239)
+		# warning C4316: 'PhysicsManager' : object allocated on the heap may not be aligned 16
+		add_definitions(/wd4316)
+		# conditional expression is constant
+		add_definitions(/wd4127)
+		# conversion from 'int' to 'unsigned int', signed/unsigned mismatch
+		add_definitions(/wd4245)
+		# declaration of 'next' hides class membe
+		add_definitions(/wd4458)
+
+		add_definitions(/WX /W4)
+		add_definitions(-Zm200)
+	endif()
+
+	# include_directories(BEFORE ${TOOLCHAIN_ROOT}/include)
+	# link_directories(${TOOLCHAIN_ROOT}/lib)
+	# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ltcmalloc")
+endmacro()
+
+macro(enable_modern_cpp)
+
+	if(WIN32)
+		add_definitions(/EHsc)
+		#add_definitions(/GR-)
+		#add_definitions(/D_HAS_EXCEPTIONS=0)
+	else()
+		# add_definitions(-fno-rtti -fno-exceptions )
+		# activate all warnings and convert in errors
+		# add_definitions(-Weffc++)
+		# borro pedantic, en dune falla
+		# add_definitions(-pedantic -pedantic-errors)
+		add_definitions(-Wall -Wextra -Waggregate-return -Wcast-align -Wcast-qual -Wconversion)
+		add_definitions(-Wdisabled-optimization -Werror -Wfloat-equal -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k)
+		add_definitions(-Wimport  -Winit-self  -Winline -Winvalid-pch -Wlong-long -Wmissing-field-initializers -Wmissing-format-attribute)
+		add_definitions(-Wpointer-arith -Wredundant-decls -Wshadow)
+		add_definitions(-Wstack-protector -Wunreachable-code -Wunused)
+		add_definitions(-Wunused-parameter -Wvariadic-macros -Wwrite-strings)
+		add_definitions(-Wswitch-default -Wswitch-enum)
+		# only gcc
+		# convert error in warnings
+		add_definitions(-Wno-error=shadow)
+		add_definitions(-Wno-error=long-long)
+		add_definitions(-Wno-error=aggregate-return)
+		add_definitions(-Wno-error=aggregate-return)
+		add_definitions(-Wno-error=unused-variable)
+		add_definitions(-Wno-error=unused-parameter)
+		add_definitions(-Wno-error=deprecated-declarations)
+		add_definitions(-Wno-error=missing-include-dirs)
+		add_definitions(-Wno-error=packed)
+		add_definitions(-Wno-error=switch-default)
+		add_definitions(-Wno-error=float-equal)
+		add_definitions(-Wno-error=invalid-pch)
+		add_definitions(-Wno-error=cast-qual)
+		add_definitions(-Wno-error=float-conversion)
+		add_definitions(-Wno-error=conversion)
+		add_definitions(-Wno-error=switch-enum)
+		add_definitions(-Wno-error=unused-local-typedefs)
+		add_definitions(-Wno-error=redundant-decls)
+		add_definitions(-Wno-error=stack-protector)
+		add_definitions(-Wno-error=extra)
+		add_definitions(-Wno-error=unused-result)
+		add_definitions(-Wno-error=sign-compare)
+
+		# TODO: remove
+		add_definitions(-Wno-error=reorder)
+
+		# if not have openmp
+		add_definitions(-Wno-error=unknown-pragmas)
+
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+			add_definitions(-Wno-error=suggest-attribute=format)
+			add_definitions(-Wno-error=suggest-attribute=noreturn)
+			add_definitions(-Wno-aggregate-return)
+			add_definitions(-Wno-long-long)
+			add_definitions(-Wno-shadow)
+			add_definitions(-Wno-strict-aliasing)
+			add_definitions(-Wno-error=inline)
+			add_definitions(-Wno-error=maybe-uninitialized)
+		else()
+			add_definitions(-Wstrict-aliasing=2)
+			add_definitions(-Wno-error=format-nonliteral)
+			add_definitions(-Wno-error=cast-align)
+			add_definitions(-Wno-error=deprecated-register)
+			# poner override en metacommon y borrar
+			add_definitions(-Wno-error=inconsistent-missing-override)
+		endif()
+
+		# In Linux default now is not export symbols
+		# add_definitions(-fvisibility=hidden)
+
+		# stop in first error
+		if(FIRST_ERROR)
+			add_definitions(-Wfatal-errors)
+		endif()
+
+	endif()
+
+	if (NOT DEFINED EXTRA_DEF)
+		if(NOT WIN32)
+			include(CheckCXXCompilerFlag)
+			CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14)
+			CHECK_CXX_COMPILER_FLAG("-std=c++1y" COMPILER_SUPPORTS_CXX1Y)
+			CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+			CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+
+			if(COMPILER_SUPPORTS_CXX14)
+				set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+				message("-- C++14 Enabled")
+			elseif(COMPILER_SUPPORTS_CXX11)
+				set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+				message("-- C++11 Enabled")
+			elseif(COMPILER_SUPPORTS_CXX0X)
+				set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+				message("-- C++0x Enabled")
+			else()
+				message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
+			endif()
+		endif()
+	else()
+		add_definitions(${EXTRA_DEF})
+	endif()
+	SET(CMAKE_BUILD_TYPE_INIT Release)
+endmacro()
+
+macro(generate_vcxproj_user _EXECUTABLE_NAME)
+	IF(MSVC)
+		set(project_vcxproj_user "${CMAKE_CURRENT_BINARY_DIR}/${_EXECUTABLE_NAME}.vcxproj.user")
+		if (NOT EXISTS ${project_vcxproj_user})
+			FILE(WRITE "${project_vcxproj_user}"
+				"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
+				"<Project ToolsVersion=\"12.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n"
+				"<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Debug|x64'\">\n"
+				"<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>\n"
+				"<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\n"
+				"</PropertyGroup>\n"
+				"<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='RelWithDebInfo|x64'\">\n"
+				"<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>\n"
+				"<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\n"
+				"</PropertyGroup>\n"
+				"<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='Release|x64'\">\n"
+				"<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>\n"
+				"<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\n"
+				"</PropertyGroup>\n"
+				"<PropertyGroup Condition=\"'$(Configuration)|$(Platform)'=='MinSizeRel|x64'\">\n"
+				"<LocalDebuggerWorkingDirectory>$(TargetDir)</LocalDebuggerWorkingDirectory>\n"
+				"<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>\n"
+				"</PropertyGroup>\n"
+				"</Project>\n")
+		endif()
+	ENDIF()
+endmacro()
+
+function(DUNE_EXECUTABLE _EXECUTABLE_NAME _SOURCE_FILES)
+
+	source_group( "Source Files" FILES ${_SOURCE_FILES} )
+	include_directories(..)
+	include_directories(h)
+	ADD_EXECUTABLE(${_EXECUTABLE_NAME} ${_SOURCE_FILES})
+	generate_vcxproj_user(${_EXECUTABLE_NAME})
+
+endfunction()
+
+function(DUNE_LIBRARY)
+
+	set(PARAMETERS ${ARGV})
+	list(GET PARAMETERS 0 LIBNAME)
+	list(REMOVE_AT PARAMETERS 0)
+
+	SET(HAVE_TESTS FALSE)
+	SET(HAVE_PCH FALSE)
+	set(TARGET_DEPENDENCIES)
+	set(EXTRA_SOURCES)
+	set(TESTS_SOURCES)
+	set(PCH_SOURCE)
+	while(PARAMETERS)
+		list(GET PARAMETERS 0 PARM)
+		if(PARM STREQUAL DEPENDENCIES)
+			set(NOW_IN DEPENDENCIES)
+		elseif(PARM STREQUAL EXTRA_SOURCES)
+			set(NOW_IN EXTRA_SOURCES)
+		elseif(PARM STREQUAL TESTS)
+			set(NOW_IN TESTS)
+		elseif(PARM STREQUAL PCH)
+			set(NOW_IN PCH)
+		else()
+			if(NOW_IN STREQUAL DEPENDENCIES)
+				set(TARGET_DEPENDENCIES ${TARGET_DEPENDENCIES} ${PARM})
+			elseif(NOW_IN STREQUAL EXTRA_SOURCES)
+				set(EXTRA_SOURCES ${EXTRA_SOURCES} ${PARM})
+			elseif(NOW_IN STREQUAL TESTS)
+				set(TESTS_SOURCES ${TESTS_SOURCES} ${PARM})
+				SET(HAVE_TESTS TRUE)
+			elseif(NOW_IN STREQUAL PCH)
+				set(PCH_SOURCE ${PARM})
+				SET(HAVE_PCH TRUE)
+			else()
+				message(FATAL_ERROR "Unknown argument ${PARM}.")
+			endif()
+		endif()
+		list(REMOVE_AT PARAMETERS 0)
+	endwhile()
+
+	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
+		include_directories(${INCLUDE_DIR})
+	endforeach()
+	INCLUDE_DIRECTORIES(..)
+	INCLUDE_DIRECTORIES(h)
+
+	file( GLOB SOURCE_FILES [Cc]/*.c [Cc]/*.cpp [Cc]/*.cxx *.cpp *.c *.cxx )
+	file( GLOB HEADERS_FILES [Hh]/*.h [Hh]/*.hpp [Hh]/*.hxx [Hh][Pp][Pp]/*.hpp [Hh][Pp][Pp]/*.hxx *.h *.hpp *.hxx )
+	IF(WIN32)
+		file( GLOB SPECIFIC_PLATFORM c/win32/*.cpp )
+		INCLUDE_DIRECTORIES(c/win32)
+	ELSEIF(UNIX)
+		file( GLOB SPECIFIC_PLATFORM c/linux/*.cpp )
+		INCLUDE_DIRECTORIES(c/linux)
+	ELSEIF(MAC)
+		file( GLOB SPECIFIC_PLATFORM c/mac/*.cpp )
+		INCLUDE_DIRECTORIES(c/mac)
+	ELSEIF(ANDROID)
+		file( GLOB SPECIFIC_PLATFORM c/android/*.cpp )
+		INCLUDE_DIRECTORIES(c/android)
+	ENDIF()
+
+	SET(SOURCE_FILES ${SOURCE_FILES} "${SPECIFIC_PLATFORM}")
+	source_group( "c" FILES ${SOURCE_FILES})
+	source_group( "h" FILES ${HEADERS_FILES})
+
+	common_flags()
+	ADD_LIBRARY(${LIBNAME} SHARED ${SOURCE_FILES} ${HEADERS_FILES} ${EXTRA_SOURCES})
+	TARGET_LINK_LIBRARIES(${LIBNAME} ${TARGET_DEPENDENCIES})
+	foreach(LIB_DIR ${CMAKI_LIBRARIES})
+		target_link_libraries(${LIBNAME} ${LIB_DIR})
+		cmaki_install_3rdparty(${LIB_DIR})
+	endforeach()
+
+	IF(WIN32)
+		# library with suffix python friendly
+		set_target_properties(${LIBNAME} PROPERTIES SUFFIX .pyd)
+	ENDIF()
+
+	if(HAVE_PCH)
+
+		# TODO: problems clang
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+			include(cotire)
+			set_target_properties(${LIBNAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "h/${PCH_SOURCE}")
+			set_target_properties(${LIBNAME} PROPERTIES COTIRE_UNITY_LINK_LIBRARIES_INIT "COPY")
+			cotire(${LIBNAME})
+		endif()
+	endif()
+
+	GENERATE_CLANG()
+
+	foreach(BUILD_TYPE ${CMAKE_BUILD_TYPE})
+		INSTALL(TARGETS ${LIBNAME}
+			DESTINATION ${BUILD_TYPE}
+			CONFIGURATIONS ${BUILD_TYPE})
+	endforeach()
+
+endfunction()
+
+function(GENERATE_LIB)
+
+	DUNE_LIBRARY(${ARGSN})
+
+endfunction()
+
+macro(common_flags_deprecated)
+	if(SANITIZER)
+		add_definitions(-g3)
+		# "address-full" "memory" "thread"
+		SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZER}")
+		SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER}")
+		add_definitions(-fsanitize=${SANITIZER})
+	endif()
+	IF(COVERAGE)
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
+		else()
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
+			SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -lgcov")
+		endif()
+	endif()
+
+	if(NOT WIN32)
+		SET( CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -pthread" )
+		if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+			SET( CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -lpthread" )
+		endif()
+	endif()
+
+	# include_directories(BEFORE ${TOOLCHAIN_ROOT}/include)
+	# link_directories(${TOOLCHAIN_ROOT}/lib)
+	# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ltcmalloc")
+endmacro()
+


ENH: remove OpenThreads from OTB_INCLUDE_ABSOLUE_DIRS and OTB_INCLUDE_RELATIVE_DIRS

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -359,16 +359,6 @@
   	${GETTEXT_INCLUDE_DIR} )
 ENDIF(OTB_USE_GETTEXT)

-# For OpentTreads  header file
-IF(OTB_USE_EXTERNAL_OPENTHREADS)
-  SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}
-    ${OPENTHREADS_INCLUDE_DIR} )
-ELSE(OTB_USE_EXTERNAL_OPENTHREADS)
-        SET(OTB_INCLUDE_RELATIVE_DIRS ${OTB_INCLUDE_RELATIVE_DIRS}
-                Utilities/otbopenthreads/OpenThreads/include)
-ENDIF(OTB_USE_EXTERNAL_OPENTHREADS)
-
-
 #For FLTK header file
 IF(OTB_USE_EXTERNAL_FLTK)
         SET(OTB_INCLUDE_ABSOLUE_DIRS ${OTB_INCLUDE_ABSOLUE_DIRS}


Working on detecting hdf5 from modules

Working on detecting hdf5 from modules

Former-commit-id: 9eec5303c87bf620c214cc958b19fba180fc8989

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -28,7 +28,7 @@
     set(HDF5_WANT_VERSION 1.10)
 endif()

-set(HDF5_ROOT ${HDF5_ROOT} $ENV{ROOT} $ENV{HOME}/.conda $ENV{HOME}/anaconda3 $ENV{HOME}/miniconda3)
+set(HDF5_ROOT ${HDF5_ROOT}  $ENV{HDF5_ROOT}  $ENV{HOME}/.conda $ENV{HOME}/anaconda3 $ENV{HOME}/miniconda3)
 find_file(HDF5_C_COMPILER_EXECUTABLE        NAMES h5cc  PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)
 find_file(HDF5_CXX_COMPILER_EXECUTABLE      NAMES h5c++ PATHS $ENV{PATH} /usr/bin /usr/local/bin $ENV{HOME}/.conda/bin  $ENV{HOME}/anaconda3/bin)


OpenSSL cacheable

OpenSSL cacheable

--- cmake/projects/OpenSSL/hunter.cmake
+++ cmake/projects/OpenSSL/hunter.cmake
@@ -4,6 +4,7 @@
 # !!! DO NOT PLACE HEADER GUARDS HERE !!!

 include(hunter_add_version)
+include(hunter_cacheable)
 include(hunter_download)
 include(hunter_pick_scheme)

@@ -170,4 +171,5 @@
     url_sha1_openssl_windows
 )

+hunter_cacheable(OpenSSL)
 hunter_download(PACKAGE_NAME OpenSSL)


Fixed building application from all files in directory for run.sh script

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -9,11 +9,11 @@
 ENDIF()

 if(BUILD_DIR)
-  string(REGEX REPLACE "/+$" "" BUILD_APP_DIR "${BUILD_APP_DIR}") # remove trailing slash
-  file(GLOB ALLOPROJECT_APP_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${BUILD_APP_DIR}/*.cpp)
-  string(REPLACE "/" "_" APP_NAME "${BUILD_APP_DIR}")
+  string(REGEX REPLACE "/+$" "" ALLOSYSTEM_BUILD_APP_DIR "${ALLOSYSTEM_BUILD_APP_DIR}") # remove trailing slash
+  file(GLOB ALLOPROJECT_APP_SRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${ALLOSYSTEM_BUILD_APP_DIR}/*.cpp)
+  string(REPLACE "/" "_" APP_NAME "${ALLOSYSTEM_BUILD_APP_DIR}")
   string(REGEX REPLACE "_+$" "" APP_NAME "${APP_NAME}")
-  set(SOURCE_DIR "${BUILD_APP_DIR}")
+  set(SOURCE_DIR "${ALLOSYSTEM_BUILD_APP_DIR}")
 else()
   set(ALLOPROJECT_APP_SRC "${BUILD_APP_FILE}")
   string(REPLACE "/" "_" APP_NAME "${BUILD_APP_FILE}")
@@ -30,7 +30,7 @@
     include("${SOURCE_DIR}/flags.cmake")
 endif()

-add_executable("${APP_NAME}" EXCLUDE_FROM_ALL "${ALLOPROJECT_APP_SRC}")
+add_executable("${APP_NAME}" EXCLUDE_FROM_ALL ${ALLOPROJECT_APP_SRC})

 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
   set_target_properties(${APP_NAME} PROPERTIES


Fixed path of TIFF_INCLUDE_DIRS

Fixed path of TIFF_INCLUDE_DIRS

--- cmake/ModuleWholeSlideImaging.cmake
+++ cmake/ModuleWholeSlideImaging.cmake
@@ -1,7 +1,7 @@
 if(FAST_MODULE_WholeSlideImaging)
     message("-- Whole slide imaging module enabled")
     include(cmake/ExternalOpenSlide.cmake)
-    set(TIFF_INCLUDE_DIRS ${FAST_EXTERNAL_BUILD_DIR}/qt5/src/qt5/qtimageformats/src/3rdparty/libtiff/)
+    set(TIFF_INCLUDE_DIRS ${FAST_EXTERNAL_BUILD_DIR}/qt5/src/qt5/qtimageformats/src/3rdparty/libtiff/libtiff/)
     if(WIN32)
         list(APPEND LIBRARIES libopenslide.lib)
         list(APPEND FAST_INCLUDE_DIRS ${FAST_EXTERNAL_INSTALL_DIR}/include/openslide/)
@@ -19,4 +19,4 @@
     list(APPEND FAST_INCLUDE_DIRS ${TIFF_INCLUDE_DIRS})
     list(APPEND FAST_LIBRARY_DIRS ${FAST_EXTERNAL_INSTALL_DIR}/plugins/imageformats/)
     list(APPEND LIBRARIES ${TIFF_LIBRARY})
-endif()+endif()


cmake/use GNUInstallDirs on UNIX systems:

fixes #17

--- cmake/Modules/SetInstallPaths.cmake
+++ cmake/Modules/SetInstallPaths.cmake
@@ -18,12 +18,7 @@
   set(RUNTIME_LIBDIR "${BINDIR}\\bin")
   set(DATADIR "${BINDIR}\\data")
 else()
-  set(BINDIR ""
-      CACHE STRING "${CMAKE_PROJECT_NAME} Bin Install Dir")
-  set(RUNTIME_LIBDIR "lib"
-      CACHE STRING "${CMAKE_PROJECT_NAME} Lib Dir")
-  set(DATADIR ""
-      CACHE STRING "${CMAKE_PROJECT_NAME} Data Install Dir")
+  include(GNUInstallDirs)
   set(DESKTOPDIR "/usr/share/applications"
       CACHE STRING "Desktop installation directory")
 endif()


[CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.

After LLVM moved to C++14, the RWMutex implementation was removed in
favor of std::shared_timed_mutex, which is only available on macOS
10.12 and later. As a workaround for older deployment targets, I added
   the original RWMutexImpl again, guarded by the deployment target.

When doing a standalone build of LLDB using the Xcode generator, the
CMake cache specifies a minimum deployment target. However, LLVM and
Clang might have been built with a different minimum deployment target.

This is exactly what happened for the Xcode build. LLVM was built with a
minimum deployment target newer than 10.12, using
std::shared_timed_mutex. LLDB on the other hand was built with a minimum
deployment target of 10.11, using the old RWMutexImpl, resulting in
undefined symbols at link-time.

This patch changes the minimum deployment target for the Xcode build to
10.12 to work around this problem. A better solution would involve
synchronizing the minimum deployment or even not setting one at all.

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

--- cmake/caches/Apple-lldb-Xcode.cmake
+++ cmake/caches/Apple-lldb-Xcode.cmake
@@ -1,7 +1,7 @@
 include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)

 set(CMAKE_GENERATOR Xcode CACHE STRING "")
-set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "")
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "")
 set(CMAKE_XCODE_GENERATE_SCHEME ON CACHE BOOL "")

 set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "")


[cmake] enable exp. grid extensions

[cmake] enable exp. grid extensions

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -59,6 +59,8 @@

 SET( CMAKE_CXX_FLAGS_RELEASE
   "-DDNDEBUG -DNDEBUG -O2 -fPIC " )
+
+SET( CMAKE_CXX_FLAGS "-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=1 ${CMAKE_CXX_FLAGS}" )

 SET( CMAKE_CXX_FLAGS_DEBUG
   "-O0 -DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor" )


lib: msgpack: use linux-atomic workaround only on Linux

Signed-off-by: Eduardo Silva <81f705dc2ce1a61a2621e0e4b442a9474e1d0c70@treasure-data.com>

--- lib/msgpack-c-0b7cabd/Files.cmake
+++ lib/msgpack-c-0b7cabd/Files.cmake
@@ -8,15 +8,17 @@

 # Fluent Bit fix for ARM without __sync calls support
 include (CheckCSourceCompiles)
-check_c_source_compiles("
-  int main() {
-    __sync_sub_and_fetch(\"\", 1);
-     return 0;
-  }" FLB_HAVE_SYNC_SUB)
-if(NOT FLB_HAVE_SYNC_SUB)
-  LIST (APPEND msgpackc_SOURCES
-    src/linux-atomic.c
-    )
+if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  check_c_source_compiles("
+    int main() {
+      __sync_sub_and_fetch(\"\", 1);
+       return 0;
+    }" FLB_HAVE_SYNC_SUB)
+  if(NOT FLB_HAVE_SYNC_SUB)
+    LIST (APPEND msgpackc_SOURCES
+      src/linux-atomic.c
+      )
+  endif()
 endif()

 LIST (APPEND msgpackc_HEADERS


WIP: ManageReleaseFedora

WIP: ManageReleaseFedora

--- Modules/ManageReleaseFedora.cmake
+++ Modules/ManageReleaseFedora.cmake
@@ -140,19 +140,20 @@
 	)
 ENDMACRO(RELEASE_FEDORA_FIND_DEPENDENCY var)

-RELEASE_FEDORA_FIND_DEPENDENCY(FEDORA_UPLOAD_CA_CERT
-    .fedora-upload-ca.cert PATHS $ENV{HOME})
+RELEASE_FEDORA_FIND_FILE_DEPENDENCY(FEDORA_UPLOAD_CA_CERT
+    ".fedora-upload-ca.cert" PATHS $ENV{HOME})
 RELEASE_FEDORA_FIND_DEPENDENCY(FEDPKG_ fedpkg)
 RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_EXECUTABLE koji)
 RELEASE_FEDORA_FIND_DEPENDENCY(GIT_EXECUTABLE git)
 ## Workaround for Bug 1115136 otherwise el7 won't work
 RELEASE_FEDORA_FIND_DEPENDENCY(BODHI-CLIENT_EXECUTABLE NAMES bodhi client.py
     PATHS /usr/bin/bodhi)
-RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_KOJI_EXECUTABLE cmake-fedora-koji
-    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH} NO_DEFAULT_PATH)
-RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_FEDPKG_EXECUTABLE cmake-fedora-fedpkg
+MESSAGE("CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH=${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH}")
+RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_KOJI_EXECUTABLE "cmake-fedora-koji"
+    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH})
+RELEASE_FEDORA_FIND_DEPENDENCY(CMAKE_FEDORA_FEDPKG_EXECUTABLE "cmake-fedora-fedpkg"
    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH})
-RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_BUILD_SCRATCH_EXECUTABLE koji-build-scratch
+RELEASE_FEDORA_FIND_DEPENDENCY(KOJI_BUILD_SCRATCH_EXECUTABLE "koji-build-scratch"
    PATHS ${CMAKE_FEDORA_ADDITIONAL_SCRIPT_PATH})

 ## Set variables


[cmake] fix missing include

[cmake] fix missing include

--- Numerics/cmake/SiconosCTest.cmake
+++ Numerics/cmake/SiconosCTest.cmake
@@ -75,6 +75,7 @@
   # library build
   SET(BUILD_SHARED_LIBS)
   SET(CMAKE_BUILD_TYPE Debug)
+  INCLUDE(TestCXXAcceptsFlag)
   CHECK_CXX_ACCEPTS_FLAG(-ftest-coverage CXX_HAVE_FTEST_COVERAGE)
   CHECK_CXX_ACCEPTS_FLAG(-fprofile-arcs CXX_HAVE_PROFILE_ARCS)
   CHECK_C_COMPILER_FLAG(-ftest-coverage C_HAVE_FTEST_COVERAGE)


pw_build/cmake: Enforce full path in CMake library names

Instead of only enforcing the parent directory to be in the CMake
library name, pw_add_module_library is updated to enforce that
the entire relative to PW root directory path is in the library
name in a dot separated format.

Change-Id: I29f3fa499474a53ff29a04ed2f353d560edd1451
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/94540
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Keir Mierle <69344103cc60b36d6e1fbdc31ce6504b2286c646@google.com>
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -293,13 +293,15 @@
   _pw_add_library_multi_value_args(multi_value_args IMPLEMENTS_FACADES)
   pw_parse_arguments_strict(pw_add_module_library 1 "" "" "${multi_value_args}")

-  # Check that the library's name is prefixed by the module name.
-  get_filename_component(module "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
-
-  if(NOT "${NAME}" MATCHES "${module}(\\.[^\\.]+)?(\\.facade)?$")
+  # Check that the library's name is prefixed by the relative PW path with dot
+  # separators instead of forward slashes.
+  file(RELATIVE_PATH rel_path $ENV{PW_ROOT} ${CMAKE_CURRENT_SOURCE_DIR})
+  string(REPLACE "/" "." dot_rel_path ${rel_path})
+  if(NOT "${NAME}" MATCHES "${dot_rel_path}(\\.[^\\.]+)?(\\.facade)?$")
     message(FATAL_ERROR
         "Module libraries must match the module name or be in the form "
-        "'MODULE_NAME.LIBRARY_NAME'. The library '${NAME}' does not match."
+        "'PATH_TO.THE_TARGET.NAME'. The library '${NAME}' does not match. "
+        "Expected ${dot_rel_path}.LIBRARY_NAME"
     )
   endif()


ENH: Update external elastix

ENH: Update external elastix

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -2,7 +2,7 @@

 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )
 set( ELASTIX_REPOSITORY git://github.com/kaspermarstal/elastix.git )
-set( ELASTIX_TAG 92131b1dd15e8e3e11c9dc87be3bfd61ceb723e5 )
+set( ELASTIX_TAG 7d25720147ef8c73497ca6c36f6d60308183fff4 )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_REPOSITORY}


Make CMake in Linux work correctly.

Make CMake in Linux work correctly.

--- Build/CMake/Modules/AtomicUtils.cmake
+++ Build/CMake/Modules/AtomicUtils.cmake
@@ -25,3 +25,7 @@
     endif()

 endmacro()
+
+if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+  set(LINUX TRUE CACHE BOOL "Indicates if host is Linux.")
+endif()


Swap MITK_EXTERNAL_PROJECT_PREFIX for Python_DIR for install macro

--- CMake/mitkFunctionInstallPython.cmake
+++ CMake/mitkFunctionInstallPython.cmake
@@ -26,17 +26,17 @@
     endif()

     if(UNIX)
-      list(APPEND _python_dirs "${MITK_EXTERNAL_PROJECT_PREFIX}/lib")
+      list(APPEND _python_dirs "${Python_DIR}/lib")
       set(PYTHON_LIB_SUFFIX ".so")
       set(_py_include_postfix python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/) # add the slash here so windows and unix will work with same code
       set(_python_runtime_dir python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/)
     else() #WIN32
-      list(APPEND _python_dirs "${MITK_EXTERNAL_PROJECT_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/Lib")
+      list(APPEND _python_dirs "${Python_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/Lib")
       #list(APPEND _python_dirs "${Python_DIR}/bin")
       set(PYTHON_LIB_SUFFIX .pyd)
       set(_py_include_postfix )
       set(_python_runtime_dir )
-      set(_search_path "${MITK_EXTERNAL_PROJECT_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/bin")
+      set(_search_path "${Python_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/bin")
     endif()

     file(GLOB_RECURSE item RELATIVE "${_python_dirs}/${_python_runtime_dir}" "${_python_dirs}/${_python_runtime_dir}*")


ENH: remove legacy  (2003?) -flat_namespace flag on MacOSX,as this would prevent the Tcl libraries from being loaded in a Tcl shell. See whole discussion with Tcl people at https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1961211&group_id=10894

--- CMake/vtkDetermineCompilerFlags.cmake
+++ CMake/vtkDetermineCompilerFlags.cmake
@@ -73,8 +73,8 @@
 ENDIF(CMAKE_COMPILER_IS_GNUCXX)

 IF(APPLE)
-  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -Wl,-flat_namespace,-U,_environ")
-  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-flat_namespace,-U,_environ")
+  SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -Wl,-U,_environ")
+  SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS} -Wl,-U,_environ")
   IF(CMAKE_COMPILER_IS_GNUCXX)
     SET(VTK_REQUIRED_C_FLAGS "${VTK_REQUIRED_C_FLAGS} -no-cpp-precomp")
     SET(VTK_REQUIRED_CXX_FLAGS "${VTK_REQUIRED_CXX_FLAGS} -no-cpp-precomp")


hdmarker dep check

hdmarker dep check

--- VAD_hdmarker.cmake
+++ VAD_hdmarker.cmake
@@ -15,6 +15,11 @@

   vad_deps(${ARGN})

+  if (NOT OpenCV_FOUND AND NOT Ceres_FOUND)
+    message("hdmarker: OpenCV or Ceres missing!")
+    return()
+  endif()
+
   git_clone(hdmarker)

   add_subdirectory("${VAD_EXTERNAL_ROOT}/hdmarker" "${CMAKE_BINARY_DIR}/external/hdmarker")


fixed: remove debug output

fixed: remove debug output

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

--- CMake/FindCollada.cmake
+++ CMake/FindCollada.cmake
@@ -81,9 +81,6 @@
     PATHS ${__COLLADA_INCLUDE_SEARCH_DIRS}
     PATH_SUFFIXES "1.4")

-MESSAGE("COLLADA_DAE_INCLUDE_DIR ${COLLADA_DAE_INCLUDE_DIR}")
-MESSAGE("COLLADA_DOM_INCLUDE_DIR ${COLLADA_DOM_INCLUDE_DIR}")
-
 # locate libraries
 FIND_LIBRARY(COLLADA_LIBRARY_RELEASE
     NAMES collada_dom collada14dom libcollada14dom21


Added includepath to lupdate command

Added includepath to lupdate command

lupdate needs the correct include path to correctly deduce
the namespace a class is in. This should fix issues with the translation
of MainControl and MolecularControl

--- cmake/BALLViewTranslations.cmake
+++ cmake/BALLViewTranslations.cmake
@@ -10,8 +10,11 @@
 SET(TRANSLATION_DIR ${CMAKE_SOURCE_DIR}/data/BALLView/translations/)

 SET(TRANSLATION_SEARCH_DIRS
-	${CMAKE_SOURCE_DIR}/include
 	${CMAKE_SOURCE_DIR}/source
+)
+
+SET(LUPDATE_INLUDE_PATHS
+	-I ${CMAKE_SOURCE_DIR}/include/
 )

 SET(TRANSLATIONS)
@@ -27,7 +30,7 @@

 	ADD_CUSTOM_TARGET(
 		${__TRANS_NAME}
-		COMMAND ${QT_LUPDATE_EXECUTABLE} ${LUPDATE_OPTIONS} -target-language ${i} ${TRANSLATION_SEARCH_DIRS} -ts "${__TS_TMP_FILE}"
+		COMMAND ${QT_LUPDATE_EXECUTABLE} ${LUPDATE_INLUDE_PATHS} ${LUPDATE_OPTIONS} -target-language ${i} ${TRANSLATION_SEARCH_DIRS} -ts "${__TS_TMP_FILE}"
 	)

 	ADD_CUSTOM_COMMAND(


Windows: Disabled some deprecated function warnings.

Visual Studio emits warnings for using deprecated functions in CRT
and the use of insecure functions in CRT. This commit supresses the
warning generation temporarily.

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

--- cmake/CompilationConfigure.cmake
+++ cmake/CompilationConfigure.cmake
@@ -70,7 +70,7 @@

   # COFF/PE and friends are somewhat limited in the number of sections they
   # allow for an object file. We use this to avoid those problems.
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB -D_SCL_SECURE_NO_WARNINGS /vd2 /MP")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj -DGOOGLE_GLOG_DLL_DECL= -DCURL_STATICLIB /vd2 /MP")

   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
   set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
@@ -96,6 +96,15 @@
   add_definitions(-DHAVE_LIBZ)
 endif (WIN32)

+# Defines to disable warnings generated by Visual Studio when using
+# deprecated functions in CRT and the use of insecure functions in CRT.
+# TODO(dpravat): Once the entire codebase is changed to use secure CRT
+# functions, these defines should be removed.
+if (WIN32)
+  add_definitions(-D_SCL_SECURE_NO_WARNINGS)
+  add_definitions(-D_CRT_SECURE_NO_WARNINGS)
+  add_definitions(-D_CRT_NONSTDC_NO_WARNINGS)
+endif (WIN32)

 # Configure directory structure for different platforms.
 ########################################################


- Fix problem with 0 header files in Mac framework function in CMake

--- cmake/Modules/BuildLibrary.cmake
+++ cmake/Modules/BuildLibrary.cmake
@@ -197,7 +197,7 @@
             set_property(TARGET ${TARGET} PROPERTY PUBLIC_HEADER ${ALL_HEADERS} )
         endif()

-        register_library( ${TARGET} ${HEADER_DIR} )
+        register_library( ${TARGET} "${HEADER_DIR}" )
     else()
         coffee_add_elibrary(
             "${TARGET}" "${LINKOPT}"


Split bash lines into more readable lines.


Another typo on warning removal

Another typo on warning removal

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -17,7 +17,7 @@
   # the flag -ftest-coverage causes nvcc to barf, so exclude that one
   if (CMAKE_COMPILER_IS_GNUCC)
     string (REPLACE "-ftest-coverage" "" TMP "${CMAKE_CXX_FLAGS}")
-    string (REPLACE "-ftemplate-depth-50" "" TMP "${TMP}")
+    string (REPLACE "-ftemplate-depth=50" "" TMP "${TMP}")
     string (REPLACE " " "," TMP "${TMP}")
     set (CUDA_CXX_FLAGS ${CUDA_CXX_FLAGS} ${TMP})
   endif ()


add support for latest Turing gpu and cuda 10

--- cmake/pcl_find_cuda.cmake
+++ cmake/pcl_find_cuda.cmake
@@ -42,8 +42,10 @@

   # Find a complete list for CUDA compute capabilities at http://developer.nvidia.com/cuda-gpus

-  if(NOT ${CUDA_VERSION_STRING} VERSION_LESS "9.0")
-    set(__cuda_arch_bin "3.0 3.5 5.0 5.2 5.3 6.0 6.1 7.0")
+  if(NOT ${CUDA_VERSION_STRING} VERSION_LESS "10.0")
+    set(__cuda_arch_bin "3.0 3.5 5.0 5.2 5.3 6.0 6.1 7.0 7.2 7.5")
+  elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "9.0")
+    set(__cuda_arch_bin "3.0 3.5 5.0 5.2 5.3 6.0 6.1 7.0 7.2")
   elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "8.0")
     set(__cuda_arch_bin "2.0 2.1(2.0) 3.0 3.5 5.0 5.2 5.3 6.0 6.1")
   elseif(NOT ${CUDA_VERSION_STRING} VERSION_LESS "6.5")


Fail the cmake build if reading the version from the podspec fails (#8068)

--- cmake/podspec_rules.cmake
+++ cmake/podspec_rules.cmake
@@ -23,6 +23,15 @@
     OUTPUT_VARIABLE ${VARIABLE}
     OUTPUT_STRIP_TRAILING_WHITESPACE
   )
+  if(${VARIABLE} STREQUAL "")
+    message(
+      FATAL_ERROR
+      "Running the sed script ${PROJECT_SOURCE_DIR}/cmake/podspec_version.sed \
+      on file ${PODSPEC_FILE} failed; ensure that the `sed` executable is \
+      installed and that its directory is present in the PATH environment \
+      variable."
+    )
+  endif()
 endmacro()

 macro(firebase_version VARIABLE PODSPEC_FILE)
@@ -34,6 +43,15 @@
     OUTPUT_VARIABLE ${VARIABLE}
     OUTPUT_STRIP_TRAILING_WHITESPACE
   )
+  if(${VARIABLE} STREQUAL "")
+    message(
+      FATAL_ERROR
+      "Running the sed script ${PROJECT_SOURCE_DIR}/cmake/firebase_version.sed \
+      on file ${PODSPEC_FILE} failed; ensure that the `sed` executable is \
+      installed and that its directory is present in the PATH environment \
+      variable."
+    )
+  endif()
 endmacro()

 function(podspec_prep_headers FRAMEWORK_NAME)


[#83] Fix conan.io config

[#83] Fix conan.io config

The conan.cmake script was importing the old
3rdParty/conanfile.cmake conan output file, generated when
conan was being invoked in the 3rdParty directory.

See cbddd10 for the changes that originated this error.

--- 3rdParty/conan.cmake
+++ 3rdParty/conan.cmake
@@ -1,9 +1,9 @@
 execute_process(
-    COMMAND conan install --build=outdated --file "${CMAKE_SOURCE_DIR}/3rdParty/conanfile.txt"
+    COMMAND conan install --build=outdated
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )

-include(${CMAKE_SOURCE_DIR}/3rdParty/conanbuildinfo.cmake)
+include(${CMAKE_SOURCE_DIR}/conanbuildinfo.cmake)
 conan_basic_setup()
 conan_define_targets()
 include(${CONAN_CMAKE-UTILS_ROOT}/conan.cmake)


more friendly error messages if the compiler isn't found

--- CMake/toolchain.cmake
+++ CMake/toolchain.cmake
@@ -25,8 +25,41 @@
 # definitions that legacy code assumes will be defined.
 add_definitions("-DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -DMBED_OPERATORS")

+
+# find the compiler and associated tools that we need:
+find_program(ARM_NONE_EABI_GCC arm-none-eabi-gcc)
+find_program(ARM_NONE_EABI_GPP arm-none-eabi-g++)
+find_program(ARM_NONE_EABI_OBJCOPY arm-none-eabi-objcopy)
+macro(gcc_program_notfound progname)
+    message("**************************************************************************\n")
+    message(" ERROR: the arm gcc program ${progname} could not be found\n")
+    if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+        message(" you can install the ARM GCC embedded compiler tools from:")
+        message(" https://launchpad.net/gcc-arm-embedded/+download ")
+    elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
+        message(" it is included in the arm-none-eabi-gcc package that you can install")
+        message(" with homebrew:\n")
+        message("   brew tap ARMmbed/homebrew-formulae")
+        message("   brew install arm-none-eabi-gcc")
+    endif()
+    message("\n**************************************************************************")
+    message(FATAL_ERROR "missing program prevents build")
+    return()
+endmacro(gcc_program_notfound)
+
+if(${ARM_NONE_EABI_GCC} STREQUAL "ARM_NONE_EABI_GCC-NOTFOUND")
+    gcc_program_notfound("arm-none-eabi-gcc")
+endif()
+if(${ARM_NONE_EABI_GCC} STREQUAL "ARM_NONE_EABI_GPP-NOTFOUND")
+    gcc_program_notfound("arm-none-eabi-g++")
+endif()
+if(${ARM_NONE_EABI_GCC} STREQUAL "ARM_NONE_EABI_OBJCOPY-NOTFOUND")
+    gcc_program_notfound("arm-none-eabi-objcopy")
+endif()
+
+
 # post-process elf files into .bin files:
-set(YOTTA_POSTPROCESS_COMMAND "arm-none-eabi-objcopy -O binary YOTTA_CURRENT_EXE_NAME YOTTA_CURRENT_EXE_NAME.bin")
+set(YOTTA_POSTPROCESS_COMMAND "${ARM_NONE_EABI_OBJCOPY} -O binary YOTTA_CURRENT_EXE_NAME YOTTA_CURRENT_EXE_NAME.bin")

 # set default compilation flags
@@ -42,15 +75,15 @@
 # Set the compiler to ARM-GCC
 include(CMakeForceCompiler)

-cmake_force_c_compiler(arm-none-eabi-gcc GNU)
-cmake_force_cxx_compiler(arm-none-eabi-g++ GNU)
+cmake_force_c_compiler(${ARM_NONE_EABI_GCC} GNU)
+cmake_force_cxx_compiler(${ARM_NONE_EABI_GPP} GNU)

 # post-process elf files into .bin files:
 function(yotta_apply_target_rules target_type target_name)
     if(${target_type} STREQUAL "EXECUTABLE")
         add_custom_command(TARGET ${target_name}
             POST_BUILD
-            COMMAND arm-none-eabi-objcopy -O binary ${target_name} ${target_name}.bin
+            COMMAND ${ARM_NONE_EABI_OBJCOPY} -O binary ${target_name} ${target_name}.bin
             COMMENT "converting to .bin"
             VERBATIM
         )


ENH: Review Cuberille Remote Module Compliance

Cuberille.remote.cmake has been updated to indicate improvements in
style, continuous integration, and testing coverage since the last
review.  Additionally, the git hash has been bumped to the most
recent commit.

--- Modules/Remote/Cuberille.remote.cmake
+++ Modules/Remote/Cuberille.remote.cmake
@@ -1,10 +1,10 @@
 #-- # Grading Level Criteria Report
 #-- EVALUATION DATE: 2020-03-24
-#-- EVALUATORS: [Dženan Zukić]
+#-- EVALUATORS: [Dženan Zukić, Davis Vigneault]
 #--
 #-- ## Compliance level 5 star (AKA ITK main modules, or remote modules that could become core modules)
 #--   - [ ] Widespread community dependance
-#--   - [ ] Above 90% code coverage
+#--   - [X] Above 90% code coverage
 #--   - [ ] CI dashboards and testing monitored rigorously
 #--   - [X] Key API features are exposed in wrapping interface
 #--   - [ ] All requirements of Levels 4,3,2,1
@@ -16,8 +16,8 @@
 #--            - [ ] Windows Shared Library Build with Visual Studio
 #--            - [ ] Mac with clang compiller
 #--            - [ ] Linux with gcc compiler
-#--   - [ ] Active developer community dedicated to maintaining code-base
-#--   - [ ] 75% code coverage demonstrated for testing suite
+#--   - [X] Active developer community dedicated to maintaining code-base
+#--   - [X] 75% code coverage demonstrated for testing suite
 #--   - [X] Continuous integration testing performed
 #--   - [X] All requirements of Levels 3,2,1
 #--
@@ -40,6 +40,9 @@
 #--
 #-- ### Please document here any justification for the criteria above
 #       Code style enforced by clang-format on 2020-02-19, and clang-tidy modernizations completed
+#       2020-05-25 Continuous integration and clang format linting now performed by Github Actions
+#       2020-05-25 Line coverage is 99.8%, function coverage is 98.0%
+

 # Contact: Matt McCormick <matt.mccormick@kitware.com>
 itk_fetch_module(Cuberille
@@ -61,5 +64,5 @@
 "
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKCuberille.git
-  GIT_TAG 105d1478ee82b674a9bfa07d78a7967f6e91830b
+  GIT_TAG 5f3b5c9140449d93e0156858b5556d66cade1a9f
   )


fix configure checks (CID 2062)

fix configure checks (CID 2062)

svn path=/trunk/KDE/kdepim/gpgmepp/; revision=541277

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -1,4 +1,6 @@
 # gpgme configure checks
+
+include (FindGpgme)

 set(CMAKE_REQUIRED_INCLUDES ${GPGME_INCLUDES})
 set(CMAKE_REQUIRED_LIBRARIES ${GPGME_LIBRARIES})
@@ -15,20 +17,20 @@
 # check if gpgme has gpgme_cancel
 check_cxx_source_compiles ("
   #include <gpgme.h>
-  int main() {
-    gpgme_ctx_t ctx = 0;
+  int test(gpgme_ctx_t& ctx) {
     gpgme_error_t e = gpgme_cancel( ctx );
   }
+  int main() { return 0; }
 " HAVE_GPGME_CANCEL
 )

 # check if gpgme has gpgme_key_t->keylist_mode
 check_cxx_source_compiles ("
   #include <gpgme.h>
-  int main() {
-    gpgme_key_t key = 0;
+  int test(gpgme_key_t& key) {
     key->keylist_mode = 0;
   }
+  int main() { return 0; }
 " HAVE_GPGME_KEY_T_KEYLIST_MODE
 )

@@ -36,8 +38,9 @@
 check_cxx_source_compiles ("
   #include <gpgme.h>
   int test(gpgme_decrypt_result_t& res) {
-    return res.wrong_key_usage;
+    return res->wrong_key_usage;
   }
+  int main() { return 0; }
 " HAVE_GPGME_WRONG_KEY_USAGE
 )

@@ -53,22 +56,22 @@
 # check if gpgme has gpgme_key_t->is_qualified
 check_cxx_source_compiles ("
   #include <gpgme.h>
-  int main() {
-    gpgme_key_t key;
+  int test(gpgme_key_t& key) {
     unsigned int iq;
     iq = key->is_qualified;
   }
+  int main() { return 0; }
 " HAVE_GPGME_KEY_T_IS_QUALIFIED
 )

 # check if gpgme has gpgme_subkey_t->is_qualified
 check_cxx_source_compiles ("
   #include <gpgme.h>
-  int main() {
-    gpgme_subkey_t subkey;
+  int test(gpgme_subkey_t& subkey) {
     unsigned int iq;
     iq = subkey->is_qualified;
   }
+  int main() { return 0; }
 " HAVE_GPGME_SUBKEY_T_IS_QUALIFIED
 )


enable build of arm-softfp cross target component. (#4636)

Fix #4635

Signed-off-by: Jiyoung Yun <888ab5aac88c5184952942ca1558a2962a0a2b47@samsung.com>

--- cross/arm-softfp/toolchain.cmake
+++ cross/arm-softfp/toolchain.cmake
@@ -4,14 +4,24 @@
 set(CMAKE_SYSTEM_VERSION 1)
 set(CMAKE_SYSTEM_PROCESSOR armv7l)

+## Specify the toolchain
+set(TOOLCHAIN "arm-linux-gnueabi")
+set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
+#set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
+#set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
+#set(CMAKE_ASM_COMPILER ${TOOLCHAIN_PREFIX}as)
+#set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
+#set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
+#set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
+
 add_compile_options(-target armv7-linux-gnueabi)
 add_compile_options(-mthumb)
 add_compile_options(-mfpu=vfpv3)
 add_compile_options(--sysroot=${CROSS_ROOTFS})

-set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target arm-linux-gnueabi")
-set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabi")
-set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/arm-linux-gnueabi -L${CROSS_ROOTFS}/usr/lib/arm-linux-gnueabi")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN} -L${CROSS_ROOTFS}/usr/lib/${TOOLCHAIN}")
 set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")

 set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS}    ${CROSS_LINK_FLAGS}" CACHE STRING "" FORCE)


make AddCompilerFlag macro more flexible in the variable it changes

--- cmake/AddCompilerFlag.cmake
+++ cmake/AddCompilerFlag.cmake
@@ -5,13 +5,34 @@
    string(REGEX REPLACE "[-+/:= ]" "_" _flag_esc "${_flag}")
    check_c_compiler_flag("${_flag}" check_c_compiler_flag_${_flag_esc})
    check_cxx_compiler_flag("${_flag}" check_cxx_compiler_flag_${_flag_esc})
-   if(check_c_compiler_flag_${_flag_esc})
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
-   endif(check_c_compiler_flag_${_flag_esc})
-   if(check_cxx_compiler_flag_${_flag_esc})
-      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
-   endif(check_cxx_compiler_flag_${_flag_esc})
+
+   set(_c_flags "CMAKE_C_FLAGS")
+   set(_cxx_flags "CMAKE_CXX_FLAGS")
    if(${ARGC} EQUAL 2)
       set(${ARGV1} "${check_cxx_compiler_flag_${_flag_esc}}")
-   endif(${ARGC} EQUAL 2)
+   elseif(ARGC GREATER 2)
+      set(state 0)
+      unset(_c_flags)
+      unset(_cxx_flags)
+      foreach(_arg ${ARGN})
+         if(_arg STREQUAL "C_FLAGS")
+            set(state 1)
+         elseif(_arg STREQUAL "CXX_FLAGS")
+            set(state 2)
+         elseif(state EQUAL 1)
+            set(_c_flags "${_arg}")
+         elseif(state EQUAL 2)
+            set(_cxx_flags "${_arg}")
+         else()
+            message(FATAL_ERROR "Syntax error for AddCompilerFlag")
+         endif()
+      endforeach()
+   endif()
+
+   if(check_c_compiler_flag_${_flag_esc} AND DEFINED _c_flags)
+      set(${_c_flags} "${${_c_flags}} ${_flag}")
+   endif()
+   if(check_cxx_compiler_flag_${_flag_esc} AND DEFINED _cxx_flags)
+      set(${_cxx_flags} "${${_cxx_flags}} ${_flag}")
+   endif()
 endmacro(AddCompilerFlag)


enable benchmark plots generation only when compiling in Release mode

--- cmake/BenchmarkMacros.cmake
+++ cmake/BenchmarkMacros.cmake
@@ -5,10 +5,15 @@

 add_custom_target(benchmarks COMMENT "Run all benchmarks" VERBATIM)
 add_target_property(benchmarks EXCLUDE_FROM_DEFAULT_BUILD 1)
-if(R_COMMAND)
+set(ENABLE_BENCHMARKS FALSE)
+if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+   set(ENABLE_BENCHMARKS TRUE)
+endif(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
+
+if(R_COMMAND AND ENABLE_BENCHMARKS)
    add_custom_target(benchmark_plots COMMENT "Create PDF plots for all benchmarks" VERBATIM)
    add_target_property(benchmark_plots EXCLUDE_FROM_DEFAULT_BUILD 1)
-endif(R_COMMAND)
+endif(R_COMMAND AND ENABLE_BENCHMARKS)

 macro(vc_generate_datafile target outfile)
    get_target_property(exec ${target} OUTPUT_NAME)
@@ -23,7 +28,7 @@
 endmacro(vc_generate_datafile)

 macro(vc_generate_plots name)
-   if(R_COMMAND)
+   if(R_COMMAND AND ENABLE_BENCHMARKS)
       set(simpleTarget "${name}_simple_benchmark")
       set(sseTarget "${name}_sse_benchmark")
       set(lrbTarget "${name}_lrb_benchmark")
@@ -80,7 +85,7 @@
       set(generate_target "generate_${name}_plot")
       add_custom_target(${generate_target} DEPENDS "${pdffile}")
       add_dependencies(benchmark_plots "${generate_target}")
-   endif(R_COMMAND)
+   endif(R_COMMAND AND ENABLE_BENCHMARKS)
 endmacro(vc_generate_plots)

 macro(vc_add_benchmark name)


add preferred cpack generator

add preferred cpack generator

--- cmake/EnumerateSystem.cmake
+++ cmake/EnumerateSystem.cmake
@@ -10,6 +10,7 @@
         set(LINUX_NAME "Fedora")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "fc${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "Fedora")
       # Scientific Linux case
       if(LINUX_ISSUE MATCHES "Scientific Linux")
@@ -17,6 +18,7 @@
         set(LINUX_NAME "ScientificLinux")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "rhel${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "Scientific Linux")
       # CentOS case
       if(LINUX_ISSUE MATCHES "CentOS")
@@ -24,6 +26,7 @@
         set(LINUX_NAME "CentOS")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "rhel${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "CentOS")
       # Redhat case
       if(LINUX_ISSUE MATCHES "Red Hat")
@@ -31,30 +34,22 @@
         set(LINUX_NAME "Redhat")
         set(LINUX_VER "${CMAKE_MATCH_1}")
         set(RPM_SYSTEM_NAME "rhel${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "RPM")
       endif(LINUX_ISSUE MATCHES "Red Hat")
       # Ubuntu case
       if(LINUX_ISSUE MATCHES "Ubuntu")
         string(REGEX MATCH "buntu ([0-9]+\\.[0-9]+)" UBUNTU "${LINUX_ISSUE}")
         set(LINUX_NAME "Ubuntu")
         set(LINUX_VER "${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
       endif(LINUX_ISSUE MATCHES "Ubuntu")
       # Debian case
       if(LINUX_ISSUE MATCHES "Debian")
         string(REGEX MATCH "Debian .*ux ([0-9]+\\.[0-9]+)" DEBIAN "${LINUX_ISSUE}")
         set(LINUX_NAME "Debian")
         set(LINUX_VER "${CMAKE_MATCH_1}")
+        set(SPECIFIC_SYSTEM_PREFERED_CPACK_GENERATOR "DEB")
       endif(LINUX_ISSUE MATCHES "Debian")
-      # Open SuSE case
-      if(LINUX_ISSUE MATCHES "SUSE")
-        string(REGEX MATCH "SUSE  ([0-9]+\\.[0-9]+)" SUSE "${LINUX_ISSUE}")
-        set(LINUX_NAME "openSUSE")
-        set(LINUX_VER "${CMAKE_MATCH_1}")
-        if (LINUX_VER MATCHES "/")
-          string(REPLACE "/" "_" LINUX_VER ${LINUX_VER})
-        endif()
-      endif(LINUX_ISSUE MATCHES "SUSE")
-      # Mandriva case
-      # TODO

       #Find CPU Arch
       if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "64")


Fix TBB debug

Fix TBB debug

--- cmake/OpenCVDetectTBB.cmake
+++ cmake/OpenCVDetectTBB.cmake
@@ -70,9 +70,13 @@
     add_library(tbb UNKNOWN IMPORTED)
     set_target_properties(tbb PROPERTIES
       IMPORTED_LOCATION "${TBB_ENV_LIB}"
-      IMPORTED_LOCATION_DEBUG "${TBB_ENV_LIB_DEBUG}"
       INTERFACE_INCLUDE_DIRECTORIES "${TBB_ENV_INCLUDE}"
     )
+    if (TBB_ENV_LIB_DEBUG)
+      set_target_properties(tbb PROPERTIES
+        IMPORTED_LOCATION_DEBUG "${TBB_ENV_LIB_DEBUG}"
+      )
+    endif()
     # workaround: system TBB library is used for linking instead of provided
     if(CV_GCC)
       get_filename_component(_dir "${TBB_ENV_LIB}" DIRECTORY)


Fixed package-contains-timestamped-gzip lintian warning for Debian packages.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -325,7 +325,7 @@
     set(CHANGELOG_PACKAGE_NAME "${CPACK_DEBIAN_COMPONENT_${comp_upcase}_NAME}")
     configure_file("${CMAKE_SOURCE_DIR}/cmake/templates/changelog.Debian.in" "${DEBIAN_CHANGELOG_OUT_FILE}" @ONLY)

-    execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
+    execute_process(COMMAND "${GZIP_TOOL}" "-ncf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
                     OUTPUT_FILE "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
                     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")

@@ -337,7 +337,7 @@
     set(CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.gz")
     file(WRITE ${CHANGELOG_OUT_FILE} "Upstream changelog stub. See https://github.com/Itseez/opencv/wiki/ChangeLog")

-    execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${CHANGELOG_OUT_FILE}"
+    execute_process(COMMAND "${GZIP_TOOL}" "-ncf9" "${CHANGELOG_OUT_FILE}"
                     OUTPUT_FILE "${CHANGELOG_OUT_FILE_GZ}"
                     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")


Removed NO_MPI option. It is unused and clobbers the NO_MPI option in the pv_add_test macro

--- cmake/PVAddExecutable.cmake
+++ cmake/PVAddExecutable.cmake
@@ -20,7 +20,7 @@
 macro(pv_add_executable TARGET)
   cmake_parse_arguments(
     PARSED_ARGS
-    "NO_MPI"
+    ""
     "OUTPUT_PATH"
     "SRC"
     ${ARGN}


cmake: add define for module name

cmake: add define for module name

--- cmake/common/px4_base.cmake
+++ cmake/common/px4_base.cmake
@@ -303,6 +303,9 @@
 	if(MAIN)
 		set_target_properties(${MODULE} PROPERTIES
 			COMPILE_DEFINITIONS PX4_MAIN=${MAIN}_app_main)
+		add_definitions(-DMODULE_NAME="${MAIN}")
+	else()
+		add_definitions(-DMODULE_NAME="unknown")
 	endif()

 	if(INCLUDES)
@@ -400,7 +403,7 @@
 		list(APPEND msg_source_files_out ${msg_source_out_path}/${msg}.cpp)
 	endforeach()
 	add_custom_command(OUTPUT ${msg_source_files_out}
-		COMMAND ${PYTHON_EXECUTABLE}
+		COMMAND ${PYTHON_EXECUTABLE}
 			Tools/px_generate_uorb_topic_files.py
 			--sources
 			${QUIET}


[CMake] Unbreak add_llvm_external_project when external projects are specified.

LLVM_EXTERNAL_*_SOURCE_DIR is reset as PATH with set(CACHE PATH).
Then the CACHE PATH variable, LLVM_EXTERNAL_*_SOURCE_DIR, is normalized as
${CMAKE_SOURCE_DIR}/${path_var} if ${path_var} is relative.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -696,6 +696,9 @@
   endif()
   if(NOT LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR)
     set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/${add_llvm_external_dir}")
+  else()
+    set(LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR
+        CACHE PATH "Path to ${name} source directory")
   endif()
   if (EXISTS ${LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR}/CMakeLists.txt)
     option(LLVM_EXTERNAL_${nameUPPER}_BUILD


Manual installs of MsgPack-C are labelled as such

--- cmake_lib/FindMsgPack.cmake
+++ cmake_lib/FindMsgPack.cmake
@@ -21,7 +21,7 @@
     /usr/local/include/msgpack
 )

-FIND_LIBRARY(MSGPACK_LIBRARY NAMES msgpack PATHS
+FIND_LIBRARY(MSGPACK_LIBRARY NAMES msgpack msgpackc PATHS
     /usr/lib
     /usr/local/lib
     /usr/local/lib/msgpack


Add missing -lcfg to AIX build for access to odm

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -601,7 +601,7 @@

 	if (AIX)
 		# specifically ask for the C++ libraries to be statically linked
-		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-berok -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lodm -static-libgcc")
+		set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-berok -Wl,-bstatic -lstdc++ -Wl,-bdynamic -lcfg -lodm -static-libgcc")
 	endif(AIX)

 	if (NOT PROPER AND NOT AIX)


loader: Fixed issue with Linux when ImageMagick-5 installed.

Last changes made ImageMagick-6 work, but broke ImageMagick-5.
The issue is that the _ARCH_INCLUDE directories are only present
for ImageMagick-6 and newer.  So, Cmake was attempting to use an
undefined variable.

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -155,9 +155,11 @@
     LIST(APPEND ImageMagick_INCLUDE_DIRS
       ${ImageMagick_${component}_INCLUDE_DIR}
       )
-    LIST(APPEND ImageMagick_INCLUDE_DIRS
-      ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
-      )
+    IF(EXISTS ${ImageMagick_${component}_ARCH_INCLUDE_DIR})
+      LIST(APPEND ImageMagick_INCLUDE_DIRS
+        ${ImageMagick_${component}_ARCH_INCLUDE_DIR}
+        )
+    ENDIF(EXISTS ${ImageMagick_${component}_ARCH_INCLUDE_DIR})
     LIST(REMOVE_DUPLICATES ImageMagick_INCLUDE_DIRS)
     SET(ImageMagick_INCLUDE_DIRS ${ImageMagick_INCLUDE_DIRS} PARENT_SCOPE)


Fixes for automatically building boost using ThirdParty zlib.

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@3801 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -27,7 +27,12 @@
             URL_MD5 "0d202cb811f934282dea64856a175698"
             DOWNLOAD_DIR ${TPSRC}
             CONFIGURE_COMMAND ./bootstrap.sh --prefix=${TPSRC}/dist
-            BUILD_COMMAND ./b2 link=shared ${BOOST_FLAGS} ${BOOST_LIB_LIST}
+            BUILD_COMMAND NO_BZIP2=1 ./b2
+                            variant=release
+                            link=shared
+                            include=${TPSRC}/dist/include
+                            linkflags="-L${TPSRC}/dist/lib"
+                            ${BOOST_FLAGS} ${BOOST_LIB_LIST}
                             --layout=system toolset=${TOOLSET} install
             INSTALL_COMMAND ""
             BUILD_IN_SOURCE 1


bump mkldnn version

bump mkldnn version

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -53,7 +53,7 @@
     ${EXTERNAL_PROJECT_LOG_ARGS}
     DEPENDS             ${MKLDNN_DEPENDS}
     GIT_REPOSITORY      "https://github.com/01org/mkl-dnn.git"
-    GIT_TAG             "v0.11"
+    GIT_TAG             "v0.14"
     PREFIX              ${MKLDNN_SOURCES_DIR}
     UPDATE_COMMAND      ""
     CMAKE_ARGS          -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}


[CMake] Move the target property PREFIX from add_llvm_loadable_module() to llvm_add_library().

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -221,7 +221,10 @@
   endif()

   if(ARG_MODULE)
-    set_property(TARGET ${name} PROPERTY SUFFIX ${LLVM_PLUGIN_EXT})
+    set_target_properties(${name} PROPERTIES
+      PREFIX ""
+      SUFFIX ${LLVM_PLUGIN_EXT}
+      )
   endif()

   if(ARG_SHARED)
@@ -285,7 +288,6 @@
     add_custom_target(${name})
   else()
     llvm_add_library(${name} MODULE ${ARGN})
-    set_target_properties( ${name} PROPERTIES PREFIX "" )

     if( EXCLUDE_FROM_ALL )
       set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)


[CMake] Export utility targets to the build/install tree depending on LLVM_BUILD/INSTALL_UTILS

Summary:
Allow external projects to import test-related targets like FileCheck, count, not etc. and query binary paths, properties, etc.
This would be useful for LLDB, because it reduces the difference between in-tree vs. standalone builds and simplifies CMake logic.

Reviewers: chapuni, gottesmm, beanz

Reviewed By: beanz

Subscribers: mgorny, lldb-commits, llvm-commits, #lldb

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -920,6 +920,9 @@
                                DEPENDS ${name}
                                COMPONENT ${name})
     endif()
+    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
+  elseif( LLVM_BUILD_UTILS )
+    set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS_BUILDTREE_ONLY ${name})
   endif()
 endmacro(add_llvm_utility name)


Push ParaView forward

Push ParaView forward

--- 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 "0c6373706a8d63c84b12f9a74aa8d9a903877444")
+  set(_paraview_revision "f0afbb7577a7fdcc400d4fd1067204b2932cb0f2")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Fix for CMake 3.6

Fix for CMake 3.6

--- absl/copts/AbseilConfigureCopts.cmake
+++ absl/copts/AbseilConfigureCopts.cmake
@@ -24,7 +24,7 @@
     if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
       # AppleClang doesn't have lsan
       # https://developer.apple.com/documentation/code_diagnostics
-      if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 3.5)
+      if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
         set(ABSL_LSAN_LINKOPTS "-fsanitize=leak")
         set(ABSL_HAVE_LSAN ON)
       endif()


Power Linux: Fix NVCC Macro

Power Linux: Fix NVCC Macro

NVCC forgets, only on OpenPOWER systems, to forward the
`linux`/`__linux` macros. This causes alpaka to fail to
compile.

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -541,6 +541,14 @@

                 SET(CUDA_PROPAGATE_HOST_FLAGS ON)

+                # nvcc sets no linux/__linux macros on OpenPOWER linux
+                # nvidia bug id: 2448610
+                IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+                    IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
+                        LIST(APPEND CUDA_NVCC_FLAGS "-Dlinux")
+                    ENDIF()
+                ENDIF()
+
                 IF(CUDA_VERSION VERSION_EQUAL 8.0)
                     LIST(APPEND CUDA_NVCC_FLAGS "-Wno-deprecated-gpu-targets")
                 ENDIF()


add error process for php-config script detect

--- cmake/modules/DetectPhpInfo.cmake
+++ cmake/modules/DetectPhpInfo.cmake
@@ -12,8 +12,9 @@
     find_program(ZAPI_PHP_CONFIG_EXECUABLE php-config
         HINTS ${ZAPI_PHP_POSSIBLE_BIN_PATHS} NO_DEFAULT_PATH)
 endif()
-if (NOT ZAPI_PHP_CONFIG_EXECUABLE)
-    message(FATAL_ERROR "php-config script is not found")
+
+if (NOT (ZAPI_PHP_CONFIG_EXECUABLE AND EXISTS ${ZAPI_PHP_CONFIG_EXECUABLE}))
+    message(FATAL_ERROR "php-config script: ${ZAPI_PHP_CONFIG_EXECUABLE} is not found")
 endif()

 # if you build the unittest we will detect libphp library


Add cmake options for gstreamer config

Add cmake options for gstreamer config

This ensures that none standard include paths (e.g.
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/include) are found and used.

--- cmake/modules/FindGStreamer.cmake
+++ cmake/modules/FindGStreamer.cmake
@@ -75,6 +75,7 @@

 # 1.1. Find headers and libraries
 FIND_GSTREAMER_COMPONENT(GSTREAMER gstreamer-1.0 gst/gst.h gstreamer-1.0)
+FIND_GSTREAMER_COMPONENT(GSTREAMER_CONFIG gstreamer-1.0 gst/gstconfig.h gstreamer-1.0)
 FIND_GSTREAMER_COMPONENT(GSTREAMER_BASE gstreamer-base-1.0 gst/base/gstadapter.h gstbase-1.0)

 # 1.2. Check GStreamer version
@@ -111,6 +112,9 @@
 FIND_GSTREAMER_COMPONENT(GSTREAMER_TAG gstreamer-tag-1.0 gst/tag/tag.h gsttag-1.0)
 FIND_GSTREAMER_COMPONENT(GSTREAMER_VIDEO gstreamer-video-1.0 gst/video/video.h gstvideo-1.0)

+list(APPEND GSTREAMER_INCLUDE_DIRS ${GSTREAMER_CONFIG_INCLUDE_DIRS})
+list(APPEND GSTREAMER_LIBRARIES ${GSTREAMER_CONFIG_LIBRARIES})
+
 # ------------------------------------------------
 # 3. Process the COMPONENTS passed to FIND_PACKAGE
 # ------------------------------------------------
@@ -134,6 +138,8 @@
 	GSTREAMER_AUDIO_LIBRARIES
 	GSTREAMER_BASE_INCLUDE_DIRS
 	GSTREAMER_BASE_LIBRARIES
+	GSTREAMER_CONFIG_INCLUDE_DIRS
+	GSTREAMER_CONFIG_LIBRARIES
 	GSTREAMER_FFT_INCLUDE_DIRS
 	GSTREAMER_FFT_LIBRARIES
 	GSTREAMER_INCLUDE_DIRS


From Brett Viren:
There is an extraneous "}" in the REFLEX_GENERATE_DICTIONARY cmake macro.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@44166 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -154,7 +154,7 @@
   if(IS_ABSOLUTE ${ARG_SELECTION})
     set(selectionfile ${ARG_SELECTION})
   else()
-    set(selectionfile ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SELECTION}})
+    set(selectionfile ${CMAKE_CURRENT_SOURCE_DIR}/${ARG_SELECTION})
   endif()

   set(gensrcdict ${dictionary}_dict.cpp)


Fix variable name

Fix variable name

--- cmake/modules/hunter_config.cmake
+++ cmake/modules/hunter_config.cmake
@@ -132,7 +132,7 @@
   if(NOT "${x_CONFIGURATION_TYPES}" STREQUAL "")
     set(
         "__HUNTER_USER_CONFIGURATION_TYPES_${package}"
-        "${x_CMAKE_ARGS}"
+        "${x_CONFIGURATION_TYPES}"
         PARENT_SCOPE
     )
   endif()


add GNUInstallDirs

add GNUInstallDirs

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -15,6 +15,8 @@
 macro(define_mrpt_metalib name)
 	internal_define_mrpt_lib(${name} 1 1 ${ARGN}) # headers_only = 1, is_metalib=1
 endmacro(define_mrpt_metalib)
+
+include(GNUInstallDirs)

 # Implementation of both define_mrpt_lib() and define_mrpt_lib_headers_only():
 #-----------------------------------------------------------------------------


little cosmetics on displayed messages for binaries dependencies

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -303,9 +303,12 @@
 		#todo : maybe we need a complete layer over that, Wk Modules handling Wk fetures such as run_libraries and correct variable name...

 		target_link_libraries(${PROJECT_NAME} ${${package_var_name}_LIBRARIES})
+		message ( STATUS "Binary Dependency ${package_name} libs : ${${package_var_name}_LIBRARIES} OK !")
 		#if the find module also defines the runtime libraries ( Wk find module standard  NOT CMAKE itself !)
 		set( ${PROJECT_NAME}_RUN_LIBRARIES ${${PROJECT_NAME}_RUN_LIBRARIES} ${${package_var_name}_RUN_LIBRARIES} CACHE INTERNAL " libraries needed to run ${PROJECT_NAME} " )
-		message ( STATUS "Binary Dependency ${package_name} runlibs : ${${package_var_name}_RUN_LIBRARIES} OK !")
+		IF ( WIN32 )
+			message ( STATUS "Binary Dependency ${package_name} runlibs : ${${package_var_name}_RUN_LIBRARIES} OK !")
+		ENDIF ( WIN32 )
 		#once the project is built with it the dependency becomes mandatory
 		# we append to the config cmake script
 		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -98,7 +98,7 @@
     math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")

     # if we could extract them, compare with the requested version number
-    if (SFML_VERSION_MAJOR)
+    if (SFML_VERSION_MAJOR AND SFML_VERSION_MINOR AND SFML_VERSION_PATCH)
         # transform version numbers to an integer
         math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")


Bumping to version 1.1.

Bumping to version 1.1.

--- source/defines.h.cmake
+++ source/defines.h.cmake
@@ -27,7 +27,7 @@
  */

 #define APP_NAME "Logos Wallpaper Updater"
-#define APP_VERSION "1.0"
+#define APP_VERSION "1.1"

 #ifdef Q_WS_MAC
 #define MACOS_X 1


for Win64 build fix for wrong SYS_ARCH value that CMake sets.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -65,6 +65,11 @@
 	if ( ${CMAKE_INSTALL_PREFIX} MATCHES "Program Files" )
 		# mimic *nix for consistency
 		set( CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/release_dir")
+	endif()
+
+	# when building x64 on Windows, cmake's SYS_ARCH value is wrong... so fix it here before we use it to brand the binaries.
+	if ( ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
+		set(SYS_ARCH "X86_64")
 	endif()

 	dprint("TODO FEATURE-> Z:TANNENBA:TJ:TSTCLAIR Update registry + paths to use this prefixed debug loc (test_install)")


Fix cmake code to use our own pcre header file on Mac OS X.

The previous code didn't add the include directory from the externals
if cmake was invoked a second time.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -143,9 +143,11 @@
 	if ( ${OS_NAME} STREQUAL "DARWIN" AND NOT HAVE_PCRE_H AND NOT HAVE_PCRE_PCRE_H )
 		# Mac OS X includes the pcre libraries but not the header
 		# files. Try supplying the appropriate headers.
-		include_directories( ${CONDOR_EXTERNAL_DIR}/bundles/pcre/7.6/include-darwin )
 		find_path(HAVE_PCRE_H "pcre.h"
 			PATHS "${CONDOR_EXTERNAL_DIR}/bundles/pcre/7.6/include-darwin")
+	endif()
+	if ( ${HAVE_PCRE_H} MATCHES "${CONDOR_EXTERNAL_DIR}/bundles/pcre/7.6/include-darwin" )
+		include_directories( ${CONDOR_EXTERNAL_DIR}/bundles/pcre/7.6/include-darwin )
 	endif()

     find_multiple( "z" ZLIB_FOUND)


Expose extra buildroot info

Expose extra buildroot info

--- Buildroot.cmake
+++ Buildroot.cmake
@@ -324,16 +324,18 @@
     )

     set_target_properties(${name} PROPERTIES
+        BUILDROOT_OUTPUT
+            ${main_output}
         BUILDROOT_BUILD_DIR
             ${build_dir}
-        BUILDROOT_OUTPUT
-            ${main_output}
+        BUILDROOT_STAGING_DIR
+            ${build_dir}/staging
+        BUILDROOT_HOST_DIR
+            ${build_dir}/host
+        BUILDROOT_HOST_TOOLS_PREFIX
+            ${build_dir}/host/usr
         BUILDROOT_HOST_TOOLS_OUTPUT
             ${host_tools_output}
-        BUILDROOT_HOST_TOOLS_PREFIX
-            ${build_dir}/host/usr
-        BUILDROOT_STAGING_DIR
-            ${build_dir}/staging
     )

     _buildroot_clean_target(${name} ${build_dir} "${all_outputs}")
@@ -483,6 +485,11 @@

 define_property(TARGET PROPERTY "BUILDROOT_BUILD_DIR"
     BRIEF_DOCS "Path to the directory that contains all Buildroot build output for this build."
+    FULL_DOCS "x"
+    )
+
+define_property(TARGET PROPERTY "BUILDROOT_HOST_DIR"
+    BRIEF_DOCS "Path to the host tools directory within the Buildroot build output"
     FULL_DOCS "x"
     )


crossbuild to android working on linux

crossbuild to android working on linux

--- WkCompilerSetup.cmake
+++ WkCompilerSetup.cmake
@@ -247,11 +247,15 @@
 			WkSetExeLinkerFlags( All -Wl,--warn-once )
 			WkSetSharedLinkerFlags( All -Wl,--warn-once )
 			WkSetModuleLinkerFlags( All -Wl,--warn-once )
-		ELSE (MSYS)
+		ELSEIF (ANDROID_ABI) # we are cross copmiling with Android NDK
+			WkSetExeLinkerFlags( All -Wl,--warn-unresolved-symbols)
+			WkSetSharedLinkerFlags( All -Wl,--warn-unresolved-symbols )
+			WkSetModuleLinkerFlags( All -Wl,--warn-unresolved-symbols )
+		ELSE()
 			WkSetExeLinkerFlags( All -Wl,--warn-unresolved-symbols,--warn-once )
 			WkSetSharedLinkerFlags( All -Wl,--warn-unresolved-symbols,--warn-once )
 			WkSetModuleLinkerFlags( All -Wl,--warn-unresolved-symbols,--warn-once )
-		ENDIF (MSYS)
+		ENDIF()

 		WkSetExeLinkerFlags( Debug )
 		WkSetSharedLinkerFlags( Debug )


Disable libxml on i686, because it is a 32 bit architecture and
libxml2.so is for 64 bit.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -159,7 +159,7 @@
   find_library(ICONV_LIBRARY_PATH NAMES iconv libiconv libiconv-2 c)
   set(LLVM_LIBXML2_ENABLED 0)
   set(LIBXML2_FOUND 0)
-  if(LLVM_ENABLE_LIBXML2 AND CMAKE_SYSTEM_NAME MATCHES "Linux" AND ICONV_LIBRARY_PATH)
+  if((LLVM_ENABLE_LIBXML2) AND (CMAKE_SYSTEM_NAME MATCHES "Linux") AND (ICONV_LIBRARY_PATH) AND (NOT LLVM_NATIVE_ARCH MATCHES "i686"))
     find_package(LibXml2)
     if (LIBXML2_FOUND)
       set(LLVM_LIBXML2_ENABLED 1)


should be safe to set

should be safe to set

--- cmake/stm32_gcc.cmake
+++ cmake/stm32_gcc.cmake
@@ -13,3 +13,6 @@
 set(CMAKE_EXECUTABLE_SUFFIX_C   .elf)
 set(CMAKE_EXECUTABLE_SUFFIX_CXX .elf)
 set(CMAKE_EXECUTABLE_SUFFIX_ASM .elf)
+
+# See: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_ROOT_PATH_MODE_PROGRAM.html
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)


Dennis: Updated cmake

Dennis:
Updated cmake

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@149 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/ACGCommon.cmake
+++ cmake/ACGCommon.cmake
@@ -57,11 +57,11 @@
 # set directory structures for the different platforms
 if (WIN32)
   set (ACG_PROJECT_DATADIR ".")
-  set (ACG_PROJECT_LIBDIR "bin")
-  set (ACG_PROJECT_BINDIR "bin")
+  set (ACG_PROJECT_LIBDIR "lib")
+  set (ACG_PROJECT_BINDIR ".")
   set (ACG_PROJECT_PLUGINDIR "Plugins")
-  if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR})
-    file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR})
+  if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
+    file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR})
   endif ()
 else ()
   set (ACG_PROJECT_DATADIR "share/${CMAKE_PROJECT_NAME}")
@@ -342,7 +342,7 @@
                           COMMAND ${CMAKE_COMMAND} -E
                           copy_if_different
                             ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll
-                            ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.dll)
+                            ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_BINDIR}/${_target}.dll)
     elseif (${_type} STREQUAL MODULE)
       if (NOT EXISTS ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
         file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR})
@@ -352,6 +352,13 @@
                           copy_if_different
                             ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.dll
                             ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_PLUGINDIR}/${_target}.dll)
+    endif ()
+    if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
+      add_custom_command (TARGET ${_target} POST_BUILD
+                          COMMAND ${CMAKE_COMMAND} -E
+                          copy_if_different
+                            ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${_target}.lib
+                            ${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_LIBDIR}/${_target}.lib)
     endif ()
   elseif (APPLE AND NOT ACG_PROJECT_MACOS_BUNDLE)
     if (${_type} STREQUAL SHARED)
@@ -372,8 +379,11 @@
     endif ()
   endif ()
   if (NOT ACG_PROJECT_BUNDLE OR NOT APPLE)
-    if (${_type} STREQUAL SHARED)
-      install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_LIBDIR})
+    if (${_type} STREQUAL SHARED OR ${_type} STREQUAL STATIC)
+      install (TARGETS ${_target}
+               RUNTIME DESTINATION ${ACG_PROJECT_BINDIR}
+               LIBRARY DESTINATION ${ACG_PROJECT_LIBDIR}
+               ARCHIVE DESTINATION ${ACG_PROJECT_LIBDIR})
     elseif (${_type} STREQUAL MODULE)
       install (TARGETS ${_target} DESTINATION ${ACG_PROJECT_PLUGINDIR})
     endif ()