x86: Revert "qemu_x86: use icount for 32-bit"

This was causing problems on some network tests.

This reverts commit 9b055ecf82c3b8e085f269a565632e2dde5a19e6.

Signed-off-by: Andrew Boie <aab045b28152628be6af0e556050d0381fd0a34d@intel.com>

--- boards/x86/qemu_x86/board.cmake
+++ boards/x86/qemu_x86/board.cmake
@@ -11,7 +11,6 @@
   set(QEMU_CPU_TYPE_${ARCH} qemu64,+x2apic)
 else()
   set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae)
-  set(ICOUNT_ARG -icount shift=5,align=off,sleep=off -rtc clock=vm)
 endif()

 set(QEMU_FLAGS_${ARCH}
@@ -20,7 +19,6 @@
   -device isa-debug-exit,iobase=0xf4,iosize=0x04
   ${REBOOT_FLAG}
   -nographic
-  ${ICOUNT_ARG}
   )

 # TODO: Support debug


Core/Build: Never overwrite the msvc cxx flags in the cache (#715)

* Setting all compiler flags in the cache led to circular bloating of
  msvc cxx parameters (was visible in console) which caused MSVC to
  rebuild the whole solution even on a small CMake change.
  It's not neccessary anyway to set the cxx parameters to the cache
  to take effect.
* Cleaning the CMake cache is recommended!

--- modules/worldengine/nucleus/src/cmake/compiler/msvc/settings.cmake
+++ modules/worldengine/nucleus/src/cmake/compiler/msvc/settings.cmake
@@ -59,7 +59,7 @@
 # Fixes a compiler-problem when using PCH - the /Ym flag is adjusted by the compiler in MSVC2012, hence we need to set an upper limit with /Zm to avoid discrepancies)
 # (And yes, this is a verified , unresolved bug with MSVC... *sigh*)
 string(REGEX REPLACE "/Zm[0-9]+ *" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500" CACHE STRING "" FORCE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm500")

 # Enable and treat as errors the following warnings to easily detect virtual function signature failures:
 # 'function' : member function does not override any base class virtual member function


r10882/sofa : push 0bf840b..f733bed

r10882/sofa : push 0bf840b..f733bed

* commit f733bed3f7f6bce75d8b3ea0964b14d826fb26f7
Hide cmake options of extlibs/metis/GKlib/

GKlib is a lib used by metis, this commit renames the cmake options it
declares and marks them as advanced to avoid pollution.

   1 files changed, 36 insertions(+), 27 deletions(-)

Former-commit-id: ac5dfaf47d8555aad2860875a4d71ac6c0300a8e

--- extlibs/metis-5.1.0/GKlib/GKlibSystem.cmake
+++ extlibs/metis-5.1.0/GKlib/GKlibSystem.cmake
@@ -3,15 +3,24 @@
 include(CheckIncludeFile)

 # Setup options.
-option(GDB "enable use of GDB" OFF)
-option(ASSERT "turn asserts on" OFF)
-option(ASSERT2 "additional assertions" OFF)
-option(DEBUG "add debugging support" OFF)
-option(GPROF "add gprof support" OFF)
-option(OPENMP "enable OpenMP support" OFF)
-option(PCRE "enable PCRE support" OFF)
-option(GKREGEX "enable GKREGEX support" OFF)
-option(GKRAND "enable GKRAND support" OFF)
+option(METIS-GKLIB_GDB "enable use of GDB" OFF)
+mark_as_advanced(METIS-GKLIB_GDB)
+option(METIS-GKLIB_ASSERT "turn asserts on" OFF)
+mark_as_advanced(METIS-GKLIB_ASSERT)
+option(METIS-GKLIB_ASSERT2 "additional assertions" OFF)
+mark_as_advanced(METIS-GKLIB_ASSERT2)
+option(METIS-GKLIB_DEBUG "add debugging support" OFF)
+mark_as_advanced(METIS-GKLIB_DEBUG)
+option(METIS-GKLIB_GPROF "add gprof support" OFF)
+mark_as_advanced(METIS-GKLIB_GPROF)
+option(METIS-GKLIB_OPENMP "enable OpenMP support" OFF)
+mark_as_advanced(METIS-GKLIB_OPENMP)
+option(METIS-GKLIB_PCRE "enable PCRE support" OFF)
+mark_as_advanced(METIS-GKLIB_PCRE)
+option(METIS-GKLIB_GKREGEX "enable GKREGEX support" OFF)
+mark_as_advanced(METIS-GKLIB_GKREGEX)
+option(METIS-GKLIB_GKRAND "enable GKRAND support" OFF)
+mark_as_advanced(METIS-GKLIB_GKRAND)

 # Add compiler flags.
 if(MSVC)
@@ -40,53 +49,53 @@
 endif(CMAKE_COMPILER_IS_GNUCC)

 # Find OpenMP if it is requested.
-if(OPENMP)
+if(METIS-GKLIB_OPENMP)
   include(FindOpenMP)
   if(OPENMP_FOUND)
     set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__OPENMP__ ${OpenMP_C_FLAGS}")
   else()
     message(WARNING "OpenMP was requested but support was not found")
   endif(OPENMP_FOUND)
-endif(OPENMP)
+endif(METIS-GKLIB_OPENMP)

 # Add various definitions.
-if(GDB)
+if(METIS-GKLIB_GDB)
   set(GKlib_COPTS "${GKlib_COPTS} -g")
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -Werror")
-endif(GDB)
+endif(METIS-GKLIB_GDB)

-if(DEBUG)
+if(METIS-GKLIB_DEBUG)
   set(GKlib_COPTS "-g")
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -DDEBUG")
-endif(DEBUG)
+endif(METIS-GKLIB_DEBUG)

-if(GPROF)
+if(METIS-GKLIB_GPROF)
   set(GKlib_COPTS "-pg")
-endif(GPROF)
+endif(METIS-GKLIB_GPROF)

-if(NOT ASSERT)
+if(NOT METIS-GKLIB_ASSERT)
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG")
-endif(NOT ASSERT)
+endif(NOT METIS-GKLIB_ASSERT)

-if(NOT ASSERT2)
+if(NOT METIS-GKLIB_ASSERT2)
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -DNDEBUG2")
-endif(NOT ASSERT2)
+endif(NOT METIS-GKLIB_ASSERT2)

 # Add various options
-if(PCRE)
+if(METIS-GKLIB_PCRE)
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -D__WITHPCRE__")
-endif(PCRE)
+endif(METIS-GKLIB_PCRE)

-if(GKREGEX)
+if(METIS-GKLIB_GKREGEX)
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKREGEX")
-endif(GKREGEX)
+endif(METIS-GKLIB_GKREGEX)

-if(GKRAND)
+if(METIS-GKLIB_GKRAND)
   set(GKlib_COPTIONS "${GKlib_COPTIONS} -DUSE_GKRAND")
-endif(GKRAND)
+endif(METIS-GKLIB_GKRAND)

 # Check for features.


ManageGConf: GConf is now in REQUIRES as well

--- Modules/ManageGConf.cmake
+++ Modules/ManageGConf.cmake
@@ -20,6 +20,7 @@
 IF(NOT DEFINED _MANAGE_GCONF_CMAKE_)
     SET(_MANAGE_GCONF_CMAKE_ DEFINED)
     INCLUDE(ManageDependency)
+    MANAGE_DEPENDENCY(REQUIRES GCONF2 REQUIRED FEDORA_NAME "GConf2")
     MANAGE_DEPENDENCY(BUILD_REQUIRES GCONF2 REQUIRED
 	PKG_CONFIG "gconf-2.0" FEDORA_NAME "GConf2" DEVEL
 	)


inite_element_to_iso_lines has been changed to a cpp file, this also needs to be specified in one of the cmake files. Tracker item 1917, https://tracker.physiomeproject.org/show_bug.cgi?id=1917

git-svn-id: 4705079bc6b8aadf675e3696f5c015a6aa4916e3@6501 3c1deb5b-d424-0410-962d-aba41a686d42

--- source/misc.cmake
+++ source/misc.cmake
@@ -25,7 +25,7 @@

 SET( FINITE_ELEMENT_GRAPHICS_SRCS
 	finite_element/finite_element_to_graphics_object.cpp
-	finite_element/finite_element_to_iso_lines.c
+	finite_element/finite_element_to_iso_lines.cpp
 	finite_element/finite_element_to_streamlines.cpp )

 SET( FINITE_ELEMENT_SRCS


Disable mongodb if boost is not found

Disable mongodb if boost is not found

--- thirdparty/mongodb/mongodb.cmake
+++ thirdparty/mongodb/mongodb.cmake
@@ -1,3 +1,23 @@
+find_library(BOOST_REGEX  boost_regex)
+find_library(BOOST_SYSTEM boost_system)
+find_library(BOOST_THREAD boost_thread)
+find_path(BOOST_INCLUDE_DIR boost/version.hpp)
+
+if(NOT EXISTS ${BOOST_REGEX})
+    message(STATUS "libboost-regex-dev not found, disabling mongodb")
+    return()
+endif()
+
+if(NOT EXISTS ${BOOST_SYSTEM})
+    message(STATUS "libboost-system-dev not found, disabling mongodb")
+    return()
+endif()
+
+if(NOT EXISTS ${BOOST_THREAD})
+    message(STATUS "libboost-thread-dev not found, disabling mongodb")
+    return()
+endif()
+
 message(STATUS "Looking for mongodb API in ${CMAKE_CURRENT_LIST_DIR}")

 find_library(MONGOCLIENT
@@ -9,19 +29,3 @@
 	mongo/config.h
     HINTS ${CMAKE_CURRENT_LIST_DIR}/include
 )
-
-find_library(BOOST_SYSTEM
-    boost_system
-)
-
-find_library(BOOST_THREAD
-    boost_thread
-)
-
-find_library(BOOST_REGEX
-    boost_regex
-)
-
-find_path(BOOST_INCLUDE_DIR
-    boost/version.hpp
-)


More robust lapacke checks

More robust lapacke checks

Former-commit-id: 9098cd0ac6902cc3cf63f47d391c18b3b848e729

--- cmake-modules/FindLAPACKE.cmake
+++ cmake-modules/FindLAPACKE.cmake
@@ -1,6 +1,6 @@

-function(CheckLapackeCompiles REQUIRED_FLAGS REQUIRED_DEFINITIONS REQUIRED_LIBRARIES_UNPARSED REQUIRED_INCLUDES)
+function(CheckLapackeCompiles TAG REQUIRED_FLAGS REQUIRED_DEFINITIONS REQUIRED_LIBRARIES_UNPARSED REQUIRED_INCLUDES REQUIRED_TARGET)
 #    message(STATUS "Checking if lapacke headers are working")
     set(REQUIRED_LIBRARIES)
     include(cmake-modules/getExpandedTarget.cmake)
@@ -12,7 +12,21 @@
             list(APPEND REQUIRED_LIBRARIES ${elem})
         endif()
     endforeach()
-    #   Test features
+
+    foreach(elem ${REQUIRED_TARGET})
+        if(TARGET ${elem})
+            expand_target_libs(${elem} expanded_libs)
+            expand_target_incs(${elem} expanded_incs)
+            expand_target_opts(${elem} expanded_opts)
+            list(APPEND REQUIRED_LIBRARIES ${expanded_libs})
+            list(APPEND REQUIRED_INCLUDES  ${expanded_incs})
+            list(APPEND REQUIRED_FLAGS     ${expanded_opts})
+        endif()
+    endforeach()
+    string(REPLACE ";" " " REQUIRED_FLAGS      "${REQUIRED_FLAGS}") # Needs to be a space-separated list
+
+
+#   Test features
     include(CheckCXXSourceCompiles)
     set(CMAKE_REQUIRED_FLAGS        ${REQUIRED_FLAGS})
     set(CMAKE_REQUIRED_DEFINITIONS  ${REQUIRED_DEFINITIONS})
@@ -44,19 +58,12 @@
            info = LAPACKE_dgels(LAPACK_ROW_MAJOR,'N',m,n,nrhs,*a,lda,*b,ldb);
            return(info);
         }
-        " LAPACKE_COMPILES)
-    if(LAPACKE_COMPILES)
-#        message(STATUS "Lapacke compiles with the following parameters:")
-        set(LAPACKE_COMPILES TRUE PARENT_SCOPE)
+        " LAPACKE_COMPILES_${TAG})
+    if(LAPACKE_COMPILES_${TAG})
+        set(LAPACKE_COMPILES_${TAG} TRUE PARENT_SCOPE)
     else()
-#        message(STATUS "Lapacke does not compile with the following parameters:")
-        set(LAPACKE_COMPILES FALSE PARENT_SCOPE)
+        set(LAPACKE_COMPILES_${TAG} FALSE PARENT_SCOPE)
     endif()
-#    message(STATUS "    flags        : " ${REQUIRED_FLAGS})
-#    message(STATUS "    definitions  : " ${REQUIRED_DEFINITIONS})
-#    message(STATUS "    libraries    : " ${REQUIRED_LIBRARIES})
-#    message(STATUS "    includes     : " ${REQUIRED_INCLUDES})
-
 endfunction()

@@ -67,20 +74,14 @@
     if(TARGET mkl)
         # Try finding lapacke in MKL library
         message(STATUS "Searching for Lapacke in Intel MKL.")
-        get_target_property(MKL_INCLUDE_DIR mkl INTERFACE_INCLUDE_DIRECTORIES)
-        get_target_property(MKL_LIBRARIES mkl INTERFACE_LINK_LIBRARIES)
-
         if(MKL_INCLUDE_DIR)
-            CheckLapackeCompiles(" "   "-DMKL_AVAILABLE"  "${MKL_LIBRARIES}" "${MKL_INCLUDE_DIR}")
+            CheckLapackeCompiles("MKL" ""  "-DMKL_AVAILABLE"  "" "" "mkl")
         endif()

-        if(LAPACKE_COMPILES)
+        if(LAPACKE_COMPILES_MKL)
             add_library(lapacke INTERFACE)
-            add_dependencies(lapacke INTERFACE mkl)
-            target_link_libraries(lapacke INTERFACE ${MKL_LIBRARIES})
-            target_include_directories(lapacke SYSTEM INTERFACE ${MKL_INCLUDE_DIR})
+            target_link_libraries(lapacke INTERFACE mkl)
             message(STATUS "Searching for Lapacke in Intel MKL - Success")
-            return()
         else()
             message(STATUS "Searching for Lapacke in Intel MKL - failed")
         endif()
@@ -93,17 +94,13 @@
 if (NOT TARGET lapacke)
     if (TARGET OpenBLAS)
         message(STATUS "Searching for Lapacke in OpenBLAS")
-        get_target_property(LAPACKE_OPENBLAS_LIBRARY   OpenBLAS INTERFACE_LINK_LIBRARIES)
-        get_target_property(LAPACKE_OPENBLAS_INCLUDE   OpenBLAS INTERFACE_INCLUDE_DIRECTORIES)
         if(LAPACKE_OPENBLAS_LIBRARY AND LAPACKE_OPENBLAS_INCLUDE)
-            CheckLapackeCompiles(" "   " "  "${LAPACKE_OPENBLAS_LIBRARY}" "${LAPACKE_OPENBLAS_INCLUDE}")
+            CheckLapackeCompiles("OpenBLAS" "" "" "" "" "OpenBLAS")
         endif()
-        if(LAPACKE_COMPILES)
+        if(LAPACKE_COMPILES_OpenBLAS)
             add_library(lapacke INTERFACE)
-            add_dependencies(lapacke INTERFACE OpenBLAS)
             target_link_libraries(lapacke INTERFACE OpenBLAS)
             message(STATUS "Searching for Lapacke in OpenBLAS - Success")
-            return()
         else()
             message(STATUS "Searching for Lapacke in OpenBLAS - failed")
         endif()
@@ -113,38 +110,43 @@

 if (NOT TARGET lapacke)
-    message(STATUS "Searching for Lapacke in system")
-    find_path(LAPACKE_INCLUDE_DIR
-            NAMES lapacke.h
-            HINTS ${LAPACKE_DIR} $ENV{CONDA_PREFIX}
-            PATHS
-            ${CMAKE_INSTALL_PREFIX}
-            ${CMAKE_INSTALL_PREFIX}/OpenBLAS
-            $ENV{BLAS_DIR}/include
-            /usr/include
-            /usr/include/x86_64-linux-gnu
-            )
-    find_library(LAPACKE_LIBRARY
-            NAMES liblapacke${CUSTOM_SUFFIX}
-            HINTS ${LAPACKE_DIR} $ENV{CONDA_PREFIX}
-            PATHS
-            $ENV{BLAS_DIR}/lib
-            ${CMAKE_INSTALL_PREFIX}
-            ${CMAKE_INSTALL_PREFIX}/OpenBLAS
-            /usr/lib
-            /usr/local/lib
-            )
-    if(LAPACKE_INCLUDE_DIR OR LAPACKE_LIBRARY)
-        CheckLapackeCompiles(" "   " "  "${LAPACKE_LIBRARY} " "${LAPACKE_INCLUDE_DIR} ")
-    endif()
-    if(LAPACKE_COMPILES)
-        add_library(lapacke INTERFACE IMPORTED)
-        target_link_libraries(lapacke INTERFACE ${LAPACKE_LIBRARY})
-        target_include_directories(lapacke SYSTEM INTERFACE ${LAPACKE_INCLUDE_DIR})
-        message(STATUS "Searching for Lapacke in system - Success: ${LAPACKE_LIBRARY}")
-        return()
-    else()
-        message(STATUS "Searching for Lapacke in system - failed")
+    if(TARGET lapack)
+        message(STATUS "Searching for Lapacke in system")
+        find_path(LAPACKE_INCLUDE_DIR
+                NAMES lapacke.h
+                HINTS ${LAPACKE_DIR} $ENV{CONDA_PREFIX}
+                PATHS
+                ${CMAKE_INSTALL_PREFIX}
+                ${CMAKE_INSTALL_PREFIX}/OpenBLAS
+                $ENV{BLAS_DIR}/include
+                /usr/include
+                /usr/include/x86_64-linux-gnu
+                )
+        find_library(LAPACKE_LIBRARY
+                NAMES liblapacke${CUSTOM_SUFFIX}
+                HINTS ${LAPACKE_DIR} $ENV{CONDA_PREFIX}
+                PATHS
+                $ENV{BLAS_DIR}/lib
+                ${CMAKE_INSTALL_PREFIX}
+                ${CMAKE_INSTALL_PREFIX}/OpenBLAS
+                /usr/lib
+                /usr/local/lib
+                )
+        if(LAPACKE_INCLUDE_DIR OR LAPACKE_LIBRARY)
+            CheckLapackeCompiles("SYSTEM" " "   " "
+                    "${LAPACKE_LIBRARY}"
+                    "${LAPACKE_INCLUDE_DIR}"
+                    "lapack"
+                    )
+        endif()
+        if(LAPACKE_COMPILES_SYSTEM)
+            add_library(lapacke INTERFACE IMPORTED)
+            target_link_libraries(lapacke INTERFACE ${LAPACKE_LIBRARY} lapack)
+            target_include_directories(lapacke SYSTEM INTERFACE ${LAPACKE_INCLUDE_DIR})
+            message(STATUS "Searching for Lapacke in system - Success: ${LAPACKE_LIBRARY}")
+        else()
+            message(STATUS "Searching for Lapacke in system - failed")
+        endif()
     endif()
 endif()


MAINT: add friendly compilation log output with gcc 4.9.

- Colored output.
- Wrap line at 72.

--- cmake/DOConfigureCompiler.cmake
+++ cmake/DOConfigureCompiler.cmake
@@ -18,6 +18,7 @@

 # Clang compiler
 elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  # Enable C++11.
   if (APPLE)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
   else ()
@@ -51,10 +52,20 @@

   do_substep_message(
     "${CMAKE_CXX_COMPILER_ID} compiler version: ${GCC_VERSION}")
+
+  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fmessage-length=72")
+
+  # Enable C++11.
   if (NOT GCC_VERSION  VERSION_LESS 4.5 AND GCC_VERSION  VERSION_LESS 4.7)
     set(ENABLE_CXX11 "-std=c++0x")
   else ()
     set (ENABLE_CXX11 "-std=c++11")
+  endif ()
+
+  # Enable colors in gcc log output.
+  if (GCC_VERSION VERSION_GREATER 4.8)
+    do_substep_message("Enable colored output of GCC.")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
   endif ()
 endif ()

@@ -66,7 +77,6 @@
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpointer-arith")
-  #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wundef")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wunused-variable")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-long-long")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")


cmake: fix find_suggested_package option.

--- cmake/FindOptionalPackage.cmake
+++ cmake/FindOptionalPackage.cmake
@@ -31,11 +31,11 @@
 	string(TOUPPER ${_normal_package} _upper_package)
 	option(WITH_${_upper_package} "Add dependency to ${_normal_package} - recommended" ON)

-	if(NOT WITHOUT_${_upper_package})
+	if(WITH_${_upper_package})
 		message(STATUS "Finding suggested package ${_normal_package}.")
 		message(STATUS "  Disable this using \"-DWITH_${_upper_package}=OFF\".")
 		find_package(${_normal_package} REQUIRED)
-	endif(NOT WITHOUT_${_upper_package})
+	endif(WITH_${_upper_package})
 endmacro(find_suggested_package)

 macro(find_optional_package _normal_package)


Removed unused CMake file

Removed unused CMake file

--- cmake/Modules/FindJansson.cmake
+++ cmake/Modules/FindJansson.cmake
@@ -1,49 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# - Try to find Jansson
-# Once done this will define
-#  JANSSON_FOUND - System has Jansson
-#  JANSSON_INCLUDE_DIRS - The Jansson include directories
-#  JANSSON_LIBRARIES - The libraries needed to use Jansson
-#  JANSSON_DEFINITIONS - Compiler switches required for using Jansson
-
-find_path(JANSSON_INCLUDE_DIR jansson.h
-	PATHS
-		/usr/include
-		/usr/local/include
-)
-
-find_library(JANSSON_LIBRARY
-	NAMES
-		jansson
-	PATHS
-		/usr/lib
-		/usr/local/lib
-)
-
-set(JANSSON_LIBRARIES ${JANSSON_LIBRARY})
-set(JANSSON_INCLUDE_DIRS ${JANSSON_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set JANSSON_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(Jansson DEFAULT_MSG
-                                  JANSSON_LIBRARY JANSSON_INCLUDE_DIR)
-
-mark_as_advanced(JANSSON_INCLUDE_DIR JANSSON_LIBRARY)


FindLuabind.cmake: Set LUABIND_INCLUDE_DIRS (plural).

--- cmake/Modules/FindLuabind.cmake
+++ cmake/Modules/FindLuabind.cmake
@@ -1,41 +1,42 @@
 # Locate Luabind library

-FIND_PATH(LUABIND_INCLUDE_DIR luabind.hpp
+FIND_PATH(LUABIND_INCLUDE_DIRS luabind/luabind.hpp
   HINTS $ENV{LUABIND_DIR}
-  PATH_SUFFIXES include/luabind include/luabind09 include
+  PATH_SUFFIXES include/luabind09 include/luabind include
 )

-FIND_LIBRARY(LUABIND_LIBRARY_RELEASE
+FIND_LIBRARY(_LUABIND_LIBRARY_RELEASE
   NAMES luabind luabind09 luabind-0.9
   HINTS $ENV{LUABIND_DIR}
   PATH_SUFFIXES lib64 lib
 )

-FIND_LIBRARY(LUABIND_LIBRARY_DEBUG
+FIND_LIBRARY(_LUABIND_LIBRARY_DEBUG
   NAMES luabind-d luabind09-d luabind-0.9-d
   HINTS $ENV{LUABIND_DIR}
   PATH_SUFFIXES lib64 lib
 )

-IF(LUABIND_LIBRARY_RELEASE OR LUABIND_LIBRARY_DEBUG)
-    IF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
-        SET(LUABIND_LIBRARY optimized ${LUABIND_LIBRARY_RELEASE}
-                            debug     ${LUABIND_LIBRARY_DEBUG})
-    ELSEIF(LUABIND_LIBRARY_RELEASE)
-        SET(LUABIND_LIBRARY ${LUABIND_LIBRARY_RELEASE})
+IF(_LUABIND_LIBRARY_RELEASE OR _LUABIND_LIBRARY_DEBUG)
+    IF(_LUABIND_LIBRARY_RELEASE AND _LUABIND_LIBRARY_DEBUG)
+        SET(_LUABIND_LIBRARY optimized ${_LUABIND_LIBRARY_RELEASE}
+                             debug     ${_LUABIND_LIBRARY_DEBUG})
+    ELSEIF(_LUABIND_LIBRARY_RELEASE)
+        SET(_LUABIND_LIBRARY ${_LUABIND_LIBRARY_RELEASE})
     ELSE()
-        SET(LUABIND_LIBRARY ${LUABIND_LIBRARY_DEBUG})
+        SET(_LUABIND_LIBRARY ${_LUABIND_LIBRARY_DEBUG})
     ENDIF()
 ENDIF()

-IF(LUABIND_LIBRARY)
-    SET(LUABIND_LIBRARIES "${LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
-ENDIF(LUABIND_LIBRARY)
+IF(_LUABIND_LIBRARY)
+    SET(LUABIND_LIBRARIES
+        "${_LUABIND_LIBRARY}" CACHE STRING "Luabind Libraries")
+ENDIF(_LUABIND_LIBRARY)

 INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
 # handle the QUIETLY and REQUIRED arguments and set LUABIND_FOUND to TRUE if
 # all listed variables are TRUE
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Luabind
-                                  REQUIRED_VARS LUABIND_LIBRARIES LUABIND_INCLUDE_DIR)
+    REQUIRED_VARS LUABIND_LIBRARIES LUABIND_INCLUDE_DIRS)

-MARK_AS_ADVANCED(LUABIND_INCLUDE_DIR LUABIND_LIBRARIES LUABIND_LIBRARY)
+MARK_AS_ADVANCED(LUABIND_INCLUDE_DIRS LUABIND_LIBRARIES)


Update Location of Zlib Download URL (#2945)

--- cmake/Modules/FindZlib_EP.cmake
+++ cmake/Modules/FindZlib_EP.cmake
@@ -83,7 +83,7 @@

     ExternalProject_Add(ep_zlib
       PREFIX "externals"
-      URL "http://prdownloads.sourceforge.net/libpng/zlib1211.zip?download"
+      URL "http://iweb.dl.sourceforge.net/project/libpng/zlib/1.2.11/zlib1211.zip"
       URL_HASH SHA1=bccd93ad3cee39c3d08eee68d45b3e11910299f2
       DOWNLOAD_NAME "zlib1211.zip"
       CMAKE_ARGS


Squashed '3rdparty/github/cmake-utils/' changes from f20c24c8..4497feec

4497feec A STATIC package dependency implies PRIVATE scope on compile definitions, link libraries and include directories

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: 4497feec7844c381761b32c72dd200f92778da28

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -61,6 +61,14 @@
   ENDIF ()
   IF (MYPACKAGE_DEBUG)
     MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency scopes are: ALL=${_ALL} TEST=${_TESTS} LIBS=${_LIBS} EXES=${_EXES}")
+  ENDIF ()
+  #
+  # Set dependency scope: PUBLIC or PRIVATE depending on _STATIC
+  #
+  IF (_STATIC)
+    SET (_package_dependency_scope "PRIVATE")
+  ELSE ()
+    SET (_package_dependency_scope "PUBLIC")
   ENDIF ()
   #
   # Check if inclusion was already done - via us or another mechanism... guessed with TARGET check
@@ -162,7 +170,7 @@
         IF (MYPACKAGE_DEBUG)
           MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding -D${packageDepend}_STATIC compile definition to target ${_target}")
         ENDIF ()
-        TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC -D${packageDepend}_STATIC)
+        TARGET_COMPILE_DEFINITIONS(${_target} ${_package_dependency_scope} -D${packageDepend}_STATIC)
         IF (MYPACKAGE_DEBUG)
           MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] ${packageDepend} dependency becomes ${packageDepend}_static for target ${_target}")
         ENDIF ()
@@ -178,7 +186,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding target ${realPackageDepend} dependency to target ${_target}")
           ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${realPackageDepend})
+          TARGET_LINK_LIBRARIES(${_target} ${_package_dependency_scope} ${realPackageDepend})
           IF (_TESTS)
             #
             # A bit painful but the target locations are not known at this time.
@@ -229,7 +237,7 @@
             IF (MYPACKAGE_DEBUG)
               MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} directory to ${_target}'s include directories")
             ENDIF ()
-            TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+            TARGET_INCLUDE_DIRECTORIES(${_target} ${_package_dependency_scope} ${_include_directory})
             #
             # Add eventually this to our project's default include directories
             #
@@ -252,7 +260,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_include_directory} directory to ${_target}'s include directories")
           ENDIF ()
-          TARGET_INCLUDE_DIRECTORIES(${_target} PUBLIC ${_include_directory})
+          TARGET_INCLUDE_DIRECTORIES(${_target} ${_package_dependency_scope} ${_include_directory})
         ENDFOREACH ()
         #
         # Library dependency
@@ -262,7 +270,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_library} library to ${_target}")
           ENDIF ()
-          TARGET_LINK_LIBRARIES(${_target} PUBLIC ${_library})
+          TARGET_LINK_LIBRARIES(${_target} ${_package_dependency_scope} ${_library})
         ENDFOREACH ()
         #
         # Compile definitions
@@ -272,7 +280,7 @@
           IF (MYPACKAGE_DEBUG)
             MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Adding ${_flag} compile flag to ${_target}")
           ENDIF ()
-          TARGET_COMPILE_DEFINITIONS(${_target} PUBLIC ${_library})
+          TARGET_COMPILE_DEFINITIONS(${_target} ${_package_dependency_scope} ${_library})
         ENDFOREACH ()
         #
         # Link flags


change opengles version, breaks compile

change opengles version, breaks compile

--- cmake/augmentation_widget.cmake
+++ cmake/augmentation_widget.cmake
@@ -12,7 +12,7 @@

 add_library( augmentation STATIC ${augmentation_SOURCES}  ${augmentation_MOC} )
 if(ANDROID)
-    target_link_libraries( augmentation ${QT_LIBRARIES} GLESv1_CM )
+    target_link_libraries( augmentation ${QT_LIBRARIES} GLESv3 )
 else()
     target_link_libraries( augmentation ${QT_LIBRARIES} GL)
 endif()


Removed extra endif.

Removed extra endif.

--- cmake/modules/FindArduino.cmake
+++ cmake/modules/FindArduino.cmake
@@ -609,6 +609,3 @@
     ARDUINO_OBJCOPY_EEP_FLAGS
     ARDUINO_OBJCOPY_HEX_FLAGS)
 load_board_settings()
