Alphabetize entries to make them easier to read!

--- lib/FindAtomSpace.cmake
+++ lib/FindAtomSpace.cmake
@@ -14,9 +14,6 @@
    /usr/lib/ /usr/lib64/ /usr/local/lib/ /usr/local/lib64/)

 find_library(ATOMSPACE_LIBRARY atomspace
-   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)
-
-find_library(ATOMSPACE_truthvalue_LIBRARY truthvalue
    PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_atomspaceutils_LIBRARY atomspaceutils
@@ -43,9 +40,6 @@
 find_library(ATOMSPACE_persist-zmq_LIBRARY persist-zmq
 	PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

-find_library(ATOMSPACE_zmqatoms_LIBRARY zmqatoms
-   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)
-
 find_library(ATOMSPACE_PythonEval_LIBRARY PythonEval
    PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

@@ -56,6 +50,12 @@
    PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 find_library(ATOMSPACE_smob_LIBRARY smob
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)
+
+find_library(ATOMSPACE_truthvalue_LIBRARY truthvalue
+   PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)
+
+find_library(ATOMSPACE_zmqatoms_LIBRARY zmqatoms
    PATH ${ATOMSPACE_LIBPATH} PATH_SUFFIXES opencog)

 set(ATOMSPACE_LIBRARIES


Remove spurious "-" in macro

Remove spurious "-" in macro

--- lib/OpenCogMacros.cmake
+++ lib/OpenCogMacros.cmake
@@ -1,7 +1,6 @@
 MACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE SCM_FILE PYTHON_FILE)
     ADD_CUSTOM_COMMAND (
-        COMMAND "${CMAKE_COMMAND}" -DSCRIPT_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE}\" -DHEADER_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}\" -DDEFINITIONS_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}\" -DINHERITANCE_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}\" -DSCM_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}\" -
-         -DPYTHON_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}\" -P "${CMAKE_SOURCE_DIR}/lib/OpenCogAtomTypes.cmake"
+        COMMAND "${CMAKE_COMMAND}" -DSCRIPT_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE}\" -DHEADER_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}\" -DDEFINITIONS_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}\" -DINHERITANCE_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}\" -DSCM_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${SCM_FILE}\" -DPYTHON_FILE=\"${CMAKE_CURRENT_BINARY_DIR}/${PYTHON_FILE}\" -P "${CMAKE_SOURCE_DIR}/lib/OpenCogAtomTypes.cmake"
         OUTPUT  "${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILE}"
                 "${CMAKE_CURRENT_BINARY_DIR}/${DEFINITIONS_FILE}"
                 "${CMAKE_CURRENT_BINARY_DIR}/${INHERITANCE_FILE}"


STYLE: Update HigherOrderAccurateGradient module for style fixes.

Addresses double underscore header guard KWStyle test failures.

Change-Id: Ibad57ef302b317f25276bd9e7c4b1be566acd72c

--- Modules/Remote/HigherOrderAccurateGradient.remote.cmake
+++ Modules/Remote/HigherOrderAccurateGradient.remote.cmake
@@ -7,5 +7,5 @@
   http://www.insight-journal.org/browse/publication/775
   http://hdl.handle.net/10380/3231"
   GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKHigherOrderAccurateGradient.git
-  GIT_TAG 011136180ec1779a4a6eb2294efd06deefe0fe7a
+  GIT_TAG 25e3ff135678fad2492db6aa5aa9fadc26d725e8
   )


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Add Ubuntu-specific linker flag for bashleveldb

--- basholeveldb.cmake
+++ basholeveldb.cmake
@@ -22,7 +22,16 @@
 elseif (${UNIX})
     message ("Basho-tuned leveldb cmake system: Detected UNIX-like platform.")
 	set (LIBFILE "so")
-	set (COMPILE_FLAGS "-lrt")
+    if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+        if (EXISTS "/etc/issue")
+            file(READ "/etc/issue" LINUX_ISSUE)
+            # Ubuntu
+            if (LINUX_ISSUE MATCHES "Ubuntu")
+                message ("Detected Ubuntu system.  Using -lrt linker flag.")
+	            set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lrt")
+            endif ()
+        endif ()
+    endif ()
 elseif (${WINDOWS})
     message (FATAL_ERROR "Leveldb cmake system: Detected Windows platform.  Not setup for it yet!")
 endif ()


Some fixes

Some fixes

--- cmake/External.cmake
+++ cmake/External.cmake
@@ -148,6 +148,7 @@
   set_target_properties(${TARGET}_ext PROPERTIES FOLDER external)

   external_set_property(${TARGET} SOURCE_DIR "${${lcName}_SOURCE_DIR}")
+  external_set_property(${TARGET} INSTALL_MAIN_DIR "${${lcName}_INSTALL_DIR}")
   if(MULTICONFIG)
     external_set_property(${TARGET} INSTALL_DIR "${${lcName}_INSTALL_DIR}/Release")
   else()
@@ -245,7 +246,7 @@
   _argument_default(DEPENDS "")

   # Guess library properties, unless set.
-  external_get_property(${DEPENDS} INSTALL_DIR)
+  external_get_property(${DEPENDS} INSTALL_MAIN_DIR)
   external_get_property(${DEPENDS} CONFIG_DIR)
   _argument_default(COMPILE_DEFINITIONS "")
   _argument_default(INCLUDE_DIR "")
@@ -262,13 +263,13 @@
   get_property(MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)

   if(MULTICONFIG)
-    set(INSTALL_DIR_DEBUG ${INSTALL_DIR}/Debug)
-    set(INSTALL_DIR_RELEASE ${INSTALL_DIR}/Release)
-    set(INSTALL_DIR_RELWITHDEBINFO ${INSTALL_DIR}/RelWithDebInfo)
-  else()
-    set(INSTALL_DIR_DEBUG ${INSTALL_DIR})
-    set(INSTALL_DIR_RELEASE ${INSTALL_DIR})
-    set(INSTALL_DIR_RELWITHDEBINFO ${INSTALL_DIR})
+    set(INSTALL_DIR_DEBUG ${INSTALL_MAIN_DIR}/Debug)
+    set(INSTALL_DIR_RELEASE ${INSTALL_MAIN_DIR}/Release)
+    set(INSTALL_DIR_RELWITHDEBINFO ${INSTALL_MAIN_DIR}/RelWithDebInfo)
+  else()
+    set(INSTALL_DIR_DEBUG ${INSTALL_MAIN_DIR})
+    set(INSTALL_DIR_RELEASE ${INSTALL_MAIN_DIR})
+    set(INSTALL_DIR_RELWITHDEBINFO ${INSTALL_MAIN_DIR})
   endif()

   # Create include directory as required by INTERFACE_INCLUDE_DIRECTORIES.


Adjust glfw find script

Adjust glfw find script

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -51,5 +51,5 @@

 # GLFW is required to link statically for now (no deploy specified)

-find_package_handle_standard_args(GLFW REQUIRED_VARS GLFW_INCLUDE_DIR GLFW_LIBRARY)
-mark_as_advanced(GLFW_INCLUDE_DIR GLFW_LIBRARY)
+find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_LIBRARY GLFW_INCLUDE_DIR)
+mark_as_advanced(GLFW_FOUND GLFW_INCLUDE_DIR GLFW_LIBRARY)


When calling cmake's add_test pass args as array

Instead of passing all args as a string. This is useful for more complex
invocations of the test script which involve "args with spaces".

--- cmake/P4CUtils.cmake
+++ cmake/P4CUtils.cmake
@@ -86,11 +86,12 @@
   file (WRITE  ${__testfile} "#! /bin/bash\n")
   file (APPEND ${__testfile} "# Generated file, modify with care\n\n")
   file (APPEND ${__testfile} "cd ${P4C_BINARY_DIR}\n")
-  file (APPEND ${__testfile} "${driver} ${P4C_SOURCE_DIR} $* ${P4C_SOURCE_DIR}/${p4test}")
+  file (APPEND ${__testfile} "${driver} ${P4C_SOURCE_DIR} \"$@\" ${P4C_SOURCE_DIR}/${p4test}")
   execute_process(COMMAND chmod +x ${__testfile})
   p4c_test_set_name(__testname ${tag} ${alias})
+  separate_arguments(__args UNIX_COMMAND ${args})
   add_test (NAME ${__testname}
-    COMMAND ${tag}/${p4test}.test ${args}
+    COMMAND ${tag}/${p4test}.test ${__args}
     WORKING_DIRECTORY ${P4C_BINARY_DIR})
   if (NOT DEFINED ${tag}_timeout)
     set (${tag}_timeout 300)


Correct path to clang-analyzer for arch linux.

--- cmake/analyzer.cmake
+++ cmake/analyzer.cmake
@@ -1,6 +1,6 @@
 # this one is important
 SET(CMAKE_SYSTEM_NAME Linux)

-SET(CMAKE_C_COMPILER /usr/lib/clang-analyzer/scan-build/ccc-analyzer)
-SET(CMAKE_CXX_COMPILER /usr/lib/clang-analyzer/scan-build/c++-analyzer)
+SET(CMAKE_C_COMPILER /usr/lib/clang/ccc-analyzer)
+SET(CMAKE_CXX_COMPILER /usr/lib/clang/c++-analyzer)


pw_build: Move generator expression handling out of pw_add_test

Moves the generator expression based dependency from
pw_auto_add_module_tests out of pw_add_test and instead inside of
the originating function by appending it manually to the created
test's library target.

Change-Id: Iad454084b2463c950d97638570881cc28919337a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117290
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Commit-Queue: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -174,12 +174,17 @@
       SOURCES
         "${test}"
         ${c_test}
-      DEPS
-        "$<TARGET_NAME_IF_EXISTS:${MODULE}>"
+      PRIVATE_DEPS
         ${arg_PRIVATE_DEPS}
       GROUPS
         "${MODULE}"
         ${arg_GROUPS}
+    )
+    # Generator expressions are not targets, ergo cannot be passed via the
+    # public pw_add_test API.
+    target_link_libraries("${MODULE}.${test_name}.lib"
+      PRIVATE
+        "$<TARGET_NAME_IF_EXISTS:${MODULE}>"
     )
   endforeach()
 endfunction(pw_auto_add_module_tests)
@@ -715,6 +720,7 @@
     PRIVATE_DEPS
       pw_unit_test
       ${pw_unit_test_MAIN}
+      ${arg_DEPS}
       ${arg_PRIVATE_DEPS}
     PRIVATE_INCLUDES
       ${arg_PRIVATE_INCLUDES}
@@ -726,9 +732,6 @@
     PRIVATE_LINK_OPTIONS
       ${arg_PRIVATE_LINK_OPTIONS}
   )
-  # TODO(ewout, hepler): Move this above once pw_auto_add_module_tests has
-  # been deprecated which relies on generator expressions (i.e. aren't targets).
-  target_link_libraries("${NAME}.lib" PRIVATE ${arg_DEPS})

   # TODO(ewout, hepler): Enable the use of pw_unit_test_EXECUTABLE_TARGET_TYPE &
   # pw_unit_test_EXECUTABLE_TARGET_TYPE_FILE for stamping out unit test


pw_build: Deprecate pw_add_test's DEPS and DEFINES

Deprecates the pw_add_test's DEPS and DEFINES arguments in favor
of the PRIVATE_DEPS and PRIVATE_DEFINES replacements.

Change-Id: I1b774a51cdfa3fe09ac77a5bb14a1d29c293fa58
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/117291
Pigweed-Auto-Submit: Ewout van Bekkum <638f134dbc68778d6b859fb04a64baea2b00b021@google.com>
Commit-Queue: Auto-Submit <14637eda5603879df170705285bf30f5996692f0@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <cca3bedb37979eacd157a9bceb473582df8aea1e@google.com>

--- pw_build/pigweed.cmake
+++ pw_build/pigweed.cmake
@@ -691,8 +691,6 @@
 #   PRIVATE_LINK_OPTIONS - private target_link_options arguments
 #
 #  TODO(ewout, hepler): Deprecate the following legacy arguments
-#   DEPS - alias to PRIVATE_DEPS
-#   DEFINES - alias to PRIVATE_DEFINES
 #   GROUPS - groups to which to add this test; if none are specified, the test is
 #       added to the 'default' and 'all' groups
 #
@@ -703,7 +701,7 @@
   set(multi_value_args SOURCES HEADERS PRIVATE_DEPS PRIVATE_INCLUDES
                        PRIVATE_DEFINES PRIVATE_COMPILE_OPTIONS
                        PRIVATE_LINK_OPTIONS
-                       DEPS DEFINES GROUPS)
+                       GROUPS)
   pw_parse_arguments_strict(
       pw_add_test "${num_positional_args}" "${option_args}" "${one_value_args}"
       "${multi_value_args}")
@@ -720,12 +718,10 @@
     PRIVATE_DEPS
       pw_unit_test
       ${pw_unit_test_MAIN}
-      ${arg_DEPS}
       ${arg_PRIVATE_DEPS}
     PRIVATE_INCLUDES
       ${arg_PRIVATE_INCLUDES}
     PRIVATE_DEFINES
-      ${arg_DEFINES}
       ${arg_PRIVATE_DEFINES}
     PRIVATE_COMPILE_OPTIONS
       ${arg_PRIVATE_COMPILE_OPTIONS}


package.json.cmake: use 0.10.x is the minimum version to compile

Note that if you compile a 0.12.x version it'll still have 0.10.x as a min req
but will likely not work with a 0.10.x interpreter

Signed-off-by: Brendan Le Foll <3e0e8c4069934e8b47d99704927a85c66c0ceb33@intel.com>

--- src/javascript/package.json.cmake
+++ src/javascript/package.json.cmake
@@ -5,7 +5,7 @@
   "homepage": "http://github.com/intel-iot-devkit/mraa",
   "main" : "./mraa.node",
   "engines": {
-    "node": ">= @NODE_VERSION_MAJOR@.@NODE_VERSION_MINOR@.x"
+    "node": ">= 0.10.x"
   },
   "bugs": {
     "url" : "http://github.com/intel-iot-devkit/mraa/issues"


Issue #21: Fix PCL CUDA config as it wasnt building CUDA at all.

--- CMake/ExternalProjects/PCL.cmake
+++ CMake/ExternalProjects/PCL.cmake
@@ -42,6 +42,27 @@
     )
   endif()

+  set(_cuda_options
+    -DBUILD_CUDA:BOOL=${MYPROJECT_USE_CUDA}
+    -DBUILD_GPU:BOOL=${MYPROJECT_USE_CUDA}
+  )
+  endif()
+  if(MYPROJECT_USE_CUDA)
+    list(APPEND _cuda_options
+      -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
+      -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
+      -DCUDA_NVCC_FLAGS:STRING=${MYPROJECT_CXX11_FLAG}
+      -DCUDA_PROPAGATE_HOST_FLAGS:BOOL=OFF
+      -DBUILD_gpu_tracking:BOOL=ON
+      -DBUILD_gpu_utils:BOOL=ON
+    )
+    if(NOT APPLE)
+      list(APPEND _cuda_options
+        -DBUILD_gpu_surface:BOOL=OFF # Can't compile this on OSX 10.10, CUDA 7.0, clang 6.0. Other platforms and versions may work.
+      )
+    endif()
+  endif()
+
   set(_build_static ON)
   if(BUILD_SHARED_LIBS)
     set(_build_static OFF)
@@ -78,9 +99,6 @@
       -DBUILD_apps:BOOL=OFF
       -DBUILD_tools:BOOL=ON
       -DBUILD_examples:BOOL=OFF
-      -DBUILD_CUDA:BOOL=${MYPROJECT_USE_CUDA}
-      -DCUDA_TOOLKIT_ROOT_DIR:PATH=${CUDA_TOOLKIT_ROOT_DIR}
-      -DCUDA_ARCH_BIN:STRING=${MYPROJECT_CUDA_ARCH_BIN}
       -DWITH_LIBUSB:BOOL=OFF    # On my Mac, this pulls in a dependency to /opt/local (MacPorts) which has the wrong version of boost.
       -DWITH_PNG:BOOL=OFF       # Same problem
       -DWITH_QHULL:BOOL=OFF     # Same problem
@@ -88,6 +106,7 @@
       -DWITH_OPENNI2:BOOL=OFF   # Same problem, but worse: For each device, PCL defaults this to TRUE, so FindX is always executed.
       -DWITH_PCAP:BOOL=OFF      # On my Mac, this is 32 bit, so barfs when linking 64 bit.
       ${_vtk_options}
+      ${_cuda_options}
     CMAKE_CACHE_ARGS
       ${EP_COMMON_CACHE_ARGS}
     CMAKE_CACHE_DEFAULT_ARGS


Small typo fixed, in case someone uncomments

--- cmake/externals/Qt.cmake
+++ cmake/externals/Qt.cmake
@@ -5,7 +5,7 @@

     set(default ON)
     if (WIN32)
-        #set(defaulf OFF)
+        #set(default OFF)
     endif()

     PackageInit(Qt Qt4 QT ${default})


Make it clearer what we use / don't use in Clang and Clang-Tidy.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -76,6 +76,8 @@
 function(CONFIGURE_CLANG_AND_CLANG_TIDY_SETTINGS TARGET)
   if(   "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
      OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
+    # The full list of diagnostic flags in Clang can be found at
+    # https://clang.llvm.org/docs/DiagnosticsReference.html
     set(COMPILE_OPTIONS
       -Weverything
       -Wno-c++98-compat
@@ -114,39 +116,65 @@
       set(HICPP_VARARG hicpp-vararg)
     endif()

+    # The full list of Clang-Tidy checks can be found at
+    # https://clang.llvm.org/extra/clang-tidy/checks/list.html
     set(CLANG_TIDY_WARNINGS
       -*
+#      abseil-*
+#      android-*
+#      boost-*
       bugprone-*
+#      cert-*
+      cppcoreguidelines-avoid-c-arrays
       cppcoreguidelines-avoid-goto
+#      cppcoreguidelines-avoid-magic-numbers
       cppcoreguidelines-c-copy-assignment-signature
+      cppcoreguidelines-explicit-virtual-functions
       cppcoreguidelines-interfaces-global-init
+      cppcoreguidelines-macro-usage
       cppcoreguidelines-narrowing-conversions
       cppcoreguidelines-no-malloc
-      cppcoreguidelines-pro-bounds-*
+      cppcoreguidelines-non-private-member-variables-in-classes
+#      cppcoreguidelines-owning-memory
+      cppcoreguidelines-pro-bounds-array-to-pointer-decay
+      cppcoreguidelines-pro-bounds-constant-array-index
+      cppcoreguidelines-pro-bounds-pointer-arithmetic
       cppcoreguidelines-pro-type-const-cast
       cppcoreguidelines-pro-type-cstyle-cast
       cppcoreguidelines-pro-type-member-init
+#      cppcoreguidelines-pro-type-reinterpret-cast
       cppcoreguidelines-pro-type-static-cast-downcast
       cppcoreguidelines-pro-type-union-access
       ${CPPCOREGUIDELINES_PRO_TYPE_VARARG}
+#      cppcoreguidelines-slicing
       ${CPPCOREGUIDELINES_SPECIAL_MEMBER_FUNCTIONS}
+#      fuchsia-default-arguments
       fuchsia-header-anon-namespaces
       fuchsia-multiple-inheritance
       fuchsia-overloaded-operator
       fuchsia-restrict-system-includes
+#      fuchsia-statically-constructed-objects
       fuchsia-trailing-return
       fuchsia-virtual-inheritance
-      google-build-*
+      google-build-explicit-make-pair
+      google-build-namespaces
+      google-build-using-namespace
       google-default-arguments
       google-explicit-constructor
       google-global-names-in-headers
-      google-objc-*
+      google-objc-avoid-throwing-exception
+      google-objc-function-naming
+      google-objc-global-variable-declaration
+      google-readability-avoid-underscore-in-googletest-name
       google-readability-braces-around-statements
       google-readability-casting
       google-readability-function-size
       google-readability-namespace-comments
+#      google-readability-todo
       google-runtime-int
       google-runtime-operator
+#      google-runtime-references
+      hicpp-avoid-c-arrays
       hicpp-avoid-goto
       hicpp-braces-around-statements
       hicpp-deprecated-headers
@@ -159,19 +187,74 @@
       hicpp-multiway-paths-covered
       hicpp-named-parameter
       hicpp-new-delete-operators
-      hicpp-no-*
+      hicpp-no-array-decay
+      hicpp-no-assembler
+      hicpp-no-malloc
       hicpp-noexcept-move
       hicpp-signed-bitwise
       ${HICPP_SPECIAL_MEMBER_FUNCTIONS}
       hicpp-static-assert
       hicpp-undelegated-constructor
-      hicpp-use-*
+      hicpp-uppercase-literal-suffix
+      hicpp-use-auto
+      hicpp-use-emplace
+      hicpp-use-equals-default
+      hicpp-use-equals-delete
+      hicpp-use-noexcept
+      hicpp-use-nullptr
+      hicpp-use-override
       ${HICPP_VARARG}
       llvm-*
-      misc-*
+      misc-definitions-in-headers
+      misc-misplaced-const
+      misc-new-delete-overloads
+      misc-non-copyable-objects
+#      misc-non-private-member-variables-in-classes
+      misc-redundant-expression
+      misc-static-assert
+      misc-throw-by-value-catch-by-reference
+      misc-unconventional-assign-operator
+      misc-uniqueptr-reset-release
+      misc-unused-alias-decls
+      misc-unused-parameters
+      misc-unused-using-decls
       modernize-*
+#      mpi-*
+#      objc-*
       performance-*
-      readability-*
+      readability-avoid-const-params-in-decls
+      readability-braces-around-statements
+      readability-const-return-type
+      readability-container-size-empty
+      readability-delete-null-pointer
+      readability-deleted-default
+      readability-else-after-return
+      readability-function-size
+      readability-identifier-naming
+      readability-implicit-bool-conversion
+      readability-inconsistent-declaration-parameter-name
+      readability-isolate-declaration
+#      readability-magic-numbers
+      readability-misleading-indentation
+      readability-misplaced-array-index
+      readability-named-parameter
+      readability-non-const-parameter
+      readability-redundant-control-flow
+      readability-redundant-declaration
+      readability-redundant-function-ptr-dereference
+      readability-redundant-member-init
+      readability-redundant-preprocessor
+      readability-redundant-smartptr-get
+      readability-redundant-string-cstr
+      readability-redundant-string-init
+      readability-simplify-boolean-expr
+      readability-simplify-subscript-expr
+      readability-static-accessed-through-instance
+      readability-static-definition-in-anonymous-namespace
+      readability-string-compare
+      readability-uniqueptr-delete-release
+      readability-uppercase-literal-suffix
+#      zircon-*
     )
     string(REPLACE ";" ","
            CLANG_TIDY_WARNINGS "${CLANG_TIDY_WARNINGS}")


cmake: cleanup dotnet.cmake

cmake: cleanup dotnet.cmake

--- cmake/dotnet.cmake
+++ cmake/dotnet.cmake
@@ -8,7 +8,7 @@

 # Will need swig
 set(CMAKE_SWIG_FLAGS)
-find_package(SWIG)
+find_package(SWIG REQUIRED)
 include(UseSWIG)

 #if(${SWIG_VERSION} VERSION_GREATER_EQUAL 4)
@@ -19,7 +19,7 @@
   list(APPEND CMAKE_SWIG_FLAGS "-DSWIGWORDSIZE64")
 endif()

-# Setup Dotnet
+# Find dotnet cli
 find_program(DOTNET_EXECUTABLE NAMES dotnet)
 if(NOT DOTNET_EXECUTABLE)
   message(FATAL_ERROR "Check for dotnet Program: not found")
@@ -67,6 +67,13 @@
 # note: macOS is APPLE and also UNIX !
 if(APPLE)
   set_target_properties(google-ortools-native PROPERTIES INSTALL_RPATH "@loader_path")
+  # Xcode fails to build if library doesn't contains at least one source file.
+  if(XCODE)
+    file(GENERATE
+      OUTPUT ${PROJECT_BINARY_DIR}/google-ortools-native/version.cpp
+      CONTENT "namespace {char* version = \"${PROJECT_VERSION}\";}")
+    target_sources(google-ortools-native PRIVATE ${PROJECT_BINARY_DIR}/google-ortools-native/version.cpp)
+  endif()
 elseif(UNIX)
   set_target_properties(google-ortools-native PROPERTIES INSTALL_RPATH "$ORIGIN")
 endif()
@@ -82,8 +89,9 @@
 endif()
 list(APPEND CMAKE_SWIG_FLAGS ${FLAGS} "-I${PROJECT_SOURCE_DIR}")

-# Swig wrap all libraries
-set(DOTNET_PROJECT Google.OrTools)
+# Needed by dotnet/CMakeLists.txt
+set(DOTNET_PACKAGE Google.OrTools)
+set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
 if(APPLE)
   set(RUNTIME_IDENTIFIER osx-x64)
 elseif(UNIX)
@@ -93,21 +101,22 @@
 else()
   message(FATAL_ERROR "Unsupported system !")
 endif()
-set(DOTNET_NATIVE_PROJECT ${DOTNET_PROJECT}.runtime.${RUNTIME_IDENTIFIER})
-
+set(DOTNET_NATIVE_PROJECT ${DOTNET_PACKAGE}.runtime.${RUNTIME_IDENTIFIER})
+set(DOTNET_PROJECT ${DOTNET_PACKAGE})
+
+# Swig wrap all libraries
 foreach(SUBPROJECT IN ITEMS algorithms graph init linear_solver constraint_solver sat util)
   add_subdirectory(ortools/${SUBPROJECT}/csharp)
   target_link_libraries(google-ortools-native PRIVATE dotnet_${SUBPROJECT})
 endforeach()

-############################
-##  .Net Runtime Package  ##
-############################
 file(COPY tools/doc/orLogo.png DESTINATION dotnet)
-set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
 set(DOTNET_LOGO_DIR "${PROJECT_BINARY_DIR}/dotnet")
 configure_file(ortools/dotnet/Directory.Build.props.in dotnet/Directory.Build.props)

+############################
+##  .Net SNK file  ##
+############################
 # Build or retrieve .snk file
 if(DEFINED ENV{DOTNET_SNK})
   add_custom_command(OUTPUT dotnet/or-tools.snk
@@ -132,40 +141,48 @@
     )
 endif()

-file(GENERATE OUTPUT dotnet/$<CONFIG>/replace_runtime.cmake
-  CONTENT
-  "FILE(READ ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.csproj.in input)
-STRING(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" input \"\${input}\")
-STRING(REPLACE \"@ortools@\" \"$<$<NOT:$<PLATFORM_ID:Windows>>:$<TARGET_SONAME_FILE:${PROJECT_NAME}>>\" input \"\${input}\")
-STRING(REPLACE \"@native@\" \"$<TARGET_FILE:google-ortools-native>\" input \"\${input}\")
-FILE(WRITE ${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.csproj \"\${input}\")"
+############################
+##  .Net Runtime Package  ##
+############################
+message(STATUS ".Net runtime project: ${DOTNET_NATIVE_PROJECT}")
+set(DOTNET_NATIVE_PATH ${PROJECT_BINARY_DIR}/dotnet/${DOTNET_NATIVE_PROJECT})
+message(STATUS ".Net runtime project build path: ${DOTNET_NATIVE_PATH}")
+
+# *.csproj.in contains:
+# CMake variable(s) (@PROJECT_NAME@) that configure_file() can manage and
+# generator expression ($<TARGET_FILE:...>) that file(GENERATE) can manage.
+configure_file(
+  ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PACKAGE}.runtime.csproj.in
+  ${DOTNET_NATIVE_PATH}/${DOTNET_NATIVE_PROJECT}.csproj.in
+  @ONLY)
+file(GENERATE
+  OUTPUT ${DOTNET_NATIVE_PATH}/$<CONFIG>/${DOTNET_NATIVE_PROJECT}.csproj.in
+  INPUT ${DOTNET_NATIVE_PATH}/${DOTNET_NATIVE_PROJECT}.csproj.in)
+
+add_custom_command(
+  OUTPUT ${DOTNET_NATIVE_PATH}/${DOTNET_NATIVE_PROJECT}.csproj
+  DEPENDS ${DOTNET_NATIVE_PATH}/$<CONFIG>/${DOTNET_NATIVE_PROJECT}.csproj.in
+  COMMAND ${CMAKE_COMMAND} -E copy ./$<CONFIG>/${DOTNET_NATIVE_PROJECT}.csproj.in ${DOTNET_NATIVE_PROJECT}.csproj
+  WORKING_DIRECTORY ${DOTNET_NATIVE_PATH}
 )

-add_custom_command(
-  OUTPUT dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.csproj
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${DOTNET_NATIVE_PROJECT}
-  COMMAND ${CMAKE_COMMAND} -P ./$<CONFIG>/replace_runtime.cmake
-  WORKING_DIRECTORY dotnet
-  )
-
-if(WIN32)
-add_custom_command(
-  OUTPUT dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${DOTNET_NATIVE_PROJECT}
-  COMMAND ${CMAKE_COMMAND} -E copy
-    ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
-    ${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
-  WORKING_DIRECTORY dotnet
-  )
-  set(DOTNET_TARGETS dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets)
-endif()
-
-add_custom_target(dotnet_native ALL
+#if(WIN32)
+#add_custom_command(
+#  OUTPUT dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
+#  COMMAND ${CMAKE_COMMAND} -E make_directory ${DOTNET_NATIVE_PROJECT}
+#  COMMAND ${CMAKE_COMMAND} -E copy
+#    ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
+#    ${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets
+#  WORKING_DIRECTORY dotnet
+#  )
+#  set(DOTNET_TARGETS dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.targets)
+#endif()
+
+add_custom_target(dotnet_native_package
   DEPENDS
     dotnet/or-tools.snk
     Dotnet${PROJECT_NAME}_proto
-    google-ortools-native
-    dotnet/${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.csproj
+    ${DOTNET_NATIVE_PATH}/${DOTNET_NATIVE_PROJECT}.csproj
     ${DOTNET_TARGETS}
   COMMAND ${CMAKE_COMMAND} -E make_directory packages
   COMMAND ${DOTNET_EXECUTABLE} build -c Release /p:Platform=x64 ${DOTNET_NATIVE_PROJECT}/${DOTNET_NATIVE_PROJECT}.csproj
@@ -174,33 +191,34 @@
     dotnet/${DOTNET_NATIVE_PROJECT}/bin
     dotnet/${DOTNET_NATIVE_PROJECT}/obj
   WORKING_DIRECTORY dotnet
-  )
+)
+add_dependencies(dotnet_native_package google-ortools-native)

 ####################
 ##  .Net Package  ##
 ####################
-file(GENERATE OUTPUT dotnet/$<CONFIG>/replace.cmake
-  CONTENT
-  "FILE(READ ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj.in input)
-STRING(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" input \"\${input}\")
-STRING(REPLACE \"@PROJECT_SOURCE_DIR@\" \"${PROJECT_SOURCE_DIR}\" input \"\${input}\")
-STRING(REPLACE \"@PROJECT_DOTNET_DIR@\" \"${PROJECT_BINARY_DIR}/dotnet\" input \"\${input}\")
-STRING(REPLACE \"@DOTNET_PACKAGES_DIR@\" \"${PROJECT_BINARY_DIR}/dotnet/packages\" input \"\${input}\")
-FILE(WRITE ${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj \"\${input}\")"
+message(STATUS ".Net project: ${DOTNET_PROJECT}")
+set(DOTNET_PATH ${PROJECT_BINARY_DIR}/dotnet/${DOTNET_PROJECT})
+message(STATUS ".Net project build path: ${DOTNET_PATH}")
+
+set(PROJECT_DOTNET_DIR ${PROJECT_BINARY_DIR}/dotnet)
+
+configure_file(
+  ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PROJECT}.csproj.in
+  ${DOTNET_PATH}/${DOTNET_PROJECT}.csproj.in
+  @ONLY)
+
+add_custom_command(
+  OUTPUT ${DOTNET_PATH}/${DOTNET_PROJECT}.csproj
+  DEPENDS ${DOTNET_PATH}/${DOTNET_PROJECT}.csproj.in
+  COMMAND ${CMAKE_COMMAND} -E copy ${DOTNET_PROJECT}.csproj.in ${DOTNET_PROJECT}.csproj
+  WORKING_DIRECTORY ${DOTNET_PATH}
 )
-
-add_custom_command(
-  OUTPUT dotnet/${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj
-  COMMAND ${CMAKE_COMMAND} -E make_directory ${DOTNET_PROJECT}
-  COMMAND ${CMAKE_COMMAND} -P ./$<CONFIG>/replace.cmake
-  WORKING_DIRECTORY dotnet
-  )

 add_custom_target(dotnet_package ALL
   DEPENDS
     dotnet/or-tools.snk
-    dotnet_native
-    dotnet/${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj
+    ${DOTNET_PATH}/${DOTNET_PROJECT}.csproj
   COMMAND ${DOTNET_EXECUTABLE} build -c Release /p:Platform=x64 ${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj
   COMMAND ${DOTNET_EXECUTABLE} pack -c Release ${DOTNET_PROJECT}/${DOTNET_PROJECT}.csproj
   BYPRODUCTS
@@ -208,52 +226,106 @@
     dotnet/${DOTNET_PROJECT}/obj
     dotnet/packages
   WORKING_DIRECTORY dotnet
-  )
-
+)
+add_dependencies(dotnet_package dotnet_native_package)
+
+#################
+##  .Net Test  ##
+#################
+# add_dotnet_test()
+# CMake function to generate and build dotnet test.
+# Parameters:
+#  the dotnet filename
+# e.g.:
+# add_dotnet_test(FooTests.cs)
+function(add_dotnet_test FILE_NAME)
+  message(STATUS "Configuring test ${FILE_NAME} ...")
+  get_filename_component(TEST_NAME ${FILE_NAME} NAME_WE)
+  get_filename_component(COMPONENT_DIR ${FILE_NAME} DIRECTORY)
+  get_filename_component(COMPONENT_NAME ${COMPONENT_DIR} NAME)
+
+  set(DOTNET_TEST_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${TEST_NAME})
+  message(STATUS "build path: ${DOTNET_TEST_PATH}")
+  file(MAKE_DIRECTORY ${DOTNET_TEST_PATH})
+
+  file(COPY ${FILE_NAME} DESTINATION ${DOTNET_TEST_PATH})
+
+  set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
+  configure_file(
+    ${PROJECT_SOURCE_DIR}/ortools/dotnet/Test.csproj.in
+    ${DOTNET_TEST_PATH}/${TEST_NAME}.csproj
+    @ONLY)
+
+  add_custom_target(dotnet_test_${TEST_NAME} ALL
+    DEPENDS ${DOTNET_TEST_PATH}/${TEST_NAME}.csproj
+    COMMAND ${DOTNET_EXECUTABLE} build -c Release
+    BYPRODUCTS
+      ${DOTNET_TEST_PATH}/bin
+      ${DOTNET_TEST_PATH}/obj
+    WORKING_DIRECTORY ${DOTNET_TEST_PATH})
+  add_dependencies(dotnet_test_${TEST_NAME} dotnet_package)
+
+  if(BUILD_TESTING)
+    add_test(
+      NAME dotnet_${COMPONENT_NAME}_${TEST_NAME}
+      COMMAND ${DOTNET_EXECUTABLE} test --no-build -c Release
+      WORKING_DIRECTORY ${DOTNET_TEST_PATH})
+  endif()
+
+  message(STATUS "Configuring test ${FILE_NAME} done")
+endfunction()
+
+###################
+##  .Net Sample  ##
+###################
 # add_dotnet_sample()
 # CMake function to generate and build dotnet sample.
 # Parameters:
 #  the dotnet filename
 # e.g.:
-# add_dotnet_sample(Foo.cs)
+# add_dotnet_sample(FooApp.cs)
 function(add_dotnet_sample FILE_NAME)
-  message(STATUS "Building ${FILE_NAME}: ...")
+  message(STATUS "Configuring sample ${FILE_NAME} ...")
   get_filename_component(SAMPLE_NAME ${FILE_NAME} NAME_WE)
   get_filename_component(SAMPLE_DIR ${FILE_NAME} DIRECTORY)
   get_filename_component(COMPONENT_DIR ${SAMPLE_DIR} DIRECTORY)
   get_filename_component(COMPONENT_NAME ${COMPONENT_DIR} NAME)

-  set(SAMPLE_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${SAMPLE_NAME})
-  file(MAKE_DIRECTORY ${SAMPLE_PATH})
-
-  file(COPY ${FILE_NAME} DESTINATION ${SAMPLE_PATH})
+  set(DOTNET_SAMPLE_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${SAMPLE_NAME})
+  message(STATUS "build path: ${DOTNET_SAMPLE_PATH}")
+  file(MAKE_DIRECTORY ${DOTNET_SAMPLE_PATH})
+
+  file(COPY ${FILE_NAME} DESTINATION ${DOTNET_SAMPLE_PATH})

   set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
   configure_file(
     ${PROJECT_SOURCE_DIR}/ortools/dotnet/Sample.csproj.in
-    ${SAMPLE_PATH}/${SAMPLE_NAME}.csproj
+    ${DOTNET_SAMPLE_PATH}/${SAMPLE_NAME}.csproj
     @ONLY)

   add_custom_target(dotnet_sample_${SAMPLE_NAME} ALL
-    DEPENDS ${SAMPLE_PATH}/${SAMPLE_NAME}.csproj
+    DEPENDS ${DOTNET_SAMPLE_PATH}/${SAMPLE_NAME}.csproj
     COMMAND ${DOTNET_EXECUTABLE} build -c Release
     COMMAND ${DOTNET_EXECUTABLE} pack -c Release
     BYPRODUCTS
-      ${SAMPLE_PATH}/bin
-      ${SAMPLE_PATH}/obj
-    WORKING_DIRECTORY ${SAMPLE_PATH})
+      ${DOTNET_SAMPLE_PATH}/bin
+      ${DOTNET_SAMPLE_PATH}/obj
+    WORKING_DIRECTORY ${DOTNET_SAMPLE_PATH})
   add_dependencies(dotnet_sample_${SAMPLE_NAME} dotnet_package)

   if(BUILD_TESTING)
     add_test(
       NAME dotnet_${COMPONENT_NAME}_${SAMPLE_NAME}
       COMMAND ${DOTNET_EXECUTABLE} run --no-build -c Release
-      WORKING_DIRECTORY ${SAMPLE_PATH})
+      WORKING_DIRECTORY ${DOTNET_SAMPLE_PATH})
   endif()

-  message(STATUS "Building ${FILE_NAME}: ...DONE")
+  message(STATUS "Configuring sample ${FILE_NAME} done")
 endfunction()

+####################
+##  .Net Example  ##
+####################
 # add_dotnet_example()
 # CMake function to generate and build dotnet example.
 # Parameters:
@@ -261,81 +333,41 @@
 # e.g.:
 # add_dotnet_example(Foo.cs)
 function(add_dotnet_example FILE_NAME)
-  message(STATUS "Building ${FILE_NAME}: ...")
+  message(STATUS "Configuring sample ${FILE_NAME} ...")
   get_filename_component(EXAMPLE_NAME ${FILE_NAME} NAME_WE)
   get_filename_component(COMPONENT_DIR ${FILE_NAME} DIRECTORY)
   get_filename_component(COMPONENT_NAME ${COMPONENT_DIR} NAME)

-  set(EXAMPLE_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${EXAMPLE_NAME})
-  file(MAKE_DIRECTORY ${EXAMPLE_PATH})
-
-  file(COPY ${FILE_NAME} DESTINATION ${EXAMPLE_PATH})
+  set(DOTNET_EXAMPLE_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${EXAMPLE_NAME})
+  message(STATUS "build path: ${DOTNET_EXAMPLE_PATH}")
+  file(MAKE_DIRECTORY ${DOTNET_EXAMPLE_PATH})
+
+  file(COPY ${FILE_NAME} DESTINATION ${DOTNET_EXAMPLE_PATH})

   set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
   set(SAMPLE_NAME ${EXAMPLE_NAME})
   configure_file(
     ${PROJECT_SOURCE_DIR}/ortools/dotnet/Sample.csproj.in
-    ${EXAMPLE_PATH}/${EXAMPLE_NAME}.csproj
+    ${DOTNET_EXAMPLE_PATH}/${EXAMPLE_NAME}.csproj
     @ONLY)

   add_custom_target(dotnet_example_${EXAMPLE_NAME} ALL
-    DEPENDS ${EXAMPLE_PATH}/${EXAMPLE_NAME}.csproj
+    DEPENDS ${DOTNET_EXAMPLE_PATH}/${EXAMPLE_NAME}.csproj
     COMMAND ${DOTNET_EXECUTABLE} build -c Release
     COMMAND ${DOTNET_EXECUTABLE} pack -c Release
     BYPRODUCTS
-      ${EXAMPLE_PATH}/bin
-      ${EXAMPLE_PATH}/obj
-    WORKING_DIRECTORY ${EXAMPLE_PATH})
+      ${DOTNET_EXAMPLE_PATH}/bin
+      ${DOTNET_EXAMPLE_PATH}/obj
+    WORKING_DIRECTORY ${DOTNET_EXAMPLE_PATH})
   add_dependencies(dotnet_example_${EXAMPLE_NAME} dotnet_package)

   if(BUILD_TESTING)
     add_test(
       NAME dotnet_${COMPONENT_NAME}_${EXAMPLE_NAME}
       COMMAND ${DOTNET_EXECUTABLE} run --no-build -c Release
-      WORKING_DIRECTORY ${EXAMPLE_PATH})
+      WORKING_DIRECTORY ${DOTNET_EXAMPLE_PATH})
   endif()

-  message(STATUS "Building ${FILE_NAME}: ...DONE")
+  message(STATUS "Configuring sample ${FILE_NAME} done")
 endfunction()

-# add_dotnet_test()
-# CMake function to generate and build dotnet test.
-# Parameters:
-#  the dotnet filename
-# e.g.:
-# add_dotnet_test(Foo.cs)
-function(add_dotnet_test FILE_NAME)
-  message(STATUS "Building ${FILE_NAME}: ...")
-  get_filename_component(TEST_NAME ${FILE_NAME} NAME_WE)
-  get_filename_component(COMPONENT_DIR ${FILE_NAME} DIRECTORY)
-  get_filename_component(COMPONENT_NAME ${COMPONENT_DIR} NAME)
-
-  set(TEST_PATH ${PROJECT_BINARY_DIR}/dotnet/${COMPONENT_NAME}/${TEST_NAME})
-  file(MAKE_DIRECTORY ${TEST_PATH})
-
-  file(COPY ${FILE_NAME} DESTINATION ${TEST_PATH})
-
-  set(DOTNET_PACKAGES_DIR "${PROJECT_BINARY_DIR}/dotnet/packages")
-  configure_file(
-    ${PROJECT_SOURCE_DIR}/ortools/dotnet/Test.csproj.in
-    ${TEST_PATH}/${TEST_NAME}.csproj
-    @ONLY)
-
-  add_custom_target(dotnet_sample_${TEST_NAME} ALL
-    DEPENDS ${TEST_PATH}/${TEST_NAME}.csproj
-    COMMAND ${DOTNET_EXECUTABLE} build -c Release
-    BYPRODUCTS
-      ${TEST_PATH}/bin
-      ${TEST_PATH}/obj
-    WORKING_DIRECTORY ${TEST_PATH})
-  add_dependencies(dotnet_sample_${TEST_NAME} dotnet_package)
-
-  if(BUILD_TESTING)
-    add_test(
-      NAME dotnet_${COMPONENT_NAME}_${TEST_NAME}
-      COMMAND ${DOTNET_EXECUTABLE} test --no-build -c Release
-      WORKING_DIRECTORY ${TEST_PATH})
-  endif()
-
-  message(STATUS "Building ${FILE_NAME}: ...DONE")
-endfunction()


Remove unused

Remove unused

--- sanitize_address.cmake
+++ sanitize_address.cmake
@@ -19,5 +19,3 @@
 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")

 include("${CMAKE_CURRENT_LIST_DIR}/flags/sanitize_address.cmake")
-
-set(HUNTER_DISABLE_SHARED_LIBS YES)


Added render tests to test suite

Added render tests to test suite

--- test/testing.cmake
+++ test/testing.cmake
@@ -21,6 +21,17 @@
 add_test(integrate integrate)
 add_test(qr_test qr)
 add_test(base64 base64)
+
+mpi_test(render 1
+  ./render
+  ${MESHES}/cube/cube.dmg
+  ${MESHES}/cube/pumi11/cube.smb
+  render_test)
+mpi_test(render_ascii 1
+  ./render
+  ${MESHES}/cube/cube.dmg
+  ${MESHES}/cube/pumi11/cube.smb
+  render_ascii_test)

 set(MDIR ${MESHES}/fun3d)
 mpi_test(inviscid_ugrid 1


Ignore tests that depend on PUMI when PUMI is not enabled

--- test/testing.cmake
+++ test/testing.cmake
@@ -23,61 +23,62 @@
 mpi_test(testMigration4 4
   ./testMigration)

-mpi_test(buildSerialMeshGraph32 1
-  ./buildMeshGraph
-  ${MESHES}/cube/cube.dmg
-  ${MESHES}/cube/pumi11/cube.smb
-  3
-  2)
+IF(ENABLE_PUMI)
+  mpi_test(buildSerialMeshGraph32 1
+    ./buildMeshGraph
+    ${MESHES}/cube/cube.dmg
+    ${MESHES}/cube/pumi11/cube.smb
+    3
+    2)

-mpi_test(buildSerialMeshGraph31 1
-  ./buildMeshGraph
-  "${MESHES}/cube/cube.dmg"
-  "${MESHES}/cube/pumi11/cube.smb"
-  3
-  1)
+  mpi_test(buildSerialMeshGraph31 1
+    ./buildMeshGraph
+    "${MESHES}/cube/cube.dmg"
+    "${MESHES}/cube/pumi11/cube.smb"
+    3
+    1)

-mpi_test(buildParallelMeshGraph32 2
-  ./buildMeshGraph
-  "${MESHES}/cube/cube.dmg"
-  "${MESHES}/cube/pumi670/2/cube.smb"
-  3
-  2)
+  mpi_test(buildParallelMeshGraph32 2
+    ./buildMeshGraph
+    "${MESHES}/cube/cube.dmg"
+    "${MESHES}/cube/pumi670/2/cube.smb"
+    3
+    2)

-mpi_test(buildParallelMeshGraph30 4
-  ./buildMeshGraph
-  "${MESHES}/torus/torus.dmg"
-  "${MESHES}/torus/4imb/torus.smb"
-  3
-  0)
+  mpi_test(buildParallelMeshGraph30 4
+    ./buildMeshGraph
+    "${MESHES}/torus/torus.dmg"
+    "${MESHES}/torus/4imb/torus.smb"
+    3
+    0)

-mpi_test(testFileIOSerial 1
-  ./testFileIO
-  ${MESHES}/cube/cube.dmg
-  ${MESHES}/cube/pumi670/cube.smb
-  ${GRAPHS}/cube/cube)
+  mpi_test(testFileIOSerial 1
+    ./testFileIO
+    ${MESHES}/cube/cube.dmg
+    ${MESHES}/cube/pumi670/cube.smb
+    ${GRAPHS}/cube/cube)

-mpi_test(testFileIOParallel 4
-  ./testFileIO
-  ${MESHES}/cube/cube.dmg
-  ${MESHES}/cube/pumi670/4/cube.smb
-  ${GRAPHS}/cube/4/)
+  mpi_test(testFileIOParallel 4
+    ./testFileIO
+    ${MESHES}/cube/cube.dmg
+    ${MESHES}/cube/pumi670/4/cube.smb
+    ${GRAPHS}/cube/4/)

-mpi_test(testFileIOParallelTorus 4
-  ./testFileIO
-  ${MESHES}/torus/torus.dmg
-  ${MESHES}/torus/4imb/torus.smb
-  ${GRAPHS}/torus/4/
-  0)
+  mpi_test(testFileIOParallelTorus 4
+    ./testFileIO
+    ${MESHES}/torus/torus.dmg
+    ${MESHES}/torus/4imb/torus.smb
+    ${GRAPHS}/torus/4/
+    0)

-mpi_test(testFileIOParallelTorus01 4
-  ./testFileIO
-  ${MESHES}/torus/torus.dmg
-  ${MESHES}/torus/4imb/torus.smb
-  ${GRAPHS}/torus/4_01/
-  0
-  1)
-
+  mpi_test(testFileIOParallelTorus01 4
+    ./testFileIO
+    ${MESHES}/torus/torus.dmg
+    ${MESHES}/torus/4imb/torus.smb
+    ${GRAPHS}/torus/4_01/
+    0
+    1)
+ENDIF()
 mpi_test(buildSerialBinaryRing 1
   ./buildBinaryGraph
   "${GRAPHS}/ring.ebin")


Also install libffi6 on Linux

Also install libffi6 on Linux

Modern Linux, such as Ubuntu 20.04, comes with libffi7 instead of
libffi6. Due to the mismatch, we should start installing libffi
as well, so that tomviz will actually run.

It might be nice to not use an absolute path to libffi at some
point...

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -111,6 +111,12 @@
     COMPONENT superbuild)
 endforeach()

+# Modern Linux (such as Ubuntu 20.04) comes with libffi7 instead of libffi6
+# For now, install libffi so it isn't missing.
+# FIXME: this hard-coded path may cause issues if we change build computers
+file(GLOB libffi_files "/usr/lib/x86_64-linux-gnu/libffi.so*")
+install(FILES ${libffi_files} DESTINATION "lib")
+
 add_test(GenerateTomvizPackage
         ${CMAKE_CPACK_COMMAND} -G TGZ
         WORKING_DIRECTORY ${Superbuild_BINARY_DIR})


Upload the 3.2 testing result to its own CDash project

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -4,14 +4,10 @@
 ## # The following are required to uses Dart and the Cdash dashboard
 ##   ENABLE_TESTING()
 ##   INCLUDE(CTest)
-set(CTEST_PROJECT_NAME "Eigen")
+set(CTEST_PROJECT_NAME "Eigen3.2")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "manao.inria.fr")
-set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Eigen3.2")
 set(CTEST_DROP_SITE_CDASH TRUE)
-set(CTEST_PROJECT_SUBPROJECTS
-Official
-Unsupported
-)


ENH: Bump OpenCV version to 4.5.1

ENH: Bump OpenCV version to 4.5.1

--- Superbuild/External-OpenCV.cmake
+++ Superbuild/External-OpenCV.cmake
@@ -2,7 +2,7 @@
 # Get and build OpenCV

 if( NOT OpenCV_TAG )
-  set( OpenCV_TAG "3.1.0" )
+  set( OpenCV_TAG "4.5.1" )
 endif()

 ExternalProject_Add(OpenCV


enh: FindMIRTK full license text, extend documentation, move code snippet

--- config/FindMIRTK.cmake
+++ config/FindMIRTK.cmake
@@ -15,7 +15,8 @@
 #
 # Result variables::
 #
-#   MIRTK_FOUND            - True if headers and requested libraries were found.
+#   MIRTK_FOUND            - True if headers and required components were found.
+#   MIRTK_<Module>_FOUND   - True if requested module was found.
 #   MIRTK_VERSION          - Version of found MIRTK libraries.
 #   MIRTK_VERSION_MAJOR    - Major version number of found MIRTK libraries.
 #   MIRTK_VERSION_MINOR    - Minor version number of found MIRTK libraries.
@@ -27,7 +28,7 @@
 #   MIRTK_MODULES_FOUND    - List of requested and found MIRTK modules.
 #   MIRTK_MODULES_NOTFOUND - List of not found optional MIRTK modules.
 #
-# By default, this module reads hints about search locations from variables::
+# By default, this module reads hints about search paths from variables::
 #
 #   DEPENDS_MIRTK_DIR - Either installation root or MIRTKConfig.cmake directory.
 #   MIRTK_DIR         - Directory containing the MIRTKConfig.cmake file.
@@ -76,15 +77,34 @@
 # Copyright 2016 Imperial College London
 # Copyright 2016 Andreas Schuh
 #
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+#   nor the names of their contributors may be used to endorse or promote
+#   products derived from this software without specific prior written
+#   permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)

 # Set MIRTKConfig.cmake directory from installation prefix path
 function (_mirtk_root_to_config_dir OUT IN)
@@ -213,7 +233,14 @@

 # Look for MIRTK installation
 if (NOT MIRTK_FIND_QUIETLY)
-  message(STATUS "Looking for MIRTK...")
+  set(_msg "Looking for MIRTK")
+  if (MIRTK_FIND_VERSION)
+    set(_msg "${_msg} ${MIRTK_FIND_VERSION}")
+  endif ()
+  if (MIRTK_FIND_COMPONENTS)
+    set(_msg "${_msg} [${MIRTK_FIND_COMPONENTS}]")
+  endif ()
+  message(STATUS "${_msg}...")
 endif ()

 set(_argv)
@@ -247,11 +274,6 @@
   else ()
     message(STATUS "Looking for MIRTK... - not found")
   endif ()
-endif ()
-
-if (NOT "^${_cache}$" STREQUAL "^MIRTK_DIR$")
-  set_property(CACHE MIRTK_DIR PROPERTY TYPE INTERNAL)
-  set(_MIRTK_DIR "${MIRTK_DIR}" CACHE INTERNAL "Previous MIRTK_DIR value" FORCE)
 endif ()

 # Make internal search path cache entries consistent with non-internal cache entry
@@ -261,6 +283,10 @@
 else ()
   mark_as_advanced(CLEAR ${_cache})
   set(_prefix NOTFOUND)
+endif ()
+if (NOT "^${_cache}$" STREQUAL "^MIRTK_DIR$")
+  set_property(CACHE MIRTK_DIR PROPERTY TYPE INTERNAL)
+  set(_MIRTK_DIR "${MIRTK_DIR}" CACHE INTERNAL "Previous MIRTK_DIR value" FORCE)
 endif ()
 get_property(_cached CACHE MIRTK_ROOT PROPERTY TYPE SET)
 if (_cached)
@@ -310,3 +336,4 @@
 unset(_cached)
 unset(_dir)
 unset(_var)
+unset(_msg)


Add source

Add source

--- cmake/Bin2H.cmake
+++ cmake/Bin2H.cmake
@@ -1,3 +1,7 @@
+#
+# From Sivachandran Paramasivam
+# http://www.sivachandran.in/2014/12/pure-cmake-based-bin2h-implementation.html
+#
 include(CMakeParseArguments)

 # Function to wrap a given string into multiple lines at the given column position.


Fix spdlog dependency warning

Fix spdlog dependency warning

spdlog 1.5 and 1.6 now require fmt 6.2.0, as of this commit:
https://github.com/conan-io/conan-center-index/pull/1651/commits/c19230f8ad6ae31a3699c4a66d90e29bad502ecb

--- cmake/Conan.cmake
+++ cmake/Conan.cmake
@@ -18,7 +18,7 @@
   ${CONAN_EXTRA_REQUIRES}
   catch2/2.11.0
   docopt.cpp/0.6.2
-  fmt/6.1.2
+  fmt/6.2.0
   spdlog/1.5.0
   OPTIONS
   ${CONAN_EXTRA_OPTIONS}


use clang-tidy-6.0 if available

use clang-tidy-6.0 if available

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -96,8 +96,11 @@

 # create clang-tidy-based target for static analysis
 function(setup_clang_tidy)
-        find_program(CLANG_TIDY_BIN NAMES clang-tidy-5.0 clang-tidy)
-        find_program(RUN_CLANG_TIDY_BIN NAMES run-clang-tidy-5.0.py run-clang-tidy.py HINTS /usr/share/clang/)
+        find_program(CLANG_TIDY_BIN NAMES
+                clang-tidy-6.0 clang-tidy-5.0 clang-tidy)
+
+        find_program(RUN_CLANG_TIDY_BIN NAMES
+                run-clang-tidy-6.0.py run-clang-tidy-5.0.py run-clang-tidy.py HINTS /usr/share/clang/)

         list(APPEND CLANG_TIDY_ARGS
                 ${RUN_CLANG_TIDY_BIN} -clang-tidy-binary ${CLANG_TIDY_BIN} -header-filter=.*/${PROJECT_NAME}/.*)


CMake: Propagate compilation flags to the dictionary generation

Compilation flags have to propagated to the dictionary generation,
especially the defines
	- general definitions, as set per project(Ex: ROOT -DWITHXML)
	- custom definition per library such as ALI_DATE

--- cmake/CMakeALICE.cmake
+++ cmake/CMakeALICE.cmake
@@ -24,6 +24,8 @@
 # @LDNAME LinkDef file name, ex: LinkDef.h
 # @DHDRS  Dictionary headers
 # @DINCDIR Include folders that need to be passed to cint/cling
+# @EXTRADEFINITIONS - optional, extra compile flags specific to library
+#       - used as ${ARGV4}
 macro(generate_dictionary DNAME LDNAME DHDRS DINCDIRS)

     # Creating the INCLUDE path for cint/cling
@@ -31,24 +33,21 @@
         set(INCLUDE_PATH -I${dir} ${INCLUDE_PATH})
     endforeach()

-    # Generate the dictionary
-#    message(STATUS "Generating dictionary ${DNAME} for ${LDNAME}")
-
-#    message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx")
-#    message(STATUS "${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h")
-#    message(STATUS "bbb${INCLUDE_PATH}bbb")
-#    message(STATUS "${DHDRS} ${LDNAME}")
-#    message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}")
-
-    # Get the definitions from the directory to be sent to CINT
-    get_directory_property(tmpdirdefs DEFINITIONS)
-    string(REPLACE " " ";" tmpdirdefs "${tmpdirdefs}")
+    # Get the list of definitions from the directory to be sent to CINT
+    get_directory_property(tmpdirdefs COMPILE_DEFINITIONS)
+    foreach(dirdef ${tmpdirdefs})
+        set(GLOBALDEFINITIONS -D${dirdef} ${GLOBALDEFINITIONS})
+    endforeach()
+
+    # Custom definitions specific to library
+    # Received as the forth optional argument
+    separate_arguments(EXTRADEFINITIONS UNIX_COMMAND "${ARGV4}")

     if (ROOT_VERSION_MAJOR LESS 6)
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h
                        COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_CINT}
                        ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx -c -p
-                       ${tmpdirdefs} ${INCLUDE_PATH}
+                       ${GLOBALDEFINITIONS} ${EXTRADEFINITIONS} ${INCLUDE_PATH}
                        ${DHDRS} ${LDNAME}
                        DEPENDS ${DHDRS} ${LDNAME} ${ROOT_CINT}
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -60,7 +59,7 @@
                        ARGS
                          -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx
                          -rmf ${CMAKE_CURRENT_BINARY_DIR}/lib${DNAME}.rootmap -rml lib${DNAME}
-                         ${tmpdirdefs} ${INCLUDE_PATH} ${DHDRS} ${LDNAME}
+                         ${GLOBALDEFINITIONS} ${EXTRADEFINITIONS}  ${INCLUDE_PATH} ${DHDRS} ${LDNAME}
                        DEPENDS
                          ${DHDRS} ${LDNAME} ${ROOT_CINT}
                        WORKING_DIRECTORY


Fix whitespaces

Fix whitespaces

--- cmake/CMakeALICE.cmake
+++ cmake/CMakeALICE.cmake
@@ -32,14 +32,14 @@
     foreach( dir ${DINCDIRS})
         set(INCLUDE_PATH -I${dir} ${INCLUDE_PATH})
     endforeach()
-
+
     # Get the list of definitions from the directory to be sent to CINT
     get_directory_property(tmpdirdefs COMPILE_DEFINITIONS)
     foreach(dirdef ${tmpdirdefs})
         string(REPLACE "\"" "\\\"" dirdef_esc ${dirdef})
         set(GLOBALDEFINITIONS -D${dirdef_esc} ${GLOBALDEFINITIONS})
     endforeach()
-
+
     # Custom definitions specific to library
     # Received as the forth optional argument
     separate_arguments(EXTRADEFINITIONS UNIX_COMMAND "${ARGV4}")
@@ -47,8 +47,8 @@
     if (ROOT_VERSION_MAJOR LESS 6)
     add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.h
                        COMMAND LD_LIBRARY_PATH=${ROOT_LIBDIR}:$ENV{LD_LIBRARY_PATH} ${ROOT_CINT}
-                       ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx -c -p
-                       ${GLOBALDEFINITIONS} ${EXTRADEFINITIONS} ${INCLUDE_PATH}
+                       ARGS -f ${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}.cxx -c -p
+                       ${GLOBALDEFINITIONS} ${EXTRADEFINITIONS} ${INCLUDE_PATH}
                        ${DHDRS} ${LDNAME}
                        DEPENDS ${DHDRS} ${LDNAME} ${ROOT_CINT}
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -69,7 +69,7 @@

     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${DNAME}.rootmap" DESTINATION lib)
     install(FILES "${CMAKE_CURRENT_BINARY_DIR}/G__${DNAME}_rdict.pcm" DESTINATION lib)
-
+
     endif (ROOT_VERSION_MAJOR LESS 6)

 endmacro(generate_dictionary)
@@ -122,7 +122,7 @@
     foreach(shared_lib ${shared_list})
         set(static_list_tmp ${static_list_tmp} "${shared_lib}-static")
     endforeach()
-
+
     # create the variable with the name received by the macro
     set(${static_list} ${static_list_tmp})
     # set the scope to parent in order to be visible in the parent
@@ -138,24 +138,24 @@
 macro(getDAdescription _detector _daname)
     # Reading the file into a string
     file(READ "${_detector}${_daname}da.cxx" tmpinfo)
-
+
     # Find the first occurance of /* */
     string(FIND "${tmpinfo}" "/*" _first_position)
     string(FIND "${tmpinfo}" "*/" _second_position)
-
+
     # Adding and removing 2 characters to remove /* */
     math(EXPR _first_position ${_first_position}+2)
     math(EXPR _second_position ${_second_position}-2)
-
+
     # Generating the length of the comment in order to take out the description
     math(EXPR _desc_length ${_second_position}-${_first_position})
-
+
     if(${_desc_length} EQUAL 0 OR ${_desc_length} LESS 0)
         message(FATAL_ERROR "{_detector}${_daname}da.cxx does not contain a description. Please add the description as the first /*comment*/ in the file")
     else()
         string(SUBSTRING "${tmpinfo}" ${_first_position}  ${_second_position} _da_description)
         string(STRIP "${_da_description}" _da_description)
-
+
         # The variable can be accesed by the parent
         set(RPM_DESCRIPTION ${_da_description})
     endif()
@@ -198,7 +198,7 @@

     # Installation
     install(TARGETS ${DETECTOR}${ALGORITHM}da.exe RUNTIME DESTINATION bin)
-
+
     if(DARPM)
         createDArpm("${DETECTOR}" "${ALGORITHM}")
     endif(DARPM)
@@ -212,7 +212,7 @@
     set(DETECTOR "${DETECTOR}")
     set(ALGORITHM "${ALGORITHM}")
     set(RPM_DESCRIPTION ${RPM_DESCRIPTION})
-
+
     if(ALGORITHM STREQUAL "")
         set(_ALGORITHM "none")
         set(DA_PREFIX "opt/daqDA-${DETECTOR}")
@@ -232,13 +232,13 @@
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} VERBATIM
                        COMMENT "RPM creation for ${DETECTOR}-${_ALGORITHM}"
     )
-
+
     # make clean will remove also the rpm folder
     # Retrive the current list of file to be deleted - set_directory_property is overwriting, not adding to the list
     get_directory_property(_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
     set(_clean_files da-${DETECTOR}${_ALGORITHM}-rpm  ${_clean_files})
     set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${_clean_files}")
-
+
     # install RPM into $CMAKE_INSTALL_PREFIX/darpms
     install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/da-${DETECTOR}${_ALGORITHM}-rpm/RPMS/ DESTINATION darpms PATTERN "\\.rpm")
 endmacro()


Fix source grouping when '..\' is part of the path.

--- cmake/CMakeUtils.cmake
+++ cmake/CMakeUtils.cmake
@@ -7,6 +7,7 @@
 		get_filename_component(_file_path "${_file}" PATH)
 		file(RELATIVE_PATH _file_path_rel "${_relative_directory}" "${_file_path}")
 		string(REPLACE "/" "\\" _group_path "${_file_path_rel}")
+		string(REPLACE "..\\" "" _group_path "${_group_path}")
 		source_group("${_group_path}" FILES "${_file}")
 	endforeach()
 endmacro()


FindEigen3.cmake: Add reading hints of Eigen directory location from environment variables EIGEN3_ROOT and EIGEN3_ROOT_DIR .

--- cmake/FindEigen3.cmake
+++ cmake/FindEigen3.cmake
@@ -9,6 +9,12 @@
 #  EIGEN3_FOUND - system has eigen lib with correct version
 #  EIGEN3_INCLUDE_DIR - the eigen include directory
 #  EIGEN3_VERSION - eigen version
+#
+# This module reads hints about search locations from
+# the following enviroment variables:
+#
+# EIGEN3_ROOT
+# EIGEN3_ROOT_DIR

 # Copyright (c) 2006, 2007 Montel Laurent, <montel@kde.org>
 # Copyright (c) 2008, 2009 Gael Guennebaud, <g.gael@free.fr>
@@ -62,6 +68,9 @@
 else (EIGEN3_INCLUDE_DIR)

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
+      HINTS
+      ENV EIGEN3_ROOT
+      ENV EIGEN3_ROOT_DIR
       PATHS
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}


Fix OS X build under the latest sc2api

Fix OS X build under the latest sc2api

--- cmake/FindSC2Api.cmake
+++ cmake/FindSC2Api.cmake
@@ -24,9 +24,11 @@
 # Find autogenerated Protobuf Api headers.
 find_path(SC2Api_Proto_INCLUDE_DIR
     NAMES
-        "sc2api.pb.h"
+        "s2clientprotocol/sc2api.pb.h"
     PATHS
-        "${SC2Api_INCLUDE_DIR}/sc2api/proto"
+        "/opt/local/include"
+        "/usr/local/include"
+        "/usr/include"
 )

 # Find Protobuf headers.
@@ -34,7 +36,7 @@
     NAMES
         "google/protobuf/stubs/common.h"
     PATHS
-        "${SC2Api_INCLUDE_DIR}/sc2api/contrib/protobuf/src"
+        "${SC2Api_INCLUDE_DIR}/sc2api"
 )

 # Put all the headers together.


PAR: preserve relative paths in PAR generation

Uses rsync. Problem triggered by the TTherminator module

--- cmake/GenParFile.cmake
+++ cmake/GenParFile.cmake
@@ -66,8 +66,9 @@

   # Target for creating PARfile (would stop after the first failed COMMAND)
   add_custom_target("${PARMODULE}.par"
-    COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && cp ${PARSOURCES} ${PARHEADERS} ${PARLINKDEF} ${PARDIR}/
+    COMMAND rsync --relative ${PARSOURCES} ${PARHEADERS} ${PARLINKDEF} ${PARDIR}/
     COMMAND tar -C ${PARDIR}/.. -czf ${PARDIR}/../${PARMODULE}.par ${PARMODULE}/
+    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
   )

 endmacro()


always use gtests tr1/tuple

always use gtests tr1/tuple

--- cmake/TestHelper.cmake
+++ cmake/TestHelper.cmake
@@ -12,6 +12,7 @@
     gtest160
     URL ${CMAKE_CURRENT_SOURCE_DIR}/build-common/vendor/gtest-1.6.0.tar.gz
     INSTALL_COMMAND ""
+    CMAKE_ARGS -DCMAKE_CXX_FLAGS=-DGTEST_USE_OWN_TR1_TUPLE=1
     BINARY_DIR ${GTEST_LIB_DIR}
     )
 ExternalProject_Get_Property(gtest160 source_dir)


facilitate the install folder

facilitate the install folder

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -98,9 +98,19 @@
   target_link_libraries(${NAME}_ectomodule
     ${ARGN}
   )
-  set_target_properties(${NAME}_ectomodule PROPERTIES
+  if (ecto_module_PYTHON_OUTPUT)
+    set_target_properties(${NAME}_ectomodule PROPERTIES
                         LIBRARY_OUTPUT_DIRECTORY ${ecto_module_PYTHON_OUTPUT}
-  )
+    )
+  else()
+    string(SUBSTRING ${NAME} 5 -1 CLEAN_NAME)
+
+    set(ecto_module_PYTHON_INSTALL ${PYTHON_PACKAGES_PATH}/${CLEAN_NAME}/ecto_cells)
+    set(ecto_module_PYTHON_OUTPUT ${CMAKE_BINARY_DIR}/gen/py/${CLEAN_NAME}/ecto_cells)
+    set_target_properties(${NAME}_ectomodule PROPERTIES
+                        LIBRARY_OUTPUT_DIRECTORY ${ecto_module_PYTHON_OUTPUT}
+    )
+  endif()
 endmacro()

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


cmake: Drop old deprecation warning

cmake: Drop old deprecation warning

Drop the old deprecation warning about
ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE. Sufficient time has passed to allow
users to migrate.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/extensions.cmake
+++ cmake/extensions.cmake
@@ -709,13 +709,6 @@
     ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_DIR
     ${USER_CACHE_DIR}/ToolchainCapabilityDatabase
     )
-  if(DEFINED ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE)
-    assert(0
-      "The deprecated ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE is now a directory"
-      "and is named ZEPHYR_TOOLCHAIN_CAPABILITY_CACHE_DIR"
-      )
-    # Remove this deprecation warning in version 1.14.
-  endif()

   # The toolchain capability database/cache is maintained as a
   # directory of files. The filenames in the directory are keys, and


The external qt device does not work well (qt_example hangs,
segfaults, and valgrind shows lots of memory management issues) when
dynamic devices are disabled so disable the external qt device for
that case.

svn path=/trunk/; revision=11661

--- cmake/modules/qt.cmake
+++ cmake/modules/qt.cmake
@@ -51,6 +51,17 @@
 # PYQT_SIP_DIR		  - sip system directory
 # PYQT_SIP_FLAGS	  - sip command flags

+# valgrind shows severe memory management problems with qt_example and
+# qt_example either segfaults or hangs when ENABLE_DYNDRIVERS is OFF.
+# I presume this is due to some linking issue for that case, but for
+# now disable PLD_extqt when ENABLE_DYNDRIVERS is OFF until someone can
+# investigate this issue further.
+
+if(PLD_extqt AND NOT ENABLE_DYNDRIVERS)
+  message(STATUS "WARNING: ENABLE_DYNDRIVERS is OFF so force PLD_extqt to be OFF")
+  set(PLD_extqt OFF CACHE BOOL "Enable Qt ext device" FORCE)
+endif(PLD_extqt AND NOT ENABLE_DYNDRIVERS)
+
 if(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt)
   set(ANY_QT_DEVICE ON)
 endif(PLD_bmpqt OR PLD_jpgqt OR PLD_pngqt OR PLD_ppmqt OR PLD_tiffqt OR PLD_epsqt OR PLD_pdfqt OR PLD_qtwidget OR PLD_svgqt OR PLD_extqt OR PLD_memqt)


CMake: Workaround Thrift symlink issue on Windows (#6060)

CMake doesn't support reading and therefore copying Windows symlinks.
A recent update to Thrift creates a symlink in its tutorial folder,
which makes the copy after patch process fail.
As a workaround we avoid copying the tutorial folder,
since we don't care about it anyway.

--- libraries/cmake/source/modules/utils.cmake
+++ libraries/cmake/source/modules/utils.cmake
@@ -58,7 +58,14 @@
   set(initializeGitSubmodule_IsAlreadyCloned FALSE PARENT_SCOPE)
 endfunction()

-function(patchSubmoduleSourceCode patches_dir source_dir apply_to_dir)
+function(patchSubmoduleSourceCode library_name patches_dir source_dir apply_to_dir)
+
+  # We need to "patch" Thrift by avoiding to copy its tutorial folder,
+  # because on Windows it contains a symlink that CMake is not able to copy.
+  if(DEFINED PLATFORM_WINDOWS AND "${library_name}" STREQUAL "thrift")
+    set(exclude_filter ".*/thrift/src/tutorial/.*")
+  endif()
+
   file(GLOB submodule_patches "${patches_dir}/*.patch")

   list(LENGTH submodule_patches patches_num)
@@ -89,7 +96,12 @@
   get_filename_component(parent_dir "${apply_to_dir}" DIRECTORY)

   file(MAKE_DIRECTORY "${parent_dir}")
-  file(COPY "${source_dir}" DESTINATION "${parent_dir}")
+
+  if(exclude_filter)
+    file(COPY "${source_dir}" DESTINATION "${parent_dir}" REGEX "${exclude_filter}" EXCLUDE)
+  else()
+    file(COPY "${source_dir}" DESTINATION "${parent_dir}")
+  endif()

   # We need to restore the source code to its original state, pre patch
   execute_process(
@@ -152,6 +164,7 @@

     if(NOT EXISTS "${patched_source_dir}")
       patchSubmoduleSourceCode(
+        "${ARGS_NAME}"
         "${directory_path}/patches/${submodule_to_patch}"
         "${directory_path}/${submodule_to_patch}"
         "${patched_source_dir}"


Revert accidental commit.

Revert accidental commit.

--- build_settings.cmake
+++ build_settings.cmake
@@ -20,7 +20,7 @@
 set(WARN_OPTS "-Wuninitialized -Werror -Wall -W -Wchar-subscripts -Wcomment -Wformat -Wparentheses -Wreturn-type -Wswitch -Wtrigraphs -Wunused -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings")

 # C and C++ compiler flags
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Og ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 ${WARN_OPTS} -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -DBOOST_DISABLE_ASSERTS -march=westmere -mtune=intel")

 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS} -Wnon-virtual-dtor -fvisibility-inlines-hidden -fdiagnostics-color=auto")


- Fix FindNativeLibraryDir.cmake, it was horribly wrong

--- cmake/Find/FindNativeLibraryDir.cmake
+++ cmake/Find/FindNativeLibraryDir.cmake
@@ -5,4 +5,6 @@
     ${CMAKE_SOURCE_DIR}/../native-library-bundle/
     )

-set ( NATIVE_LIBRARY_DIR ${NATIVE_LIBRARY_DIR_TMP} CACHE PATH "" )
+if(NATIVE_LIBRARY_DIR_TMP)
+    set ( NATIVE_LIBRARY_DIR ${NATIVE_LIBRARY_DIR_TMP} CACHE PATH "" )
+endif()


cmake: XercesTranscoderSelection: Correct typos in variable names breaking use of GNU iconv on Solaris

git-svn-id: 3ec853389310512053d525963cab269c063bb453@1819989 13f79535-47bb-0310-9956-ffa450edef68

--- cmake/XercesTranscoderSelection.cmake
+++ cmake/XercesTranscoderSelection.cmake
@@ -59,7 +59,7 @@
 set(gnuiconv_available 0)
 if(HAVE_ICONV_H AND HAVE_WCHAR_H AND HAVE_STRING_H AND HAVE_STDLIB_H AND
     HAVE_STDIO_H AND HAVE_CTYPE_H AND HAVE_LOCALE_H AND HAVE_ERRNO_H)
-  if (HAVE_ENDIAN_H OR HAVE_MACHINE/ENDIAN_H OR HAVE_ARPA/NAMESER_COMPAT_H)
+  if (HAVE_ENDIAN_H OR HAVE_MACHINE_ENDIAN_H OR HAVE_ARPA_NAMESER_COMPAT_H)
     if(HAVE_ICONV_OPEN AND HAVE_ICONV_CLOSE AND HAVE_ICONV)
       set(gnuiconv_available 1)
       list(APPEND transcoders gnuiconv)


Removed C++ 11 option. Use CMAKE_CXX_STANDARD instead

--- cmake/ilcsoft_default_cxx_flags.cmake
+++ cmake/ilcsoft_default_cxx_flags.cmake
@@ -30,20 +30,6 @@
   ENDIF()
 ENDFOREACH()

-OPTION( USE_CXX11 "Use CXX Standard 2011" True )
-IF( USE_CXX11 )
-  SET( FLAG "-std=c++11" )
-  SET( FLAG_WORD "stdCXX11" )
-  CHECK_CXX_COMPILER_FLAG( ${FLAG} CXX_FLAG_WORKS_${FLAG_WORD} )
-  IF( ${CXX_FLAG_WORKS_${FLAG_WORD}} )
-    SET( CMAKE_CXX_FLAGS "${FLAG} ${CMAKE_CXX_FLAGS}")
-  ELSE()
-    MESSAGE( FATAL_ERROR "Cannot add ${FLAG} to CMAKE_CXX_FLAGS, but c++11 was requested, check your compiler" )
-  ENDIF()
-ELSE()
-  MESSAGE( STATUS "NOT building with CXX11 standard" )
-ENDIF()
-
 IF( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9 )
   SET( CMAKE_CXX_FLAGS "-fdiagnostics-color=auto ${CMAKE_CXX_FLAGS}" )
 ENDIF()


Thrid part of the fix for ROOT-6194 to handle the windows case

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -384,7 +384,6 @@
 set(altf77 ${CMAKE_Fortran_COMPILER})
 set(altld ${CMAKE_CXX_COMPILER})
 set(pythonvers ${PYTHON_VERSION})
-get_filename_component(cxx ${CMAKE_CXX_COMPILER} NAME)

 #---RConfigure.h---------------------------------------------------------------------------------------------
 configure_file(${PROJECT_SOURCE_DIR}/config/RConfigure.in include/RConfigure.h)
@@ -471,16 +470,24 @@

 #---compiledata.h--------------------------------------------------------------------------------------------
+get_filename_component(_name ${CMAKE_CXX_COMPILER} NAME)
+get_filename_component(_path ${CMAKE_CXX_COMPILER} PATH)
+if("$ENV{PATH}" MATCHES ${_path})
+  set(cxx ${_name})
+else()
+  set(cxx ${CMAKE_CXX_COMPILER})
+endif()
+
 if(WIN32)
-  set(makecompiledata ${CMAKE_SOURCE_DIR}/build/win/compiledata.sh)
+  # We cannot use the compiledata.sh script for windows
+  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h)
 else()
-  set(makecompiledata ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh)
-endif()
-
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
-execute_process(COMMAND ${makecompiledata} include/compiledata.h "${cxx}" "" "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
-	   "${CMAKE_CXX_FLAGS}" "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_FLAGS}" "${LibSuffix}" "${SYSLIBS}"
-	   "${libdir}" "-lCore" "-Rint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
+  string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/build/unix/compiledata.sh include/compiledata.h "${cxx}" ""
+       "${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}"
+	     "${CMAKE_CXX_FLAGS}" "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_FLAGS}" "${LibSuffix}" "${SYSLIBS}"
+	     "${libdir}" "-lCore" "-Rint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "" "${explicitlink}" )
+endif()

 configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)


master-next: fix PR13574 for Linux

master-next: fix PR13574 for Linux

Set the deployment target to an empty string for non-Darwin platforms
so that it is safe to append to the target triple without guarding it
with a check for Darwin.

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -141,7 +141,7 @@
   set(SWIFT_SDK_${prefix}_PATH "${sdkpath}")
   set(SWIFT_SDK_${prefix}_VERSION "don't use")
   set(SWIFT_SDK_${prefix}_BUILD_NUMBER "don't use")
-  set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "don't use")
+  set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "")
   set(SWIFT_SDK_${prefix}_LIB_SUBDIR "${lib_subdir}")
   set(SWIFT_SDK_${prefix}_VERSION_MIN_NAME "")
   set(SWIFT_SDK_${prefix}_TRIPLE_NAME "${triple_name}")
@@ -171,7 +171,7 @@
   set(SWIFT_SDK_${prefix}_PATH "/")
   set(SWIFT_SDK_${prefix}_VERSION "NOTFOUND")
   set(SWIFT_SDK_${prefix}_BUILD_NUMBER "NOTFOUND")
-  set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "NOTFOUND")
+  set(SWIFT_SDK_${prefix}_DEPLOYMENT_VERSION "")
   set(SWIFT_SDK_${prefix}_LIB_SUBDIR "windows")
   set(SWIFT_SDK_${prefix}_VERSION_MIN_NAME "NOTFOUND")
   set(SWIFT_SDK_${prefix}_TRIPLE_NAME "Win32")


Use the native readline library on FreeBSD as well

--- cmake/Modules/FindReadline.cmake
+++ cmake/Modules/FindReadline.cmake
@@ -9,23 +9,37 @@

 # Apple readline does not support readline hooks
 # So we look for another one by default
-IF (APPLE)
+IF (APPLE OR FREEBSD)
   FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h PATHS
+    /usr/include/
     /sw/include
     /opt/local/include
     /opt/include
     /usr/local/include
-    /usr/include/
     NO_DEFAULT_PATH
     )
-ENDIF (APPLE)
+ENDIF (APPLE OR FREEBSD)
 FIND_PATH (READLINE_INCLUDE_DIR NAMES readline/readline.h)

 # Apple readline does not support readline hooks
 # So we look for another one by default
-IF (APPLE)
+IF (APPLE OR FREEBSD)
   FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline PATHS
+    /usr/lib
+    /sw/lib
+    /opt/local/lib
+    /opt/lib
+    /usr/local/lib
+    NO_DEFAULT_PATH
+    )
+ENDIF (APPLE OR FREEBSD)
+FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline)
+
+# Sometimes readline really needs ncurses
+IF (APPLE OR FREEBSD)
+  FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses PATHS
+    /usr/lib
     /sw/lib
     /opt/local/lib
     /opt/lib
@@ -33,20 +47,7 @@
     /usr/lib
     NO_DEFAULT_PATH
     )
-ENDIF (APPLE)
-FIND_LIBRARY (READLINE_readline_LIBRARY NAMES readline)
-
-# Sometimes readline really needs ncurses
-IF (APPLE)
-  FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses PATHS
-    /sw/lib
-    /opt/local/lib
-    /opt/lib
-    /usr/local/lib
-    /usr/lib
-    NO_DEFAULT_PATH
-    )
-ENDIF (APPLE)
+ENDIF (APPLE OR FREEBSD)
 FIND_LIBRARY (READLINE_ncurses_LIBRARY NAMES ncurses)

 MARK_AS_ADVANCED (


Bug 793368 - Install AppStream metadata to /usr/share/metainfo/

--- cmake/modules/FindIntltool.cmake
+++ cmake/modules/FindIntltool.cmake
@@ -39,7 +39,7 @@
 #
 # add_appdata_file(_infilename _outfilename)
 #    A shortcut to call intltool-merge() for an appdata file and install it
-#    to ${SHARE_INSTALL_PREFIX}/appdata
+#    to ${SHARE_INSTALL_PREFIX}/metainfo

 include(FindGettext)

@@ -204,6 +204,6 @@
 	add_dependencies(appdata-files appdata-${_outtarget})

 	install(FILES ${_out}
-		DESTINATION ${SHARE_INSTALL_PREFIX}/appdata
+		DESTINATION ${SHARE_INSTALL_PREFIX}/metainfo
 	)
 endmacro(add_appdata_file)


Add support for clang from XCode 8 in macOS

Since upgrading XCode to 8 (even in El Capitan), cmake has outputted an
unsupported compiler message:

  Unknown compiler.  Version info:

  Apple LLVM version 8.0.0 (clang-800.0.38)

  Target: x86_64-apple-darwin16.0.0

  Thread model: posix

  InstalledDir:
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

This is also the default version in the new macOS Sierra.
This patch fixes this by adding it to the list of supported
compilers.

Note that this patch, by itself, won't allow to fully compile Kudu in
macOS Sierra, as the current version of tcmalloc is incompatible:
https://github.com/gperftools/gperftools/issues/827

We need to wait until the issue above is fixed in order to fully support
building with the default toolchain in macOS Sierra. In the meanwhile this
patch is still valuable. It's still possible to build Kudu with the clang
toolchain we ship and CLion users can still use the default toolchain,
as long as they don't actually run the CLion build's binaries.

Were we to change to jemalloc, that issue is solved there:
https://github.com/jemalloc/jemalloc/pull/427

Change-Id: I74574fb80525c7b7545e2aaf9b220f63486a46b6
Reviewed-on: http://gerrit.cloudera.org:8080/4482
Reviewed-by: Dan Burkert <2591e5f46f28d303f9dc027d475a5c60d8dea17a@cloudera.com>
Tested-by: Kudu Jenkins

--- cmake_modules/CompilerInfo.cmake
+++ cmake_modules/CompilerInfo.cmake
@@ -37,6 +37,11 @@
   set(COMPILER_FAMILY "clang")
   set(COMPILER_VERSION "3.7.0svn")

+# clang on Mac OS X, XCode 8.
+elseif("${COMPILER_VERSION_FULL}" MATCHES ".*clang-8")
+  set(COMPILER_FAMILY "clang")
+  set(COMPILER_VERSION "3.8.0svn")
+
 # gcc
 elseif("${COMPILER_VERSION_FULL}" MATCHES ".*gcc version.*")
   set(COMPILER_FAMILY "gcc")


Remove unused CMakeMacroParseArguments.cmake file

ROOT now uses the builtin cmake_parse_arguments() function.

--- cmake/modules/CMakeMacroParseArguments.cmake
+++ cmake/modules/CMakeMacroParseArguments.cmake
@@ -1,95 +0,0 @@
-# Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.
-# All rights reserved.
-#
-# For the licensing terms see $ROOTSYS/LICENSE.
-# For the list of contributors see $ROOTSYS/README/CREDITS.
-
-# This file defines the following macro for developers needing to parse
-# arguments passed to a CMake macro using names.
-#
-# PARSE_ARGUMENTS           - parse arguments supplied to a macro
-#
-# The PARSE_ARGUMENTS macro will take the arguments of another macro and define
-# several variables. The first argument to PARSE_ARGUMENTS is a prefix to put
-# on all variables it creates. The second argument is a list of names, and the
-# third argument is a list of options. Both of these lists should be quoted.
-# The rest of PARSE_ARGUMENTS are arguments from another macro to be parsed.
-#
-#    PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...)
-#
-# For each item in options, PARSE_ARGUMENTS will create a variable with that
-# name, prefixed with prefix_. So, for example, if prefix is MY_MACRO and
-# options is OPTION1;OPTION2, then PARSE_ARGUMENTS will create the variables
-# MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These variables will be set to true
-# if the option exists in the command line or false otherwise.
-#
-# For each item in arg_names, PARSE_ARGUMENTS will create a variable with that
-# name, prefixed with prefix_. Each variable will be filled with the arguments
-# that occur after the given arg_name is encountered up to the next arg_name
-# or the end of the arguments. All options are removed from these lists.
-# PARSE_ARGUMENTS also creates a prefix_DEFAULT_ARGS variable containing the
-# list of all arguments up to the first arg_name encountered.
-#
-# Here is a simple, albeit impractical, example of using PARSE_ARGUMENTS that
-# demonstrates its behavior.
-#
-# SET(arguments
-#   hello OPTION3 world
-#   LIST3 foo bar
-#   OPTION2
-#   LIST1 fuz baz
-#   )
-# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "OPTION1;OPTION2;OPTION3" ${arguments})
-#
-# PARSE_ARGUMENTS creates 7 variables and sets them as follows:
-#
-#    * ARG_DEFAULT_ARGS: hello;world
-#    * ARG_LIST1: fuz;baz
-#    * ARG_LIST2:
-#    * ARG_LIST3: foo;bar
-#    * ARG_OPTION1: FALSE
-#    * ARG_OPTION2: TRUE
-#    * ARG_OPTION3: TRUE
-#
-# If you don't have any options, use an empty string in its place.
-#
-# PARSE_ARGUMENTS(ARG "LIST1;LIST2;LIST3" "" ${arguments})
-#
-# Likewise if you have no lists.
-#
-# PARSE_ARGUMENTS(ARG "" "OPTION1;OPTION2;OPTION3" ${arguments})
-#
-#
-# Code and description copied from:
-#   http://www.cmake.org/Wiki/CMakeMacroParseArguments
-
-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
-  SET(DEFAULT_ARGS)
-  FOREACH(arg_name ${arg_names})
-    SET(${prefix}_${arg_name})
-  ENDFOREACH(arg_name)
-  FOREACH(option ${option_names})
-    SET(${prefix}_${option} FALSE)
-  ENDFOREACH(option)
-
-  SET(current_arg_name DEFAULT_ARGS)
-  SET(current_arg_list)
-  FOREACH(arg ${ARGN})
-    SET(larg_names ${arg_names})
-    LIST(FIND larg_names "${arg}" is_arg_name)
-    IF (is_arg_name GREATER -1)
-      SET(${prefix}_${current_arg_name} ${current_arg_list})
-      SET(current_arg_name ${arg})
-      SET(current_arg_list)
-    ELSE (is_arg_name GREATER -1)
-      SET(loption_names ${option_names})
-      LIST(FIND loption_names "${arg}" is_option)
-      IF (is_option GREATER -1)
-        SET(${prefix}_${arg} TRUE)
-      ELSE (is_option GREATER -1)
-        SET(current_arg_list ${current_arg_list} ${arg})
-      ENDIF (is_option GREATER -1)
-    ENDIF (is_arg_name GREATER -1)
-  ENDFOREACH(arg)
-  SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)


