improved FindJSONCPP to automatically download jsoncpp package if not found

--- cmake/FindJSONCPP.cmake
+++ cmake/FindJSONCPP.cmake
@@ -1,11 +1,15 @@
+#------------------------------------------------------------------------
 #
-# Safety Framework for Component-based Robotics
+# CASROS: Component-based Architecture for Safe Robotic Systems
 #
-# Copyright (C) 2012 Min Yang Jung, Peter Kazanzides
+# Copyright (C) 2012-2014 Min Yang Jung
 #
-# Distributed under the Boost Software License, Version 1.0.
-# (See accompanying file LICENSE_1_0.txt or copy at
-# http://www.boost.org/LICENSE_1_0.txt)
+#------------------------------------------------------------------------
+#
+# Created on   : Sep 24, 2012
+# Last revision: Mar 19, 2014
+# Author       : Min Yang Jung (myj@jhu.edu)
+# Github       : https://github.com/minyang/casros
 #

 #
@@ -26,15 +30,67 @@
 #       http://jsoncpp.sourceforge.net
 #

-#find_path(JSONCPP_INCLUDE_DIR NAMES jsoncpp/json.h DOC "Directory containing jsoncpp/json.h")
-#find_library(JSONCPP_LIBRARY NAMES json_linux-gcc-4.2.1_libmt DOC "Path to jsoncpp library")
-find_path(JSONCPP_INCLUDE_DIR NAMES json.h DOC "Directory containing json.h")
-find_library(JSONCPP_LIBRARY NAMES jsoncpp DOC "Path to jsoncpp library")
+set (JSONCPP_FOUND OFF)

-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(JSONCPP DEFAULT_MSG JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
+if (SF_ON_MAC)
+  set (JSONCPP_INCLUDE_DEFAULT_PATH "/opt/local/include/json") # mac port
+  set (JSONCPP_LIB_DEFAULT_PATH "/opt/local/lib/") # mac port
+elseif (SF_ON_WINDOWS)
+  # TODO
+elseif (SF_ON_LINUX)
+  # TODO
+endif ()

-if(JSONCPP_FOUND)
+find_path(JSONCPP_INCLUDE_DIR NAMES json.h
+                              DOC "Directory containing json.h"
+                              PATHS ${JSONCPP_INCLUDE_DEFAULT_PATH})
+find_library(JSONCPP_LIBRARY NAMES jsoncpp
+                             DOC "Path to jsoncpp library"
+                             PATHS ${JSONCPP_LIB_DEFAULT_PATH})
+
+if (DEFINED ${JSONCPP_INCLUDE_DIR} AND DEFINED ${JSONCPP_LIBRARY})
+  message("JSONCPP found")
+  set (JSONCPP_FOUND TRUE)
+else()
+  message("JSONCPP not found -- will be downloaded and compiled during build")
+endif ()
+
+if (JSONCPP_FOUND)
   set(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
   set(JSONCPP_INCLUDE_DIR ${JSONCPP_INCLUDE_DIR})# PARENT_SCOPE)
-endif(JSONCPP_FOUND)
+else ()
+  # if not found, try downloading and building JSON automatically
+  include (ExternalProject)
+  set (JSONCPP_SVN_REPOSITORY svn://svn.code.sf.net/p/jsoncpp/code/trunk/jsoncpp)
+  set (JSONCPP_SVN_REVISION 276)
+  ExternalProject_Add (jsoncppExternal
+                       PREFIX casrosJSON
+                       SVN_REPOSITORY ${JSONCPP_SVN_REPOSITORY}
+                       SVN_REVISION   -r ${JSONCPP_SVN_REVISION}
+                       CMAKE_CACHE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
+                                        -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+                                        -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
+                                        -DOPTION_BUILD_EXAMPLES:BOOL=OFF
+                                        -DJSONCPP_WITH_TESTS:BOOL=OFF
+                                        -DJSONCPP_LIB_BUILD_SHARED:BOOL=ON
+                                        -DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF
+                                        -DCMAKE_INSTALL_PREFIX:FILEPATH=${SF_BUILD_ROOT}/external/json
+                       INSTALL_DIR ${SF_BUILD_ROOT}/external/json
+                       )
+
+  # Set all JSON variables based on install directory
+  set (JSONCPP_INCLUDE_DIR "${SF_BUILD_ROOT}/external/json/include")
+  set (JSONCPP_INCLUDE_DIR ${JSONCPP_INCLUDE_DIR} PARENT_SCOPE)
+
+  set (JSONCPP_LIBRARY_DIRS "${SF_BUILD_ROOT}/external/json/lib")
+  set (JSONCPP_LIBRARY_DIRS ${JSONCPP_LIBRARY_DIRS} PARENT_SCOPE)
+  set (JSONCPP_LIBRARIES jsoncpp)
+  set (JSONCPP_LIBRARIES ${JSONCPP_LIBRARIES} PARENT_SCOPE)
+
+  set (JSONCPP_FOUND ON)
+  set (JSONCPP_FOUND ON PARENT_SCOPE)
+
+  message(STATUS "JSONCPP include dir: ${JSONCPP_INCLUDE_DIR}")
+  message(STATUS "JSONCPP libs:${JSONCPP_LIBRARIES}")
+  message(STATUS "JSONCPP library dir:${JSONCPP_LIBRARY_DIRS}")
+endif ()


yaml: cmake build fixed

yaml: cmake build fixed

git-svn-id: 064804baee87e6f2e88b9d97c5d2047848bd4f18@7222 1b0b35fe-f740-4c1b-b404-a338b32e513b

--- cmake/FindLibYAML.cmake
+++ cmake/FindLibYAML.cmake
@@ -6,11 +6,27 @@
 #    LIBYAML_INCLUDE_DIR
 #    LIBYAML_LIBRARY

+FIND_LIBRARY(LIBYAML_LIBRARY
+  NAMES libyaml yaml
+  PATHS
+    ${LIBYAML_LIBRARIES}
+)

-FIND_PATH(LIBYAML_INCLUDE_DIR NAMES yaml.h)
-FIND_LIBRARY(LIBYAML_LIBRARIES NAMES yaml libyaml)
+FIND_PATH(LIBYAML_INCLUDE_DIR
+  NAMES yaml.h
+  PATHS
+#   ${libyaml_FRAMEWORK_INCLUDES}
+    ${LIBYAML_INCLUDE_DIRS}
+    ${LIBYAML_INCLUDE_DIR}
+)
+
+MARK_AS_ADVANCED(
+  LIBYAML_LIBRARY
+  LIBYAML_INCLUDE_DIR
+)
+SET(LIBYAML_INCLUDE_DIRS "${LIBYAML_INCLUDE_DIR}")
+SET(LIBYAML_LIBRARIES "${LIBYAML_LIBRARY}")

 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Yaml DEFAULT_MSG LIBYAML_LIBRARIES LIBYAML_INCLUDE_DIR)
-MARK_AS_ADVANCED(LIBYAML_INCLUDE_DIR LIBYAML_LIBRARIES)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibYAML DEFAULT_MSG LIBYAML_LIBRARIES LIBYAML_INCLUDE_DIRS)


build: fix FindLibgit2

build: fix FindLibgit2

--- cmake/FindLibgit2.cmake
+++ cmake/FindLibgit2.cmake
@@ -12,7 +12,8 @@
   /usr/include
   /sw/include)

-find_library(libgit2_LIBRARY NAMES libgit2.a libgit2.so libgit2.dylib NO_DEFAULT_PATH PATHS
+set(libgit2_NAMES ${libgit2_NAMES} git2 )
+find_library(libgit2_LIBRARY NAMES ${libgit2_NAMES} NO_DEFAULT_PATH PATHS
   /opt/local/lib
   /usr/local/lib
   /usr/lib


Use all LDFLAGS when linking without pkgconfig

We're already using the `_LDFLAGS` for any libraries discovered via
pkgconfig; we should make sure to use the same pattern when discovering
libraries via CMake's `find_library` command.

--- cmake/FindPrereqs.cmake
+++ cmake/FindPrereqs.cmake
@@ -70,7 +70,7 @@
         include_directories(${${UPPER_SHORT_NAME}_INCLUDE_DIRS})
         link_directories(${${UPPER_SHORT_NAME}_LIBRARY_DIRS})
     else (USE_CUSTOM_${UPPER_SHORT_NAME})
-        find_library(${UPPER_SHORT_NAME}_LIBRARIES ${LIB_NAME})
+        find_library(${UPPER_SHORT_NAME}_LDFLAGS ${LIB_NAME})
     endif (USE_CUSTOM_${UPPER_SHORT_NAME})

 endfunction(library_prereq)


Fix mac build issue.

Fix mac build issue.

Signed-off-by: FellowTraveler <71f9e3635dd61a511a33df5b0216634229abc0cb@gmail.com>

--- cmake/Findopentxs.cmake
+++ cmake/Findopentxs.cmake
@@ -9,7 +9,7 @@

   find_library(
       OPENTXS_LIBRARIES
-      NAMES libopentxs.so libopentxs.a libopentxs.dynlib
+      NAMES libopentxs.dylib libopentxs.so libopentxs.a
       HINTS ${PC_OPENTXS_LIBRARY_DIRS}
   )


Added a "rd" suffix for libraries built in "RelWithDebInfo" because it would otherwise sometimes cause some rebuild configuration mismatches here when switching between this and "Release" build.

Former-commit-id: e44f2de7e1edd59261aa674b0cc9d6ae58b061c8

--- cmake/postProject.cmake
+++ cmake/postProject.cmake
@@ -77,14 +77,14 @@
     set_target_properties(${PROJECT_NAME} PROPERTIES
         DEBUG_POSTFIX "${BUILDSUFFIX}d"
         RELEASE_POSTFIX "${BUILDSUFFIX}"
-        RELWITHDEBINFO_POSTFIX "${BUILDSUFFIX}"
+        RELWITHDEBINFO_POSTFIX "${BUILDSUFFIX}rd"
         MINSIZEREL_POSTFIX "${BUILDSUFFIX}"
         COMPILE_DEFINITIONS_DEBUG "SOFA_LIBSUFFIX=${LIBSUFFIX}d"
+		COMPILE_DEFINITIONS_RELWITHDEBINFO "SOFA_LIBSUFFIX=${LIBSUFFIX}rd"
         )
 	if(NOT "${LIBSUFFIX}" STREQUAL "")
 		set_target_properties(${PROJECT_NAME} PROPERTIES
 			COMPILE_DEFINITIONS_RELEASE "SOFA_LIBSUFFIX=${LIBSUFFIX}"
-			COMPILE_DEFINITIONS_RELWITHDEBINFO "SOFA_LIBSUFFIX=${LIBSUFFIX}"
 			COMPILE_DEFINITIONS_MINSIZEREL "SOFA_LIBSUFFIX=${LIBSUFFIX}"
 			)
 	endif()


Loader: Fix 32-bit Cmake detection of ImageMagick

Older versions of Cmake didn't like the newer script.

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -101,10 +101,10 @@
   if (WIN32)
     # If a 64-bit compile, it can only appear in "[HKLM]\\software\\ImageMagick"
     if (CMAKE_CL_64)
-
-      set (IMAGEMAGIC_REG_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]" PARENT_SCOPE)
-      set (IMAGEMAGIC_REGINCLUDE_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include" PARENT_SCOPE)
-      set (IMAGEMAGIC_REGLIB_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib" PARENT_SCOPE)
+
+        GET_FILENAME_COMPONENT(IM_BIN_PATH
+          [HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]
+          ABSOLUTE CACHE)

     else()

@@ -115,23 +115,28 @@
         [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ImageMagick\\Current;BinPath]
         PATH)

-      # If a 32-bit compile on a 64-bit Windows, it appears in "[HKLM]\\software\\WOW6432Node\\ImageMagick"
-      if (TESTING STREQUAL "C:/Program Files (x86)")
+      # If the WOW6432Node reg string returns empty, assume 32-bit OS, and look in the standard reg path.
+      if (TESTING STREQUAL "")

-        set (IMAGEMAGIC_REG_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ImageMagick\\Current;BinPath] PARENT_SCOPE)
-        set (IMAGEMAGIC_REGINCLUDE_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ImageMagick\\Current;BinPath]/include PARENT_SCOPE)
-        set (IMAGEMAGIC_REGLIB_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ImageMagick\\Current;BinPath]/lib PARENT_SCOPE)
-
-      # If a 32-bit compile on a 32-bit Windows, it appears in "[HKLM]\\software\\ImageMagick"
+        GET_FILENAME_COMPONENT(IM_BIN_PATH
+          [HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]
+          ABSOLUTE CACHE)
+
+      # Otherwise, the WOW6432Node returned a string, assume 32-bit build on 64-bit OS and use that string.
       else()
-
-        set (IMAGEMAGIC_REG_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath] PARENT_SCOPE)
-        set (IMAGEMAGIC_REGINCLUDE_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/include PARENT_SCOPE)
-        set (IMAGEMAGIC_REGLIB_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\ImageMagick\\Current;BinPath]/lib PARENT_SCOPE)
+
+        GET_FILENAME_COMPONENT(IM_BIN_PATH
+          [HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\ImageMagick\\Current;BinPath]
+          ABSOLUTE CACHE)

       endif()

     endif()
+
+    set (IMAGEMAGIC_REG_PATH ${IM_BIN_PATH} PARENT_SCOPE)
+    set (IMAGEMAGIC_REGINCLUDE_PATH ${IM_BIN_PATH}/include PARENT_SCOPE)
+    set (IMAGEMAGIC_REGLIB_PATH ${IM_BIN_PATH}/lib PARENT_SCOPE)
+
   else()

   message(WARNING "In FIND_REGISTRY:  LINUX_BUILD")


[cmake] fix warning

[cmake] fix warning

--- cmake/FindLibexecinfo.cmake
+++ cmake/FindLibexecinfo.cmake
@@ -42,7 +42,7 @@
 endif()

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(LibExecinfo
+find_package_handle_standard_args(Libexecinfo
   DEFAULT_MSG LIBEXECINFO_INCLUDE_DIR LIBEXECINFO_LIB_FOUND)
 mark_as_advanced(LIBEXECINFO_INCLUDE_DIR LIBEXECINFO_LIBRARIES
   LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE LIBEXECINFO_LIB_FOUND)


Add QTest to find libraries script

Add QTest to find libraries script

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -14,6 +14,10 @@
 find_package( Qt5PrintSupport )
 if( NOT Qt5PrintSupport_FOUND )
   message( FATAL_ERROR "Could not find Qt5PrintSupport.  Build cannot continue." )
+endif()
+find_package( Qt5Test )
+if( NOT Qt5Test_FOUND )
+  message( FATAL_ERROR "Could not find Qt5Test.  Build cannot continue." )
 endif()
 if( WIN32 )
   set( QT_THIRD_PARTY_LIBS


changed to find TBB library(VS2015)

changed to find TBB library(VS2015)

--- cmake/OpenCVDetectTBB.cmake
+++ cmake/OpenCVDetectTBB.cmake
@@ -65,6 +65,8 @@
           set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc11")
         elseif(MSVC12)
           set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc12")
+        elseif(MSVC14)
+          set(_TBB_LIB_PATH "${_TBB_LIB_PATH}/vc14")
         endif()
         set(TBB_LIB_DIR "${_TBB_LIB_PATH}" CACHE PATH "Full path of TBB library directory")
         link_directories("${TBB_LIB_DIR}")


Added implicit dependency from python and python-py to debian packages.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -69,7 +69,11 @@
 set(CPACK_COMPONENT_docs_DEPENDS libs)
 set(CPACK_COMPONENT_java_DEPENDS libs)
 set(CPACK_COMPONENT_python_DEPENDS libs)
+set(CPACK_DEB_python_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}")
 set(CPACK_COMPONENT_tests_DEPENDS libs)
+if (HAVE_opencv_python)
+  set(CPACK_DEB_tests_PACKAGE_DEPENDS "python${PYTHON_VERSION_MAJOR_MINOR}, python-py | python-pytest")
+endif()

 if(HAVE_CUDA)
   string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})


Added 0.7-p3 version for ccv in default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -54,6 +54,7 @@
 hunter_config(TIFF VERSION 4.0.2-hunter-2)
 hunter_config(Washer VERSION 0.1.2)
 hunter_config(ZLIB VERSION 1.2.8-p2)
+hunter_config(ccv VERSION 0.7-p3)
 hunter_config(cvmatio VERSION 1.0.11)
 hunter_config(dlib VERSION 18.14-p1)
 hunter_config(ios_sim VERSION 3.1.1)


Upgrade MKLDNN to v0.18-rc and fix issue caused by lib/lib64 (#15861)

* Upgrade MKLDNN to v0.18-rc and fix issue caused by lib/lib64

Upgrade MKLDNN to v0.18-rc
Also fix the issue during upgrade

test=develop

* Rebase MKLDNN to rls-v0.18 branch

Some issues in v0.18-rc which caused INT8 conv op unit test failure was fixed
in rls-v0.18 branch

test=develop

* Upgrade MKLDNN from v0.18rc to formal v0.18 tag

test=develop

* Fix the windows compile issue.

test=develop

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -31,9 +31,17 @@
     return()
 ENDIF()

-MESSAGE(STATUS "Set ${MKLDNN_INSTALL_DIR}/lib to runtime path")
+# Introduce variables:
+# * CMAKE_INSTALL_LIBDIR
+INCLUDE(GNUInstallDirs)
+SET(LIBDIR "lib")
+if(CMAKE_INSTALL_LIBDIR MATCHES ".*lib64$")
+  SET(LIBDIR "lib64")
+endif()
+
+MESSAGE(STATUS "Set ${MKLDNN_INSTALL_DIR}/l${LIBDIR} to runtime path")
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLDNN_INSTALL_DIR}/lib")
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLDNN_INSTALL_DIR}/${LIBDIR}")

 INCLUDE_DIRECTORIES(${MKLDNN_INC_DIR}) # For MKLDNN code to include internal headers.

@@ -58,7 +66,7 @@
     ${EXTERNAL_PROJECT_LOG_ARGS}
     DEPENDS             ${MKLDNN_DEPENDS}
     GIT_REPOSITORY      "https://github.com/intel/mkl-dnn.git"
-    GIT_TAG             "830a10059a018cd2634d94195140cf2d8790a75a"
+    GIT_TAG             "863ff6e7042cec7d2e29897fe9f0872e0888b0fc"
     PREFIX              ${MKLDNN_SOURCES_DIR}
     UPDATE_COMMAND      ""
     CMAKE_ARGS          -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
@@ -79,9 +87,9 @@
                         -DMKLROOT:PATH=${MKLML_ROOT}
 )
 if(WIN32)
-    SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/lib/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
+    SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/mkldnn.lib" CACHE FILEPATH "mkldnn library." FORCE)
 else(WIN32)
-    SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/lib/libmkldnn.so" CACHE FILEPATH "mkldnn library." FORCE)
+    SET(MKLDNN_LIB "${MKLDNN_INSTALL_DIR}/${LIBDIR}/libmkldnn.so" CACHE FILEPATH "mkldnn library." FORCE)
 endif(WIN32)

 ADD_LIBRARY(shared_mkldnn SHARED IMPORTED GLOBAL)
@@ -101,7 +109,7 @@
 # copy the real so.0 lib to install dir
 # it can be directly contained in wheel or capi
 if(WIN32)
-    SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/lib/mkldnn.dll)
+    SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/bin/mkldnn.dll)
 else(WIN32)
     SET(MKLDNN_SHARED_LIB ${MKLDNN_INSTALL_DIR}/libmkldnn.so.0)
     ADD_CUSTOM_COMMAND(OUTPUT ${MKLDNN_SHARED_LIB}


[cmake] win -> unix line ends

[cmake] win -> unix line ends

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -1,283 +1,283 @@
-# Locate Intel Threading Building Blocks include paths and libraries
-# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
-# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
-# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
-#   Florian Uhlig <F.Uhlig _at_ gsi.de>,
-#   Jiri Marsik <jiri.marsik89 _at_ gmail.com>
-
-# The MIT License
-#
-# Copyright (c) 2011 Hannes Hofmann
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-
-# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
-#   e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
-#   TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
-#   in the TBB installation directory (TBB_INSTALL_DIR).
-#
-# GvdB: Mac OS X distribution places libraries directly in lib directory.
-#
-# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
-# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
-#   which architecture to use
-# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
-#   which compiler to use (detected automatically on Windows)
-
-# This module respects
-# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
-
-# This module defines
-# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
-# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
-# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
-# TBB_INSTALL_DIR, the base TBB install directory
-# TBB_LIBRARIES, the libraries to link against to use TBB.
-# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
-# TBB_FOUND, If false, don't try to use TBB.
-# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
-
-
-if (WIN32)
-    # has em64t/vc8 em64t/vc9
-    # has ia32/vc7.1 ia32/vc8 ia32/vc9
-    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
-    set(_TBB_LIB_NAME "tbb")
-    set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-    set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-    set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-    if (MSVC71)
-        set (_TBB_COMPILER "vc7.1")
-    endif(MSVC71)
-    if (MSVC80)
-        set(_TBB_COMPILER "vc8")
-    endif(MSVC80)
-    if (MSVC90)
-        set(_TBB_COMPILER "vc9")
-    endif(MSVC90)
-    if(MSVC10)
-        set(_TBB_COMPILER "vc10")
-    endif(MSVC10)
-    # Todo: add other Windows compilers such as ICL.
-    set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
-endif (WIN32)
-
-if (UNIX)
-    if (APPLE)
-        # MAC
-        set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
-        # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
-        set(_TBB_LIB_NAME "tbb")
-        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-        # default flavor on apple: ia32/cc4.0.1_os10.4.9
-        # Jiri: There is no reason to presume there is only one flavor and
-        #       that user's setting of variables should be ignored.
-        if(NOT TBB_COMPILER)
-            set(_TBB_COMPILER "cc4.0.1_os10.4.9")
-        elseif (NOT TBB_COMPILER)
-            set(_TBB_COMPILER ${TBB_COMPILER})
-        endif(NOT TBB_COMPILER)
-        if(NOT TBB_ARCHITECTURE)
-            set(_TBB_ARCHITECTURE "ia32")
-        elseif(NOT TBB_ARCHITECTURE)
-            set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
-        endif(NOT TBB_ARCHITECTURE)
-    else (APPLE)
-        # LINUX
-        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
-        set(_TBB_LIB_NAME "tbb")
-        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-        # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
-        # has ia32/*
-        # has itanium/*
-        set(_TBB_COMPILER ${TBB_COMPILER})
-        set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
-    endif (APPLE)
-endif (UNIX)
-
-if (CMAKE_SYSTEM MATCHES "SunOS.*")
-# SUN
-# not yet supported
-# has em64t/cc3.4.3_kernel5.10
-# has ia32/*
-endif (CMAKE_SYSTEM MATCHES "SunOS.*")
-
-
-#-- Clear the public variables
-set (TBB_FOUND "NO")
-
-
-#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
-# first: use CMake variable TBB_INSTALL_DIR
-if (TBB_INSTALL_DIR)
-    set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
-endif (TBB_INSTALL_DIR)
-# second: use environment variable
-if (NOT _TBB_INSTALL_DIR)
-    if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
-    endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
-    # Intel recommends setting TBB21_INSTALL_DIR
-    if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
-    endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
-    if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
-    endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
-    if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
-    endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
-endif (NOT _TBB_INSTALL_DIR)
-# third: try to find path automatically
-if (NOT _TBB_INSTALL_DIR)
-    if (_TBB_DEFAULT_INSTALL_DIR)
-        set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
-    endif (_TBB_DEFAULT_INSTALL_DIR)
-endif (NOT _TBB_INSTALL_DIR)
-# sanity check
-if (NOT _TBB_INSTALL_DIR)
-    message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
-else (NOT _TBB_INSTALL_DIR)
-# finally: set the cached CMake variable TBB_INSTALL_DIR
-if (NOT TBB_INSTALL_DIR)
-    set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
-    mark_as_advanced(TBB_INSTALL_DIR)
-endif (NOT TBB_INSTALL_DIR)
-
-
-#-- A macro to rewrite the paths of the library. This is necessary, because
-#   find_library() always found the em64t/vc9 version of the TBB libs
-macro(TBB_CORRECT_LIB_DIR var_name)
-#    if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
-        string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
-#    endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
-    string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
-    string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-    string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-    string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-    string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-endmacro(TBB_CORRECT_LIB_DIR var_content)
-
-
-#-- Look for include directory and set ${TBB_INCLUDE_DIR}
-set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
-# Jiri: tbbvars now sets the CPATH environment variable to the directory
-#       containing the headers.
-find_path(TBB_INCLUDE_DIR
-    tbb/task_scheduler_init.h
-    PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
-)
-mark_as_advanced(TBB_INCLUDE_DIR)
-
-
-#-- Look for libraries
-# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
-if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-    set (_TBB_LIBRARY_DIR
-         ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
-         ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
-        )
-endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-# Jiri: This block isn't mutually exclusive with the previous one
-#       (hence no else), instead I test if the user really specified
-#       the variables in question.
-if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
-    # HH: deprecated
-    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
-    # Jiri: It doesn't hurt to look in more places, so I store the hints from
-    #       ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
-    #       variables and search them both.
-    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
-endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
-
-# GvdB: Mac OS X distribution places libraries directly in lib directory.
-list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
-
-# Jiri: No reason not to check the default paths. From recent versions,
-#       tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
-#       variables, which now point to the directories of the lib files.
-#       It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
-#       argument instead of the implicit PATHS as it isn't hard-coded
-#       but computed by system introspection. Searching the LIBRARY_PATH
-#       and LD_LIBRARY_PATH environment variables is now even more important
-#       that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
-#       the use of TBB built from sources.
-find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
-        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
-find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
-        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
-
-#Extract path from TBB_LIBRARY name
-get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
-
-#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
-#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
-mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
-
-#-- Look for debug libraries
-# Jiri: Changed the same way as for the release libraries.
-find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
-        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
-find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
-        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
-
-# Jiri: Self-built TBB stores the debug libraries in a separate directory.
-#       Extract path from TBB_LIBRARY_DEBUG name
-get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
-
-#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
-#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
-mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
-
-
-if (TBB_INCLUDE_DIR)
-    if (TBB_LIBRARY)
-        set (TBB_FOUND "YES")
-        set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
-        set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
-        set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
-        set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
-        # Jiri: Self-built TBB stores the debug libraries in a separate directory.
-        set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
-        mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
-        message(STATUS "Found Intel TBB")
-    endif (TBB_LIBRARY)
-endif (TBB_INCLUDE_DIR)
-
-if (NOT TBB_FOUND)
-    message("ERROR: Intel TBB NOT found!")
-    message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
-    # do only throw fatal, if this pkg is REQUIRED
-    if (TBB_FIND_REQUIRED)
-        message(FATAL_ERROR "Could NOT find TBB library.")
-    endif (TBB_FIND_REQUIRED)
-endif (NOT TBB_FOUND)
-
-endif (NOT _TBB_INSTALL_DIR)
-
-if (TBB_FOUND)
-	set(TBB_INTERFACE_VERSION 0)
-	FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
-	STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
-	set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
-endif (TBB_FOUND)
+# Locate Intel Threading Building Blocks include paths and libraries
+# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
+# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
+# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
+#   Florian Uhlig <F.Uhlig _at_ gsi.de>,
+#   Jiri Marsik <jiri.marsik89 _at_ gmail.com>
+
+# The MIT License
+#
+# Copyright (c) 2011 Hannes Hofmann
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
+#   e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
+#   TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
+#   in the TBB installation directory (TBB_INSTALL_DIR).
+#
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
+#
+# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
+# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
+#   which architecture to use
+# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
+#   which compiler to use (detected automatically on Windows)
+
+# This module respects
+# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
+
+# This module defines
+# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
+# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
+# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
+# TBB_INSTALL_DIR, the base TBB install directory
+# TBB_LIBRARIES, the libraries to link against to use TBB.
+# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
+# TBB_FOUND, If false, don't try to use TBB.
+# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
+
+
+if (WIN32)
+    # has em64t/vc8 em64t/vc9
+    # has ia32/vc7.1 ia32/vc8 ia32/vc9
+    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
+    set(_TBB_LIB_NAME "tbb")
+    set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+    set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+    set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+    if (MSVC71)
+        set (_TBB_COMPILER "vc7.1")
+    endif(MSVC71)
+    if (MSVC80)
+        set(_TBB_COMPILER "vc8")
+    endif(MSVC80)
+    if (MSVC90)
+        set(_TBB_COMPILER "vc9")
+    endif(MSVC90)
+    if(MSVC10)
+        set(_TBB_COMPILER "vc10")
+    endif(MSVC10)
+    # Todo: add other Windows compilers such as ICL.
+    set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+endif (WIN32)
+
+if (UNIX)
+    if (APPLE)
+        # MAC
+        set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
+        # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # default flavor on apple: ia32/cc4.0.1_os10.4.9
+        # Jiri: There is no reason to presume there is only one flavor and
+        #       that user's setting of variables should be ignored.
+        if(NOT TBB_COMPILER)
+            set(_TBB_COMPILER "cc4.0.1_os10.4.9")
+        elseif (NOT TBB_COMPILER)
+            set(_TBB_COMPILER ${TBB_COMPILER})
+        endif(NOT TBB_COMPILER)
+        if(NOT TBB_ARCHITECTURE)
+            set(_TBB_ARCHITECTURE "ia32")
+        elseif(NOT TBB_ARCHITECTURE)
+            set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+        endif(NOT TBB_ARCHITECTURE)
+    else (APPLE)
+        # LINUX
+        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
+        # has ia32/*
+        # has itanium/*
+        set(_TBB_COMPILER ${TBB_COMPILER})
+        set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+    endif (APPLE)
+endif (UNIX)
+
+if (CMAKE_SYSTEM MATCHES "SunOS.*")
+# SUN
+# not yet supported
+# has em64t/cc3.4.3_kernel5.10
+# has ia32/*
+endif (CMAKE_SYSTEM MATCHES "SunOS.*")
+
+
+#-- Clear the public variables
+set (TBB_FOUND "NO")
+
+
+#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
+# first: use CMake variable TBB_INSTALL_DIR
+if (TBB_INSTALL_DIR)
+    set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
+endif (TBB_INSTALL_DIR)
+# second: use environment variable
+if (NOT _TBB_INSTALL_DIR)
+    if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
+    endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
+    # Intel recommends setting TBB21_INSTALL_DIR
+    if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
+    endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
+    if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
+    endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
+    if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
+    endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
+endif (NOT _TBB_INSTALL_DIR)
+# third: try to find path automatically
+if (NOT _TBB_INSTALL_DIR)
+    if (_TBB_DEFAULT_INSTALL_DIR)
+        set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
+    endif (_TBB_DEFAULT_INSTALL_DIR)
+endif (NOT _TBB_INSTALL_DIR)
+# sanity check
+if (NOT _TBB_INSTALL_DIR)
+    message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
+else (NOT _TBB_INSTALL_DIR)
+# finally: set the cached CMake variable TBB_INSTALL_DIR
+if (NOT TBB_INSTALL_DIR)
+    set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
+    mark_as_advanced(TBB_INSTALL_DIR)
+endif (NOT TBB_INSTALL_DIR)
+
+
+#-- A macro to rewrite the paths of the library. This is necessary, because
+#   find_library() always found the em64t/vc9 version of the TBB libs
+macro(TBB_CORRECT_LIB_DIR var_name)
+#    if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
+        string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+#    endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
+    string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+    string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+endmacro(TBB_CORRECT_LIB_DIR var_content)
+
+
+#-- Look for include directory and set ${TBB_INCLUDE_DIR}
+set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
+# Jiri: tbbvars now sets the CPATH environment variable to the directory
+#       containing the headers.
+find_path(TBB_INCLUDE_DIR
+    tbb/task_scheduler_init.h
+    PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
+)
+mark_as_advanced(TBB_INCLUDE_DIR)
+
+
+#-- Look for libraries
+# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
+if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+    set (_TBB_LIBRARY_DIR
+         ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
+         ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
+        )
+endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+# Jiri: This block isn't mutually exclusive with the previous one
+#       (hence no else), instead I test if the user really specified
+#       the variables in question.
+if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
+    # HH: deprecated
+    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
+    # Jiri: It doesn't hurt to look in more places, so I store the hints from
+    #       ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
+    #       variables and search them both.
+    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
+endif ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
+
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
+list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
+
+# Jiri: No reason not to check the default paths. From recent versions,
+#       tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
+#       variables, which now point to the directories of the lib files.
+#       It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
+#       argument instead of the implicit PATHS as it isn't hard-coded
+#       but computed by system introspection. Searching the LIBRARY_PATH
+#       and LD_LIBRARY_PATH environment variables is now even more important
+#       that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
+#       the use of TBB built from sources.
+find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+#Extract path from TBB_LIBRARY name
+get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
+mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
+
+#-- Look for debug libraries
+# Jiri: Changed the same way as for the release libraries.
+find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+# Jiri: Self-built TBB stores the debug libraries in a separate directory.
+#       Extract path from TBB_LIBRARY_DEBUG name
+get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
+mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
+
+
+if (TBB_INCLUDE_DIR)
+    if (TBB_LIBRARY)
+        set (TBB_FOUND "YES")
+        set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
+        set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
+        set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
+        set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
+        # Jiri: Self-built TBB stores the debug libraries in a separate directory.
+        set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
+        mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
+        message(STATUS "Found Intel TBB")
+    endif (TBB_LIBRARY)
+endif (TBB_INCLUDE_DIR)
+
+if (NOT TBB_FOUND)
+    message("ERROR: Intel TBB NOT found!")
+    message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
+    # do only throw fatal, if this pkg is REQUIRED
+    if (TBB_FIND_REQUIRED)
+        message(FATAL_ERROR "Could NOT find TBB library.")
+    endif (TBB_FIND_REQUIRED)
+endif (NOT TBB_FOUND)
+
+endif (NOT _TBB_INSTALL_DIR)
+
+if (TBB_FOUND)
+    set(TBB_INTERFACE_VERSION 0)
+    FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
+    STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
+    set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
+endif (TBB_FOUND)


Add a more general fallthrough attribute.

GCC7 raises implicit fallthrough warnings in a lot of places when we
compile without C++17 support. This patch adds a second check for the
GCC extension `__attribute__((fallthrough))` that works in C++11 and
C++14 and fixes these warnings.

--- cmake/checks/check_01_cxx_features.cmake
+++ cmake/checks/check_01_cxx_features.cmake
@@ -442,12 +442,44 @@
 ENDIF()

 #
-# Enable c++17's [[fallthrough]] attribute.
+# Try to enable a fallthrough attribute. This is a language feature in C++17,
+# but a compiler extension in earlier language versions: check both
+# possibilities here.
 #
 IF(DEAL_II_WITH_CXX17)
   SET(DEAL_II_FALLTHROUGH "[[fallthrough]]")
 ELSE()
-  SET(DEAL_II_FALLTHROUGH " ")
+  # see if the current compiler configuration supports the GCC extension
+  # __attribute__((fallthrough)) syntax instead
+  PUSH_CMAKE_REQUIRED("-Werror")
+  PUSH_CMAKE_REQUIRED("-Wextra")
+  PUSH_CMAKE_REQUIRED("${DEAL_II_CXX_VERSION_FLAG}")
+  CHECK_CXX_SOURCE_COMPILES(
+    "
+    int main()
+    {
+      int i = 42;
+      int j = 10;
+      switch(i)
+        {
+        case 1:
+          ++j;
+          __attribute__((fallthrough));
+        case 2:
+          ++j;
+          __attribute__((fallthrough));
+        default:
+          break;
+        }
+    }
+    "
+    DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH)
+  RESET_CMAKE_REQUIRED()
+  IF(DEAL_II_HAVE_ATTRIBUTE_FALLTHROUGH)
+    SET(DEAL_II_FALLTHROUGH "__attribute__((fallthrough))")
+  ELSE()
+    SET(DEAL_II_FALLTHROUGH " ")
+  ENDIF()
 ENDIF()


Clarify undefined symbol lookup on different linkers

--- cmake/ilcsoft_default_cxx_flags.cmake
+++ cmake/ilcsoft_default_cxx_flags.cmake
@@ -6,8 +6,12 @@

 SET(COMPILER_FLAGS -Wall -Wextra -Wshadow -Weffc++ -pedantic -Wno-long-long -Wuninitialized )

-IF( NOT APPLE )
- LIST( APPEND COMPILER_FLAGS -Wl,-no-undefined )
+IF(("${CMAKE_CXX_COMPILER_ID}" EQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" EQUAL "Clang"))
+    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+ENDIF()
+
+IF("${CMAKE_CXX_COMPILER_ID}" EQUAL "AppleClang")
+    SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined,error")
 ENDIF()


[CMake] Add -fno-sanitize=function to UBSan bootstrap

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -365,7 +365,7 @@
       endif()
     elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
       append_common_sanitizer_flags()
-      append("-fsanitize=undefined -fno-sanitize=vptr -fno-sanitize-recover"
+      append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
       message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")


Fix check for std::apply (R__HAS_STD_APPLY)

std::apply is part of C++17 standard. The order of argument was
wrong. According to the documention it's function first followed
by the tuple.

Signed-off-by: David Abdurachmanov <c087e48302f7476d5d88ea1a1a98ff646e8a8d3e@gmail.com>

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -541,7 +541,7 @@
 endif()

 CHECK_CXX_SOURCE_COMPILES("#include <tuple>
-int main() { std::tuple<int> tup;std::apply(tup, [](int){}); return 0;}" found_stdapply)
+int main() { std::apply([](int, int){}, std::make_tuple(1,2)); return 0;}" found_stdapply)
 if(found_stdapply)
   set(hasstdapply define)
 else()


Customize qt5_add_resources to avoid cmake warnings

Modern version on cmake generate the following warning without it:

  Policy CMP0071 is not set: Let AUTOMOC and AUTOUIC process GENERATED files.
  Run "cmake --help-policy CMP0071" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  For compatibility, CMake is excluding the GENERATED source file(s):

    "/.../qrc_....cpp"

  from processing by AUTOMOC.  If any of the files should be processed, set
  CMP0071 to NEW.  If any of the files should not be processed, explicitly
  exclude them by setting the source file property SKIP_AUTOMOC:

    set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON)

Change-Id: Ia32c313c49e25404331b6e028aefeb35619bdf89

--- cmake/qibuild/modules/qt5-tools.cmake
+++ cmake/qibuild/modules/qt5-tools.cmake
@@ -18,6 +18,11 @@
 if(Qt5Widgets_FOUND)
   include("${Qt5Widgets_DIR}/Qt5WidgetsMacros.cmake")
 endif()
+
+macro(qt5_add_resources name)
+  _qt5_add_resources(${name} ${ARGN})
+  set_property(SOURCE ${${name}} PROPERTY SKIP_AUTOMOC ON)
+endmacro()

 function(qi_generate_qt_conf)
   # First, find qt and generate qt.conf


Need to specify a version when uploading artifacts.

We use '*' as version when downloading artifacts as the artifacts
are identified by their IDENTITY_PROPERTIES. However we must
specify a version when uploading artifacts.

--- Artifactory.cmake
+++ Artifactory.cmake
@@ -53,6 +53,7 @@
 #                             NAME <artifact-id>
 #                             VERSION <version>
 #                             UPLOAD_VERSION <upload-version>
+#                             DOWNLOAD_VERSION <download-version>
 #                             [IDENTITY_PROPERTIES <prop1> <value1> <prop2> <value2> ...]
 #                             [INFORMATION_PROPERTIES <prop1> <value1> <prop2> <value2> ...])
 #
@@ -114,11 +115,11 @@
 # repository layout works.
 #
 function(artifactory_add_artifact directory)
-    set(one_value_keywords GROUP LOCAL_TARGET NAME REPO VERSION UPLOAD_VERSION)
+    set(one_value_keywords GROUP LOCAL_TARGET NAME REPO VERSION UPLOAD_VERSION DOWNLOAD_VERSION)
     set(multi_value_keywords IDENTITY_PROPERTIES INFORMATION_PROPERTIES)
     cmake_parse_arguments(ARTIFACT "" "${one_value_keywords}" "${multi_value_keywords}" ${ARGN})
     ensure_all_arguments_parsed(artifactory_add_artifact "${ARTIFACT_UNPARSED_ARGUMENTS}")
-    require_arguments(artifactory_add_artifact ARTIFACT GROUP NAME REPO VERSION UPLOAD_VERSION)
+    require_arguments(artifactory_add_artifact ARTIFACT GROUP NAME REPO VERSION UPLOAD_VERSION DOWNLOAD_VERSION)
     _artifactory_check_version(${ARTIFACT_VERSION})

     set(binary_directory ${CMAKE_CURRENT_BINARY_DIR}/${directory})
@@ -136,7 +137,7 @@
             REPO ${ARTIFACT_REPO}
             GROUP ${ARTIFACT_GROUP}
             NAME ${ARTIFACT_NAME}
-            VERSION ${ARTIFACT_VERSION}
+            VERSION ${ARTIFACT_DOWNLOAD_VERSION}
             PROPERTIES ${ARTIFACT_IDENTITY_PROPERTIES}
         )
     endif()
@@ -297,6 +298,7 @@
 #                       GROUP <group-id>
 #                       NAME <artifact-id>
 #                       VERSION <version>
+#                       UPLOAD_VERSION <upload-version>
 #                       [NO_AUTOGENERATED_POM]
 #                       [PROPERTIES <prop1> <value1> <prop2> <value2> ...])
 #


Missing include

Missing include

--- hunter_recipes/projects/F2C/hunter.cmake
+++ hunter_recipes/projects/F2C/hunter.cmake
@@ -4,6 +4,7 @@
 include(hunter_download)
 include(hunter_pick_scheme)
 include(hunter_add_package)
+include(hunter_configuration_types)

 # Makes it possible to use syste cfitsio
 hunter_add_version(


Allow specifying extra samples files in the 'cegui_add_sample' macro

--HG--
branch : gui_navigation-devel

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -350,18 +350,19 @@
 endmacro()

 #
-# Define a CEGUI sample module
-#
-macro (cegui_add_sample _NAME)
+# Define a CEGUI sample module using some extra header and source files
+#
+macro (cegui_add_sample_with_extra_files _NAME _EXTRA_HEADER_FILES _EXTRA_SOURCE_FILES)
     set (CEGUI_TARGET_NAME ${_NAME})
-
     cegui_gather_files()

-	set(CORE_HEADER_FILES ${CORE_HEADER_FILES}
-		${CMAKE_SOURCE_DIR}/samples/common/include/Sample.h
-		${CMAKE_SOURCE_DIR}/samples/common/include/SampleBase.h
-	)
-
+    set(CORE_HEADER_FILES ${CORE_HEADER_FILES} ${_EXTRA_HEADER_FILES}
+        ${CMAKE_SOURCE_DIR}/samples/common/include/Sample.h
+        ${CMAKE_SOURCE_DIR}/samples/common/include/SampleBase.h
+    )
+
+	set(CORE_SOURCE_FILES ${CORE_SOURCE_FILES} ${_EXTRA_SOURCE_FILES})
+
     # Each demo will become a dynamically linked library as plugin (module)
     cegui_add_library_impl(${CEGUI_TARGET_NAME} TRUE CORE_SOURCE_FILES CORE_HEADER_FILES FALSE FALSE)

@@ -394,6 +395,10 @@
     file(APPEND ${CMAKE_BINARY_DIR}/datafiles/samples/samples.xml "${DEMO_META_DATA}")

 endmacro()
+macro (cegui_add_sample _NAME)
+	cegui_add_sample_with_extra_files(${_NAME} "" "")
+endmacro()
+

 #
 # Define a PyCEGUI* extension module


Update FindMSGPACK.cmake to support multiple library names

--- cmake/FindMSGPACK.cmake
+++ cmake/FindMSGPACK.cmake
@@ -6,8 +6,10 @@
 find_path(MSGPACK_INCLUDE_DIR msgpack.h
   HINTS ${SHARED_MSGPACK_INCLUDEDIR} ${SHARED_MSGPACK_INCLUDE_DIRS}
   ${LIMIT_SEARCH})
+
+list(APPEND MSGPACK_NAMES msgpackc msgpack)

-find_library(MSGPACK_LIBRARY NAMES msgpack
+find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
   HINTS ${SHARED_MSGPACK_LIBDIR} ${SHARED_MSGPACK_LIBRARY_DIRS}
   ${LIMIT_SEARCH})


Revert "Add missing alias for installed builds"

This reverts commit 05dae5692be0bd51b64a86fd4586cafc8729b65f.

--- cmake/jegp-config.cmake
+++ cmake/jegp-config.cmake
@@ -3,6 +3,3 @@
 find_dependency(range-v3 0.10.0)

 include(${CMAKE_CURRENT_LIST_DIR}/jegp-targets.cmake)
-
-add_library(jegp::jegp INTERFACE IMPORTED)
-target_link_libraries(jegp::jegp INTERFACE jegp)


Fix stack protection link error on mingw

--- cmake/DaemonFlags.cmake
+++ cmake/DaemonFlags.cmake
@@ -208,9 +208,13 @@
     endif()

     # Hardening, don't set _FORTIFY_SOURCE in debug builds
-    set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELEASE)
-    set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELWITHDEBINFO)
-    set_c_cxx_flag("-D_FORTIFY_SOURCE=2" MINSIZEREL)
+    if (USE_HARDENING OR NOT MINGW)
+        # MinGW with _FORTIFY_SOURCE and without -fstack-protector causes unsatisfied dependency on libssp
+        # https://github.com/msys2/MINGW-packages/issues/5868
+        set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELEASE)
+        set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELWITHDEBINFO)
+        set_c_cxx_flag("-D_FORTIFY_SOURCE=2" MINSIZEREL)
+    endif()
     if (USE_HARDENING)
         try_c_cxx_flag(FSTACK_PROTECTOR_STRONG "-fstack-protector-strong")
         if (NOT FLAG_FSTACK_PROTECTOR_STRONG)


MOD: Reimplement FindFribidi in terms of new uber-macro: THIS NEEDS TESTING!

--- cmake/FindFribidi.cmake
+++ cmake/FindFribidi.cmake
@@ -1,40 +1,7 @@
 ################################################################################
 # Custom cmake module for CEGUI to find the fribidi library & header
 ################################################################################
-include(FindPackageHandleStandardArgs)
+include(CEGUIFindHelpers)

-find_path(FRIBIDI_H_PATH NAMES fribidi.h PATH_SUFFIXES fribidi)
-find_library(FRIBIDI_LIB NAMES fribidi libfribidi PATH_SUFFIXES dynamic)
-find_library(FRIBIDI_LIB_DBG NAMES fribidi_d libfribidi_d PATH_SUFFIXES dynamic)
-mark_as_advanced(FRIBIDI_H_PATH FRIBIDI_LIB FRIBIDI_LIB_DBG)
+cegui_find_package(FRIBIDI fribidi fribidi.h fribidi fribidi)

-if (WIN32 OR APPLE)
-    find_library(FRIBIDI_LIB_STATIC NAMES fribidi libfribidi PATH_SUFFIXES static)
-    find_library(FRIBIDI_LIB_STATIC_DBG NAMES fribidi_d libfribidi_d PATH_SUFFIXES static)
-    mark_as_advanced(FRIBIDI_LIB_STATIC FRIBIDI_LIB_STATIC_DBG)
-endif()
-
-cegui_find_package_handle_standard_args(FRIBIDI FRIBIDI_LIB FRIBIDI_H_PATH)
-
-
-# set up output vars
-if (FRIBIDI_FOUND)
-    set (FRIBIDI_INCLUDE_DIR ${FRIBIDI_H_PATH})
-    set (FRIBIDI_LIBRARIES ${FRIBIDI_LIB})
-    if (FRIBIDI_LIB_DBG)
-        set (FRIBIDI_LIBRARIES_DBG ${FRIBIDI_LIB_DBG})
-    endif()
-    if (FRIBIDI_LIB_STATIC)
-        set (FRIBIDI_LIBRARIES_STATIC ${FRIBIDI_LIB_STATIC})
-    endif()
-    if (FRIBIDI_LIB_STATIC_DBG)
-        set (FRIBIDI_LIBRARIES_STATIC_DBG ${FRIBIDI_LIB_STATIC_DBG})
-    endif()
-else()
-    set (FRIBIDI_INCLUDE_DIR)
-    set (FRIBIDI_LIBRARIES)
-    set (FRIBIDI_LIBRARIES_DBG)
-    set (FRIBIDI_LIBRARIES_STATIC)
-    set (FRIBIDI_LIBRARIES_STATIC_DBG)
-endif()
-


Remove boost from the popsift package; add threads.

--- cmake/FindPopsift.cmake
+++ cmake/FindPopsift.cmake
@@ -24,7 +24,7 @@
 )

 find_package(CUDA 7.0 REQUIRED)
-find_package(Boost 1.53.0 REQUIRED COMPONENTS system filesystem)
+find_package(Threads REQUIRED)

 IF(POPSIFT_INCLUDE_DIR)
   MESSAGE(STATUS "popsift headers found in ${POPSIFT_INCLUDE_DIR}")


Move BUILD_tools to pcl_options.cmake and enable it again

--- cmake/pcl_options.cmake
+++ cmake/pcl_options.cmake
@@ -48,3 +48,5 @@
 if(USE_PROJECT_FOLDERS)
   set_property(GLOBAL PROPERTY USE_FOLDERS ON)
 endif(USE_PROJECT_FOLDERS)
+
+option(BUILD_tools "Useful PCL-based command line tools" ON)


fix for Fedora users who need explicit pthread linking

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@1790 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -150,7 +150,11 @@
 macro(PCL_ADD_EXECUTABLE _name _component)
     add_executable(${_name} ${ARGN})
     # must link explicitly against boost.
-    target_link_libraries(${_name} ${Boost_LIBRARIES})
+    if(UNIX)
+      target_link_libraries(${_name} ${Boost_LIBRARIES} pthread)
+    else(UNIX)
+      target_link_libraries(${_name} ${Boost_LIBRARIES})
+    endif(UNIX)
     #
     # Only link if needed
     if(WIN32 AND MSVC)


cpack: Use application version.

cpack: Use application version.

Signed-off-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -11,9 +11,9 @@

 ### versions
-set(CPACK_PACKAGE_VERSION_MAJOR "0")
-set(CPACK_PACKAGE_VERSION_MINOR "5")
-set(CPACK_PACKAGE_VERSION_PATCH "90")
+set(CPACK_PACKAGE_VERSION_MAJOR ${APPLICATION_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${APPLICATION_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${APPLICATION_VERSION_PATCH})
 set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")


ENH: Prefer https vs http for ctest submission.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,7 +1,7 @@
 set(CTEST_PROJECT_NAME "ITK")
 set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

-set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_METHOD "https")
 set(CTEST_DROP_SITE "open.cdash.org")
 set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
 set(CTEST_DROP_SITE_CDASH TRUE)


refs #5537 suppress spurious build warnings about ranlib

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -217,6 +217,11 @@
 list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE "log_print.cc")

 list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
-  "xz-4.999.9beta/src/liblzma"              # don't complain about warnings in xz source
-  "clang: warning: unknown warning option"  # don't complain about clang missing warnings from xz code
-  )
+  # don't complain about warnings in xz source
+  "xz-4.999.9beta/src/liblzma"
+  # don't complain about clang missing warnings from xz code
+  "clang: warning: unknown warning option"
+  # don't complain about ranlib on empty archive
+  "ranlib: file: .* has no symbols"
+  "ranlib: warning for library: .* the table of contents is empty"
+  )


refs #5127 ignore libtool warnings

refs #5127 ignore libtool warnings

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -225,6 +225,7 @@
   "clang: warning: unknown warning option"
   # don't complain about warnings in jemalloc source
   "jemalloc-3.2.0/src"
-  # don't complain about ranlib on empty archive
-  "ranlib:"
-  )
+  # don't complain about ranlib or libtool on empty archive
+  "has no symbols"
+  "the table of contents is empty"
+  )


FindSodium: Do not create target unconditionally (#430)

Summary:
This fixes  https://github.com/facebook/fbthrift/issues/429

Pull Request resolved: https://github.com/facebook/fbthrift/pull/430

Reviewed By: iahs

Differential Revision: D28832985

Pulled By: vitaut

fbshipit-source-id: 0719f27207d11bb7970cc43c621640c425d8f55d

--- build/fbcode_builder/CMake/FindSodium.cmake
+++ build/fbcode_builder/CMake/FindSodium.cmake
@@ -254,7 +254,10 @@
 else()
     set(_LIB_TYPE SHARED)
 endif()
-add_library(sodium ${_LIB_TYPE} IMPORTED)
+
+if(NOT TARGET sodium)
+    add_library(sodium ${_LIB_TYPE} IMPORTED)
+endif()

 set_target_properties(sodium PROPERTIES
     INTERFACE_INCLUDE_DIRECTORIES "${sodium_INCLUDE_DIR}"


Updated Bootloader for better User Bootloader support

--- cmake/Depthai/DepthaiBootloaderConfig.cmake
+++ cmake/Depthai/DepthaiBootloaderConfig.cmake
@@ -4,4 +4,4 @@

 # "version if applicable"
 # set(DEPTHAI_BOOTLOADER_VERSION "0.0.21")
-set(DEPTHAI_BOOTLOADER_VERSION "0.0.21+cc516a91bb082130586300db4e6123d3cc8c72a7")
+set(DEPTHAI_BOOTLOADER_VERSION "0.0.21+050d0a19edf9747082ae8c3852e09a1764304f78")


Update FW with ipv6 disabled

Update FW with ipv6 disabled

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "d1649317d08c52e603e6c2999c676f646f1ca38b")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "c331d88b13bf939fcf125cabbd20a2425cd08fe6")

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


Clear variables set to NOTFOUND to let builtin GLEW to override them

This is necessary when builtin_glew gets auto-enabled after a search
for GLEW with find_package(GLEW) fails.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -502,6 +502,11 @@
   else()
     find_Package(GLEW)
     if(NOT GLEW_FOUND)
+      # clear variables set to NOTFOUND to allow builtin GLEW to override them
+      foreach(var GLEW_LIBRARIES GLEW_LIBRARY GLEW_LIBRARY_DEBUG GLEW_LIBRARY_RELEASE)
+        unset(${var})
+        unset(${var} CACHE)
+      endforeach()
       message(STATUS "GLEW not found. Switching on builtin_glew option")
       set(builtin_glew ON CACHE BOOL "Enabled because opengl requested and GLEW not found (${builtin_glew_description})" FORCE)
     endif()


Revert "Do not enable builtin_pcre if fail-on-missing=ON"

This reverts commit 1ebf321d2248ac6a7b4637813f37d3b2809c0fd3.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -118,17 +118,13 @@
 #---Check for PCRE-------------------------------------------------------------------
 if(NOT builtin_pcre)
   message(STATUS "Looking for PCRE")
-  if(fail-on-missing)
-    find_package(PCRE REQUIRED)
-  else()
-    find_package(PCRE)
-    if(NOT PCRE_FOUND)
-      message(STATUS "PCRE not found. Switching on builtin_pcre option")
-      set(builtin_pcre ON CACHE BOOL "" FORCE)
-    endif()
-  endif()
-endif()
-
+  find_package(PCRE)
+  if(PCRE_FOUND)
+  else()
+    message(STATUS "PCRE not found. Switching on builtin_pcre option")
+    set(builtin_pcre ON CACHE BOOL "" FORCE)
+  endif()
+endif()
 if(builtin_pcre)
   set(pcre_version 8.37)
   message(STATUS "Building pcre version ${pcre_version} included in ROOT itself")


Check for GLEW when opengl=ON and builtin_glew=OFF

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -527,6 +527,20 @@
     else()
       message(STATUS "OpenGL (with GLU) not found. Switching off opengl option")
       set(opengl OFF CACHE BOOL "" FORCE)
+    endif()
+  endif()
+endif()
+
+#---Check for GLEW -------------------------------------------------------------------
+if(opengl AND NOT builtin_glew)
+  message(STATUS "Looking for GLEW")
+  if(fail-on-missing)
+    find_Package(GLEW REQUIRED)
+  else()
+    find_Package(GLEW)
+    if(NOT GLEW_FOUND)
+      message(STATUS "GLEW not found. Switching on builtin_glew option")
+      set(builtin_glew ON CACHE BOOL "" FORCE)
     endif()
   endif()
 endif()


[cmake xrd] From Guilherme: disable -Werror which breaks GCC9:

See https://github.com/xrootd/xrootd/issues/993
In a subsequent commit (not part of v6.18) we will only build the Xrd client!

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -776,7 +776,7 @@
                -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
                -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
                -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-               -DCMAKE_CXX_FLAGS=${__cxxflags}
+               -DCMAKE_CXX_FLAGS=${__cxxflags}\ -w
                -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
                -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
                -DENABLE_PYTHON=OFF


[cmake] Introduce hidden pyroot[23] options:

Allows -Dfail-on-missing -Dpyroot3 to fail configuration if only pyroot2 can be built.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1533,6 +1533,15 @@
     message(STATUS "PyROOT: Python development package not found for python ${PYTHON_EXECUTABLE}. Switching off pyroot option")
     set(pyroot OFF CACHE BOOL "Disabled because Python development package was not found" FORCE)
   endif()
+  mark_as_advanced(FORCE pyroot2 pyroot3)
+  if(fail-on-missing AND pyroot2 AND NOT Python2_Development_FOUND)
+    message(FATAL_ERROR "PyROOT2: Python2 development package not found and pyroot2 component required"
+                        " (python2 executable: ${Python2_EXECUTABLE})")
+  endif()
+  if(fail-on-missing AND pyroot3 AND NOT Python3_Development_FOUND)
+    message(FATAL_ERROR "PyROOT3: Python3 development package not found and pyroot3 component required"
+                        " (python3 executable: ${Python3_EXECUTABLE})")
+  endif()
 endif()

 #---Check for Pyroot Exp---------------------------------------------------------------------


Retro-merge github mirror's master...

Retro-merge github mirror's master...

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1041,8 +1041,11 @@
       set(vc OFF CACHE BOOL "" FORCE)
     endif()
   elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
-      message(STATUS "VC requires Clang version >= 4.0; switching OFF 'vc' option")
+    if ( APPLE AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4)
+      message(STATUS "VC requires Apple Clang version >= 4.0; switching OFF 'vc' option")
+      set(vc OFF CACHE BOOL "" FORCE)
+    elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
+      message(STATUS "VC requires Clang version >= 3.1; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
     endif()
   elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")


Make Vdt::Vdt imported target depend on builtin Vdt if needed

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1473,6 +1473,9 @@
   add_library(Vdt::Vdt INTERFACE IMPORTED)
   set_property(TARGET Vdt::Vdt PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${VDT_INCLUDE_DIRS}")
   set_property(TARGET Vdt::Vdt PROPERTY INTERFACE_LINK_LIBRARIES "${VDT_LIBRARIES}")
+  if(TARGET VDT)
+    add_dependencies(Vdt::Vdt VDT)
+  endif()
 endif()

 #---Check for VecGeom--------------------------------------------------------------------


COMP: use c++ 14 to compile gdal config tests

--- Modules/ThirdParty/GDAL/otb-module-init.cmake
+++ Modules/ThirdParty/GDAL/otb-module-init.cmake
@@ -57,7 +57,8 @@
 set(${var})
 try_run(RUN_${var} COMPILE_${var} ${CMAKE_CURRENT_BINARY_DIR}
 ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/${source_file}
-CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-w" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+COMPILE_DEFINITIONS "-std=c++14" "-w"
 COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT_${var}
 RUN_OUTPUT_VARIABLE RUN_OUTPUT_${var}
 ARGS ${ARGN}
@@ -104,7 +105,8 @@
 #gdal_try_run(FATAL_ERROR GDAL_HAS_OGR gdalOGRTest.cxx)
 try_compile(COMPILE_GDAL_HAS_OGR ${CMAKE_CURRENT_BINARY_DIR}
 ${CMAKE_SOURCE_DIR}/Modules/ThirdParty/GDAL/gdalOGRTest.cxx
-CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-w" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:PATH=${GDAL_INCLUDE_DIR}" "-DLINK_LIBRARIES:STRING=${GDAL_LIBRARY}"
+COMPILE_DEFINITIONS "-std=c++14" "-w"
 OUTPUT_VARIABLE COMPILE_OUTPUT_GDAL_HAS_OGR
 )
 if(NOT COMPILE_GDAL_HAS_OGR)


Fixing bug in regex not accepting 2.1(2.0) notation

--- lib/THC/cmake/select_compute_arch.cmake
+++ lib/THC/cmake/select_compute_arch.cmake
@@ -117,13 +117,13 @@
       set(add_ptx TRUE)
       set(arch_name ${CMAKE_MATCH_1})
     endif()
-    if(arch_name MATCHES "([0-9]\\.[0-9])$")
+    if(arch_name MATCHES "(^[0-9]\\.[0-9](\\([0-9]\\.[0-9]\\))?)$")
       set(arch_bin ${CMAKE_MATCH_1})
       set(arch_ptx ${arch_bin})
     else()
       # Look for it in our list of known architectures
       if(${arch_name} STREQUAL "Fermi")
-        set(arch_bin 2.0 "2.1(2.0)")
+        set(arch_bin "2.0 2.1(2.0)")
       elseif(${arch_name} STREQUAL "Kepler+Tegra")
         set(arch_bin 3.2)
       elseif(${arch_name} STREQUAL "Kepler+Tesla")
@@ -174,11 +174,11 @@
   # Tell NVCC to add binaries for the specified GPUs
   foreach(arch ${cuda_arch_bin})
     if(arch MATCHES "([0-9]+)\\(([0-9]+)\\)")
-      # User explicitly specified PTX for the concrete BIN
+      # User explicitly specified ARCH for the concrete CODE
       list(APPEND nvcc_flags -gencode arch=compute_${CMAKE_MATCH_2},code=sm_${CMAKE_MATCH_1})
       list(APPEND nvcc_archs_readable sm_${CMAKE_MATCH_1})
     else()
-      # User didn't explicitly specify PTX for the concrete BIN, we assume PTX=BIN
+      # User didn't explicitly specify ARCH for the concrete CODE, we assume ARCH=CODE
       list(APPEND nvcc_flags -gencode arch=compute_${arch},code=sm_${arch})
       list(APPEND nvcc_archs_readable sm_${arch})
     endif()


Extend cppcheck find script with default installation paths on Windows

--- cmake/Findcppcheck.cmake
+++ cmake/Findcppcheck.cmake
@@ -5,11 +5,17 @@

 include(FindPackageHandleStandardArgs)

+# work around CMP0053, see http://public.kitware.com/pipermail/cmake/2014-November/059117.html
+set(PROGRAMFILES_x86_ENV "PROGRAMFILES(x86)")
+
 find_program(cppcheck_EXECUTABLE
     NAMES
         cppcheck
     PATHS
         "${CPPCHECK_DIR}"
+        "$ENV{CPPCHECK_DIR}"
+        "$ENV{PROGRAMFILES}/Cppcheck"
+        "$ENV{${PROGRAMFILES_x86_ENV}}/Cppcheck"
 )

 find_package_handle_standard_args(cppcheck
@@ -19,4 +25,4 @@
         cppcheck_EXECUTABLE
 )

-mark_as_advanced(cppcheck_EXECUTABLE)+mark_as_advanced(cppcheck_EXECUTABLE)


Fixing very small issue with modmetis version dependency for buildbot

--- cmake/NektarCommon.cmake
+++ cmake/NektarCommon.cmake
@@ -227,7 +227,7 @@

     # NIST Sparse BLAS only static, so link into Nektar libraries directly.
     TARGET_LINK_LIBRARIES( ${name} ${NIST_SPARSE_BLAS} ${METIS_LIB})
-    ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.0.2 boost tinyxml
+    ADD_DEPENDENCIES(${name} spblastk0.9b modmetis-5.1.0 boost tinyxml
         zlib-1.2.7)
     SET_PROPERTY(TARGET ${name} PROPERTY FOLDER ${component})
     IF (NEKTAR_USE_MPI)


Cmake: Added inviwo-dev as search path when using external apps/modules such that the main directory does not need to be inviwo-dev.

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -295,8 +295,9 @@
         list(LENGTH IVW_EXTERNAL_MODULES modlen)
         if(NOT ${modlen} EQUAL 0)
             set(paths "const std::string externalModulePaths_[] = {:")
-            set(first "0")
-            set(count 0)
+            set(first "1")
+            list(APPEND paths "\"${IVW_ROOT_DIR}/modules\":")
+            set(count 1)
             foreach(dir ${IVW_EXTERNAL_MODULES})
                 if(IS_DIRECTORY ${dir})
                     if(NOT ${first} EQUAL "0")


Tweak xlC options

Tweak xlC options

--- Common.cmake
+++ Common.cmake
@@ -77,8 +77,8 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
   endif()
 elseif(CMAKE_COMPILER_IS_XLCXX)
-  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -qnoopt")
-  set(CMAKE_CC_FLAGS_DEBUG "${CMAKE_CC_FLAGS_DEBUG} -O0 -qnoopt")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -qnoopt -qnoipa")
+  set(CMAKE_CC_FLAGS_DEBUG "${CMAKE_CC_FLAGS_DEBUG} -O0 -qnoopt -qnoipa")
 endif()

 if(MSVC)


Set install_name on Darwin dylibs

Set install_name on Darwin dylibs

--- Common.cmake
+++ Common.cmake
@@ -106,6 +106,9 @@
   set(CMAKE_OSX_ARCHITECTURES ${OSX_ARCHITECTURES})
   set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
   set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
+  if (NOT CMAKE_INSTALL_NAME_DIR)
+    set(CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+  endif (NOT CMAKE_INSTALL_NAME_DIR)
   message(STATUS
     "Building ${CMAKE_PROJECT_NAME} for ${CMAKE_OSX_ARCHITECTURES}")
 endif(APPLE)


needed to add a new include_directory for external/gco

--- config/IRTKInclude.cmake
+++ config/IRTKInclude.cmake
@@ -142,6 +142,7 @@
 INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/registration/include)
 INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/registration2/include)
 INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/packages/segmentation/include)
+INCLUDE_DIRECTORIES(${IRTK_SOURCE_DIR}/external/gco-v3.0)

 LINK_DIRECTORIES(${IRTK_BINARY_DIR}/lib)


Added a message to alert when ORNL Titan is detected as build system

--- DyninstInstall.cmake
+++ DyninstInstall.cmake
@@ -23,6 +23,7 @@
 cmake_host_system_information(RESULT BUILD_HOST QUERY HOSTNAME)
 if ("${BUILD_HOST}" MATCHES "(titan-ext)[1-7]")
 	## We are on titan, use the following version of dyninst
+	message(INFO " We detected that we are on ORNL Titan, Using Dyninst REV a8252fd")
 	set(DYNINST_VERSION "a8252fd9ace7dd837f98b0db750c588560feea95")
 endif("${BUILD_HOST}" MATCHES "(titan-ext)[1-7]")


do not override CMAKE_INSTALL_PREFIX

do not override CMAKE_INSTALL_PREFIX

--- Shared/CMake/JamomaPlatformSpecific.cmake
+++ Shared/CMake/JamomaPlatformSpecific.cmake
@@ -45,11 +45,11 @@
 			#set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH};/opt/android-toolchain/arm-linux-androideabi/local/include")

 		else()
-			SET(CMAKE_INSTALL_PREFIX /usr)
+			# SET(CMAKE_INSTALL_PREFIX /usr)
 			SET(CPACK_GENERATOR "DEB")
 			SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Jamoma <jamoma@jamoma.org>")
 			SET(CPACK_SET_DESTDIR true)
-			SET(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
+			SET(CPACK_INSTALL_PREFIX /usr)

 			if(CMAKE_SIZEOF_VOID_P EQUAL 4)
 				include_directories("/usr/include/i386-linux-gnu/c++/4.9/")
@@ -63,7 +63,7 @@
 elseif(WIN32)
 	add_definitions(-DTT_PLATFORM_WIN)
 	add_definitions(-DWIN_VERSION)
-
+
 	if(MINGW)
 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-unknown-pragmas -Wno-conversion -Wno-deprecated-declarations -Wno-trigraphs")
 	else()


[SofaMacro] adding sml extension to python installed files

--- SofaKernel/SofaFramework/SofaMacros.cmake
+++ SofaKernel/SofaFramework/SofaMacros.cmake
@@ -202,7 +202,8 @@
     ## Install python scripts, preserving the file tree
     file(GLOB_RECURSE PYTHON_FILES "${CMAKE_CURRENT_SOURCE_DIR}/${directory}/*.py")
     file(GLOB_RECURSE JSON_FILES   "${CMAKE_CURRENT_SOURCE_DIR}/${directory}/*.json")
-    LIST(APPEND ALL_FILES ${PYTHON_FILES} ${JSON_FILES})
+    file(GLOB_RECURSE SML_FILES    "${CMAKE_CURRENT_SOURCE_DIR}/${directory}/*.sml")
+    LIST(APPEND ALL_FILES ${PYTHON_FILES} ${JSON_FILES} ${SML_FILES})
     foreach(python_file ${ALL_FILES})
         file(RELATIVE_PATH script "${CMAKE_CURRENT_SOURCE_DIR}/${directory}" "${python_file}")
         get_filename_component(path ${script} DIRECTORY)


updates to CI

updates to CI

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -102,7 +102,7 @@

 set(CTEST_CONFIGURE_COMMAND "${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}")
 set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ${CTEST_BUILD_OPTIONS}")
-set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} .")
+set(CTEST_CONFIGURE_COMMAND "${CTEST_CONFIGURE_COMMAND} ..")

 # start the test
 ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})


Link binaries with Full RELRO on Linux (#5748)

Full RELRO is a useful exploit mitigation which disables lazy
binding of functions, makes the GOT read-only and also reorders the ELF sections so
that a buffer overflow cannot easily overwrite the next ones, where
normally the GOT is.

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -99,13 +99,21 @@
         OSQUERY_BUILD_PLATFORM=linux
       )

+      set(osquery_linux_common_link_options
+        -Wl,-z,relro,-z,now
+      )
+
       set(linux_cxx_link_options
         --no-undefined
       )

       list(APPEND osquery_defines ${osquery_linux_common_defines})
       target_link_options(cxx_settings INTERFACE
+        ${osquery_linux_common_link_options}
         ${linux_cxx_link_options}
+      )
+      target_link_options(c_settings INTERFACE
+        ${osquery_linux_common_link_options}
       )
     elseif(DEFINED PLATFORM_MACOS)
       set(macos_cxx_compile_options


Added a ORYOL_UNITTESTS define

Added a ORYOL_UNITTESTS define

--- cmake/oryol.cmake
+++ cmake/oryol.cmake
@@ -84,6 +84,11 @@
     else()
         add_definitions(-DORYOL_ALLOCATOR_DEBUG=0)
     endif()
+    if (ORYOL_UNITTESTS)
+        add_definitions(-DORYOL_UNITTESTS=1)
+    else()
+        add_definitions(-DORYOL_UNITTESTS=0)
+    endif()

 endmacro()


CMake: use CI variable CI_COMMIT_TAG to decide whether this is a tag build or not

--- cmake/tools.cmake
+++ cmake/tools.cmake
@@ -22,8 +22,9 @@
                 MESSAGE(STATUS "Git project directory is dirty:\n ${PROJECT_STATUS}.")
             ENDIF(PROJECT_STATUS STREQUAL "")

-            EXEC_PROGRAM(git ${CMAKE_CURRENT_SOURCE_DIR} ARGS describe --exact-match --tags HEAD OUTPUT_VARIABLE GIT_TAG RETURN_VALUE GIT_RETURN)
-            IF(GIT_RETURN EQUAL 0)
+            # Check if commit flag has been set by the CI:
+            IF(DEFINED ENV{CI_COMMIT_TAG})
+                MESSAGE(STATUS "Found CI tag flag, building tagged version")
                 SET(TAG_FOUND TRUE)
             ENDIF()
         ELSE(GIT_FOUND)


don't set CMAKE_CXX_STANDARD in fips_setup

--- cmake/fips.cmake
+++ cmake/fips.cmake
@@ -44,11 +44,6 @@
 #   at the start of the root CMakeLists.txt file.
 #
 macro(fips_setup)
-
-    # default settings
-    if (NOT CMAKE_CXX_STANDARD)
-        set(CMAKE_CXX_STANDARD 11)
-    endif()

     #
     # cmake 3.15 has added a warning if the top-level cmake file doesn't contain


fix cmake glop build

fix cmake glop build


handle the case where there are no new ldflags

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@7760 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/pods.cmake
+++ cmake/pods.cmake
@@ -386,14 +386,11 @@
         ${PKG_CONFIG_EXECUTABLE} --libs ${ARGN}
         OUTPUT_VARIABLE _pods_pkg_ldflags)
     string(STRIP ${_pods_pkg_ldflags} _pods_pkg_ldflags)
-    #    message("ldflags: ${_pods_pkg_ldflags}")
-    include_directories(${_pods_pkg_include_flags})
-    string(REPLACE " " ";" TMP ${_pods_pkg_ldflags}) # convert white-space delimited list to a semi-colon delimited list
-    target_link_libraries(${target} ${TMP})

     # make the target depend on libraries that are cmake targets
     if (_pods_pkg_ldflags)
         string(REPLACE " " ";" _split_ldflags ${_pods_pkg_ldflags})
+	target_link_libraries(${target} ${_split_ld_flags})
         foreach(__ldflag ${_split_ldflags})
                 string(REGEX REPLACE "^-l" "" __depend_target_name ${__ldflag})
                 get_target_property(IS_TARGET ${__depend_target_name} LOCATION)


Require Qt 5.5.

Require Qt 5.5.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -1,6 +1,6 @@
 set(LIBRARIES)

-find_package(Qt5Core REQUIRED)
+find_package(Qt5Core 5.5 REQUIRED)
 find_package(Qt5Gui REQUIRED)
 find_package(Qt5Widgets REQUIRED)
 find_package(Qt5OpenGL REQUIRED)


cleanup

cleanup

--- cmake/ArangoDBInstall.cmake
+++ cmake/ArangoDBInstall.cmake
@@ -138,7 +138,6 @@
 set(IS_SYSTEMD_INSTALL 0)
 set(SYSTEMD_UNIT_DIR "")
 if (UNIX)
-
   if (${USE_ENTERPRISE})
     set(SERVICE_NAME "arangodb3e")
   else ()
@@ -172,7 +171,6 @@
       DESTINATION ${SYSTEMD_UNIT_DIR}/
       RENAME ${SERVICE_NAME})

-    endif()
   endif()
 endif()
 ################################################################################


Include jpeg headers on windows

Include jpeg headers on windows

--- cmake/ExternalLibJPEG.cmake
+++ cmake/ExternalLibJPEG.cmake
@@ -10,5 +10,6 @@
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
         INSTALL_COMMAND ${CMAKE_COMMAND} -E copy ${FAST_EXTERNAL_BUILD_DIR}/libjpeg/src/libjpeg/LibJPEG/9d/bin/libjpeg.dll ${FAST_EXTERNAL_INSTALL_DIR}/bin/
+            ${CMAKE_COMMAND} -E copy_directory ${FAST_EXTERNAL_BUILD_DIR}/libjpeg/src/libjpeg/LibJPEG/9d/include/ ${FAST_EXTERNAL_INSTALL_DIR}/include/
 )
 endif()


build: Fix ImageMagick_Magick++ search

build: Fix ImageMagick_Magick++ search

One cmake test was looking at ImageMagick_MagickWand_INCLUDE_DIR
instead of ImageMagick_Magick++_INCLUDE_DIR

--- cmake/FindImageMagick.cmake
+++ cmake/FindImageMagick.cmake
@@ -246,7 +246,7 @@
             )
         ENDIF()

-        IF(NOT ImageMagick_MagickWand_INCLUDE_DIR OR NOT ImageMagick_MagickWand_LIBRARY)
+        IF(NOT ImageMagick_Magick++_INCLUDE_DIR OR NOT ImageMagick_Magick++_LIBRARY)
             # Look for Magick++.h, in the magick sub-folder
             FIND_IMAGEMAGICK_API(Magick++ magick magick/Magick++.h
                 Magick++ CORE_RL_Magick++_ Magick++-6.Q16 Magick++-Q16 Magick++-6.Q8 Magick++-Q8 Magick++-6.Q16HDRI Magick++-Q16HDRI Magick++-6.Q8HDRI Magick++-Q8HDRI


More fixes, security check for downloaded binaries

--- cmake/FindWin32Lapack.cmake
+++ cmake/FindWin32Lapack.cmake
@@ -1,30 +1,50 @@
-FIND_LIBRARY(WIN32_BLAS NAMES libblas PATHS
-    ${CMAKE_SOURCE_DIR}/ThirdParty)
-FIND_LIBRARY(WIN32_LAPACK NAMES liblapack PATHS
-    ${CMAKE_SOURCE_DIR}/ThirdParty)
+FIND_LIBRARY(WIN32_BLAS NAMES libblas PATHS ${TPSRC})
+FIND_LIBRARY(WIN32_LAPACK NAMES liblapack PATHS ${TPSRC})

 IF (NOT WIN32_BLAS OR NOT WIN32_LAPACK)
     IF (CMAKE_CL64)
-        SET(WIN_ZIP_FILE "win64-blas-lapack.zip")
+        SET(WIN_ZIP_FILE         "win64-blas-lapack.zip")
+        SET(WIN_ZIP_MD5_VALUE    "b5ad4f7335ca964bbdafab129e44a046")
+        SET(WIN_ZIP_SHA1_VALUE   "adb331fa195db264e95e46b902887f12971dbf48")
+        SET(WIN_ZIP_SHA256_VALUE "0e6e3360cdf577718ee57a6fd27c47bac0391d3c7d373e29a0352505e1dc912b")
     ELSE()
-        SET(WIN_ZIP_FILE "win32-blas-lapack.zip")
+        SET(WIN_ZIP_FILE         "win32-blas-lapack.zip")
+        SET(WIN_ZIP_MD5_VALUE    "6dbf9cced1fb73cc093ccc6560cb46e2")
+        SET(WIN_ZIP_SHA1_VALUE   "39c5deaf17211a5012ccfd9d0258da04a7ceb197")
+        SET(WIN_ZIP_SHA256_VALUE "6bb347aa717530fa74b71539f331bb4027767d8b25b8a26c741b540c73398a03")
     ENDIF()

-    IF (NOT EXISTS ${TPSRC}/${WIN_ZIP_FILE})
-        FILE(DOWNLOAD http://ae-nektar.ae.ic.ac.uk/~dmoxey/${WIN_ZIP_FILE} ${TPSRC}/${WIN_ZIP_FILE})
+    SET(WIN_ZIP_PATH ${TPSRC}/${WIN_ZIP_FILE})
+
+    IF (NOT EXISTS ${WIN_ZIP_PATH})
+        FILE(DOWNLOAD http://ae-nektar.ae.ic.ac.uk/~dmoxey/${WIN_ZIP_FILE} ${WIN_ZIP_PATH})
     ENDIF()
+
+    # Calculate expected MD5 and SHA128 hashes
+    FILE  (MD5      ${WIN_ZIP_PATH}    WIN_ZIP_MD5)
+    FILE  (SHA1     ${WIN_ZIP_PATH}    WIN_ZIP_SHA1)
+    FILE  (SHA256   ${WIN_ZIP_PATH}    WIN_ZIP_SHA256)
+    STRING(TOLOWER "${WIN_ZIP_MD5}"    WIN_ZIP_MD5)
+    STRING(TOLOWER "${WIN_ZIP_SHA1}"   WIN_ZIP_SHA1)
+    STRING(TOLOWER "${WIN_ZIP_SHA256}" WIN_ZIP_SHA256)
+
+    IF ((NOT WIN_ZIP_MD5    STREQUAL WIN_ZIP_MD5_VALUE)  OR
+        (NOT WIN_ZIP_SHA1   STREQUAL WIN_ZIP_SHA1_VALUE) OR
+        (NOT WIN_ZIP_SHA256 STREQUAL WIN_ZIP_SHA256_VALUE))
+        MESSAGE(FATAL_ERROR "Security error: Win32 BLAS/LAPACK file has "
+                            "MD5, SHA1 or SHA256 hash")
+    ENDIF()
+
     EXECUTE_PROCESS(
-        COMMAND ${CMAKE_COMMAND} -E tar jxf ${TPSRC}/${WIN_ZIP_FILE}
+        COMMAND ${CMAKE_COMMAND} -E tar jxf ${WIN_ZIP_PATH}
         WORKING_DIRECTORY ${TPSRC}
     )

-    FIND_LIBRARY(WIN32_BLAS NAMES libblas PATHS
-        ${CMAKE_SOURCE_DIR}/ThirdParty)
-    FIND_LIBRARY(WIN32_LAPACK NAMES liblapack PATHS
-        ${CMAKE_SOURCE_DIR}/ThirdParty)
+    # For some reason CMake refuses to run FIND_LIBRARY again so we
+    # force this to the correct library.
+    SET(WIN32_BLAS "${TPSRC}/libblas.lib" CACHE FILEPATH "Blas" FORCE)
+    SET(WIN32_LAPACK "${TPSRC}/liblapack.lib" CACHE FILEPATH "LAPACK" FORCE)

-    MESSAGE(STATUS ${CMAKE_SOURCE_DIR}/ThirdParty)
-    MESSAGE(STATUS ${WIN32_BLAS})
     IF (NOT WIN32_BLAS)
         MESSAGE(FATAL_ERROR "Could not find BLAS library after unzipping!")
     ENDIF()


#7 Update CMake script to find libass dependencies (it looks to work fine now)

--- cmake/Modules/FindASS.cmake
+++ cmake/Modules/FindASS.cmake
@@ -10,6 +10,22 @@
 find_package(PkgConfig)
 pkg_check_modules(PC_LIBASS QUIET libass)
 set(LIBASS_DEFINITIONS ${PC_LIBASS_CFLAGS_OTHER})
+set(LIBRARY_SEARCH_PATHS
+  ${LIBASS_ROOT}/lib
+  $ENV{LIBASS_ROOT}/lib
+  ~/Library/Frameworks
+  /Library/Frameworks
+  /usr/local/lib
+  /usr/local/lib64
+  /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+  /usr/lib
+  /usr/lib64
+  /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+  /sw/lib
+  /opt/local/lib
+  /opt/csw/lib
+  /opt/lib
+  /usr/freeware/lib64)

 find_path(LIBASS_INCLUDE_DIR ass/ass.h
           HINTS ${PC_LIBASS_INCLUDEDIR} ${PC_LIBASS_INCLUDE_DIRS}
@@ -28,23 +44,8 @@
           PATH_SUFFIXES libass)

 find_library(LIBASS_LIBRARY NAMES ass
-             PATHS
-             ${LIBASS_ROOT}/lib
-             $ENV{LIBASS_ROOT}/lib
-             ~/Library/Frameworks
-             /Library/Frameworks
-             /usr/local/lib
-             /usr/local/lib64
-             /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
-             /usr/lib
-             /usr/lib64
-             /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
-             /sw/lib
-             /opt/local/lib
-             /opt/csw/lib
-             /opt/lib
-             /usr/freeware/lib64
-             HINTS ${PC_LIBASS_LIBDIR} ${PC_LIBASS_LIBRARY_DIRS} )
+             PATHS ${LIBRARY_SEARCH_PATHS}
+             HINTS ${PC_LIBASS_LIBDIR} ${PC_LIBASS_LIBRARY_DIRS})

 set(LIBASS_LIBRARIES ${LIBASS_LIBRARY} )
 set(LIBASS_INCLUDE_DIRS ${LIBASS_INCLUDE_DIR} )
@@ -52,11 +53,31 @@
 # On Windows we assume that only static version of libass is used (this is the default build type)
 # so we also link against its dependencies (libass does not provide any Find*.cmake script to simplify this aspect)
 if (${CMAKE_HOST_WIN32})
-  find_package(Freetype REQUIRED)
-  find_package(fribidi REQUIRED)
-  find_package(harfbuzz REQUIRED)
+  find_library(FREETYPE_LIBRARY NAMES freetype
+               PATHS ${LIBRARY_SEARCH_PATHS} ${FREETYPE_ROOT} $ENV{FREETYPE_ROOT}
+               HINTS ${PC_LIBASS_LIBDIR} ${PC_LIBASS_LIBRARY_DIRS})
+
+  find_library(FRIBIDI_LIBRARY NAMES fribidi
+               PATHS ${LIBRARY_SEARCH_PATHS} ${FRIBIDI_ROOT} $ENV{FRIBIDI_ROOT}
+               HINTS ${PC_LIBASS_LIBDIR} ${PC_LIBASS_LIBRARY_DIRS})

-  set(LIBASS_LIBRARIES ${LIBASS_LIBRARIES} ${FREETYPE_LIBRARIES} ${FRIBIDI_LIBRARIES} ${HARFBUZZ_LIBRARIES})
+  find_library(HARBUZZ_LIBRARY NAMES harbuzz
+               PATHS ${LIBRARY_SEARCH_PATHS} ${HARFBUZZ_ROOT} $ENV{HARFBUZZ_ROOT}
+               HINTS ${PC_LIBASS_LIBDIR} ${PC_LIBASS_LIBRARY_DIRS})
+
+  if (NOT FREETYPE_LIBRARY)
+    message(FATAL_ERROR "Could not find required FreeType library: define FREETYPE_LIBRARY to the location of your FreeType library")
+  endif()
+
+  if (NOT FRIBIDI_LIBRARY)
+    message(FATAL_ERROR "Could not find required Fribidi library: define FRIBIDI_LIBRARY to the location of your Fribidi library")
+  endif()
+
+  if (NOT HARBUZZ_LIBRARY)
+    message(FATAL_ERROR "Could not find required Harfbuzz library: define HARBUZZ_LIBRARY to the location of your Harfbuzz library")
+  endif()
+
+  set(LIBASS_LIBRARIES ${LIBASS_LIBRARIES} ${FREETYPE_LIBRARY} ${FRIBIDI_LIBRARY} ${HARBUZZ_LIBRARY})
 endif()

 # handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if


Deleted previous cvmatio release #.

Deleted previous cvmatio release #.

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -54,7 +54,6 @@
 hunter_config(TIFF VERSION 4.0.2-hunter-2)
 hunter_config(Washer VERSION 0.1.2)
 hunter_config(ZLIB VERSION 1.2.8-p2)
-hunter_config(cvmatio VERSION 1.0.19)
 hunter_config(cvmatio VERSION 1.0.11)
 hunter_config(dlib VERSION 18.14-p1)
 hunter_config(ios_sim VERSION 3.1.1)


[CMake] add_llvm_symbol_exports: Use Python oneliner instead of "cmd.exe /c type" to generate *.def.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -93,20 +93,9 @@
   else()
     set(native_export_file "${target_name}.def")

-    set(CAT "cat")
-    set(export_file_nativeslashes ${export_file})
-    if(WIN32 AND NOT CYGWIN AND NOT MSYS)
-      set(CAT "type")
-      # Convert ${export_file} to native format (backslashes) for "type"
-      # Does not use file(TO_NATIVE_PATH) as it doesn't create a native
-      # path but a build-system specific format (see CMake bug
-      # http://public.kitware.com/Bug/print_bug_page.php?bug_id=5939 )
-      string(REPLACE / \\ export_file_nativeslashes ${export_file})
-    endif()
-
     add_custom_command(OUTPUT ${native_export_file}
-      COMMAND ${CMAKE_COMMAND} -E echo "EXPORTS" > ${native_export_file}
-      COMMAND ${CAT} ${export_file_nativeslashes} >> ${native_export_file}
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sys;print(''.join(['EXPORTS\\n']+sys.stdin.readlines(),))"
+        < ${export_file} > ${native_export_file}
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")


[CMake] Prune deprecate usage of CMAKE_RUNTIME_OUTPUT_DIRECTORY.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -267,7 +267,6 @@
   )

 macro(add_llvm_tool name)
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_TOOLS_BINARY_DIR})
   if( NOT LLVM_BUILD_TOOLS )
     set(EXCLUDE_FROM_ALL ON)
   endif()
@@ -284,7 +283,6 @@

 macro(add_llvm_example name)
-#  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LLVM_EXAMPLES_BINARY_DIR})
   if( NOT LLVM_BUILD_EXAMPLES )
     set(EXCLUDE_FROM_ALL ON)
   endif()


actually checks for the header, and sets the path properly, now my compile passes ;)

svn path=/trunk/KDE/kdenetwork/cmake/modules/FindIDN.cmake; revision=620384

--- cmake/modules/FindIDN.cmake
+++ cmake/modules/FindIDN.cmake
@@ -14,7 +14,11 @@

 PKGCONFIG(libidn _IDNIncDir _IDNLinkDir _IDNLinkFlags _IDNCflags)

-set(IDN_INCLUDE_DIR ${_IDNIncDir})
+FIND_PATH(IDN_INCLUDE_DIR idna.h
+  PATHS
+  ${_IDNIncDir}
+  NO_DEFAULT_PATH
+)

 set(IDN_DEFINITIONS ${_IDNCflags})
 set(IDN_INCLUDES ${IDN_INCLUDE_DIR} )


Include ENABLE_tk and ENABLE_itk in summary.

svn path=/trunk/; revision=6979

--- cmake/modules/summary.cmake
+++ cmake/modules/summary.cmake
@@ -67,6 +67,7 @@
 ENABLE_cxx:		${ENABLE_cxx}		ENABLE_java:	${ENABLE_java}
 ENABLE_python:		${ENABLE_python}		ENABLE_octave:	${ENABLE_octave}
 ENABLE_tcl:		${ENABLE_tcl}		ENABLE_itcl:	${ENABLE_itcl}
+ENABLE_tk:		${ENABLE_tk}		ENABLE_itk:	${ENABLE_itk}
 ENABLE_pdl:		${ENABLE_pdl}
 ")
 message("${_output_results}")


ENH: Add VTKDIR for RigidAlignement

ENH: Add VTKDIR for RigidAlignement

--- SuperBuild/External_RigidAlignment.cmake
+++ SuperBuild/External_RigidAlignment.cmake
@@ -43,7 +43,7 @@

   ### --- Project specific additions here
   set(${proj}_CMAKE_OPTIONS
-      #-DITK_DIR:PATH=${ITK_DIR}
+      -DVTK_DIR:PATH=${VTK_DIR}
       -DSlicerExecutionModel_DIR:PATH=${SlicerExecutionModel_DIR}
       -DMeshLib_DIR:PATH=${MeshLib_DIR}
       -DCMAKE_INSTALL_PREFIX:PATH=${EXTERNAL_BINARY_DIRECTORY}/${proj}-install/


Add functions to print colored text to the terminal.

--- src/config.h.cmake
+++ src/config.h.cmake
@@ -1,3 +1,29 @@
+/*
+ * Copyright (c) 2013, Tim Vandermeersch
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *     * Redistributions of source code must retain the above copyright
+ *       notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in the
+ *       documentation and/or other materials provided with the distribution.
+ *     * Neither the name of the <organization> nor the
+ *       names of its contributors may be used to endorse or promote products
+ *       derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
 #ifndef HE_CONFIG_H
 #define HE_CONFIG_H

@@ -28,4 +54,24 @@

 #endif  // _MSC_VER

+namespace Color {
+#ifndef WIN32
+  inline const char *white() { return "\033[0;37m"; }
+  inline const char *red() { return "\033[0;31m"; }
+  inline const char *green() { return "\033[0;32m"; }
+  inline const char *yellow() { return "\033[0;33m"; }
+  inline const char *blue() { return "\033[0;34m"; }
+  inline const char *magenta() { return "\033[0;35m"; }
+  inline const char *cyan() { return "\033[0;36m"; }
+#else
+  inline const char *white() { return ""; }
+  inline const char *red() { return ""; }
+  inline const char *green() { return ""; }
+  inline const char *yellow() { return ""; }
+  inline const char *blue() { return ""; }
+  inline const char *magenta() { return ""; }
+  inline const char *cyan() { return ""; }
+#endif
+}
+
 #endif // HE_CONFIG_H


Compilation Release with debug info par default

--- CMake/ConfigXsilium.cmake
+++ CMake/ConfigXsilium.cmake
@@ -25,7 +25,7 @@
 	if (CMAKE_BUILD_TYPE STREQUAL "")
 	  # CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
 	  # differentiation between debug and release builds.
-	  set(CMAKE_BUILD_TYPE "MinSizeRel" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
+	  set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
 	endif ()

 	set(XSILIUM_INSTALL_PREFIX ${ROOT})


CMakeList: Generate kmd.json during make phase

Change-Id: I4ee8e96b488df634c45150e69b3264a7807cd6fd

--- CMake/CodeGenerator.cmake
+++ CMake/CodeGenerator.cmake
@@ -618,18 +618,26 @@
     const char * getModuleName () {return \"${VALUE_NAME}\";}"
   )

-  execute_code_generator (
-    EXEC_PARAMS -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/
-  )
+  file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/generate_kmd_include.cmake
+"  execute_process (COMMAND ${KurentoModuleCreator_EXECUTABLE} -r ${PARAM_MODELS} -dr ${KURENTO_MODULES_DIR} -o ${CMAKE_CURRENT_BINARY_DIR}/)

   file (READ ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json KMD_DATA)

-  string (REGEX REPLACE "\n *" "" KMD_DATA ${KMD_DATA})
-  string (REPLACE "\"" "\\\"" KMD_DATA ${KMD_DATA})
-  string (REPLACE "\\n" "\\\\n" KMD_DATA ${KMD_DATA})
-  set (KMD_DATA "\"${KMD_DATA}\"")
-
-  file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json ${KMD_DATA})
+  string (REGEX REPLACE \"\\n *\" \"\" KMD_DATA \${KMD_DATA})
+  string (REPLACE \"\\\"\" \"\\\\\\\"\" KMD_DATA \${KMD_DATA})
+  string (REPLACE \"\\\\n\" \"\\\\\\\\n\" KMD_DATA \${KMD_DATA})
+  set (KMD_DATA \"\\\"\${KMD_DATA}\\\"\")
+
+  file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json \${KMD_DATA})
+"
+  )
+
+  add_custom_command(
+    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json
+    COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/generate_kmd_include.cmake
+    DEPENDS ${MODEL_FILES}
+    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+  )

   file (WRITE ${CMAKE_CURRENT_BINARY_DIR}/module_descriptor.cpp
     "
@@ -648,6 +656,7 @@
     ${CMAKE_CURRENT_BINARY_DIR}/module_version.cpp
     ${CMAKE_CURRENT_BINARY_DIR}/module_name.cpp
     ${CMAKE_CURRENT_BINARY_DIR}/module_descriptor.cpp
+    ${CMAKE_CURRENT_BINARY_DIR}/${VALUE_NAME}.kmd.json
   )

   add_dependencies(${VALUE_CODE_IMPLEMENTATION_LIB}module


Enable pep8 testing for cumulus plugin

Enable pep8 testing for cumulus plugin

--- girder/cumulus/plugin.cmake
+++ girder/cumulus/plugin.cmake
@@ -2,3 +2,4 @@
 add_python_test(job PLUGIN cumulus)
 add_python_test(cluster PLUGIN cumulus)
 add_python_test(script PLUGIN cumulus)
+add_python_style_test(pep8_style_cumulus "${PROJECT_SOURCE_DIR}/plugins/cumulus/server")


updated models hash

updated models hash

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -16,7 +16,7 @@

 set(CTEST_PROJECT_NAME "Embree")
 set(CTEST_NIGHTLY_START_TIME "22:00:00 UTC")
-set(TEST_MODELS_HASH 0492fdff472c3d58cbe41159119b82be523405f3)
+set(TEST_MODELS_HASH d74e144bf98219dcfe70f5f6a183f39edb93c958)

 IF (NOT CTEST_DROP_SITE)
   set(CTEST_DROP_METHOD "http")


warning suppression doesn't work as expected

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -1,5 +1,2 @@
-set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "expandandmerge.cpp:(41|64|76): warning: .+c.+ (is|may be) used uninitialized in this function")
-set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "gather.cpp:(39|40|42|44): warning: .+(a|b|ii|castedMask).+ (is|may be) used uninitialized in this function")
-set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "load.cpp:(65|90): warning: .+b.+ (is|may be) used uninitialized in this function")
 set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "used uninitialized in this function")
 set(CTEST_CUSTOM_WARNING_EXCEPTION ${CTEST_CUSTOM_WARNING_EXCEPTION} "warning is a GCC extension")