Update all references of rheaderfiles to the newly introduced variable.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -397,7 +397,7 @@
     # all rest of the first dict is in the PCH but this file is not and it
     # cannot be present in the original dictionary.
     if(NOT ARG_MULTIDICT)
-      ROOT_CXXMODULES_APPEND_TO_MODULEMAP("${library_name}" "${rheaderfiles}")
+      ROOT_CXXMODULES_APPEND_TO_MODULEMAP("${library_name}" "${headerfiles}")
     endif()
   endif(cxxmodules)
 endfunction()


add local dir in build strategy

add local dir in build strategy

--- cmake/modules/hunter_config.cmake
+++ cmake/modules/hunter_config.cmake
@@ -18,7 +18,7 @@
         "error.unexpected.hunter_config"
     )
   endif()
-  set(_hunter_one_value VERSION GIT_SUBMODULE GIT_SUBMODULE_DIR)
+  set(_hunter_one_value VERSION GIT_SUBMODULE GIT_SUBMODULE_DIR LOCAL_DIR)
   set(_hunter_multiple_values CMAKE_ARGS CONFIGURATION_TYPES)
   cmake_parse_arguments(
       _hunter
@@ -77,6 +77,24 @@
     )
   endif()

+string(COMPARE NOTEQUAL "${_hunter_LOCAL_DIR}" "" _hunter_localdir_consume)
+  if(_hunter_localdir_consume)
+    set_property(
+      GLOBAL
+      PROPERTY
+      "HUNTER_${_hunter_current_project}_LOCAL_DIR"
+      "${_hunter_LOCAL_DIR}"
+    )
+
+    set_property(
+      GLOBAL
+      APPEND
+      PROPERTY
+      HUNTER_LOCAL_PROJECTS
+      "${_hunter_current_project}"
+    )
+  endif()
+
   if(_hunter_VERSION)
     set(HUNTER_${_hunter_current_project}_VERSION ${_hunter_VERSION})
     set(HUNTER_${_hunter_current_project}_CMAKE_ARGS ${_hunter_CMAKE_ARGS})
@@ -87,4 +105,5 @@
   else()
     hunter_user_error("Expected VERSION option for 'hunter_config' command")
   endif()
+
 endmacro()


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/gloox/hunter.cmake
+++ cmake/projects/gloox/hunter.cmake
@@ -82,5 +82,5 @@

 hunter_download(
     PACKAGE_NAME gloox
-    PACKAGE_INTERNAL_DEPS_ID "1"
+    PACKAGE_INTERNAL_DEPS_ID "2"
 )


Necessary for the latest ubuntu

Necessary for the latest ubuntu

--- cmake/CMakelinuxx8664gcc.cmake
+++ cmake/CMakelinuxx8664gcc.cmake
@@ -85,7 +85,7 @@
                 OUTPUT_STRIP_TRAILING_WHITESPACE)

-set(SYSLIBS "-ldl -lcrypt -L/usr/X11R6/lib -lX11 ${LIBNOVER}")
+set(SYSLIBS "-ldl -lcrypt -L/usr/X11R6/lib -lX11 -lGL -lGLU ${LIBNOVER}")

 if(${CMAKE_Fortran_COMPILER} MATCHES "g95")


find template

find template

--- cmake/Modules/FindLAPACK.cmake
+++ cmake/Modules/FindLAPACK.cmake
@@ -87,14 +87,14 @@
   NAMES atlas
   PATH_SUFFIXES atlas)

-pkg_check_modules(LAPACK_ATLAS lapack-atlas)
+pkg_check_modules(LAPACK_ATLAS lapack-atlas QUIET)

 find_library(LAPACK_ATLAS
   NAMES ptlapack lapack_atlas lapack
   PATH_SUFFIXES atlas
   HINTS ${LAPACK_ATLAS_LIBRARY_DIRS} ${LAPACK_ATLAS_LIBDIR})

-pkg_check_modules(LAPACK_BLAS blas-atlas)
+pkg_check_modules(LAPACK_BLAS blas-atlas QUIET)

 find_library(BLAS_LIBRARY
   NAMES ptf77blas f77blas blas
@@ -148,9 +148,9 @@
   endif()
 endif(LAPACK95 IN_LIST LAPACK_FIND_COMPONENTS)

-pkg_check_modules(LAPACK lapack-netlib)
+pkg_check_modules(LAPACK lapack-netlib QUIET)
 if(NOT LAPACK_FOUND)
-  pkg_check_modules(LAPACK lapack)  # Netlib on Cygwin, Homebrew and others
+  pkg_check_modules(LAPACK lapack QUIET)  # Netlib on Cygwin, Homebrew and others
 endif()
 find_library(LAPACK_LIB
   NAMES lapack
@@ -164,7 +164,7 @@
 endif()

 if(LAPACKE IN_LIST LAPACK_FIND_COMPONENTS)
-  pkg_check_modules(LAPACKE lapacke)
+  pkg_check_modules(LAPACKE lapacke QUIET)
   find_library(LAPACKE_LIBRARY
     NAMES lapacke
     PATHS /usr/local/opt
@@ -192,9 +192,9 @@
   mark_as_advanced(LAPACKE_LIBRARY LAPACKE_INCLUDE_DIR)
 endif(LAPACKE IN_LIST LAPACK_FIND_COMPONENTS)

-pkg_check_modules(BLAS blas-netlib)
+pkg_check_modules(BLAS blas-netlib QUIET)
 if(NOT BLAS_FOUND)
-  pkg_check_modules(BLAS blas)  # Netlib on Cygwin and others
+  pkg_check_modules(BLAS blas QUIET)  # Netlib on Cygwin and others
 endif()
 find_library(BLAS_LIBRARY
   NAMES refblas blas
@@ -225,14 +225,14 @@
 #===============================
 function(openblas_libs)

-pkg_check_modules(LAPACK lapack-openblas)
+pkg_check_modules(LAPACK lapack-openblas QUIET)
 find_library(LAPACK_LIBRARY
   NAMES lapack
   HINTS ${LAPACK_LIBRARY_DIRS} ${LAPACK_LIBDIR}
   PATH_SUFFIXES openblas)

-pkg_check_modules(BLAS blas-openblas)
+pkg_check_modules(BLAS blas-openblas QUIET)
 find_library(BLAS_LIBRARY
   NAMES openblas blas
   HINTS ${BLAS_LIBRARY_DIRS} ${BLAS_LIBDIR}
@@ -323,7 +323,7 @@
   endif()
 endif()

-find_package(PkgConfig)
+find_package(PkgConfig QUIET)

 # ==== generic MKL variables ====

@@ -359,7 +359,7 @@
       list(APPEND _mkl_libs tbb.lib)
     endif()
   elseif(OpenMP IN_LIST LAPACK_FIND_COMPONENTS)
-    pkg_check_modules(MKL mkl-${_mkltype}-${_mkl_bitflag}lp64-iomp)
+    pkg_check_modules(MKL mkl-${_mkltype}-${_mkl_bitflag}lp64-iomp QUIET)

     set(_mp iomp5)
     if(WIN32)
@@ -367,7 +367,7 @@
     endif()
     list(APPEND _mkl_libs mkl_intel_thread mkl_core ${_mp})
   else()
-    pkg_check_modules(MKL mkl-${_mkltype}-${_mkl_bitflag}lp64-seq)
+    pkg_check_modules(MKL mkl-${_mkltype}-${_mkl_bitflag}lp64-seq QUIET)
     list(APPEND _mkl_libs mkl_sequential mkl_core)
   endif()


findlapack template

findlapack template

--- cmake/Modules/FindLAPACK.cmake
+++ cmake/Modules/FindLAPACK.cmake
@@ -136,37 +136,31 @@

 if(LAPACK95 IN_LIST LAPACK_FIND_COMPONENTS)
   find_path(LAPACK95_INCLUDE_DIR
-              NAMES f95_lapack.mod
-              PATHS ${LAPACK95_ROOT})
+    NAMES f95_lapack.mod
+    HINTS ${LAPACK95_ROOT}
+    PATH_SUFFIXES include)

   find_library(LAPACK95_LIBRARY
-                 NAMES lapack95
-                 PATHS ${LAPACK95_ROOT})
-
-  if(LAPACK95_LIBRARY AND LAPACK95_INCLUDE_DIR)
-    set(LAPACK_INCLUDE_DIR ${LAPACK95_INCLUDE_DIR})
-    set(LAPACK_LIBRARY ${LAPACK95_LIBRARY})
-  else()
+    NAMES lapack95
+    HINTS ${LAPACK95_ROOT})
+
+  if(NOT (LAPACK95_LIBRARY AND LAPACK95_INCLUDE_DIR))
     return()
   endif()
+
+  set(LAPACK95_INCLUDE_DIR ${LAPACK95_INCLUDE_DIR} PARENT_SCOPE)
+  set(LAPACK95_LIBRARY ${LAPACK95_LIBRARY} PARENT_SCOPE)
+  set(LAPACK_LAPACK95_FOUND true PARENT_SCOPE)
 endif(LAPACK95 IN_LIST LAPACK_FIND_COMPONENTS)

-set(_lapack_hints)
-if(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
-  get_filename_component(_pgi_path ${CMAKE_Fortran_COMPILER} DIRECTORY)
-  set(_lapack_hints ${_pgi_path}/../)
-endif()

 pkg_search_module(pc_lapack lapack-netlib lapack)

-find_library(LAPACK_LIB
+find_library(LAPACK_LIBRARY
   NAMES lapack
-  PATHS /usr/local/opt  # homebrew
-  HINTS ${_lapack_hints} ${pc_lapack_LIBRARY_DIRS} ${pc_lapack_LIBDIR}
+  HINTS ${pc_lapack_LIBRARY_DIRS} ${pc_lapack_LIBDIR}
   PATH_SUFFIXES lapack lapack/lib)
-if(LAPACK_LIB)
-  list(APPEND LAPACK_LIBRARY ${LAPACK_LIB})
-else()
+if(NOT LAPACK_LIBRARY)
   return()
 endif()

@@ -174,25 +168,21 @@
   pkg_check_modules(pc_lapacke lapacke)
   find_library(LAPACKE_LIBRARY
     NAMES lapacke
-    PATHS /usr/local/opt
     HINTS ${pc_lapacke_LIBRARY_DIRS} ${pc_lapacke_LIBDIR}
     PATH_SUFFIXES lapack lapack/lib)

   # lapack/include for Homebrew
   find_path(LAPACKE_INCLUDE_DIR
     NAMES lapacke.h
-    PATHS /usr/local/opt
     HINTS ${pc_lapacke_INCLUDE_DIRS} ${pc_lapacke_LIBDIR}
     PATH_SUFFIXES lapack lapack/include)
-
-  if(LAPACKE_LIBRARY AND LAPACKE_INCLUDE_DIR)
-    set(LAPACK_LAPACKE_FOUND true PARENT_SCOPE)
-    list(APPEND LAPACK_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR})
-    list(APPEND LAPACK_LIBRARY ${LAPACKE_LIBRARY})
-  else()
+  if(NOT (LAPACKE_LIBRARY AND LAPACKE_INCLUDE_DIR))
     return()
   endif()

+  set(LAPACK_LAPACKE_FOUND true PARENT_SCOPE)
+  list(APPEND LAPACK_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR})
+  list(APPEND LAPACK_LIBRARY ${LAPACKE_LIBRARY})
   mark_as_advanced(LAPACKE_LIBRARY LAPACKE_INCLUDE_DIR)
 endif(LAPACKE IN_LIST LAPACK_FIND_COMPONENTS)

@@ -202,23 +192,18 @@
 find_library(BLAS_LIBRARY
   NAMES refblas blas
   NAMES_PER_DIR
-  PATHS /usr/local/opt
-  HINTS ${_lapack_hints} ${pc_blas_LIBRARY_DIRS} ${pc_blas_LIBDIR}
+  HINTS ${pc_blas_LIBRARY_DIRS} ${pc_blas_LIBDIR}
   PATH_SUFFIXES lapack lapack/lib blas)

-if(BLAS_LIBRARY)
-  list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARY})
-  set(LAPACK_Netlib_FOUND true PARENT_SCOPE)
-else()
+if(NOT BLAS_LIBRARY)
   return()
 endif()
+
+list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARY})
+set(LAPACK_Netlib_FOUND true PARENT_SCOPE)

 if(NOT WIN32)
   list(APPEND LAPACK_LIBRARY ${CMAKE_THREAD_LIBS_INIT})
-endif()
-
-if(LAPACK95_LIBRARY)
-  set(LAPACK_LAPACK95_FOUND true PARENT_SCOPE)
 endif()

 set(LAPACK_LIBRARY ${LAPACK_LIBRARY} PARENT_SCOPE)
@@ -234,7 +219,6 @@
   NAMES lapack
   HINTS ${pc_lapack_LIBRARY_DIRS} ${pc_lapack_LIBDIR}
   PATH_SUFFIXES openblas)
-

 pkg_check_modules(pc_blas blas-openblas)
 find_library(BLAS_LIBRARY
@@ -244,15 +228,15 @@
   PATH_SUFFIXES openblas)

 find_path(LAPACK_INCLUDE_DIR
-    NAMES cblas-openblas.h cblas.h f77blas.h openblas_config.h
-    HINTS ${pc_lapack_INCLUDE_DIRS})
-
-if(LAPACK_LIBRARY AND BLAS_LIBRARY)
-  list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARY})
-  set(LAPACK_OpenBLAS_FOUND true PARENT_SCOPE)
-else()
+  NAMES cblas-openblas.h cblas.h f77blas.h openblas_config.h
+  HINTS ${pc_lapack_INCLUDE_DIRS})
+
+if(NOT (LAPACK_LIBRARY AND BLAS_LIBRARY))
   return()
 endif()
+
+list(APPEND LAPACK_LIBRARY ${BLAS_LIBRARY})
+set(LAPACK_OpenBLAS_FOUND true PARENT_SCOPE)

 if(NOT WIN32)
  find_package(Threads)  # not required--for example Flang
@@ -295,15 +279,14 @@
     return()
   endif()

-  list(APPEND LAPACK_LIB ${LAPACK_${s}_LIBRARY})
+  list(APPEND LAPACK_LIBRARY ${LAPACK_${s}_LIBRARY})
 endforeach()

 if(NOT BUILD_SHARED_LIBS AND CMAKE_SYSTEM_NAME STREQUAL Linux)
-  set(LAPACK_LIB -Wl,--start-group ${LAPACK_LIB} -Wl,--end-group)
-endif()
-
-set(BLAS_LIBRARY PARENT_SCOPE)
-set(LAPACK_LIBRARY ${LAPACK_LIB} PARENT_SCOPE)
+  set(LAPACK_LIBRARY -Wl,--start-group ${LAPACK_LIBRARY} -Wl,--end-group)
+endif()
+
+set(LAPACK_LIBRARY ${LAPACK_LIBRARY} PARENT_SCOPE)
 set(LAPACK_INCLUDE_DIR
   ${MKLROOT}/include
   ${MKLROOT}/include/intel64/${_mkl_bitflag}lp64
@@ -352,9 +335,15 @@
     set(_mkl_bitflag)
   endif()

-  unset(_mkl_libs)
+  set(_mkl_libs)
   if(LAPACK95 IN_LIST LAPACK_FIND_COMPONENTS)
-    set(_mkl_libs mkl_blas95_${_mkl_bitflag}lp64 mkl_lapack95_${_mkl_bitflag}lp64)
+    find_mkl_libs(mkl_blas95_${_mkl_bitflag}lp64 mkl_lapack95_${_mkl_bitflag}lp64)
+    if(LAPACK_LIBRARY)
+      set(LAPACK95_LIBRARY ${LAPACK_LIBRARY})
+      set(LAPACK_LIBRARY)
+      set(LAPACK95_INCLUDE_DIR ${LAPACK_INCLUDE_DIR})
+      set(LAPACK_LAPACK95_FOUND true)
+    endif()
   endif()

   unset(_tbb)
@@ -394,10 +383,6 @@
       set(LAPACK_MKL64_FOUND true)
     endif()

-    if(LAPACK95 IN_LIST LAPACK_FIND_COMPONENTS)
-      set(LAPACK_LAPACK95_FOUND true)
-    endif()
-
     if(OpenMP IN_LIST LAPACK_FIND_COMPONENTS)
       set(LAPACK_OpenMP_FOUND true)
     endif()
@@ -422,38 +407,44 @@
 endif()

 # -- verify library works
+
+function(lapack_check)
+
+get_property(enabled_langs GLOBAL PROPERTY ENABLED_LANGUAGES)
+if(NOT Fortran IN_LIST enabled_langs)
+  set(LAPACK_links true PARENT_SCOPE)
+  return()
+endif()

 set(CMAKE_REQUIRED_FLAGS)
 set(CMAKE_REQUIRED_LINK_OPTIONS)
 set(CMAKE_REQUIRED_INCLUDES)
 set(CMAKE_REQUIRED_LIBRARIES ${LAPACK_LIBRARY})

-get_property(enabled_langs GLOBAL PROPERTY ENABLED_LANGUAGES)
-set(LAPACK_links true)  # complex to check across distinct LapackE APIs
-
-if(LAPACK_LIBRARY AND Fortran IN_LIST enabled_langs)
-
+foreach(i s d)
   check_source_compiles(Fortran
   "program check_lapack
-  implicit none
-  double precision, external :: disnan
-  print *, disnan(0.)
-  end" LAPACK_real64_links)
-
-  check_source_compiles(Fortran
-  "program check_lapack
-  implicit none
-  real, external :: sisnan
-  print *, sisnan(0.)
-  end" LAPACK_real32_links)
-
-  if(NOT (LAPACK_real64_links AND LAPACK_real32_links))
-    set(LAPACK_links false)
-  endif()
-
-endif()
-
-set(CMAKE_REQUIRED_LIBRARIES)
+  implicit none (type, external)
+  external :: ${i}isnan
+  end program" LAPACK_${i}_links)
+
+  if(LAPACK_${i}_links)
+    set(LAPACK_${i}_FOUND true PARENT_SCOPE)
+    set(LAPACK_links true)
+  endif()
+
+endforeach()
+
+set(LAPACK_links ${LAPACK_links} PARENT_SCOPE)
+
+endfunction(lapack_check)
+
+# --- Check that Scalapack links
+
+if(LAPACK_LIBRARY)
+  lapack_check()
+endif()
+

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(LAPACK
@@ -480,6 +471,19 @@
                           INTERFACE_INCLUDE_DIRECTORIES "${LAPACK_INCLUDE_DIR}"
                         )
   endif()
+
+  if(LAPACK_LAPACK95_FOUND)
+    set(LAPACK95_LIBRARIES ${LAPACK95_LIBRARY})
+    set(LAPACK95_INCLUDE_DIRS ${LAPACK95_INCLUDE_DIR})
+
+    if(NOT TARGET LAPACK::LAPACK95)
+      add_library(LAPACK::LAPACK95 INTERFACE IMPORTED)
+      set_target_properties(LAPACK::LAPACK95 PROPERTIES
+        INTERFACE_LINK_LIBRARIES "${LAPACK95_LIBRARY}"
+        INTERFACE_INCLUDE_DIRECTORIES "${LAPACK95_INCLUDE_DIR}"
+      )
+    endif()
+  endif()
 endif()

 mark_as_advanced(LAPACK_LIBRARY LAPACK_INCLUDE_DIR)


merging

merging

--- cmake/Modules/Gettextize.cmake
+++ cmake/Modules/Gettextize.cmake
@@ -1,19 +1,35 @@
 include(CMakeParseArguments)
+
+###############################################################################
+# homebrew hackery
+###############################################################################
+# homebrew's gettext is keyonly, so we need to append it's path
+if(APPLE)
+	find_program(BREW brew)
+	if(BREW)
+		execute_process(COMMAND ${BREW} --prefix gettext
+		                OUTPUT_VARIABLE GETTEXT_PREFIX
+		                OUTPUT_STRIP_TRAILING_WHITESPACE)
+		if(GETTEXT_PREFIX)
+			set(GETTEXT_PATH "${GETTEXT_PREFIX}/bin")
+		endif(GETTEXT_PREFIX)
+	endif(BREW)
+endif(APPLE)

 ###############################################################################
 # Dependencies
 ###############################################################################
-find_program(XGETTEXT_EXECUTABLE xgettext)
+find_program(XGETTEXT_EXECUTABLE xgettext ${GETTEXT_PATH})
 if(NOT XGETTEXT_EXECUTABLE)
 	message(FATAL_ERROR "Failed to find xgettext")
 endif(NOT XGETTEXT_EXECUTABLE)

-find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt)
+find_program(GETTEXT_MSGFMT_EXECUTABLE msgfmt ${GETTEXT_PATH})
 if(NOT GETTEXT_MSGFMT_EXECUTABLE)
 	message(FATAL_ERROR "Failed to find msgfmt")
 endif(NOT GETTEXT_MSGFMT_EXECUTABLE)

-find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge)
+find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge ${GETTEXT_PATH})
 if(NOT GETTEXT_MSGMERGE_EXECUTABLE)
 	message(FATAL_ERROR "Failed to find msgmerge")
 endif(NOT GETTEXT_MSGMERGE_EXECUTABLE)


Add --enable-stdcall-fixup to ld flags on Windows

--- cmake/Modules/SampPlugin.cmake
+++ cmake/Modules/SampPlugin.cmake
@@ -22,6 +22,11 @@
     set_property(TARGET ${name} APPEND_STRING PROPERTY LINK_FLAGS    " -m32")
   endif()

+  if(WIN32 AND CMAKE_COMPILER_IS_GNUCC)
+    set_property(TARGET ${name} APPEND_STRING PROPERTY
+                 LINK_FLAGS " -Wl,--enable-stdcall-fixup")
+  endif()
+
   if(UNIX AND NOT WIN32)
     set_property(TARGET ${name} APPEND PROPERTY COMPILE_DEFINITIONS "LINUX")
   endif()


fix python cross-compilation

fix python cross-compilation

--- cmake/OpenCVDetectPython.cmake
+++ cmake/OpenCVDetectPython.cmake
@@ -39,11 +39,11 @@
   if(NOT ANDROID AND NOT IOS)
     ocv_check_environment_variables(PYTHON_LIBRARY PYTHON_INCLUDE_DIR)
     if(CMAKE_CROSSCOMPILING)
-      find_host_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR})
+      find_package(PythonLibs ${PYTHON_VERSION_MAJOR_MINOR})
     elseif(CMAKE_VERSION VERSION_GREATER 2.8.8 AND PYTHON_VERSION_FULL)
-      find_host_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
+      find_package(PythonLibs ${PYTHON_VERSION_FULL} EXACT)
     else()
-      find_host_package(PythonLibs ${PYTHON_VERSION_FULL})
+      find_package(PythonLibs ${PYTHON_VERSION_FULL})
     endif()
     # cmake 2.4 (at least on Ubuntu 8.04 (hardy)) don't define PYTHONLIBS_FOUND
     if(NOT PYTHONLIBS_FOUND AND PYTHON_INCLUDE_PATH)


:pushpin: use JSON test data v1.0.0

:pushpin: use JSON test data v1.0.0

--- cmake/download_test_data.cmake
+++ cmake/download_test_data.cmake
@@ -1,9 +1,12 @@
 find_package(Git)
+
+set(JSON_TEST_DATA_URL     https://github.com/nlohmann/json_test_data)
+set(JSON_TEST_DATA_VERSION 1.0.0)

 # target to download test data
 add_custom_target(download_test_data
-    COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone https://github.com/nlohmann/json_test_data.git --quiet --depth 1
-    COMMENT "Downloading test data from https://github.com/nlohmann/json_test_data"
+    COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone -c advice.detachedHead=false --branch v${JSON_TEST_DATA_VERSION} ${JSON_TEST_DATA_URL}.git --quiet --depth 1
+    COMMENT "Downloading test data from ${JSON_TEST_DATA_URL} (v${JSON_TEST_DATA_VERSION})"
     WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
 )


cmake: use -fp-model precise with ICC

cmake: use -fp-model precise with ICC

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -101,6 +101,10 @@
   endif()
 endif()

+if(CV_ICC AND NOT ENABLE_FAST_MATH)
+  add_extra_compiler_option("-fp-model precise")
+endif()
+
 if(CMAKE_COMPILER_IS_GNUCXX)
   # High level of warnings.
   add_extra_compiler_option(-W)


use runtest.sh script iif /bin/bash does exist

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -2,6 +2,9 @@
 option(EIGEN_DEBUG_ASSERTS "Enable advanced debuging of assertions" OFF)

 include(CheckCXXSourceCompiles)
+
+# check whether /bin/bash exists
+find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)

 macro(ei_add_property prop value)
   get_property(previous GLOBAL PROPERTY ${prop})
@@ -61,15 +64,11 @@
     endif()
   endif()

-  if(WIN32)
-    if(CYGWIN)
-      add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
-    else(CYGWIN)
-      add_test(${testname_with_suffix} "${targetname}")
-    endif(CYGWIN)
-  else(WIN32)
+  if(EIGEN_BIN_BASH_EXISTS)
     add_test(${testname_with_suffix} "${Eigen_SOURCE_DIR}/test/runtest.sh" "${testname_with_suffix}")
-  endif(WIN32)
+  else()
+    add_test(${testname_with_suffix} "${targetname}")
+  endif()

 endmacro(ei_add_test_internal)


Fix RPATH error (Macosx only)

Fix RPATH error (Macosx only)

--- cmake/SiconosSetup.cmake
+++ cmake/SiconosSetup.cmake
@@ -154,12 +154,6 @@
 # https://cmake.org/Wiki/CMake_RPATH_handling
 # to avoid the rpath issue that appears on OS X El Capitan

-# the RPATH to be used when installing, but only if it's not a system directory
-list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
-if("${isSystemDir}" STREQUAL "-1")
-  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${_install_lib}")
-endif()
-
 # Set prefix path for libraries installation
 # --> means that any library target will be installed
 # in CMAKE_INSTALL_PREFIX/_install_lib
@@ -169,6 +163,12 @@
   ASSERT(CMAKE_INSTALL_LIBDIR)
   set(_install_lib ${CMAKE_INSTALL_LIBDIR})
   set(${PROJECT_NAME}_INSTALL_LIB_DIR ${_install_lib})
+endif()
+
+# the RPATH to be used when installing, but only if it's not a system directory
+list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+if("${isSystemDir}" STREQUAL "-1")
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${_install_lib}")
 endif()

 # install cmake macros


kconfig: Make CONIG_FP_SOFTABI generate floating point instructions

The actual behaviour of CONIG_FP_SOFTABI has not been matching the
documenation. The Kconfig documentation states that floating point
instructions should be generated, but this Kconfig option has been
turning off floating point instructions instead.

This commit causes floating point instructions to be generated when
CONFIG_FP_SOFTABI is enabled, as was originally intended and
documented.

This commit can cause regressions if users have been relying on the
actual behaviour instead of the documented behaviour.

Kconfig documentation:

config FP_SOFTABI
	help
	  This option selects the Floating point ABI in which hardware
	  floating point instructions are generated but soft-float calling
	  conventions.

GCC documentation:

Specifying ‘soft’ causes GCC to generate output containing library
calls for floating-point operations. ‘softfp’ allows the generation of
code using hardware floating-point instructions, but still uses the
soft-float calling conventions. ‘hard’ allows generation of
floating-point instructions and uses FPU-specific calling conventions.

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

--- cmake/compiler/gcc.cmake
+++ cmake/compiler/gcc.cmake
@@ -63,7 +63,7 @@
   if(CONFIG_FLOAT)
     list(APPEND TOOLCHAIN_C_FLAGS -mfpu=${FPU_FOR_${GCC_M_CPU}})
     if    (CONFIG_FP_SOFTABI)
-      list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=soft)
+      list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=softfp)
     elseif(CONFIG_FP_HARDABI)
       list(APPEND TOOLCHAIN_C_FLAGS -mfloat-abi=hard)
     endif()


