BUG: Prevent HDF5 from overwritting ITK library names

The OUTPUT_NAME variants, e.g. OUTPUT_NAME_RELEASE, interfere with the
OUTPUT_NAME set by the itk_module_target_name macro.

 libitkhdf5.so ->  libitkhdf5-shared-5.2.so

 Closes #1971

--- Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake_ext_mod/HDFMacros.cmake
+++ Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake_ext_mod/HDFMacros.cmake
@@ -110,6 +110,8 @@

 #-------------------------------------------------------------------------------
 macro (HDF_SET_LIB_OPTIONS libtarget libname libtype)
+  # ITK: use ITK library naming
+  if(FALSE)
   if (${libtype} MATCHES "SHARED")
     set (LIB_RELEASE_NAME "${libname}")
     set (LIB_DEBUG_NAME "${libname}${CMAKE_DEBUG_POSTFIX}")
@@ -163,6 +165,8 @@
         PREFIX ""
     )
   endif ()
+  # ITK: use ITK library naming
+  endif()
 endmacro ()

 #-------------------------------------------------------------------------------


cmake: Fix argument order of get_filename_component().

--- cmake/Modules/FindIconv.cmake
+++ cmake/Modules/FindIconv.cmake
@@ -36,8 +36,8 @@
 )

 if (ICONV_LIBRARY)
-    get_filename_component(NAME ${ICONV_LIBRARY} _ICONV_NAME)
-    get_filename_component(PATH ${ICONV_LIBRARY} _ICONV_PATH)
+    get_filename_component(_ICONV_NAME ${ICONV_LIBRARY} NAME)
+    get_filename_component(_ICONV_PATH ${ICONV_LIBRARY} PATH)
     check_library_exists(${_ICONV_NAME} iconv ${_ICONV_PATH} HAVE_ICONV)
 else()
     check_function_exists(iconv HAVE_ICONV)


Import HPC linear algebra libs as cblas target

--- cmake/external/openblas.cmake
+++ cmake/external/openblas.cmake
@@ -69,8 +69,13 @@
 MESSAGE(STATUS "BLAS library: ${CBLAS_LIBRARIES}")
 INCLUDE_DIRECTORIES(${CBLAS_INC_DIR})

-ADD_LIBRARY(cblas STATIC IMPORTED)
-SET_PROPERTY(TARGET cblas PROPERTY IMPORTED_LOCATION ${CBLAS_LIBRARIES})
+# FIXME(gangliao): generate cblas target to track all high performance
+# linear algebra libraries for cc_library(xxx SRCS xxx.c DEPS cblas)
+SET(dummyfile ${CMAKE_CURRENT_BINARY_DIR}/lib_any_dummy.c)
+FILE(WRITE ${dummyfile} "const char * dummy_any = \"${dummyfile}\";")
+ADD_LIBRARY(cblas STATIC ${dummyfile})
+TARGET_LINK_LIBRARIES(cblas ${CBLAS_LIBRARIES})
+
 IF(NOT ${CBLAS_FOUND})
     ADD_DEPENDENCIES(cblas extern_openblas)
     LIST(APPEND external_project_dependencies cblas)


Fix: parameters order for calling pkg_check_modules, my bad

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@183 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindOpenNI.cmake
+++ cmake/Modules/FindOpenNI.cmake
@@ -8,7 +8,7 @@
 # OPENNI_DEFINITIONS - Compiler flags for OPENNI.

 find_package(PkgConfig)
-pkg_check_modules(PC_OPENNI openni-dev QUIET)
+pkg_check_modules(PC_OPENNI QUIET openni-dev)
 set(OPENNI_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER})

 find_path(OPENNI_INCLUDE_DIR XnStatus.h


:sparkles: add option JSON_TestDataDirectory to set path with test data #2189

--- cmake/download_test_data.cmake
+++ cmake/download_test_data.cmake
@@ -3,15 +3,21 @@
 set(JSON_TEST_DATA_URL     https://github.com/nlohmann/json_test_data)
 set(JSON_TEST_DATA_VERSION 2.0.0)

-# target to download test data
-add_custom_target(download_test_data
-    COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone -c advice.detachedHead=false --branch v${JSON_TEST_DATA_VERSION} ${JSON_TEST_DATA_URL}.git --quiet --depth 1
-    COMMENT "Downloading test data from ${JSON_TEST_DATA_URL} (v${JSON_TEST_DATA_VERSION})"
-    WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
-)
-
-# create a header with the path to the downloaded test data
-file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${CMAKE_BINARY_DIR}/json_test_data\"\n")
+# if variable is set, use test data from given directory rather than downloading them
+if(JSON_TestDataDirectory)
+    message(STATUS "Using test data in ${JSON_TestDataDirectory}.")
+    add_custom_target(download_test_data)
+    file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${JSON_TestDataDirectory}\"\n")
+else()
+    # target to download test data
+    add_custom_target(download_test_data
+        COMMAND test -d json_test_data || ${GIT_EXECUTABLE} clone -c advice.detachedHead=false --branch v${JSON_TEST_DATA_VERSION} ${JSON_TEST_DATA_URL}.git --quiet --depth 1
+        COMMENT "Downloading test data from ${JSON_TEST_DATA_URL} (v${JSON_TEST_DATA_VERSION})"
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+    )
+    # create a header with the path to the downloaded test data
+    file(WRITE ${CMAKE_BINARY_DIR}/include/test_data.hpp "#define TEST_DATA_DIRECTORY \"${CMAKE_BINARY_DIR}/json_test_data\"\n")
+endif()

 # determine the operating system (for debug and support purposes)
 find_program(UNAME_COMMAND uname)


FindOpenCL.cmake is provided since CMake 3.1

--- cmake/modules/FindOpenCL.cmake
+++ cmake/modules/FindOpenCL.cmake
@@ -1,31 +0,0 @@
-# Find the OpenCL includes and library
-#
-# To set manually the paths, define these environment variables:
-#  OpenCL_INC_DIR       - Include path (e.g. OpenCL_INC_DIR=/usr/local/cuda/include)
-#  OpenCL_LIB_DIR       - Library path (e.g. OpenCL_LIB_DIR=/usr/lib64/nvidia)
-#
-# Once done this will define
-#  OpenCL_INCLUDE_DIRS  - where to find OpenCL include files
-#  OpenCL_LIBRARIES     - where to find OpenCL libs
-#  OpenCL_FOUND         - True if OpenCL is found
-
-set(OpenCL_INC_DIR $ENV{OpenCL_INC_DIR} CACHE PATH "OpenCL header files directory.")
-set(OpenCL_LIB_DIR $ENV{OpenCL_LIB_DIR} CACHE PATH "OpenCL library files directory.")
-
-if(APPLE)
-    find_path(OpenCL_INCLUDE_DIR OpenCL/cl.h)
-    find_library(OpenCL_LIBRARY OpenCL)
-    # hack: CMake converts framework path to the following, but we don't use CMake for this
-    set(OpenCL_LIBRARY "-framework OpenCL")
-else()
-    find_path(OpenCL_INCLUDE_DIR CL/cl.h HINTS ${OpenCL_INC_DIR})
-    find_library(OpenCL_LIBRARY OpenCL HINTS ${OpenCL_LIB_DIR})
-endif()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(OpenCL DEFAULT_MSG OpenCL_INCLUDE_DIR OpenCL_LIBRARY)
-
-set(OpenCL_INCLUDE_DIRS ${OpenCL_INCLUDE_DIR})
-set(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
-
-mark_as_advanced(OpenCL_INCLUDE_DIR OpenCL_LIBRARY)


OpenCL: Removed our custom FindOpenCL.cmake function since CMake 3.5.1 can find OpenCL

--- cmake/modules/FindOpenCL.cmake
+++ cmake/modules/FindOpenCL.cmake
@@ -1,147 +0,0 @@
-#.rst:
-# FindOpenCL
-# ----------
-#
-# Try to find OpenCL
-#
-# Once done this will define::
-#
-#   OPENCL_FOUND          - True if OpenCL was found
-#   OPENCL_INCLUDE_DIRS   - include directories for OpenCL
-#   OPENCL_LIBRARIES      - link against this library to use OpenCL
-#   OPENCL_VERSION_STRING - Highest supported OpenCL version (eg. 1.2)
-#   OPENCL_VERSION_MAJOR  - The major version of the OpenCL implementation
-#   OPENCL_VERSION_MINOR  - The minor version of the OpenCL implementation
-#
-# The module will also define two cache variables::
-#
-#   OPENCL_INCLUDE_DIR    - the OpenCL include directory
-#   OPENCL_LIBRARY        - the path to the OpenCL library
-#
-
-#=============================================================================
-# Copyright 2014 Matthaeus G. Chajdas
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-function(_FIND_OPENCL_VERSION)
-  include(CheckSymbolExists)
-  include(CMakePushCheckState)
-  set(CMAKE_REQUIRED_QUIET ${OPENCL_FIND_QUIETLY})
-
-  CMAKE_PUSH_CHECK_STATE()
-  foreach(VERSION "2_0" "1_2" "1_1" "1_0")
-    set(CMAKE_REQUIRED_INCLUDES "${OPENCL_INCLUDE_DIR}")
-
-    if(APPLE)
-      # prefer the header from the Framework
-      set(OSX_OPENCL_HEADER "${OPENCL_INCLUDE_DIR}/Headers/cl.h")
-      if(EXISTS "${OPENCL_INCLUDE_DIR}/OpenCL/cl.h")
-        set(OSX_OPENCL_HEADER "${OPENCL_INCLUDE_DIR}/OpenCL/cl.h")
-      endif()
-
-      CHECK_SYMBOL_EXISTS(
-        CL_VERSION_${VERSION}
-        ${OSX_OPENCL_HEADER}
-        OPENCL_VERSION_${VERSION})
-    else()
-      CHECK_SYMBOL_EXISTS(
-        CL_VERSION_${VERSION}
-        "${OPENCL_INCLUDE_DIR}/CL/cl.h"
-        OPENCL_VERSION_${VERSION})
-    endif()
-
-    if(OPENCL_VERSION_${VERSION})
-      string(REPLACE "_" "." VERSION "${VERSION}")
-      set(OPENCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
-      string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
-      list(GET version_components 0 major_version)
-      list(GET version_components 1 minor_version)
-      set(OPENCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
-      set(OPENCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
-      break()
-    endif()
-  endforeach()
-  CMAKE_POP_CHECK_STATE()
-endfunction()
-
-find_path(OPENCL_INCLUDE_DIR
-  NAMES
-    CL/cl.h OpenCL/cl.h
-  PATHS
-    ENV "PROGRAMFILES(X86)"
-    ENV AMDAPPSDKROOT
-    ENV INTELOCLSDKROOT
-    ENV NVSDKCOMPUTE_ROOT
-    ENV CUDA_PATH
-    ENV ATISTREAMSDKROOT
-  PATH_SUFFIXES
-    ../include # Search in subdirectory since NVIDIA has started to add bin folder, "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin"
-    include
-    OpenCL/common/inc
-    "AMD APP/include")
-
-_FIND_OPENCL_VERSION()
-
-if(WIN32)
-  if(CMAKE_SIZEOF_VOID_P EQUAL 4)
-    find_library(OPENCL_LIBRARY
-      NAMES OpenCL
-      PATHS
-        ENV "PROGRAMFILES(X86)"
-        ENV AMDAPPSDKROOT
-        ENV INTELOCLSDKROOT
-        ENV CUDA_PATH
-        ENV NVSDKCOMPUTE_ROOT
-        ENV ATISTREAMSDKROOT
-      PATH_SUFFIXES
-        "AMD APP/lib/x86"
-        lib/x86
-        lib/Win32
-        OpenCL/common/lib/Win32)
-  elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
-    find_library(OPENCL_LIBRARY
-      NAMES OpenCL
-      PATHS
-        ENV "PROGRAMFILES(X86)"
-        ENV AMDAPPSDKROOT
-        ENV INTELOCLSDKROOT
-        ENV CUDA_PATH
-        ENV NVSDKCOMPUTE_ROOT
-        ENV ATISTREAMSDKROOT
-      PATH_SUFFIXES
-        "AMD APP/lib/x86_64"
-        ../lib/x86_64 # Search in subdirectory since NVIDIA has started to add bin folder, "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\bin"
-        ../lib/x64
-        lib/x86_64
-        lib/x64
-        OpenCL/common/lib/x64)
-  endif()
-else()
-  find_library(OPENCL_LIBRARY
-    NAMES OpenCL)
-endif()
-
-set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
-set(OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})
-
-include(FindPackageHandleStandardArgs)
-# Ubuntu 12.04 / Travis CI have an old version of CMake that doesn't
-# support "FOUND_VAR OPENCL_FOUND". This could, in principle, be added
-# at a later date.
-find_package_handle_standard_args(
-  OpenCL
-  REQUIRED_VARS OPENCL_LIBRARY OPENCL_INCLUDE_DIR
-  VERSION_VAR OPENCL_VERSION_STRING)
-
-mark_as_advanced(
-  OPENCL_INCLUDE_DIR
-  OPENCL_LIBRARY)


Actually read the correct file.

Actually read the correct file.

--- cmake/modules/FindPhonon.cmake
+++ cmake/modules/FindPhonon.cmake
@@ -7,12 +7,14 @@
 #  PHONON_VERSION  - the version of the Phonon Library

 # Copyright (c) 2008, Matthias Kretz <kretz@kde.org>
+# Copyright (c) 2010, Mark Kretschmann <kretschmann@kde.org>
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 macro(_phonon_find_version)
    set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/phonon/phononnamespace.h")
+   set(_phonon_pulsesupport_header_file "${PHONON_INCLUDE_DIR}/phonon/pulsesupport.h")
    if (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
       set(_phonon_namespace_header_file "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
    endif (APPLE AND EXISTS "${PHONON_INCLUDE_DIR}/Headers/phononnamespace.h")
@@ -47,7 +49,7 @@

       if(PHONON_PULSESUPPORT)
          # Check if the method enable() is available in pulsesupport.h
-         file(READ ${_phonon_namespace_header_file} _pulsesupport_header)
+         file(READ ${_phonon_pulsesupport_header_file} _pulsesupport_header)
          string(REGEX MATCH "void enable" _phonon_pulse_match "${_pulsesupport_header}")
          set(PHONON_PULSESUPPORT "${_phonon_pulse_match}")
       endif(PHONON_PULSESUPPORT)


Align compiler and options with master

Align compiler and options with master

--- cmake/modules/SetUpLinux.cmake
+++ cmake/modules/SetUpLinux.cmake
@@ -41,8 +41,7 @@
 set(CRYPTLIBS "-lcrypt")
 set(CMAKE_M_LIBS -lm)

-if(CMAKE_COMPILER_IS_GNUCXX OR
-   CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+if(CMAKE_COMPILER_IS_GNUCXX)

   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -Woverloaded-virtual -fPIC")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -fPIC")
@@ -68,7 +67,42 @@
   set(CMAKE_C_FLAGS_DEBUG            "-g  -fno-reorder-blocks -fno-schedule-insns -fno-inline")
   set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
   set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
-
+
+  #Settings for cint
+  set(CPPPREP "${CXX} -E -C")
+  set(CXXOUT "-o ")
+  set(EXPLICITLINK "no") #TODO
+
+  set(EXEEXT "")
+  set(SOEXT "so")
+
+elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
+
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -Woverloaded-virtual -fPIC")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -fPIC")
+
+  set(CMAKE_Fortran_FLAGS "${CMAKE_FORTRAN_FLAGS} ${BIT_ENVIRONMENT} -std=legacy")
+
+  set(CINT_CXX_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}")
+  set(CINT_C_DEFINITIONS "-DG__REGEXP -DG__UNIX -DG__SHAREDLIB -DG__OSFDLL -DG__ROOT -DG__REDIRECTIO -DG__STD_EXCEPTION ${SPECIAL_CINT_FLAGS}")
+
+  set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
+  set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
+
+  set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined")
+
+  # Select flags.
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
+  set(CMAKE_CXX_FLAGS_RELEASE        "-O2 -DNDEBUG")
+  set(CMAKE_CXX_FLAGS_DEBUG          "-g -fno-schedule-insns -fno-inline")
+  set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
+  set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+  set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g -DNDEBUG")
+  set(CMAKE_C_FLAGS_RELEASE          "-O2 -DNDEBUG")
+  set(CMAKE_C_FLAGS_DEBUG            "-g  -fno-schedule-insns -fno-inline")
+  set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
+  set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
+
   #Settings for cint
   set(CPPPREP "${CXX} -E -C")
   set(CXXOUT "-o ")


Search for pybind11 only at the git submodule location  - Fixes a bug where pybind11 is found in the installation directory

--- cmake_modules/SuperBuild.cmake
+++ cmake_modules/SuperBuild.cmake
@@ -59,7 +59,7 @@

 #######################################################################
 if (USE_PYTHON)
-    find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include)
+  find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include NO_DEFAULT_PATH)
     if( NOT PYBIND_INCLUDE_DIR )
       execute_process(COMMAND git submodule update --init --recursive WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
         find_path(PYBIND_INCLUDE_DIR pybind11/pybind11.h ${CMAKE_CURRENT_SOURCE_DIR}/external_dependencies/pybind11/include)


Fixed some compiler flags and added the EIGEN_NO_DEBUG define for release builds.

--- cmake/ConfigureCompiler.cmake
+++ cmake/ConfigureCompiler.cmake
@@ -65,11 +65,11 @@
                           CACHE STRING "Flags used by the compiler during all build types." FORCE)
       set(CMAKE_CXX_FLAGS_DEBUG "/DDEBUG /Zi"
                           CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-      set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /O3 /ipo /fast"
+      set(CMAKE_CXX_FLAGS_RELEASE "/DNDEBUG /DEIGEN_NO_DEBUG /O3 /ipo /fast"
                           CACHE STRING "Flags used by the compiler during release builds." FORCE)
       set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/DDEBUG /O3 /Zi"
                           CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
-      set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /Os /ipo /fast"
+      set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /DEIGEN_NO_DEBUG /Os /ipo /fast"
                           CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
     else()
       set(CONFIGURE_COMPILER_SET_CXX_COMPILER_FLAGS ON)
@@ -77,11 +77,11 @@
                           CACHE STRING "Flags used by the compiler during all build types." FORCE)
       set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -O0 -g"
                           CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-      set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3 -ipo -fast -g0"
+      set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -DEIGEN_NO_DEBUG -O3 -ipo -fast -g0"
                           CACHE STRING "Flags used by the compiler during release builds." FORCE)
       set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -O3 -ipo -g"
                           CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
-      set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os -ipo -fast"
+      set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -DEIGEN_NO_DEBUG -Os -ipo -fast"
                           CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
     endif()
   endif()
@@ -149,11 +149,11 @@
                         CACHE STRING "Flags used by the compiler during all build types." FORCE)
     set(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -O0 -g"
                         CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3"
+    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -DEIGEN_NO_DEBUG -O3"
                         CACHE STRING "Flags used by the compiler during release builds." FORCE)
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -O3 -g"
                         CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