-
-endif()
-


[CMake] Avoid REVERSE on unset variable

[CMake] Avoid REVERSE on unset variable

If required_libs happens to remain unset, CMake would fail with:

  list sub-command REVERSE requires list to be present.

Fix by ensuring we do not attempt to reverse an unset variable.

Reported by Tu Vuong.

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

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

--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -302,7 +302,9 @@
     expand_topologically(${lib} "${required_libs}" "${visited_libs}")
   endforeach()

-  list(REVERSE required_libs)
+  if(required_libs)
+    list(REVERSE required_libs)
+  endif()
   set(${out_libs} ${required_libs} PARENT_SCOPE)
 endfunction()


USE_TCL_TK_STUBS option temporarily set to OFF by default for this
release since using the the stubs versions of libTcl and libTk (which
is recommended by Tcl/Tk developers) has proven not to be reliable
(-dev tk segfaults) for version 8.6 of Tcl/Tk.  The stubs versions of
libTcl and libTk work fine for version 8.5 of Tcl/Tk.  Moving from the
deprecated Tcl/Tk API we currently use to the recommended Tcl/Tk API
may allow us to reliably use the stubs versions of libTcl and libTk
for all versions of Tcl/Tk post-release.

svn path=/trunk/; revision=12866

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -34,7 +34,7 @@

 option(USE_INCRTCL_VERSION_4 "Use version 4 of Itcl and Itcl, version 4.1 of Iwidgets" OFF)

-option(USE_TCL_TK_STUBS "Use Tcl/Tk stubs libraries" ON)
+option(USE_TCL_TK_STUBS "Use Tcl/Tk stubs libraries" OFF)

 # Depending on these above options and system resources may also determine
 # the following variables which are largely self-explanatory unless documented


Clean up check_uris dependencies to work around nmake limitation.

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -383,10 +383,14 @@
       LIST (GET copy_rules 1 _output_file)
       LIST (GET copy_rules 2 _depend_target)
       LIST (REMOVE_AT copy_rules 0 1 2)
+      SET (_depends "${_input_file}")
+      IF (_depend_target)
+        LIST (APPEND _depends "${_depend_target}")
+      ENDIF (_depend_target)
       ADD_CUSTOM_COMMAND (OUTPUT "${_output_file}"
         COMMAND "${CMAKE_COMMAND}" -E copy
         "${_input_file}" "${_output_file}"
-        DEPENDS "${_input_file}" "${_depend_target}"
+        DEPENDS ${_depends}
         COMMENT "Copying ${_input_file} to URI path" VERBATIM)
       LIST (APPEND _output_files "${_output_file}")
     ENDWHILE (copy_rules)


Adapt test build process with xmod and a proper clean process

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -10,10 +10,18 @@
 set (EXECUTABLE_ORIGINAL original_code_${TEST_NAME})
 set (EXECUTABLE_TRANSFORMED transformed_code_${TEST_NAME})

+# Define directory for build
+set (XMOD_DIR __xmod__)
+set (OMNI_TMP_DIR __omni_tmp__)
+
+if (NOT EXISTS ${XMOD_DIR})
+  file(MAKE_DIRECTORY ${XMOD_DIR})
+endif()
+
 # Create intermediate representation in XcodeML Fortran format
 add_custom_command(
   OUTPUT  ${OUTPUT_FILE}
-  COMMAND ${CLAWF90} -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
+  COMMAND ${CLAWF90} -J ${XMOD_DIR} -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
   DEPENDS ${ORIGINAL_FILE}
   COMMENT "Translating CLAW directive with ${CLAWF90}"
 )
@@ -30,9 +38,16 @@
   COMMENT "Clean previous transformation"
 )

+
 # Build the original code and the transformed code
 add_executable (${EXECUTABLE_ORIGINAL} ${ORIGINAL_FILE})
 add_executable (${EXECUTABLE_TRANSFORMED} ${OUTPUT_FILE})

 # Compare reference transformed code and output of the transformation
 add_test(NAME ast-transform-${TEST_NAME} COMMAND diff ${OUTPUT_FILE} ${REFERENCE_FILE})
+
+# Add build directory to be removed with clean target
+set_property(
+  DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+  PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${XMOD_DIR} ${OMNI_TMP_DIR}
+)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

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

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


Version: Update development date

Version: Update development date

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 4)
-set(CastXML_VERSION_PATCH 20211025)
+set(CastXML_VERSION_PATCH 20220308)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -133,17 +133,18 @@
 		set(http_package_cmake_filename "${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename}")
 		# 4. descargo el fichero que se supone tienes los ficheros cmake
 		if(NOT "${NO_USE_CACHE_REMOTE}")
+			message("Downloading ${http_package_cmake_filename} ...")
 			cmaki_download_file("${http_package_cmake_filename}" "${package_uncompressed_file}")
-			message("Downloading ${http_package_cmake_filename} ...")
 		endif()
 		# Si no puede descargar el artefacto ya hecho (es que necesito compilarlo y subirlo)
 		if(NOT "${COPY_SUCCESFUL}" OR "${NO_USE_CACHE_REMOTE}")

 			file(REMOVE_RECURSE "${depends_bin_package}")
 			file(REMOVE_RECURSE "${depends_package}")
-			file(REMOVE_RECURSE "${package_uncompressed_file}")
+			file(REMOVE "${package_uncompressed_file}")

 			# 5. compilo y genera el paquete en local
+			message("Generating artifact ${PACKAGE} ...")
 			execute_process(
 				COMMAND python ${ARTIFACTS_PATH}/build.py ${PACKAGE} --depends=${CMAKI_PATH}/../depends.json --cmakefiles=${CMAKI_PATH} --prefix=${CMAKE_PREFIX_PATH} --third-party-dir=${CMAKE_PREFIX_PATH}
 				WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -153,12 +154,11 @@
 				message(FATAL_ERROR "can't create artifact ${PACKAGE}")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
-				file(REMOVE_RECURSE "${package_uncompressed_file}")
+				file(REMOVE "${package_uncompressed_file}")
 			endif()

 			#######################################################
 			# 6: obtengo la version del paquete creado
-			message("python ${ARTIFACTS_PATH}/check_remote_version.py --server=${CMAKI_REPOSITORY} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE} ${EXTRA_VERSION}")
 			execute_process(
 				COMMAND python ${ARTIFACTS_PATH}/check_remote_version.py --server=${CMAKI_REPOSITORY} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE} ${EXTRA_VERSION}
 				WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -179,7 +179,6 @@
 			set(package_cmake_generated_file ${CMAKE_PREFIX_PATH}/${package_cmake_filename})

 			# 8. descomprimo el artefacto
-			message("${CMAKE_COMMAND}" -E tar zxf "${package_cmake_generated_file}")
 			execute_process(
 				COMMAND "${CMAKE_COMMAND}" -E tar zxf "${package_cmake_generated_file}"
 				WORKING_DIRECTORY "${CMAKE_PREFIX_PATH}/"
@@ -189,8 +188,8 @@
 				message(FATAL_ERROR "Extracting ${package_cmake_generated_file} failed! Error ${uncompress_result}")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
-				file(REMOVE_RECURSE "${package_uncompressed_file}")
-				file(REMOVE_RECURSE "${package_generated_file}")
+				file(REMOVE "${package_uncompressed_file}")
+				file(REMOVE "${package_generated_file}")
 			endif()

 			# y tambien descomprimo el propio tar gz
@@ -203,8 +202,8 @@
 				message(FATAL_ERROR "Extracting ${package_generated_file} failed! Error ${uncompress_result2}")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
-				file(REMOVE_RECURSE "${package_uncompressed_file}")
-				file(REMOVE_RECURSE "${package_generated_file}")
+				file(REMOVE "${package_uncompressed_file}")
+				file(REMOVE "${package_generated_file}")
 			endif()

 			# 9. subir artefactos
@@ -220,8 +219,8 @@
 				message("error in upload ${package_generated_file})")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
-				file(REMOVE_RECURSE "${package_uncompressed_file}")
-				file(REMOVE_RECURSE "${package_generated_file}")
+				file(REMOVE "${package_uncompressed_file}")
+				file(REMOVE "${package_generated_file}")
 			endif()
 			message("-- uploading ${package_cmake_generated_file}")
 			message("python ${ARTIFACTS_PATH}/upload_package.py --url=${CMAKI_REPOSITORY}/upload.php --filename=${package_cmake_generated_file}")
@@ -235,8 +234,8 @@
 				message("error in upload ${package_cmake_generated_file})")
 				file(REMOVE_RECURSE "${depends_bin_package}")
 				file(REMOVE_RECURSE "${depends_package}")
-				file(REMOVE_RECURSE "${package_uncompressed_file}")
-				file(REMOVE_RECURSE "${package_generated_file}")
+				file(REMOVE "${package_uncompressed_file}")
+				file(REMOVE "${package_generated_file}")
 			endif()

 			# 10. borro los 2 tar gz
@@ -250,13 +249,11 @@
 			execute_process(
 				COMMAND "${CMAKE_COMMAND}" -E tar zxf "${package_uncompressed_file}"
 				WORKING_DIRECTORY "${CMAKE_PREFIX_PATH}/"
-				RESULT_VARIABLE uncompress_result
-				)
+				RESULT_VARIABLE uncompress_result)
 			if(uncompress_result)
 				message(FATAL_ERROR "Extracting ${package_uncompressed_file} failed! Error ${uncompress_result}")
 			endif()
 			file(REMOVE "${package_uncompressed_file}")
-
 		endif()
 	endif()


Ported jsoncpp to iOS

Ported jsoncpp to iOS

--- ThirdPartyLibraries.cmake
+++ ThirdPartyLibraries.cmake
@@ -1703,9 +1703,10 @@

       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+      -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
       -DCMAKE_BUILD_TYPE=RELEASE
-      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
-      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
+      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS_WITH_ARCHS}
+      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS_WITH_ARCHS}
       -DCMAKE_EXE_LINKER_FLAGS=${CMAKE_EXE_LINKER_FLAGS}
       -DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
       -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}


COMP: set LD_LIBRARY_PATH for clang openmp implementation

--- src/Testing/Dashboard/elxDashboard_LKEB_linux64_clang_Debug.cmake
+++ src/Testing/Dashboard/elxDashboard_LKEB_linux64_clang_Debug.cmake
@@ -26,6 +26,7 @@
 set( CTEST_DASHBOARD_ROOT "/home/marius/nightly-builds/elastix" )
 set( CTEST_BINARY_DIRECTORY ${CTEST_DASHBOARD_ROOT}/bin_debug_clang )
 set( CTEST_MEMORYCHECK_TYPE "AddressSanitizer" )
+set( ENV{LD_LIBRARY_PATH} "/usr/local/lib:$ENV{LD_LIBRARY_PATH}" )

 # Specify the kind of dashboard to submit
 # default: Nightly


MSVC: updated the toolchain file for the latest (16.3) release.

--- toolchains/msvc.toolchain.cmake
+++ toolchains/msvc.toolchain.cmake
@@ -2,7 +2,7 @@
 #
 # T:N.U.N. Visual Studio/MSVC CMake tool chain file.
 #
-# Copyright (c) 2016 - 2017. Domagoj Saric.
+# Copyright (c) 2016 - 2019. Domagoj Saric.
 #
 ################################################################################

@@ -14,7 +14,7 @@
 #                                             (01.06.2016.) (Domagoj Saric)
 set( TNUN_compiler_debug_symbols                  -Zi                                         )
 set( TNUN_compiler_debug_flags                    -DDEBUG -Od -MDd                            )
-set( TNUN_compiler_release_flags                  -Ox -Ob2 -Oy -GF -Gw -Gm- -GS- -Gy -MD      )
+set( TNUN_compiler_release_flags                  -Ox -Oy -GF -Gw -Gm- -GS- -Gy -MD           )
 set( TNUN_linker_debug_symbols                    -DEBUG                                      )
 set( TNUN_compiler_LTO                            -GL                                         )
 set( TNUN_linker_LTO                              -LTCG                                       )
@@ -24,8 +24,8 @@
 set( TNUN_compiler_exceptions_on                  -EHsc                                       )
 set( TNUN_compiler_exceptions_off                 -D_HAS_EXCEPTIONS=0 -wd4577                 )
 set( TNUN_compiler_report_optimization            -Qpar-report:1 -Qvec-report:2               ) # https://msdn.microsoft.com/en-us/library/jj658585.aspx Vectorizer and Parallelizer Messages
-set( TNUN_compiler_optimize_for_speed             -Ox -Ot -Qpar                               )
-set( TNUN_compiler_optimize_for_size              -Ox -Os                                     )
+set( TNUN_compiler_optimize_for_speed             -Ox -Ot -Ob3 -Qpar                          )
+set( TNUN_compiler_optimize_for_size              -Ox -Os -Ob2                                )
 set( TNUN_compiler_runtime_sanity_checks          -GS -sdl -guard:cf                          ) #...mrmlj...-fp:strict would disable fast-math so for now it is moved to the dbg_only version
 set( TNUN_compiler_dbg_only_runtime_sanity_checks -RTC1 -fp:strict                            )
 set( TNUN_warnings_as_errors                      -WX                                         )
@@ -35,12 +35,14 @@

 # w4373: '...': virtual function overrides '...', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
 # w4324: 'structure was padded due to alignment specifier'
-add_compile_options( /std:c++latest -MP -Oi -Zc:threadSafeInit- -wd4324 -wd4373 )
+# w5104: 'found 'L#x' in macro replacement list, did you mean 'L""#x'?' @ windows.h + experimental PP
+# w5105: 'macro expansion producing 'defined' has undefined behavior' @ windows.h + experimental PP
+add_compile_options( /std:c++latest /permissive- /experimental:preprocessor -MP -Oi -Zc:threadSafeInit- -wd4324 -wd4373 -wd5104 -wd5105 )
 add_definitions(
   -D_CRT_SECURE_NO_WARNINGS
   -D_SCL_SECURE_NO_WARNINGS
   -D_SBCS
-  -D_WIN32_WINNT=0x0601 # Win7
+  -D_WIN32_WINNT=0x0A00 # Win10
 )

 set( TNUN_ABIs


MINIFICPP-1420 - Add alternate mirrors for libsodium

Signed-off-by: Arpad Boda <aboda@apache.org>

This closes #951

--- cmake/BundledLibSodium.cmake
+++ cmake/BundledLibSodium.cmake
@@ -40,13 +40,15 @@
     endif()

     # Build project
-    set(LIBSODIUM_URL https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz)
+    set(LIBSODIUM_OFFICIAL_MIRROR_URL https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz)
+    set(LIBSODIUM_GITHUB_MIRROR_URL https://github.com/jedisct1/libsodium/releases/download/1.0.18-RELEASE/libsodium-1.0.18.tar.gz)
+    set(LIBSODIUM_GENTOO_MIRROR_URL https://gentoo.osuosl.org/distfiles/libsodium-1.0.18.tar.gz)
     set(LIBSODIUM_URL_HASH "SHA256=6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1")

     if (WIN32)
         ExternalProject_Add(
                 libsodium-external
-                URL ${LIBSODIUM_URL}
+                URL "${LIBSODIUM_OFFICIAL_MIRROR_URL} ${LIBSODIUM_GITHUB_MIRROR_URL} ${LIBSODIUM_GENTOO_MIRROR_URL}"
                 URL_HASH ${LIBSODIUM_URL_HASH}
                 SOURCE_DIR "${BINARY_DIR}/thirdparty/libsodium-src"
                 LIST_SEPARATOR % # This is needed for passing semicolon-separated lists
@@ -60,7 +62,7 @@

         ExternalProject_Add(
                 libsodium-external
-                URL ${LIBSODIUM_URL}
+                URL "${LIBSODIUM_OFFICIAL_MIRROR_URL} ${LIBSODIUM_GITHUB_MIRROR_URL} ${LIBSODIUM_GENTOO_MIRROR_URL}"
                 URL_HASH ${LIBSODIUM_URL_HASH}
                 BUILD_IN_SOURCE true
                 SOURCE_DIR "${BINARY_DIR}/thirdparty/libsodium-src"


Uninstall: Remove empty Ruby & Python directories

--- cmake/ElektraUninstall.cmake
+++ cmake/ElektraUninstall.cmake
@@ -121,7 +121,14 @@
      "${CMAKE_INSTALL_PREFIX}/lib/lua"
      "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig"
      "${CMAKE_INSTALL_PREFIX}/lib/python2.7/site-packages"
+     "${CMAKE_INSTALL_PREFIX}/lib/python2.7/__pycache__"
      "${CMAKE_INSTALL_PREFIX}/lib/python2.7"
+     "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages/__pycache__"
+     "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages"
+     "${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
+     "${CMAKE_INSTALL_PREFIX}/lib/ruby/site_ruby"
+     "${CMAKE_INSTALL_PREFIX}/lib/ruby"
+     "${CMAKE_INSTALL_PREFIX}/lib"
      "${CMAKE_INSTALL_PREFIX}/share/appdata"
      "${CMAKE_INSTALL_PREFIX}/share/applications"
      "${CMAKE_INSTALL_PREFIX}/share/doc"


Fix coverage detection

Fix coverage detection

--- cmake/Modules/Coverage.cmake
+++ cmake/Modules/Coverage.cmake
@@ -1,12 +1,13 @@
-if( NOT CLANG AND NOT GCC )
-	if( NOT LCOV )
-		message( FATAL_ERROR "coverage not available outside of gcc and clang" )
-	endif( NOT LCOV )
-endif( NOT CLANG AND NOT GCC )
-
 option( COVERAGE "Build with gprov information" OFF )

 if( COVERAGE )
+	if( NOT CLANG AND NOT GCC )
+		if( NOT LCOV )
+			message( FATAL_ERROR "coverage not available outside of gcc and clang" )
+		endif( NOT LCOV )
+	endif( NOT CLANG AND NOT GCC )
+
+
 	find_program( GCOV
 		gcov
 		/usr/bin
@@ -80,6 +81,7 @@
 	)

 	file( GLOB_RECURSE lcov_files ${CMAKE_CURRENT_SOURCE_DIR}/*.html ${CMAKE_CURRENT_SOURCE_DIR}/*.css ${CMAKE_CURRENT_SOURCE_DIR}/*.png )
+	message( ${lcov_files} )
 	add_custom_target( coverage_clean
 		COMMAND rm ${lcov_files}
 	)


Updated OpenCVFindMatlab with changes suggested by SpecLad

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -8,15 +8,15 @@
 #   MATLAB_ROOT_DIR:    Root of Matlab installation
 #   MATLAB_BIN:         The main Matlab "executable" (shell script)
 #   MATLAB_MEX_SCRIPT:  The mex script used to compile mex files
-#   MATLAB_BIN:         The actual Matlab executable
-#   MATLAB_INCLUDE_DIR: Path to "mex.h"
-#   MATLAB_LIBRARY_DIR: Path to mex and matrix libraries
-#   MATLAB_LIBS:        The Matlab libs, usually mx, mex, mat
+#   MATLAB_INCLUDE_DIRS:Path to "mex.h"
+#   MATLAB_LIBRARY_DIRS:Path to mex and matrix libraries
+#   MATLAB_LIBRARIES:   The Matlab libs, usually mx, mex, mat
 #   MATLAB_MEXEXT:      The mex library extension. It will be one of:
 #                         mexwin32, mexwin64,  mexglx, mexa64, mexmac,
 #                         mexmaci,  mexmaci64, mexsol, mexs64
-#   MATLAB_ARCH:        The installation architecture. It is simply
-#                       the MEXEXT with the preceding "mex" removed
+#   MATLAB_ARCH:        The installation architecture. It is **usually**
+#                       the MEXEXT with the preceding "mex" removed,
+#                       though it's different for linux distros.
 #
 # There doesn't appear to be an elegant way to detect all versions of Matlab
 # across different platforms. If you know the matlab path and want to avoid
@@ -57,23 +57,8 @@
 # the absolute path in the variable MATLAB_ROOT_DIR
 function(locate_matlab_root)

-  # --- LINUX ---
-  if (UNIX AND NOT APPLE)
-    # possible root locations, in order of likelihood
-    set(SEARCH_DIRS_ /usr/local /opt/local /usr /opt)
-    foreach (DIR_ ${SEARCH_DIRS_})
-      file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/*matlab*)
-      if (MATLAB_ROOT_DIR_)
-        # sort in order from highest to lowest
-        list(SORT MATLAB_ROOT_DIR_)
-        list(REVERSE MATLAB_ROOT_DIR_)
-        list(GET MATLAB_ROOT_DIR_ 0 MATLAB_ROOT_DIR_)
-        break()
-      endif()
-    endforeach()
-
-  # --- APPLE ---
-  elseif (APPLE)
+  # --- UNIX/APPLE ---
+  if (UNIX)
     # possible root locations, in order of likelihood
     set(SEARCH_DIRS_ /Applications /usr/local /opt/local /usr /opt)
     foreach (DIR_ ${SEARCH_DIRS_})
@@ -84,21 +69,25 @@
         list(SORT MATLAB_ROOT_DIR_)
         list(REVERSE MATLAB_ROOT_DIR_)
         list(GET MATLAB_ROOT_DIR_ 0 MATLAB_ROOT_DIR_)
-        break()
+        set(MATLAB_ROOT_DIR ${MATLAB_ROOT_DIR_} PARENT_SCOPE)
+        return()
       endif()
     endforeach()

   # --- WINDOWS ---
   elseif (WIN32)
-    # search the path to see if Matlab exists there
-    # Contrary to EVERY OTHER REGEX IMPLEMENTATION ON EARTH, cmake returns
-    # the entire input string if no matches for the capture group are found.
-    string(REGEX REPLACE ".*[;=](.*[Mm][Aa][Tt][Ll][Aa][Bb][^;]*)\\\\bin.*" "\\1" MATLAB_ROOT_DIR_ "$ENV{PATH}")
-    if ("${MATLAB_ROOT_DIR_}" STREQUAL "$ENV{PATH}")
-      set(MATLAB_ROOT_DIR_)
+    # 1. search the path environment variable
+    find_program(MATLAB_ROOT_DIR_ matlab PATHS ENV PATH)
+    if (MATLAB_ROOT_DIR_)
+      # get the root directory from the full path
+      # /path/to/matlab/rootdir/bin/matlab.exe
+      get_filename_component(MATLAB_ROOT_DIR_ ${MATLAB_ROOT_DIR_} PATH)
+      get_filename_component(MATLAB_ROOT_DIR_ ${MATLAB_ROOT_DIR_} PATH)
+      set(MATLAB_ROOT_DIR ${MATLAB_ROOT_DIR_} PARENT_SCOPE)
+      return()
     endif()

-    # registry-hacking
+    # 2. search the registry
     # determine the available Matlab versions
     set(REG_EXTENSION_ "SOFTWARE\\Mathworks\\MATLAB")
     set(REG_ROOTS_ "HKEY_LOCAL_MACHINE" "HKEY_CURRENT_USER")
@@ -119,15 +108,11 @@
     # request the MATLABROOT from the registry
     foreach(REG_ROOT_ ${REG_ROOTS_})
       get_filename_component(QUERY_RESPONSE_ [${REG_ROOT_}\\${REG_EXTENSION_}\\${VERSION_};MATLABROOT] ABSOLUTE)
-      if ("${MATLAB_ROOT_DIR_}" STREQUAL "" AND NOT ${QUERY_RESPONSE_} MATCHES "registry$")
-        set(MATLAB_ROOT_DIR_ ${QUERY_RESPONSE_})
+      if (NOT ${QUERY_RESPONSE_} MATCHES "registry$")
+        set(MATLAB_ROOT_DIR ${QUERY_RESPONSE_} PARENT_SCOPE)
+        return()
       endif()
     endforeach()
-  endif()
-
-  # export the root into the parent scope
-  if (MATLAB_ROOT_DIR_)
-    set(MATLAB_ROOT_DIR ${MATLAB_ROOT_DIR_} PARENT_SCOPE)
   endif()
 endfunction()

@@ -140,11 +125,7 @@
 # sets the variable MATLAB_FOUND to TRUE
 function(locate_matlab_components MATLAB_ROOT_DIR)
   # get the mex extension
-  if (UNIX)
-    execute_process(COMMAND ${MATLAB_ROOT_DIR}/bin/mexext OUTPUT_VARIABLE MATLAB_MEXEXT_)
-  elseif (WIN32)
-    execute_process(COMMAND ${MATLAB_ROOT_DIR}/bin/mexext.bat OUTPUT_VARIABLE MATLAB_MEXEXT_)
-  endif()
+  execute_process(COMMAND ${MATLAB_ROOT_DIR}/bin/mexext OUTPUT_VARIABLE MATLAB_MEXEXT_)
   if (NOT MATLAB_MEXEXT_)
     return()
   endif()
@@ -160,35 +141,34 @@
   endforeach()

   # get the path to the libraries
-  set(MATLAB_LIBRARY_DIR_ ${MATLAB_ROOT_DIR}/bin/${MATLAB_ARCH_})
+  set(MATLAB_LIBRARY_DIRS_ ${MATLAB_ROOT_DIR}/bin/${MATLAB_ARCH_})

   # get the libraries
   set_libarch_prefix_suffix()
-  find_library(MATLAB_LIB_MX_  mx  PATHS ${MATLAB_LIBRARY_DIR_} NO_DEFAULT_PATH)
-  find_library(MATLAB_LIB_MEX_ mex PATHS ${MATLAB_LIBRARY_DIR_} NO_DEFAULT_PATH)
-  find_library(MATLAB_LIB_MAT_ mat PATHS ${MATLAB_LIBRARY_DIR_} NO_DEFAULT_PATH)
-  set(MATLAB_LIBS_ ${MATLAB_LIB_MX_} ${MATLAB_LIB_MEX_} ${MATLAB_LIB_MAT_})
+  find_library(MATLAB_LIB_MX_  mx  PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
+  find_library(MATLAB_LIB_MEX_ mex PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
+  find_library(MATLAB_LIB_MAT_ mat PATHS ${MATLAB_LIBRARY_DIRS_} NO_DEFAULT_PATH)
+  set(MATLAB_LIBRARIES_ ${MATLAB_LIB_MX_} ${MATLAB_LIB_MEX_} ${MATLAB_LIB_MAT_})

   # get the include path
-  find_path(MATLAB_INCLUDE_DIR_ mex.h ${MATLAB_ROOT_DIR}/extern/include)
+  find_path(MATLAB_INCLUDE_DIRS_ mex.h ${MATLAB_ROOT_DIR}/extern/include)

   # get the mex shell script
-  find_file(MATLAB_MEX_SCRIPT_ NAMES mex mex.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
+  find_program(MATLAB_MEX_SCRIPT_ NAMES mex PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)

   # get the Matlab executable
-  find_file(MATLAB_BIN_ NAMES matlab matlab.exe PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
+  find_program(MATLAB_BIN_ NAMES matlab PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)

   # export into parent scope
-  if (MATLAB_MEX_SCRIPT_ AND MATLAB_LIBS_ AND MATLAB_INCLUDE_DIR_)
-    set(MATLAB_BIN         ${MATLAB_BIN_}         PARENT_SCOPE)
-    set(MATLAB_MEX_SCRIPT  ${MATLAB_MEX_SCRIPT_}  PARENT_SCOPE)
-    set(MATLAB_INCLUDE_DIR ${MATLAB_INCLUDE_DIR_} PARENT_SCOPE)
-    set(MATLAB_LIBS        ${MATLAB_LIBS_}        PARENT_SCOPE)
-    set(MATLAB_LIBRARY_DIR ${MATLAB_LIBRARY_DIR_} PARENT_SCOPE)
-    set(MATLAB_MEXEXT      ${MATLAB_MEXEXT_}      PARENT_SCOPE)
-    set(MATLAB_ARCH        ${MATLAB_ARCH_}        PARENT_SCOPE)
+  if (MATLAB_MEX_SCRIPT_ AND MATLAB_LIBRARIES_ AND MATLAB_INCLUDE_DIRS_)
+    set(MATLAB_BIN          ${MATLAB_BIN_}          PARENT_SCOPE)
+    set(MATLAB_MEX_SCRIPT   ${MATLAB_MEX_SCRIPT_}   PARENT_SCOPE)
+    set(MATLAB_INCLUDE_DIRS ${MATLAB_INCLUDE_DIRS_} PARENT_SCOPE)
+    set(MATLAB_LIBRARIES    ${MATLAB_LIBRARIES_}    PARENT_SCOPE)
+    set(MATLAB_LIBRARY_DIRS ${MATLAB_LIBRARY_DIRS_} PARENT_SCOPE)
+    set(MATLAB_MEXEXT       ${MATLAB_MEXEXT_}       PARENT_SCOPE)
+    set(MATLAB_ARCH         ${MATLAB_ARCH_}         PARENT_SCOPE)
   endif()
-  return()
 endfunction()

@@ -197,9 +177,6 @@
 # FIND MATLAB COMPONENTS
 # ----------------------------------------------------------------------------
 if (NOT MATLAB_FOUND)
-
-  # guilty until proven innocent
-  set(MATLAB_FOUND FALSE)

   # attempt to find the Matlab root folder
   if (NOT MATLAB_ROOT_DIR)
@@ -210,7 +187,9 @@
   if (MATLAB_ROOT_DIR)
     locate_matlab_components(${MATLAB_ROOT_DIR})
   endif()
-  find_package_handle_standard_args(Matlab DEFAULT_MSG MATLAB_MEX_SCRIPT MATLAB_INCLUDE_DIR
-                                           MATLAB_ROOT_DIR MATLAB_LIBS   MATLAB_LIBRARY_DIR
-                                           MATLAB_MEXEXT MATLAB_ARCH MATLAB_BIN)
+  find_package_handle_standard_args(Matlab DEFAULT_MSG
+                                           MATLAB_MEX_SCRIPT   MATLAB_INCLUDE_DIRS
+                                           MATLAB_ROOT_DIR     MATLAB_LIBRARIES
+                                           MATLAB_LIBRARY_DIRS MATLAB_MEXEXT
+                                           MATLAB_ARCH         MATLAB_BIN)
 endif()


update: gcc/clang options

update: gcc/clang options

--- cmake/SetupCompilerPre.cmake
+++ cmake/SetupCompilerPre.cmake
@@ -24,7 +24,7 @@
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -pipe")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wall -Wextra")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wpointer-arith")
-  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-ignored-qualifiers")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-unused-parameter")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fmessage-length=0")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fdiagnostics-show-option")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -ferror-limit=5")
@@ -84,12 +84,9 @@
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -pipe")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wall -Wextra")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wpointer-arith")
-
-  IF(SLOPPY_COMPILE)
-    SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-ignored-qualifiers")
-    SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-unused-but-set-variable")
-    SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-unused-parameter")
-  ENDIF()
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-ignored-qualifiers")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-unused-parameter")
+  SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -Wno-unused-but-set-variable")

   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fmessage-length=0")
   SET(GLOBAL_COMPILER_FLAGS "${GLOBAL_COMPILER_FLAGS} -fdiagnostics-show-location=once")


Standardize this Find module.  Drop special LTDL_INC_SEARCH_PATH and
LTDL_LIB_SEARCH_PATH variables since the environment variables
CMAKE_INCLUDE_PATH and CMAKE_LIBRARY_PATH implement the same functionality
in a more general sense.  Messages output and execution halted on failure
depending on the standard LTDL_FIND_QUIETLY and LTDL_FIND_REQUIRED cmake
variables so that the find_package QUIET and REQUIRED options should work
correctly.

svn path=/trunk/; revision=6840

--- cmake/modules/FindLTDL.cmake
+++ cmake/modules/FindLTDL.cmake
@@ -1,28 +1,17 @@
 # - Find ltdl header and library
 #
-
-# This module is controlled by two variables optionally defined by the user.
-#  LTDL_INC_SEARCH_PATH, the first PATH(s) to check for the header, ltdl.h.
-#  LTDL_LIB_SEARCH_PATH, the first PATH(s) to check for the library.

 # This module defines
 #  LTDL_FOUND, if false, do not try to use LTDL.
 #  LTDL_INCLUDE_DIR, where to find ltdl.h.
 #  LTDL_LIBRARIES, the libraries to link against to use libltdl.

-set(LTDL_INC_SEARCH_PATH CACHE PATH
-"User-specified search path for ltdl.h")
-set(LTDL_LIB_SEARCH_PATH CACHE PATH
-"User-specified search path for ltdl library")
-
-find_path(LTDL_INCLUDE_DIR ltdl.h
-${LTDL_INC_SEARCH_PATH} /usr/local/include /usr/include
-)
+find_path(LTDL_INCLUDE_DIR ltdl.h /usr/local/include /usr/include)

 if(LTDL_INCLUDE_DIR)
   find_library(LTDL_LIBRARIES
   NAMES ltdl
-  PATHS ${LTDL_LIB_SEARCH_PATH} /usr/local/lib /usr/lib
+  PATHS /usr/local/lib /usr/lib
   )
   if(LTDL_LIBRARIES)

@@ -85,6 +74,16 @@
   endif(LTDL_LIBRARIES)
 endif(LTDL_INCLUDE_DIR)

+if(LTDL_FOUND)
+  if(NOT LTDL_FIND_QUIETLY)
+    message(STATUS "Found LTDL library")
+  endif(NOT LTDL_FIND_QUIETLY)
+else(LTDL_FOUND)
+  if(LTDL_FIND_REQUIRED)
+    message(FATAL_ERROR "Could not find LTDL library")
+  endif(LTDL_FIND_REQUIRED)
+endif(LTDL_FOUND)
+
 mark_as_advanced(
 LTDL_LTDL_ADDLIB0 LTDL_LTDL_HAVE_ADDLIB0
 LTDL_LTDL_ADDLIB1 LTDL_LTDL_HAVE_ADDLIB1


Make finder aware of external sources

Make finder aware of external sources

--- cmake/modules/FindTUIO.cmake
+++ cmake/modules/FindTUIO.cmake
@@ -15,7 +15,7 @@
 # Include dir
 find_path(TUIO_INCLUDE_DIR
   NAMES TUIO/TuioClient.h
-  PATHS ${TUIO_PKGCONF_INCLUDE_DIRS}
+  PATHS ${TUIO_PKGCONF_INCLUDE_DIRS} ${TUIO_ROOT} $ENV{TUIO_ROOT}
 )

 # also add the TUIO/ directory to the include path
@@ -27,7 +27,7 @@
 # Finally the library itself
 find_library(TUIO_LIBRARY
   NAMES TUIO
-  PATHS ${TUIO_PKGCONF_LIBRARY_DIRS}
+  PATHS ${TUIO_PKGCONF_LIBRARY_DIRS} ${TUIO_ROOT} $ENV{TUIO_ROOT}
 )

 # Set the include dir variables and the libraries and let libfind_process do the rest.


Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"

Previously, when compiling Visual Studio targets, one could see random build errors. This was caused by tablegen projects using the same build folders.
This workaround simply chains tablegen projects.

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

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -158,6 +158,12 @@
       llvm_ExternalProject_BuildCmd(tblgen_build_cmd ${target}
                                     ${LLVM_NATIVE_BUILD}
                                     CONFIGURATION Release)
+      # Create an artificial dependency between tablegen projects, because they
+      # compile the same dependencies, thus using the same build folders.
+      # FIXME: A proper fix requires sequentially chaining tablegens.
+      if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host)
+        add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
+      endif()
       add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
         COMMAND ${tblgen_build_cmd}
         DEPENDS CONFIGURE_LLVM_NATIVE ${target}


CMake: Make sure to build TableGen'd files in the binary directory

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -4,15 +4,18 @@

 macro(tablegen ofn)
   file(GLOB all_tds "*.td")
+
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     COMMAND ${LLVM_TABLEGEN} ${ARGN} -I ${CMAKE_CURRENT_SOURCE_DIR}
     -I ${LLVM_MAIN_SRC_DIR}/lib/Target -I ${LLVM_MAIN_INCLUDE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS} -o ${ofn}.tmp
+    ${CMAKE_CURRENT_SOURCE_DIR}/${LLVM_TARGET_DEFINITIONS}
+    -o ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     DEPENDS ${LLVM_TABLEGEN} ${all_tds}
     COMMENT "Building ${ofn}.tmp..."
     )
   add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
-    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ofn}.tmp ${ofn}
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different
+    ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp ${CMAKE_CURRENT_BINARY_DIR}/${ofn}
     DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${ofn}.tmp
     COMMENT "Building ${ofn}..."
     )


CMake Windows update ref#236.

CMake Windows update ref#236.

git-svn-id: 1001b6e0dd469eaa302a741812f7f5d223cf35f7@1620 ff5d1e40-2be0-497f-93bd-dc18237bd3c7

--- cmake_include/FindSZIP.cmake
+++ cmake_include/FindSZIP.cmake
@@ -28,11 +28,12 @@

 find_library(SZIP_LIB NAMES sz szip PATHS $ENV{HDF5_ROOT}/bin $ENV{HDF5_ROOT}/lib)

-find_library(ZIP_LIB NAMES z zlib zdll zlib1 zlibd zlibd1 PATHS $ENV{HDF5_ROOT}/bin $ENV{HDF5_ROOT}/lib)
-
 find_path(SZIP_INCLUDE NAMES sz.h szlib.h PATHS $ENV{HDF5_ROOT}/include)

-find_path(ZIP_INCLUDE zlib.h PATHS $ENV{HDF5_ROOT}/include)
+if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
+    find_library(ZIP_LIB NAMES z zlib zdll zlib1 zlibd zlibd1 PATHS $ENV{HDF5_ROOT}/bin $ENV{HDF5_ROOT}/lib)
+    find_path(ZIP_INCLUDE zlib.h PATHS $ENV{HDF5_ROOT}/include)
+endif(CMAKE_SYSTEM_NAME STREQUAL "Windows")

 if(SZIP_INCLUDE)
     include_directories(${SZIP_INCLUDE})


Revert "Use mapr C client instead of libhdfs.so"

This reverts commit a660ad54ef5dc886a71852bf00e63bf6487e2196.

--- cmake_modules/FindHDFS.cmake
+++ cmake_modules/FindHDFS.cmake
@@ -38,8 +38,8 @@
 set(HDFS_LIB_PATHS $ENV{HADOOP_HOME}/lib/native)
 #set(HDFS_LIB_PATHS /opt/mapr/lib $ENV{HADOOP_HOME}/lib/native/Linux-amd64-64)

-#find_library(HDFS_LIB NAMES hdfs PATHS
-find_library(HDFS_LIB NAMES MapRClient PATHS
+find_library(HDFS_LIB NAMES hdfs PATHS
+#find_library(HDFS_LIB NAMES MapRClient PATHS
   ${HDFS_LIB_PATHS}
   # make sure we don't accidentally pick up a different version
   NO_DEFAULT_PATH


COMP: CMake seems to require full specification of tag as origin/master

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -47,7 +47,7 @@
   set( proj Insight )
   ExternalProject_Add( ${proj}
     GIT_REPOSITORY "http://github.com/Slicer/ITK.git"
-    GIT_TAG "v3.20.0"
+    GIT_TAG "origin/slicer-4.0"
     SOURCE_DIR "${CMAKE_BINARY_DIR}/Insight"
     BINARY_DIR Insight-Build
     CMAKE_GENERATOR ${gen}
@@ -118,7 +118,8 @@
       ##
       set( proj VTK )
       ExternalProject_Add( ${proj}
-        GIT_REPOSITORY "http://vtk.org/VTK.git"
+        GIT_REPOSITORY "http://github.com/Slicer/VTK.git"
+        GIT_TAG "origin/slicer-4.0"
         SOURCE_DIR "${CMAKE_BINARY_DIR}/VTK"
         BINARY_DIR VTK-Build
         CMAKE_GENERATOR ${gen}
@@ -275,6 +276,7 @@
     set( proj CTK )
     ExternalProject_Add( CTK
       GIT_REPOSITORY "http://github.com/commontk/CTK.git"
+      GIT_TAG "origin/master"
       SOURCE_DIR "${CMAKE_BINARY_DIR}/CTK"
       BINARY_DIR CTK-Build
       CMAKE_GENERATOR ${gen}


Set a CMAKE_DEBUG_POSTFIX for all external projects.

This allows parallel debug and release installs.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -208,6 +208,7 @@
 set(ep_common_args
   -DCMAKE_CXX_EXTENSIONS:STRING=0
   -DCMAKE_CXX_STANDARD:STRING=11
+  -DCMAKE_DEBUG_POSTFIX:STRING=d
   -DBUILD_TESTING:BOOL=OFF
   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
   "-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>^^${CMAKE_PREFIX_PATH}"


If set, pass Qt5_DIR to MITK-superbuild.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -81,6 +81,12 @@
   "-DCMAKE_INCLUDE_PATH:PATH=${CMAKE_INCLUDE_PATH}"
   "-DCMAKE_LIBRARY_PATH:PATH=${CMAKE_LIBRARY_PATH}"
 )
+
+if(Qt5_DIR)
+  list(APPEND ep_common_cache_default_args
+    "-DQt5_DIR:PATH=${Qt5_DIR}"
+  )
+endif()

 # Include external projects
 foreach(p ${external_projects})


COMP: Superbuild - PYTHON_EXECUTABLE is now passed to CTK inner build

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -228,6 +228,7 @@
     -DCTK_KWSTYLE_EXECUTABLE:FILEPATH=${CTK_KWSTYLE_EXECUTABLE}
     -DDCMTK_DIR:PATH=${DCMTK_DIR} # FindDCMTK expects DCMTK_DIR variable to be defined
     -DVTK_DIR:PATH=${VTK_DIR}     # FindVTK expects VTK_DIR variable to be defined
+    -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}   # FindPythonInterp expects PYTHON_EXECUTABLE variable to be defined
     -DPYTHON_INCLUDE_DIR:PATH=${PYTHON_INCLUDE_DIR}     # FindPythonQt expects PYTHON_INCLUDE_DIR variable to be defined
     -DPYTHON_LIBRARY:FILEPATH=${PYTHON_LIBRARY}         # FindPythonQt expects PYTHON_LIBRARY variable to be defined
     -DPYTHONQT_INSTALL_DIR:PATH=${PYTHONQT_INSTALL_DIR} # FindPythonQt expects PYTHONQT_INSTALL_DIR variable to be defined


perform Visual Studio version detection

perform Visual Studio version detection

--- toolchains/msvc.toolchain.cmake
+++ toolchains/msvc.toolchain.cmake
@@ -64,6 +64,21 @@
 set( TNUN_arch_include_dir "${CMAKE_CURRENT_LIST_DIR}/windows" )
 include( "${TNUN_arch_include_dir}/${TNUN_ABI}.abi.cmake" )

+# Detect Visual Studio Version
+if( ${CMAKE_GENERATOR} MATCHES "Visual Studio" )
+    if(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 20 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 19)
+        message(STATUS "Detected Visual Studio 2015 (MSVC ${CMAKE_CXX_COMPILER_VERSION})")
+        set(VS_VERSION "VS2015")
+    elseif(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 19 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 18)
+        message(STATUS "Detected Visual Studio 2013 (MSVC ${CMAKE_CXX_COMPILER_VERSION})")
+        set(VS_VERSION "VS2013")
+    elseif(${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 18 AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 17)
+        message(STATUS "Detected Visual Studio 2012 (MSVC ${CMAKE_CXX_COMPILER_VERSION})")
+        set(VS_VERSION "VS2012")
+    else()
+        message(FATAL_ERROR "Unkown MSVC version")
+    endif()
+endif()

 ################################################################################
 # TNUN_setup_target_for_arch()


REFAC: update patchelf verison to 0.12

REFAC: update patchelf verison to 0.12

--- Packaging/External_patchelf.cmake
+++ Packaging/External_patchelf.cmake
@@ -41,8 +41,8 @@

 ExternalProject_Add(PATCHELF
   PREFIX "${PATCHELF_PREFIX_DIR}"
-  URL                 "https://nixos.org/releases/patchelf/patchelf-0.10/patchelf-0.10.tar.bz2"
-  URL_MD5             6c3f3a06a95705870d129494a6880106
+  URL                 "https://github.com/NixOS/patchelf/archive/refs/tags/0.12.tar.gz"
+  URL_MD5             b9d1161e52e2f342598deabf7d85ed24
   DOWNLOAD_DIR        "${DOWNLOAD_LOCATION}"
   SOURCE_DIR          "${PATCHELF_SOURCE_DIR}"
   BINARY_DIR          "${PATCHELF_SOURCE_DIR}"


fixing cmake libdir for spdlog

fixing cmake libdir for spdlog

Former-commit-id: b4a20200972604eee413667f5a0e8fd9e1151bb6

--- cmake-modules/Fetch_spdlog.cmake
+++ cmake-modules/Fetch_spdlog.cmake
@@ -26,7 +26,7 @@
     set(spdlog_DIR ${INSTALL_DIR}/spdlog/${CMAKE_INSTALL_LIBDIR}/spdlog/cmake)
     add_dependencies(spdlog external_SPDLOG)
     target_include_directories(spdlog INTERFACE ${INSTALL_DIR}/${CMAKE_INSTALL_INCLUDEDIR})
-    target_link_libraries(spdlog INTERFACE ${INSTALL_DIR}/lib/spdlog/libspdlog${CUSTOM_SUFFIX})
+    target_link_libraries(spdlog INTERFACE ${INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/spdlog/libspdlog${CUSTOM_SUFFIX})
     target_link_libraries (spdlog INTERFACE ${PTHREAD_LIBRARY})
 else()
     message("WARNING: Dependency spdlog not found and DOWNLOAD_SPDLOG is OFF. Build will fail.")


Cmake check for xcb dri3/present

Cmake check for xcb dri3/present

--- cmake/FindSinkDependencies.cmake
+++ cmake/FindSinkDependencies.cmake
@@ -7,9 +7,21 @@
 endfunction(FindWayland)

 function(FindX11 libs)
+  pkg_check_modules(XCBDRI3 xcb-dri3)
+  pkg_check_modules(XCBPRESENT xcb-present)
   pkg_check_modules(X11    REQUIRED x11)
   pkg_check_modules(XKB    xkbcommon)
   pkg_check_modules(XRANDR xrandr)
+  if(XCBDRI3_FOUND)
+	  set(${libs} ${${libs}} ${XCBDRI3_LIBRARIES} PARENT_SCOPE)
+	  include_directories (${XCBDRI3_INCLUDE_DIRS})
+  endif()
+
+  if(XCBPRESENT_FOUND)
+	  set(${libs} ${${libs}} ${XCBPRESENT_LIBRARIES} PARENT_SCOPE)
+	  include_directories (${XCBPRESENT_INCLUDE_DIRS})
+  endif()
+
   if(X11_FOUND)
     set(${libs} ${${libs}} ${X11_LIBRARIES} PARENT_SCOPE)
     include_directories (${X11_INCLUDE_DIRS})


Fixed: unable to find Discount

Fixed: unable to find Discount

--- cmake/Modules/FindDiscount.cmake
+++ cmake/Modules/FindDiscount.cmake
@@ -17,7 +17,7 @@
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Discount DEFAULT_MSG Discount_INCLUDE Discount_LIBRARY)

-if(Discount_FOUND)
+if(DISCOUNT_FOUND)
   message(STATUS "Found Discount (include: ${Discount_INCLUDE}, library: ${Discount_LIBRARY})")
   set(Discount_INCLUDES ${Discount_INCLUDE})
   set(Discount_LIBRARIES ${Discount_LIBRARY})


docu for add_sources

docu for add_sources

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -88,6 +88,13 @@
 ##################
 #
 #Thank to Michael Wild
+#
+#
+# elektra...        are the sources for all elektra targets
+# elektra-shared... are the additional sources
+#                   for elektra SHARED only (excludes elektra-full)
+# elektra-full...   are the additional sources for the versions
+#                   with all backends built-in (excludes elektra-shared)
 #
 function (add_sources target)
 	# define the <target>_SRCS properties if necessary


[cmake] Revert (rL319574): Resubmit Remove redundant call to cmake when building host tools.

Still fails for some bots.

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

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

--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -12,17 +12,6 @@
         CACHE STRING "Toolchain file for ${target_name}")
   endif()

-  if (buildtype)
-    set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
-  endif()
-  if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING)
-    set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
-  endif()
-  if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
-    # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
-    set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
-  endif()
-
   add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}
     COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_${target_name}_BUILD}
     COMMENT "Creating ${LLVM_${target_name}_BUILD}...")
@@ -34,14 +23,40 @@
     COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-        -DLLVM_TARGETS_TO_BUILD=Native
-        ${build_type_flags} ${linker_flag} ${external_clang_dir}
     WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
     DEPENDS CREATE_LLVM_${target_name}
     COMMENT "Configuring ${target_name} LLVM...")

   add_custom_target(CONFIGURE_LLVM_${target_name}
                     DEPENDS ${LLVM_${target_name}_BUILD}/CMakeCache.txt)
+
+  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
+                                      ${LLVM_${target_name}_BUILD})
+
+  if(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})
+
+    message(STATUS "Configuring ${target_name} build...")
+    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
+      ${LLVM_${target_name}_BUILD} )
+
+    message(STATUS "Configuring ${target_name} targets...")
+    if (buildtype)
+      set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
+    endif()
+    if (LLVM_USE_LINKER AND NOT CMAKE_CROSSCOMPILING)
+      set(linker_flag "-DLLVM_USE_LINKER=${LLVM_USE_LINKER}")
+    endif()
+    if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
+      # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
+      set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
+    endif()
+    execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags}
+        -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
+        ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
+        -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
+        ${external_clang_dir} ${linker_flag}
+      WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} )
+  endif(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})

 endfunction()


let llvm-config give us an include path hint too

--- cmake/modules/FindLibClang.cmake
+++ cmake/modules/FindLibClang.cmake
@@ -14,10 +14,15 @@
 		OUTPUT_VARIABLE _llvm_lib_dir
 		OUTPUT_STRIP_TRAILING_WHITESPACE
 	)
+	execute_process(
+		COMMAND ${LLVM_CONFIG} --includedir
+		OUTPUT_VARIABLE _llvm_include_dir
+		OUTPUT_STRIP_TRAILING_WHITESPACE
+	)
 endif(LLVM_CONFIG)

 # find the headers
-find_path(LIBCLANG_INCLUDE_DIR clang-c/Index.h)
+find_path(LIBCLANG_INCLUDE_DIR clang-c/Index.h HINTS ${_llvm_include_dir})

 # find the library
 find_library(LIBCLANG_LIBRARY NAMES clang libclang liblibclang HINTS ${_llvm_lib_dir})


build: correct the `DT_SONAME`

build: correct the `DT_SONAME`

When ninja is invoked from a subdirectory it will convert the path to a
relative path, and that resulted in incorrect test results. This
ensures that we get the correct soname.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -136,7 +136,7 @@
     if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
       set(emit_library -emit-library)
     else()
-      set(emit_library -emit-library -Xlinker -soname -Xlinker ${AST_OUTPUT})
+      set(emit_library -emit-library -Xlinker -soname -Xlinker ${CMAKE_SHARED_LIBRARY_PREFIX}${target}${CMAKE_SHARED_LIBRARY_SUFFIX})
     endif()
   endif()
   if(NOT AST_LIBRARY OR library_kind STREQUAL SHARED)


Revert "cmake: Limit color output to terminals"

This reverts commit c1da999748aade38240f47eee179cdd58c144c78.

--- cmake/px4_add_common_flags.cmake
+++ cmake/px4_add_common_flags.cmake
@@ -114,8 +114,8 @@
 	elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")

 		if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9)
-			# enable color for gcc > 4.9 when stdout is terminal
-			add_compile_options(-fdiagnostics-color=auto)
+			# force color for gcc > 4.9
+			add_compile_options(-fdiagnostics-color=always)
 		endif()

 		if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.3)


fix luajit w/out amalg build

fix luajit w/out amalg build

--- deps/luajit.cmake
+++ deps/luajit.cmake
@@ -222,6 +222,9 @@

 SET(SRC_LJCORE
   ${LUAJIT_DIR}/src/lj_gc.c
+  ${LUAJIT_DIR}/src/lj_buf.c
+  ${LUAJIT_DIR}/src/lj_strfmt.c
+  ${LUAJIT_DIR}/src/lj_profile.c
   ${LUAJIT_DIR}/src/lj_err.c
   ${LUAJIT_DIR}/src/lj_char.c
   ${LUAJIT_DIR}/src/lj_bc.c


Added class to create custom scrollable lists for gui components.

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -158,6 +158,7 @@
 src/util/gui/lineedit.cpp
 src/util/gui/rectarea.cpp
 src/util/gui/popup-box.cpp
+src/util/gui/scroll-list.cpp
 src/util/gui/tabbed-box.cpp
 src/util/gui/timer.cpp
 src/util/gui/widget.cpp


install zlib into subfolder zlib

install zlib into subfolder zlib

--- cmake/get-zlib.cmake
+++ cmake/get-zlib.cmake
@@ -11,7 +11,7 @@
 set(ZLIB_CMAKE_ARGS
    ${COMMON_CMAKE_ARGS}
     -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-    -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
+    -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}/zlib
     #-DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH}
     -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
     -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
@@ -23,7 +23,6 @@
     DOWNLOAD_DIR ${DEPENDENCY_DOWNLOAD_DIR}
     URL https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.zip
     #URL_MD5
-    INSTALL_DIR ${DEPENDENCY_INSTALL_DIR}
     CMAKE_ARGS ${ZLIB_CMAKE_ARGS}
 )


cmake: fix STRIP error in platform detection script

Signed-off-by: Artur Wojcik <ea75e86c6673ace627dcd6a91fbef5d4fea719d0@intel.com>

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -18,14 +18,14 @@
     if (EXISTS "/etc/lsb-release")
         file(STRINGS "/etc/lsb-release" __lsb_release_file_content)
         foreach(__line ${__lsb_release_file_content})
-            string(STRIP __line ${__line})
+            string(STRIP "${__line}" __line)
             string(REGEX MATCH "^(.+)=(.*)$" __lsb_release_values_check ${__line})
             set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
         endforeach()
     elseif (EXISTS "/etc/os-release")
         file(STRINGS "/etc/os-release" __os_release_file_content)
         foreach(__line ${__os_release_file_content})
-            string(STRIP __line ${__line})
+            string(STRIP "${__line}" __line)
             string(REGEX MATCH "^(.+)=(.*)$" __os_release_values_check ${__line})
             string(REPLACE "\"" "" __variable_value ${CMAKE_MATCH_2})
             set(__${CMAKE_MATCH_1} ${__variable_value})


Define LINUX before inclusions if they'd need it

--- cmake/platform.cmake
+++ cmake/platform.cmake
@@ -1,5 +1,5 @@
-include(compilation)
-
 if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
   set(LINUX 1)
 endif()
+
+include(compilation)


add missing dependency

add missing dependency

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -49,7 +49,7 @@
         OUTPUT_VARIABLE UBUNTU_RELEASE
         OUTPUT_STRIP_TRAILING_WHITESPACE)
     set(CPACK_PACKAGE_FILE_NAME "omplapp_${OMPL_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}-Ubuntu${UBUNTU_RELEASE}")
-    set(CPACK_DEBIAN_PACKAGE_DEPENDS "python${PYTHON_VERSION}, libboost-all-dev, libode-dev")
+    set(CPACK_DEBIAN_PACKAGE_DEPENDS "python${PYTHON_VERSION}, libboost-all-dev, libode-dev, libtriangle-dev")
 endif()

 if(WIN32)


Updated rosbuild.cmake.

Updated rosbuild.cmake.

--- rosbuild.cmake
+++ rosbuild.cmake
@@ -36,7 +36,7 @@
     MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/planners.yaml"
     DEPENDS "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
     COMMAND "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
-            --version="${OMPL_VERSION}"
+            --include-dirs="${OMPL_INCLUDE_DIRS}"
             < "${PROJECT_SOURCE_DIR}/planners.yaml"
             > "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
 )


Fixes CMake lint issues.

Fixes CMake lint issues.

--- rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
+++ rosidl_generator_dds_idl/cmake/rosidl_generate_dds_interfaces.cmake
@@ -52,7 +52,7 @@
     get_filename_component(_name "${_idl_file}" NAME_WE)
     if(_extension STREQUAL ".msg")
       set(_allowed_parent_folders "msg" "srv" "action")
-      if (NOT _parent_folder IN_LIST _allowed_parent_folders)
+      if(NOT _parent_folder IN_LIST _allowed_parent_folders)
         message(FATAL_ERROR "Interface file with unknown parent folder: ${_idl_file}")
       endif()
       set(_generated_files "_generated_${_parent_folder}_files")
@@ -61,7 +61,7 @@
       # TODO(dirk-thomas) this is only done for opensplice
       # and should be move to the opensplice specific generator package
       set(_allowed_parent_folders "srv" "action")
-      if (NOT _parent_folder IN_LIST _allowed_parent_folders)
+      if(NOT _parent_folder IN_LIST _allowed_parent_folders)
         message(FATAL_ERROR "Interface file with unknown parent folder: ${_idl_file}")
       endif()
       set(_generated_files "_generated_${_parent_folder}_files")


CMake: creation of the macros SALOME_UPDATE_FLAG_AND_LOG_PACKAGE() and SALOME_PACKAGE_REPORT(). The two are used to register optional packages and to turn off specific configuration flags when the optional prerequisites is not found. The final setup is printed on screen through SALOME_PACKAGE_REPORT()

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -242,7 +242,7 @@
   ENDIF()

   # If the package was not found, force the cache flag to OFF
-  IF(NOT isFound)
+  IF(NOT _isFound)
     SET(${flag} OFF)
   ENDIF()
 ENDMACRO(SALOME_UPDATE_FLAG_AND_LOG_PACKAGE)


Add a dependency on the resource compiler for the generated files.

--- Core/Code/CppMicroServices/CMake/usFunctionEmbedResources.cmake
+++ Core/Code/CppMicroServices/CMake/usFunctionEmbedResources.cmake
@@ -136,7 +136,7 @@
     OUTPUT ${us_cpp_resource_file}
     COMMAND ${resource_compiler} "${us_lib_name}" ${us_cpp_resource_file} ${cmd_line_args}
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    DEPENDS ${absolute_res_files}
+    DEPENDS ${absolute_res_files} ${resource_compiler}
     COMMENT "Generating embedded resource file ${us_cpp_resource_name}"
   )


modules: avoid repeating the same include dirs over and over.

Similarly to the _LIBRARIES above, just add stuff that is not already
there.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -506,7 +506,7 @@
         string(TOUPPER ${dependency} _DEPENDENCY)
         if(MAGNUM_${_DEPENDENCY}_LIBRARY)
             list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCY_LIBRARIES ${MAGNUM_${_DEPENDENCY}_LIBRARY} ${_MAGNUM_${_DEPENDENCY}_LIBRARIES})
-            list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCY_INCLUDE_DIRS ${MAGNUM_${_DEPENDENCY}_INCLUDE_DIRS})
+            list(APPEND _MAGNUM_${_COMPONENT}_DEPENDENCY_INCLUDE_DIRS ${_MAGNUM_${_DEPENDENCY}_INCLUDE_DIRS})
         else()
             unset(MAGNUM_${_COMPONENT}_LIBRARY)
         endif()


CI: disable Shark for now due to bug in boost_serialization

--- CI/ubuntu-18.04-llvm-shark.cmake
+++ CI/ubuntu-18.04-llvm-shark.cmake
@@ -27,4 +27,5 @@
 CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld
 CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld
 CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld
+OTB_USE_SHARK:BOOL=ON
 ")


activate tests in monteverdi2

activate tests in monteverdi2

--- CMake/External_Monteverdi2.cmake
+++ CMake/External_Monteverdi2.cmake
@@ -33,6 +33,7 @@
     endif()
 endif()

+#TODO: control build testing via cmake variable properly
 ExternalProject_Add(${proj}
    PREFIX ${proj}
    HG_REPOSITORY "http://hg.orfeo-toolbox.org/Monteverdi2"
@@ -43,7 +44,7 @@
    CMAKE_CACHE_ARGS
     -DCMAKE_BUILD_TYPE:STRING=Release
     -DBUILD_SHARED_LIBS:BOOL=ON
-    -DBUILD_TESTING:BOOL=${BUILD_TESTING}
+    -DBUILD_TESTING:BOOL=ON
     -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
     -DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX};${CMAKE_PREFIX_PATH}
     -DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}


Modified FindDirectX.cmake to behave closer to our other find scripts. Should fix part 2 of 2765664.

--- CMake/Packages/FindDirectX.cmake
+++ CMake/Packages/FindDirectX.cmake
@@ -6,51 +6,49 @@
 # DirectX_LIBRARY
 # DirectX_ROOT_DIR

-set(DirectX_FOUND false)
-
 if(WIN32) # The only platform it makes sense to check for DirectX SDK
-
-  # We start with Microsoft DirectX SDK (August 2008) 9.24.1400
-  # Example of path is C:\apps_x86\Microsoft DirectX SDK (August 2008)\Include
-  find_path(DirectX_INCLUDE_DIR d3d9.h
-    "$ENV{DXSDK_DIR}/Include"
-    "C:/apps_x86/Microsoft DirectX SDK*/Include"
-    "C:/Program Files (x86)/Microsoft DirectX SDK*/Include"
-    "C:/apps/Microsoft DirectX SDK*/Include"
-    "C:/Program Files/Microsoft DirectX SDK*/Include"
-    )
-  mark_as_advanced(DirectX_INCLUDE_DIR)
+  include(FindPkgMacros)
+  findpkg_begin(DirectX)
+
+  # construct search paths
+  set(DirectX_PREFIX_PATH ${DXSDK_DIR} $ENV{DXSDK_DIR}
+    "C:/apps_x86/Microsoft DirectX SDK*"
+    "C:/Program Files (x86)/Microsoft DirectX SDK*"
+    "C:/apps/Microsoft DirectX SDK*"
+    "C:/Program Files/Microsoft DirectX SDK*"
+	"$ENV{ProgramFiles}/Microsoft DirectX SDK*"
+  )
+  create_search_paths(DirectX)
+  # redo search if prefix path changed
+  clear_if_changed(DirectX_PREFIX_PATH
+    DirectX_LIBRARY
+	DirectX_INCLUDE_DIR
+	DirectX_ROOT_DIR
+  )
+
+  find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH})
+  # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
+  # lib files are in DirectX_ROOT_DIR/Lib/x64|x86
+  if(CMAKE_CL_64)
+    set(DirectX_LIBPATH_SUFFIX "x64")
+  else(CMAKE_CL_64)
+    set(DirectX_LIBPATH_SUFFIX "x86")
+  endif(CMAKE_CL_64)
+  find_library(DirectX_LIBRARY NAMES d3d9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
+
   if(DirectX_INCLUDE_DIR)
     set(DirectX_ROOT_DIR "${DirectX_INCLUDE_DIR}/..")
   endif(DirectX_INCLUDE_DIR)

-  # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
-  # lib files are in DirectX_ROOT_DIR/Lib/x64|x86

-  set(DirectX_LIBRARY_PATHS)
-  if(CMAKE_CL_64)
-    set(DirectX_LIBRARY_PATHS
-      "${DirectX_ROOT_DIR}/Lib/x64")
-  else(CMAKE_CL_64)
-    set(DirectX_LIBRARY_PATHS
-      "${DirectX_ROOT_DIR}/Lib/x86" "${DirectX_ROOT_DIR}/Lib")
-  endif(CMAKE_CL_64)
+  findpkg_finish(DirectX)

-  find_library(DirectX_LIBRARY d3d9 ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)
-  if(DirectX_INCLUDE_DIR AND DirectX_LIBRARY)
-    set(DirectX_FOUND true)
-  endif(DirectX_INCLUDE_DIR AND DirectX_LIBRARY)
-  mark_as_advanced(DirectX_LIBRARY)
-
-  #message("DirectX_FOUND=${DirectX_FOUND}")
-  #message("DirectX_INCLUDE_DIR=${DirectX_INCLUDE_DIR}")
-  #message("DirectX_LIBRARY=${DirectX_LIBRARY}")
-  #message("DirectX_ROOT_DIR=${DirectX_ROOT_DIR}")
-
   # look for D3D10.1 components
   if (DirectX_FOUND)
-    find_path(DirectX_D3D10_INCLUDE_DIR NAMES d3d10_1shader.h HINTS ${DirectX_INCLUDE_DIR})
-	find_library(DirectX_D3D10_LIBRARY NAMES d3d10 HINTS ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)
+    find_path(DirectX_D3D10_INCLUDE_DIR NAMES d3d10_1shader.h HINTS ${DirectX_INCLUDE_DIR} NO_DEFAULT_PATH)
+	get_filename_component(DirectX_LIBRARY_DIR "${DirectX_LIBRARY}" PATH)
+	message(STATUS "DX lib dir: ${DirectX_LIBRARY_DIR}")
+	find_library(DirectX_D3D10_LIBRARY NAMES d3d10 HINTS ${DirectX_LIBRARY_DIR} NO_DEFAULT_PATH)
 	if (DirectX_D3D10_INCLUDE_DIR AND DirectX_D3D10_LIBRARY)
 	  set(DirectX_D3D10_FOUND TRUE)
 	  set(DirectX_D3D10_INCLUDE_DIRS ${DirectX_D3D10_INCLUDE_DIR})


Fixing path of the installed examples directory

--- CMakeModules/AFInstallDirs.cmake
+++ CMakeModules/AFInstallDirs.cmake
@@ -29,9 +29,8 @@
   set(AF_INSTALL_DOC_DIR "${AF_INSTALL_DATA_DIR}/doc" CACHE PATH "Installation path for documentation")
 endif()

-# Examples
 if(NOT DEFINED AF_INSTALL_EXAMPLE_DIR)
-  set(AF_INSTALL_EXAMPLE_DIR "${AF_INSTALL_DATA_DIR}/examples" CACHE PATH "Installation path for examples")
+  set(AF_INSTALL_EXAMPLE_DIR "${AF_INSTALL_DATA_DIR}" CACHE PATH "Installation path for examples")
 endif()

 # Man pages


Add default for PVRTexLib on linux

Add default for PVRTexLib on linux

--- CMakeModules/FindPVRTexLib.cmake
+++ CMakeModules/FindPVRTexLib.cmake
@@ -56,30 +56,51 @@
 #  PVRTEXLIB_LIBRARIES - The libraries needed to use PVRTexLib

 IF (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+  SET( PVRTEXLIB_ROOT "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" )
   find_path(
     PVRTEXLIB_INCLUDE_DIR PVRTexture.h
-    PATHS "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Include"
+    PATHS ${PVRTEXLIB_ROOT}/Include
   )

   find_library(PVRTEXLIB_LIB PVRTexLib
-    PATHS "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Static"
-          "/Applications/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/OSX_x86/Dynamic"
+    PATHS ${PVRTEXLIB_ROOT}/OSX_x86/Static
+          ${PVRTEXLIB_ROOT}/OSX_x86/Dynamic
   )
-ELSEIF(MSVC)
+ELSEIF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+  SET( PVRTEXLIB_ROOT "/opt/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" )
   find_path(
     PVRTEXLIB_INCLUDE_DIR PVRTexture.h
-    PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Include"
+    PATHS ${PVRTEXLIB_ROOT}/Include
+  )
+
+  IF(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+    find_library(PVRTEXLIB_LIB PVRTexLib
+      PATHS ${PVRTEXLIB_ROOT}/Linux_x86_64/Static
+            ${PVRTEXLIB_ROOT}/Linux_x86_64/Dynamic
+    )
+  ELSE()
+    find_library(PVRTEXLIB_LIB PVRTexLib
+      PATHS ${PVRTEXLIB_ROOT}/Linux_x86_32/Static
+            ${PVRTEXLIB_ROOT}/Linux_x86_32/Dynamic
+    )
+  ENDIF()
+
+ELSEIF(MSVC)
+  SET( PVRTEXLIB_ROOT "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library" )
+  find_path(
+    PVRTEXLIB_INCLUDE_DIR PVRTexture.h
+    PATHS ${PVRTEXLIB_ROOT}/Include
   )

   IF(${CMAKE_GENERATOR} MATCHES Win64)
     find_library(PVRTEXLIB_LIB PVRTexLib
-      PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_64/Static"
-            "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_64/Dynamic"
+      PATHS ${PVRTEXLIB_ROOT}/Windows_x86_64/Static
+            ${PVRTEXLIB_ROOT}/Windows_x86_64/Dynamic
     )
   ELSE()
     find_library(PVRTEXLIB_LIB PVRTexLib
-      PATHS "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_32/Static"
-            "C:/Imagination/PowerVR/GraphicsSDK/PVRTexTool/Library/Windows_x86_32/Dynamic"
+      PATHS ${PVRTEXLIB_ROOT}/Windows_x86_32/Static
+            ${PVRTEXLIB_ROOT}/Windows_x86_32/Dynamic
     )
   ENDIF()
 ENDIF()
@@ -93,4 +114,4 @@
 find_package_handle_standard_args(PVRTexLib  DEFAULT_MSG
                                   PVRTEXLIB_LIB PVRTEXLIB_INCLUDE_DIR)

-mark_as_advanced(PVRTEXLIB_INCLUDE_DIR PVRTEXLIB_LIB )
+mark_as_advanced( PVRTEXLIB_ROOT PVRTEXLIB_INCLUDE_DIR PVRTEXLIB_LIB )


[ci skip] Fix WARN_AS_ERROR_FLAGS is not working properly

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -3,7 +3,7 @@
 #

 # Set warnings as errors flag
-option(CUBBYFLOW_WARNINGS_AS_ERRORS ON)
+option(CUBBYFLOW_WARNINGS_AS_ERRORS "Treat all warnings as errors" ON)
 if(CUBBYFLOW_WARNINGS_AS_ERRORS)
 	if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
 		set(WARN_AS_ERROR_FLAGS	"/WX")
@@ -82,7 +82,6 @@
 		# /wd4592     # -> disable warning: 'identifier': symbol will be dynamically initialized (implementation limitation)
 		# /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
 		# /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)
-		/wd4717       # -> disable warning: recursive on all control paths, function will cause runtime stack overflow (wrong warning)

 		#$<$<CONFIG:Debug>:
 		#/RTCc        # -> value is assigned to a smaller data type and results in a data loss


Added new CTK Plugins to PluginList

Added new CTK Plugins to PluginList

--- Modules/Bundles/PluginList.cmake
+++ Modules/Bundles/PluginList.cmake
@@ -7,4 +7,6 @@
   org.mitk.gui.qt.extapplication:ON
   org.mitk.planarfigure:ON
   org.mitk.gui.qt.datamanager:ON
+  org.mitk.gui.qt.imagenavigator:ON
+  org.mitk.gui.qt.moviemaker:ON
   )


[Numerics] add copy of hdf5 files for test

--- Numerics/cmake/SiconosTools.cmake
+++ Numerics/cmake/SiconosTools.cmake
@@ -142,6 +142,7 @@
     RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${_D}
     *.mat
     *.dat
+    *.hdf5
     *.xml
     *.DAT
     *.INI)


COMP: Correct ParallelMPI module test dependencies

Parallel XML writers have been moved to a new module
vtkIOParalleXML (see 7355859). Tests in the ParallelMPI
module use the Parallel XML multi-block writer, hence they
now need to depend on vtkIOParallelXML, instead of
vtkIOParallel. Fixed that.

Change-Id: I5490cd9d9b5bbaeb7f1c29826f002ef97515dc4e

--- Filters/ParallelMPI/module.cmake
+++ Filters/ParallelMPI/module.cmake
@@ -9,7 +9,7 @@
     vtkParallelMPI
   TEST_DEPENDS
     vtkIOXML
-    vtkIOParallel
+    vtkIOParallelXML
     vtkCommonDataModel
     vtkTestingCore
   )


CI: disable shark due to boost_serialization issue

--- CI/ubuntu-18.04-llvm-shark.cmake
+++ CI/ubuntu-18.04-llvm-shark.cmake
@@ -27,5 +27,5 @@
 CMAKE_EXE_LINKER_FLAGS:STRING=-fuse-ld=lld
 CMAKE_MODULE_LINKER_FLAGS:STRING=-fuse-ld=lld
 CMAKE_SHARED_LINKER_FLAGS:STRING=-fuse-ld=lld
-OTB_USE_SHARK:BOOL=ON
+OTB_USE_SHARK:BOOL=OFF
 ")


ctkMacroWrapPythonQt - Make sure PYTHON_LIBRARY_PATH is valid on Windows

--- CMake/ctkMacroWrapPythonQt.cmake
+++ CMake/ctkMacroWrapPythonQt.cmake
@@ -111,7 +111,7 @@
   get_filename_component(PYTHON_DIR_PATH ${PYTHON_EXECUTABLE} PATH)
   set(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH}/../lib)
   IF(WIN32)
-    set(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH}/../bin)
+    set(PYTHON_LIBRARY_PATH ${PYTHON_DIR_PATH})
   ENDIF(WIN32)

   # Clear log file


Remove default build support for 1.x arches

These GPUs are now more than 5 years old.

--- CMake/hoomd/HOOMDCUDASetup.cmake
+++ CMake/hoomd/HOOMDCUDASetup.cmake
@@ -38,17 +38,11 @@
 if (ENABLE_CUDA)
     # setup nvcc to build for all CUDA architectures. Allow user to modify the list if desired
     if (CUDA_VERSION VERSION_GREATER 4.99)
-        set(CUDA_ARCH_LIST 12 13 20 30 35 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
+        set(CUDA_ARCH_LIST 20 30 35 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
     elseif (CUDA_VERSION VERSION_GREATER 4.1)
-        set(CUDA_ARCH_LIST 12 13 20 30 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
+        set(CUDA_ARCH_LIST 20 30 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
     else()
-        set(CUDA_ARCH_LIST 12 13 20 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
-    endif()
-
-    # if double precision is on, remove incompatible arches
-    if (NOT SINGLE_PRECISION)
-        list(REMOVE_ITEM CUDA_ARCH_LIST 13 12 11 10)
-        message(STATUS "Double precision build enabled, removing support for compute 1.x")
+        set(CUDA_ARCH_LIST 20 CACHE STRING "List of target sm_ architectures to compile CUDA code for. Separate with semicolons.")
     endif()

     foreach(_cuda_arch ${CUDA_ARCH_LIST})


COMP: Build all pyramid components by default

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -66,8 +66,8 @@
   -DUSE_DistancePreservingRigidityPenalty:BOOL=OFF
   -DUSE_EulerTransformElastix:BOOL=ON
   -DUSE_FiniteDifferenceGradientDescent:BOOL=OFF
-  -DUSE_FixedGenericPyramid:BOOL=OFF
-  -DUSE_FixedRecursivePyramid:BOOL=OFF
+  -DUSE_FixedGenericPyramid:BOOL=ON
+  -DUSE_FixedRecursivePyramid:BOOL=ON
   -DUSE_FixedShrinkingPyramid:BOOL=ON
   -DUSE_FixedSmoothingPyramid:BOOL=ON
   -DUSE_FullSampler:BOOL=OFF
@@ -78,8 +78,8 @@
   -DUSE_LinearInterpolator:BOOL=ON
   -DUSE_LinearResampleInterpolator:BOOL=ON
   -DUSE_MissingStructurePenalty:BOOL=OFF
-  -DUSE_MovingGenericPyramid:BOOL=OFF
-  -DUSE_MovingRecursivePyramid:BOOL=OFF
+  -DUSE_MovingGenericPyramid:BOOL=ON
+  -DUSE_MovingRecursivePyramid:BOOL=ON
   -DUSE_MovingShrinkingPyramid:BOOL=ON
   -DUSE_MovingSmoothingPyramid:BOOL=ON
   -DUSE_MultiBSplineTransformWithNormal:BOOL=OFF


ENH: Update elastix

ENH: Update elastix

--- SuperBuild/External_Elastix.cmake
+++ SuperBuild/External_Elastix.cmake
@@ -2,7 +2,7 @@
 file( WRITE "${CMAKE_CURRENT_BINARY_DIR}/${proj}-build/CMakeCacheInit.txt" "${ep_common_cache}" )

 set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/SuperElastix/elastix )
-set( ELASTIX_GIT_TAG 0ce6c24a2b74c0132f1a53848321f1c7a92162ea )
+set( ELASTIX_GIT_TAG 1f504cf08cc73bc1c11ce2b29fcb3b8c14383cb6 )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


ManageZanataScript: Remove the include of ManageEnvironment

--- Modules/ManageZanataScript.cmake
+++ Modules/ManageZanataScript.cmake
@@ -147,7 +147,7 @@
 GET_FILENAME_COMPONENT(CMAKE_FEDORA_MODULE_DIR
     "${MANAGE_MODULE_PATH}" PATH)

-INCLUDE(ManageEnvironment)
+INCLUDE(ManageEnvironmentCommon)
 INCLUDE(ManageString)
 INCLUDE(ManageVariable)
 INCLUDE(ManageVersion)


Add Windows Kit detection for Windows 10. Close #911.

--- CMake/Modules/FindDirect3D.cmake
+++ CMake/Modules/FindDirect3D.cmake
@@ -50,6 +50,7 @@
 # Only need to search the DLL as a proxy for the presence of the MS Windows SDK
 # Note: do not use default paths such as the PATH variable, to potentially avoid using a wrong architecture DLL
 find_file (DIRECT3D_DLL NAMES ${DLL_NAMES} PATHS
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${PATH_SUFFIX}"
     NO_DEFAULT_PATH)


New module for new system (ubuntu 14)

New module for new system (ubuntu 14)

--- fsm/cmake/FindSpeechtools.cmake
+++ fsm/cmake/FindSpeechtools.cmake
@@ -18,9 +18,9 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)

-find_path(SPEECHTOOLS_INCLUDE_DIRS EST/EST.h
+find_path(SPEECHTOOLS_INCLUDE_DIRS speech_tools/EST.h
 		  HINTS /usr/include /usr/local/include
-		  PATH_SUFFIXES EST)
+		  PATH_SUFFIXES speech_tools)

 find_library(ESTBASE_LIBRARIES estbase
 		   HINTS /usr/lib/ usr/local/lib)
@@ -30,7 +30,7 @@
 		   HINTS /usr/lib/ usr/local/lib)

 SET(SPEECHTOOLS_LIBRARIES ${ESTOOLS_LIBRARIES} ${ESTBASE_LIBRARIES} ${ESTSTRING_LIBRARIES})
-SET(SPEECHTOOLS_INCLUDE_DIR ${SPEECHTOOLS_INCLUDE_DIRS}/EST)
+SET(SPEECHTOOLS_INCLUDE_DIR ${SPEECHTOOLS_INCLUDE_DIRS}/speech_tools)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Festival DEFAULT_MSG


Ticket #1789: Flags need to be adjusted both linux and windows

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -502,9 +502,11 @@
 endif(CONDOR_EXTERNALS AND NOT WINDOWS)

 ######### special case for contrib
-if (WINDOWS AND WANT_CONTRIB AND WITH_MANAGEMENT)
+if (WANT_CONTRIB AND WITH_MANAGEMENT)
     # global scoping external linkage var when options enable.
-    set (CONDOR_QMF condor_qmflib;${QPID_FOUND})
+    if (WINDOWS)
+        set (CONDOR_QMF condor_qmflib;${QPID_FOUND})
+    endif()
     add_definitions( -DWANT_CONTRIB )
     add_definitions( -DWITH_MANAGEMENT )
 endif()


OPENCV: fixing dependencies of package highgui

- adding missing "e" in depends

Change-Id: Ic6404b8384a0e2c04f007b4b0d02d4aec3317e53
Reviewed-on: http://gerrit.aldebaran.lan:8080/3392
Reviewed-by: llec <42f1a1c02cacc0f5b0188f0127ea77bedfdcf21a@aldebaran-robotics.com>
Reviewed-by: ewirbel <000207eeda0ccaab43180a4d03b5e4463d19fe94@aldebaran-robotics.com>
Tested-by: ewirbel <000207eeda0ccaab43180a4d03b5e4463d19fe94@aldebaran-robotics.com>

--- cmake/qibuild/modules/opencv2_highgui-config.cmake
+++ cmake/qibuild/modules/opencv2_highgui-config.cmake
@@ -5,4 +5,4 @@
 get_filename_component(_ROOT_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
 include("${_ROOT_DIR}/opencv2utils.cmake")

-opencv2_flib(highgui DPENDS core)
+opencv2_flib(highgui DEPENDS core)


allow generator expression in resources

allow generator expression in resources

--- ament_cmake_core/cmake/index/ament_index_register_resource.cmake
+++ ament_cmake_core/cmake/index/ament_index_register_resource.cmake
@@ -17,6 +17,9 @@

 #
 # Register a package resource of a specific type with the index.
+#
+# For both CONTENT as well as CONTENT_FILE CMake generator expressions are
+# supported.
 #
 # :param resource_type: the type of the resource
 # :type resource_type: string
@@ -76,15 +79,15 @@
     "${CMAKE_BINARY_DIR}/ament_cmake_index/${destination}/${ARG_PACKAGE_NAME}")

   if(ARG_CONTENT OR NOT ARG_CONTENT_FILE)
-    # use the CONTENT argument to create the marker file
-    file(WRITE "${marker_file}" "${ARG_CONTENT}")
+    file(GENERATE OUTPUT "${marker_file}" CONTENT "${ARG_CONTENT}")
   else()
-    # expand template
+    # content file is a  .in template
     configure_file(
       "${ARG_CONTENT_FILE}"
-      "${marker_file}"
+      "${marker_file}.genexp"
       @ONLY
     )
+    file(GENERATE OUTPUT "${marker_file}" INPUT "${marker_file}.genexp")
   endif()

   install(


build: eliminate ICC warnings

build: eliminate ICC warnings

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -368,4 +368,10 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4589") # Constructor of abstract class ... ignores initializer for virtual base class 'cv::Algorithm'
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4359") # Alignment specifier is less than actual alignment (4), and will be ignored
   endif()
-endif()
+
+  if(CV_ICC AND NOT ENABLE_NOISY_WARNINGS)
+    foreach(flags CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_DEBUG)
+      string(REGEX REPLACE "( |^)/W[0-9]+( |$)" "\\1\\2" ${flags} "${${flags}}")
+    endforeach()
+  endif()
+endif()