modify xpu.cmake *test=kunlun (#42962)

modify xpu.cmake *test=kunlun (#42962)

--- cmake/external/xpu.cmake
+++ cmake/external/xpu.cmake
@@ -9,7 +9,7 @@

 if(NOT DEFINED XPU_BASE_URL)
   SET(XPU_BASE_URL_WITHOUT_DATE "https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev")
-  SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220511")
+  SET(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220520")
 else()
   SET(XPU_BASE_URL "${XPU_BASE_URL}")
 endif()


CMake: do not globally define -pthread

CMake: do not globally define -pthread

--- CMake/ConfigureBuild.cmake
+++ CMake/ConfigureBuild.cmake
@@ -35,10 +35,6 @@
 # configure threading options
 set(OGRE_THREAD_PROVIDER 0)
 if (OGRE_CONFIG_THREADS)
-	if (UNIX)
-		add_definitions(-pthread)
-	endif ()
-
 	if (OGRE_CONFIG_THREAD_PROVIDER STREQUAL "boost")
 		set(OGRE_THREAD_PROVIDER 1)
 		include_directories(${Boost_INCLUDE_DIRS})


Je suis con ou quoi ?

Je suis con ou quoi ?

--- CMake/Modules/common.cmake
+++ CMake/Modules/common.cmake
@@ -8,7 +8,7 @@

-set (CMAKE_BUILD_TYPE Release)
+set (CMAKE_BUILD_TYPE Debug)

 # execute_process (COMMAND echo COMMAND ${CMAKE_C_COMPILER} -E -dM - OUTPUT_VARIABLE PREDEFINED_MACROS ERROR_QUIET)
@@ -23,13 +23,15 @@
 	message ("wouesh on passe en 64 bits !!!")
 	set (DASH_MBIT -m64) # This variable is intentionally not defined on Android and RPI platform
 else ()
-	message ("wouesh on passe en 32 bits !!!")
-	set (TE_MBIT -m32)
+	message ("wouesh on passe en 33 bits !!!")
+	set (DASH_MBIT -m32)
 endif ()

-set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DASH_MBIT}")
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DASH_MBIT}")
-set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${DASH_MBIT}")
-set (CCMAKE_EXE_LINKER_FLAGS "${CCMAKE_EXE_LINKER_FLAGS} ${DASH_MBIT}")
-set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${DASH_MBIT}")
+set (CMAKE_C_FLAGS_DEBUG  "${CMAKE_C_FLAGS_DEBUG} ${DASH_MBIT}")
+message("ici => ${CMAKE_C_FLAGS_DEBUG}")
+set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DASH_MBIT}")
+message("ici => ${CMAKE_CXX_FLAGS_DEBUG}")
+set (CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ${DASH_MBIT}")
+set (CCMAKE_EXE_LINKER_FLAGS_DEBUG "${CCMAKE_EXE_LINKER_FLAGS_DEBUG} ${DASH_MBIT}")
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} ${DASH_MBIT}")


Explicitly list Boost libraries in the build command.

--- CMakeExternals/Boost.cmake
+++ CMakeExternals/Boost.cmake
@@ -18,12 +18,16 @@
   if(NOT DEFINED BOOST_ROOT AND NOT MITK_USE_SYSTEM_Boost)

     set(_boost_libs )
+    set(_with_boost_libs )

     # Set the boost root to the libraries install directory
     set(BOOST_ROOT "${ep_prefix}")

     if(MITK_USE_Boost_LIBRARIES)
       string(REPLACE ";" "," _boost_libs "${MITK_USE_Boost_LIBRARIES}")
+      foreach(_boost_lib ${MITK_USE_Boost_LIBRARIES})
+        list(APPEND _with_boost_libs ${_with_boost_libs} --with-${_boost_lib})
+      endforeach()
     endif()

     if(WIN32)
@@ -79,6 +83,7 @@
         ${APPLE_SYSROOT_FLAG}
         "--build-dir=<BINARY_DIR>"
         --layout=tagged
+        ${_with_boost_libs}
         # Use the option below to view the shell commands (for debugging)
         #-d+4
         variant=${_boost_variant}


added path to find mkl

added path to find mkl

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -96,6 +96,7 @@
     /opt/intel/mkl
     $ENV{MKLROOT}
     /opt/intel/compilers_and_libraries/linux/mkl
+    /usr/include/mkl
   PATH_SUFFIXES
     include
     IntelSWTools/compilers_and_libraries/windows/mkl/include


Adapt to location of rocprofiler.h in ROCm 2.1

--- CMakeModules/GPA-HSA.cmake
+++ CMakeModules/GPA-HSA.cmake
@@ -18,17 +18,18 @@
                                                 "/opt/rocm/hsa/include/hsa")
         endif()

-        # ROCm path
-        find_file(ROCM_PATH "rocprofiler.h"
-                  HINTS "/opt/rocm/include"
+        # ROCProfiler header
+        find_file(ROCP_HEADER "rocprofiler.h"
+                  HINTS "/opt/rocm/include/rocprofiler" "/opt/rocm/include"
                   NO_DEFAULT_PATH)
-        if(${ROCM_PATH} STREQUAL "ROCM_PATH-NOTFOUND")
-            message("CMake: ROCm Profiler not found")
+        if(${ROCP_HEADER} STREQUAL "ROCP_HEADER-NOTFOUND")
+            message("CMake: ROCm Profiler header not found")
         else()
+            get_filename_component(ROCP_PATH ${ROCP_HEADER} DIRECTORY)
             set(ADDITIONAL_INCLUDE_DIRECTORIES ${ADDITIONAL_INCLUDE_DIRECTORIES}
-                                                "/opt/rocm/include")
+                                                ${ROCP_PATH})
         endif()
     endif()
 else()
     include(${CMAKE_COMMON_LIB_GLOBAL_AMD_HSA_NO_LIB})
-endif()+endif()


Keep Linux package dependencies for libc and zlib (#2812)

--- CMake/Packages.cmake
+++ CMake/Packages.cmake
@@ -17,27 +17,30 @@
     DEPENDS daemon shell
   )

+  set(DEB_PACKAGE_DEPENDENCIES "libc6 (>=2.12), zlib1g")
+  set(RPM_PACKAGE_DEPENDENCIES "glibc >= 2.12, zlib")
+
   find_program(FPM_EXECUTABLE "fpm" ENV PATH)
   find_program(RPMBUILD_EXECUTABLE "rpmbuild" ENV PATH)

   if(FPM_EXECUTABLE)
     add_custom_command(TARGET packages PRE_BUILD
       COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_linux_package.sh"
-        -t "deb" -i "1.14"
+        -t "deb" -i "1.14" -d '${DEB_PACKAGE_DEPENDENCIES}'
     )
     add_custom_command(TARGET packages PRE_BUILD
       COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_linux_package.sh"
-        -t "deb" -i "1.16" -s
+        -t "deb" -i "1.16" -s -d '${DEB_PACKAGE_DEPENDENCIES}'
     )

     if(RPMBUILD_EXECUTABLE)
       add_custom_command(TARGET packages PRE_BUILD
         COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_linux_package.sh"
-          -t "rpm" -i "1.el6"
+          -t "rpm" -i "1.el6" -d '${RPM_PACKAGE_DEPENDENCIES}'
       )
       add_custom_command(TARGET packages PRE_BUILD
         COMMAND bash "${CMAKE_SOURCE_DIR}/tools/deployment/make_linux_package.sh"
-          -t "rpm" -i "1.el7" -s
+          -t "rpm" -i "1.el7" -s -d '${RPM_PACKAGE_DEPENDENCIES}'
       )
     else()
       WARNING_LOG("Skipping RPM/CentOS packages: Cannot find rpmbuild")


correct mac compilation SDL now leverages https://cmake.org/cmake/help/v3.10/command/enable_language.html

--- Tools/CMake/basics.cmake
+++ Tools/CMake/basics.cmake
@@ -467,6 +467,19 @@
         ENDFOREACH()
     endif()
 else()
+    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
+        macro(CHECK_OBJC_SOURCE_COMPILES SOURCE VAR)
+            set(PREV_REQUIRED_DEFS "${CMAKE_REQUIRED_DEFINITIONS}")
+            set(CMAKE_REQUIRED_DEFINITIONS "-x objective-c ${PREV_REQUIRED_DEFS}")
+            CHECK_C_SOURCE_COMPILES(${SOURCE} ${VAR})
+            set(CMAKE_REQUIRED_DEFINITIONS "${PREV_REQUIRED_DEFS}")
+        endmacro()
+    else()
+        include(CheckOBJCSourceCompiles)
+        if (APPLE)
+            enable_language(OBJC)
+        endif()
+    endif()
     # TODO: improve default settings on other platforms
     set(TORQUE_CXX_FLAGS_EXECUTABLES "" CACHE STRING "")
     mark_as_advanced(TORQUE_CXX_FLAGS_EXECUTABLES)


build: Remove unneeded f2c cmake scripts

--- cMake/FindF2C.cmake
+++ cMake/FindF2C.cmake
@@ -1,39 +0,0 @@
-# This module finds the f2c library.
-#
-# This module sets the following variables:
-#  F2C_FOUND - set to true if library is found
-#  F2C_DEFINITIONS - compilation options to use f2c
-#  F2C_LIBRARIES - f2c library name (using full path name)
-
-if (F2C_LIBRARIES)
-
-  set(F2C_FOUND TRUE)
-
-else(F2C_LIBRARIES)
-
-  set(F2C_DEFINITIONS)
-
-  find_library(F2C_LIBRARIES f2c
-               /usr/lib
-               /usr/local/lib
-              )
-
-  if(F2C_LIBRARIES)
-    set(F2C_FOUND TRUE)
-  else()
-    set(F2C_FOUND FALSE)
-  endif()
-
-  if(NOT F2C_FIND_QUIETLY)
-    if(F2C_FOUND)
-      message(STATUS "f2c library found.")
-    else(F2C_FOUND)
-      if(F2C_FIND_REQUIRED)
-        message(FATAL_ERROR "f2c library not found. Please specify library location.")
-      else()
-        message(STATUS "f2c library not found. Please specify library location.")
-      endif()
-    endif(F2C_FOUND)
-  endif(NOT F2C_FIND_QUIETLY)
-
-endif(F2C_LIBRARIES)


ENH: added mitkSimpleTextRendering

ENH: added mitkSimpleTextRendering

--- Core/Rendering/files.cmake
+++ Core/Rendering/files.cmake
@@ -38,5 +38,6 @@
   mitkVtkRenderWindow.cpp
   mitkVtkStencilRenderWindow.cpp
   mitkLogoRendering.cpp
+  mitkSimpleTextRendering.cpp
 )


Allow the user to specify the location of the libraries.

This is useful when a repository being used as a submodule wants
to build Google Mock and multiple copies should not be built.

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -24,6 +24,23 @@
 # There is some trickiness that comes with setting up both Google Test and
 # Google Mock. Different vendors tend to ship it in different ways.
 #
+# 0. A parent directory could have build Google Test and Google Mock,
+#    and have provided us with the relevant paths in the form of
+#    the following options:
+#
+#    GTEST_EXTERNAL_SET_INCLUDE_DIR
+#    GMOCK_EXTERNAL_SET_INCLUDE_DIR
+#    GTEST_EXTERNAL_SET_LIBRARY
+#    GMOCK_EXTERNAL_SET_LIBRARY
+#    GTEST_EXTERNAL_SET_MAIN_LIBRARY
+#    GMOCK_EXTERNAL_SET_MAIN_LIBRARY
+#
+#    A parent should also provide the following variable, as a dependency
+#    to add in order to ensure that the Google Test and Google Mock
+#    libraries are available when this target is built.
+#
+#    GTEST_AND_GMOCK_EXTERNAL_SET_DEPENDENCY
+#
 # 1. Google Test and Google Mock are shipped as a pre-built library
 #    in which case we can use both and set the include dirs.
 # 2. Only Google Mock is shipped in source-form, including a distribution
@@ -57,48 +74,106 @@
 option (GMOCK_PREFER_SOURCE_BUILD
         "Whether or not to prefer a source build of Google Mock." OFF)

-# Situation 0. Google Test and Google Mock were already found. Use those
+macro (_import_library_from_extproject library_target location extproj)
+
+    add_library (${library_target} STATIC IMPORTED GLOBAL)
+    set_target_properties (${library_target}
+                           PROPERTIES IMPORTED_LOCATION ${location})
+    set_target_properties (${library_target}
+                           PROPERTIES EXTERNAL_PROJECT ${extproj})
+    add_dependencies (${library_target} ${extproj})
+
+endmacro (_import_library_from_extproject)
+
+# Already found, return
 if (GTEST_FOUND AND GMOCK_FOUND)

     return ()

 endif (GTEST_FOUND AND GMOCK_FOUND)
+
+# Situation 0. Google Test and Google Mock were provided by the user.
+if (GTEST_EXTERNAL_SET_INCLUDE_DIR AND
+    GMOCK_EXTERNAL_SET_INCLUDE_DIR AND
+    GTEST_EXTERNAL_SET_LIBRARY AND
+    GMOCK_EXTERNAL_SET_LIBRARY AND
+    GTEST_EXTERNAL_SET_MAIN_LIBRARY AND
+    GMOCK_EXTERNAL_SET_MAIN_LIBRARY AND
+    GTEST_AND_GMOCK_EXTERNAL_SET_DEPENDENCY)
+
+    set (GTEST_INCLUDE_DIR ${GTEST_EXTERNAL_SET_INCLUDE_DIR})
+    set (GMOCK_INCLUDE_DIR ${GMOCK_EXTERNAL_SET_INCLUDE_DIR})
+
+    set (_library_dependency ${GTEST_AND_GMOCK_EXTERNAL_SET_DEPENDENCY})
+
+    _import_library_from_extproject (gtest
+                                     ${GTEST_EXTERNAL_SET_LIBRARY}
+                                     ${_library_dependency})
+    _import_library_from_extproject (gmock
+                                     ${GMOCK_EXTERNAL_SET_LIBRARY}
+                                     ${_library_dependency})
+    _import_library_from_extproject (gtest_main
+                                     ${GTEST_EXTERNAL_SET_MAIN_LIBRARY}
+                                     ${_library_dependency})
+    _import_library_from_extproject (gmock_main
+                                     ${GMOCK_EXTERNAL_SET_MAIN_LIBRARY}
+                                     ${_library_dependency})
+
+    set (GTEST_FOUND 1)
+    set (GMOCK_FOUND 1)
+
+    # We want to specify this so that the target names
+    # are re-used.
+    set (GTEST_CREATED_TARGET 1)
+    set (GMOCK_CREATED_TARGET 1)
+
+endif (GTEST_EXTERNAL_SET_INCLUDE_DIR AND
+       GMOCK_EXTERNAL_SET_INCLUDE_DIR AND
+       GTEST_EXTERNAL_SET_LIBRARY AND
+       GMOCK_EXTERNAL_SET_LIBRARY AND
+       GTEST_EXTERNAL_SET_MAIN_LIBRARY AND
+       GMOCK_EXTERNAL_SET_MAIN_LIBRARY AND
+       GTEST_AND_GMOCK_EXTERNAL_SET_DEPENDENCY)

 # Situation 1. Google Test and Google Mock are shipped in library form.
 # Use the libraries unless there we've been asked not to.