-    set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -Os"
+    set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -DEIGEN_NO_DEBUG -Os"
                         CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
   endif()
   if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
@@ -210,11 +210,11 @@
     #      (1) Try and figure out problem and fix code
     #      (2) SET_SOURCE_FILES_PROPERTIES(${file} PROPERTIES COMPILE_FLAGS -O1)
     #      Clang 3.3 and lower produces wrong answer for mutilsimpsontestsuite hangs for -O2 or -O3
-    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3"
+    set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -DEIGEN_NO_DEBUG -O3"
                         CACHE STRING "Flags used by the compiler during release builds." FORCE)
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DDEBUG -O3 -g"
                         CACHE STRING "Flags used by the compiler during release with debug info builds." FORCE)
-      set(CMAKE_CXX_FLAGS_MINSIZEREL "/DNDEBUG /Os /ipo /fast"
+      set(CMAKE_CXX_FLAGS_MINSIZEREL "-DNDEBUG -DEIGEN_NO_DEBUG -Os"
                         CACHE STRING "Flags used by the compiler during release minsize builds." FORCE)
   endif()
   if(CMAKE_Fortran_COMPILER_ID STREQUAL "Clang")


[cmake] use check_library_exists instead of check_symbol_exists

--- cmake/Modules/FindCBLAS.cmake
+++ cmake/Modules/FindCBLAS.cmake
@@ -6,18 +6,16 @@
 #  CBLAS_FOUND       - True if CBLAS found.

 include(FindPackageHandleStandardArgs)
-include(CheckSymbolExists)
-
+include(CheckLibraryExists)

 function(FIND_AND_CHECK_CBLAS _libname _includename _symbol)
   find_path(_CBLAS_INCLUDES ${_includename})
   find_library(_CBLAS_LIBRARIES NAMES ${_libname})

   # check if cblas symbol is present
-  if(_CBLAS_LIBRARIES AND _CBLAS_INCLUDES)
-    set(CMAKE_REQUIRED_INCLUDES ${_CBLAS_INCLUDES})
-    set(CMAKE_REQUIRED_LIBRARIES ${_CBLAS_LIBRARIES})
-    check_symbol_exists(${_symbol} ${_includename} _HAVE_CBLAS_SYMBOL)
+  if(_CBLAS_LIBRARIES AND _CBLAS_INCLUDES)
+    get_filename_component(_LIB_PATH ${_CBLAS_LIBRARIES} DIRECTORY)
+    check_library_exists(${_libname} ${_symbol} ${_LIB_PATH} _HAVE_CBLAS_SYMBOL)
     if(_HAVE_CBLAS_SYMBOL)
       set(CBLAS_LIBRARIES ${_CBLAS_LIBRARIES} CACHE FILEPATH "Path to CBLAS library")
       set(CBLAS_INCLUDES ${_CBLAS_INCLUDES} CACHE PATH "Path to CBLAS include directory")
@@ -27,7 +25,7 @@
   # reset variables
   unset(_CBLAS_INCLUDES CACHE)
   unset(_CBLAS_LIBRARIES CACHE)
-endfunction(FIND_AND_CHECK_CBLAS)
+endfunction(FIND_AND_CHECK_CBLAS)

 # check Apple CBLAS


commenting the assignment of Caffe_DIR variable; user must specify the path to his caffe directory

--- cmake/Modules/FindCaffe.cmake
+++ cmake/Modules/FindCaffe.cmake
@@ -1,7 +1,8 @@
 # Caffe package
 unset(Caffe_FOUND)

-set(Caffe_DIR /home/kunal/ssd/caffe/distribute)
+###Set the variable Caffe_DIR as the root of your caffe directory
+#set(Caffe_DIR /*Specify path to caffe here*/)

 find_path(Caffe_INCLUDE_DIRS NAMES caffe/caffe.hpp caffe/common.hpp caffe/net.hpp caffe/proto/caffe.pb.h caffe/util/io.hpp caffe/vision_layers.hpp


Find GTest: Reformat CMake code

Find GTest: Reformat CMake code

--- cmake/Modules/FindGTest.cmake
+++ cmake/Modules/FindGTest.cmake
@@ -1,3 +1,4 @@
+# ~~~
 # This script reads the GTEST_ROOT variable, if available,
 # looking into it as base directory of the GoogleTest sources.
 #
@@ -6,27 +7,20 @@
 # Must be included only once
 #
 # GTEST_ROOT will only be honored in the very first invocation
+# ~~~

 if (NOT GOOGLETEST_ROOT)
 	if (NOT (GTEST_ROOT STREQUAL ""))
 		if (EXISTS ${GTEST_ROOT}/CMakeLists.txt)
-			set(GOOGLETEST_ROOT
-				"${GTEST_ROOT}"
-				CACHE INTERNAL
-				"Folder which gtest will use"
-				FORCE)
+			set (GOOGLETEST_ROOT "${GTEST_ROOT}" CACHE INTERNAL "Folder which gtest will use" FORCE)
 			message (STATUS "used external gtest below ${GTEST_ROOT}")
-		endif()
-	else()
-		set(GOOGLETEST_ROOT
-			${CMAKE_SOURCE_DIR}/tests/gtest-1.7.0
-			CACHE INTERNAL
-			"Folder which gtest will use"
-			FORCE)
-	endif()
-endif()
+		endif ()
+	else ()
+		set (GOOGLETEST_ROOT ${CMAKE_SOURCE_DIR}/tests/gtest-1.7.0 CACHE INTERNAL "Folder which gtest will use" FORCE)
+	endif ()
+endif ()

-add_subdirectory(${GOOGLETEST_ROOT} ${CMAKE_BINARY_DIR}/gtest)
+add_subdirectory (${GOOGLETEST_ROOT} ${CMAKE_BINARY_DIR}/gtest)

-set_property (TARGET gtest PROPERTY COMPILE_FLAGS "-w" )
-set_property (TARGET gtest_main PROPERTY COMPILE_FLAGS "-w" )
+set_property (TARGET gtest PROPERTY COMPILE_FLAGS "-w")
+set_property (TARGET gtest_main PROPERTY COMPILE_FLAGS "-w")


Removes cmake hcFFT finder (no more needed).

--- cmake/modules/FindhcFFT.cmake
+++ cmake/modules/FindhcFFT.cmake
@@ -1,54 +0,0 @@
-# - Find hcFFT, HSA's hcFFT library
-
-# This script defines the following variables:
-# HCFFT_INCLUDE_DIRS    - Location of hcFFT's include directory.
-# HCFFT_LIBRARIES       - Location of hcFFT's libraries
-# HCFFT_FOUND           - True if hcFFT has been located
-#
-# If your hcFFT installation is not in a standard installation directory, you
-# may provide a hint to where it may be found. Simply set the value HCFFT_ROOT
-# to the directory containing 'include/hcfft.h" prior to calling this script.
-# Defining an environment variable called HCFFT_ROOT would also work
-#
-# By default this script will attempt to find the 32-bit version of hcFFT.
-# If you desire to use the 64-bit version instead, set
-#   set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS ON)
-# prior to calling this script.
-#
-#=============================================================================
-# Copyright 2016 Peter Steinbach
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#=============================================================================
-#
-if( (NOT DEFINED HCFFT_ROOT) AND DEFINED ENV{HCFFT_ROOT} )
-  set( HCFFT_ROOT $ENV{HCFFT_ROOT} )
-endif()
-
-find_path(HCFFT_INCLUDE_DIRS
-    NAMES "hcfft.h"
-    PATHS ${HCFFT_ROOT}
-    PATH_SUFFIXES "include"
-    )
-find_library(HCFFT_LIBRARIES
-    NAMES "hcfft"
-    PATHS ${HCFFT_ROOT}
-    PATH_SUFFIXES "lib" "lib64"
-    )
-# handle the QUIETLY and REQUIRED arguments and set HCFFT_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE (FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(HCFFT DEFAULT_MSG HCFFT_LIBRARIES HCFFT_INCLUDE_DIRS)
-MARK_AS_ADVANCED(HCFFT_LIBRARIES HCFFT_INCLUDE_DIRS)
-
-


*** empty log message ***

*** empty log message ***

git-svn-id: b7791fb0f5d07d96612766859ad70a13be88ea96@1899 305cdda6-5ce1-45b3-a98d-dfc68c8b3305

--- library/FindACML.cmake
+++ library/FindACML.cmake
@@ -33,15 +33,15 @@
 RESET_VAR_IF_CHANGED( ACML_SEARCH_PATHS ACML_USE_OPENMP_LIBRARIES)
 RESET_VAR_IF_CHANGED( ACML_SEARCH_PATHS ACML_USE_SHARED_LIBRARIES)

-SET(ACML_BASE_SEARCH_PATHS "/opt/acml" "C:\\Program Files\\AMD\\acml")
+SET(ACML_BASE_SEARCH_PATHS "/opt/acml" "C:\\AMD\\acml" "C:\\Program Files\\AMD\\acml")
 SET(ACML_SEARCH_PATHS "")

 # The various supported versions.  When new versions come out this will need
 # to be updated to allow automatic detection.
-SET(ACML_VERSIONS 4.1.0 4.0.0 3.5.0 3.6.0 3.6.1)
+SET(ACML_VERSIONS 4.2.0 4.1.0 4.0.0 3.5.0 3.6.0 3.6.1)

-SET(MP_COMPILER_VERSIONS gfortran64_mp gfortran64_mp_int64 pgi32_mp)
-SET(COMPILER_VERSIONS gfortran64 gfortran64_int64 pgi32)
+SET(MP_COMPILER_VERSIONS gfortran64_mp gfortran64_mp_int64 pgi32_mp ifort32_mp)
+SET(COMPILER_VERSIONS gfortran64 gfortran64_int64 pgi32 ifort32)

 SET(COMPILER_VERSION_TO_USE "a")

@@ -66,26 +66,24 @@

 IF( ACML_USE_SHARED_LIBRARIES )
 	IF( ACML_USE_OPENMP_LIBRARIES )
-		SET(ACML_LIB_NAMES acml_mp)
+		SET(ACML_LIB_NAMES acml_mp acml_mp_dll libacml_mp_dll)
 	ELSE( ACML_USE_OPENMP_LIBRARIES )
-		SET(ACML_LIB_NAMES acml)
+		SET(ACML_LIB_NAMES acml acml_dll libacml_dll)
 	ENDIF( ACML_USE_OPENMP_LIBRARIES )
 ELSE( ACML_USE_SHARED_LIBRARIES )
 	IF( ACML_USE_OPENMP_LIBRARIES )
-		SET(ACML_LIB_NAMES acml_mp)
+		SET(ACML_LIB_NAMES acml_mp libacml_mp)
 	ELSE( ACML_USE_OPENMP_LIBRARIES )
-		SET(ACML_LIB_NAMES acml)
+		SET(ACML_LIB_NAMES acml libacml)
 	ENDIF( ACML_USE_OPENMP_LIBRARIES )
 ENDIF( ACML_USE_SHARED_LIBRARIES )

 FIND_LIBRARY( ACML NAMES ${ACML_LIB_NAMES} PATHS ${ACML_LIB_PATH} )

-#MESSAGE(${ACML})
-
 IF( ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" )
 	SET( ACML_TARGET_LINK_LIBRARIES ${ACML} gfortran )
 ELSE( ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" )
-	SET( ACML_TARGET_LINK_LIBRARIES ${ACML} gfortran )
+	SET( ACML_TARGET_LINK_LIBRARIES ${ACML} )
 ENDIF( ${CMAKE_GENERATOR} STREQUAL "Unix Makefiles" )

 IF (ACML_INCLUDE_PATH)


Upgraded pythonqt from ctk master

Upgraded pythonqt from ctk master

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -90,7 +90,7 @@
         -DCTK_USE_GIT_PROTOCOL:BOOL=OFF
         -DDCMTK_DIR:PATH=${DCMTK_DIR}
         -DqRestAPI_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/qRestAPI_c5e4c2a7_patched.tar.gz
-        -DPythonQt_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/PythonQt_cb38ae51.tar.gz
+        -DPythonQt_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/PythonQt_a081f9d6.tar.gz
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}
       CMAKE_CACHE_DEFAULT_ARGS


[cmake] removed space

[cmake] removed space

--- CMakeModules/FindBinaryen.cmake
+++ CMakeModules/FindBinaryen.cmake
@@ -13,6 +13,6 @@
 # handle the QUIETLY and REQUIRED arguments and set BINARYEN_FOUND to TRUE
 # if all listed variables are TRUE

-find_package_handle_standard_args(BINARYEN DEFAULT_MSG BINARYEN_BIN BINARYEN_INCLUDE_DIRS BINARYEN_LIBRARIES )
+find_package_handle_standard_args(BINARYEN DEFAULT_MSG BINARYEN_BIN BINARYEN_INCLUDE_DIRS BINARYEN_LIBRARIES)

 mark_as_advanced(BINARYEN_BIN BINARYEN_INCLUDE_DIRS BINARYEN_LIBRARIES)


Update version number

Update version number

--- Projects/velodyneviewer.bundle.common.cmake
+++ Projects/velodyneviewer.bundle.common.cmake
@@ -2,7 +2,7 @@
 # configure stage.
 set (vv_version_major 1)
 set (vv_version_minor 0)
-set (vv_version_patch 1)
+set (vv_version_patch 2)
 set (vv_version_suffix)
 set (vv_version "${vv_version_major}.${vv_version_minor}")


Quiten displaycluster finder

Quiten displaycluster finder

--- FindDisplayCluster.cmake
+++ FindDisplayCluster.cmake
@@ -15,16 +15,15 @@

 if(DISPLAYCLUSTER_FIND_REQUIRED)
   set(_DISPLAYCLUSTER_required REQUIRED)
-  set(_DISPLAYCLUSTER_version_output_type FATAL_ERROR)
   set(_DISPLAYCLUSTER_output 1)
+  set(_DISPLAYCLUSTER_output_type FATAL_ERROR)
 else()
-  set(_DISPLAYCLUSTER__version_output_type STATUS)
-  if(NOT DISPLAYCLUSTER_FIND_QUIETLY)
-    set(_DISPLAYCLUSTER_output 1)
-  endif()
+  set(_DISPLAYCLUSTER_output_type STATUS)
 endif()
 if(DISPLAYCLUSTER_FIND_QUIETLY)
   set(_DISPLAYCLUSTER_quiet QUIET)
+else()
+  set(_DISPLAYCLUSTER_output 1)
 endif()

 find_path(_DISPLAYCLUSTER_INCLUDE_DIR dcStream.h
@@ -43,7 +42,8 @@
 else()
   set(_DISPLAYCLUSTER_EPIC_FAIL TRUE)
   if(_DISPLAYCLUSTER_output)
-    message(${_DISPLAYCLUSTER_version_output_type} "Can't find DisplayCluster header file dcStream.h.")
+    message(${_DISPLAYCLUSTER_output_type}
+      "Can't find DisplayCluster header file dcStream.h.")
   endif()
 endif()

@@ -75,14 +75,18 @@
                                     DISPLAYCLUSTER_LIBRARY _DISPLAYCLUSTER_INCLUDE_DIR)
 elseif(_DISPLAYCLUSTER_version_not_high_enough)
   set(_DISPLAYCLUSTER_EPIC_FAIL TRUE)
-  message(${_DISPLAYCLUSTER_version_output_type}
-    "Version ${DISPLAYCLUSTER_FIND_VERSION} or higher of DisplayCluster is required. "
-    "Version ${DISPLAYCLUSTER_VERSION} was found in ${_DISPLAYCLUSTER_Version_file}.")
+  if(_DISPLAYCLUSTER_output)
+    message(${_DISPLAYCLUSTER_output_type}
+      "Version ${DISPLAYCLUSTER_FIND_VERSION} or higher of DisplayCluster is required. "
+      "Version ${DISPLAYCLUSTER_VERSION} was found in ${_DISPLAYCLUSTER_Version_file}.")
+  endif()
 elseif(_DISPLAYCLUSTER_version_not_exact)
   set(_DISPLAYCLUSTER_EPIC_FAIL TRUE)
-  message(${_DISPLAYCLUSTER_version_output_type}
-    "Version ${DISPLAYCLUSTER_FIND_VERSION} of DisplayCluster is required exactly. "
-    "Version ${DISPLAYCLUSTER_VERSION} was found.")
+  if(_DISPLAYCLUSTER_output)
+    message(${_DISPLAYCLUSTER_output_type}
+      "Version ${DISPLAYCLUSTER_FIND_VERSION} of DisplayCluster is required exactly. "
+      "Version ${DISPLAYCLUSTER_VERSION} was found.")
+  endif()
 else()
   if(DISPLAYCLUSTER_FIND_REQUIRED)
     if(DISPLAYCLUSTER_LIBRARY MATCHES "DISPLAYCLUSTER_LIBRARY-NOTFOUND")


FLP fix

FLP fix

--- FindLibraryPackage.cmake
+++ FindLibraryPackage.cmake
@@ -169,11 +169,11 @@
   # Version checking
   if(${_flp_NAME}_VERSION AND ${name}_FIND_VERSION)
     if(${name}_FIND_VERSION_EXACT)
-      if(NOT ${name}_FIND_VERSION VERSION_EQUAL ${_flp_NAME}_VERSION})
+      if(NOT ${name}_FIND_VERSION VERSION_EQUAL ${_flp_NAME}_VERSION)
         set(_flp_EPIC_FAIL TRUE)
         if(_flp_output)
           message(${_flp_version_output_type}
-            "Version ${${name}_FIND_VERSION} of ${name} is required exactly. "
+            "Version ${${name}_FIND_VERSION} of ${name} is required exactly."
             "Version ${${_flp_NAME}_VERSION} was found.")
         endif()
       endif()
@@ -183,7 +183,7 @@
         set(_flp_EPIC_FAIL TRUE)
         if(_flp_output)
           message(${_flp_version_output_type}
-            "Version ${${name}_FIND_VERSION} or higher of ${name} is required. "
+            "Version ${${name}_FIND_VERSION} or higher of ${name} is required."
             "Version ${${_flp_NAME}_VERSION} was found in ${${_flp_NAME}_INCLUDE_DIR}.")
         endif()
       endif()


Update Kylin dependency to 1.5.4.

Update Kylin dependency to 1.5.4.

--- build/cmake/versions.cmake
+++ build/cmake/versions.cmake
@@ -12,8 +12,8 @@
 set(GLIDE_HASH 898ab4f7f15fd8274cc43f48077dcf72)
 set(GOLANG_VERSION 1.7.1)
 set(GOLANG_HASH 43ad621c9b014cde8db17393dc108378d37bc853aa351a6c74bf6432c1bbd182)
-set(KYLIN_VERSION 1.5.3)
-set(KYLIN_HASH 517874b77685a9aae25719bed208edaa)
+set(KYLIN_VERSION 1.5.4)
+set(KYLIN_HASH 9f0c7cd5e02cd6c8098ab061a9d712f6)
 set(LIBCIDR_VERSION 1.2.3)
 set(LIBCIDR_HASH c5efcc7ae114fdaa5583f58dacecd9de)
 set(LIBESTR_VERSION 0.1.10)


Remove invalid parameter

Remove invalid parameter

--- CMake/HeadorOnlyVSProject.cmake
+++ CMake/HeadorOnlyVSProject.cmake
@@ -7,11 +7,7 @@
     ${ARGN}
   )
   # Dummy project to show the header-only lib in VS
-  add_custom_target(
-    ${DUMMY_TARGET_NAME}
-    EXCLUDE_FROM_ALL
-    SOURCES ${LIB_HEADERS}
-  )
+  add_custom_target(${DUMMY_TARGET_NAME} SOURCES ${LIB_HEADERS})

   if(PARSED_ARGS_FOLDER)
     message(STATUS "FOLDER property of ${DUMMY_TARGET_NAME} is to ${PARSED_ARGS_FOLDER}")


BUG: NIFTYREG_DIR was always overwritten under the assumption that SuperElastix was built by the SuperBuild

Now we properly use NIFTYREG_DIR from CMake cache and complain if not
set. This is the expected behaviour.

--- Modules/Components/Niftyreg/ModuleNiftyreg.cmake
+++ Modules/Components/Niftyreg/ModuleNiftyreg.cmake
@@ -25,14 +25,11 @@
   set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
 endif()

-set(NIFTYREG_DIR ${CMAKE_BINARY_DIR}/../Niftyreg-prefix)
-#message(STATUS ${NIFTYREG_DIR})
-
 find_package( Niftyreg REQUIRED )
-#mark_as_advanced(Niftyreg_DIR)
-if (NOT Niftyreg_FOUND)
-  #set( NIFTYREG_DIR "" CACHE PATH "Path to Niftyreg build folder" )
-  message(FATAL_ERROR "Could not find Niftyreg. Point NIFTYREG_DIR to its install folder.")
+if( NOT Niftyreg_FOUND )
+  mark_as_advanced( NIFTYREG_DIR )
+  set( NIFTYREG_DIR "" CACHE PATH "Path to Niftyreg build folder." )
+  message( FATAL_ERROR "Could not find Niftyreg. Point NIFTYREG_DIR to its install folder." )
 endif()

 set( ${MODULE}_INCLUDE_DIRS


update

update

--- modules/protobuf.cmake
+++ modules/protobuf.cmake
@@ -20,7 +20,6 @@
   set_target_properties(libprotobuf-lite PROPERTIES FOLDER modules/protobuf)
   set_target_properties(libprotoc PROPERTIES FOLDER modules/protobuf)
   set_target_properties(protoc PROPERTIES FOLDER modules/protobuf)
-  set_target_properties(js_embed PROPERTIES FOLDER modules/protobuf)

   # Module definition
   set(protobuf "${CMAKE_CURRENT_SOURCE_DIR}/protobuf/src" PARENT_SCOPE)


[CMake] Update Platform Specific Android script.

--- EMULATOR/PLATFORM/Android.cmake
+++ EMULATOR/PLATFORM/Android.cmake
@@ -0,0 +1,7 @@
+if(ANDROID)
+
+Message("Compiling for Android!")
+
+#TODO
+
+endif()


armadillo openblas wrapper

armadillo openblas wrapper

--- include/pass_bits/config.hpp.cmake
+++ include/pass_bits/config.hpp.cmake
@@ -3,6 +3,7 @@
 // Armadillo
 #define ARMA_DONT_PRINT_ERRORS
 #define ARMA_USE_WRAPPER
+#define ARMA_BLAS_LONG
 #define ARMA_USE_CXX11
 #include <armadillo>
 #include <cblas.h>


Explicitly specify feature test macro for glibc earlier than 2.19 (#7397)

--- src/pal/src/configure.cmake
+++ src/pal/src/configure.cmake
@@ -13,7 +13,7 @@
   set(CMAKE_REQUIRED_INCLUDES /opt/local/include)
 endif()
 if(NOT CMAKE_SYSTEM_NAME STREQUAL Darwin AND NOT CMAKE_SYSTEM_NAME STREQUAL FreeBSD AND NOT CMAKE_SYSTEM_NAME STREQUAL NetBSD)
-  set(CMAKE_REQUIRED_DEFINITIONS "-D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
+  set(CMAKE_REQUIRED_DEFINITIONS "-D_BSD_SOURCE -D_SVID_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200809L")
 endif()

 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_FILE_OFFSET_BITS=64)


Check separate paths for LLVM homebrew (x86_64/arm64)

--- atdna/FindLLVM.cmake
+++ atdna/FindLLVM.cmake
@@ -42,9 +42,16 @@
                       llvm-config-3.3 llvm-config33
                       llvm-config-3.2 llvm-config32
                       llvm-config-3.1 llvm-config31 llvm-config)
+if(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL x86_64)
+    set(LLVM_HOMEBREW_PATH /usr/local/opt/llvm/bin)
+elseif(APPLE AND CMAKE_SYSTEM_PROCESSOR STREQUAL arm64)
+    set(LLVM_HOMEBREW_PATH /opt/homebrew/opt/llvm/bin)
+else()
+    set(LLVM_HOMEBREW_PATH "")
+endif()
 find_program(LLVM_CONFIG
     NAMES ${llvm_config_names}
-    PATHS ${LLVM_ROOT_DIR}/bin /usr/local/opt/llvm/bin /opt/homebrew/opt/llvm/bin NO_DEFAULT_PATH
+    PATHS ${LLVM_ROOT_DIR}/bin ${LLVM_HOMEBREW_PATH} NO_DEFAULT_PATH
     DOC "Path to llvm-config tool.")
 find_program(LLVM_CONFIG NAMES ${llvm_config_names})


adapt to new dir structure within Google Test

--- modules/googletest.cmake
+++ modules/googletest.cmake
@@ -8,9 +8,9 @@
 #
 # autocmake.cfg configuration::
 #
-#   define: '-DGOOGLETEST_ROOT=external/googletest'
+#   define: '-DGOOGLETEST_ROOT=external/googletest/googletest'

-set(GOOGLETEST_ROOT external/googletest CACHE STRING "Google Test source root")
+set(GOOGLETEST_ROOT external/googletest/googletest CACHE STRING "Google Test source root")

 message(STATUS "GOOGLETEST_ROOT set to ${GOOGLETEST_ROOT}")


set cmake policies only when available (fix #247)

--- cmake/all.cmake
+++ cmake/all.cmake
@@ -66,25 +66,30 @@
 list(INSERT CMAKE_PREFIX_PATH 0 ${CATKIN_DEVEL_PREFIX})

-# enable all new policies
-cmake_policy(SET CMP0000 NEW)
-cmake_policy(SET CMP0001 NEW)
-cmake_policy(SET CMP0002 NEW)
-cmake_policy(SET CMP0003 NEW)
-cmake_policy(SET CMP0004 NEW)
-cmake_policy(SET CMP0005 NEW)
-cmake_policy(SET CMP0006 NEW)
-cmake_policy(SET CMP0007 NEW)
-cmake_policy(SET CMP0008 NEW)
-cmake_policy(SET CMP0009 NEW)
-cmake_policy(SET CMP0010 NEW)
-cmake_policy(SET CMP0011 NEW)
-cmake_policy(SET CMP0012 NEW)
-cmake_policy(SET CMP0013 NEW)
-cmake_policy(SET CMP0014 NEW)
-cmake_policy(SET CMP0015 NEW)
-cmake_policy(SET CMP0016 NEW)
-cmake_policy(SET CMP0017 NEW)
+# enable all new policies (if available)
+macro(_set_cmake_policy_to_new_if_available policy)
+  if(POLICY ${policy})
+    cmake_policy(SET ${policy} NEW)
+  endif()
+endmacro()
+_set_cmake_policy_to_new_if_available(CMP0000)
+_set_cmake_policy_to_new_if_available(CMP0001)
+_set_cmake_policy_to_new_if_available(CMP0002)
+_set_cmake_policy_to_new_if_available(CMP0003)
+_set_cmake_policy_to_new_if_available(CMP0004)
+_set_cmake_policy_to_new_if_available(CMP0005)
+_set_cmake_policy_to_new_if_available(CMP0006)
+_set_cmake_policy_to_new_if_available(CMP0007)
+_set_cmake_policy_to_new_if_available(CMP0008)
+_set_cmake_policy_to_new_if_available(CMP0009)
+_set_cmake_policy_to_new_if_available(CMP0010)
+_set_cmake_policy_to_new_if_available(CMP0011)
+_set_cmake_policy_to_new_if_available(CMP0012)
+_set_cmake_policy_to_new_if_available(CMP0013)
+_set_cmake_policy_to_new_if_available(CMP0014)
+_set_cmake_policy_to_new_if_available(CMP0015)
+_set_cmake_policy_to_new_if_available(CMP0016)
+_set_cmake_policy_to_new_if_available(CMP0017)

 # the following operations must be performed inside a project context
 if(NOT PROJECT_NAME)


fixed dependencies for generating the EventTracing Header files correctly.

--- cmake/etw.cmake
+++ cmake/etw.cmake
@@ -39,35 +39,23 @@

 CHECK_ETW()

-# Produce a header file  with
-# ETW macros
-MACRO (ETW_HEADER provider header_name)
- IF(ENABLE_ETW)
- ADD_CUSTOM_COMMAND(
-   OUTPUT  ${header_name}.h ${header_name}.rc ${header_name}Temp.bin
-   COMMAND ${CMAKE_MC_COMPILER} -um ${provider} -z ${header_name}
-   WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/utDataflow
-   COMMENT "Exectuing: mc.exe -um ${provider} -z ${header_name}"
-   DEPENDS ${provider}
- )
- ENDIF()
-ENDMACRO()
-
-
 # Create provider headers
 IF(ENABLE_ETW)
   CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/doc/etw/ubitrack_etw_providers.man.base
     ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man COPYONLY)
-  ETW_HEADER(
-   ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man
-   probes_ubitrack_etw
-  )
-  MESSAGE(WARN "Please execute these commands manually for now:")
-  MESSAGE(STATUS "ETW Generate Headers command: cd  ${CMAKE_BINARY_DIR}/utDataflow")
-  MESSAGE(STATUS "ETW Generate Headers command: mc.exe -um ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man -z probes_ubitrack_etw")
-  ADD_CUSTOM_TARGET(gen_etw_header
+
+ ADD_CUSTOM_COMMAND(
+   OUTPUT "${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etw.h"
+           "${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etw.rc"
+           "${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etwTemp.bin"
+   COMMAND ${CMAKE_MC_COMPILER} -um ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man -z probes_ubitrack_etw
+   WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/utDataflow"
+   COMMENT "Exectuing: mc.exe -um ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man -z probes_ubitrack_etw"
+   DEPENDS ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man
+ )
+
+ADD_CUSTOM_TARGET(gen_etw_header
   DEPENDS
-  ${CMAKE_BINARY_DIR}/utDataflow/ubitrack_etw_providers.man
   ${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etw.h
   ${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etw.rc
   ${CMAKE_BINARY_DIR}/utDataflow/probes_ubitrack_etwTemp.bin
@@ -75,7 +63,5 @@
 ENDIF()

 FUNCTION(ETW_INSTRUMENT target)
-  IF(ENABLE_ETW)
-    ADD_DEPENDENCIES(${target} gen_etw_header)
-  ENDIF()
+  ADD_DEPENDENCIES(${target} gen_etw_header)
 ENDFUNCTION()


cmake/g++: restore mistakenly deleted -Weffc++

--- cmake/g++.cmake
+++ cmake/g++.cmake
@@ -2,7 +2,7 @@
 # GNU G++ options
 #

-set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -Wextra -Werror -pedantic -pipe")
+set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -Wextra -Weffc++ -Werror -pedantic -pipe")
 set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG -ggdb -O0")
 set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")


using GLOB_RECURSE for library sources

using GLOB_RECURSE for library sources

--- cmake/lib.cmake
+++ cmake/lib.cmake
@@ -6,6 +6,7 @@
 if(CRYPTOPP_INCLUDE_DIR)
     set(ABI_ENALED TRUE)
     add_definitions(-D__ABI_ENABLED__)
+    add_definitions(-DBOOST_PP_VARIADICS)
     add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/abi)
 endif()

@@ -15,10 +16,7 @@
 include_directories(${Boost_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/src)
 include_directories(${JSONCPP_INCLUDE_DIR})

-file(GLOB SOURCES
-    "src/*.cpp"
-    "src/transport/*.cpp"
-)
+file(GLOB_RECURSE SOURCES "src/*.cpp")

 include(CheckTypeSize)

@@ -60,7 +58,6 @@
               COMMAND ${CMAKE_AR} x  ${ABI_LIBRARY_PATH} WORKING_DIRECTORY ${LIB_OBJ_DIR}
               COMMAND ${CMAKE_AR} x  ${ETHRPC_LIBRARY_PATH} WORKING_DIRECTORY ${LIB_OBJ_DIR}
               COMMAND ${CMAKE_AR} rcs  ${ETHRPC_LIBRARY_PATH} ${LIB_OBJ_DIR}/*.o
-              COMMAND rm -fr ${LIB_OBJ_DIR}
         )
     endif ()
     file(COPY ${CMAKE_CURRENT_BINARY_DIR}/abi/include/abi DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/include/ethrpc)


activated tests again

activated tests again

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -8,8 +8,7 @@
    # mark it as critical.

    ################## DISABLED TESTS #################################################
-   #mitkNavigationToolStorageSerializerTest.cpp # deactivated because of bug 17199
-   #mitkNavigationToolStorageSerializerAndDeserializerIntegrationTest.cpp # deactivated because of bug 17199
+   # <none>

    ################# RUNNING TESTS ###################################################
    mitkCameraVisualizationTest.cpp
@@ -47,6 +46,8 @@
    mitkNavigationToolTest.cpp
    mitkNavigationToolReaderAndWriterTest.cpp
    mitkNavigationToolStorageDeserializerTest.cpp
+   mitkNavigationToolStorageSerializerTest.cpp
+   mitkNavigationToolStorageSerializerAndDeserializerIntegrationTest.cpp
    # -----------------------------------------------------------------------
 )


Remove FindExtProject.cmake

Remove FindExtProject.cmake

--- cmake/FindExtProject.cmake
+++ cmake/FindExtProject.cmake
@@ -1,377 +0,0 @@
-################################################################################
-# Project:  external projects
-# Purpose:  CMake build scripts
-# Author:   Dmitry Baryshnikov, polimax@mail.ru
-################################################################################
-# Copyright (C) 2015-2016, NextGIS <info@nextgis.com>
-# Copyright (C) 2015 Dmitry Baryshnikov
-#
-# This script is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This script is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this script.  If not, see <http://www.gnu.org/licenses/>.
-################################################################################
-
-function(get_imported_targets file_to_search targets)
-    file(STRINGS ${file_to_search} targets_str
-         REGEX "^foreach+([()_a-zA-Z0-9 ]+)")
-    string(SUBSTRING ${targets_str} 24 -1 targets_local)
-    string(LENGTH ${targets_local} STR_LEN)
-    math(EXPR LAST_INDEX "${STR_LEN} - 1")
-    string(SUBSTRING ${targets_local} 0 ${LAST_INDEX} targets_local)
-    string(REPLACE " " ";" targets_local ${targets_local})
-    set(${targets} ${targets_local} PARENT_SCOPE)
-endfunction()
-
-function(get_target_name target_lib target_name)
-    string(LENGTH ${target_lib} STR_LEN)
-    if(STR_LEN LESS 21)
-        return()
-    endif()
-    string(SUBSTRING ${target_lib} 21 -1 targets_local)
-    string(LENGTH ${targets_local} STR_LEN)
-    math(EXPR LAST_INDEX "${STR_LEN} - 1")
-    string(SUBSTRING ${targets_local} 0 ${LAST_INDEX} targets_local)
-    set(${target_name} ${targets_local} PARENT_SCOPE)
-endfunction()
-
-function(check_updates file_path update_period check)
-    file(TIMESTAMP ${file_path} LAST_PULL "%y%j%H%M" UTC)
-    if(NOT LAST_PULL)
-        set(LAST_PULL 0)
-    endif()
-    string(TIMESTAMP CURRENT_TIME "%y%j%H%M" UTC)
-    math(EXPR DIFF_TIME "${CURRENT_TIME} - ${LAST_PULL}")
-    #message(STATUS "period ${update_period} diff ${DIFF_TIME} current ${CURRENT_TIME} last ${LAST_PULL}")
-    if(DIFF_TIME GREATER ${update_period})
-        set(${check} TRUE PARENT_SCOPE)
-    else()
-        set(${check} FALSE PARENT_SCOPE)
-    endif()
-endfunction()
-
-function(color_message text)
-
-    string(ASCII 27 Esc)
-    set(BoldGreen   "${Esc}[1;32m")
-    set(ColourReset "${Esc}[m")
-
-    message(STATUS "${BoldGreen}${text}${ColourReset}")
-
-endfunction()
-
-function(include_exports_path include_path)
-    #add to list imported
-    list(FIND EXPORTS_PATHS ${include_path} PATH_INDEX)
-    if(PATH_INDEX EQUAL -1)
-        list(APPEND EXPORTS_PATHS "${include_path}")
-        set(EXPORTS_PATHS "${EXPORTS_PATHS}" PARENT_SCOPE)
-        # Add imported library have limit scope
-        # During the export cmake add library without GLOBAL parameter and no
-        # way to change this bihaviour. Let's fix it.
-        file (READ ${include_path} _file_content)
-        string (REPLACE "IMPORTED)" "IMPORTED GLOBAL)" _file_content "${_file_content}")
-        file(WRITE ${include_path} "${_file_content}")
-
-        include(${include_path})
-    endif()
-endfunction()
-
-function(find_extproject name)
-    set(options OPTIONAL)
-    set(oneValueArgs SHARED)
-    set(multiValueArgs CMAKE_ARGS)
-    cmake_parse_arguments(find_extproject "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-
-    # set default third party lib path
-    if(NOT DEFINED EP_PREFIX)
-        set(EP_PREFIX "${CMAKE_BINARY_DIR}/third-party")
-    endif()
-
-    # set default url
-    if(NOT DEFINED EP_URL)
-        set(EP_URL "https://github.com/nextgis-borsch")
-    endif()
-
-    if(NOT DEFINED PULL_UPDATE_PERIOD)
-        set(PULL_UPDATE_PERIOD 25) # 25 min
-    endif()
-
-    if(NOT DEFINED PULL_TIMEOUT)
-        set(PULL_TIMEOUT 100) # 100 ms
-    endif()
-
-    if(NOT DEFINED SUPRESS_VERBOSE_OUTPUT)
-        set(SUPRESS_VERBOSE_OUTPUT TRUE)
-    endif()
-
-    list(APPEND find_extproject_CMAKE_ARGS -DEP_PREFIX=${EP_PREFIX})
-    list(APPEND find_extproject_CMAKE_ARGS -DEP_URL=${EP_URL})
-    list(APPEND find_extproject_CMAKE_ARGS -DPULL_UPDATE_PERIOD=${PULL_UPDATE_PERIOD})
-    list(APPEND find_extproject_CMAKE_ARGS -DPULL_TIMEOUT=${PULL_TIMEOUT})
-    list(APPEND find_extproject_CMAKE_ARGS -DSUPRESS_VERBOSE_OUTPUT=${SUPRESS_VERBOSE_OUTPUT})
-    if(CMAKE_TOOLCHAIN_FILE)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
-    endif()
-    if(ANDROID)
-        # TODO: do we need more keys?
-        list(APPEND find_extproject_CMAKE_ARGS -DANDROID_NDK=${ANDROID_NDK})
-        list(APPEND find_extproject_CMAKE_ARGS -DANDROID_NATIVE_API_LEVEL=${ANDROID_NATIVE_API_LEVEL})
-        list(APPEND find_extproject_CMAKE_ARGS -DANDROID_ABI=${ANDROID_ABI})
-        list(APPEND find_extproject_CMAKE_ARGS -DANDROID=ON)
-    endif()
-
-    set_property(DIRECTORY PROPERTY "EP_PREFIX" ${EP_PREFIX})
-
-    set(EXT_INSTALL_DIR ${EP_PREFIX})
-    set(EXT_STAMP_DIR ${EP_PREFIX}/src/${name}_EP-stamp)
-    set(EXT_BUILD_DIR ${EP_PREFIX}/src/${name}_EP-build)
-
-    # search CMAKE_INSTALL_PREFIX
-    string (REGEX MATCHALL "(^|;)-DCMAKE_INSTALL_PREFIX=[A-Za-z0-9_]*" _matchedVars "${find_extproject_CMAKE_ARGS}")
-    list(LENGTH _matchedVars _list_size)
-    if(_list_size EQUAL 0)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${EXT_INSTALL_DIR})
-    endif()
-    unset(_matchedVars)
-
-    # search BUILD_SHARED_LIBS
-    if(NOT DEFINED find_extproject_SHARED)
-        list(APPEND find_extproject_CMAKE_ARGS -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS})
-        set(find_extproject_SHARED ${BUILD_SHARED_LIBS})
-    elseif(find_extproject_SHARED)
-        list(APPEND find_extproject_CMAKE_ARGS -DBUILD_SHARED_LIBS=ON)
-    else()
-        list(APPEND find_extproject_CMAKE_ARGS -DBUILD_SHARED_LIBS=OFF)
-    endif()
-
-    # set some arguments
-    if(CMAKE_GENERATOR)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_GENERATOR=${CMAKE_GENERATOR})
-    endif()
-    if(CMAKE_MAKE_PROGRAM)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM})
-    endif()
-    if(CMAKE_BUILD_TYPE)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE})
-    endif()
-    # list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_CONFIGURATION_TYPES=${CMAKE_CONFIGURATION_TYPES})
-    if(CMAKE_GENERATOR_TOOLSET)
-        list(APPEND find_extproject_CMAKE_ARGS -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET})
-    endif()
-    if(SKIP_GIT_PULL)
-        list(APPEND find_extproject_CMAKE_ARGS -DSKIP_GIT_PULL=${SKIP_GIT_PULL})
-    endif()
-
-    get_cmake_property(_variableNames VARIABLES)
-    string (REGEX MATCHALL "(^|;)WITH_[A-Za-z0-9_]*" _matchedVars "${_variableNames}")
-    foreach(_variableName ${_matchedVars})
-        if(NOT SUPRESS_VERBOSE_OUTPUT)
-            message(STATUS "${_variableName}=${${_variableName}}")
-        endif()
-        list(APPEND find_extproject_CMAKE_ARGS -D${_variableName}=${${_variableName}})
-    endforeach()
-
-
-    # get some properties from <cmakemodules>/findext${name}.cmake file
-    include(FindExt${name})
-
-    find_exthost_package(Git)
-    if(NOT GIT_FOUND)
-      message(FATAL_ERROR "git is required")
-      return()
-    endif()
-
-    include(ExternalProject)
-
-    # create delete build file script and custom command to periodically execute it
-    file(WRITE ${EP_PREFIX}/tmp/${name}_EP-checkupdate.cmake
-        "file(TIMESTAMP ${EXT_STAMP_DIR}/${name}_EP-gitpull.txt LAST_PULL \"%y%j%H%M\" UTC)
-         if(NOT LAST_PULL)
-            set(LAST_PULL 0)
-         endif()
-         string(TIMESTAMP CURRENT_TIME \"%y%j%H%M\" UTC)
-         math(EXPR DIFF_TIME \"\${CURRENT_TIME} - \${LAST_PULL}\")
-         if(DIFF_TIME GREATER ${PULL_UPDATE_PERIOD})
-            message(STATUS \"Git pull ${repo_name} ...\")
-            execute_process(COMMAND ${GIT_EXECUTABLE} pull
-               WORKING_DIRECTORY  ${EP_PREFIX}/src/${name}_EP
-               TIMEOUT ${PULL_TIMEOUT} OUTPUT_VARIABLE OUT_STR)
-
-            if(OUT_STR)
-                string(FIND \${OUT_STR} \"Already up-to-date\" STR_POS)
-                if(STR_POS LESS 0)
-                    message(STATUS \"Remove ${name}_EP-build\")
-                    file(REMOVE ${EXT_STAMP_DIR}/${name}_EP-build)
-                endif()
-                file(WRITE ${EXT_STAMP_DIR}/${name}_EP-gitpull.txt \"\")
-            endif()
-         endif()")
-
-    ExternalProject_Add(${name}_EP
-        GIT_REPOSITORY ${EP_URL}/${repo_name}
-        CMAKE_ARGS ${find_extproject_CMAKE_ARGS}
-        UPDATE_DISCONNECTED 1
-    )
-
-    if(NOT SKIP_GIT_PULL)
-    add_custom_command(TARGET ${name}_EP PRE_BUILD
-               COMMAND ${CMAKE_COMMAND} -P ${EP_PREFIX}/tmp/${name}_EP-checkupdate.cmake
-               COMMENT "Check if update needed ..."
-               VERBATIM)
-    endif()
-
-    set(RECONFIGURE OFF)
-    set(INCLUDE_EXPORT_PATH "${EXT_BUILD_DIR}/${repo_project}-exports.cmake")
-
-    if(NOT EXISTS "${EP_PREFIX}/src/${name}_EP/.git")
-        color_message("Git clone ${repo_name} ...")
-
-        set(error_code 1)
-        set(number_of_tries 0)
-        while(error_code AND number_of_tries LESS 3)
-          execute_process(
-            COMMAND ${GIT_EXECUTABLE} clone ${EP_URL}/${repo_name} ${name}_EP
-            WORKING_DIRECTORY  ${EP_PREFIX}/src
-            RESULT_VARIABLE error_code
-            )
-          math(EXPR number_of_tries "${number_of_tries} + 1")
-        endwhile()
-
-        if(error_code)
-            message(FATAL_ERROR "Failed to clone repository: ${EP_URL}/${repo_name}")
-            return()
-        else()
-            #execute_process(COMMAND ${GIT_EXECUTABLE} checkout master
-            #    WORKING_DIRECTORY  ${EP_PREFIX}/src/${name}_EP)
-            file(WRITE ${EXT_STAMP_DIR}/${name}_EP-gitclone-lastrun.txt "")
-            #execute_process(COMMAND ${CMAKE_COMMAND} ${EP_PREFIX}/src/${name}_EP
-            #    ${find_extproject_CMAKE_ARGS}
-            #    WORKING_DIRECTORY ${EXT_BUILD_DIR})
-            set(RECONFIGURE ON)
-        endif()
-    else()
-        if(EXISTS ${INCLUDE_EXPORT_PATH})
-            check_updates(${EXT_STAMP_DIR}/${name}_EP-gitpull.txt ${PULL_UPDATE_PERIOD} CHECK_UPDATES)
-        else()
-            set(RECONFIGURE ON)
-        endif()
-        if(CHECK_UPDATES)
-            color_message("Git pull ${repo_name} ...")
-            execute_process(COMMAND ${GIT_EXECUTABLE} pull
-               WORKING_DIRECTORY  ${EP_PREFIX}/src/${name}_EP
-               TIMEOUT ${PULL_TIMEOUT} OUTPUT_VARIABLE OUT_STR)
-           if(OUT_STR)
-                string(FIND ${OUT_STR} "Already up-to-date" STR_POS)
-                if(STR_POS LESS 0)
-                    file(REMOVE ${EXT_STAMP_DIR}/${name}_EP-build)
-                    set(RECONFIGURE ON)
-                endif()
-                file(WRITE ${EXT_STAMP_DIR}/${name}_EP-gitpull.txt "")
-            endif()
-        endif()
-    endif()
-
-    if(RECONFIGURE)
-        color_message("Configure ${repo_name} ...")
-        execute_process(COMMAND ${CMAKE_COMMAND} ${EP_PREFIX}/src/${name}_EP
-            ${find_extproject_CMAKE_ARGS}
-            WORKING_DIRECTORY ${EXT_BUILD_DIR})
-    endif()
-
-    if(EXISTS ${INCLUDE_EXPORT_PATH})
-        get_imported_targets(${INCLUDE_EXPORT_PATH} IMPORTED_TARGETS)
-        string(TOUPPER ${name}_FOUND IS_FOUND)
-        set(${IS_FOUND} TRUE PARENT_SCOPE)
-
-        #add to list imported
-        include_exports_path(${INCLUDE_EXPORT_PATH})
-    else()
-        message(WARNING "The path ${INCLUDE_EXPORT_PATH} not exist")
-        return()
-    endif()
-
-    if(EXISTS ${EXT_BUILD_DIR}/ext_options.cmake)
-        include(${EXT_BUILD_DIR}/ext_options.cmake)
-
-        # add include into  ext_options.cmake
-        set(WITHOPT "${WITHOPT}include(${EXT_BUILD_DIR}/ext_options.cmake)\n" PARENT_SCOPE)
-
-        foreach(INCLUDE_EXPORT_PATH ${INCLUDE_EXPORTS_PATHS})
-            include_exports_path(${INCLUDE_EXPORT_PATH})
-        endforeach()
-        unset(INCLUDE_EXPORT_PATH)
-    endif()
-
-    add_dependencies(${IMPORTED_TARGETS} ${name}_EP)
-
-    set(DEPENDENCY_LIB ${DEPENDENCY_LIB} ${IMPORTED_TARGETS} PARENT_SCOPE)
-
-    set(IMPORTED_TARGET_PATH)
-    foreach(IMPORTED_TARGET ${IMPORTED_TARGETS})
-        set(IMPORTED_TARGET_PATH ${IMPORTED_TARGET_PATH} $<TARGET_LINKER_FILE:${IMPORTED_TARGET}>) #${IMPORTED_TARGET}
-        if(NOT find_extproject_SHARED)
-            get_target_property(LINK_INTERFACE_LIBS "${IMPORTED_TARGET}" INTERFACE_LINK_LIBRARIES)
-            foreach(LINK_INTERFACE_LIB ${LINK_INTERFACE_LIBS})
-                if(LINK_INTERFACE_LIB)
-                    string(FIND ${LINK_INTERFACE_LIB} "$<TARGET_LINKER_FILE:" POS)
-                    if(POS EQUAL -1)
-                        set(IMPORTED_TARGET_PATH ${IMPORTED_TARGET_PATH} ${LINK_INTERFACE_LIB})
-                    else()
-                        get_target_name(${LINK_INTERFACE_LIB} INTERFACE_TARGET)
-                        if(TARGET ${INTERFACE_TARGET})
-                            set(IMPORTED_TARGET_PATH ${IMPORTED_TARGET_PATH} ${LINK_INTERFACE_LIB})
-                        else()
-                            message(STATUS "NO TARGET ${LINK_INTERFACE_LIB} -> INTERFACE_TARGET ${INTERFACE_TARGET}")
-                        endif()
-                    endif()
-                endif()
-            endforeach()
-        endif()
-    endforeach()
-    set(TARGET_LINK_LIB ${TARGET_LINK_LIB} ${IMPORTED_TARGET_PATH} PARENT_SCOPE)
-
-    include_directories(${EXT_INSTALL_DIR}/include)
-    foreach (inc ${repo_include})
-        include_directories(${EXT_INSTALL_DIR}/include/${inc})
-    endforeach ()
-
-    if(WIN32)
-        set(_INST_ROOT_PATH /)
-    else()
-        set(_INST_ROOT_PATH ${CMAKE_INSTALL_PREFIX})
-    endif()
-
-    # create directories
-    file(MAKE_DIRECTORY "${EXT_INSTALL_DIR}/bin")
-    file(MAKE_DIRECTORY "${EXT_INSTALL_DIR}/lib")
-    file(MAKE_DIRECTORY "${EXT_INSTALL_DIR}/include")
-    file(MAKE_DIRECTORY "${EXT_INSTALL_DIR}/share")
-
-    install( DIRECTORY ${EXT_INSTALL_DIR}/bin
-             DESTINATION ${_INST_ROOT_PATH}
-             COMPONENT applications)
-
-    install( DIRECTORY ${EXT_INSTALL_DIR}/lib
-             DESTINATION ${_INST_ROOT_PATH}
-             COMPONENT libraries)
-
-    install( DIRECTORY ${EXT_INSTALL_DIR}/include
-             DESTINATION ${_INST_ROOT_PATH}
-             COMPONENT headers)
-
-    install( DIRECTORY ${EXT_INSTALL_DIR}/share
-             DESTINATION ${_INST_ROOT_PATH}
-             COMPONENT libraries)
-
-    set(EXPORTS_PATHS ${EXPORTS_PATHS} PARENT_SCOPE)
-    set(LINK_SEARCH_PATHS ${LINK_SEARCH_PATHS} ${INCLUDE_LINK_SEARCH_PATHS} ${EP_PREFIX}/lib PARENT_SCOPE)
-endfunction()


Remove stray debug message.

Remove stray debug message.

--- cmake/ThirdPartyZlib.cmake
+++ cmake/ThirdPartyZlib.cmake
@@ -56,7 +56,6 @@
         )

     IF (APPLE)
-        MESSAGE(STATUS ${CMAKE_INSTALL_PREFIX}/${NEKTAR_LIB_DIR})
         EXTERNALPROJECT_ADD_STEP(zlib-1.2.7 patch-install-path
             COMMAND ${CMAKE_INSTALL_NAME_TOOL} -id ${CMAKE_INSTALL_PREFIX}/${NEKTAR_LIB_DIR}/libz.1.2.7.dylib ${TPDIST}/lib/libz.1.2.7.dylib
             DEPENDEES install)


bump version

bump version

--- cmake/ospray_options.cmake
+++ cmake/ospray_options.cmake
@@ -19,8 +19,8 @@
 ##############################################################

 SET(OSPRAY_VERSION_MAJOR 1)
-SET(OSPRAY_VERSION_MINOR 3)
-SET(OSPRAY_VERSION_PATCH 1)
+SET(OSPRAY_VERSION_MINOR 4)
+SET(OSPRAY_VERSION_PATCH 0)
 SET(OSPRAY_VERSION_GITHASH 0)
 IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
   FIND_PACKAGE(Git)


Add stackprotector flag and check for fourtify source.

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -34,6 +34,16 @@
   string(REGEX REPLACE "[\r\n]" " " ${_lfs_CFLAGS} "${${_lfs_CFLAGS}}")

   add_definitions(${_lfs_CFLAGS})
+  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement)

-  add_definitions(-Wall -W -Wmissing-prototypes -Wdeclaration-after-statement -D_FORTIFY_SOURCE=2)
+  check_cxx_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
+  if (WITH_STACK_PROTECTOR)
+    add_definitions(-fstack-protector)
+  endif (WITH_STACK_PROTECTOR)
+
+  check_cxx_compiler_flag("-D_FORTIFY_SOURCE=2" WITH_FORTIFY_SOURCE)
+  if (WITH_FORTIFY_SOURCE)
+    add_definitions(-D_FORTIFY_SOURCE=2)
+  endif (WITH_FORTIFY_SOURCE)
+
 endif (UNIX AND NOT WIN32)


sort only for max os x

sort only for max os x

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -92,10 +92,10 @@
 		list (APPEND ${build_sources} ${common_sources} ${win32_sources})
 	elseif (MAC_OSX)
 		list (APPEND ${build_sources} ${common_sources} ${macosx_sources} ${unix_sources})
+		list (SORT ${build_sources}) # Helps XCode displaying the right packages
 	elseif (LINUX)
 		list (APPEND ${build_sources} ${common_sources} ${linux_sources} ${unix_sources})
 	endif()
-	list (SORT ${build_sources}) # Helps XCode displaying the right packages

 	# cannot be inside MAC_OSX zone, as some targets (e.g. mac_osx client) doesn't mark osx files explizit.
 	fix_objc_flags ("${macosx_sources}")


COMP: fixed win warnings

COMP: fixed win warnings

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -93,6 +93,9 @@
   STRING(REGEX REPLACE "/W[0-9]" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
   STRING(REGEX REPLACE "/W[0-9]" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
   ADD_DEFINITIONS(/w)
+  # suppress also poco linker warnings
+  SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /ignore:4217")
+  SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /ignore:4217")
 ENDIF(MSVC_VERSION)
 IF(CMAKE_COMPILER_IS_GNUCXX)
   ADD_DEFINITIONS(-w)


Fix package checksum not getting updated in last commit.

--- build/cmake/versions.cmake
+++ build/cmake/versions.cmake
@@ -66,7 +66,7 @@
 set(MAVEN_VERSION 3.5.0)
 set(MAVEN_HASH 35c39251d2af99b6624d40d801f6ff02)
 set(MAILHOG_VERSION 1.0.0)
-set(MAILHOG_HASH 6602fd7f69276e7efba310362e958133)
+set(MAILHOG_HASH 3b758c81bfe2c9110911511daca1a7bc)
 set(MONGO_ORCHESTRATION_VERSION 0.6.9)
 set(MONGODB_VERSION 3.2.12)
 set(MONGODB_HASH 0cc86a1a93177185a682ff157e98e450)


Correct valgrind arguments for nightly testing for #17

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -141,7 +141,7 @@
   "-DMESHES=/lore/diamog/cdash/repos/EnGPar/pumi-meshes/"
   "-DGRAPHS=/lore/diamog/cdash/repos/EnGPar/EnGPar-graphs/"
   "-DVALGRIND=valgrind"
-  "-DVALGRIND_ARGS=--log-file=vg.%p;--leak-check=full;--error-exitcode=1;--suppressions=/lore/diamog/cdash/repos/EnGPar/mpich3.supp"
+  "-DVALGRIND_ARGS=--log-file=vg.%p\;--leak-check=full\;--error-exitcode=1\;--suppressions=/lore/diamog/cdash/repos/EnGPar/mpich3.supp"
   )
 message(STATUS "configure options ${CONFIGURE_VALGRIND}")
 build_subproject(memcheck "${CONFIGURE_VALGRIND}")


cmake: remove not needed options

cmake: remove not needed options

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -271,7 +271,6 @@
   # DEFINE_DEVICE_TYPE defines a dummy target <arch>_<device_type>_arch that
   # will build the merged architecture file for the device type.

-  set(options UPDATE_TIMINGS UPDATE_TILES ADD_PACK_PATTERNS)
   set(oneValueArgs DEVICE_TYPE ARCH ARCH_XML)
   set(multiValueArgs SCRIPT_OUTPUT_NAME SCRIPTS SCRIPT_DEPS)
   cmake_parse_arguments(


setting CMAKE_PACKAGE_INSTALL_PREFIX only under MacOSX

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -16,7 +16,7 @@

 OPTION(ENABLE_INSTALLER "Switches between installer or ZIP file creation for 'make package'" ON)

-IF (ENABLE_INSTALLER)
+IF (ENABLE_INSTALLER AND APPLE)
   #SET(CMAKE_MACOSX_RPATH ON)
   #SET(CMAKE_SKIP_INSTALL_RPATH OFF)
   #SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")


fix apriltags depends

fix apriltags depends

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -453,10 +453,8 @@
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
     DEPENDS
-      ${lcm_depends}
-    )
-
-  set(apriltags_depends apriltags)
+      ${lcm_depends} apriltags
+    )

 endif()


Deactivated the old Radiomics test

Deactivated the old Radiomics test

--- Modules/Classification/CLUtilities/test/files.cmake
+++ Modules/Classification/CLUtilities/test/files.cmake
@@ -1,5 +1,5 @@
 set(MODULE_TESTS
   #mitkSmoothedClassProbabilitesTest.cpp
-  mitkGIFImageDescriptionFeaturesTest
+  #mitkGIFImageDescriptionFeaturesTest
   mitkGlobalFeaturesTest.cpp
 )


CMake: fixup broken Assimp find_package script

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -317,12 +317,22 @@
 find_package(ASSIMP QUIET)
 macro_log_feature(ASSIMP_FOUND "Assimp" "Needed for the AssimpLoader Plugin" "https://www.assimp.org/" FALSE "" "")

-if(ASSIMP_FOUND AND NOT TARGET assimp::assimp)
-  add_library(assimp::assimp INTERFACE IMPORTED)
-  set_target_properties(assimp::assimp PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${ASSIMP_INCLUDE_DIRS}"
-      INTERFACE_LINK_LIBRARIES "${ASSIMP_LIBRARIES}"
-  )
+if(ASSIMP_FOUND)
+  # fixup horribly broken assimp cmake
+  if(NOT TARGET assimp::assimp)
+    # assimp 4.1 does not yet export target
+    add_library(assimp::assimp INTERFACE IMPORTED)
+    set_target_properties(assimp::assimp PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ASSIMP_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${ASSIMP_LIBRARIES}"
+    )
+  elseif(UNIX)
+    # 5.0 does but messes up paths on UNIX
+    set_target_properties(assimp::assimp PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${ASSIMP_INCLUDE_DIRS}"
+        INTERFACE_LINK_LIBRARIES "${ASSIMP_LIBRARIES}"
+    )
+  endif()
 endif()

 #######################################################################


BUG: Fix export of classes whose source files are given as full paths.

--- CMake/vtkExportKit.cmake
+++ CMake/vtkExportKit.cmake
@@ -4,7 +4,7 @@
   SET(KIT_ABSTRACT_LIST)
   SET(KIT_EXCLUDE_LIST)
   FOREACH(src ${sources})
-    STRING(REGEX REPLACE "\\.cxx$" "" CLASS "${src}")
+    GET_FILENAME_COMPONENT(CLASS "${src}" NAME_WE)
     SET(KIT_CLASS_LIST "${KIT_CLASS_LIST}\n  \"${CLASS}\"")
     GET_SOURCE_FILE_PROPERTY(IS_ABSTRACT ${src} ABSTRACT)
     IF(IS_ABSTRACT MATCHES "^1$")


working ctk with corrected brackets in indexer

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    SET(revision_tag ffb23fc7611b60cf5f9db4688da0f368cccbc444)
+    SET(revision_tag 2b5ab7c42c0e180c21922cf09c5ccd465477cca8)
     IF(${proj}_REVISION_TAG)
       SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Revert "Updated CTK version to include fixes for GCC 4.7"

This reverts commit ed004aef4388a93c0b2dbf76197b5e75cc20286c.

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 96bb84d885d936b3980f07f7dc5dafecfcc96a8e)
+    set(revision_tag 70c0a8d3)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()


dont need GTKMM_BASEPATH in linux

dont need GTKMM_BASEPATH in linux

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@199 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/Gtkmm.cmake
+++ CMakeModules/Gtkmm.cmake
@@ -2,41 +2,39 @@
 # Find is already called in the top-level CMakeLists

 macro (FIND_GTKMM)
-	if (NOT DEFINED ENV{GTKMM_BASEPATH})
+	if (MSVC AND NOT DEFINED ENV{GTKMM_BASEPATH})
 		message (FATAL_ERROR "Environment variable GTKMM_BASEPATH not set! Please set it to point to where you installed gtkmm, http://www.gtkmm.org/download.shtml e.g. \"C:\\Program Files\\gtkmm\"")
 	endif ()
 endmacro ()

 macro (INCLUDE_GTKMM)
-	include_directories (
-		$ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
-		$ENV{GTKMM_BASEPATH}/include/atk-1.0
-		$ENV{GTKMM_BASEPATH}/lib/gtk-2.0/include
-		$ENV{GTKMM_BASEPATH}/include/gdkmm-2.4
-		$ENV{GTKMM_BASEPATH}/include/atkmm-1.6
-		$ENV{GTKMM_BASEPATH}/lib/gdkmm-2.4/include
-		$ENV{GTKMM_BASEPATH}/lib/gtkmm-2.4/include
-		$ENV{GTKMM_BASEPATH}/include/cairomm-1.0
-		$ENV{GTKMM_BASEPATH}/include/cairo
-		$ENV{GTKMM_BASEPATH}/include/pango-1.0
-		$ENV{GTKMM_BASEPATH}/include/gtk-2.0
-		$ENV{GTKMM_BASEPATH}/include/pangomm-1.4
-		$ENV{GTKMM_BASEPATH}/include/giomm-2.4
-		$ENV{GTKMM_BASEPATH}/include/sigc++-2.0
-		$ENV{GTKMM_BASEPATH}/lib/glib-2.0/include
-		$ENV{GTKMM_BASEPATH}/include/glib-2.0
-		$ENV{GTKMM_BASEPATH}/lib/glibmm-2.4/include
-		$ENV{GTKMM_BASEPATH}/include/glibmm-2.4
-		$ENV{GTKMM_BASEPATH}/include/gtkmm-2.4
-		$ENV{GTKMM_BASEPATH}/lib/sigc++-2.0/include
-		$ENV{GTKMM_BASEPATH}/include/libglade-2.0
-		$ENV{GTKMM_BASEPATH}/include/libglademm-2.4
-	)
-
-	link_directories (
-		$ENV{GTKMM_BASEPATH}/lib
-	)
-
+    if (MSVC)
+        include_directories
+            ($ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
+            $ENV{GTKMM_BASEPATH}/include/atk-1.0
+            $ENV{GTKMM_BASEPATH}/lib/gtk-2.0/include
+            $ENV{GTKMM_BASEPATH}/include/gdkmm-2.4
+            $ENV{GTKMM_BASEPATH}/include/atkmm-1.6
+            $ENV{GTKMM_BASEPATH}/lib/gdkmm-2.4/include
+            $ENV{GTKMM_BASEPATH}/lib/gtkmm-2.4/include
+            $ENV{GTKMM_BASEPATH}/include/cairomm-1.0
+            $ENV{GTKMM_BASEPATH}/include/cairo
+            $ENV{GTKMM_BASEPATH}/include/pango-1.0
+            $ENV{GTKMM_BASEPATH}/include/gtk-2.0
+            $ENV{GTKMM_BASEPATH}/include/pangomm-1.4
+            $ENV{GTKMM_BASEPATH}/include/giomm-2.4
+            $ENV{GTKMM_BASEPATH}/include/sigc++-2.0
+            $ENV{GTKMM_BASEPATH}/lib/glib-2.0/include
+            $ENV{GTKMM_BASEPATH}/include/glib-2.0
+            $ENV{GTKMM_BASEPATH}/lib/glibmm-2.4/include
+            $ENV{GTKMM_BASEPATH}/include/glibmm-2.4
+            $ENV{GTKMM_BASEPATH}/include/gtkmm-2.4
+            $ENV{GTKMM_BASEPATH}/lib/sigc++-2.0/include
+            $ENV{GTKMM_BASEPATH}/include/libglade-2.0
+            $ENV{GTKMM_BASEPATH}/include/libglademm-2.4)
+
+        link_directories ($ENV{GTKMM_BASEPATH}/lib)
+    endif (MSVC)
 endmacro ()

 macro (LINK_GTKMM)
@@ -62,7 +60,6 @@
 			optimized gtkmm-vc90-2_4.lib
 			optimized pangomm-vc90-1_4.lib
 			optimized sigc-vc90-2_0.lib
-			optimized glademm-vc90-2_4.lib
-			)
+			optimized glademm-vc90-2_4.lib)
 	endif ()
 endmacro ()


Disable asserts only for non-debug builds of root *and* llvm.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -626,10 +626,14 @@
   if(NOT DEFINED LLVM_BUILD_TYPE)
     set(LLVM_BUILD_TYPE Release)
   endif()
-  if(LLVM_BUILD_TYPE STREQUAL "Debug")
+  if(ROOT_BUILD_TYPE STREQUAL "Debug")
     set(LLVM_ENABLE_ASSERTIONS "YES")
   else()
-    set(LLVM_ENABLE_ASSERTIONS "NO")
+    if(LLVM_BUILD_TYPE STREQUAL "Debug")
+      set(LLVM_ENABLE_ASSERTIONS "YES")
+    else()
+      set(LLVM_ENABLE_ASSERTIONS "NO")
+    endif()
   endif()

   if(builtin_llvm)


Fix purging of CMake flags for iOS + Boost

--- cmake/modules/hunter_dump_cmake_flags.cmake
+++ cmake/modules/hunter_dump_cmake_flags.cmake
@@ -28,11 +28,11 @@
     hunter_assert_not_empty_string("${IOS_SDK_VERSION}")
     string(COMPARE EQUAL "${IOS_DEPLOYMENT_SDK_VERSION}" "" _no_deployment_sdk_version)
     if(_no_deployment_sdk_version)
-      set(CMAKE_CXX_FLAGS "-miphoneos-version-min=${IOS_SDK_VERSION}")
-      set(CMAKE_C_FLAGS "-miphoneos-version-min=${IOS_SDK_VERSION}")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IOS_SDK_VERSION}")
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=${IOS_SDK_VERSION}")
     else()
-      set(CMAKE_CXX_FLAGS "-miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}")
-      set(CMAKE_C_FLAGS "-miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}")
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -miphoneos-version-min=${IOS_DEPLOYMENT_SDK_VERSION}")
     endif()

     if(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE)


build: prune unused FindGTest.cmake

build: prune unused FindGTest.cmake

Signed-off-by: Dmitry Rogozhkin <01f0df9cc32cbf6a7f0faa5c8376e6cf28354d70@intel.com>

--- builder/FindGTest.cmake
+++ builder/FindGTest.cmake
@@ -1,44 +0,0 @@
-# Copyright (c) 2018 Intel Corporation
-#
-# 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.
-
-find_path( GTEST_INCLUDE gtest/gtest.h PATHS "$ENV{GTEST_INCLUDE_PATH}" "/usr/local/include" )
-find_library( GTEST_LIBRARY gtest PATHS "$ENV{GTEST_LIBRARY_PATH}" "/usr/local/lib" )
-find_library( GTEST_MAIN_LIBRARY gtest_main PATHS "$ENV{GTEST_LIBRARY_PATH}" "/usr/local/lib" )
-
-if(NOT GTEST_INCLUDE MATCHES NOTFOUND)
-  if(NOT GTEST_LIBRARY MATCHES NOTFOUND AND
-        NOT GTEST_MAIN_LIBRARY MATCHES NOTFOUND)
-    set( GTEST_FOUND TRUE )
-
-    get_filename_component(GTEST_LIB_DIR ${GTEST_LIBRARY} PATH)
-    get_filename_component(GTEST_MAIN_LIB_DIR ${GTEST_MAIN_LIBRARY} PATH)
-
-    include_directories( "${GTEST_INCLUDE}" )
-    link_directories( "${GTEST_LIB_DIR}" "${GTEST_MAIN_LIB_DIR}" )
-  endif()
-endif()
-
-if(NOT DEFINED GTEST_FOUND)
-  message( STATUS "Google tests libraries and headers were not found! Build GTest and install to /usr/local." )
-else ()
-  message( STATUS "Google tests libraries were found in ${GTEST_LIB_DIR}" )
-  message( STATUS "Google tests headers were found in ${GTEST_INCLUDE}" )
-endif()
-


Added fix for installations with a local gtest installation

Update #104

--- cmake/DebianGTestFix.cmake
+++ cmake/DebianGTestFix.cmake
@@ -8,11 +8,18 @@
 	set(GTEST_SOURCE_DIR /usr/src/googletest/googletest)
 elseif(LSB_CODENAME MATCHES jessie OR LSB_CODENAME MATCHES xenial)
 	set(GTEST_SOURCE_DIR /usr/src/gtest)
-else()
-	message(FATAL_ERROR "Could not identify Debian distribution!")
 endif()

-set(GTEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build)
-add_subdirectory(${GTEST_SOURCE_DIR} ${GTEST_BINARY_DIR})
-set(GTEST_INCLUDE_DIRS ${GTEST_SOURCE_DIR}/include)
-set(GTEST_LIBRARIES gtest gtest_main)
+if(EXISTS ${GTEST_SOURCE_DIR} AND IS_DIRECTORY ${GTEST_SOURCE_DIR})
+	#if the source directory exists and is indeed a directory we build the
+	#gtest code
+	set(GTEST_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/googletest-build)
+	add_subdirectory(${GTEST_SOURCE_DIR} ${GTEST_BINARY_DIR})
+	set(GTEST_INCLUDE_DIRS ${GTEST_SOURCE_DIR}/include)
+	set(GTEST_LIBRARIES gtest gtest_main)
+else()
+	#if the gtest source directory does not exist we fallback on
+	#find_package.
+	find_package(GTest REQUIRED)
+endif()
+


Use OpenSuSE clang/llvm binary on Linux #144

--- cmake/clang/download.cmake
+++ cmake/clang/download.cmake
@@ -9,8 +9,11 @@
     set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     if(64_BIT_PLATFORM)
-      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-14.04")
-      set(CLANG_MD5 "0eabc565733a62d77da1214a70c6c344")
+      # Using OpenSuSE binary to avoid terminfo dependency
+      # See https://github.com/Valloric/YouCompleteMe/issues/778 and
+      # https://github.com/jeaye/color_coded/issues/144
+      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-opensuse13.2)
+      set(CLANG_MD5 "31ef61aad2b5ca6bfccb40ce48752292")
       set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
     else()
       message(FATAL_ERROR "No pre-built Clang ${CLANG_VERSION} binaries for 32 bit Linux; this system is not supported")


Bug#13463417 63487: ANNOYING TRACE MESSAGE IN CMAKE CODE

Remove it.

--- cmake/install_macros.cmake
+++ cmake/install_macros.cmake
@@ -78,7 +78,6 @@
     ELSE()
       SET(SECTION man8)
     ENDIF()
-    MESSAGE("huj!")
     INSTALL(FILES "${MANPAGE}" DESTINATION "${INSTALL_MANDIR}/${SECTION}"
       COMPONENT ManPages)
   ENDIF()


AWI for Werner Smekal: tweak messages.

AWI for Werner Smekal: tweak messages.

svn path=/trunk/; revision=6998

--- cmake/modules/wingcc.cmake
+++ cmake/modules/wingcc.cmake
@@ -27,14 +27,14 @@
 # DRIVERS_LINK_FLAGS	  - list of LINK_FLAGS for all static devices.

 if(PLD_wingcc)
-  message(STATUS "Looking for windows.h and libgdi32.a")
+  message(STATUS "Looking for gdi32 header and library")
   find_package(GDI32)
   if(GDI32_FOUND)
-    message(STATUS "Looking for windows.h and libgdi32.a - found")
+    message(STATUS "Looking for gdi32 header and library - found")
     set(wingcc_LINK_FLAGS "${GDI32_LIBRARIES}")
     set(DRIVERS_LINK_FLAGS ${DRIVERS_LINK_FLAGS} ${wingcc_LINK_FLAGS})
   else(GDI32_FOUND)
-    message(STATUS "Looking for windows.h and libgdi32.a - not found")
+    message(STATUS "Looking for gdi32 header and library - not found")
     message(STATUS "WARNING: Setting PLD_wingcc to OFF.")
     set(PLD_wingcc OFF CACHE BOOL "Enable wingcc device" FORCE)
   endif(GDI32_FOUND)


* set Boost libraries as system libraries

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@4075 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -22,6 +22,6 @@
   # Obtain diagnostic information about Boost's automatic linking outputted
   # during compilation time.
   add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})
-  include_directories(${Boost_INCLUDE_DIRS})
+  include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
   link_directories(${Boost_LIBRARY_DIRS})
 endif(Boost_FOUND)


Use proper target names when adding dependencies

--- conf/sprokit-macro-python.cmake
+++ conf/sprokit-macro-python.cmake
@@ -118,7 +118,7 @@
     COMPONENT   runtime)

   add_dependencies(python
-    "python${python_arch}-${safe_modpath}-${module}")
+    "configure-python${python_arch}-${safe_modpath}-${module}")

   if (python_both_arch)
     set(python_both_arch)


ARROW-3213: [C++] Use CMake to build vendored Snappy on Windows

Because we can't run configure script on Windows.

Author: Kouhei Sutou <kou@clear-code.com>

Closes #2538 from kou/cpp-use-cmake-to-build-vendored-snappy-with-mingw and squashes the following commits:

811637d88 <Kouhei Sutou>  Use CMake to build vendored Snappy on Windows

--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -783,7 +783,7 @@
       endif()
     endif()

-    if (MSVC)
+    if (WIN32)
       set(SNAPPY_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
                             "-DCMAKE_CXX_FLAGS=${EP_CXX_FLAGS}"
                             "-DCMAKE_CXX_FLAGS_${UPPERCASE_BUILD_TYPE}=${EP_CXX_FLAGS}"


include version.h in API doc

include version.h in API doc

--- doc/Doxyfile.cmake
+++ doc/Doxyfile.cmake
@@ -82,7 +82,7 @@
 #---------------------------------------------------------------------------
 # configuration options related to the input files
 #---------------------------------------------------------------------------
-INPUT = @CMAKE_SOURCE_DIR@/doc/fluidsynth-v11-devdoc.txt @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/include/fluidsynth @CMAKE_SOURCE_DIR@/src
+INPUT = @CMAKE_SOURCE_DIR@/doc/fluidsynth-v11-devdoc.txt @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/include/fluidsynth @CMAKE_SOURCE_DIR@/src @CMAKE_BINARY_DIR@/include/fluidsynth
 INPUT_ENCODING = UTF-8
 FILE_PATTERNS = *.c *.h
 RECURSIVE = YES


Improved cmake gcc compiler flags to remove unnecessary warning.

--- cmake/Compiler.cmake
+++ cmake/Compiler.cmake
@@ -171,7 +171,7 @@
     #

     # -Werror
-    set(CMAKE_CXX_FLAGS "-W -Wall")
+    set(CMAKE_CXX_FLAGS "-W -Wall -Wno-attributes -Wno-unknown-pragmas")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
     set(CMAKE_CXX_FLAGS_DEBUG   	   "-DDEBUG -g -O0")
     set(CMAKE_CXX_FLAGS_RELEASE 	   "-DNDEBUG -O2")


Manually file glob each file

Manually file glob each file

--- cmake/CppCheck.cmake
+++ cmake/CppCheck.cmake
@@ -48,17 +48,17 @@
     file(WRITE ${CMAKE_BINARY_DIR}/cppcheck-supressions "${CPPCHECK_SUPPRESS}")
     set(CPPCHECK_DEFINES)
     foreach(DEF ${PARSE_DEFINE})
-        list(APPEND CPPCHECK_DEFINES -D ${DEF})
+        set(CPPCHECK_DEFINES "${CPPCHECK_DEFINES} -D${DEF}")
     endforeach()

     set(CPPCHECK_UNDEFINES)
     foreach(DEF ${PARSE_UNDEFINE})
-        list(APPEND CPPCHECK_UNDEFINES -U ${DEF})
+        set(CPPCHECK_UNDEFINES "${CPPCHECK_UNDEFINES} -U${DEF}")
     endforeach()

     set(CPPCHECK_INCLUDES)
     foreach(INC ${PARSE_INCLUDE})
-        list(APPEND CPPCHECK_INCLUDES -include=${INC})
+        set(CPPCHECK_INCLUDES "${CPPCHECK_INCLUDES} -I${INC}")
     endforeach()

     # set(CPPCHECK_FORCE "--project=${CMAKE_BINARY_DIR}/compile_commands.json")
@@ -67,25 +67,48 @@
         set(CPPCHECK_FORCE --force)
     endif()

-    set(CPPCHECK_COMMAND
-        ${CPPCHECK_EXE}
-        -q
-        # --report-progress
-        ${CPPCHECK_FORCE}
-        --platform=native
-        --template='{file}:{line}: {severity}[{id}]: {message}'
-        --error-exitcode=1
-        -j ${CPPCHECK_JOBS}
-        ${CPPCHECK_DEFINES}
-        ${CPPCHECK_UNDEFINES}
-        ${CPPCHECK_INCLUDES}
-        "--enable=${CPPCHECK_CHECKS}"
-        "--suppressions-list=${CMAKE_BINARY_DIR}/cppcheck-supressions"
-        ${PARSE_SOURCES}
-    )
+    set(SOURCES)
+    set(GLOBS)
+    foreach(SOURCE ${PARSE_SOURCES})
+        if(EXISTS ${SOURCE})
+            if(IS_DIRECTORY ${SOURCE})
+                set(GLOBS "${GLOBS} ${SOURCE}/*.cpp ${SOURCE}/*.hpp ${SOURCE}/*.cxx ${SOURCE}/*.c ${SOURCE}/*.h")
+            else()
+                set(SOURCES "${SOURCES} ${SOURCE}")
+            endif()
+        else()
+            set(GLOBS "${GLOBS} ${SOURCE}")
+        endif()
+    endforeach()
+
+    file(WRITE ${CMAKE_BINARY_DIR}/cppcheck.cmake "
+        file(GLOB_RECURSE GSRCS ${GLOBS})
+        execute_process(
+            COMMAND ${CPPCHECK_EXE}
+            -q
+            # -v
+            # --report-progress
+            ${CPPCHECK_FORCE}
+            --platform=native
+            \"--template={file}:{line}: {severity}[{id}]: {message}\"
+            --error-exitcode=1
+            -j ${CPPCHECK_JOBS}
+            ${CPPCHECK_DEFINES}
+            ${CPPCHECK_UNDEFINES}
+            ${CPPCHECK_INCLUDES}
+            --enable=${CPPCHECK_CHECKS}
+            --suppressions-list=${CMAKE_BINARY_DIR}/cppcheck-supressions
+            ${SOURCES} \${GSRCS}
+            WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+            RESULT_VARIABLE RESULT
+        )
+        if(NOT RESULT EQUAL 0)
+            message(FATAL_ERROR \"Cppcheck failed\")
+        endif()
+")

     add_custom_target(cppcheck
-        COMMAND ${CPPCHECK_COMMAND}
+        COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/cppcheck.cmake
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
         COMMENT "cppcheck: Running cppcheck..."
     )


Protection in case ROOT_LIBRARIES is empty.

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -51,7 +51,9 @@
     endif()
   endif()
 endforeach()
-list(REMOVE_DUPLICATES ROOT_LIBRARIES)
+if(ROOT_LIBRARIES)
+  list(REMOVE_DUPLICATES ROOT_LIBRARIES)
+endif()

 execute_process(
     COMMAND ${ROOT_CONFIG_EXECUTABLE} --cflags


Finds SDL2main lib corresponding to system

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -127,17 +127,40 @@
     # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
     # seem to provide SDL2main for compatibility even though they don't
     # necessarily need it.
-    FIND_LIBRARY(SDL2MAIN_LIBRARY
-      NAMES SDL2main
-      HINTS
-      $ENV{SDL2DIR}
-      PATH_SUFFIXES lib64 lib
-      PATHS
-      /sw
-      /opt/local
-      /opt/csw
-      /opt
-    )
+
+    # Lookup the 64 bit libs on x64
+    IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        FIND_LIBRARY(SDL2MAIN_LIBRARY
+            NAMES SDL2main
+            HINTS
+            ${SDL2}
+            $ENV{SDL2DIR}
+            PATH_SUFFIXES lib64 lib
+            lib/x64
+            x86_64-w64-mingw32/lib
+            PATHS
+            /sw
+            /opt/local
+            /opt/csw
+            /opt
+        )
+    # On 32bit build find the 32bit libs
+    ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
+        FIND_LIBRARY(SDL2MAIN_LIBRARY
+            NAMES SDL2main
+            HINTS
+            ${SDL2}
+            $ENV{SDL2DIR}
+            PATH_SUFFIXES lib
+            lib/x86
+            i686-w64-mingw32/lib
+            PATHS
+            /sw
+            /opt/local
+            /opt/csw
+            /opt
+        )
+    ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
   ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
 ENDIF(NOT SDL2_BUILDING_LIBRARY)


build: Clean up the find-module for DPDK

--- cmake/Finddpdk.cmake
+++ cmake/Finddpdk.cmake
@@ -23,10 +23,6 @@
 find_path (dpdk_INCLUDE_DIR
   NAMES rte_atomic.h
   PATH_SUFFIXES dpdk)
-
-if (dpdk_INCLUDE_DIR)
-  set (dpdk_FOUND ON)
-endif ()

 find_library (dpdk_PMD_VMXNET3_UIO_LIBRARY rte_pmd_vmxnet3_uio)
 find_library (dpdk_PMD_I40E_LIBRARY rte_pmd_i40e)
@@ -55,7 +51,6 @@
 include (FindPackageHandleStandardArgs)

 find_package_handle_standard_args (dpdk
-  FOUND_VAR dpdk_FOUND
   REQUIRED_VARS
     dpdk_INCLUDE_DIR
     dpdk_PMD_VMXNET3_UIO_LIBRARY


do not show _lsb_release in the default cmake settings

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -57,6 +57,7 @@
          # some distributions patch their GCC to be API incompatible to what the FSF released. In
          # those cases we require a macro to identify the distribution version
          find_program(_lsb_release lsb_release)
+         mark_as_advanced(_lsb_release)
          if(_lsb_release)
             execute_process(COMMAND ${_lsb_release} -is OUTPUT_VARIABLE _distributor_id OUTPUT_STRIP_TRAILING_WHITESPACE)
             execute_process(COMMAND ${_lsb_release} -rs OUTPUT_VARIABLE _distributor_release OUTPUT_STRIP_TRAILING_WHITESPACE)


add check for msvc2013

add check for msvc2013

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@5841 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -118,12 +118,13 @@

 if("x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")

-    #  if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18)
-    # Update 4 of MSVC 2013 ?
-    #    endif()
-
-    # Disable checked iterators
-    set(CMAKE_CXX_FLAGS    "${CMAKE_CXX_FLAGS}  /bigobj /D_SECURE_SCL=0")
+    if(${MSVC_VERSION} EQUAL 1800 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.00.31101.0)
+       message(WARNING "Visual Studio 2013 without Update 4 detected. Update your compiler to avoid G+Smo compilation problems.")
+    endif()
+
+    # Disable checked iterators and irrelevant warnings
+    #wd4351: regards old behaviour before MSVC2005
+    set(CMAKE_CXX_FLAGS    "${CMAKE_CXX_FLAGS}  /bigobj /D_SECURE_SCL=0  /wd4351")
     # See http://msdn.microsoft.com/en-us/library/hh697468.aspx
     #add_definitions(-D_HAS_ITERATOR_DEBUGGING=0)
     #add_definitions(-D_SECURE_SCL=0)
@@ -140,8 +141,7 @@

     if (CMAKE_SIZEOF_VOID_P EQUAL 8) #64bit compiler
        # Note: On 64bit-platforms, /Wp64 flag is present, causing extra warnings
-       #wd4351: regards old behaviour before MSVC2005
-       set(CMAKE_CXX_FLAGS    "${CMAKE_CXX_FLAGS} /wd4244 /wd4267 /wd4351")
+       set(CMAKE_CXX_FLAGS    "${CMAKE_CXX_FLAGS} /wd4244 /wd4267")

     #else() #32bit compiler has CMAKE_SIZEOF_VOID_P EQUAL 4
     endif()


config update

config update

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@5721 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -173,7 +173,6 @@
   # large files can overflow pe/coff sections
   # this switches binutils to use the pe+ format
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj")
-  add_definitions(-O3)
 endif()

 #message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}")


IncludeWhatYouUse: Also read the COMPILE_FLAGS property

--- IncludeWhatYouUse.cmake
+++ IncludeWhatYouUse.cmake
@@ -99,8 +99,12 @@
         # Convert spaces in IWYU_SOURCE_ARGS to "," delimiter
         string (REPLACE " " "," IWYU_SOURCE_ARGS "${IWYU_SOURCE_ARGS}")

+        get_property (TARGET_PROPERTY_COMPILE_FLAGS
+                      TARGET "${TARGET}" PROPERTY COMPILE_FLAGS)
+
         set (IWYU_ARGUMENTS
              ${IWYU_TARGET_ARGS}
+             ${TARGET_PROPERTY_COMPILE_FLAGS}
              ${IWYU_SOURCE_ARGS})
         string (REPLACE ";" "," IWYU_ARGUMENTS "${IWYU_ARGUMENTS}")


fasm_extra_features: Set PART_JSON whenever XDC file is specified

Signed-off-by: Tomasz Michalak <a2fdaa543b4cc5e3d6cd8672ec412c0eb393b86e@antmicro.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -932,6 +932,10 @@
     OUT_RRXML_VIRT ${DEVICE} OUT_RRXML_VIRT
   )

+  if(NOT "${ADD_FPGA_TARGET_INPUT_XDC_FILE}" STREQUAL "")
+      get_target_property_required(PART_JSON ${BOARD} PART_JSON)
+  endif()
+
   set(NAME ${ADD_FPGA_TARGET_NAME})
   get_target_property_required(DEVICE_FULL_TEMPLATE ${ARCH} DEVICE_FULL_TEMPLATE)
   string(CONFIGURE ${DEVICE_FULL_TEMPLATE} DEVICE_FULL)
@@ -978,7 +982,6 @@
     if(NOT "${ADD_FPGA_TARGET_INPUT_XDC_FILE}" STREQUAL "")
       add_file_target(FILE ${ADD_FPGA_TARGET_INPUT_XDC_FILE})
       get_file_location(INPUT_XDC_FILE ${ADD_FPGA_TARGET_INPUT_XDC_FILE})
-      get_target_property_required(PART_JSON ${BOARD} PART_JSON)
     endif()
   endif()


cmake: fix devices.cmake comment

cmake: fix devices.cmake comment

Signed-off-by: Elms <23ce84ca7a7de9dc17ad8e8b0bbd717d4f9f9884@freshred.net>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -252,7 +252,7 @@
   #
   # optional SCRIPTs can be run after the standard flow to augment the
   # final arch xml. The name and script must be provided and each
-  # script will be run as `cmd input > output`
+  # script will be run as `cmd < input > output`
   #
   # DEFINE_DEVICE_TYPE defines a dummy target <arch>_<device_type>_arch that
   # will build the merged architecture file for the device type.


Set default plugins variable to empty string.

--- CMake/mitkFunctionEnablePlugins.cmake
+++ CMake/mitkFunctionEnablePlugins.cmake
@@ -18,7 +18,7 @@
     message(FATAL_ERROR "Variable 'enabled_plugins' not set in whitelist file '${whitelistFile}'!")
   endif()

-  set(plugins)
+  set(plugins "")

   foreach(plugin ${${ARGV0}})
     string(FIND ${plugin} ":" index REVERSE)


Fix for #95085 DAs don't compile with 5.33.02b

--- cmake/CMakeDA.cmake
+++ cmake/CMakeDA.cmake
@@ -96,12 +96,12 @@

 execute_process(COMMAND ${XML2} --libs OUTPUT_VARIABLE _xml2libs OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process(COMMAND ${DATE_CONFIG} --monitorlibs=noshift OUTPUT_VARIABLE MONITORLIBS OUTPUT_STRIP_TRAILING_WHITESPACE)
-execute_process(COMMAND $ENV{AMORE}/amore-config --ldflags-da-static OUTPUT_VARIABLE _amore1 OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND $ENV{AMORE}/bin/amore-config --ldflags-da-static OUTPUT_VARIABLE _amore1 OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process(COMMAND date-config --rcproxylibs OUTPUT_VARIABLE _amore2 OUTPUT_STRIP_TRAILING_WHITESPACE)
 execute_process(COMMAND date-config --monitorlibs=noshift OUTPUT_VARIABLE _monitor1 OUTPUT_STRIP_TRAILING_WHITESPACE)
 string(REPLACE "\n" " " _amore1 "${_amore1}")
-set(AMOREDALIBS "-static ${_amore1} ${_amore2}")
-set(MONITORLIBS "${_monitor1}")
+set(AMOREDALIBS " ${_amore1} ${_amore2}")
+set(MONITORLIBS "${_monitor1} -lssl")

 separate_arguments(MONITORLIBS)
 separate_arguments(AMOREDALIBS)


Support empty sources in add_executable and add_library

Change-Id: I1441f2c045aeda2bba99bffe1c99fcc4a59cea9b

--- cmake/FindHIP.cmake
+++ cmake/FindHIP.cmake
@@ -638,7 +638,11 @@
         endif()
         set(CMAKE_HIP_LINK_EXECUTABLE "${HIP_HIPCC_CMAKE_LINKER_HELPER} ${HIP_CLANG_PATH} ${HIP_CLANG_PARALLEL_BUILD_LINK_OPTIONS} <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
     endif()
-    add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
+    if ("${_sources}" STREQUAL "")
+        add_executable(${hip_target} ${_cmake_options} ${_generated_files} "")
+    else()
+        add_executable(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
+    endif()
     set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE HIP)
 endmacro()

@@ -652,7 +656,11 @@
     if(_source_files)
         list(REMOVE_ITEM _sources ${_source_files})
     endif()
-    add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
+    if ("${_sources}" STREQUAL "")
+        add_library(${hip_target} ${_cmake_options} ${_generated_files} "")
+    else()
+        add_library(${hip_target} ${_cmake_options} ${_generated_files} ${_sources})
+    endif()
     set_target_properties(${hip_target} PROPERTIES LINKER_LANGUAGE ${HIP_C_OR_CXX})
 endmacro()


FindMKL update for ParallelStudio2016 and later

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -46,6 +46,7 @@
 #   <Composer XE directory> -> C:\Program Files\Intel\ComposerXE-2011
 #     redist\ia32\mkl
 #     redist\intel64\mkl
+# Intel from version 2016 seems to provide a common path for Win and Linux: <intel_dir>/compilers_and_libraries/${OS}/mkl and so on...

 set(_MKL_IA32 FALSE)
 set(_MKL_INTEL64 FALSE)
@@ -104,13 +105,19 @@
   ${MKL_ROOT}
 )

-foreach (_MKL_VER ${_MKL_TEST_VERSIONS})
-    if (WIN32)
-        list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/Intel/Composer XE/mkl")
-    else()
-        list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/composerxe-${_MKL_VER}/mkl")
-    endif()
-endforeach()
+
+if (WIN32)
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/Intel/Composer XE/mkl") # default until ParallelStudioXE2015
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "$ENV{ProgramFiles}/IntelSWTools/compilers_and_libraries/windows/mkl") # default for ParallelStudioXE2016 and later
+else()
+	foreach (_MKL_VER ${_MKL_TEST_VERSIONS})
+		list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (root permissions)
+		list(APPEND _MKL_ROOT_SEARCH_DIRS "$HOME/intel/composerxe-${_MKL_VER}/mkl") # default until ParallelStudioXE2015 (no root permissions)
+	endforeach()
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "/opt/intel/compilers_and_libraries/linux/mkl") # default for ParallelStudioXE2016 and later (root permissions)
+	list(APPEND _MKL_ROOT_SEARCH_DIRS "$HOME/intel/compilers_and_libraries/linux/mkl") # default for ParallelStudioXE2016 and later (no root permissions)
+endif()
+

 if (MKL_FIND_DEBUG)
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "