Updated cmake/FindOpenVDB.cmake to support finding pyopenvdb and openvdb_houdini

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindOpenVDB.cmake
+++ cmake/FindOpenVDB.cmake
@@ -14,7 +14,9 @@
     [version] [EXACT]      # Minimum or EXACT version
     [REQUIRED]             # Fail with error if OpenVDB is not found
     [COMPONENTS <libs>...] # OpenVDB libraries by their canonical name
-                           # e.g. "openvdb" for "libopenvdb"
+                           # e.g. "openvdb" for "libopenvdb",
+                           # "pyopenvdb" for the python plugin
+                           # "openvdb_houdini" for the houdini plugin
     )

 IMPORTED Targets
@@ -22,6 +24,10 @@

 ``OpenVDB::openvdb``
   The core openvdb library target.
+``OpenVDB::pyopenvdb``
+  The openvdb python library target.
+``OpenVDB::openvdb_houdini``
+  The openvdb houdini library target.

 Result Variables
 ^^^^^^^^^^^^^^^^
@@ -40,7 +46,7 @@
   OpenVDB library directories.
 ``OpenVDB_DEFINITIONS``
   Definitions to use when compiling code that uses OpenVDB.
-``OpenVDB_{COMPONENT}_FOUND``
+``OpenVDB_${COMPONENT}_FOUND``
   True if the system has the named OpenVDB component.
 ``OpenVDB_USES_BLOSC``
   True if the OpenVDB Library has been built with blosc support
@@ -59,7 +65,9 @@

 ``OpenVDB_INCLUDE_DIR``
   The directory containing ``openvdb/version.h``.
-``OpenVDB_{COMPONENT}_LIBRARY``
+``OpenVDB_${COMPONENT}_INCLUDE_DIR``
+  Individual component include directories for OpenVDB
+``OpenVDB_${COMPONENT}_LIBRARY``
   Individual component libraries for OpenVDB

 Hints
@@ -74,6 +82,12 @@
   Preferred include directory e.g. <prefix>/include
 ``OPENVDB_LIBRARYDIR``
   Preferred library directory e.g. <prefix>/lib
+``OPENVDB_${COMPONENT}_ROOT``
+  Preferred installation prefix of a specific component.
+``OPENVDB_${COMPONENT}_INCLUDEDIR``
+  Preferred include directory of a specific component e.g. <prefix>/include
+``OPENVDB_${COMPONENT}_LIBRARYDIR``
+  Preferred library directory of a specific component e.g. <prefix>/lib
 ``SYSTEM_LIBRARY_PATHS``
   Global list of library paths intended to be searched by and find_xxx call
 ``OPENVDB_USE_STATIC_LIBS``
@@ -106,6 +120,8 @@

 set(_OPENVDB_COMPONENT_LIST
   openvdb
+  pyopenvdb
+  openvdb_houdini
 )

 if(OpenVDB_FIND_COMPONENTS)
@@ -126,7 +142,14 @@
   endif()
 else()
   set(OPENVDB_COMPONENTS_PROVIDED FALSE)
-  set(OpenVDB_FIND_COMPONENTS ${_OPENVDB_COMPONENT_LIST})
+  set(OpenVDB_FIND_COMPONENTS openvdb)
+endif()
+
+# always make sure openvdb is picked up as a component i.e.
+# find_package(OpenVDB COMPONENTS pyopenvdb) results in both
+# openvdb and pyopenvdb targets
+if(NOT openvdb IN_LIST OpenVDB_FIND_COMPONENTS)
+  list(APPEND OpenVDB_FIND_COMPONENTS openvdb)
 endif()

 # Set _OPENVDB_ROOT based on a user provided root var. Xxx_ROOT and ENV{Xxx_ROOT}
@@ -191,12 +214,52 @@
   ${SYSTEM_LIBRARY_PATHS}
 )

-# Look for a standard OpenVDB header file.
-find_path(OpenVDB_INCLUDE_DIR openvdb/version.h
-  ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
-  PATHS ${_OPENVDB_INCLUDE_SEARCH_DIRS}
-  PATH_SUFFIXES ${CMAKE_INSTALL_INCLUDEDIR} include
-)
+foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
+  # Add in extra component paths
+  set(_VDB_COMPONENT_SEARCH_DIRS ${_OPENVDB_INCLUDE_SEARCH_DIRS})
+  list(APPEND _VDB_COMPONENT_SEARCH_DIRS
+    ${OPENVDB_${COMPONENT}_ROOT}
+    ${OPENVDB_${COMPONENT}_INCLUDEDIR}
+  )
+  list(REMOVE_DUPLICATES _VDB_COMPONENT_SEARCH_DIRS)
+
+  # Look for a standard header files.
+  if(${COMPONENT} STREQUAL "openvdb")
+    # Look for a standard OpenVDB header file.
+    find_path(OpenVDB_${COMPONENT}_INCLUDE_DIR openvdb/version.h
+      ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
+      PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
+      PATH_SUFFIXES
+        ${CMAKE_INSTALL_INCLUDEDIR}
+        include
+    )
+  elseif(${COMPONENT} STREQUAL "pyopenvdb")
+    find_path(OpenVDB_${COMPONENT}_INCLUDE_DIR pyopenvdb.h
+      ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
+      PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
+      PATH_SUFFIXES
+        ${CMAKE_INSTALL_INCLUDEDIR}/openvdb/python
+        ${CMAKE_INSTALL_INCLUDEDIR}/openvdb
+        ${CMAKE_INSTALL_INCLUDEDIR}
+        include
+    )
+  elseif(${COMPONENT} STREQUAL "openvdb_houdini")
+    # @note  Expects both houdini_utils and openvdb_houdini folders
+    #   to be located in the same place
+    find_path(OpenVDB_${COMPONENT}_INCLUDE_DIR openvdb_houdini/SOP_NodeVDB.h
+      ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
+      PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
+      PATH_SUFFIXES
+        ${CMAKE_INSTALL_INCLUDEDIR}/openvdb
+        ${CMAKE_INSTALL_INCLUDEDIR}
+        include
+    )
+  endif()
+  unset(_VDB_COMPONENT_SEARCH_DIRS)
+endforeach()
+
+set(OpenVDB_INCLUDE_DIR ${OpenVDB_openvdb_INCLUDE_DIR}
+  CACHE PATH "The OpenVDB core include directory")

 OPENVDB_VERSION_FROM_HEADER("${OpenVDB_INCLUDE_DIR}/openvdb/version.h"
   VERSION OpenVDB_VERSION
@@ -224,6 +287,28 @@

 set(_OPENVDB_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})

+set(OPENVDB_PYTHON_PATH_SUFFIXES
+  ${CMAKE_INSTALL_LIBDIR}/python
+  ${CMAKE_INSTALL_LIBDIR}/python2.7
+  ${CMAKE_INSTALL_LIBDIR}/python3
+  lib64/python
+  lib64/python2.7
+  lib64/python3
+  lib/python
+  lib/python2.7
+  lib/python3
+)
+
+set(OPENVDB_LIB_PATH_SUFFIXES
+  ${CMAKE_INSTALL_LIBDIR}
+  lib64
+  lib
+)
+
+list(REMOVE_DUPLICATES OPENVDB_PYTHON_PATH_SUFFIXES)
+list(REMOVE_DUPLICATES OPENVDB_LIB_PATH_SUFFIXES)
+
+# Static library setup
 if(WIN32)
   if(OPENVDB_USE_STATIC_LIBS)
     set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
@@ -238,11 +323,31 @@

 foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
   set(LIB_NAME ${COMPONENT})
-  find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
-    ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
-    PATHS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS}
-    PATH_SUFFIXES ${CMAKE_INSTALL_LIBDIR} lib64 lib
-  )
+
+  # Add in extra component paths
+  set(_VDB_COMPONENT_SEARCH_DIRS ${_OPENVDB_LIBRARYDIR_SEARCH_DIRS})
+  list(APPEND _VDB_COMPONENT_SEARCH_DIRS
+    ${OPENVDB_${COMPONENT}_ROOT}
+    ${OPENVDB_${COMPONENT}_LIBRARYDIR}
+  )
+
+  if(${COMPONENT} STREQUAL "pyopenvdb")
+    set(_OPENVDB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
+    set(CMAKE_FIND_LIBRARY_PREFIXES ";lib") # find non-prefixed
+    find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
+      ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
+      PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
+      PATH_SUFFIXES ${OPENVDB_PYTHON_PATH_SUFFIXES}
+    )
+    set(CMAKE_FIND_LIBRARY_PREFIXES ${_OPENVDB_ORIG_CMAKE_FIND_LIBRARY_PREFIXES})
+  else()
+    find_library(OpenVDB_${COMPONENT}_LIBRARY ${LIB_NAME}
+      ${_FIND_OPENVDB_ADDITIONAL_OPTIONS}
+      PATHS ${_VDB_COMPONENT_SEARCH_DIRS}
+      PATH_SUFFIXES ${OPENVDB_LIB_PATH_SUFFIXES}
+    )
+  endif()
+
   list(APPEND OpenVDB_LIB_COMPONENTS ${OpenVDB_${COMPONENT}_LIBRARY})

   if(OpenVDB_${COMPONENT}_LIBRARY)
@@ -250,7 +355,11 @@
   else()
     set(OpenVDB_${COMPONENT}_FOUND FALSE)
   endif()
+  unset(_VDB_COMPONENT_SEARCH_DIRS)
 endforeach()
+
+unset(OPENVDB_PYTHON_PATH_SUFFIXES)
+unset(OPENVDB_LIB_PATH_SUFFIXES)

 # Reset library suffix

@@ -306,6 +415,12 @@
 #  Handle OpenVDB dependencies and interface settings
 # ------------------------------------------------------------------------

+# Handle openvdb_houdini first to configure search paths
+
+if(openvdb_houdini IN_LIST OpenVDB_FIND_COMPONENTS)
+  include(OpenVDBHoudiniSetup)
+endif()
+
 # Add standard dependencies

 find_package(IlmBase REQUIRED COMPONENTS Half)
@@ -323,6 +438,37 @@

 find_package(Boost REQUIRED COMPONENTS iostreams system)

+# Add deps for pyopenvdb
+# @todo track for numpy
+
+if(pyopenvdb IN_LIST OpenVDB_FIND_COMPONENTS)
+  find_package(PythonLibs REQUIRED)
+
+  # Boost python handling - try and find both python and pythonXx (version suffixed).
+  # Prioritize the version suffixed library, failing if neither exist.
+
+  find_package(Boost ${MINIMUM_BOOST_VERSION}
+    QUIET COMPONENTS python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}
+  )
+
+  if(TARGET Boost::python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR})
+    set(BOOST_PYTHON_LIB "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
+    message(STATUS "Found boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
+  else()
+    find_package(Boost ${MINIMUM_BOOST_VERSION} QUIET COMPONENTS python)
+    if(TARGET Boost::python)
+      set(BOOST_PYTHON_LIB "python")
+      message(STATUS "Found non-suffixed boost_python, assuming to be python version "
+        "\"${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}\" compatible"
+      )
+    else()
+      message(FATAL_ERROR "Unable to find boost_python or "
+        "boost_python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}."
+      )
+    endif()
+  endif()
+endif()
+
 # As the way we resolve optional libraries relies on library file names, use
 # the configuration options from the main CMakeLists.txt to allow users
 # to manually identify the requirements of OpenVDB builds if they know them.
@@ -465,7 +611,7 @@
 endif()

 # ------------------------------------------------------------------------
-#  Configure imported target
+#  Configure imported targets
 # ------------------------------------------------------------------------

 set(OpenVDB_LIBRARIES ${OpenVDB_LIB_COMPONENTS})
@@ -478,37 +624,62 @@
 endforeach()
 list(REMOVE_DUPLICATES OpenVDB_LIBRARY_DIRS)

-foreach(COMPONENT ${OpenVDB_FIND_COMPONENTS})
-  # Configure lib type. If XXX_USE_STATIC_LIBS, we always assume a static
-  # lib is in use. If win32, we can't mark the import .libs as shared, so
-  # these are always marked as UNKNOWN. Otherwise, infer from extension.
-  set(OPENVDB_${COMPONENT}_LIB_TYPE UNKNOWN)
+# OpenVDB::openvdb
+
+if(NOT TARGET OpenVDB::openvdb)
+  set(OPENVDB_openvdb_LIB_TYPE UNKNOWN)
   if(OPENVDB_USE_STATIC_LIBS)
-    set(OPENVDB_${COMPONENT}_LIB_TYPE STATIC)
+    set(OPENVDB_openvdb_LIB_TYPE STATIC)
   elseif(UNIX)
-    get_filename_component(_OPENVDB_${COMPONENT}_EXT
-      ${OpenVDB_${COMPONENT}_LIBRARY} EXT)
-    if(_OPENVDB_${COMPONENT}_EXT STREQUAL ".a")
-      set(OPENVDB_${COMPONENT}_LIB_TYPE STATIC)
-    elseif(_OPENVDB_${COMPONENT}_EXT STREQUAL ".so" OR
-           _OPENVDB_${COMPONENT}_EXT STREQUAL ".dylib")
-      set(OPENVDB_${COMPONENT}_LIB_TYPE SHARED)
+    get_filename_component(_OPENVDB_openvdb_EXT
+      ${OpenVDB_openvdb_LIBRARY} EXT)
+    if(_OPENVDB_openvdb_EXT STREQUAL ".a")
+      set(OPENVDB_openvdb_LIB_TYPE STATIC)
+    elseif(_OPENVDB_openvdb_EXT STREQUAL ".so" OR
+           _OPENVDB_openvdb_EXT STREQUAL ".dylib")
+      set(OPENVDB_openvdb_LIB_TYPE SHARED)
     endif()
   endif()

-  if(NOT TARGET OpenVDB::${COMPONENT})
-    add_library(OpenVDB::${COMPONENT} ${OPENVDB_${COMPONENT}_LIB_TYPE} IMPORTED)
-    set_target_properties(OpenVDB::${COMPONENT} PROPERTIES
-      IMPORTED_LOCATION "${OpenVDB_${COMPONENT}_LIBRARY}"
-      INTERFACE_COMPILE_OPTIONS "${PC_OpenVDB_CFLAGS_OTHER}"
-      INTERFACE_COMPILE_DEFINITIONS "${OpenVDB_DEFINITIONS}"
-      INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}"
-      IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps
-      INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers)
+  add_library(OpenVDB::openvdb ${OPENVDB_openvdb_LIB_TYPE} IMPORTED)
+  set_target_properties(OpenVDB::openvdb PROPERTIES
+    IMPORTED_LOCATION "${OpenVDB_openvdb_LIBRARY}"
+    INTERFACE_COMPILE_OPTIONS "${PC_OpenVDB_CFLAGS_OTHER}"
+    INTERFACE_COMPILE_DEFINITIONS "${OpenVDB_DEFINITIONS}"
+    INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}"
+    IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps
+    INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers)
+    INTERFACE_COMPILE_FEATURES cxx_std_14
+  )
+endif()
+
+# OpenVDB::pyopenvdb
+
+if(OpenVDB_pyopenvdb_LIBRARY)
+  if(NOT TARGET OpenVDB::pyopenvdb)
+    add_library(OpenVDB::pyopenvdb MODULE IMPORTED)
+    set_target_properties(OpenVDB::pyopenvdb PROPERTIES
+      IMPORTED_LOCATION "${OpenVDB_pyopenvdb_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_pyopenvdb_INCLUDE_DIR};${PYTHON_INCLUDE_DIR}"
+      INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;Boost::${BOOST_PYTHON_LIB};${PYTHON_LIBRARIES}"
       INTERFACE_COMPILE_FEATURES cxx_std_14
    )
   endif()
-endforeach()
+endif()
+
+# OpenVDB::openvdb_houdini
+
+if(OpenVDB_openvdb_houdini_LIBRARY)
+  if(NOT TARGET OpenVDB::openvdb_houdini)
+    add_library(OpenVDB::openvdb_houdini SHARED IMPORTED)
+    set_target_properties(OpenVDB::openvdb_houdini PROPERTIES
+      IMPORTED_LOCATION "${OpenVDB_openvdb_houdini_LIBRARY}"
+      INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_openvdb_houdini_INCLUDE_DIR}"
+      INTERFACE_LINK_LIBRARIES "OpenVDB::openvdb;Houdini"
+      INTERFACE_COMPILE_FEATURES cxx_std_14
+   )
+  endif()
+endif()

 unset(_OPENVDB_VISIBLE_DEPENDENCIES)
 unset(_OPENVDB_HIDDEN_DEPENDENCIES)


cmake: avoid unnecessary files creation in ocv_cmake_configure()

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -32,8 +32,8 @@
 endfunction()

 macro(ocv_cmake_configure file_name var_name)
-  configure_file(${file_name} "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${ARGN})
-  file(READ "${CMAKE_BINARY_DIR}/CMakeConfig-${var_name}.cmake" ${var_name})
+  file(READ "${file_name}" __config)
+  string(CONFIGURE "${__config}" ${var_name} ${ARGN})
 endmacro()

 macro(ocv_update VAR)


Commentary tweak

Commentary tweak

svn path=/trunk/; revision=7679

--- cmake/modules/agg.cmake
+++ cmake/modules/agg.cmake
@@ -26,7 +26,7 @@
 )

 #if(HAVE_AGG)
-#  if(NOT PKGCONFIG_EXECUTABLE)
+#  if(NOT PKG_CONFIG_EXECUTABLE)
 #    message(STATUS
 #    "WARNING: pkg-config not found. Setting HAVE_AGG to OFF."
 #    )
@@ -34,7 +34,7 @@
 #    CACHE BOOL "Enable driver options for using AGG library for antializing"
 #    FORCE
 #    )
-#  endif(NOT PKGCONFIG_EXECUTABLE)
+#  endif(NOT PKG_CONFIG_EXECUTABLE)
 #endif(HAVE_AGG)
 # Look for agg libraries
 if (HAVE_AGG)


FindVOTCA_TOOLS.cmake: fixed a typo

FindVOTCA_TOOLS.cmake: fixed a typo

--- CMakeModules/FindVOTCA_TOOLS.cmake
+++ CMakeModules/FindVOTCA_TOOLS.cmake
@@ -30,6 +30,9 @@
 if (VOTCA_TOOLS_HAS_SQLITE3)
   #due to include <sqlite3.h> in database.h
   find_package(SQLITE3 REQUIRED)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR};${SQLITE3_INCLUDE_DIR}" )
+else(VOTCA_TOOLS_HAS_SQLITE3)
+  set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )
 endif (VOTCA_TOOLS_HAS_SQLITE3)

@@ -48,7 +51,6 @@
 endif("${VOTCA_TOOLS_LIBRARY}" MATCHES "libvotca_tools[^;]*\\.a")

 set(VOTCA_TOOLS_LIBRARIES "${VOTCA_TOOLS_LIBRARY};${VOTCA_TOOLS_DEP_LIBRARIES}" )
-set(VOTCA_TOOLS_INCLUDE_DIRS "${VOTCA_TOOLS_INCLUDE_DIR}" )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set VOTCA_TOOLS_FOUND to TRUE


改善OSX兼容性

改善OSX兼容性

--- Modules/FindConfigurePackage.cmake
+++ Modules/FindConfigurePackage.cmake
@@ -1,4 +1,4 @@
-#.rst:
+#.rst:
 # FindConfigurePackage
 # ----------------
 #
@@ -154,9 +154,15 @@

                 find_program(TAR_EXECUTABLE tar PATHS "${CYGWIN_INSTALL_PATH}/bin")
                 if(TAR_EXECUTABLE AND NOT EXISTS "${FindConfigurePackage_WORKING_DIRECTORY}/${FindConfigurePackage_SRC_DIRECTORY_NAME}")
-                    execute_process(COMMAND ${TAR_EXECUTABLE} -axvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
-                        WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
-                    )
+                    if(APPLE)
+                        execute_process(COMMAND ${TAR_EXECUTABLE} -xvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
+                            WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
+                        )
+                    else()
+                        execute_process(COMMAND ${TAR_EXECUTABLE} -axvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
+                            WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
+                        )
+                    endif()
                 endif()

                 if(NOT TAR_EXECUTABLE)


Work around a stupid template argument limitation in VS 2012.

Without this, the build was breaking on Google Test.

--- CMake/SurgSimBuildFlags.cmake
+++ CMake/SurgSimBuildFlags.cmake
@@ -65,6 +65,11 @@
 	# Enable parallel builds:
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")  # is this needed?
+
+	# Work around a stupid template argument limitation in VS 2012
+	if(MSVC_VERSION EQUAL 1700)
+		add_definitions( -D_VARIADIC_MAX=10 )
+	endif(MSVC_VERSION EQUAL 1700)
 endif(MSVC)

 # Windows-specific settings


proj variable was wrong if BUILD_TESTING is OFF

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -7,12 +7,11 @@
   MESSAGE(FATAL_ERROR "MITK_DATA_DIR variable is defined but corresponds to non-existing directory")
 ENDIF()

-SET(MITK-Data_DEPENDS)
+SET(proj MITK-Data)
+SET(proj_DEPENDENCIES)
+SET(MITK-Data_DEPENDS ${proj})

 IF(BUILD_TESTING)
-  SET(proj MITK-Data)
-  SET(proj_DEPENDENCIES)
-  SET(MITK-Data_DEPENDS ${proj})

   ExternalProject_Add(${proj}
     GIT_REPOSITORY http://git.mitk.org/MITK-Data.git


Updating Revision tag for new MITK-Data archive

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

 if(BUILD_TESTING)

-  set(revision_tag 9436dc36)
+  set(revision_tag 16d96097)

   #if(${proj}_REVISION_TAG)
   #  set(revision_tag ${${proj}_REVISION_TAG})


/permissive-

/permissive-

--- projects/cmake/internal_utils.cmake
+++ projects/cmake/internal_utils.cmake
@@ -4,6 +4,14 @@
 #
 macro(fix_default_compiler_settings_)
   if (MSVC)
+    if(NOT (MSVC_VERSION LESS 1910))
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 /permissive-")
+    endif()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
+    if (MSVC_VERSION LESS 1900)
+      set(CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} -wd4505")
+    endif()
+
     foreach (flag_var
              CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
              CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO
@@ -18,12 +26,8 @@
       #else()
       #  set(${flag_var} "${${flag_var}} /W4")
       endif()
-
-      set(${flag_var} "${${flag_var}} /WX")
-      if (MSVC_VERSION LESS 1900)
-        set(${flag_var} "${${flag_var}} -wd4505")
-      endif()
     endforeach()
+
     foreach (flag_var
              CMAKE_CXX_FLAGS)
       message(STATUS "${flag_var}=${${flag_var}}")


Adding missing api source files.  https://tracker.physiomeproject.org/show_bug.cgi?id=2648

--- source/cmake/api_source_files.cmake
+++ source/cmake/api_source_files.cmake
@@ -3,8 +3,8 @@

 SET( API_SRCS
 	source/api/cmiss_context.c
+	source/api/cmiss_core.c
 	source/api/cmiss_element.c
-	source/api/cmiss_graphics_window.c
 	source/api/cmiss_field.c
 	source/api/cmiss_graphic.c
 	source/api/cmiss_graphics_window.c
@@ -13,6 +13,8 @@
 	source/api/cmiss_node.c
 	source/api/cmiss_region.c
 	source/api/cmiss_rendition.c
+	source/api/cmiss_scene_viewer.cpp
+	source/api/cmiss_texture.c
 	source/api/cmiss_time.c
 	source/api/cmiss_time_keeper.c
 	source/api/cmiss_time_sequence.c


merging changes in toolchain to expose path to toolchain in cache

--- Toolchains/android.toolchain.cmake
+++ Toolchains/android.toolchain.cmake
@@ -375,6 +375,7 @@
  # see if we have path to Android standalone toolchain
  __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ENV_ANDROID_STANDALONE_TOOLCHAIN OBSOLETE_ANDROID_NDK_TOOLCHAIN_ROOT OBSOLETE_ENV_ANDROID_NDK_TOOLCHAIN_ROOT )

+
  if( NOT ANDROID_STANDALONE_TOOLCHAIN )
   #try to find Android NDK in one of the the default locations
   set( __ndkSearchPaths )
@@ -428,11 +429,11 @@
   unset( __androidStandaloneToolchainPreviousPath )
   unset( __length )
  endif()
- set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE INTERNAL "Path of the Android standalone toolchain" )
+ set( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" CACHE PATH "Path of the Android standalone toolchain" )
  set( BUILD_WITH_STANDALONE_TOOLCHAIN True )
 else()
  list(GET ANDROID_NDK_SEARCH_PATHS 0 ANDROID_NDK_SEARCH_PATH)
- message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolcahin.
+ message( FATAL_ERROR "Could not find neither Android NDK nor Android standalone toolchain.
     You should either set an environment variable:
       export ANDROID_NDK=~/my-android-ndk
     or


GCC&co: - added default linker flags for 'binary'/'non-static-lib' targets - added the TNUN_compiler_optimize_for_size option.

--- toolchains/gcc_compatibles.cmake
+++ toolchains/gcc_compatibles.cmake
@@ -11,21 +11,28 @@
 set( CMAKE_INTERPROCEDURAL_OPTIMIZATION true )
 set( CMAKE_VISIBILITY_INLINES_HIDDEN    true )

-set( TNUN_compiler_debug_symbols      -g                             )
-set( TNUN_compiler_LTO                -flto                          )
-set( TNUN_linker_LTO                  -flto                          )
-set( TNUN_compiler_fastmath           -ffast-math -ffp-contract=fast )
-set( TNUN_compiler_rtti_on            -frtti                         )
-set( TNUN_compiler_rtti_off           -fno-rtti                      )
-set( TNUN_compiler_exceptions_on      -fexceptions                   )
-set( TNUN_compiler_exceptions_off     -fno-exceptions                )
-set( TNUN_compiler_optimize_for_speed -O3 -funroll-loops             )
+set( TNUN_compiler_debug_symbols      -g                                    )
+set( TNUN_compiler_LTO                -flto                                 )
+set( TNUN_linker_LTO                  -flto                                 )
+set( TNUN_compiler_fastmath           -ffast-math -ffp-contract=fast -Ofast )
+set( TNUN_compiler_rtti_on            -frtti                                )
+set( TNUN_compiler_rtti_off           -fno-rtti                             )
+set( TNUN_compiler_exceptions_on      -fexceptions                          )
+set( TNUN_compiler_exceptions_off     -fno-exceptions                       )
+set( TNUN_compiler_optimize_for_speed -O3 -funroll-loops                    )
+set( TNUN_compiler_optimize_for_size  -Os                                   )

 set( TNUN_compiler_release_flags -DNDEBUG -fomit-frame-pointer -ffunction-sections -fdata-sections -fmerge-all-constants -fno-stack-protector )

-add_compile_options( -fstrict-aliasing -fstrict-enums -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wall -Wstrict-aliasing -Wno-multichar -Wno-unknown-pragmas -Wno-delete-non-virtual-dtor -Wno-unused-local-typedefs )
+add_compile_options( -fstrict-aliasing -fstrict-enums -fvisibility=hidden -fvisibility-inlines-hidden -fno-threadsafe-statics -Wall -Wstrict-aliasing -Wno-multichar -Wno-unknown-pragmas -Wno-unused-local-typedefs )

 # "Unknown language" error with CMake 3.5.2 if COMPILE_LANGUAGE:C is used.
 # + 'COMPILE_LANGUAGE' isn't supported by VS generators:
 # https://cmake.org/cmake/help/latest/manual/cmake-generator-expressions.7.html#logical-expressions
-add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++1z> $<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-std=gnu11> )
+add_compile_options( $<$<COMPILE_LANGUAGE:CXX>:-std=gnu++1z> )
+add_compile_options( $<$<NOT:$<COMPILE_LANGUAGE:CXX>>:-std=gnu11> )
+
+link_libraries( "-Wl,--no-undefined" "-Wl,-z,relro" "-Wl,-z,now" "-Wl,-z,nocopyreloc" )
+link_libraries( $<$<CONFIG:RELEASE>:-Wl,--gc-sections> )
+link_libraries( $<$<CONFIG:RELEASE>:-Wl,--icf=all>     ) # http://research.google.com/pubs/pub36912.html Safe ICF: Pointer Safe and Unwinding Aware Identical Code Folding in Gold
+#-fuse-ld=gold ...mrmlj...does not work with Android NDK r11 (but should be the default)


EMSCRIPTEN: ALLOCATING 24MB (INSTEAD OF THE DEFAULT 16MB) FOR SKETCHES

--- core/cmake/sketch.cmake
+++ core/cmake/sketch.cmake
@@ -39,6 +39,8 @@
 # ---

 if (PLATFORM MATCHES emscripten)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s TOTAL_MEMORY=25165824")
+
   set(ZLIB_INCLUDE_DIRS "$ENV{HOME}/.emscripten_cache/ports-builds/zlib")
   set(ZLIB_LIBRARIES "$ENV{HOME}/.emscripten_cache/zlib.bc")


Updated mysql dll path

Updated mysql dll path

--- tools/cmake/Win32PostBuild.cmake
+++ tools/cmake/Win32PostBuild.cmake
@@ -17,7 +17,7 @@
     TARGET DEPS
     POST_BUILD
     COMMAND xcopy "${BOOST_PYTHON_DLL_PATH}\\*-gd-*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\Debug" /D /I /Y /s
-    COMMAND xcopy "${BOOST_PYTHON_DLL_PATH}\\*-mt-1*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\Release" /D /I /Y /s
+    COMMAND xcopy "${BOOST_PYTHON_DLL_PATH}\\*-mt-1*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\Release" /D /I /Y /s
     VERBATIM
 )

@@ -26,8 +26,7 @@
 add_custom_command(
     TARGET DEPS
     POST_BUILD
-    COMMAND xcopy "${MYSQL_CONNECTOR_C_DLL_PATH}\\Debug\\*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\$\(Configuration\)" /D /I /Y /s
-    COMMAND xcopy "${MYSQL_CONNECTOR_C_DLL_PATH}\\opt\\*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\$\(Configuration\)" /D /I /Y /s
+    COMMAND xcopy "${MYSQL_CONNECTOR_C_DLL_PATH}\\$\(Configuration\)\\*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\$\(Configuration\)" /D /I /Y /s
     VERBATIM
 )

@@ -56,9 +55,9 @@
     POST_BUILD
     COMMAND xcopy "${ZLIB_DLL_PATH}\\$\(Configuration\)\\*.dll" "${WIN_PROJECT_BINARY_DIR}\\bin\\$\(Configuration\)" /D /I /Y /s
     VERBATIM
-)
+)

-foreach(configuration ${CMAKE_CONFIGURATION_TYPES})
+foreach(configuration ${CMAKE_CONFIGURATION_TYPES})
     if(NOT EXISTS "${PROJECT_BINARY_DIR}/bin/${configuration}/config/swganh.cfg")
     configure_file(
         "${PROJECT_SOURCE_DIR}/data/config/swganh.cfg.in"


message call in FindPCAP.cmake

message call in FindPCAP.cmake

--- cmake/FindPCAP.cmake
+++ cmake/FindPCAP.cmake
@@ -14,6 +14,8 @@
 #  PCAP_FOUND                System has libpcap, include and library dirs found
 #  PCAP_INCLUDE_DIR          The libpcap include directories.
 #  PCAP_LIBRARY              The libpcap library
+
+message ("\nLooking for pcap headers and libraries")

 find_path(PCAP_ROOT_DIR
     NAMES include/pcap.h


Fix elasticsearch install make process when upgrading.

If performing a "make" on top of an existing working copy, the
elasticsearch build process could leave left-over files from the
previous version. These extra files could then prevent ElasticSearch
from starting up (we saw this happen when upgrading from ElaticSearch
1.7 to 2.3).

--- build/cmake/elasticsearch.cmake
+++ build/cmake/elasticsearch.cmake
@@ -7,7 +7,7 @@
   URL_HASH SHA1=${ELASTICSEARCH_HASH}
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
-  INSTALL_COMMAND rsync -a -v <SOURCE_DIR>/ ${STAGE_EMBEDDED_DIR}/elasticsearch/
+  INSTALL_COMMAND rsync -a -v --delete-after <SOURCE_DIR>/ ${STAGE_EMBEDDED_DIR}/elasticsearch/
     COMMAND cd ${STAGE_EMBEDDED_DIR}/bin && ln -snf ../elasticsearch/bin/plugin ./plugin
     COMMAND cd ${STAGE_EMBEDDED_DIR}/bin && ln -snf ../elasticsearch/bin/elasticsearch ./elasticsearch
 )


windows: Make Qt5 part of the tomviz component

For some reason this is needed for the NSIS generator to install the libs.
The ZIP generator worked fine without it, which is what I was testing.
There is still an issue with Qt though, starting the application installed
from the NSIS installer says Qt cannot find the 'windows' plugin.

--- projects/win32/qt.use.system.cmake
+++ projects/win32/qt.use.system.cmake
@@ -39,4 +39,4 @@
     endif()
   endforeach()
 endforeach()
-")
+" COMPONENT "tomviz")


including boost

including boost

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -1,13 +1,14 @@
 find_package(EthRPC REQUIRED)
 find_package(JsonCPP REQUIRED)
 find_package(CryptoPP REQUIRED)
+find_package(Boost REQUIRED)

 add_definitions(-D__ABI_ENABLED__)
 add_definitions(-DBOOST_PP_VARIADICS)

 include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/CopyHeaders.cmake)

-include_directories(${JSONCPP_INCLUDE_DIR} ${CRYPTOPP_INCLUDE_DIR} ${ETHRPC_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
+include_directories(${Boost_INCLUDE_DIRS} ${JSONCPP_INCLUDE_DIR} ${CRYPTOPP_INCLUDE_DIR} ${ETHRPC_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src)
 file(GLOB_RECURSE SOURCES "src/*.cpp")


Updated sdl.cmake

Updated sdl.cmake

--- cmake/sdl.cmake
+++ cmake/sdl.cmake
@@ -6,6 +6,7 @@
 SET(SDL_DLL_LIBRARY "SDL.dll")
 SET(SDL_IMAGE_DLL_LIBRARY "SDL_image.dll")
 SET(SDL_PNG_DLL_LIBRARY "libpng15-15.dll")
+SET(SDL_ZLIB_DLL_LIBRARY "zlib1.dll")

 if(WIN32)
 	if(CMAKE_CL_64)


Change the generation order, NSIS will be removed

--- projects/win32/tomviz.bundle.cmake
+++ projects/win32/tomviz.bundle.cmake
@@ -68,7 +68,12 @@
 include(InstallRequiredSystemLibraries)
 include(CPack)

-# Build nsis package
+# Build WIX package
+add_test(GenerateTomvizPackage-WIX
+        ${CMAKE_CPACK_COMMAND} -G WIX
+        WORKING_DIRECTORY ${Superbuild_BINARY_DIR})
+
+# Build NSIS package
 add_test(GenerateTomvizPackage-NSIS
         ${CMAKE_CPACK_COMMAND} -G NSIS
         WORKING_DIRECTORY ${Superbuild_BINARY_DIR})
@@ -78,11 +83,6 @@
         ${CMAKE_CPACK_COMMAND} -G ZIP
         WORKING_DIRECTORY ${Superbuild_BINARY_DIR})

-# Build WIX package
-add_test(GenerateTomvizPackage-WIX
-        ${CMAKE_CPACK_COMMAND} -G WIX
-        WORKING_DIRECTORY ${Superbuild_BINARY_DIR})
-
 set_tests_properties(GenerateTomvizPackage-NSIS
                      GenerateTomvizPackage-ZIP
                      GenerateTomvizPackage-WIX


[Apple Clang] Expose llvm-config from stage2 builds in stage1

This exposes the stage2-llvm-config target though the stage1 build configuration.

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

--- cmake/caches/Apple-stage1.cmake
+++ cmake/caches/Apple-stage1.cmake
@@ -37,6 +37,7 @@
   check-all
   check-llvm
   check-clang
+  llvm-config
   test-suite
   test-depends
   llvm-test-depends


Package odb: enable cache

Package odb: enable cache

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

 include(hunter_add_version)
+include(hunter_cacheable)
 include(hunter_configuration_types)
 include(hunter_download)
 include(hunter_pick_scheme)
@@ -21,4 +22,9 @@

 hunter_configuration_types(odb CONFIGURATION_TYPES Release)
 hunter_pick_scheme(DEFAULT url_sha1_autotools)
-hunter_download(PACKAGE_NAME odb)
+hunter_cacheable(odb)
+hunter_download(PACKAGE_NAME odb
+    PACKAGE_UNRELOCATABLE_TEXT_FILES
+    "lib/libodb.la"
+    "lib/pkgconfig/libodb.pc"
+)


Removed some overlooked debug output.

Removed some overlooked debug output.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -77,7 +77,6 @@
   # Pop off authority part and reverse on dots
   LIST (GET mangled_path 0 authority)
   LIST (REMOVE_AT mangled_path 0)
-  message (STATUS "After remove: ${mangled_path}")
   STRING (REPLACE "." ";" authority "${authority}")
   LIST (REVERSE authority)

@@ -102,7 +101,6 @@
   # Stick the reversed authority back on the front of the path: done!
   LIST (INSERT mangled_path 0 ${authority})
   STRING (REPLACE ";" "/" ${DIR_VAR} "${mangled_path}")
-  message (STATUS "uri: ${URI} dir: ${${DIR_VAR}} file: ${${FILE_VAR}}")
 ENDMACRO (MANGLE_URI)

 # Macro which declares a module. This sets up the installation of the


create-toolchain-info: fix wiki link

create-toolchain-info: fix wiki link

[skip ci]

--- scripts/create-toolchain-info.cmake
+++ scripts/create-toolchain-info.cmake
@@ -7,7 +7,7 @@
   message("[hunter ** INTERNAL **] [Directory:${CMAKE_CURRENT_LIST_DIR}]")
   message("")
   message("------------------------------ WIKI -------------------------------")
-  message("    https://github.com/ruslo/hunter/wiki/Error-%28Internal%29")
+  message("    https://github.com/ruslo/hunter/wiki/error.internal")
   message("-------------------------------------------------------------------")
   message(FATAL_ERROR "")
 endif()


[cmake] don't add headercheck to 'all'

[cmake] don't add headercheck to 'all'

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -42,7 +42,7 @@
 		string(REPLACE "/" "_" fn ${HEADER})
 		SET( TEST_NAME "headercheck_${fn}")
 		configure_file( ${DUNE_STUFF_ROOT}/cmake/headercheck.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/headercheck/${TEST_NAME}.cpp )
-		ADD_LIBRARY( ${TEST_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/headercheck/${TEST_NAME}.cpp )
+		ADD_LIBRARY( ${TEST_NAME} EXCLUDE_FROM_ALL STATIC ${CMAKE_CURRENT_BINARY_DIR}/headercheck/${TEST_NAME}.cpp )
 		set_target_properties(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
 		add_dependencies( headercheck ${TEST_NAME} )
 	ENDFOREACH( HEADER )


[cmake.duneutils] removed BOOST_ROOT

[cmake.duneutils] removed BOOST_ROOT

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -203,9 +203,6 @@
 SET( CUSTOM_FLAGS
 	"-Wall -Wextra -Wlogical-op -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Winline -fno-strict-aliasing" CACHE STRING
 	"CUSTOM FLAGS")
-SET( BOOST_ROOT
-	"/opt/boost-1.48" CACHE STRING
-	"" )

 SET( CMAKE_CXX_FLAGS_RELEASE
 	"-DDNDEBUG -funroll-loops -m64 -mfpmath=sse -falign-loops -mtune=native -march=native -O3 -pipe -fomit-frame-pointer " )


Use local FindCUDA for CMake < 3.7

Use local FindCUDA for CMake < 3.7

--- cmake/MiscCheck.cmake
+++ cmake/MiscCheck.cmake
@@ -260,6 +260,8 @@
   # We know that VS2017 needs the new FindCUDA functionality, so we will
   # simply enable it for the whole Windows build.
   set(CAFFE2_CMAKE_USE_LOCAL_FINDCUDA ON)
+elseif (${CMAKE_VERSION} VERSION_LESS 3.7 AND ${USE_CUDA})
+  set(CAFFE2_CMAKE_USE_LOCAL_FINDCUDA ON)
 endif()

 if (${CAFFE2_CMAKE_USE_LOCAL_FINDCUDA})


UsePython.cmake: improve wording

UsePython.cmake: improve wording

--- cmake/UsePython.cmake
+++ cmake/UsePython.cmake
@@ -50,14 +50,14 @@
 			"-Dpyc_SUFFIX=${_PYSUFFIX}"
 			-DUSE_PYTHON_LIST_PY_COMPILE=1
 			-P "${USE_PYTHON_MODULE_PATH}"
-		COMMENT "Generating Python module inventory"
+		COMMENT "Updating inventory for Python module '${_DIR}'"
 		VERBATIM)
 	add_custom_command(
 		OUTPUT "${_DIR}/.py_compile.done" "${_DIR}/.py_compile.done.PHONY"
 		COMMAND "${PYTHON_EXECUTABLE}" ${_PYFLAGS}
 				"${USE_PYTHON_MODULE_DIR}/use_python_compile.py" "${_DIR}"
 		DEPENDS "${_DIR}/.py_compile"
-		COMMENT "Precompiling Python module"
+		COMMENT "Precompiling Python module '${_DIR}'"
 		VERBATIM)
 	set_source_files_properties(
 		"${_DIR}/.py_compile.PHONY" "${_DIR}/.py_compile.done.PHONY"


fix redefinition of argument machine

fix redefinition of argument machine

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -50,20 +50,14 @@
 endif(NOT WITH_PROFILER)

 if(NOT CMAKE_CROSSCOMPILING)
-    set(SIMD_FLAG)
-    if(WITH_AVX)
-        if (AVX512F_FOUND)
-            set(SIMD_FLAG "${SIMD_FLAG} ${AVX512F_FLAG}")
-        endif()
-        if (AVX2_FOUND)
-            set(SIMD_FLAG "${SIMD_FLAG} ${AVX2_FLAG}")
-        endif()
-        if (AVX_FOUND)
-            set(SIMD_FLAG "${SIMD_FLAG} ${AVX_FLAG}")
-        endif()
-        if (SSE3_FOUND)
-            set(SIMD_FLAG "${SIMD_FLAG} ${SSE3_FLAG}")
-        endif()
+    if(WITH_AVX AND AVX512F_FOUND)
+        set(SIMD_FLAG ${AVX512F_FLAG})
+    elseif(WITH_AVX AND AVX2_FOUND)
+        set(SIMD_FLAG ${AVX2_FLAG})
+    elseif(WITH_AVX AND AVX_FOUND)
+        set(SIMD_FLAG ${AVX_FLAG})
+    elseif(SSE3_FOUND)
+        set(SIMD_FLAG ${SSE3_FLAG})
     endif()
 endif()


MDEV-293 5.5 RPMs for RHEL6/CentOS6

MDEV-293 5.5 RPMs for RHEL6/CentOS6

Build MariaDB-compat rpm by repackaging files from MariaDB-shared-5.3.*.rpm
Or RHEL6/CentOS6 make all other MariaDB rpms depend on MariaDB-compat.

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -21,6 +21,7 @@
 SET(CPACK_COMPONENT_README_GROUP "server")
 SET(CPACK_COMPONENT_SHAREDLIBRARIES_GROUP "shared")
 SET(CPACK_COMPONENT_COMMON_GROUP "common")
+SET(CPACK_COMPONENT_COMPAT_GROUP "compat")
 SET(CPACK_COMPONENTS_ALL Server ManPagesServer IniFiles Server_Scripts
                                 SupportFiles Development ManPagesDevelopment
                                 ManPagesTest Readme ManPagesClient Test
@@ -94,5 +95,35 @@
 # workaround for lots of perl dependencies added by rpmbuild
 SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_misc.pl)")

+# If we want to build build MariaDB-shared-compat,
+# extract compat libraries from MariaDB-shared-5.3 rpm
+FILE(GLOB compat_rpm RELATIVE ${CMAKE_SOURCE_DIR}
+    "${CMAKE_SOURCE_DIR}/../MariaDB-shared-5.3.*.rpm")
+IF (compat_rpm)
+  MESSAGE("Using ${compat_rpm} to build MariaDB-compat")
+  INSTALL(CODE "EXECUTE_PROCESS(
+                 COMMAND rpm2cpio ${CMAKE_SOURCE_DIR}/${compat_rpm}
+                 COMMAND cpio --extract --make-directories */libmysqlclient*.so.* -
+                 WORKING_DIRECTORY \$ENV{DESTDIR})
+                EXECUTE_PROCESS(
+                 COMMAND chmod -R a+rX .
+                 WORKING_DIRECTORY \$ENV{DESTDIR})"
+                 COMPONENT Compat)
+  SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} Compat)
+
+  # RHEL6/CentOS6 install Postfix by default, and it requires
+  # libmysqlclient.so.16 that pulls in mysql-libs-5.1.x
+  # And the latter conflicts with our rpms.
+  # Make sure that for these distribuions all our rpms require
+  # MariaDB-compat, that will replace mysql-libs-5.1
+  IF(RPM MATCHES "(rhel|centos)6")
+    SET(CPACK_RPM_common_PACKAGE_REQUIRES "MariaDB-compat")
+  ENDIF()
+ENDIF(compat_rpm)
+
+SET(CPACK_RPM_compat_PACKAGE_REQUIRES "/bin/sh") # to mask CPACK_RPM_PACKAGE_REQUIRES
+SET(CPACK_RPM_compat_PACKAGE_PROVIDES "mysql-libs = 5.3.5") # exact version doesn't matter as long as it greater than 5.1
+SET(CPACK_RPM_compat_PACKAGE_OBSOLETES "mysql-libs < 5.3.5")
+
 ENDIF(RPM)


MDEV-3832 MariaDB conflicts with packages filesystem-3.1-2.fc18.i686 and jre-1.7.0_09-fcs.i586 on Fedora 18

fix the rpm packaging to work on Fedora18. Two problems:
* conflicts on common directories with other packages.
* more auto-generated requirements for mariadb-test.rpm

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -64,10 +64,29 @@

 SET(CPACK_RPM_PACKAGE_REQUIRES "MariaDB-common")

-SET(CPACK_RPM_server_USER_FILELIST "%ignore /etc" "%ignore /etc/init.d" "%config(noreplace) /etc/my.cnf.d/*")
-SET(CPACK_RPM_common_USER_FILELIST "%config(noreplace) /etc/my.cnf")
-SET(CPACK_RPM_shared_USER_FILELIST "%config(noreplace) /etc/my.cnf.d/*")
-SET(CPACK_RPM_client_USER_FILELIST "%config(noreplace) /etc/my.cnf.d/*")
+SET(ignored
+  "%ignore /etc"
+  "%ignore /etc/init.d"
+  "%ignore /etc/logrotate.d"
+  "%ignore /usr"
+  "%ignore /usr/bin"
+  "%ignore /usr/include"
+  "%ignore /usr/lib64"
+  "%ignore /usr/sbin"
+  "%ignore /usr/share"
+  "%ignore /usr/share/aclocal"
+  "%ignore /usr/share/doc"
+  "%ignore /usr/share/man"
+  "%ignore /usr/share/man/man1*"
+  "%ignore /usr/share/man/man8*"
+  )
+
+SET(CPACK_RPM_server_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_common_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf")
+SET(CPACK_RPM_shared_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_client_USER_FILELIST ${ignored} "%config(noreplace) /etc/my.cnf.d/*")
+SET(CPACK_RPM_devel_USER_FILELIST ${ignored})
+SET(CPACK_RPM_test_USER_FILELIST ${ignored})

 SET(CPACK_RPM_client_PACKAGE_OBSOLETES "mysql-client MySQL-client MySQL-OurDelta-client")
 SET(CPACK_RPM_client_PACKAGE_PROVIDES "MariaDB-client MySQL-client mysql-client")
@@ -97,7 +116,7 @@
 SET(CPACK_RPM_test_PACKAGE_PROVIDES "MariaDB-test MySQL-test mysql-test")

 # workaround for lots of perl dependencies added by rpmbuild
-SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_misc.pl)")
+SET(CPACK_RPM_test_PACKAGE_PROVIDES "${CPACK_RPM_test_PACKAGE_PROVIDES} perl(lib::mtr_gcov.pl) perl(lib::mtr_gprof.pl) perl(lib::mtr_io.pl) perl(lib::mtr_misc.pl) perl(lib::mtr_process.pl) perl(lib::v1/mtr_cases.pl) perl(lib::v1/mtr_gcov.pl) perl(lib::v1/mtr_gprof.pl) perl(lib::v1/mtr_im.pl) perl(lib::v1/mtr_io.pl) perl(lib::v1/mtr_match.pl) perl(lib::v1/mtr_misc.pl) perl(lib::v1/mtr_process.pl) perl(lib::v1/mtr_report.pl) perl(lib::v1/mtr_stress.pl) perl(lib::v1/mtr_timer.pl) perl(lib::v1/mtr_unique.pl) perl(mtr_cases) perl(mtr_io.pl) perl(mtr_match) perl(mtr_misc.pl) perl(mtr_report) perl(mtr_results) perl(mtr_unique)")

 # If we want to build build MariaDB-shared-compat,
 # extract compat libraries from MariaDB-shared-5.3 rpm


hack in dependencies to imitate mysql-*.rpm even better

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -107,7 +107,7 @@
 SET(CPACK_RPM_devel_PACKAGE_PROVIDES "MariaDB-devel MySQL-devel mysql-devel")

 SET(CPACK_RPM_server_PACKAGE_OBSOLETES "MariaDB mysql mysql-server MySQL-server MySQL-OurDelta-server")
-SET(CPACK_RPM_server_PACKAGE_PROVIDES "MariaDB MariaDB-server MySQL-server config(MariaDB-server) msqlormysql mysql mysql-server")
+SET(CPACK_RPM_server_PACKAGE_PROVIDES "MariaDB MariaDB-server MySQL-server config(MariaDB-server) msqlormysql mysql mysql(x86-32) mysql(x86-64) mysql-server")
 SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
 SET(CPACK_RPM_server_PRE_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-preun.sh)
 SET(CPACK_RPM_server_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postin.sh)


Updated libprotoc.cmake

Updated libprotoc.cmake

--- cmake/libprotoc.cmake
+++ cmake/libprotoc.cmake
@@ -72,6 +72,7 @@
   ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_message_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/javanano/javanano_primitive_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/js/js_generator.cc
+  ${protobuf_source_dir}/src/google/protobuf/compiler/js/well_known_types_embed.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc
   ${protobuf_source_dir}/src/google/protobuf/compiler/objectivec/objectivec_extension.cc


Add wx-config without postfix to search list

--- cmake-scripts/Findwxwidgets3.cmake
+++ cmake-scripts/Findwxwidgets3.cmake
@@ -36,7 +36,7 @@
     SET(WX_OPTS "")
 ELSE(MINGW)
     FIND_PROGRAM(WX_CONFIG
-        NAMES wx-config-3.0 wx-config-2.9
+        NAMES wx-config-3.0 wx-config-2.9 wx-config
         PATHS
             /usr/bin
             /usr/local/bin


- Fix minor oopsie in BuildFunctions.cmake

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -67,7 +67,7 @@
     add_library(${TARGET} ${LINKOPT} "${SOURCES}" "${${TARGET}_HEADERS}")

     if(EMSCRIPTEN)
-        target_compile_options(CoffeeGLeam PRIVATE
+        target_compile_options(${TARGET} PRIVATE
             -s USE_SDL=2
             )
     endif()


- Fix BuildFunctions

- Fix BuildFunctions

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -11,7 +11,7 @@
 # Wrappers to get rid of boilerplate and cross-platform-ness (ahem, Android)

 macro(TARGET_ENABLE_CXX11 TARGET)
-    if(ANDROID OR CMAKE_MAJOR_VERSION VERSION_LESS 3 AND CMAKE_MINOR_VERSION VERSION_LESS 1)
+    if(ANDROID OR "${CMAKE_MAJOR_VERSION}" VERSION_LESS 3 AND "${CMAKE_MINOR_VERSION}" VERSION_LESS 1)
         # Android's compiler doesn't support target_compile_features :(
         set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
     elseif(APPLE)


removed hack setting the build rpath on os x

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -82,7 +82,6 @@
 # ------------------------------------------------------------------------------
 if (APPLE)
     set(CMAKE_INSTALL_NAME_DIR "@rpath")
-    SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
 endif (APPLE)

 # Set CUDA releated compiler flags.


Fix a typo

Fix a typo

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -19,7 +19,7 @@
   foreach( lib \${shared_libs})
     if (IS_SYMLINK \${lib})
       get_filename_component(resolved_link \"\${lib}\" REALPATH)
-      set(\${lib} \${resolved_link})
+      set(lib \${resolved_link})
     endif()
     message(\${lib})
     file(INSTALL \${lib}


remove debug message

remove debug message

--- modules/SetProgramEnv.cmake
+++ modules/SetProgramEnv.cmake
@@ -55,7 +55,7 @@
 	set(oneValueArgs WORKING_DIRECTORY)
 	set(multiValueArgs RUNTIME_DIRS ENVIRONMENT)
 	cmake_parse_arguments(PROGRAM_ENV "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-	message (STATUS  "${PROJECT_BINARY_DIR}/${PROGRAM_ENV_UNPARSED_ARGUMENTS}.vcxproj.user")
+
 	if(MSVC)
 		if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
 			set(comparch "x64")


[brief] Trims compiler definitions for Atlas.

[detailed]
- The majority of the compiler warnings that were disabled were not required.
  These have now been removed to ensure Atlas compiles clean.

--- config/Compiler.cmake
+++ config/Compiler.cmake
@@ -25,13 +25,7 @@
 # Now setup the flags depending on the compiler we're using.
 if (ATLAS_COMPILER_MSVC)
     add_definitions(
-        -wd4714 # force inline not inlined.
-        -wd4510 # default constructor could not be generated.
-        -wd4512 # assignment operator could not be generated.
-        -wd4610 # nonstandard extension used.
-        -wd4316 # object allocated on the heap may not be aligned 16.
         -wd4201 # nonstandard extension used: nameless struct/union.
-        -wd4310 # cast truncates constant value.
         -D_CRT_SECURE_NO_WARNINGS
         )
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")


"Allow memory growth" option for emscripten toolchain.

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -57,6 +57,7 @@
 option(FIPS_EMSCRIPTEN_USE_MEMORY_PROFILER "emscripten: enable the built-in memory profiler" OFF)
 option(FIPS_EMSCRIPTEN_USE_WEBGL2 "emscripten: use WebGL2" OFF)
 option(FIPS_EMSCRIPTEN_USE_CLOSURE "emscripten: run closure compiler on JS code" OFF)
+option(FIPS_EMSCRIPTEN_ALLOW_MEMORY_GROWTH "emscripten: allow memory growth" OFF)
 set(FIPS_EMSCRIPTEN_TOTAL_MEMORY 134217728 CACHE STRING "emscripten: total heap size in bytes")
 set(FIPS_EMSCRIPTEN_LTO_LEVEL 1 CACHE STRING "emscripten: Link-time-optimization level (0..3)")
 set(FIPS_EMSCRIPTEN_OUTLINING_LIMIT 60000 CACHE STRING "emscripten: outlining limit")
@@ -81,6 +82,10 @@
 set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s TOTAL_MEMORY=${FIPS_EMSCRIPTEN_TOTAL_MEMORY}")
 set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s ERROR_ON_UNDEFINED_SYMBOLS=1")
 set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s NO_EXIT_RUNTIME=1")
+
+if (FIPS_EMSCRIPTEN_ALLOW_MEMORY_GROWTH)
+    set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1")
+endif()

 if (FIPS_EMSCRIPTEN_USE_CWRAP)
     set(EMSC_LINKER_FLAGS "${EMSC_LINKER_FLAGS} -s \"EXTRA_EXPORTED_RUNTIME_METHODS=['cwrap','ccall']\"")


Update FW with resource allocation fix

Update FW with resource allocation fix

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "e67dee8bba18786b8fabe8fe212455481ca5c8b3")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "169d63f7c4360e0a1ad9de6917ce734d97113a75")

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


Enable it in build

Enable it in build

--- cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ cmake/configs/nuttx_px4fmu-v2_default.cmake
@@ -48,6 +48,7 @@
 	drivers/bst
 	drivers/snapdragon_rc_pwm
 	drivers/lis3mdl
+	drivers/tap_esc

 	#
 	# System commands


Do not search for unuran or enable builtin_unuran if unuran=OFF

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -52,7 +52,7 @@
 endif()

 #---Check for Unuran ------------------------------------------------------------------
-if(NOT builtin_unuran)
+if(unuran AND NOT builtin_unuran)
   message(STATUS "Looking for Unuran")
   find_Package(Unuran)
   if(NOT UNURAN_FOUND)


Fix for ROOT-7782 - Builtin GSL build does not respect ROOT compiler settings

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -232,7 +232,7 @@
       # http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
       URL ${repository_tarfiles}/gsl-${gsl_version}.tar.gz
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no CFLAGS=${CMAKE_C_FLAGS}
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --enable-shared=no CC=${CMAKE_C_COMPILER} CFLAGS=${CMAKE_C_FLAGS}
       LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     )
     set(GSL_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)


Add APPEND option to set_property() to avoid overwriting includes

Vc headers were not found because later calls to set_property() for
INCLUDE_DIRECTORIES were overwriting the property instead of appending
to it. Now directories are appended.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1289,7 +1289,7 @@
     endif()
   endif()
   if(Vc_FOUND)
-    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${Vc_INCLUDE_DIR})
+    set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${Vc_INCLUDE_DIR})
   endif()
 endif()

@@ -1333,7 +1333,7 @@
   target_link_libraries(Vc INTERFACE VcExt)

   # propagate build-time include directories to rootcling
-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${Vc_INCLUDE_DIR})
+  set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${Vc_INCLUDE_DIR})

   find_package_handle_standard_args(Vc
     FOUND_VAR Vc_FOUND
@@ -1362,7 +1362,7 @@
     message(STATUS "VecCore not found, switching on 'builtin_veccore' option.")
     set(builtin_veccore ON CACHE BOOL "" FORCE)
   else()
-    set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${VecCore_INCLUDE_DIRS})
+    set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${VecCore_INCLUDE_DIRS})
   endif()
 endif()