-if (NOT GTEST_PREFER_SOURCE_BUILD)
-
-    find_package (GTest QUIET)
-
-endif (NOT GTEST_PREFER_SOURCE_BUILD)
-
-if (NOT GMOCK_PREFER_SOURCE_BUILD)
-
-    # We must try to find google-mock first, if that is unavailable then
-    # building gmock will build both it and google-test
-    if (GTEST_FOUND)
-
-        find_library (GMOCK_LIBRARY gmock)
-        find_library (GMOCK_MAIN_LIBRARY gmock_main)
-
-        # Find the Google Mock include directory by
-        # searching the system paths
-        find_path (GMOCK_INCLUDE_DIR
-                   gmock/gmock.h)
-
-        if (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY AND GMOCK_INCLUDE_DIR)
-
-            # Library forms are available and acceptable, we have found
-            # both Google Test and Google Mock
-
-            set (GTEST_FOUND TRUE)
-            set (GMOCK_FOUND TRUE)
-
-        endif (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY AND GMOCK_INCLUDE_DIR)
-
-    endif (GTEST_FOUND)
-
-endif (NOT GMOCK_PREFER_SOURCE_BUILD)
+if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)
+
+    if (NOT GTEST_PREFER_SOURCE_BUILD)
+
+        find_package (GTest QUIET)
+
+    endif (NOT GTEST_PREFER_SOURCE_BUILD)
+
+    if (NOT GMOCK_PREFER_SOURCE_BUILD)
+
+        # We must try to find google-mock first, if that is unavailable then
+        # building gmock will build both it and google-test
+        if (GTEST_FOUND)
+
+            find_library (GMOCK_LIBRARY gmock)
+            find_library (GMOCK_MAIN_LIBRARY gmock_main)
+
+            # Find the Google Mock include directory by
+            # searching the system paths
+            find_path (GMOCK_INCLUDE_DIR
+                       gmock/gmock.h)
+
+            if (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY AND GMOCK_INCLUDE_DIR)
+
+                # Library forms are available and acceptable, we have found
+                # both Google Test and Google Mock
+
+                set (GTEST_FOUND TRUE)
+                set (GMOCK_FOUND TRUE)
+
+            endif (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY AND GMOCK_INCLUDE_DIR)
+
+        endif (GTEST_FOUND)
+
+    endif (NOT GMOCK_PREFER_SOURCE_BUILD)
+
+endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND)

 function (_find_prefix_from_base INCLUDE_BASE INCLUDE_DIR PREFIX_VAR)

@@ -149,8 +224,8 @@
             add_subdirectory (${GMOCK_SRC_DIR}
                               ${CMAKE_CURRENT_BINARY_DIR}/src/gmock)

-            set (GTEST_HAVE_SOURCES TRUE)
-            set (GMOCK_HAVE_SOURCES TRUE)
+            set (GTEST_CREATED_TARGET TRUE)
+            set (GMOCK_CREATED_TARGET TRUE)

             set (GTEST_FOUND TRUE)
             set (GMOCK_FOUND TRUE)
@@ -188,7 +263,7 @@
             add_subdirectory (${GTEST_SRC_DIR}
                               ${CMAKE_CURRENT_BINARY_DIR}/src/gtest)

-            set (GTEST_HAVE_SOURCES TRUE)
+            set (GTEST_CREATED_TARGET TRUE)

             find_library (GMOCK_LIBRARY gmock)
             find_library (GMOCK_MAIN_LIBRARY gmock_main)
@@ -208,16 +283,6 @@

 # Situation 4. Neither was shipped in source form.
 # Set up an external project, download it and build it there.
-macro (_import_library_from_extproject library_target location extproj)
-
-    add_library (${library_target} STATIC IMPORTED GLOBAL)
-    set_target_properties (${library_target}
-                           PROPERTIES IMPORTED_LOCATION ${location})
-    set_target_properties (${library_target}
-                           PROPERTIES EXTERNAL_PROJECT ${extproj})
-    add_dependencies (${library_target} ${extproj})
-
-endmacro (_import_library_from_extproject)

 # Workaround for some generators setting a different output directory
 function (_get_build_directory_suffix_for_generator SUFFIX)
@@ -311,19 +376,19 @@

 else (NOT GTEST_FOUND OR NOT GMOCK_FOUND)

-    if (GTEST_HAVE_SOURCES)
+    if (GTEST_CREATED_TARGET)

         set (GTEST_LIBRARY gtest)
         set (GTEST_MAIN_LIBRARY gtest_main)

-    endif (GTEST_HAVE_SOURCES)
-
-    if (GMOCK_HAVE_SOURCES)
+    endif (GTEST_CREATED_TARGET)
+
+    if (GMOCK_CREATED_TARGET)

         set (GMOCK_LIBRARY gmock)
         set (GMOCK_MAIN_LIBRARY gmock_main)

-    endif (GMOCK_HAVE_SOURCES)
+    endif (GMOCK_CREATED_TARGET)

     set (GTEST_BOTH_LIBRARIES
          ${CMAKE_THREAD_LIBS_INIT}


add the possibility to specify a list of sub-test suffixes in a compact way

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -120,9 +120,9 @@

   file(READ "${testname}.cpp" test_source)
   set(parts 0)
-  string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+"
+  string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+|EIGEN_SUFFIXES(;[0-9]+)+"
          occurences "${test_source}")
-  string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_" "" suffixes "${occurences}")
+  string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_|EIGEN_SUFFIXES" "" suffixes "${occurences}")
   list(REMOVE_DUPLICATES suffixes)
   if(EIGEN_SPLIT_LARGE_TESTS AND suffixes)
     add_custom_target(${testname})


improve compiler name and version detection

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -271,6 +271,9 @@

   set_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT "0")
   set_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT "0")
+
+  # uncomment anytime you change the ei_get_compilerver_from_cxx_version_string macro
+  # ei_test_get_compilerver_from_cxx_version_string()
 endmacro(ei_init_testing)

 macro(ei_set_sitename)
@@ -303,28 +306,63 @@
     endif()
   else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
-    exec_program( ${CMAKE_CXX_COMPILER}
-                  ARGS --version
-                  OUTPUT_VARIABLE eigen_cxx_compiler_version_raw
-                )
-    # first extract the compiler name which is the first word
-    string( REGEX REPLACE ".*(llvm\\-g\\+\\+|g\\+\\+|icpc|clang).*" "\\1"
-            eigen_cxx_compiler_name ${eigen_cxx_compiler_version_raw})
-
-    if(eigen_cxx_compiler_name MATCHES ".*g\\+\\+.*")
-      string( REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1.\\2.\\3"
-              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
-    elseif(eigen_cxx_compiler_name MATCHES "icpc|clang")
-      string( REGEX REPLACE ".* ([0-9]+\\.[0-9]+\\.[0-9]+|[0-9]+\\.[0-9]+).*" "\\1"
-              eigen_cxx_compiler_version ${eigen_cxx_compiler_version_raw})
-    else()
-      set(eigen_cxx_compiler_version "_")
-    endif()
-
-    set(${VAR} "${eigen_cxx_compiler_name}-${eigen_cxx_compiler_version}")
+    # supporting a "--version" flag
+    execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                    COMMAND head -n 1
+                    OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+    ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+
+    set(${VAR} "${CNAME}-${CVER}")
   endif()
 endmacro(ei_get_compilerver)
+
+# Extract compiler name and version from a raw version string
+# WARNING: if you edit thid macro, then please test it by  uncommenting
+# the testing macro call in ei_init_testing() of the EigenTesting.cmake file.
+# See also the ei_test_get_compilerver_from_cxx_version_string macro at the end of the file
+macro(ei_get_compilerver_from_cxx_version_string VERSTRING CNAME CVER)
+  # extract possible compiler names
+  string(REGEX MATCH "g\\+\\+"      ei_has_gpp    ${VERSTRING})
+  string(REGEX MATCH "llvm|LLVM"    ei_has_llvm   ${VERSTRING})
+  string(REGEX MATCH "gcc|GCC"      ei_has_gcc    ${VERSTRING})
+  string(REGEX MATCH "icpc|ICC"     ei_has_icpc   ${VERSTRING})
+  string(REGEX MATCH "clang|CLANG"  ei_has_clang  ${VERSTRING})
+
+  # combine them
+  if((ei_has_llvm) AND (ei_has_gpp OR ei_has_gcc))
+    set(${CNAME} "llvm-g++")
+  elseif((ei_has_llvm) AND (ei_has_clang))
+    set(${CNAME} "llvm-clang++")
+  elseif(ei_has_icpc)
+    set(${CNAME} "icpc")
+  elseif(ei_has_gpp OR ei_has_gcc)
+    set(${CNAME} "g++")
+  else()
+    set(${CNAME} "_")
+  endif()
+
+  # extract possible version numbers
+  # first try to extract 3 isolated numbers:
+  string(REGEX MATCH " [0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+  if(NOT eicver)
+    # try to extract 2 isolated ones:
+    string(REGEX MATCH " [0-9]+\\.[0-9]+" eicver ${VERSTRING})
+    if(NOT eicver)
+      # try to extract 3:
+      string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+\\.[0-9]+" eicver ${VERSTRING})
+      if(NOT eicver)
+        # try to extract 2:
+        string(REGEX MATCH "[^0-9][0-9]+\\.[0-9]+" eicver ${VERSTRING})
+      else()
+        set(eicver " _")
+      endif()
+    endif()
+  endif()
+
+  string(REGEX REPLACE ".(.*)" "\\1" ${CVER} ${eicver})
+
+endmacro(ei_get_compilerver_from_cxx_version_string)

 macro(ei_get_cxxflags VAR)
   set(${VAR} "")
@@ -402,3 +440,31 @@
     set(${VAR} 1)
   endif()
 endmacro(ei_is_64bit_env)
+
+
+# helper macro for testing ei_get_compilerver_from_cxx_version_string
+# STR: raw version string
+# REFNAME: expected compiler name
+# REFVER: expected compiler version
+macro(ei_test1_get_compilerver_from_cxx_version_string STR REFNAME REFVER)
+  ei_get_compilerver_from_cxx_version_string(${STR} CNAME CVER)
+  if((NOT ${REFNAME} STREQUAL ${CNAME}) OR (NOT ${REFVER} STREQUAL ${CVER}))
+    message("STATUS ei_get_compilerver_from_cxx_version_string error:")
+    message("Expected \"${REFNAME}-${REFVER}\", got \"${CNAME}-${CVER}\"")
+  endif()
+endmacro(ei_test1_get_compilerver_from_cxx_version_string)
+
+# macro for testing ei_get_compilerver_from_cxx_version_string
+# feel free to add more version strings
+macro(ei_test_get_compilerver_from_cxx_version_string)
+  ei_test1_get_compilerver_from_cxx_version_string("g++ (SUSE Linux) 4.5.3 20110428 [gcc-4_5-branch revision 173117]" "g++" "4.5.3")
+  ei_test1_get_compilerver_from_cxx_version_string("c++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)" "g++" "4.5.1")
+  ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 11.0 20081105" "icpc" "11.0")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-3.4 (GCC) 3.4.6" "g++" "3.4.6")
+  ei_test1_get_compilerver_from_cxx_version_string("SUSE Linux clang version 3.0 (branches/release_30 145598) (based on LLVM 3.0)" "llvm-clang++" "3.0")
+  ei_test1_get_compilerver_from_cxx_version_string("icpc (ICC) 12.0.5 20110719" "icpc" "12.0.5")
+  ei_test1_get_compilerver_from_cxx_version_string("Apple clang version 2.1 (tags/Apple/clang-163.7.1) (based on LLVM 3.0svn)" "llvm-clang++" "2.1")
+  ei_test1_get_compilerver_from_cxx_version_string("i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)" "llvm-g++" "4.2.1")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 4.4.6" "g++" "4.4.6")
+  ei_test1_get_compilerver_from_cxx_version_string("g++-mp-4.4 (GCC) 2011" "g++" "4.4")
+endmacro(ei_test_get_compilerver_from_cxx_version_string)


add GLog/GFlags options

add GLog/GFlags options

--- cmake/InstallFolly.cmake
+++ cmake/InstallFolly.cmake
@@ -4,14 +4,7 @@
     URL_MD5             ${FOLLY_URL_MD5}
     CONFIGURE_COMMAND   cd <SOURCE_DIR>/folly &&
                         autoreconf -vi &&
-                        CXXFLAGS=-I<INSTALL_DIR>/include
-                        LDFLAGS=-L<INSTALL_DIR>/lib
-                        PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig
-                        GFLAGS_CFLAGS=-I<INSTALL_DIR>/include
-                        GFLAGS_LIBS=<INSTALL_DIR>/lib/libgflags.a
-                        <SOURCE_DIR>/folly/configure
-                        --prefix=<INSTALL_DIR> ${WITH_OPENSSL}
-                        --with-boost=${BOOST_ROOT}
+                        CXXFLAGS=-I<INSTALL_DIR>/include LDFLAGS=-L<INSTALL_DIR>/lib PKG_CONFIG_PATH=<INSTALL_DIR>/lib/pkgconfig GFLAGS_CFLAGS=-I${GFLAGS_INCLUDE_DIRS} GFLAGS_LIBS=${GFLAGS_LIBRARIES} GLOG_CFLAGS=-I${GLOG_INCLUDE_PATH} GLOG_LIBS=${GLOG_LIBRARY} OPENSSL_CFLAGS=-I${OPENSSL_INCLUDE_DIR} OPENSSL_LIBS=${OPENSSL_LIBRARIES} <SOURCE_DIR>/folly/configure --prefix=<INSTALL_DIR> ${WITH_OPENSSL} --with-boost=${BOOST_ROOT}
     BUILD_COMMAND       cd <SOURCE_DIR>/folly && make
     INSTALL_COMMAND     cd <SOURCE_DIR>/folly && make install
 )


Cleaned up fix for issue inviwo/inviwo-dev#1137, dll deployment on VS 2015

--- cmake/globalconfig.cmake
+++ cmake/globalconfig.cmake
@@ -278,6 +278,9 @@
     else()
         set(CMAKE_MSVC_ARCH x86)
     endif()
+    # default dll dependencies for Visual Studio versions 2005, 2008, 2010, and 2013
+    # In VS 2015, "msvcr140.dll" was replaced by several other dlls.
+    set(MSVC_DLLNAMES "msvcp" "msvcr")
     if(MSVC90)
         set(MSVC_ACRO "9")
     elseif(MSVC10)
@@ -288,24 +291,17 @@
         set(MSVC_ACRO "12")
     elseif(MSVC14)
         set(MSVC_ACRO "14")
-    endif()
+        set(MSVC_DLLNAMES "msvcp" "concrt" "vccorlib" "vcruntime")
+    endif()
+
     if(IVW_PACKAGE_PROJECT AND BUILD_SHARED_LIBS)
         if(DEFINED MSVC_ACRO)
-            if(MSVC_ACRO GREATER 13)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/concrt${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/msvcp${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/vccorlib${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/vcruntime${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/concrt${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/msvcp${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/vccorlib${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/vcruntime${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-            else()
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/msvcp${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/msvcr${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/msvcp${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/msvcr${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
-            endif()
+            foreach(dllname ${MSVC_DLLNAMES})
+                # debug build
+                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/Debug_NonRedist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.DebugCRT/${dllname}${MSVC_ACRO}0d.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Debug)
+                # release build
+                install(FILES "C:/Program Files (x86)/Microsoft Visual Studio ${MSVC_ACRO}.0/VC/redist/${CMAKE_MSVC_ARCH}/Microsoft.VC${MSVC_ACRO}0.CRT/${dllname}${MSVC_ACRO}0.dll" DESTINATION bin COMPONENT core CONFIGURATIONS Release)
+            endforeach()
         endif()
     endif()


Cmake: Removed redundant code

Cmake: Removed redundant code

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -300,10 +300,7 @@
             set(count 1)
             foreach(dir ${IVW_EXTERNAL_MODULES})
                 if(IS_DIRECTORY ${dir})
-                    if(NOT ${first} EQUAL "0")
-                        list(APPEND paths ", :")
-                    endif()
-                    set(first "1")
+                    list(APPEND paths ", :")
                     list(APPEND paths "\"${dir}\":")
                     MATH(EXPR count "${count}+1")
                 else()


cmake: check that headers and libs are consistent

Change-Id: Ibeda2b72f90500c40efd1e5c99bbd856a747223c
Reviewed-on: http://gerrit.aldebaran.lan/28899
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: gerrit

--- cmake/qibuild/find.cmake
+++ cmake/qibuild/find.cmake
@@ -361,6 +361,11 @@
     find_package_handle_standard_args(${prefix} DEFAULT_MSG ${_to_check})
   endif()

+  # Check that headers and libs are consistent
+  _check_consistent(${prefix}
+                    INC ${prefix}_INCLUDE_DIRS
+                    LIB ${prefix}_LIBRARIES)
+
   # Right after find_package_handle_standard_args, ${prefix}_FOUND is
   # set correctly.
   # For instance, if foo/bar.h is not foud, FOO_FOUND is FALSE.
@@ -370,3 +375,59 @@
   qi_persistent_set(${prefix}_PACKAGE_FOUND ${${prefix}_FOUND})
   qi_persistent_set(${prefix}_SEARCHED TRUE)
 endfunction()
+
+
+function(_check_consistent package)
+  cmake_parse_arguments(ARG "" "" "INC;LIB" ${ARGN})
+  if (NOT ARG_INC)
+    return()
+  endif()
+
+  if(NOT ARG_LIB)
+    return()
+  endif()
+
+  foreach(_inc ${ARG_INC})
+    foreach(_lib ${ARG_LIB})
+      # this should filter out args such as SYSTEM,
+      # general, debug, release
+      if(EXISTS ${_inc} AND EXISTS ${_lib})
+        _check_consistent_helper(${package} ${_inc} ${_lib})
+      endif()
+    endforeach()
+  endforeach()
+
+endfunction()
+
+function(_check_consistent_helper package include_path lib_path)
+  set(_inc_in_system)
+  set(_lib_in_system)
+  string(FIND ${include_path} "toolchains" _found)
+  if(${_found} EQUAL "-1")
+    set(_inc_in_system FALSE)
+  else()
+    set(_inc_in_system TRUE)
+  endif()
+
+  string(FIND ${lib_path} "toolchains" _found)
+  if(${_found} EQUAL "-1")
+    set(_lib_in_system FALSE)
+  else()
+    set(_lib_in_system TRUE)
+  endif()
+
+  if(${_lib_in_system} AND ${_inc_in_system})
+    # both in system: ok
+    return()
+  endif()
+
+  if(NOT ${_lib_in_system} AND NOT ${_inc_in_system})
+    # both in toolchain: ok
+    return()
+  endif()
+  qi_error("Inconsistent lib/header settings found for package ${package}:
+${include_path}
+${lib_path}
+")
+
+endfunction()


this fixed the issue

this fixed the issue

--- cmake/stm32/common.cmake
+++ cmake/stm32/common.cmake
@@ -43,12 +43,10 @@
 find_program(CMAKE_CPPFILT NAMES ${STM32_TARGET_TRIPLET}-c++filt PATHS ${TOOLCHAIN_BIN_PATH} NO_DEFAULT_PATH)

 function(stm32_print_size_of_target TARGET)
-    # this target is always considered out of date so size will always be displayed on build
-    add_custom_target(
-        ${TARGET}_size
+    add_custom_target(do_always
         ALL COMMAND ${CMAKE_SIZE} ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C}
-        DEPENDS ${TARGET}${CMAKE_EXECUTABLE_SUFFIX_C}
-        COMMENT "Target sizes:"
+        COMMENT "Target Sizes: "
+        DEPENDS ${TARGET}
     )
 endfunction()


trick ctest into submitting the correct coverage file

--- cmake/travis_build.cmake
+++ cmake/travis_build.cmake
@@ -11,6 +11,7 @@
 ctest_build()
 ctest_test(PARALLEL_LEVEL 3 RETURN_VALUE res)
 ctest_coverage()
+file(REMOVE ${CTEST_BINARY_DIRECTORY}/coverage.xml)

 if(NOT res EQUAL 0)
   message(FATAL_ERROR "Test failures occurred.")


Fix windows path

Fix windows path

--- compiler/msvc-2013.cmake
+++ compiler/msvc-2013.cmake
@@ -7,4 +7,8 @@
   set(POLLY_COMPILER_MSVC_2013_CMAKE_ 1)
 endif()

-set(HUNTER_MSVC_VCVARSALL "$ENV{VS120COMNTOOLS}/../../VC/vcvarsall.bat")
+get_filename_component(
+    HUNTER_MSVC_VCVARSALL
+    "$ENV{VS120COMNTOOLS}/../../VC/vcvarsall.bat"
+    ABSOLUTE
+)


fix location of lapacke_nancheck

fix location of lapacke_nancheck

--- cmake/lapacke.cmake
+++ cmake/lapacke.cmake
@@ -2394,6 +2394,7 @@
   lapacke_slagsy_work.c
   lapacke_zlagsy.c
   lapacke_zlagsy_work.c
+  lapacke_nancheck.c
 )

 set(Utils_SRC
@@ -2434,7 +2435,6 @@
   lapacke_ctp_nancheck.c          lapacke_dtr_trans.c             lapacke_str_trans.c             lapacke_ztp_trans.c
   lapacke_ctp_trans.c             lapacke_lsame.c                 lapacke_xerbla.c                lapacke_ztr_nancheck.c
   lapacke_ctr_nancheck.c          lapacke_make_complex_double.c   lapacke_z_nancheck.c            lapacke_ztr_trans.c
-  lapacke_nancheck.c
 )

 set(LAPACKE_REL_SRC "")


Fixed so that 'add_unit_test' (./cmake/testing.cmake) applies same cpp-standards as parent target (eg. CXX_STANDARD=C++17 etc.), so that if parent uses C++17 features, the test-target can as well.

--- cmake/testing.cmake
+++ cmake/testing.cmake
@@ -1,5 +1,5 @@
-find_package(catch QUIET)
-find_package(fakeit QUIET)
+find_package(catch REQURIED)
+find_package(fakeit REQURIED)

 function(add_test_internal)
     set(oneValueArgs
@@ -18,9 +18,18 @@
     add_executable( ${arg_TEST_NAME}
         ${arg_SOURCES}
     )
+
+    # Extract properties and apply to test-target
+    get_target_property(CXX_STANDARD ${arg_TEST_TARGET} CXX_STANDARD)
+    get_target_property(CXX_STANDARD_REQUIRED ${arg_TEST_TARGET} CXX_STANDARD_REQUIRED)
+    get_target_property(CXX_EXTENSIONS ${arg_TEST_TARGET} CXX_EXTENSIONS)
     get_target_property(DEBUG_POSTFIX ${arg_TEST_TARGET} DEBUG_POSTFIX)
+
     set_target_properties( ${arg_TEST_NAME}
         PROPERTIES
+            CXX_STANDARD ${CXX_STANDARD}
+            CXX_EXTENSIONS ${CXX_EXTENSIONS}
+            CXX_STANDARD_REQUIRED ${CXX_STANDARD_REQUIRED}
             DEBUG_POSTFIX ${DEBUG_POSTFIX}
     )
     target_include_directories( ${arg_TEST_NAME}


Increase version number to make a tag.

Increase version number to make a tag.

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -1,6 +1,6 @@
 SET(${PROJECTNAME}_VERSION_MAJOR 0)
 SET(${PROJECTNAME}_VERSION_MINOR 1)
-SET(${PROJECTNAME}_VERSION_PATCH 1)
+SET(${PROJECTNAME}_VERSION_PATCH 2)

 MATH(EXPR OFFICIAL "${${PROJECTNAME}_VERSION_PATCH} % 2")
 IF(OFFICIAL EQUAL 0)


added libvlc to mac os x bundle

added libvlc to mac os x bundle

--- Mac/projectDef.cmake
+++ Mac/projectDef.cmake
@@ -7,36 +7,56 @@
 # Included from ../CMakeLists.txt

 # remember that the current source dir is the project root; this file is in Mac/
-file (GLOB PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
+file( GLOB PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
     Mac/[^.]*.cpp
     Mac/[^.]*.h
     Mac/[^.]*.cmake
     )

-set (VLC_PATH "/Applications/VLC.app/Contents/MacOS")
-include_directories("${VLC_PATH}/include")
+set( VLC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Mac/VLC-${VLC_VERSION}.app/Contents/MacOS" )
+
+file( GLOB LIBVLC_LIB ${VLC_PATH}/lib/[^.]*.dylib )
+file( GLOB LIBVLC_PLUGINS ${VLC_PATH}/plugins/[^.]*.dylib )
+
+set( LIBVLC ${LIBVLC_LIB} ${LIBVLC_PLUGINS} )
+
+set_source_files_properties(
+    ${LIBVLC_LIB}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION MacOS/lib
+)
+
+set_source_files_properties(
+    ${LIBVLC_PLUGINS}
+    PROPERTIES
+    MACOSX_PACKAGE_LOCATION MacOS/plugins
+)
+
+include_directories( ${VLC_PATH}/include )

 # use this to add preprocessor definitions
 add_definitions(

 )

+source_group( Libvlc FILES ${LIBVLC} )

-SOURCE_GROUP(Mac FILES ${PLATFORM})
+source_group( Mac FILES ${PLATFORM} )

 set (SOURCES
     ${SOURCES}
     ${PLATFORM}
+    ${LIBVLC}
     )

 set(PLIST "Mac/bundle_template/Info.plist")
 set(STRINGS "Mac/bundle_template/InfoPlist.strings")
 set(LOCALIZED "Mac/bundle_template/Localized.r")

-add_mac_plugin(${PROJECT_NAME} ${PLIST} ${STRINGS} ${LOCALIZED} SOURCES)
+add_mac_plugin( ${PROJECT_NAME} ${PLIST} ${STRINGS} ${LOCALIZED} SOURCES )

 # add library dependencies here; leave ${PLUGIN_INTERNAL_DEPS} there unless you know what you're doing!
-target_link_libraries(${PROJECT_NAME}
+target_link_libraries( ${PROJECT_NAME}
     ${PLUGIN_INTERNAL_DEPS}
     "${VLC_PATH}/lib/libvlc.dylib"
     )


Update FW: hotfix for stereo confidence threshold setting, it was overwritten to 200

--- 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 "f34e1ec1450b659bd8ff8383eaff5b7f988cb6fc")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "b71584129b101b30e4632678c19d33b020c04c36")

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


Changed the version of XROOTD when building with builtin_xrootd=ON and simplification in the interface

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -616,25 +616,15 @@
   endif()
 endif()
 if(builtin_xrootd)
-  set(xrootd_version 4.2.1)
+  set(xrootd_version 4.2.2)
   set(xrootd_versionnum 400020001)
   message(STATUS "Downloading and building XROOTD version ${xrootd_version}")
-  string(REPLACE "-Wall " "" __cxxflags "${CMAKE_CXX_FLAGS}")  # Otherwise it produces many warnings
-  string(REPLACE "-W " "" __cxxflags "${__cxxflags}")          # Otherwise it produces many warnings
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-duplicate-decl-specifier)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-deprecated-declarations)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-conditional-uninitialized)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-unused-result)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-sometimes-uninitialized)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-pointer-bool-conversion)
-  ROOT_ADD_CXX_FLAG(__cxxflags -Wno-format-security)
   ExternalProject_Add(
     XROOTD
     # http://xrootd.org/download/v${xrootd_version}/xrootd-${xrootd_version}.tar.gz
     URL ${repository_tarfiles}/xrootd-${xrootd_version}.tar.gz
     INSTALL_DIR ${CMAKE_BINARY_DIR}
-    CMAKE_ARGS -DENABLE_PERL=FALSE
-               -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
                -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
                -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
                -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}


Revert "Follow style of current externals for Vc"

This reverts commit 3010e26e2763193ead22ab49958649e2c74faffa.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1273,12 +1273,13 @@
   set(Vc_PROJECT "Vc-${Vc_VERSION}")
   set(Vc_SRC_URI "${lcgpackages}/${Vc_PROJECT}.tar.gz")
   set(Vc_SRC_MD5 "a248e904f0b1a330ad8f37ec50cbad30")
-  set(Vc_DESTDIR "${CMAKE_BINARY_DIR}/${Vc_PROJECT}")
+  set(Vc_DESTDIR "${CMAKE_BINARY_DIR}/externals/install/${Vc_PROJECT}")
   set(Vc_ROOTDIR "${Vc_DESTDIR}/${CMAKE_INSTALL_PREFIX}")
   set(Vc_LIBNAME "${CMAKE_STATIC_LIBRARY_PREFIX}Vc${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(Vc_LIBRARY "${Vc_ROOTDIR}/${_LIBDIR_DEFAULT}/${Vc_LIBNAME}")

   ExternalProject_Add(${Vc_PROJECT}
+    PREFIX externals
     URL     ${Vc_SRC_URI}
     URL_MD5 ${Vc_SRC_MD5}
     BUILD_IN_SOURCE 0


Clear cache LZ4 variables to allow switching between builtin_lz4=ON/OFF

If we don't clear the cache variables, CMake will keep LZ4_LIBRARY set
to $<TARGET_FILE:lz4> when switching builtin_lz4 from ON to OFF, which
makes ROOT fail to compile.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -237,6 +237,9 @@
 #---Check for LZ4--------------------------------------------------------------------
 if(NOT builtin_lz4)
   message(STATUS "Looking for LZ4")
+  foreach(suffix FOUND INCLUDE_DIR LIBRARY LIBRARY_DEBUG LIBRARY_RELEASE)
+    unset(LZ4_${suffix} CACHE)
+  endforeach()
   find_package(LZ4)
   if(NOT LZ4_FOUND)
     message(STATUS "LZ4 not found. Switching on builtin_lz4 option")


hunter_dump_cmake_flags: include C/CXX standard flags

--- cmake/modules/hunter_dump_cmake_flags.cmake
+++ cmake/modules/hunter_dump_cmake_flags.cmake
@@ -4,6 +4,7 @@
 include(CMakeParseArguments) # cmake_parse_arguments

 include(hunter_internal_error)
+include(hunter_get_lang_standard_flag)

 # Packages to test this function:
 # * Boost
@@ -51,6 +52,18 @@
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -l${x}")
       endif()
     endforeach()
+  endif()
+
+  hunter_get_lang_standard_flag(CXX flag)
+  string(COMPARE NOTEQUAL "${flag}" "" has_flag)
+  if(has_flag)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
+  endif()
+
+  hunter_get_lang_standard_flag(C flag)
+  string(COMPARE NOTEQUAL "${flag}" "" has_flag)
+  if(has_flag)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
   endif()

   string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILER_TARGET}" "" has_value)


Added fix to support header-only libraries

--- cmakemodules/find_or_download_package.cmake
+++ cmakemodules/find_or_download_package.cmake
@@ -9,6 +9,9 @@
     endif()

     add_library(${target_name} INTERFACE)
+    set_target_properties(${target_name} PROPERTIES
+        "INTERFACE_INCLUDE_DIRECTORIES" "${${package_found_prefix}_INCLUDE_DIRS}"
+    )

     foreach(sublib ${${package_found_prefix}_LIBRARIES})
         get_filename_component(LIB_NAME ${sublib} NAME_WE)


generate only platform specific env hook for catkin

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -194,7 +194,11 @@
 if(CATKIN_BUILD_BINARY_PACKAGE AND NOT "${PROJECT_NAME}" STREQUAL "catkin")
   set(catkin_skip_install_env_hooks "SKIP_INSTALL")
 endif()
-catkin_add_env_hooks(05.catkin-test-results SHELLS bat sh DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks})
+if(CMAKE_HOST_UNIX)
+  catkin_add_env_hooks(05.catkin-test-results SHELLS sh DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks})
+else()
+  catkin_add_env_hooks(05.catkin-test-results SHELLS bat DIRECTORY ${catkin_EXTRAS_DIR}/env-hooks ${catkin_skip_install_env_hooks})
+endif()

 # requires stamp and environment files
 include(${catkin_EXTRAS_DIR}/catkin_python_setup.cmake)


Fix Cygwin build

Fix Cygwin build

--- modules/capnproto.cmake
+++ modules/capnproto.cmake
@@ -5,6 +5,8 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_ORIGIN}")

   # Set options
+  SET(WITH_FIBERS OFF CACHE STRINGS "Whether or not to build libkj-async with fibers." FORCE)
+  SET(WITH_OPENSSL OFF CACHE STRINGS "Whether or not to build libkj-tls by linking against openssl." FORCE)
   SET(BUILD_TESTING OFF CACHE BOOL "Build unit tests and enable CTest 'check' target." FORCE)

   # Module subdirectory


cache BLAS/LAPACK_FOUND; fixes #72, fixes #73

--- modules/math_libs.cmake
+++ modules/math_libs.cmake
@@ -479,6 +479,10 @@
     endforeach()
 endif()

+foreach(_service BLAS LAPACK)
+    set(${_service}_FOUND ${${_service}_FOUND} CACHE BOOL "${_service} found")
+endforeach()
+
 #miro: first lapack, then blas as lapack might need blas routine
 set(MATH_LIBS
     ${MATH_LIBS}


modules: add forgotten WindowlessWglApplication into the find module.

Sorry!

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -325,7 +325,7 @@

 # Component distinction (listing them explicitly to avoid mistakes with finding
 # components from other repositories)
-set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$")
+set(_MAGNUM_LIBRARY_COMPONENTS "^(Audio|DebugTools|MeshTools|Primitives|SceneGraph|Shaders|Shapes|Text|TextureTools|GlutApplication|GlxApplication|NaClApplication|Sdl2Application|XEglApplication|WindowlessCglApplication|WindowlessGlxApplication|WindowlessNaClApplication|WindowlessWglApplication|WindowlessWindowsEglApplication|CglContext|EglContext|GlxContext|WglContext)$")
 set(_MAGNUM_PLUGIN_COMPONENTS "^(MagnumFont|MagnumFontConverter|ObjImporter|TgaImageConverter|TgaImporter|WavAudioImporter)$")
 set(_MAGNUM_EXECUTABLE_COMPONENTS "^(distancefieldconverter|fontconverter|info)$")


Changed configuration to use vpm_include_directories

--- configure.cmake
+++ configure.cmake
@@ -1,4 +1,4 @@
 # Copyright (c) 2011, Christian Rorvik
 # Distributed under the Simplified BSD License (See accompanying file LICENSE.txt)

-include_directories(${CMAKE_CURRENT_LIST_DIR}/include)+vpm_include_directories(${CMAKE_CURRENT_LIST_DIR}/include)


Fix GPUSD inclusion

Fix GPUSD inclusion

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

--- GPUSD.cmake
+++ GPUSD.cmake
@@ -15,6 +15,9 @@
 endif()

 if(GPUSD_FOUND)
+  if(GPUSD_LOCAL)
+    add_subdirectory(gpu-sd)
+  endif()
   return()
 endif()


cleanup

cleanup

--- share/hugh/cmake/functions/cma_setup_test.cmake
+++ share/hugh/cmake/functions/cma_setup_test.cmake
@@ -55,8 +55,6 @@
       cma_add_winrt_props(${EXE})
     endif()

-    #set_property(TARGET ${EXE} PROPERTY FOLDER "Tests/${TST_PREFIX}")
-
     target_link_libraries(${EXE} ${TST_DEPENDENCIES})
     add_test(${EXE} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXE} ${BOOSTTEST_ARGS})
     list(APPEND TST_EXES ${EXE})
@@ -75,23 +73,6 @@
   endif()

   if(${PROJECT_NAME}_BLD_UTEST)
-#    if(NOT TARGET test_libs)
- #     add_custom_target(test_libs)
-  #    #set_property(TARGET test_libs PROPERTY FOLDER "Tests")
-   # endif()
-
-    #if(NOT TARGET test_all)
-     # add_custom_target(test_all)
-#      #set_property(TARGET test_all PROPERTY FOLDER "Tests")
- #     add_dependencies(test_all test_libs)
-
-      #if(${PROJECT_NAME}_COVERAGE)
-      #	add_custom_command(TARGET test_all POST_BUILD
-      #	                   COMMAND ${CMAKE_COMMAND} --build . --target coverage_collect
-      #			   WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
-      #endif()
-  #  endif()
-
     if(${PROJECT_NAME}_RUN_CTEST)
       if(TARGET test_${TST_PREFIX})
 	add_dependencies(test_${TST_PREFIX} ${TST_EXES})
@@ -118,7 +99,6 @@
       endif()
     endif()

-    #set_property(TARGET test_${TST_PREFIX} PROPERTY FOLDER "Tests/${TST_PREFIX}")
     add_dependencies(test_libs test_${TST_PREFIX})
   endif()
 endfunction()


Make package date YYYYMMDD

Make package date YYYYMMDD

--- Superbuild/Projects/veloview.bundle.common.cmake
+++ Superbuild/Projects/veloview.bundle.common.cmake
@@ -9,7 +9,7 @@
 # Sets GD_YEAR, GD_MONTH, GD_DAY
 include(${VeloViewSuperBuild_SOURCE_DIR}/Projects/getdate.cmake)
 GET_DATE()
-set(PACKAGE_TIMESTAMP "${GD_DAY}${GD_MONTH}${GD_YEAR}")
+set(PACKAGE_TIMESTAMP "${GD_YEAR}${GD_MONTH}${GD_DAY}")

 # Enable CPack packaging.
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VeloView")


BUG: Update Hippo_Kitware_TubeTK.cmake

BUG: Update Hippo_Kitware_TubeTK.cmake

--- Hippo_Kitware_TubeTK.cmake
+++ Hippo_Kitware_TubeTK.cmake
@@ -151,7 +151,7 @@
 set( ENV{PATH} "${SITE_EXECUTABLE_DIRS}:$ENV{PATH}" )

 set( SITE_C_FLAGS
-  "-fPIC -W -Wall -Wextra -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -fno-diagnostics-fixit-info-fno-caret-diagnostics -fno-color-diagnostics" )
+  "-fPIC -W -Wall -Wextra -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -fno-diagnostics-fixit-info -fno-caret-diagnostics -fno-color-diagnostics" )
 set( SITE_CXX_FLAGS
   "-fPIC -W -Wall -Wextra -Wno-system-headers -Wwrite-strings -Wno-deprecated -Wno-deprecated-declarations -Wno-incompatible-pointer-types -Wno-invalid-source-encoding -Wno-sometimes-uninitialized -Woverloaded-virtual -Wno-unused-private-field -fno-diagnostics-fixit-info -fno-caret-diagnostics -fno-color-diagnostics" )
 set( SITE_EXE_LINKER_FLAGS "" )


cmake: Don't reject unknown cpp files that start with .

Some editors create hidden file backups in the same
directory as the file, and it's annoying when cmake
errors on them.

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

--- cmake/modules/LLVMProcessSources.cmake
+++ cmake/modules/LLVMProcessSources.cmake
@@ -59,12 +59,17 @@
   file(GLOB globbed *.c *.cpp)
   foreach(g ${globbed})
     get_filename_component(fn ${g} NAME)
-    list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx)
-    if( idx LESS 0 )
-      list(FIND listed ${fn} idx)
+
+    # Don't reject hidden files. Some editors create backups in the
+    # same directory as the file.
+    if (NOT "${fn}" MATCHES "^\\.")
+      list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx)
       if( idx LESS 0 )
-        message(SEND_ERROR "Found unknown source file ${g}
+        list(FIND listed ${fn} idx)
+        if( idx LESS 0 )
+          message(SEND_ERROR "Found unknown source file ${g}
 Please update ${CMAKE_CURRENT_LIST_FILE}\n")
+        endif()
       endif()
     endif()
   endforeach()


TestBuild.cmake

TestBuild.cmake

  Some additional comments about finding the svn command.

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3788 3d70eeeb-363e-0410-a505-8a46323a89f2

--- TestBuild.cmake
+++ TestBuild.cmake
@@ -7,9 +7,11 @@
 SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE)

 SET (CTEST_CMAKE_COMMAND "cmake")
-# NOTE(bigler): This command isn't defined for some tests that I've seen, so it
-# may not be necessary.  Also, I'm not sure how this is dealt with on windows
-# where it should be using TortoiseSVN.
+# NOTE(bigler): On windows you should make sure something like cygwin is in
+# your path.  Then it will find cygwin's svn.  Otherwise, your nightlies
+# won't find svn and won't do the updates.  I put it in the bat script at
+# the end:
+#   set PATH=%PATH%;"C:\Program Files\CMake 2.4\bin";"c:/cygwin/bin"
 SET (CTEST_CVS_COMMAND "svn")

 # A smoke test only builds the code and doesn't run any tests, so we


To disable pthreads with MinGW, the variable must be set in the cache.

--- CMake/sitkUseGTest.cmake
+++ CMake/sitkUseGTest.cmake
@@ -37,7 +37,7 @@

   # google test does not properly use pthreads on mingw
   if (MINGW)
-    set(gtest_disable_pthreads  ON)
+    set(gtest_disable_pthreads  ON CACHE INTERNAL "" FORCE)
   endif()

   # Must build GTest as static since EXCLUDE_FROM_ALL, would exclude


fixed typo that causes warning

fixed typo that causes warning

--- opensplice-config.cmake
+++ opensplice-config.cmake
@@ -65,7 +65,7 @@
 # hack
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/setup.sh "export OSPL_URI=file:///${OPENSPLICE_PREFIX}/etc/opensplice/config/ospl.xml\n")
 if(APPLE)
-  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/setup.sh "export DYLD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:\$DYLD_LIBRARY_PATH"\n)
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/setup.sh "export DYLD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:\$DYLD_LIBRARY_PATH\n")
 endif()

 include(FindPackageHandleStandardArgs)


Bugfix

Bugfix

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@26430 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/contrib/cmake/configure/configure_zlib.cmake
+++ deal.II/contrib/cmake/configure/configure_zlib.cmake
@@ -13,7 +13,7 @@
 ENDMACRO()

-MACRO(FEATURE_ZLIB_FIND_EXTERNAL var)
+MACRO(FEATURE_ZLIB_CONFIGURE_EXTERNAL var)

   INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
   LIST(APPEND deal_ii_external_libraries ${ZLIB_LIBRARIES})


fixes

fixes

- added support for multiple targets in single binary dir
- extract flags from target properties, not only from directory property

--- pch.cmake
+++ pch.cmake
@@ -129,7 +129,8 @@
         set_target_properties(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER ${_input} XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "Yes")
     else()
         GET_FILENAME_COMPONENT(_name ${_input} NAME)
-        SET(_output "${CMAKE_CURRENT_BINARY_DIR}/${_name}.gch")
+        SET(GCH_PATH "${CMAKE_CURRENT_BINARY_DIR}/${_targetName}-pch" )
+        SET(_output "${GCH_PATH}/${_name}.gch")
     #    SET(_output "${CMAKE_BINARY_DIR}/${_name}.gch")

         string(REGEX REPLACE "[^a-zA-Z0-9]" "" OutputName ${_output})
@@ -147,19 +148,22 @@
     #        message("Additional compile flags for ${_targetName}: ${targetCompileFlags}")
             list(APPEND _compiler_FLAGS ${targetCompileFlags})

-            GET_DIRECTORY_PROPERTY(_directory_flags INCLUDE_DIRECTORIES)
-            FOREACH(item ${_directory_flags})
-              LIST(APPEND _compiler_FLAGS "-I${item}")
-            ENDFOREACH(item)
-
-            GET_DIRECTORY_PROPERTY(_directory_flags COMPILE_DEFINITIONS)
-
-            foreach( def ${_directory_flags} )
+            get_directory_property( _directory_flags INCLUDE_DIRECTORIES )
+            get_target_property( _target_include_dirs ${_targetName} INCLUDE_DIRECTORIES )
+            foreach( item ${_directory_flags} ${_target_include_dirs} )
+              list( APPEND _compiler_FLAGS "-I${item}" )
+            endforeach()
+
+            get_directory_property( _directory_flags COMPILE_DEFINITIONS )
+            get_target_property( _target_compile_definitions ${_targetName} COMPILE_DEFINITIONS )
+            foreach( def ${_directory_flags} ${_target_compile_definitions} )
                 list( APPEND _compiler_FLAGS "-D${def}" )
             endforeach()

-            GET_DIRECTORY_PROPERTY(_compile_options COMPILE_OPTIONS)
-            foreach(option ${_compile_options})
+            get_directory_property( _compile_options COMPILE_OPTIONS )
+            get_target_property( _target_compile_options ${_targetName} COMPILE_OPTIONS )
+            foreach( option ${_compile_options} ${_target_compile_options} )
+                # message( "Target: ${_targetName} Option: ${option}" )
                 # COMPILE_LANGUAGE generator expression cannot be evaluated in this context
                 set(append_option true)
                 if(${option} MATCHES ".*COMPILE_LANGUAGE.*")
@@ -173,9 +177,10 @@
                 endif()
                 # Adding CONFIG:DEBUG flags in Release and vice versa produces empty quotes to compiler command line
                 # which confuses GCC.
+                string( TOUPPER ${option} upper_option )
                 if(
-                    ( ${option} MATCHES ".*CONFIG:RELEASE.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) OR
-                    ( ${option} MATCHES ".*CONFIG:DEBUG.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
+                    ( ${upper_option} MATCHES ".*CONFIG:RELEASE.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Debug" ) OR
+                    ( ${upper_option} MATCHES ".*CONFIG:DEBUG.*" AND ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
                 )
                     set(append_option false)
                 endif()
@@ -195,6 +200,10 @@

             if( APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET )
                 list(APPEND _compiler_FLAGS "-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}")
+            endif()
+
+            if( CMAKE_CXX_STANDARD )
+                list( APPEND _compiler_FLAGS "-std=gnu++${CMAKE_CXX_STANDARD}" )
             endif()

             set(COMPILER ${CMAKE_CXX_COMPILER})
@@ -219,7 +228,7 @@
             # set(${OutputName}_CREATED true PARENT_SCOPE)
         endif()
         add_custom_target(${_targetName}_PCH DEPENDS ${_output} SOURCES ${_input})
-        target_compile_options( ${_targetName} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-include ${CMAKE_CURRENT_BINARY_DIR}/${PCH_NAME}.h -Winvalid-pch> )
+        target_compile_options( ${_targetName} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-include ${GCH_PATH}/${PCH_NAME}.h -Winvalid-pch> )
         ADD_DEPENDENCIES(${_targetName} ${_targetName}_PCH)
     endif()
   ENDIF(CMAKE_COMPILER_IS_GNUCXX OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")


Remove mkblctrl from default.cmake

Remove mkblctrl from default.cmake

Mkblctrl needs to be removed for the build to succeed.

--- boards/mro/ctrl-zero-h7/default.cmake
+++ boards/mro/ctrl-zero-h7/default.cmake
@@ -37,7 +37,6 @@
 		lights/rgbled
 		lights/rgbled_ncp5623c
 		magnetometer # all available magnetometer drivers
-		mkblctrl
 		optical_flow # all available optical flow drivers
 		#osd
 		pca9685


Fix spacing. [ci skip]

Fix spacing. [ci skip]

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -242,8 +242,8 @@
         set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
     endif ()
     if (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND CMAKE_GENERATOR STREQUAL Ninja)
-      set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
-      set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
+        set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fcolor-diagnostics")
+        set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
     endif ()
 endif ()


CMake, Add search of libssl.so.

CMake, Add search of libssl.so.

	* build-aux/cmake/modules/FindUrbiOpenSSL.cmake: Here.

--- build-aux/cmake/modules/FindUrbiOpenSSL.cmake
+++ build-aux/cmake/modules/FindUrbiOpenSSL.cmake
@@ -63,8 +63,8 @@
 #                      if the whole package has not been found.
 #
 # Here is the XXX_YY list:
-# OPEN_SSL_CRYPTO_LIBRARY
-# OPEN_SSL_DL_LIBRARY
+# URBI_OPEN_SSL_CRYPTO_LIBRARY
+# URBI_OPEN_SSL_DL_LIBRARY
 #
 ##-----------------------------------------------------------------

@@ -72,6 +72,15 @@
 package_header(${CMAKE_CURRENT_LIST_FILE})

 if(UNIX)
+    # Search for openssl library.
+    find_package(OpenSSL)
+    if(OPENSSL_FOUND)
+      # FIXME: Check if other variable are requiered
+      list(APPEND ${PACKAGE_NAME}_LIBRARIES ${OPENSSL_LIBRARIES})
+      list(APPEND ${PACKAGE_NAME}_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIRS})
+      list(APPEND ${PACKAGE_NAME}_LIBRARY_DIRS ${OPENSSL_LIBRARY_DIRS})
+    endif()
+
     # Search for the associated crypto library.
     package_search(LIBRARY ${PACKAGE_NAME}_CRYPTO_LIBRARY crypto
                    FULLNAME "SDK Engine's Cryptography"


- Fix Gradle build for sure this time

- Fix Gradle build for sure this time

--- cmake/Packaging/AndroidApkBuild.cmake
+++ cmake/Packaging/AndroidApkBuild.cmake
@@ -187,8 +187,7 @@
     # Create build directory
     #
     if(ANDROID_USE_GRADLE)
-        add_custom_command ( TARGET ${TARGET_NAME}
-            PRE_BUILD
+        execute_process (
             COMMAND ${CMAKE_COMMAND} -E copy_directory
                 "${ANDROID_PROJECT_INPUT}/Gradle" "${BUILD_DIR}"
             )


Update cmake/modules/AddSwiftUnittests.cmake

Co-authored-by: Eric Miotto <6f46436dcc7cf71597e8de5c449f423a8736f729@users.noreply.github.com>

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -40,7 +40,9 @@
   endif()

   if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
-    # Add an @rpath to the swift library directory.
+    # Add an @rpath to the swift library directory
+    # and one to the OS dylibs we require but
+    # are not building ourselves (e.g Foundation overlay)
     set_target_properties(${test_dirname} PROPERTIES
       BUILD_RPATH "${SWIFT_LIBRARY_OUTPUT_INTDIR}/swift/macosx;${SWIFT_DARWIN_STDLIB_INSTALL_NAME_DIR}")
     # Force all the swift libraries to be found via rpath.
@@ -87,4 +89,3 @@
   endif()
 endfunction()

-


Disable GCC's -Wclass-memaccess warning

Disable GCC's -Wclass-memaccess warning

It fires on things like SmallVector<std::pair<int, int>>, where we
intentionally use memcpy instead of calling the assignment operator.
This warning fires in practically every LLVM TU, so we have to do
something about it, even if we aren't interested in being 100% warning
clean with GCC.

Reported as PR37337

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -579,6 +579,11 @@
   append_if(USE_NO_UNINITIALIZED "-Wno-uninitialized" CMAKE_CXX_FLAGS)
   append_if(USE_NO_MAYBE_UNINITIALIZED "-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)

+  # Disable -Wclass-memaccess, a C++-only warning from GCC 8 that fires on
+  # LLVM's ADT classes.
+  check_cxx_compiler_flag("-Wclass-memaccess" CXX_SUPPORTS_CLASS_MEMACCESS_FLAG)
+  append_if(CXX_SUPPORTS_CLASS_MEMACCESS_FLAG "-Wno-class-memaccess" CMAKE_CXX_FLAGS)
+
   # Check if -Wnon-virtual-dtor warns even though the class is marked final.
   # If it does, don't add it. So it won't be added on clang 3.4 and older.
   # This also catches cases when -Wnon-virtual-dtor isn't supported by


[cmake] Unmark LLVM_BUILD_INSTRUMENTED_COVERAGE as experimental

The coverage bot has been stable for a while:

  http://lab.llvm.org:8080/coverage/coverage-reports/index.html

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -730,7 +730,7 @@
   message(FATAL_ERROR "Exception handling requires RTTI. You must set LLVM_ENABLE_RTTI to ON")
 endif()

-option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation (experimental)" Off)
+option(LLVM_BUILD_INSTRUMENTED "Build LLVM and tools with PGO instrumentation" Off)
 mark_as_advanced(LLVM_BUILD_INSTRUMENTED)
 append_if(LLVM_BUILD_INSTRUMENTED "-fprofile-instr-generate='${LLVM_PROFILE_FILE_PATTERN}'"
   CMAKE_CXX_FLAGS
@@ -738,7 +738,7 @@
   CMAKE_EXE_LINKER_FLAGS
   CMAKE_SHARED_LINKER_FLAGS)

-option(LLVM_BUILD_INSTRUMENTED_COVERAGE "Build LLVM and tools with Code Coverage instrumentation (experimental)" Off)
+option(LLVM_BUILD_INSTRUMENTED_COVERAGE "Build LLVM and tools with Code Coverage instrumentation" Off)
 mark_as_advanced(LLVM_BUILD_INSTRUMENTED_COVERAGE)
 append_if(LLVM_BUILD_INSTRUMENTED_COVERAGE "-fprofile-instr-generate='${LLVM_PROFILE_FILE_PATTERN}' -fcoverage-mapping"
   CMAKE_CXX_FLAGS


refs #5485 fix gcov linking

refs #5485 fix gcov linking

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@48037 c7de825b-a66e-492c-adef-691d508d4ae1

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -197,7 +197,7 @@
     foreach(lib ${ARGN})
       add_space_separated_property(TARGET ${lib} COMPILE_FLAGS --coverage)
       add_space_separated_property(TARGET ${lib} LINK_FLAGS --coverage)
-      target_link_libraries(${lib} LINK_INTERFACE_LIBRARIES_DEBUG gcov)
+      target_link_libraries(${lib} LINK_INTERFACE_LIBRARIES gcov)
     endforeach(lib)
   endif (USE_GCOV)
 endfunction(maybe_add_gcov_to_libraries)


PROTON-1722: Bump library versions after ABI change review

--- proton-c/versions.cmake
+++ proton-c/versions.cmake
@@ -1,19 +1,19 @@
 set(PN_LIB_CORE_MAJOR_VERSION 10)
 set(PN_LIB_CORE_MINOR_VERSION 2)
-set(PN_LIB_CORE_PATCH_VERSION 0)
+set(PN_LIB_CORE_PATCH_VERSION 1)
 set(PN_LIB_CORE_VERSION "${PN_LIB_CORE_MAJOR_VERSION}.${PN_LIB_CORE_MINOR_VERSION}.${PN_LIB_CORE_PATCH_VERSION}")

 set(PN_LIB_PROACTOR_MAJOR_VERSION 1)
-set(PN_LIB_PROACTOR_MINOR_VERSION 1)
+set(PN_LIB_PROACTOR_MINOR_VERSION 2)
 set(PN_LIB_PROACTOR_PATCH_VERSION 0)
 set(PN_LIB_PROACTOR_VERSION "${PN_LIB_PROACTOR_MAJOR_VERSION}.${PN_LIB_PROACTOR_MINOR_VERSION}.${PN_LIB_PROACTOR_PATCH_VERSION}")

 set(PN_LIB_LEGACY_MAJOR_VERSION 11)
-set(PN_LIB_LEGACY_MINOR_VERSION 1)
+set(PN_LIB_LEGACY_MINOR_VERSION 2)
 set(PN_LIB_LEGACY_PATCH_VERSION 0)
 set(PN_LIB_LEGACY_VERSION "${PN_LIB_LEGACY_MAJOR_VERSION}.${PN_LIB_LEGACY_MINOR_VERSION}.${PN_LIB_LEGACY_PATCH_VERSION}")

 set(PN_LIB_CPP_MAJOR_VERSION 11)
-set(PN_LIB_CPP_MINOR_VERSION 1)
+set(PN_LIB_CPP_MINOR_VERSION 2)
 set(PN_LIB_CPP_PATCH_VERSION 0)
 set(PN_LIB_CPP_VERSION "${PN_LIB_CPP_MAJOR_VERSION}.${PN_LIB_CPP_MINOR_VERSION}.${PN_LIB_CPP_PATCH_VERSION}")


Removed cxx_std_17 now we're using 20.

Removed cxx_std_17 now we're using 20.

--- CMakeModules/FindTacentProjectUtilities.cmake
+++ CMakeModules/FindTacentProjectUtilities.cmake
@@ -79,7 +79,6 @@
 	target_compile_features(
 		${PROJNAME}
 		PRIVATE
-			# cxx_std_17
 			cxx_std_20
 			)
 endfunction(tacent_target_compile_features)


BUG: Improve HeaderTest regeneration.

BUG: Improve HeaderTest regeneration.

When new headers are added are removed, the header test sources are regenerated
as required at CMake configuration.  Note that a CMake configuration is still
required when adding or removing headers.  However, the HeaderTests executables
will only be rebuilt when headers are added, removed or moved.

Props to Jean-Christophe Fillion-Robin for the suggestion to use MD5's with
CMake.

Change-Id: I5765884a840c4addc9387910d32d7beb42958027

--- CMake/ITKModuleHeaderTest.cmake
+++ CMake/ITKModuleHeaderTest.cmake
@@ -8,8 +8,9 @@
 # The tests will simply not be run if python is unavailable.
 find_package(PythonInterp)

-# The maximum number of headers in a test.  (This helps limit memory issues,
-# and the cppcheck tests.)
+# The maximum number of headers in a test.  This helps limit memory issues,
+# and the cppcheck tests.  However, if this is not unity, there is a slight
+# chance that problems may be hidden.  For a complete header check, set to "1".
 set( MAXIMUM_NUMBER_OF_HEADERS 35
   CACHE STRING "The number of headers in a HeaderTest code." )
 mark_as_advanced( MAXIMUM_NUMBER_OF_HEADERS )
@@ -44,6 +45,25 @@
       ${CMAKE_COMMAND} -E remove ${_outputs} )
     add_dependencies( ITKHeaderTests ${_name}HeaderTestClean )

+    # We check to see if the headers are changed.  If so, remove the header test
+    # source files so they are regenerated.
+    set( _headers_list_md5 "${${_name}_BINARY_DIR}/test/CMakeFiles/HeadersList.md5" )
+    list( SORT _h_files )
+    string( MD5 _new_md5 "${_h_files}" )
+    set( _regenerate_sources FALSE )
+    if( NOT EXISTS "${_headers_list_md5}" )
+      set( _regenerate_sources TRUE )
+    else()
+      file( READ "${_headers_list_md5}" _old_md5 )
+      if( NOT ("${_old_md5}" STREQUAL "${_new_md5}"))
+        set( _regenerate_sources TRUE )
+      endif()
+    endif()
+    file( WRITE "${_headers_list_md5}" "${_new_md5}" )
+    if( ${_regenerate_sources} )
+      file( REMOVE ${_outputs} )
+    endif()
+
     set( _test_num 1 )
     foreach( _header_test_src ${_outputs} )
       get_filename_component( _test_name ${_header_test_src} NAME_WE )


CMake: Permanently disable csharp until swig branch is merged.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -132,6 +132,7 @@
 _option(URHO3D_FILEWATCHER "Watch filesystem for resource changes")
 _option(URHO3D_TASKS "Enable coroutine subsystem")
 _option(URHO3D_CSHARP "Enable C# support")
+set (URHO3D_CSHARP OFF) # Disabled until swig branch is merged
 if (MSVC)
     _option(URHO3D_MINIDUMPS "Enable writing minidumps on crash")
 else ()


CMake: Do not disable C# on mobiles.

CMake: Do not disable C# on mobiles.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -166,11 +166,9 @@
     set (URHO3D_HASH_DEBUG ON)
 endif ()

-if (WEB OR MOBILE)
-    if (URHO3D_CSHARP)
-        message(WARNING "C# is not supported in this configuration.")
-        set (URHO3D_CSHARP OFF)
-    endif ()
+if (WEB AND URHO3D_CSHARP)
+    message(WARNING "C# is not supported in this configuration.")
+    set (URHO3D_CSHARP OFF)
 endif ()

 if (WEB AND BUILD_SHARED_LIBS)


Update AndroidUtils.cmake, forcing landscape orientation.

--- CMakeModules/AndroidUtils.cmake
+++ CMakeModules/AndroidUtils.cmake
@@ -1,12 +1,17 @@
 # Configure build environment to automatically generate APK's instead of executables.
 if(ANDROID)
+    # virtual targets which we'll add apks and push actions to.
+    add_custom_target( apk )
+    add_custom_target( push )
+    add_custom_target( run )
+
     # Reset output directories to be in binary folder (rather than source)
     set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
     set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME})
     set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME})
     set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBRARY_OUTPUT_PATH_ROOT}/bin/${ANDROID_NDK_ABI_NAME})

-    macro( create_android_manifest_xml filename library_so_name package_name activity_name)
+    macro( create_android_manifest_xml filename prog_name package_name activity_name)
         file( WRITE ${filename}
 "<?xml version=\"1.0\" encoding=\"utf-8\"?>
 <!-- BEGIN_INCLUDE(manifest) -->
@@ -17,8 +22,10 @@

     <!-- This is the platform API where NativeActivity was introduced. -->
     <uses-sdk android:minSdkVersion=\"14\" />
+    <uses-feature android:name=\"android.hardware.camera\" />
     <uses-permission android:name=\"android.permission.CAMERA\"/>
-    <uses-feature android:name=\"android.hardware.camera\" />
+    <uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>
+    <uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>

     <!-- This .apk has no Java code itself, so set hasCode to false. -->
     <application android:label=\"${activity_name}\" android:hasCode=\"false\">
@@ -27,10 +34,11 @@
              This will take care of integrating with our NDK code. -->
         <activity android:name=\"android.app.NativeActivity\"
                 android:label=\"${activity_name}\"
+                android:screenOrientation=\"landscape\"
                 android:configChanges=\"orientation|keyboardHidden\">
             <!-- Tell NativeActivity the name of our .so -->
             <meta-data android:name=\"android.app.lib_name\"
-                    android:value=\"${library_so_name}\" />
+                    android:value=\"${prog_name}_start\" />
             <intent-filter>
                 <action android:name=\"android.intent.action.MAIN\" />
                 <category android:name=\"android.intent.category.LAUNCHER\" />
@@ -39,7 +47,43 @@
     </application>

 </manifest>
-<!-- END_INCLUDE(manifest) -->"    )
+<!-- END_INCLUDE(manifest) -->" )
+    endmacro()
+
+    macro( create_bootstrap_library prog_name package_name)
+        set(bootstrap_cpp "${CMAKE_CURRENT_BINARY_DIR}/${prog_name}_start.cpp" )
+        file( WRITE ${bootstrap_cpp}
+"#include <android/native_activity.h>
+#include <android/log.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <cstdio>
+
+#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, \"AndroidUtils.cmake\", __VA_ARGS__))
+#define LIB_PATH \"/data/data/${package_name}/lib/\"
+
+void * load_lib(const char * l) {
+    void * handle = dlopen(l, RTLD_NOW | RTLD_GLOBAL);
+    if (!handle) {
+        LOGE( \"dlopen('%s'): %s\", l, strerror(errno) );
+    }
+    return handle;
+}
+
+void ANativeActivity_onCreate(ANativeActivity * app, void * ud, size_t udsize) {
+    #include \"${prog_name}_shared_load.h\"
+    void (*main)(ANativeActivity*, void*, size_t);
+    *(void **) (&main) = dlsym(load_lib( LIB_PATH \"lib${prog_name}.so\"), \"ANativeActivity_onCreate\");
+    if (!main) {
+        LOGE( \"undefined symbol ANativeActivity_onCreate\" );
+        exit(1);
+    }
+    (*main)(app, ud, udsize);
+}" )
+        add_library( "${prog_name}_start" SHARED ${bootstrap_cpp} )
+        target_link_libraries( "${prog_name}_start" android log )
+        add_dependencies( ${prog_name} "${prog_name}_start" )
     endmacro()

     macro( android_update android_project_name)
@@ -61,9 +105,12 @@
         # Create manifest required for APK
         set(ANDROID_PACKAGE_NAME "com.github.stevenlovegrove.pangolin.${prog_name}")
         create_android_manifest_xml(
-            "${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml" ${prog_name}
+            "${CMAKE_CURRENT_BINARY_DIR}/AndroidManifest.xml" "${prog_name}"
             "${ANDROID_PACKAGE_NAME}" "${prog_name}"
         )
+
+        # Create library that will launch this program and load shared libs
+        create_bootstrap_library( ${prog_name} ${ANDROID_PACKAGE_NAME} )

         # Generate ant build system for APK
         android_update( ${prog_name} )
@@ -78,22 +125,61 @@
         )

         # Target to install on device
-        add_custom_target( "${prog_name}-apk" ALL
+        add_custom_target( ${prog_name}-apk
             DEPENDS ${APK_FILE}
         )
+        add_dependencies(apk ${prog_name}-apk)

         # Target to install on device
-        add_custom_target( "${prog_name}-push"
+        add_custom_target( ${prog_name}-push
             COMMAND adb install -r ${APK_FILE}
             DEPENDS ${APK_FILE}
         )
+        add_dependencies(push ${prog_name}-push)

         # install and run on device
-        add_custom_target( "${prog_name}-run"
+        add_custom_target( ${prog_name}-run
             COMMAND adb shell am start -n ${ANDROID_PACKAGE_NAME}/android.app.NativeActivity
-            DEPENDS "${prog_name}-push"
+            DEPENDS ${prog_name}-push
             WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         )
+        add_dependencies(run ${prog_name}-run)
+
+        # Clear shared library loading header
+        file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${prog_name}_shared_load.h" "")
+    endmacro()
+
+    macro( add_to_depend_libs prog_name depend_file lib_name )
+            # dependents of lib
+            get_target_property(TARGET_LIBS ${lib_name} IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG)
+            foreach(SUBLIB ${TARGET_LIBS})
+                if(SUBLIB)
+                    add_to_depend_libs( ${prog_name} ${depend_file} ${SUBLIB} )
+                endif()
+            endforeach()
+
+            # lib itself
+            get_target_property(TARGET_LIB ${lib_name} IMPORTED_LOCATION_NOCONFIG)
+            if(TARGET_LIB)
+                get_filename_component(target_filename ${TARGET_LIB} NAME)
+                file( APPEND ${depend_file} "load_lib(LIB_PATH \"${target_filename}\" );\n")
+                add_custom_command(TARGET ${prog_name} POST_BUILD
+                    COMMAND ${CMAKE_COMMAND} -E copy_if_different
+                    ${TARGET_LIB} "${CMAKE_CURRENT_BINARY_DIR}/libs/${ANDROID_NDK_ABI_NAME}"
+                )
+            endif()
+    endmacro()
+
+
+    macro( target_link_libraries prog_name)
+        # _target_link_libraries corresponds to original
+        _target_link_libraries( ${prog_name} ${ARGN} )
+
+        # Add to shared library loading header.
+        set(depend_file "${CMAKE_CURRENT_BINARY_DIR}/${prog_name}_shared_load.h" )
+        foreach( LIB ${ARGN} )
+            add_to_depend_libs( ${prog_name} ${depend_file} ${LIB} )
+        endforeach()
     endmacro()

 endif()


Search for ARMA_DIR before standard paths

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -51,12 +51,10 @@

 find_path (ARMADILLO_INCLUDES Mat_meat.hpp
   PATHS
+  $ENV{ARMA_DIR}/include
   /usr/include
   /usr/local/include
   /opt/include
-  /afs/desy.de/user/y/yoon/armadillo-3.910.1/include
-  $ENV{ARMA_DIR}/include
-  #/afs/desy.de/user/y/yoon/armadillo-3.800.2/include
   PATH_SUFFIXES armadillo armadillo_bits
   )

@@ -65,11 +63,11 @@

 find_library (ARMADILLO_LIBRARIES armadillo
   PATHS
+  $ENV{ARMA_DIR}
   /usr/lib
   /usr/local/lib
   /opt/lib
   /usr/lib64
-  $ENV{ARMA_DIR}
   PATH_SUFFIXES
   )

@@ -77,8 +75,10 @@
 ## Actions taken when all components have been found

 if (ARMADILLO_INCLUDES)
-  MESSAGE("ARMA INC FOUND")
-endif (ARMADILLO_INCLUDES)
+  MESSAGE("ARMA INC FOUND: ${ARMADILLO_INCLUDES}")
+elseif(NOT ARMADILLO_INCLUDES)
+  MESSAGE("WHAT!!!!!!!!!!!!!!")
+endif()

 if (ARMADILLO_LIBRARIES)
   MESSAGE("ARMA LIB FOUND: ${ARMADILLO_LIBRARIES}")


activated test again

activated test again

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -28,7 +28,7 @@

    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp
-   #mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
+   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
    mitkNavigationToolTest.cpp
    mitkNavigationToolReaderAndWriterTest.cpp #deactivated, see bug #3461
    # -----------------------------------------------------------------------


Split off 7.12.32

Split off 7.12.32

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 12 )
-set ( HPCC_POINT 31 )
+set ( HPCC_POINT 33 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off candidate_4.0.4 branch

Split off candidate_4.0.4 branch

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 3 )
+set ( HPCC_POINT 5 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.4.38

Split off 8.4.38

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 37 )
+set ( HPCC_POINT 39 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 7.6.34

Split off 7.6.34

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 6 )
-set ( HPCC_POINT 33 )
+set ( HPCC_POINT 35 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###