Squashed 'CMakeModules/' changes from 2979d55..ebfa49d

ebfa49d Merge pull request #1 from arpg/private_linkage
40245bc Makes def_library link privately.

git-subtree-dir: CMakeModules
git-subtree-split: ebfa49d8c26ef31a783425596febca3f457820ec

--- def_library.cmake
+++ def_library.cmake
@@ -2,7 +2,7 @@
 include(SetSourceFlags)

 function(def_library lib)
-
+
   string(TOUPPER ${lib} LIB)

   set(LIB_OPTIONS)
@@ -62,11 +62,11 @@
     endif()

     if(lib_DEPENDS)
-      target_link_libraries(${lib} ${lib_DEPENDS})
+      target_link_libraries(${lib} PRIVATE ${lib_DEPENDS})
     endif()

     if(lib_LINK_LIBS)
-      target_link_libraries(${lib} ${lib_LINK_LIBS})
+      target_link_libraries(${lib} PRIVATE ${lib_LINK_LIBS})
     endif()

     if(ANDROID)
@@ -75,7 +75,7 @@
       if(NOT GNUSTL_SHARED_LIBRARY)
 	message(FATAL_ERROR "Could not find required GNU STL shared library.")
       endif()
-      target_link_libraries(${lib} log android z -pthread ${GNUSTL_SHARED_LIBRARY})
+      target_link_libraries(${lib} PRIVATE log android z -pthread ${GNUSTL_SHARED_LIBRARY})
     endif()

     if(lib_PACKAGE)