@@ -1399,7 +1399,7 @@
   add_dependencies(VecCore VECCORE)

   # propagate build-time include directories to rootcling
-  set_property(DIRECTORY PROPERTY INCLUDE_DIRECTORIES ${VecCore_ROOTDIR}/include)
+  set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${VecCore_ROOTDIR}/include)

   if (Vc_FOUND)
     set(VecCore_Vc_FOUND True)


Use '--track-origins=yes' option in valgrind

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -12,8 +12,8 @@
 # Specify MEMCHECK Option: http://valgrind.org/docs/manual/mc-manual.html
 # Note: We use "--trace-children=yes" to valgrind-ise child processes (follow execve)
 # Note: We turn off "--show-reachable=yes" option.
-SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full ")
-SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full ")
+SET (VALGRIND_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")
+SET (CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --workaround-gcc296-bugs=yes --num-callers=50 --trace-children=yes --leak-check=full --track-origins=yes")

 set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu")


update(build): bump fakeit version

update(build): bump fakeit version

Signed-off-by: Jason Dellaluce <20c6928ffe03623fc951bdff750fdd62eb23ea4d@gmail.com>

--- cmake/modules/DownloadFakeIt.cmake
+++ cmake/modules/DownloadFakeIt.cmake
@@ -14,8 +14,8 @@

 set(FAKEIT_INCLUDE ${CMAKE_BINARY_DIR}/fakeit-prefix/include)

-set(FAKEIT_EXTERNAL_URL URL https://github.com/eranpeer/fakeit/archive/2.0.5.tar.gz URL_HASH
-                        SHA256=298539c773baca6ecbc28914306bba19d1008e098f8adc3ad3bb00e993ecdf15)
+set(FAKEIT_EXTERNAL_URL URL https://github.com/eranpeer/fakeit/archive/2.0.9.tar.gz URL_HASH
+                        SHA256=dc4ee7b17a84c959019b92c20fce6dc9426e9e170b6edf84db6cb2e188520cd7)

 ExternalProject_Add(
   fakeit-external


Fix cmake build.

Fix cmake build.

PiperOrigin-RevId: 175195239

--- tensorflow/contrib/cmake/tf_c.cmake
+++ tensorflow/contrib/cmake/tf_c.cmake
@@ -21,7 +21,6 @@
     "${tensorflow_source_dir}/tensorflow/c/c_api_function.cc"
     "${tensorflow_source_dir}/tensorflow/c/eager/c_api.cc"
     "${tensorflow_source_dir}/tensorflow/c/eager/c_api.h"
-    "${tensorflow_source_dir}/tensorflow/c/eager/tape.cc"
     "${tensorflow_source_dir}/tensorflow/c/eager/tape.h"
     "${tensorflow_source_dir}/tensorflow/c/eager/runtime.cc"
     "${tensorflow_source_dir}/tensorflow/c/eager/runtime.h"


Quiet warnings on older compilers.

Quiet warnings on older compilers.

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -26,7 +26,13 @@

     if(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")

-        set(_common_options "-march=${GCC_ARCH} -Wall -Wno-unknown-pragmas -Wno-c++14-extensions")
+        set(_common_options "-march=${GCC_ARCH} -Wall -Wno-unknown-pragmas")
+
+        include(CheckCXXCompilerFlag)
+        check_cxx_compiler_flag("-Wno-c++14-extensions" HAS_WCPP14_EXTENSIONS)
+        if (HAS_WCPP14_EXTENSIONS)
+            set(_common_options "${_common_options} -Wno-c++14-extensions")
+        endif()

         # default flags for g++
         set(CMAKE_C_FLAGS_DEBUG "${_common_options} -g" CACHE STRING "Flags used by the compiler during debug builds." FORCE)


Fix CMake variable containing target names for modules and test drivers.

--- CMake/mitkFunctionUseModules.cmake
+++ CMake/mitkFunctionUseModules.cmake
@@ -149,6 +149,9 @@
   if(package_depends)
     _mitk_parse_package_args(${package_depends})

+    # Some package config files like MITK_Qt5_Config.cmake rely on a
+    # properly set "MODULE_NAME" variable for the current target.
+    set(MODULE_NAME ${USE_TARGET})
     # Read all package information
     foreach(_package ${PACKAGE_NAMES})
       set(${_package}_REQUIRED_COMPONENTS_BY_MODULE ${${_package}_REQUIRED_COMPONENTS})


Added paragraph about whitelist file format.

--- CMake/mitkFunctionWhitelists.cmake
+++ CMake/mitkFunctionWhitelists.cmake
@@ -64,6 +64,9 @@
 #! cache variable <prefix>_WHITELIST. Its default value is "None".
 #! The function mitkFunctionCreateWhitelistPaths must be called
 #! with the same <prefix> prior to this function.
+#!
+#! Whitelists are *.cmake files which set the two list variables
+#! enabled_modules and enabled_plugins.
 #!
 #! List of variables available after the function is called:
 #! - <prefix>_WHITELIST


ARROW-13273: [C++] Don't use .pc only in CMake paths for Requires.private

Because they can't be found by raw pkg-config usage.

Closes #10668 from kou/cpp-pc-in-cmake-path

Authored-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -239,7 +239,11 @@
     list(APPEND ARROW_SYSTEM_DEPENDENCIES ${PACKAGE_NAME})
     find_package(PkgConfig QUIET)
     foreach(ARG_PC_PACKAGE_NAME ${ARG_PC_PACKAGE_NAMES})
-      pkg_check_modules(${ARG_PC_PACKAGE_NAME}_PC ${ARG_PC_PACKAGE_NAME} QUIET)
+      pkg_check_modules(${ARG_PC_PACKAGE_NAME}_PC
+                        ${ARG_PC_PACKAGE_NAME}
+                        NO_CMAKE_PATH
+                        NO_CMAKE_EINVIRONMENT_PATH
+                        QUIET)
       if(${${ARG_PC_PACKAGE_NAME}_PC_FOUND})
         string(APPEND ARROW_PC_REQUIRES_PRIVATE " ${ARG_PC_PACKAGE_NAME}")
       endif()


cosmetics and fixing original cmake package variable display and propagation in headers

--- dist/WkBuild.cmake
+++ dist/WkBuild.cmake
@@ -210,7 +210,7 @@

 	#TODO : find a simpler way than this complex merge...
 	MERGE("${HEADERS}" "${SOURCES}" SOURCES)
-	MESSAGE ( STATUS "== ${PROJECT_NAME} Sources : ${SOURCES}" )
+	#MESSAGE ( STATUS "== ${PROJECT_NAME} Sources : ${SOURCES}" )

 	#
 	# Handling my own build config
@@ -297,11 +297,15 @@

 	if ( ${package_var_name}_FOUND )

+		#hiding the original cmake Module variable, displaying the WkCMake later on
+		mark_as_advanced ( FORCE ${package_var_name}_INCLUDE_DIR )
+
 		# to handle cmake moule who dont have exactly the same standard as WkModules
 		if ( NOT ${package_var_name}_INCLUDE_DIRS )
 			set ( ${package_var_name}_INCLUDE_DIRS ${${package_var_name}_INCLUDE_DIR} CACHE PATH "${package_name} Headers directories")
 		endif ( NOT ${package_var_name}_INCLUDE_DIRS )

+		set ( WK_${package_var_name}_FOUND ON )
 		add_definitions(-D WK_${package_var_name}_FOUND)

 		include_directories(${${package_var_name}_INCLUDE_DIRS})
@@ -322,6 +326,9 @@
 	#message ( "${package_name} -> ${package_var_name}" )

 	if ( ${package_var_name}_FOUND )
+
+		#hiding the original cmake Module variable, displaying the WkCMake later on
+		mark_as_advanced ( FORCE ${package_var_name}_LIBRARY )

 		# to handle cmake moule who dont have exactly the same standard as WkModules
 		if ( NOT ${package_var_name}_LIBRARIES )
@@ -333,12 +340,16 @@
 		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 FILEPATH " ${package_name} libraries needed to run ${PROJECT_NAME} " )
+		mark_as_advanced( FORCE ${PROJECT_NAME}_RUN_LIBRARIES )
 		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
-		# However we need to propagate hte location of dependencies, to make it easier for later
-		get_filename_component( ${package_name}_FDIR ${${package_name}_DIR} ABSOLUTE )
+		# However we need to propagate the location of Custom Wk-dependencies, to make it easier for later
+		if ( ${package_name}_DIR )
+			get_filename_component( ${package_name}_FDIR ${${package_name}_DIR} ABSOLUTE )
+		endif ( ${package_name}_DIR )
+
 		# we append to the config cmake script
 		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "

@@ -347,8 +358,21 @@
 CMAKE_POLICY(VERSION 2.6)

 # We need to find the dependency here to get the directory of the library...
+
+		")
+
+		#If it s a custom Wk-dependency we can propagate the build directory
+		if ( ${package_name}_DIR )
+			file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
+
 #However we already know where it is going to be
 set ( ${package_name}_DIR ${${package_name}_FDIR} CACHE PATH \"Imported location of ${package_name} from ${PROJECT_NAME}\" )
+
+			")
+		endif ( ${package_name}_DIR )
+
+		file( APPEND ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "
+
 find_package( ${package_name} )

 # Include directory might be needed by upper project if ${PROJECT_NAME} doesn totally encapsulate it.


Update tflite tag to dl fix version

Update tflite tag to dl fix version

Tested building the cpp sdk on glinux, gwindows and mac with CMAKE_DL_LIBS removed from the sdk cmakefile, running ctests and test_app.

Bug: 186247424
Change-Id: I177d8f269d948ba5d35b11735da2f2f1a4ea52ab

--- sdk/cpp/external/tensorflow.cmake
+++ sdk/cpp/external/tensorflow.cmake
@@ -23,8 +23,8 @@
 OverridableFetchContent_Declare(
   tensorflow
   GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git
-  # Fix MSVC2015 build issues.
-  GIT_TAG d24f1369180d52d0ad79db5fd4df369776c2dc14
+  # Update DL dependency in tflite cmake files
+  GIT_TAG cf8e67c4f33b587189f018b019b1c2517ba5e56d
   # It's not currently possible to shallow clone with a GIT TAG
   # as cmake attempts to git checkout the commit hash after the clone
   # which doesn't work as it's a shallow clone hence a different commit hash.


MITK/NifTK sync: No need to filter as Sascha implemented this change elsewhere

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -159,7 +159,6 @@
         MITK_USE_MODULE(${DEPENDS})

         # ok, now create the module itself
-        list(REMOVE_DUPLICATES ALL_INCLUDE_DIRECTORIES)
         include_directories(. ${ALL_INCLUDE_DIRECTORIES})
         include(files.cmake)


Issue #51: Update eigen to 323c052e1731 == 3.3.7

--- CMake/ExternalProjects/Eigen.cmake
+++ CMake/ExternalProjects/Eigen.cmake
@@ -24,8 +24,8 @@
   message(FATAL_ERROR "Eigen_DIR variable is defined but corresponds to non-existing directory \"${Eigen_ROOT}\".")
 endif()

-set(version "3.2.2.1")
-set(location "${NIFTK_EP_TARBALL_LOCATION}/eigen-eigen-${version}.tar.bz2")
+set(version "323c052e1731")
+set(location "${NIFTK_EP_TARBALL_LOCATION}/eigen-eigen-${version}.tar.gz")
 mpMacroDefineExternalProjectVariables(Eigen ${version} ${location})
 set(proj_DEPENDENCIES )


add dondition : clean test dir only if Nightly build

git-svn-id: 8b72b58fb31a931b6e9a2bd3bb08bc6614045fb1@3404 c330d7e9-fc0c-0410-a5b3-fd85c6f5aa8f

--- test/openVibeTests.cmake
+++ test/openVibeTests.cmake
@@ -151,7 +151,9 @@

 message(" -- Finished ${MODEL}  - ${CTEST_BUILD_NAME} --")

-message(" -- clean ${MODEL}  - ${CTEST_BUILD_NAME} --")
-ctest_empty_binary_directory(${CTEST_SOURCE_DIRECTORY})
+IF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
+	message(" -- clean ${MODEL}  - ${CTEST_BUILD_NAME} --")
+	ctest_empty_binary_directory(${CTEST_SOURCE_DIRECTORY})
+ENDIF(${CTEST_SCRIPT_ARG} MATCHES Nightly)
 exec_program("rm" ARGS "-rf ${CTEST_SOURCE_DIRECTORY}" OUTPUT_VARIABLE "cleanScript")


NO-JIRA: Remove deprecated ENABLE_VALGRIND option if it is found

--- tests/RuntimeCheck.cmake
+++ tests/RuntimeCheck.cmake
@@ -53,11 +53,11 @@

 # Deprecated options to enable runtime checks
 macro(deprecated_enable_check old new doc)
-  option(${old} ${doc} OFF)
   if (${old})
     message("WARNING: option ${old} is deprecated, use RUNTIME_CHECK=${new} instead")
     set(RUNTIME_CHECK_DEFAULT ${new})
   endif()
+  unset(${old} CACHE)
 endmacro()
 deprecated_enable_check(ENABLE_VALGRIND memcheck "Use valgrind to detect run-time problems")
 deprecated_enable_check(ENABLE_SANITIZERS asan "Compile with memory sanitizers (asan, ubsan)")


CMake: ccache can also be used on Windows (with MinGW).

--- cmake/environmentchecks.cmake
+++ cmake/environmentchecks.cmake
@@ -31,7 +31,7 @@
   if(NOT BUILDCACHE_EXE)
     if(MSVC)
       find_program(CLCACHE_EXE clcache)
-    elseif(NOT WIN32)
+    else()
       find_program(CCACHE_EXE ccache)
     endif()
   endif()
@@ -79,7 +79,7 @@
     mark_as_advanced(BUILDCACHE_EXE)
   elseif(MSVC)
     mark_as_advanced(CLCACHE_EXE)
-  elseif(NOT WIN32)
+  else()
     mark_as_advanced(CCACHE_EXE)
   endif()