build: make SPIDERMONKEY_ROOT take precedence over the default paths

--- CMakeModules/FindSpidermonkey.cmake
+++ CMakeModules/FindSpidermonkey.cmake
@@ -38,13 +38,22 @@
 FIND_PATH(
     SPIDERMONKEY_INCLUDE_DIR
     js/jsapi.h
-    PATHS "${SPIDERMONKEY_ROOT}/include")
+    PATHS "${SPIDERMONKEY_ROOT}/include"
+    NO_DEFAULT_PATH)
+
+FIND_PATH(
+    SPIDERMONKEY_INCLUDE_DIR
+    js/jsapi.h)

 FIND_LIBRARY(
     SPIDERMONKEY_LIBRARY
     NAMES js mozjs js32
     PATHS "${SPIDERMONKEY_ROOT}/lib"
-    DOC "Spidermonkey library")
+    NO_DEFAULT_PATH)
+
+FIND_LIBRARY(
+    SPIDERMONKEY_LIBRARY
+    NAMES js mozjs js32)

 SET(SPIDERMONKEY_LIBRARIES ${SPIDERMONKEY_LIBRARY})


Added configuration options for android SDK Now activating JAVA_DEBUG only for CMake Debug configuration by default.

--- cmake/ConfigOptionsAndroid.cmake
+++ cmake/ConfigOptionsAndroid.cmake
@@ -15,6 +15,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.

+set(JAVA_DEBUG_DEFAULT "off")
+if("${CMAKE_BUILD_TYPE STREQUAL "Debug")
+	set(JAVA_DEBUG_DEFAULT "on")
+endif()
+
 option(WITH_DEBUG_ANDROID_JNI "Enable debug output for android jni bindings" ${DEFAULT_DEBUG_OPTION})
 option(ANDROID_BUILD_JAVA "Automatically android java code - build type depends on CMAKE_BUILD_TYPE" ON)
-option(ANDROID_BUILD_JAVA_DEBUG "Create a android debug package" ON)
+option(ANDROID_BUILD_JAVA_DEBUG "Create a android debug package" ${JAVA_DEBUG_DEFAULT})
+
+set(ANDROID_APP_TARGET_SDK 11 CACHE STRING "Application target android SDK")
+set(ANDROID_APP_MIN_SDK 8 CACHE STRING "Application minimum android SDK requirement")
+set(ANDROID_APP_GOOGLE_TARGET_SDK "16" CACHE STRING "Application target google SDK")
+


ci: speed up publish-docs build (#7657)

ci: speed up publish-docs build (#7657)

Do not scan the `*.cc` files for Doxygen comments. I searched, and the
existing Doxygen comments for such files are in files excluded for other
reasons (tests, internal symbols, etc.)  This reduced the build time
from 440s to 270s.

--- cmake/GoogleCloudCppCommon.cmake
+++ cmake/GoogleCloudCppCommon.cmake
@@ -39,7 +39,7 @@
 elseif (GOOGLE_CLOUD_CPP_GENERATE_DOXYGEN)
     find_package(Doxygen REQUIRED)
     set(DOXYGEN_RECURSIVE NO)
-    set(DOXYGEN_FILE_PATTERNS *.h *.cc *.dox)
+    set(DOXYGEN_FILE_PATTERNS *.h *.dox)
     set(DOXYGEN_EXCLUDE_PATTERNS "*_test.cc" "retry_traits.h")
     set(DOXYGEN_EXAMPLE_RECURSIVE NO)
     set(DOXYGEN_EXCLUDE_SYMLINKS YES)