Use same code for Ninja and "Visual Studio" generators

--- conan.cmake
+++ conan.cmake
@@ -2,30 +2,22 @@

 function(_get_msvc_ide_version result)
     set(${result} "" PARENT_SCOPE)
-    if(${CMAKE_GENERATOR} STREQUAL "Ninja")
-        string(REGEX MATCHALL "[0-9]+" output "$ENV{VisualStudioVersion}")
-        list(GET output 0 _msvc_version)
-        set(${result} ${_msvc_version} PARENT_SCOPE)
-    else()
-        if(CMAKE_VS_PLATFORM_TOOLSET)
-            string(REGEX MATCHALL "[0-9]+" output "${CMAKE_VS_PLATFORM_TOOLSET}")
-            list(GET output 0 _toolset_version)
-            if(_toolset_version LESS 142)
-                if ("${_toolset_version}" EQUAL "141")
-                    set(_msvc_version "15")
-                else()
-                    string(SUBSTRING ${_toolset_version} 0 2 _msvc_version)
-                endif()
-                set(${result} ${_msvc_version} PARENT_SCOPE)
-                return()
-            else()
-                message(STATUS "Conan **WARNING** : Unknown MSVC toolset ${_toolset_version}")
-            endif()
-        endif()
-
-        string(REGEX MATCHALL "[0-9]+" output "${CMAKE_GENERATOR}")
-        list(GET output 0 _msvc_version)
-        set(${result} ${_msvc_version} PARENT_SCOPE)
+    if(NOT MSVC_VERSION VERSION_LESS 1400 AND MSVC_VERSION VERSION_LESS 1500)
+        set(${result} 8 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1500 AND MSVC_VERSION VERSION_LESS 1600)
+        set(${result} 9 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1600 AND MSVC_VERSION VERSION_LESS 1700)
+        set(${result} 10 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1700 AND MSVC_VERSION VERSION_LESS 1800)
+        set(${result} 11 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1800 AND MSVC_VERSION VERSION_LESS 1900)
+        set(${result} 12 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1900 AND MSVC_VERSION VERSION_LESS 1910)
+        set(${result} 14 PARENT_SCOPE)
+    elseif(NOT MSVC_VERSION VERSION_LESS 1910 AND MSVC_VERSION VERSION_LESS 1920)
+        set(${result} 15 PARENT_SCOPE)
+    else()
+        message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]")
     endif()
 endfunction()

@@ -55,7 +47,7 @@

     #handle -s os setting
     if(CMAKE_SYSTEM_NAME)
-    #use default conan os setting if CMAKE_SYSTEM_NAME is not defined
+        #use default conan os setting if CMAKE_SYSTEM_NAME is not defined
         set(CONAN_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
         if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
             set(CONAN_SYSTEM_NAME Macos)
@@ -94,29 +86,20 @@
         set(_VISUAL "Visual Studio")
         _get_msvc_ide_version(_VISUAL_VERSION)
         if("${_VISUAL_VERSION}" STREQUAL "")
-            message(FATAL_ERROR "Visual Studio not recognized")
+            message(FATAL_ERROR "Conan: Visual Studio not recognized")
         else()
             set(_SETTINGS ${_SETTINGS} -s compiler=${_VISUAL} -s compiler.version=${_VISUAL_VERSION})
         endif()

-        if(${CMAKE_GENERATOR} STREQUAL "Ninja")
-            if($ENV{Platform} STREQUAL "X64")
-                set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-            elseif($ENV{Platform} STREQUAL "ARM")
-                message(STATUS "Conan: Using default ARM architecture from MSVC")
-                set(_SETTINGS ${_SETTINGS} -s arch=armv6)
-            else()
-                set(_SETTINGS ${_SETTINGS} -s arch=x86)
-            endif()
-        else()
-            if(${CMAKE_GENERATOR} MATCHES "Win64")
-                set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
-            elseif (${CMAKE_GENERATOR} MATCHES "ARM")
-                message(STATUS "Conan: Using default ARM architecture from MSVC")
-                set(_SETTINGS ${_SETTINGS} -s arch=armv6)
-            else()
-                set(_SETTINGS ${_SETTINGS} -s arch=x86)
-            endif()
+        if (MSVC_CXX_ARCHITECTURE_ID MATCHES "64")
+            set(_SETTINGS ${_SETTINGS} -s arch=x86_64)
+        elseif (MSVC_CXX_ARCHITECTURE_ID MATCHES "^ARM")
+            message(STATUS "Conan: Using default ARM architecture from MSVC")
+            set(_SETTINGS ${_SETTINGS} -s arch=armv6)
+        elseif (MSVC_CXX_ARCHITECTURE_ID MATCHES "86")
+            set(_SETTINGS ${_SETTINGS} -s arch=x86)
+        else ()
+            message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_CXX_ARCHITECTURE_ID}]")
         endif()

         conan_cmake_detect_vs_runtime(_vs_runtime)


ENH: Updated ResampleDTIlogEuclidean version

--- SuperBuild/FindExternalTools.cmake
+++ SuperBuild/FindExternalTools.cmake
@@ -455,10 +455,7 @@
 # ===== ResampleDTIlogEuclidean =====================================================
 set( SourceCodeArgs
   GIT_REPOSITORY "${git_protocol}://github.com/NIRALUser/ResampleDTIlogEuclidean.git"
-  GIT_TAG 0cc1b5c9aae868a46917f52dcb3f1e28f0b82e0f #12-12-2013 addition of an install rule
-#  a2afcd57c931d224b91e6ce026cb499648e4f017 # 04-22-2013 addition of MatrixOffsetTransformBase support (ANTS affine tfm for DTIReg)
-# "84e691a0600128dbe1e9d41a80336e7083e73fa7" # 02/04/2013 fix comp with ITK4.4 + stat lib windows linkage error
-# "e78a9ea00d73a11cc52b3c457e32f1302a3403d4" # 12/20/2012
+  GIT_TAG 09a0676bc4befa3a1b9c2384fedf37b21e193797
 # URL "http://www.insight-journal.org/download/sourcecode/742/11/SourceCode11_ResampleDTIInsightJournal2.tar.gz"
 # http://github.com/midas-journal/midas-journal-742/tree/master/ResampleDTIInsightJournal
   )


start network filesystem implementation (curl and nacl backends)

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -33,6 +33,7 @@

 set(NETWORK_SRC
 src/util/network/network.cpp
+src/util/network/network-system.cpp
 src/paintown-engine/network/cacher.cpp
 src/paintown-engine/network/client.cpp
 src/paintown-engine/network/chat_client.cpp
@@ -122,6 +123,7 @@
 src/util/windows/funcs.cpp
 src/util/windows/system.cpp
 src/util/nacl/module.cpp
+src/util/nacl/network-system.cpp
 src/exceptions/exception.cpp
 src/openbor/pack-reader.cpp
 src/openbor/animation.cpp


FindFFTW.cmake typo

FindFFTW.cmake typo

--- cmake/FindFFTW.cmake
+++ cmake/FindFFTW.cmake
@@ -7,9 +7,10 @@
 # The following CMake variables are set by this module:
 #
 # FFTW_FOUND            true, if a valid FFTW installation has been identified
-# FTWD_FOUND            true, if double precision library found
+# FFTWD_FOUND           true, if double precision library found
 # FFTWF_FOUND           true, if single precision library found
 # FFTWL_FOUND           true, if long double precision library found
+#
 # FFTW_INCLUDE_DIR      absolute directory that contains fftw3.h header file
 #
 # FFTWD_LIB             double precision library


FindMono: fall back to mcs when gmcs cannot be found

With mono 4.6, gmcs is no longer an upstream shipped wrapper.
Just fallback to 'mcs' if gmcs cannot be found. Distros still shipping
gmcs are assumed to know why they do so - in this case we favor their
local scripts.

Fixes issue #37.

--- cmake/FindMono.cmake
+++ cmake/FindMono.cmake
@@ -12,7 +12,7 @@
 # Redistribution and use is allowed according to the terms of the GPL license.

 FIND_PROGRAM (MONO_EXECUTABLE mono)
-FIND_PROGRAM (GMCS_EXECUTABLE gmcs)
+FIND_PROGRAM (GMCS_EXECUTABLE NAMES gmcs mcs)
 FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil)

 SET (MONO_FOUND FALSE CACHE INTERNAL "")


build: find dpdk shared libraries as well

there is chance that DPDK is compiled as shared libraries, would be great
if we can use them if they are installed.

in this change

* check for static DPDK libraries before checking for shared libraries.
  and prefer static ones if found.
* check the rte_config.h to see if RTE_MBUF_REFCNT_ATOMIC is defined.
  bail out if this macro is defined. as atomic refcnt of mbuf is not
  necessary if dpdk is used by a Seastar task.

Signed-off-by: Kefu Chai <cdc92d111bae0ed1ee3b3c8a1f849fcffc6b44f7@gmail.com>

--- cmake/Finddpdk.cmake
+++ cmake/Finddpdk.cmake
@@ -21,9 +21,9 @@
 #

 find_package (PkgConfig REQUIRED)
-pkg_check_modules (dpdk_PC libdpdk)
-
-if (dpdk_PC_FOUND)
+pkg_check_modules (dpdk_PC QUIET libdpdk)
+
+if (dpdk_PC_FOUND AND dpdk_PC_STATIC_LIBRARIES)
   find_package_handle_standard_args (dpdk
     REQUIRED_VARS
       dpdk_PC_STATIC_CFLAGS
@@ -40,11 +40,38 @@
         INTERFACE_LINK_DIRECTORIES "${dpdk_PC_STATIC_LIBRARY_DIRS}")
     return ()
   endif ()
+elseif (dpdk_PC_FOUND)
+  find_package_handle_standard_args (dpdk
+    REQUIRED_VARS
+      dpdk_PC_CFLAGS
+      dpdk_PC_INCLUDE_DIRS
+      dpdk_PC_LDFLAGS
+      dpdk_PC_LIBRARY_DIRS)
+  if (dpdk_FOUND AND NOT (TARGET dpdk::dpdk))
+    add_library (dpdk::dpdk INTERFACE IMPORTED)
+    set_target_properties (dpdk::dpdk
+      PROPERTIES
+        INTERFACE_COMPILE_OPTIONS "${dpdk_PC_CFLAGS}"
+        INTERFACE_INCLUDE_DIRECTORIES "${dpdk_PC_INCLUDE_DIRS}"
+        INTERFACE_LINK_OPTIONS "${dpdk_PC_LDFLAGS}"
+        INTERFACE_LINK_DIRECTORIES "${dpdk_PC_LIBRARY_DIRS}")
+    return ()
+  endif ()
 endif ()

 find_path (dpdk_INCLUDE_DIR
   NAMES rte_atomic.h
   PATH_SUFFIXES dpdk)
+
+if (dpdk_INCLUDE_DIR AND EXISTS "${dpdk_INCLUDE_DIR}/rte_config.h")
+  file (STRINGS "${dpdk_INCLUDE_DIR}/rte_config.h" rte_mbuf_refcnt_atomic
+    REGEX "^#define[ \t ]+RTE_MBUF_REFCNT_ATOMIC")
+  if (rte_mbuf_refcnt_atomic)
+    message (SEND_ERROR
+      "DPDK is configured with RTE_MBUF_REFCNT_ATOMIC enabled, "
+      "please disable this option and recompile DPDK.")
+  endif ()
+endif ()

 find_library (dpdk_PMD_VMXNET3_UIO_LIBRARY rte_net_vmxnet3)
 find_library (dpdk_PMD_I40E_LIBRARY rte_net_i40e)


cmake: for now assume AVX2 implies FMA and BMI2

Refs: gh-11

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -469,9 +469,11 @@
       _vc_compile_one_implementation(${_srcs} AVX+FMA "-mavx -mfma"  ""    "")
    endif()
    if(NOT Vc_AVX2_INTRINSICS_BROKEN)
-      _vc_compile_one_implementation(${_srcs} AVX2 "-xCORE-AVX2"  "-mavx2"    "/arch:AVX2")
-      _vc_compile_one_implementation(${_srcs} AVX2+BMI2 "-mavx2 -mbmi2" "" "")
-      _vc_compile_one_implementation(${_srcs} AVX2+FMA+BMI2 "-mavx2 -mfma -mbmi2" "-march=core-avx2" "")
-      _vc_compile_one_implementation(${_srcs} AVX2+FMA "-mavx2 -mfma" "" "")
-   endif()
-endmacro()
+      # The necessary list is not clear to me yet. At this point I'll only consider Intel CPUs, in
+      # which case AVX2 implies the availability of FMA and BMI2
+      #_vc_compile_one_implementation(${_srcs} AVX2  "-mavx2")
+      #_vc_compile_one_implementation(${_srcs} AVX2+BMI2 "-mavx2 -mbmi2")
+      _vc_compile_one_implementation(${_srcs} AVX2+FMA+BMI2 "-xCORE-AVX2" "-mavx2 -mfma -mbmi2" "/arch:AVX2")
+      #_vc_compile_one_implementation(${_srcs} AVX2+FMA "-mavx2 -mfma")
+   endif()
+endmacro()


cmake: Fix flatzinc build

cmake: Fix flatzinc build

--- cmake/flatzinc.cmake
+++ cmake/flatzinc.cmake
@@ -49,8 +49,6 @@
   ortools/flatzinc/checker.h
   ortools/flatzinc/cp_model_fz_solver.cc
   ortools/flatzinc/cp_model_fz_solver.h
-  ortools/flatzinc/logging.cc
-  ortools/flatzinc/logging.h
   ortools/flatzinc/model.cc
   ortools/flatzinc/model.h
   ortools/flatzinc/parser.cc


modules: updated FindMagnum.cmake.

modules: updated FindMagnum.cmake.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -1011,15 +1011,15 @@
         add_library(Magnum::WindowlessApplication ALIAS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIASED_TARGET})
     else()
         add_library(Magnum::WindowlessApplication UNKNOWN IMPORTED)
-        get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_CONFIGURATIONS)
+        foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
+            get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_${property} ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} ${property})
+            if(_MAGNUM_WINDOWLESSAPPLICATION_${property})
+                set_target_properties(Magnum::WindowlessApplication PROPERTIES
+                    ${property} "${_MAGNUM_WINDOWLESSAPPLICATION_${property}}")
+            endif()
+        endforeach()
         get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE)
         get_target_property(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG)
-        set_target_properties(Magnum::WindowlessApplication PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
-            INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
-            INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_COMPILE_OPTIONS>
-            INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_WINDOWLESSAPPLICATION_ALIAS},INTERFACE_LINK_LIBRARIES>
-            IMPORTED_CONFIGURATIONS "${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_CONFIGURATIONS}")
         if(_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE)
             set_target_properties(Magnum::WindowlessApplication PROPERTIES
                 IMPORTED_LOCATION_RELEASE ${_MAGNUM_WINDOWLESSAPPLICATION_IMPORTED_LOCATION_RELEASE})
@@ -1038,15 +1038,16 @@
         add_library(Magnum::Application ALIAS ${_MAGNUM_APPLICATION_ALIASED_TARGET})
     else()
         add_library(Magnum::Application UNKNOWN IMPORTED)
-        get_target_property(_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_CONFIGURATIONS)
+        foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
+            get_target_property(_MAGNUM_APPLICATION_${property}
+                ${_MAGNUM_APPLICATION_ALIAS} ${property})
+            if(_MAGNUM_APPLICATION_${property})
+                set_target_properties(Magnum::Application PROPERTIES ${property}
+                    "${_MAGNUM_APPLICATION_${property}}")
+            endif()
+        endforeach()
         get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_RELEASE)
         get_target_property(_MAGNUM_APPLICATION_IMPORTED_LOCATION_DEBUG ${_MAGNUM_APPLICATION_ALIAS} IMPORTED_LOCATION_DEBUG)
-        set_target_properties(Magnum::Application PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
-            INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
-            INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_COMPILE_OPTIONS>
-            INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_APPLICATION_ALIAS},INTERFACE_LINK_LIBRARIES>
-            IMPORTED_CONFIGURATIONS "${_MAGNUM_APPLICATION_IMPORTED_CONFIGURATIONS}")
         if(_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE)
             set_target_properties(Magnum::Application PROPERTIES
                 IMPORTED_LOCATION_RELEASE ${_MAGNUM_APPLICATION_IMPORTED_LOCATION_RELEASE})
@@ -1065,15 +1066,15 @@
         add_library(Magnum::GLContext ALIAS ${_MAGNUM_GLCONTEXT_ALIASED_TARGET})
     else()
         add_library(Magnum::GLContext UNKNOWN IMPORTED)
-        get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_CONFIGURATIONS)
+        foreach(property IMPORTED_CONFIGURATIONS INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_OPTIONS INTERFACE_LINK_LIBRARIES)
+            get_target_property(_MAGNUM_GLCONTEXT_${property} ${_MAGNUM_GLCONTEXT_ALIAS} ${property})
+            if(_MAGNUM_GLCONTEXT_${property})
+                set_target_properties(Magnum::GLContext PROPERTIES ${property}
+                    "${_MAGNUM_GLCONTEXT_${property}}")
+            endif()
+        endforeach()
         get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_RELEASE)
         get_target_property(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_DEBUG ${_MAGNUM_GLCONTEXT_ALIAS} IMPORTED_LOCATION_DEBUG)
-        set_target_properties(Magnum::GLContext PROPERTIES
-            INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_INCLUDE_DIRECTORIES>
-            INTERFACE_COMPILE_DEFINITIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_DEFINITIONS>
-            INTERFACE_COMPILE_OPTIONS $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_COMPILE_OPTIONS>
-            INTERFACE_LINK_LIBRARIES $<TARGET_PROPERTY:${_MAGNUM_GLCONTEXT_ALIAS},INTERFACE_LINK_LIBRARIES>
-            IMPORTED_CONFIGURATIONS "${_MAGNUM_GLCONTEXT_IMPORTED_CONFIGURATIONS}")
         if(_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE)
             set_target_properties(Magnum::GLContext PROPERTIES
                 IMPORTED_LOCATION_RELEASE ${_MAGNUM_GLCONTEXT_IMPORTED_LOCATION_RELEASE})


Updated FindMagnum.cmake from Magnum repository.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -18,8 +18,10 @@
 #  MeshTools     - MeshTools library
 #  Physics       - Physics library
 #  Primitives    - Library with stock geometric primitives (static)
+#  SceneGraph    - Scene graph library
 #  Shaders       - Library with stock shaders
-#  EglContext    - EGL context (depends on EGL and X11 libraries)
+#  GlxContext    - GLX context (depends on X11 libraries)
+#  XEglContext   - X/EGL context (depends on EGL and X11 libraries)
 #  GlutContext   - GLUT context (depends on GLUT library)
 #  Sdl2Context   - SDL2 context (depends on SDL2 library)
 # Example usage with specifying additional components is:
@@ -110,8 +112,18 @@
             endif()
         endif()

+        # GLX context dependencies
+        if(${component} STREQUAL GlxContext)
+            find_package(X11)
+            if(X11_FOUND)
+                set(_MAGNUM_${_COMPONENT}_LIBRARIES ${X11_LIBRARIES})
+            else()
+                unset(MAGNUM_${_COMPONENT}_LIBRARY)
+            endif()
+        endif()
+
         # X/EGL context dependencies
-        if(${component} STREQUAL EglContext)
+        if(${component} STREQUAL XEglContext)
             find_package(EGL)
             find_package(X11)
             if(EGL_FOUND AND X11_FOUND)
@@ -135,6 +147,11 @@
     # Primitives library
     if(${component} STREQUAL Primitives)
         set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Cube.h)
+    endif()
+
+    # Scene graph library
+    if(${component} STREQUAL SceneGraph)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Scene.h)
     endif()

     # Shaders library
@@ -147,6 +164,9 @@
         find_path(_MAGNUM_${_COMPONENT}_INCLUDE_DIR
             NAMES ${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES}
             PATHS ${MAGNUM_INCLUDE_DIR}/${_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX})
+
+        # Don't expose this variable to end users
+        mark_as_advanced(FORCE _MAGNUM_${_COMPONENT}_INCLUDE_DIR)
     endif()

     # Decide if the library was found


bump version number

bump version number

git-svn-id: 647c2dfdf120d9af8205d960f30c8711574448cd@1400 6778bc44-b910-0410-a7a0-be141de4315d

--- src/libprojectM/cmake/CPack-projectM.cmake
+++ src/libprojectM/cmake/CPack-projectM.cmake
@@ -17,8 +17,8 @@
 #SET(CPACK_BINARY_TGZ ON)
 #SET(CPACK_SOURCE_Z OFF)
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")

 IF(CPACK_PROJECTM_INCLUDED)
 	INCLUDE(CPack)


Updated CMake config file to only add HDF5 libraries when HDF5 is found.

--- CMake/TBTKConfigTemplate.cmake
+++ CMake/TBTKConfigTemplate.cmake
@@ -66,6 +66,8 @@

 IF(HDF5_FOUND)
 	MESSAGE("[X] HDF5")
+	LIST(APPEND TBTK_LIBRARIES "hdf5")
+	LIST(APPEND TBTK_LIBRARIES "hdf5_cpp")
 ELSE(HDF5_FOUND)
 	MESSAGE("[ ] HDF5")
 ENDIF(HDF5_FOUND)
@@ -111,8 +113,6 @@
 ENDIF(wxWidgets_FOUND)

 #LIST(APPEND TBTK_LIBRARIES "-lhdf5 -lhdf5_cpp -llapack -lblas")
-LIST(APPEND TBTK_LIBRARIES "hdf5")
-LIST(APPEND TBTK_LIBRARIES "hdf5_cpp")
 LIST(APPEND TBTK_LIBRARIES "lapack")
 IF(OpenBLAS_FOUND)
 	LIST(APPEND TBTK_LIBRARIES "openblas")


BUILD: Add options to build deb and rpm packages on demand

--- CMakeModules/CPackConfig.cmake
+++ CMakeModules/CPackConfig.cmake
@@ -2,16 +2,27 @@

 INCLUDE("${CMAKE_MODULE_PATH}/Version.cmake")

+OPTION(CREATE_STGZ "Create .sh install file" ON)
+MARK_AS_ADVANCED(CREATE_STGZ)
+
 # CPack package generation
-#SET(CPACK_GENERATOR "TGZ;STGZ")
-SET(CPACK_GENERATOR "STGZ")
-# Create the following installers are as follows:
-#  Windows: Use external packaging, do nothing here
-#  OSX: Deploy as TGZ and STGZ
-#IF("${CMAKE_SYSTEM}" MATCHES "Linux")
-#    #  Linux: TGZ, STGZ, DEB
-#    SET(CPACK_GENERATOR "TGZ;STGZ;DEB;RPM")
-#ENDIF()
+IF(${CREATE_STGZ})
+  LIST(APPEND CPACK_GENERATOR "STGZ")
+ENDIF()
+
+OPTION(CREATE_DEB "Create .deb install file" OFF)
+MARK_AS_ADVANCED(CREATE_DEB)
+
+IF(${CREATE_DEB})
+  LIST(APPEND CPACK_GENERATOR "DEB")
+ENDIF()
+
+OPTION(CREATE_RPM "Create .rpm install file" OFF)
+MARK_AS_ADVANCED(CREATE_RPM)
+
+IF(${CREATE_RPM})
+  LIST(APPEND CPACK_GENERATOR "RPM")
+ENDIF()

 # Common settings to all packaging tools
 SET(CPACK_PREFIX_DIR ${CMAKE_INSTALL_PREFIX})
@@ -59,16 +70,14 @@
 # Debian package
 ##
 SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${PROCESSOR_ARCHITECTURE})
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libfreeimage-dev, libatlas3gf-base, libfftw3-dev, liblapacke-dev")
-SET(CPACK_DEBIAN_PACKAGE_SUGGESTS "ocl-icd-libopencl1 (>= 2.0), nvidia-cuda-dev (>= 6.0)")

 ##
 # RPM package
 ##
 SET(CPACK_RPM_PACKAGE_LICENSE "BSD")
+set(CPACK_RPM_PACKAGE_AUTOREQPROV " no")
+
 SET(CPACK_PACKAGE_GROUP "Development/Libraries")
-SET(CPACK_RPM_PACKAGE_REQUIRES "freeimage atlas fftw lapack")
-
 ##
 # Source package
 ##


Downsize tests so they run in a reasonable amount of time

--- test/testing.cmake
+++ test/testing.cmake
@@ -87,9 +87,13 @@
   ./buildBinaryGraph
   "${GRAPHS}/tree.ebin")

-mpi_test(buildParallelBinaryGraph 4
+mpi_test(buildParallelBinaryGraph2 2
   ./buildBinaryGraph
-  "${GRAPHS}/google.ebin")
+  "${GRAPHS}/gnutella.ebin")
+
+mpi_test(buildParallelBinaryGraph4 4
+  ./buildBinaryGraph
+  "${GRAPHS}/enron.ebin")

 mpi_test(testAdjacentSerial 1
   ./testAdjacentTraversal
@@ -126,9 +130,9 @@
   "${GRAPHS}/torus/4/"
   .15)

-mpi_test(vtxBalanceRing 2
+mpi_test(vtxBalanceGraph 2
   ./vtxBalance
-  "${GRAPHS}/ring.ebin"
+  "${GRAPHS}/gnutella.ebin"
   .1)

 mpi_test(balanceCube 4


replace cook with mpi_test macro

replace cook with mpi_test macro

--- test/testing.cmake
+++ test/testing.cmake
@@ -7,12 +7,6 @@
     COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} ${PROCS} ${VALGRIND} ${VALGRIND_ARGS} ${EXE} ${ARGN}
   )
 endmacro(mpi_test)
-macro(cook TESTNAME PROG PARTS FACTOR WORKDIR)
-  math(EXPR OUTPARTS "${PARTS} * ${FACTOR}")
-  add_test(NAME "${TESTNAME}"
-    COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} ${OUTPARTS} "${PROG}"
-    WORKING_DIRECTORY "${WORKDIR}")
-endmacro()
 add_test(shapefun shapefun)
 add_test(shapefun2 shapefun2)
 add_test(bezierElevation bezierElevation)
@@ -246,7 +240,8 @@
 if (PCU_COMPRESS)
   set(MDIR ${MESHES}/phasta/1-1-Chef-Tet-Part/run)
   if (PHASTA_CHEF_ENABLED)
-    cook(chefStream ${CMAKE_CURRENT_BINARY_DIR}/chefStream 1 1 ${MDIR})
+    mpi_test(chefStream 1 ${CMAKE_CURRENT_BINARY_DIR}/chefStream
+      WORKING_DIRECTORY ${MDIR})
     set(cmd
       ${CMAKE_BINARY_DIR}/phasta/bin/checkphasta
       ${MDIR}/1-procs_case/
@@ -258,28 +253,26 @@
       WORKING_DIRECTORY ${MDIR}
     )
   endif()
-  cook(chef0 ${CMAKE_CURRENT_BINARY_DIR}/chef 1 1 ${MDIR})
+  mpi_test(chef0 1 ${CMAKE_CURRENT_BINARY_DIR}/chef
+    WORKING_DIRECTORY ${MDIR})
   set(MDIR ${MESHES}/phasta/1-1-Chef-Tet-Part)
   add_test(NAME chef1
     COMMAND diff -r -x .svn out_mesh/ good_mesh/
     WORKING_DIRECTORY ${MDIR})
-  set(MDIR ${MESHES}/phasta/2-1-Chef-Tet-Part/run)
   if(ENABLE_ZOLTAN)
-    cook(chef2 ${CMAKE_CURRENT_BINARY_DIR}/chef 1 2 ${MDIR})
-    set(MDIR ${MESHES}/phasta/2-1-Chef-Tet-Part/4-2-Chef-Part/run)
-    cook(chef3 ${CMAKE_CURRENT_BINARY_DIR}/chef 2 2 ${MDIR})
-    set(MDIR ${MESHES}/phasta/4-1-Chef-Tet-Part/run)
-    cook(chef4 ${CMAKE_CURRENT_BINARY_DIR}/chef 1 4 ${MDIR})
+    mpi_test(chef2 2 ${CMAKE_CURRENT_BINARY_DIR}/chef
+      WORKING_DIRECTORY ${MESHES}/phasta/2-1-Chef-Tet-Part/run)
+    mpi_test(chef3 4 ${CMAKE_CURRENT_BINARY_DIR}/chef
+      WORKING_DIRECTORY ${MESHES}/phasta/2-1-Chef-Tet-Part/4-2-Chef-Part/run)
+    mpi_test(chef4 4 ${CMAKE_CURRENT_BINARY_DIR}/chef
+      WORKING_DIRECTORY ${MESHES}/phasta/4-1-Chef-Tet-Part/run)
   endif()
-  set(MDIR ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20/run)
-  cook(chef5 ${CMAKE_CURRENT_BINARY_DIR}/chef 4 1 ${MDIR})
-  set(MDIR ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20)
+  mpi_test(chef5 4 ${CMAKE_CURRENT_BINARY_DIR}/chef
+    WORKING_DIRECTORY ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20/run)
   add_test(NAME chef6
     COMMAND diff -r -x .svn out_mesh/ good_mesh/
-    WORKING_DIRECTORY ${MDIR})
-  set(MDIR ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20/run)
-  add_test(NAME chefReadUrPrep
-    COMMAND ${MPIRUN} ${MPIRUN_PROCFLAG} 4
-    ${CMAKE_CURRENT_BINARY_DIR}/chefReadUrPrep ../../../model.dmg bz2:../good_mesh/ adapt.inp
-    WORKING_DIRECTORY "${MDIR}")
-endif()
+    WORKING_DIRECTORY ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20)
+  mpi_test(chefReadUrPrep 4 ${CMAKE_CURRENT_BINARY_DIR}/chefReadUrPrep
+    ../../../model.dmg bz2:../good_mesh/ adapt.inp
+    WORKING_DIRECTORY ${MESHES}/phasta/4-1-Chef-Tet-Part/4-4-Chef-Part-ts20/run)
+endif()


added check for gcc version (gcc 3.x.x doesn't know what "-fno-tree-vectorize" is => make failed on sun os)

--- CMakeCompilers.cmake
+++ CMakeCompilers.cmake
@@ -41,9 +41,15 @@

     # first, add "-ggdb -g3" flag to generate more debug info
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -ggdb")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -fno-tree-vectorize")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -fno-tree-vectorize")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb")
+
+    # turn off tree-vectorize O3 optimization; it breaks Sedna
+    # gcc versions 3.x.x lack this option thus we need this condition
+    # gcc version is 4.6.1 at this moment
+    if (_GCC_COMPILER_VERSION STRGREATER "40")
+      set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_DEBUG} -fno-tree-vectorize")
+      set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_DEBUG} -fno-tree-vectorize")
+    endif (_GCC_COMPILER_VERSION STRGREATER "40")

     # add some -f declarations
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-omit-frame-pointer")


remove more debug code

remove more debug code

--- VigraAddDep.cmake
+++ VigraAddDep.cmake
@@ -118,8 +118,7 @@
   get_target_property(IMP_PROP "${_VAD_NAME}" IMPORTED)
   if(NOT IMP_PROP)
     get_target_property(_IMP_TYPE "${_VAD_NAME}" TYPE)
-    message("type: ${_IMP_TYPE} imp: ${IMP_PROP}")
-    message(FATAL_ERROR "Target '${_VAD_NAME}' is not IMPORTED, no need to make it global.")
+    message(FATAL_ERROR "Target '${_VAD_NAME}' is not IMPORTED but of type \"${_IMP_TYPE}\", no need to make it global.")
   endif()

   # The strategy here is as follows:
@@ -162,7 +161,6 @@
   add_library(_VAD_${NAME_NO_COLONS}_STUB_INTERFACE INTERFACE)
   target_link_libraries(_VAD_${NAME_NO_COLONS}_STUB_INTERFACE INTERFACE _VAD_${_VAD_NAME}_STUB)
   add_library("${_VAD_NAME}" ALIAS _VAD_${NAME_NO_COLONS}_STUB_INTERFACE)
-  message("added global target ${_VAD_NAME} using _VAD_${NAME_NO_COLONS}_STUB_INTERFACE and _VAD_${_VAD_NAME}_STUB")

   # We need to remove the library dir for the original target from the global list:
   # the target is now just an alias with no TARGET_FILE_DIR property. Its actual


additionally track ownership of reset variables - used to verify and to keep track of ownership of cached variable (e.g. PERL_EXECUTABLE might be set by user)

Change-Id: Ifb1e2618d7b36fdec0ac8f76122129bf9cca6b5a

--- VigraAddDep.cmake
+++ VigraAddDep.cmake
@@ -209,9 +209,13 @@
   # to find_package_plus(). These variables are stored in a variable called VAD_NEW_VARS_${_VAD_NAME}, which we will
   # also remove.
   foreach(_NEWVAR ${VAD_NEW_VARS_${_VAD_NAME}})
-    unset(${_NEWVAR} CACHE)
+    if (VAD_${_NEWVAR}_RESET_OWNER STREQUAL ${_VAD_NAME})
+      unset(${_NEWVAR} CACHE)
+      unset(${_NEWVAR})
+    else()
+      message(FATAL_ERROR "inconsistent variable ownership (${_VAD_NAME} tried to unset ${_NEWVAR} which was detected as set by ${VAD_${_NEWVAR}_RESET_OWNER})")
+    endif()
   endforeach()
-  unset(VAD_NEW_VARS_${_VAD_NAME} CACHE)

   # Get the list of the currently defined variables.
   get_cmake_property(_OLD_VARIABLES_${_VAD_NAME} VARIABLES)
@@ -227,37 +231,60 @@
   # We will append the detected variables to the _DIFFVARS list.
   set(_DIFFVARS)
   foreach(_NEWVAR ${_NEW_VARIABLES_${_VAD_NAME}})
-      list(FIND _OLD_VARIABLES_${_VAD_NAME} "${_NEWVAR}" _NEWVARIDX)
-
-      var_is_cached(${_NEWVAR} _NEWVAR_IS_CACHED)
-
-      if(_NEWVARIDX EQUAL -1 AND NOT _NEWVAR_IS_CACHED)
-          # New var was not found among the old ones. We check if it is not an internal variable,
-          # in which case we will add it to the cached variables.
-          # cached variables are also skipped (should not be added to diffvars so they will not be reset!
-          string(TOLOWER "${_NEWVAR}" _NEWVAR_LOW)
-          # We forcefully exclude variables named in a certain way:
-          # - starts with underscore "_",
-          # - vad-related variables,
-          # - variables set by CMake's builtin find_package,
-          # - args* (these are arguments to macros/functions).
-          if(NOT _NEWVAR_LOW MATCHES "^_" AND NOT _NEWVAR_LOW MATCHES "^vad" AND NOT _NEWVAR_LOW MATCHES "^find_package" AND NOT _NEWVAR_LOW MATCHES "^argv[0-9]*" AND NOT _NEWVAR_LOW MATCHES "^argc" AND NOT _NEWVAR_LOW MATCHES "^argn")
-            # Make sure we don't store multiline strings in the cache, as that is not supported.
-            string(REPLACE "\n" ";" _NEWVAR_NO_NEWLINES "${${_NEWVAR}}")
-            if(VAD_VERBOSE)
-              message(STATUS "Storing new variable in cache: '${_NEWVAR}:${_NEWVAR_NO_NEWLINES}'")
+      string(TOLOWER "${_NEWVAR}" _NEWVAR_LOW)
+      # We forcefully exclude variables named in a certain way:
+      # - starts with underscore "_",
+      # - vad-related variables,
+      # - variables set by CMake's builtin find_package,
+      # - args* (these are arguments to macros/functions).
+      if(NOT _NEWVAR_LOW MATCHES "^_" AND NOT _NEWVAR_LOW MATCHES "^vad" AND NOT _NEWVAR_LOW MATCHES "^find_package" AND NOT _NEWVAR_LOW MATCHES "^argv[0-9]*" AND NOT _NEWVAR_LOW MATCHES "^argc" AND NOT _NEWVAR_LOW MATCHES "^argn")
+
+        list(FIND _OLD_VARIABLES_${_VAD_NAME} "${_NEWVAR}" _NEWVARIDX)
+
+        var_is_cached(${_NEWVAR} _NEWVAR_IS_CACHED)
+
+        # variables might first be added to the cache by a package and then overwritten by the user
+        # these should stay in cache and stay in new_vars list
+        if (_NEWVAR_IS_CACHED)
+          #message("newvar ${_NEWVAR} is cached")
+          if (VAD_${_NEWVAR}_RESET_OWNER STREQUAL ${_VAD_NAME})
+            # force overwrite if it was cached by us (else ignore it), and leave/readd to diffvars
+            string(FIND "${VAD_NEW_VARS_${_VAD_NAME}}" ${_NEWVAR} _IS_NEWVAR_IDX)
+            if (NOT _IS_NEWVAR_IDX EQUAL -1)
+              get_property(_NEWVAR_CACHETYPE CACHE ${_NEWVAR} PROPERTY TYPE)
+              # FIXME get INTERNAL + ADVANCED flag? why do we rewrite this exaclty?
+              set(${_NEWVAR} ${${_NEWVAR}} CACHE ${_NEWVAR_CACHETYPE} "" FORCE)
+              list(APPEND _DIFFVARS ${_NEWVAR})
+              set(VAD_${_NEWVAR}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
+            else()
+              #message("skipping variable ${_NEWVAR} is ours but not known ${VAD_${_NEWVAR}_RESET_OWNER}")
             endif()
-            if(_NEWVAR_LOW MATCHES "librar" OR _NEWVAR_LOW MATCHES "include")
-              # Variables which are likely to represent lib paths or include dirs are set as string variables,
-              # so that they are visible from the GUI.
-              set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE STRING "")
-            else()
-              # Otherwise, mark them as internal vars.
-              set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE INTERNAL "")
-            endif()
-            list(APPEND _DIFFVARS ${_NEWVAR})
+          else()
+            #message("skipping variable ${_NEWVAR} is cached by \"${VAD_${_NEWVAR}_RESET_OWNER}\" (I'm ${_VAD_NAME})")
           endif()
-      endif()
+        elseif(_NEWVARIDX EQUAL -1)
+            # New var was not found among the old ones. We check if it is not an internal variable,
+            # in which case we will add it to the cached variables.
+            # cached variables are also skipped (should not be added to diffvars so they will not be reset!
+              # Make sure we don't store multiline strings in the cache, as that is not supported.
+              string(REPLACE "\n" ";" _NEWVAR_NO_NEWLINES "${${_NEWVAR}}")
+              if(VAD_VERBOSE)
+                message(STATUS "Storing new variable in cache: '${_NEWVAR}:${_NEWVAR_NO_NEWLINES}'")
+              endif()
+              if(_NEWVAR_LOW MATCHES "librar" OR _NEWVAR_LOW MATCHES "include")
+                # Variables which are likely to represent lib paths or include dirs are set as string variables,
+                # so that they are visible from the GUI.
+                set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE STRING "")
+              else()
+                # Otherwise, mark them as internal vars.
+                set(${_NEWVAR} ${_NEWVAR_NO_NEWLINES} CACHE INTERNAL "")
+              endif()
+              list(APPEND _DIFFVARS ${_NEWVAR})
+              set(VAD_${_NEWVAR}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
+        else()
+          #message("skipping known variable ${_VAD_NAME}")
+        endif() #new var
+      endif() #exclude match
   endforeach()
   # Store a list of the variables that were exported as cache variables.
   set(VAD_NEW_VARS_${_VAD_NAME} ${_DIFFVARS} CACHE INTERNAL "")
@@ -269,6 +296,7 @@
   endif()
   set(${_VARNAME} ${_VARVAL} CACHE INTERNAL "")
   set(VAD_NEW_VARS_${_VAD_NAME} "${VAD_NEW_VARS_${_VAD_NAME}};${_VARNAME}" CACHE INTERNAL "")
+  set(VAD_${_VARNAME}_RESET_OWNER ${_VAD_NAME} CACHE INTERNAL "")
 endfunction()

 # In addition to calling the builtin find_package(), this function


feature(cmake) Add option to disable compiler optimizations for wrapfunctions.cpp (Fixes #828) (#829)

--- src/CMakeLists.template.cmake
+++ src/CMakeLists.template.cmake
@@ -34,6 +34,13 @@

 add_library(${PROJECT_NAME} ${SRC_LIST_LIB})
 add_library(model ALIAS ${PROJECT_NAME})
+
+# This option can be helpful when using the Intel compiler and compilation of
+# wrapfunctions.cpp fails due to insufficient memory.
+option(ENABLE_WRAPFUNCTIONS_OPTIMIZATIONS "Enable compiler optimizations for wrapfunctions.cpp?" ON)
+if(NOT ENABLE_WRAPFUNCTIONS_OPTIMIZATIONS)
+    set_source_files_properties(wrapfunctions.cpp PROPERTIES COMPILE_FLAGS -O0)
+endif()

 target_include_directories(${PROJECT_NAME} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")


Solve linking error caused by missing pthreads library

Not sure why it worked on Debian but didn't work on Arch, could have
been some indirect link dependency or so.

Anyway, we explicitly depends on pthreads, so need to do corresponding
find_package().

--- src/cmake/external_libs.cmake
+++ src/cmake/external_libs.cmake
@@ -40,6 +40,10 @@
 	if(APPLE OR WIN32)
 		include(precompiled_libs)
 	endif()
+
+	# PThreads
+	find_package(Threads REQUIRED)
+	set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})

 	####
 	# OpenGL


Core/CMake: show branch name in server info

--- src/cmake/revision.h.in.cmake
+++ src/cmake/revision.h.in.cmake
@@ -3,10 +3,11 @@
  #define _REVISION                  "@rev_id_str@"
  #define _HASH                      "@rev_hash@"
  #define _DATE                      "@rev_date@"
+ #define _BRANCH                    "@rev_branch@"
  #define VER_COMPANYNAME_STR        "AzerothCore"
  #define VER_LEGALCOPYRIGHT_STR     "AzerothCore"
  #define VER_FILEVERSION            0,0,0
- #define VER_FILEVERSION_STR        "@rev_hash@ @rev_date@"
+ #define VER_FILEVERSION_STR        "@rev_hash@ @rev_date@ (@rev_branch@ branch)"
  #define VER_PRODUCTVERSION         VER_FILEVERSION
  #define VER_PRODUCTVERSION_STR     VER_FILEVERSION_STR
 #endif // __REVISION_H__


Removed trailing spaces

Removed trailing spaces

--- raspberrypi2-cxx11.cmake
+++ raspberrypi2-cxx11.cmake
@@ -60,7 +60,7 @@
 )
 if(_has_errors)
   polly_fatal_error(
-      "RaspberyPi Toolchain configuration failed:"
+      "RaspberyPi Toolchain configuration failed:"
       ${_rpi_error_msg}
   )
 endif()
@@ -84,7 +84,7 @@
     CACHE STRING "RaspberryPi Toolchain Prefix"
 )

-# The sysroot for the cross compile
+# The sysroot for the cross compile
 set(CROSS_COMPILE_SYSROOT
     "$ENV{RASPBERRYPI_CROSS_COMPILE_SYSROOT}"
     CACHE PATH "RaspberryPi sysroot"


Bug 880: manually edit the DartConfiguration.tcl file to get it working with cmake 3.0.x

--- cmake/EigenConfigureTesting.cmake
+++ cmake/EigenConfigureTesting.cmake
@@ -14,49 +14,18 @@
 # check whether /bin/bash exists
 find_file(EIGEN_BIN_BASH_EXISTS "/bin/bash" PATHS "/" NO_DEFAULT_PATH)

-# CMake/Ctest does not allow us to change the build command,
-# so we have to workaround by directly editing the generated DartConfiguration.tcl file
-# save CMAKE_MAKE_PROGRAM
-set(CMAKE_MAKE_PROGRAM_SAVE ${CMAKE_MAKE_PROGRAM})
-# and set a fake one
-set(CMAKE_MAKE_PROGRAM "@EIGEN_MAKECOMMAND_PLACEHOLDER@")
-
 # This call activates testing and generates the DartConfiguration.tcl
 include(CTest)

 set(EIGEN_TEST_BUILD_FLAGS "" CACHE STRING "Options passed to the build command of unit tests")

-# overwrite default DartConfiguration.tcl
-# The worarounds are different for each version of the MSVC IDE
-set(EIGEN_TEST_TARGET buildtests)
-if(MSVC_IDE)
-  if(CMAKE_MAKE_PROGRAM_SAVE MATCHES "devenv") # devenv
-    set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} Eigen.sln /build Release /project ${EIGEN_TEST_TARGET}")
-  else() # msbuild
-    set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${EIGEN_TEST_TARGET}.vcxproj /p:Configuration=\${CTEST_CONFIGURATION_TYPE}")
-  endif()
-
-  # append the build flags if provided
-  if(NOT "${EIGEN_TEST_BUILD_FLAGS}" MATCHES "^[ \t]*$")
-    set(EIGEN_BUILD_COMMAND "${EIGEN_BUILD_COMMAND} ${EIGEN_TEST_BUILD_FLAGS}")
-  endif()
-
-  # apply the dartconfig hack ...
-  set(EIGEN_MAKECOMMAND_PLACEHOLDER "${EIGEN_BUILD_COMMAND}\n#")
-else()
-  # for make and nmake
-  set(EIGEN_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM_SAVE} ${EIGEN_TEST_TARGET} ${EIGEN_TEST_BUILD_FLAGS}")
-  set(EIGEN_MAKECOMMAND_PLACEHOLDER "${EIGEN_BUILD_COMMAND}")
-endif()
-
-configure_file(${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl ${CMAKE_BINARY_DIR}/DartConfiguration.tcl)
-
-# restore default CMAKE_MAKE_PROGRAM
-set(CMAKE_MAKE_PROGRAM ${CMAKE_MAKE_PROGRAM_SAVE})
-
-# un-set temporary variables so that it is like they never existed
-unset(CMAKE_MAKE_PROGRAM_SAVE)
-unset(EIGEN_MAKECOMMAND_PLACEHOLDER)
+# Overwrite default DartConfiguration.tcl such that ctest can build our unit tests.
+# Recall that our unit tests are not in the "all" target, so we have to explicitely ask ctest to build our custom 'buildtests' target.
+# At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable.
+file(READ  "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE)
+string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config '' -- -i ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
+       EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE})
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" ${EIGEN_DART_CONFIG_FILE2})

 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake.in ${CMAKE_BINARY_DIR}/CTestCustom.cmake)


[CMake] Provide the ability to skip stripping when generating dSYMs

For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On.

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@265057 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -362,6 +362,10 @@
     return()
   endif()

+  if(NOT COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP)
+    set(strip_command COMMAND xcrun strip -Sl $<TARGET_FILE:${name}>)
+  endif()
+
   if(APPLE)
     if(CMAKE_CXX_FLAGS MATCHES "-flto"
       OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
@@ -372,7 +376,7 @@
     endif()
     add_custom_command(TARGET ${name} POST_BUILD
       COMMAND xcrun dsymutil $<TARGET_FILE:${name}>
-      COMMAND xcrun strip -Sl $<TARGET_FILE:${name}>)
+      ${strip_command})
   else()
     message(FATAL_ERROR "COMPILER_RT_EXTERNALIZE_DEBUGINFO isn't implemented for non-darwin platforms!")
   endif()


Remove white spaces

Remove white spaces

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -1478,7 +1478,7 @@
 function(generateHeaders pythonInput output target)
      add_custom_command(OUTPUT ${output}
           DEPENDS ${pythonInput} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
-          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
+          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
                                        ${pythonInput}
                                        ${output}
      )
@@ -1493,7 +1493,7 @@
 function(generateManual name pythonInput output)
      add_custom_target(${name} ALL
           DEPENDS ${pythonInput} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
-          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
+          COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/build/misc/argparse2help.py
                                        ${pythonInput}
                                        ${output}
      )


Enable OpenVino build on Arm64 platform (#5682)


Update FindSuiteSparse.cmake

Update FindSuiteSparse.cmake

--- cmakemodule/FindSuiteSparse.cmake
+++ cmakemodule/FindSuiteSparse.cmake
@@ -56,7 +56,7 @@
 ##
 ## Created by jesnault (jerome.esnault@inria.fr) 2014-01-15
 ## Updated by jesnault (jerome.esnault@inria.fr) 2014-01-21
-
+## Licensed under 3-Claused BSD License. See https://github.com/jlblancoc/suitesparse-metis-for-windows/blob/master/LICENSE.md

 ## check if global root SuiteSparse folder is set or not and cache it in order to let user fill it
 if(NOT SuiteSparse_DIR)


Add coverage for library targets as well

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -155,6 +155,7 @@

 		set_target_properties(mrpt-${name} PROPERTIES FOLDER "modules")
 		set(iftype PUBLIC)
+		add_coverage(mrpt-${name})
 	ELSE()
 		# A hdr-only library: needs no real compiling
 		add_library(mrpt-${name} INTERFACE)


Typo missing "

Typo missing "

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -271,7 +271,7 @@
 			ELSE()
 				# Use cotire module for GCC/CLANG:
 				list(APPEND COTIRE_PREFIX_HEADER_IGNORE_PATH
-					${OpenCV_INCLUDE_DIR}"
+					"${OpenCV_INCLUDE_DIR}"
 					"${MRPT_LIBS_ROOT}/${name}/src"
 				)
 				set_target_properties(mrpt-${name} PROPERTIES


remove unused boost atomic dependency

remove unused boost atomic dependency

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -134,7 +134,7 @@
     SET(Boost_DETAILED_FAILURE_MSG ON)
 ENDIF()
 IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE)
-    FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET COMPONENTS fiber context system thread atomic chrono date_time)
+    FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET COMPONENTS fiber context system thread chrono date_time)
     IF(NOT Boost_FIBER_FOUND)
         MESSAGE(STATUS "Optional alpaka dependency Boost fiber could not be found! Fibers back-end disabled!")
         SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE OFF CACHE BOOL "Enable the Fibers CPU back-end" FORCE)


crypto: correct documentation in FindLibOpenSSL.cmake

--- cmake/Modules/FindLibOpenSSL.cmake
+++ cmake/Modules/FindLibOpenSSL.cmake
@@ -2,10 +2,9 @@
 #
 # Defines:
 #
-#  OPENSSL_FOUND - set if the system has the gcrypt library
-#  OPENSSL_CFLAGS - the required gcrypt compilation flags
-#  OPENSSL_LIBRARIES - the linker libraries needed to use the gcrypt library
-#  HAS_OPENSSL_4SURE - set if a test program can be compiled and linked against the OpenSSL library.
+#  OPENSSL_FOUND - set if the system has the OpenSSL library
+#  OPENSSL_LIBRARIES - the linker libraries needed to use the OpenSSL library
+#  OPENSSL_INCLUDE_DIR - the path to the include files of the OpenSSL library
 #
 # Copyright (c) 2017 Peter Nirschl <peter.nirschl@gmail.com>
 #
@@ -34,4 +33,6 @@
     set (OPENSSL_INCLUDE_DIR "")
     set (OPENSSL_LIBRARIES "")
   endif ()
+
+  unset (HAS_OPENSSL_4SURE)
 endif ()


CMake considers versions 1.1 and 1.2 when looking for QtMobility information.

CMake looks for the latest first 1.2, 1.1, and so on.

--- cmake/Modules/FindQtMobility.cmake
+++ cmake/Modules/FindQtMobility.cmake
@@ -20,8 +20,16 @@
     ENDIF()
 endmacro()

-IF(EXISTS "${QT_MKSPECS_DIR}/features/mobility.prf")
-    FILE(READ ${QT_MKSPECS_DIR}/features/mobility.prf MOBILITY_FILE_CONTENTS)
+if(EXISTS "${QT_MKSPECS_DIR}/features/mobility12.prf")
+    set(MOBILITY_PRF_FILE "${QT_MKSPECS_DIR}/features/mobility12.prf")
+elseif(EXISTS "${QT_MKSPECS_DIR}/features/mobility11.prf")
+    set(MOBILITY_PRF_FILE "${QT_MKSPECS_DIR}/features/mobility11.prf")
+elseif(EXISTS "${QT_MKSPECS_DIR}/features/mobility.prf")
+    set(MOBILITY_PRF_FILE "${QT_MKSPECS_DIR}/features/mobility.prf")
+endif()
+
+IF(DEFINED MOBILITY_PRF_FILE)
+    FILE(READ ${MOBILITY_PRF_FILE} MOBILITY_FILE_CONTENTS)

     STRING(REGEX MATCH "MOBILITY_PREFIX=([^\n]+)" QT_MOBILITY_PREFIX "${MOBILITY_FILE_CONTENTS}")
     SET(QT_MOBILITY_PREFIX ${CMAKE_MATCH_1})


Same, without breaking GCC 4

Same, without breaking GCC 4

--- cmake/Modules/cvmfs_compiler.cmake
+++ cmake/Modules/cvmfs_compiler.cmake
@@ -38,12 +38,12 @@
 if (CMAKE_COMPILER_IS_GNUCC)
   message (STATUS "checking gcc version...")
   execute_process (
-    COMMAND ${CMAKE_C_COMPILER} -dumpfullversion
+    COMMAND ${CMAKE_C_COMPILER} --version
     OUTPUT_VARIABLE CVMFS_GCC_VERSION
     ERROR_VARIABLE  CVMFS_GCC_VERSION
   )
-  STRING(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" CVMFS_GCC_MAJOR "${CVMFS_GCC_VERSION}")
-  STRING(REGEX REPLACE "[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" CVMFS_GCC_MINOR "${CVMFS_GCC_VERSION}")
+  STRING(REGEX REPLACE "[A-Za-z]* \\(GCC\\) ([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" CVMFS_GCC_MAJOR "${CVMFS_GCC_VERSION}")
+  STRING(REGEX REPLACE "[A-Za-z]* \\(GCC\\) [0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" CVMFS_GCC_MINOR "${CVMFS_GCC_VERSION}")
   if (${CVMFS_GCC_MAJOR} LESS 4)
     message (FATAL_ERROR "GCC < 4.1 unsupported")
   endif (${CVMFS_GCC_MAJOR} LESS 4)


Update paraview and qt for osx 12.0 on i386.


fix CMake warning

fix CMake warning

Change-Id: Ibcaa5370a74bccd8e641376b0c69f38d23288db7
Reviewed-on: http://gerrit.aldebaran.lan/25479
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: vbarbaresi <371b46c96c99af52f4f920034e4fcb63ece5bdb5@aldebaran-robotics.com>

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -544,7 +544,7 @@
   set(_res "${_res} ${_vars}")
   set(_sdk_file "${QI_SDK_DIR}/${QI_SDK_CMAKE_MODULES}/${_l_target}-config.cmake")
   file(WRITE "${_sdk_file}" "${_res}")
-  _qi_install_redist_file("${_sdk_file}" "${target}", "${_l_target}")
+  _qi_install_redist_file("${_sdk_file}" "${target}" "${_l_target}")
 endfunction()

 #


enable policy CMP0055

enable policy CMP0055

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -104,6 +104,11 @@
 if (POLICY CMP0054)
 	# only interpret if() arguments as variables or keywords when unquoted
 	cmake_policy(SET CMP0054 NEW)
+endif()
+
+if (POLICY CMP0055)
+	# strict checking for break() command
+	cmake_policy(SET CMP0055 NEW)
 endif()

 include(CMakeParseArguments)


precompiled headers

precompiled headers

--- build/build.cmake
+++ build/build.cmake
@@ -47,12 +47,18 @@
 )

 settingsCR(core)
-
+
 target_include_directories(core PUBLIC "${root}/inc")
 target_link_libraries(core PUBLIC
   doctest
+  fmt
   spdlog
-  fmt
+)
+
+target_precompile_headers(core PRIVATE
+	<3rdParty/doctest.h>
+    <3rdParty/fmt.h>
+    <3rdParty/spdlog.h>
 )

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


Update utils.cmake

Update utils.cmake

--- build/utils.cmake
+++ build/utils.cmake
@@ -14,9 +14,9 @@
 		CACHE STRING "Available build-types: Debug, DebugEditor, Develop, DevelopEditor and Shipping" FORCE)

 	# copy settings from existing build types
-	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG -DET_DEBUG" )
-	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG -DET_DEBUG")
-	set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -D_DEBUG -DET_DEBUG")
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DET_DEBUG" )
+	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DET_DEBUG")
+	set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -DET_DEBUG")

 	set(CMAKE_CXX_FLAGS_DEBUGEDITOR "${CMAKE_CXX_FLAGS_DEBUG} -DEDITOR" )
 	set(CMAKE_C_FLAGS_DEBUGEDITOR "${CMAKE_C_FLAGS_DEBUG} -DEDITOR")


COMP: fixed typo in install code

COMP: fixed typo in install code

--- BlueBerry/CMake/MacroInstallCTKPlugin.cmake
+++ BlueBerry/CMake/MacroInstallCTKPlugin.cmake
@@ -27,7 +27,7 @@
                              FILE \"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_debug}\")")
         ENDIF()
         IF(_target_filename_release)
-          INSTALL(CODE "FILE(RPATH_CHANGE
+          INSTALL(CODE "FILE(RPATH_REMOVE
                              FILE \"\${CMAKE_INSTALL_PREFIX}/${_INSTALL_DESTINATION}/${_target_filename_release}\")")
         ENDIF()
       ENDIF()


cosmetics on test source filename display

--- dist/WkTest.cmake
+++ dist/WkTest.cmake
@@ -70,12 +70,12 @@
 			set( testsource "" )
 			#To make sure the sources file exists
 			foreach( testsrc ${ARGN} )
-				set ( testsrc ${PROJECT_SOURCE_DIR}/${WKCMAKE_TEST_DIR}/${testsrc} )
-				IF (NOT EXISTS ${testsrc})
+				set ( testsrc ${WKCMAKE_TEST_DIR}/${testsrc} )
+				IF (NOT EXISTS ${PROJECT_SOURCE_DIR}/${testsrc})
 					MESSAGE ( FATAL_ERROR "${testsrc} Not Found !" )
-				ELSE ( NOT EXISTS ${testsrc})
+				ELSE ( NOT EXISTS ${PROJECT_SOURCE_DIR}/${testsrc})
 					SET (testsource ${testsource} ${testsrc})
-				ENDIF (NOT EXISTS ${testsrc})
+				ENDIF (NOT EXISTS ${PROJECT_SOURCE_DIR}/${testsrc})
 			endforeach( testsrc ${ARGN} )
 			MESSAGE ( STATUS "== Detected ${test_name} Source : ${testsource}" )
 		ENDIF ( ${ARGC} EQUAL 1 )


make it possible to add more sources to a marble test application if needed

svn path=/branches/work/marble-geodata-nt/marble/; revision=923990

--- MarbleMacros.cmake
+++ MarbleMacros.cmake
@@ -95,7 +95,7 @@

 macro( marble_add_test TEST_NAME )
     if( BUILD_MARBLE_TESTS )
-        set( ${TEST_NAME}_SRCS ${TEST_NAME}.cpp )
+        set( ${TEST_NAME}_SRCS ${TEST_NAME}.cpp ${ARGN})
         if( QTONLY )
             qt4_generate_moc( ${TEST_NAME}.cpp ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.moc )
             include_directories( ${CMAKE_CURRENT_BINARY_DIR} )


Auto-activate-on-diffusion-app-on

Auto-activate-on-diffusion-app-on

--- Applications/Diffusion/target_libraries.cmake
+++ Applications/Diffusion/target_libraries.cmake
@@ -20,4 +20,5 @@
   org_mitk_gui_qt_measurementtoolbox
   org_mitk_gui_qt_basicimageprocessing
   org_mitk_gui_qt_registration
+  org_mitk_gui_qt_candystore
 )


Disable hunter use by forge from ArrayFire

This would result in developer to isntall forge dependencies
manually.
The following are the dependencies required:
* glbinding
* glfw3
* glm
* freetype
* boost(headers only, not need of libs)
* fontconfig(on non-Windows platforms)

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -40,7 +40,6 @@
       -DCMAKE_CXX_FLAGS:STRING=${disable_warning_flags}
       -DFG_BUILD_EXAMPLES:BOOL=OFF
       -DFG_BUILD_DOCS:BOOL=OFF
-      $<$<BOOL:${UNIX}>:-DFG_ENABLE_HUNTER:BOOL=ON>
       -DFG_WITH_FREEIMAGE:BOOL=OFF
       -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_SHARED_LINKER_FLAGS}
     )


Changed cmake message.

Changed cmake message.

--- CMakeModules/FindTacentProjectUtilities.cmake
+++ CMakeModules/FindTacentProjectUtilities.cmake
@@ -65,7 +65,7 @@

 function(tacent_install PROJNAME)
 	set(TACENT_INSTALL_DIR "${CMAKE_BINARY_DIR}/Install")
-	message(STATUS "Tacent -- ${PROJECT_NAME} being installed to ${TACENT_INSTALL_DIR}")
+	message(STATUS "Tacent -- ${PROJECT_NAME} will be installed to ${TACENT_INSTALL_DIR}")

 	install(
 		TARGETS ${PROJNAME}


Fix for windows build: cmake doesn't like backslashes :-(

--- cmake/sign.cmake
+++ cmake/sign.cmake
@@ -2,8 +2,8 @@
   IF(WITH_SIGNCODE)
     IF(WIN32)
       SET(target_file $<TARGET_FILE:${target}>)
-      IF(EXISTS "C:\tools\sign.bat")
-        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND c:\tools\sign.bat ${target_file})
+      IF(EXISTS "/tools/sign.bat")
+        ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND /tools/sign.bat ARGS ${target_file})
       ELSEIF()
         ADD_CUSTOM_COMMAND(TARGET ${target} COMMAND signtool ARGS sign ${SIGN_OPTIONS} ${target_file})
       ENDIF()


Disable Clang warning

Disable Clang warning

--- cmake/DevBaseCompiler.cmake
+++ cmake/DevBaseCompiler.cmake
@@ -46,6 +46,8 @@

 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
         CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    # Handle case where C++ compiler is gcc or clang.
+
     # TODO Figure this out:
     # https://gcc.gnu.org/wiki/Visibility

@@ -62,9 +64,6 @@
     # TODO Maybe add:
     # -Wconversion
     # -Wsign-conversion
-    set(CMAKE_C_FLAGS
-        "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual -Wwrite-strings -Werror=strict-aliasing -fno-strict-overflow -Wno-unused-parameter"
-    )
     set(CMAKE_CXX_FLAGS
         "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual -Wwrite-strings -Werror=strict-aliasing -fno-strict-overflow -ftemplate-backtrace-limit=0"
     )
@@ -100,12 +99,22 @@
             endif()
         endif()
     endif()
+
 elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+    # Handle case where C++ compiler is msvc.
+
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_SCL_SECURE_NO_WARNINGS /wd4101")
+
 endif()

 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+    # Handle case where C compiler is gcc and not clang.
+
+    set(CMAKE_C_FLAGS
+        "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Wcast-qual -Wwrite-strings -Werror=strict-aliasing -fno-strict-overflow -Wno-unused-parameter"
+    )
+
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")

     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -U_FORTIFY_SOURCE")
@@ -117,6 +126,8 @@

 if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+    # Handle case where C++ compiler is gcc and not clang.
+
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -U_FORTIFY_SOURCE")
@@ -124,8 +135,18 @@
     # Make linker report any unresolved symbols.
     set(CMAKE_SHARED_LINKER_FLAGS
         "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+
 elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    # Handle case where C++ compiler is clang and not gcc.
+
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
+
+    check_cxx_compiler_flag("-Wno-vla-extension"
+        CXX_SUPPORTS_NO_VLA_EXTENSION)
+
+    if (CXX_SUPPORTS_NO_VLA_EXTENSION)
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla-extension")
+    endif ()
 endif()


Squashed '3rdparty/github/cmake-utils-remote/' changes from 25ce7aa..09fb2f1

09fb2f1 Install of export file

git-subtree-dir: 3rdparty/github/cmake-utils-remote
git-subtree-split: 09fb2f1cedb15ae589b536398325e515cf7a6c8f

--- cmake/MyPackageExport.cmake
+++ cmake/MyPackageExport.cmake
@@ -10,5 +10,7 @@
     EXPORT_FILE_NAME "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h"
     STATIC_DEFINE ${PROJECT_NAME}_STATIC)
   ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
+  INSTALL(FILES ${_file} DESTINATION ${_dir})
+  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})

 ENDMACRO()


Install of export file bis

Install of export file bis

--- cmake/MyPackageExport.cmake
+++ cmake/MyPackageExport.cmake
@@ -11,6 +11,6 @@
     STATIC_DEFINE ${PROJECT_NAME}_STATIC)
   ADD_CUSTOM_TARGET(${PROJECT_NAME}Export SOURCES "${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h")
   INSTALL(FILES ${_file} DESTINATION ${_dir})
-  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION ${PROJECT_NAME})
+  INSTALL (FILES ${INCLUDE_OUTPUT_PATH}/${PROJECT_NAME}/export.h DESTINATION include/${PROJECT_NAME}/)

 ENDMACRO()


update

update

--- cmake/SetupTestConfig.cmake
+++ cmake/SetupTestConfig.cmake
@@ -6,8 +6,10 @@
 #                                                                                #
 ####################################################################################################

-SET(CTEST_PROJECT_NAME    "DCS08961")
-SET(CTEST_DROP_METHOD     "http")
-SET(CTEST_DROP_SITE       "www.cdash.org")
-SET(CTEST_DROP_LOCATION   "/CDash/submit.php?project=DCS08961")
-SET(CTEST_DROP_SITE_CDASH TRUE)
+SET(CTEST_PROJECT_NAME       "DCS08961")
+SET(CTEST_NIGHTLY_START_TIME "01:00:00 EST")
+SET(CTEST_DROP_METHOD        "http")
+SET(CTEST_DROP_SITE          "www.cdash.org")
+SET(CTEST_DROP_LOCATION      "/CDash/submit.php?project=${CTEST_PROJECT_NAME}")
+SET(CTEST_DROP_SITE_CDASH    TRUE)
+SET(CTEST_USE_LAUNCHERS      0)


cmake: fix path in comment

cmake: fix path in comment

Use correct path for soc in the comment.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -563,7 +563,7 @@
 endif()

 # Use SOC to search for a 'CMakeLists.txt' file.
-# e.g. zephyr/soc/xtense/intel_apl_adsp/CMakeLists.txt.
+# e.g. zephyr/soc/xtensa/intel_adsp/CMakeLists.txt.
 foreach(root ${SOC_ROOT})
   # Check that the root looks reasonable.
   if(NOT IS_DIRECTORY "${root}/soc")


Set MKLROOT when building MKLDNN (#1093)

* finally have something almost acceptable

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -41,6 +41,38 @@
     return()
 endif()

+# This section sets up MKL as an external project to be used later by MKLDNN
+
+set(MKLURLROOT "https://github.com/intel/mkl-dnn/releases/download/v0.14/")
+set(MKLVERSION "2018.0.3.20180406")
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
+    set(MKLPACKAGE "mklml_lnx_${MKLVERSION}.tgz")
+    set(MKL_SHA1_HASH aea0d9ce65773cfcf5d8292b8db553bde965fc8f)
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+    set(MKLPACKAGE "mklml_mac_${MKLVERSION}.tgz")
+    set(MKL_SHA1_HASH d76083fd5a79767a96572ad0e23e7f4c892818f2)
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+    set(MKLPACKAGE "mklml_win_${MKLVERSION}.tgz")
+    set(MKL_SHA1_HASH d607ca92d7bfc101f0828c0b005098b75531669b)
+endif()
+set(MKLURL ${MKLURLROOT}${MKLPACKAGE})
+
+ExternalProject_Add(
+    ext_mkl
+    PREFIX mkl
+    URL ${MKLURL}
+    URL_HASH SHA1=${MKL_SHA1_HASH}
+    CONFIGURE_COMMAND ""
+    BUILD_COMMAND ""
+    INSTALL_COMMAND ""
+    UPDATE_COMMAND ""
+    DOWNLOAD_NO_PROGRESS TRUE
+    EXCLUDE_FROM_ALL TRUE
+)
+ExternalProject_Get_Property(ext_mkl source_dir)
+set(MKL_ROOT ${EXTERNAL_PROJECTS_ROOT}/mkldnn/src/external/mkl)
+set(MKL_SOURCE_DIR ${source_dir})
+
 set(MKLDNN_GIT_REPO_URL https://github.com/intel/mkl-dnn)
 set(MKLDNN_GIT_TAG "0e7ca73")

@@ -48,6 +80,33 @@
 if(${CMAKE_VERSION} VERSION_LESS 3.2)
     ExternalProject_Add(
         ext_mkldnn
+        DEPENDS ext_mkl
+        GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
+        GIT_TAG ${MKLDNN_GIT_TAG}
+        UPDATE_COMMAND ""
+        CONFIGURE_COMMAND
+        # Uncomment below with any in-flight MKL-DNN patches
+        # PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
+        CMAKE_ARGS
+            -DWITH_TEST=FALSE
+            -DWITH_EXAMPLE=FALSE
+            -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+            -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
+            -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+            -DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/mkldnn
+            -DMKLROOT=${MKL_ROOT}
+        TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/tmp"
+        STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/stamp"
+        DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/download"
+        SOURCE_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/src"
+        BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/build"
+        INSTALL_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn"
+        EXCLUDE_FROM_ALL TRUE
+        )
+else()
+    ExternalProject_Add(
+        ext_mkldnn
+        DEPENDS ext_mkl
         GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
         GIT_TAG ${MKLDNN_GIT_TAG}
         UPDATE_COMMAND ""
@@ -60,29 +119,7 @@
             -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
             -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
             -DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/mkldnn
-        TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/tmp"
-        STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/stamp"
-        DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/download"
-        SOURCE_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/src"
-        BINARY_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/build"
-        INSTALL_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn"
-        EXCLUDE_FROM_ALL TRUE
-        )
-else()
-    ExternalProject_Add(
-        ext_mkldnn
-        GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
-        GIT_TAG ${MKLDNN_GIT_TAG}
-        UPDATE_COMMAND ""
-        # Uncomment below with any in-flight MKL-DNN patches
-        # PATCH_COMMAND patch -p1 < ${CMAKE_SOURCE_DIR}/third-party/patches/mkldnn-cmake-openmp.patch
-        CMAKE_ARGS
-            -DWITH_TEST=FALSE
-            -DWITH_EXAMPLE=FALSE
-            -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-            -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-            -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-            -DCMAKE_INSTALL_PREFIX=${EXTERNAL_PROJECTS_ROOT}/mkldnn
+            -DMKLROOT=${MKL_ROOT}
         TMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/tmp"
         STAMP_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/stamp"
         DOWNLOAD_DIR "${EXTERNAL_PROJECTS_ROOT}/mkldnn/download"
@@ -94,12 +131,10 @@
         )
 endif()

-ExternalProject_Get_Property(ext_mkldnn source_dir binary_dir)
-
 ExternalProject_Add_Step(
     ext_mkldnn
     PrepareMKL
-    COMMAND ${source_dir}/scripts/prepare_mkl.sh
+    COMMAND ${CMAKE_COMMAND} -E copy_directory ${MKL_SOURCE_DIR} ${MKL_ROOT}
     DEPENDEES download
     DEPENDERS configure
     )


[cmake] set default build type to "Release"

--- cmake/iDynTreeOptions.cmake
+++ cmake/iDynTreeOptions.cmake
@@ -63,3 +63,13 @@
 if(IDYNTREE_USES_SEMANTICS)
     add_definitions(-DIDYNTREE_USES_SEMANTICS)
 endif(IDYNTREE_USES_SEMANTICS)
+
+#set default build type to "Release" in single-config generators
+if(NOT CMAKE_CONFIGURATION_TYPES)
+    if(NOT CMAKE_BUILD_TYPE)
+    set(CMAKE_BUILD_TYPE "Release" CACHE STRING
+        "Choose the type of build, recommanded options are: Debug or Release" FORCE)
+    endif()
+    set(IDYNTREE_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
+    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${IDYNTREE_BUILD_TYPES})
+endif()


Enclose CLANG_USED_LIBS in --start/end-group when linking liblldb (bug #24044)

Patch by Eugene Zelenko.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@241576 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -67,7 +67,13 @@
     lldb_link_common_libs(${name} "${libkind}")

-    target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_USED_LIBS})
+    target_link_libraries(${name})
+    if (COMPILER_SUPPORTS_GROUPS)
+        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC}
+                    -Wl,--start-group ${CLANG_USED_LIBS} -Wl,--end-group)
+    else()
+        target_link_libraries(${name} ${cmake_2_8_12_PUBLIC} ${CLANG_USED_LIBS})
+    endif()
     llvm_config(${name} ${LLVM_LINK_COMPONENTS})

     if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "liblldb")


[CMake] Remove old lldb_setup_framework_rpaths_in_tool()

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -170,43 +170,6 @@
   set_target_properties(${target_name} PROPERTIES LINK_FLAGS ${new_link_flags})
 endfunction()

-# For tools that depend on liblldb, account for varying directory structures in
-# which LLDB.framework can be used and distributed: In the build-tree we find it
-# by its absolute target path. This is only relevant for running the test suite.
-# In the install step CMake will remove this entry and insert the final RPATHs.
-# These are relative to the file path from where the tool will be loaded on the
-# enduser system.
-#
-# Note that the LLVM install-tree doesn't match the enduser system structure
-# for LLDB.framework, so by default dependent tools will not be functional in
-# their install location. The LLDB_FRAMEWORK_INSTALL_DIR variable allows to fix
-# this. If specified, it causes the install-tree location of the framework to be
-# added as an extra RPATH below.
-#
-function(lldb_setup_framework_rpaths_in_tool name)
-  # In the build-tree, we know the exact path to the binary in the framework.
-  set(rpath_build_tree "$<TARGET_FILE:liblldb>")
-
-  # The installed framework is relocatable and can be in different locations.
-  set(rpaths_install_tree "@loader_path/../../../SharedFrameworks")
-  list(APPEND rpaths_install_tree "@loader_path/../../System/Library/PrivateFrameworks")
-  list(APPEND rpaths_install_tree "@loader_path/../../Library/PrivateFrameworks")
-
-  if(LLDB_FRAMEWORK_INSTALL_DIR)
-    set(rpaths_install_tree "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
-  endif()
-
-  # If LLDB_NO_INSTALL_DEFAULT_RPATH was NOT enabled (default), this overwrites
-  # the default settings from llvm_setup_rpath().
-  set_target_properties(${name} PROPERTIES
-    BUILD_WITH_INSTALL_RPATH OFF
-    BUILD_RPATH "${rpath_build_tree}"
-    INSTALL_RPATH "${rpaths_install_tree}"
-  )
-
-  add_dependencies(${name} lldb-framework)
-endfunction()
-
 # Unified handling for executable LLDB.framework resources. Given the name of an
 # executable target, this function adds a post-build step to copy it to the
 # framework bundle in the build-tree.


detabify

detabify

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -66,8 +66,8 @@
       set_target_properties( ${name} PROPERTIES EXCLUDE_FROM_ALL ON)
     else()
       install(TARGETS ${name}
-	LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-	ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+        LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+        ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
     endif()
   endif()


[CMake] build correctly if build path contains whitespace

The add_llvm_symbol_exports function in AddLLVM.cmake creates command
line link flags with paths containing CMAKE_CURRENT_BINARY_DIR, but that
will break if CMAKE_CURRENT_BINARY_DIR contains whitespace. This patch
adds quotes to those paths.

Fixes PR39843.

Patch by John Garvin.

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -73,7 +73,7 @@
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS " -Wl,-exported_symbols_list,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+                 LINK_FLAGS " -Wl,-exported_symbols_list,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES "AIX")
     set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                  LINK_FLAGS " -Wl,-bE:${export_file}")
@@ -93,10 +93,10 @@
       COMMENT "Creating export file for ${target_name}")
     if (${LLVM_LINKER_IS_SOLARISLD})
       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                   LINK_FLAGS "  -Wl,-M,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+                   LINK_FLAGS "  -Wl,-M,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
     else()
       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                   LINK_FLAGS "  -Wl,--version-script,${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+                   LINK_FLAGS "  -Wl,--version-script,\"${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}\"")
     endif()
   else()
     set(native_export_file "${target_name}.def")


BUG: Fix location of CMakeOutput.log and CMakeError.log.

--- Utilities/kwsys/kwsysPlatformCxxTests.cmake
+++ Utilities/kwsys/kwsysPlatformCxxTests.cmake
@@ -8,11 +8,11 @@
       OUTPUT_VARIABLE OUTPUT)
     IF(${var}_COMPILED)
       FILE(APPEND
-        ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
+        ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
         "${description} compiled with the following output:\n${OUTPUT}\n\n")
     ELSE(${var}_COMPILED)
       FILE(APPEND
-        ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
+        ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
         "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
     ENDIF(${var}_COMPILED)
     IF(${invert} MATCHES INVERT)


Build gtest with CMAKE_BUILD_TYPE=Release

--- cmake/gtest.cmake
+++ cmake/gtest.cmake
@@ -1,5 +1,6 @@
 find_package(Threads)
 find_package(GTest QUIET)
+
 if(NOT GTEST_FOUND)
   message(STATUS "Building own gtest")

@@ -10,7 +11,7 @@
     URL_HASH SHA256=b58cb7547a28b2c718d1e38aee18a3659c9e3ff52440297e965f5edffe34b6d0
     PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gtest-1.7.0
     CMAKE_ARGS
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+      -DCMAKE_BUILD_TYPE=Release
       -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
     INSTALL_COMMAND ""


QHY/Linux - fix linux version check

QHY/Linux - fix linux version check

--- thirdparty/thirdparty.cmake
+++ thirdparty/thirdparty.cmake
@@ -1360,7 +1360,8 @@
         ERROR_QUIET
         )
       # temporarily disable qhy camera pending fix for link error on Ubuntu Trusty
-      if((${LSB_RELEASE_ID} EQUAL "Ubuntu") AND (${LSB_RELEASE_RELEASE} EQUAL "14.04"))
+      if((${LSB_RELEASE_ID} STREQUAL "Ubuntu") AND (${LSB_RELEASE_RELEASE} STREQUAL "14.04"))
+        message(STATUS "Disabling QHY camera support on this platform")
         remove_definitions(-DHAVE_QHY_CAMERA=1)
       endif()
     endif()


Added some cmake options for emscripten

Added some cmake options for emscripten

--- cmake-toolchains/emscripten.toolchain.cmake
+++ cmake-toolchains/emscripten.toolchain.cmake
@@ -37,7 +37,18 @@
 set(FIPS_POSIX 1)

 # tweakable options
-option(FIPS_EMSCRIPTEN_USE_FS "Enable FS module on emscripten" OFF)
+option(FIPS_EMSCRIPTEN_USE_FS "emscripten: enable FS module" OFF)
+set(FIPS_EMSCRIPTEN_TOTAL_MEMORY 134217728 CACHE STRING "emscripten: total heap size in bytes")
+set(FIPS_EMSCRIPTEN_LTO_LEVEL 1 CACHE STRING "emscripten: Link-time-optimization level (0..3)")
+set(FIPS_EMSCRIPTEN_OUTLINING_LIMIT 20000 CACHE STRING "emscripten: outlining limit")
+set(FIPS_EMSCRIPTEN_MEM_INIT_METHOD 1 CACHE STRING "emscripten: how to represent initial memory content (0..2)")
+
+# memory-init-method also needs the --memory-init-file option
+if (${FIPS_EMSCRIPTEN_MEM_INIT_METHOD} STREQUAL 1)
+    set(EMSCRIPTEN_MEMORY_INIT_FLAG 1)
+else()
+    set(EMSCRIPTEN_MEMORY_INIT_FLAG 0)
+endif()

 # enable the emscripten tracer if profiling is enabled
 if (FIPS_PROFILING)
@@ -48,14 +59,8 @@
     set(EMSCRIPTEN_TRACING_OPTION "")
 endif()

-# total memory is 128MB for main thread, and 16 MB for worker
-# NOTE: USE_MEMORY_INIT_FILE has/had problems that the script is already starting but the MEM file isn't loaded yet(?)
-# at least I'm having weird startup problems...
-set(EMSCRIPTEN_TOTAL_MEMORY 134217728)
 set(EMSCRIPTEN_TOTAL_MEMORY_WORKER 16777216)
-set(EMSCRIPTEN_USE_MEMORY_INIT_FILE 1)
 set(EMSCRIPTEN_OPT "-O3")
-set(EMSCRIPTEN_LTO_LEVEL 1)
 if (FIPS_EMSCRIPTEN_USE_FS)
     set(EMSCRIPTEN_NO_FILESYSTEM 0)
 else()
@@ -65,7 +70,6 @@
 # disable closure for now, as long as ANGLE_instanced_array support is not fully supported in emscripten
 set(EMSCRIPTEN_USE_CLOSURE 0)
 set(EMSCRIPTEN_ASSERTIONS 0)
-set(EMSCRIPTEN_OUTLINING_LIMIT 20000)

 if (FIPS_COMPILE_VERBOSE)
     set(EMSCRIPTEN_BUILD_VERBOSE 1)
@@ -93,13 +97,13 @@
     set(FIPS_EMSC_RTTI_FLAGS "-fno-rtti")
 endif()

-message("EMSCRIPTEN_TOTAL_MEMORY: ${EMSCRIPTEN_TOTAL_MEMORY}")
+message("FIPS_EMSCRIPTEN_TOTAL_MEMORY: ${FIPS_EMSCRIPTEN_TOTAL_MEMORY}")
+message("FIPS_EMSCRIPTEN_LTO_LEVEL: ${FIPS_EMSCRIPTEN_LTO_LEVEL}")
+message("FIPS_EMSCRIPTEN_OUTLINING_LIMIT: ${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")
+message("FIPS_EMSCRIPTEN_MEM_INIT_METHOD: ${FIPS_EMSCRIPTEN_MEM_INIT_METHOD}")
 message("EMSCRIPTEN_TOTAL_MEMORY_WORKER: ${EMSCRIPTEN_TOTAL_MEMORY_WORKER}")
-message("EMSCRIPTEN_USE_MEMORY_INIT_FILE: ${EMSCRIPTEN_USE_MEMORY_INIT_FILE}")
-message("EMSCRIPTEN_LTO_LEVEL: ${EMSCRIPTEN_LTO_LEVEL}")
 message("EMSCRIPTEN_USE_CLOSURE: ${EMSCRIPTEN_USE_CLOSURE}")
 message("EMSCRIPTEN_ASSERTIONS: ${EMSCRIPTEN_ASSERTIONS}")
-message("EMSCRIPTEN_OUTLINING_LIMIT: ${EMSCRIPTEN_OUTLINING_LIMIT}")
 message("EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING: ${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING}")
 message("EMSCRIPTEN_NO_FILESYSTEM: ${EMSCRIPTEN_NO_FILESYSTEM}")
 message("EMSCRIPTEN_TRACING: ${EMSCRIPTEN_TRACING}")
@@ -195,19 +199,19 @@
 set(CMAKE_C_FLAGS_PROFILING "${EMSCRIPTEN_OPT} --profiling")

 # linker flags
-set(CMAKE_EXE_LINKER_FLAGS "${EMSCRIPTEN_CONFIG_OPTION} ${EMSCRIPTEN_CACHE_OPTION} ${EMSCRIPTEN_TRACING_OPTION} --memory-init-file ${EMSCRIPTEN_USE_MEMORY_INIT_FILE} -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY} -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
-set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${EMSCRIPTEN_OPT} --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
+set(CMAKE_EXE_LINKER_FLAGS "${EMSCRIPTEN_CONFIG_OPTION} ${EMSCRIPTEN_CACHE_OPTION} ${EMSCRIPTEN_TRACING_OPTION} --memory-init-file ${EMSCRIPTEN_MEMORY_INIT_FLAG} -s MEM_INIT_METHOD=${FIPS_EMSCRIPTEN_MEM_INIT_METHOD} -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${FIPS_EMSCRIPTEN_TOTAL_MEMORY} -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${EMSCRIPTEN_OPT} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${EMSCRIPTEN_OPT} -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE}")
-set(CMAKE_EXE_LINKER_FLAGS_PROFILING "--profiling ${EMSCRIPTEN_OPT} --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT}")
+set(CMAKE_EXE_LINKER_FLAGS_PROFILING "--profiling ${EMSCRIPTEN_OPT} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")

 # static library flags (for CMAKE_AR)
 set(CMAKE_STATIC_LINKER_FLAGS "${EMSCRIPTEN_CONFIG_OPTION}")

 # dynamic lib linker flags
-set(CMAKE_SHARED_LINKER_FLAGS "-shared ${EMSCRIPTEN_CONFIG_OPTIONS} ${EMSCRIPTEN_CACHE_OPTION} ${EMSCRIPTEN_TRACING_OPTION} --memory-init-file 0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY_WORKER} -s BUILD_AS_WORKER=1 -s EXPORTED_FUNCTIONS=[\\\"_dowork\\\"] -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
-set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${EMSCRIPTEN_OPT} --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
+set(CMAKE_SHARED_LINKER_FLAGS "-shared ${EMSCRIPTEN_CONFIG_OPTIONS} ${EMSCRIPTEN_CACHE_OPTION} ${EMSCRIPTEN_TRACING_OPTION} --memory-init-file 0 -s ERROR_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${FIPS_EMSCRIPTEN_TOTAL_MEMORY_WORKER} -s BUILD_AS_WORKER=1 -s EXPORTED_FUNCTIONS=[\\\"_dowork\\\"] -s DISABLE_EXCEPTION_CATCHING=${EMSCRIPTEN_DISABLE_EXCEPTION_CATCHING} -s NO_FILESYSTEM=${EMSCRIPTEN_NO_FILESYSTEM}")
+set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${EMSCRIPTEN_OPT} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${EMSCRIPTEN_OPT} -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} --closure 0")
-set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "--profiling ${EMSCRIPTEN_OPT} --llvm-lto ${EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT}")
+set(CMAKE_SHARED_LINKER_FLAGS_PROFILING "--profiling ${EMSCRIPTEN_OPT} --llvm-lto ${FIPS_EMSCRIPTEN_LTO_LEVEL} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${FIPS_EMSCRIPTEN_OUTLINING_LIMIT}")

 # update cache variables for cmake gui
 set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Config Type" FORCE)


Update FW: allow `StereoDepth` to work with `ColorCamera`s, without having to call `StereoDepth::setInputResolution`

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "e3345e17ac4cc49677480452154985c2682be334")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "5b4675066b28847d2ffc59f9117263df3fa55fcb")

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


FMUv4: config style

FMUv4: config style

--- cmake/configs/nuttx_px4fmu-v4_default.cmake
+++ cmake/configs/nuttx_px4fmu-v4_default.cmake
@@ -215,7 +215,6 @@
    sensor_baro
    )

-
 set(config_extra_builtin_cmds
 	serdis
 	sercon


Change the version of embedded davix to 0.6.3

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -981,7 +981,7 @@
     if(NOT davix)
       set(davix ON CACHE BOOL "" FORCE)
     endif()
-    set(DAVIX_VERSION 0.6.2)
+    set(DAVIX_VERSION 0.6.3)
     message(STATUS "Downloading and building Davix version ${DAVIX_VERSION}")
     string(REPLACE "-Wall " "" __cxxflags "${CMAKE_CXX_FLAGS}")                      # Otherwise it produces tones of warnings
     string(REPLACE "-W " "" __cxxflags "${__cxxflags}")


Add builtin_cfitsio option for Windows

Add builtin_cfitsio option for Windows

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -806,18 +806,39 @@
     string(REPLACE "." "" cfitsio_version_no_dots ${cfitsio_version})
     message(STATUS "Downloading and building CFITSIO version ${cfitsio_version}")
     set(CFITSIO_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfitsio${CMAKE_STATIC_LIBRARY_SUFFIX})
-    ExternalProject_Add(
-      CFITSIO
-      # ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz
-      URL ${lcgpackages}/cfitsio${cfitsio_version_no_dots}.tar.gz
-      URL_HASH SHA256=de8ce3f14c2f940fadf365fcc4a4f66553dd9045ee27da249f6e2c53e95362b3
-      INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
-      LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
-      BUILD_IN_SOURCE 1
-      BUILD_BYPRODUCTS ${CFITSIO_LIBRARIES}
-    )
-    set(CFITSIO_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
+    if(WIN32)
+      if(winrtdebug)
+        set(cfitsiobuild "Debug")
+      else()
+        set(cfitsiobuild "Release")
+      endif()
+      ExternalProject_Add(
+        CFITSIO
+        # ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz
+        URL http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfit3450.zip
+        URL_HASH SHA256=1d13073967654a48d47535ff33392656f252511ddf29059d7c7dc3ce8f2a1041
+        INSTALL_DIR ${CMAKE_BINARY_DIR}
+        CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+        BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${cfitsiobuild}
+        INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${cfitsiobuild}/cfitsio.dll <INSTALL_DIR>/bin
+        LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 BUILD_IN_SOURCE 0
+        BUILD_BYPRODUCTS ${CFITSIO_LIBRARIES}
+      )
+      set(CFITSIO_INCLUDE_DIR ${CMAKE_BINARY_DIR}/CFITSIO-prefix/src/CFITSIO)
+    else()
+      ExternalProject_Add(
+        CFITSIO
+        # ftp://heasarc.gsfc.nasa.gov/software/fitsio/c/cfitsio${cfitsio_version_no_dots}.tar.gz
+        URL ${lcgpackages}/cfitsio${cfitsio_version_no_dots}.tar.gz
+        URL_HASH SHA256=de8ce3f14c2f940fadf365fcc4a4f66553dd9045ee27da249f6e2c53e95362b3
+        INSTALL_DIR ${CMAKE_BINARY_DIR}
+        CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR>
+        LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
+        BUILD_IN_SOURCE 1
+        BUILD_BYPRODUCTS ${CFITSIO_LIBRARIES}
+      )
+      set(CFITSIO_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)
+    endif()
     set(fitsio ON CACHE BOOL "Enabled because builtin_cfitsio requested (${fitsio_description})" FORCE)
     set(CFITSIO_TARGET CFITSIO)
   else()


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

This reverts commit 901f8d96f09fdae0f002feae54369b4f69ca213e.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1350,21 +1350,16 @@
   if(vc)
     set(VecCore_COMPONENTS Vc)
   endif()
-  if(fail-on-missing)
-    find_package(VecCore 0.4.2 CONFIG QUIET REQUIRED COMPONENTS ${VecCore_COMPONENTS})
-  else()
-    find_package(VecCore 0.4.2 CONFIG QUIET COMPONENTS ${VecCore_COMPONENTS})
-    if(NOT VecCore_FOUND)
-      message(STATUS "VecCore not found, switching on 'builtin_veccore' option.")
-      set(builtin_veccore ON CACHE BOOL "" FORCE)
-    endif()
-  endif()
-  if(VecCore_FOUND)
+  find_package(VecCore 0.4.2 CONFIG QUIET COMPONENTS ${VecCore_COMPONENTS})
+  if(NOT VecCore_FOUND)
+    message(STATUS "VecCore not found, switching on 'builtin_veccore' option.")
+    set(builtin_veccore ON CACHE BOOL "" FORCE)
+  else()
     set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES ${VecCore_INCLUDE_DIRS})
   endif()
 endif()

-if(builtin_veccore)
+if(veccore AND NOT VecCore_FOUND)
   set(VecCore_VERSION "0.4.2")
   set(VecCore_PROJECT "VecCore-${VecCore_VERSION}")
   set(VecCore_SRC_URI "${lcgpackages}/${VecCore_PROJECT}.tar.gz")


Handle empty AVAILABLE_VERSIONS

Handle empty AVAILABLE_VERSIONS

--- cmake/modules/hunter_get_package_sha1.cmake
+++ cmake/modules/hunter_get_package_sha1.cmake
@@ -24,7 +24,6 @@

   hunter_assert_not_empty_string("${x_PACKAGE}")
   hunter_assert_not_empty_string("${x_VERSION}")
-  hunter_assert_not_empty_string("${x_AVAILABLE_VERSIONS}")
   hunter_assert_not_empty_string("${x_OUT}")

   set(user_sha1 "${__HUNTER_FINAL_SHA1_${x_PACKAGE}}")
@@ -39,10 +38,12 @@
   elseif(NOT hunter_sha1 STREQUAL "")
     set("${x_OUT}" "${hunter_sha1}" PARENT_SCOPE)
   else()
-    hunter_status_debug("Available versions:")
-    foreach(version ${x_AVAILABLE_VERSIONS})
-      hunter_status_debug("* ${version}")
-    endforeach()
+    if(NOT "${x_AVAILABLE_VERSIONS}" STREQUAL "")
+      hunter_status_debug("Available versions:")
+      foreach(version ${x_AVAILABLE_VERSIONS})
+        hunter_status_debug("* ${version}")
+      endforeach()
+    endif()

     hunter_user_error(
         "Version not found: ${x_VERSION}. Please check 'hunter_config' command."


DoxyGen: Made IVW_DOXY_OUT a cache varaible so the output location can be manually specified

--- tools/doxygen/doxygen.cmake
+++ tools/doxygen/doxygen.cmake
@@ -112,7 +112,7 @@
     )

     ivw_make_documentation(
-        "${ivw_doxy_out}"
+        "${IVW_DOXY_OUT}"
         "Help"
         "Inviwo help"
         "${SOURCE_LIST}"
@@ -139,21 +139,21 @@
         "</QHelpCollectionProject>"
     )
     string(REPLACE ";" "\n" INV_QHCP ${INV_QHCP})
-    file(WRITE "${ivw_doxy_out}/help/inviwo.qhcp" ${INV_QHCP})
+    file(WRITE "${IVW_DOXY_OUT}/help/inviwo.qhcp" ${INV_QHCP})

     add_custom_target("DOXY-QCH"
         COMMAND ${CMAKE_COMMAND} -E echo "Clean unused files"
-        COMMAND ${CMAKE_COMMAND} -P "${ivw_doxy_out}/clean_help.cmake"
+        COMMAND ${CMAKE_COMMAND} -P "${IVW_DOXY_OUT}/clean_help.cmake"
         COMMAND ${CMAKE_COMMAND} -E echo "Building inviwo.qch"
-        COMMAND ${CMAKE_COMMAND} -E echo "Running: ${IVW_DOXY_QHELPGENERATOR} -o ${ivw_doxy_out}/help/inviwo.qch ${ivw_doxy_out}/help/html/index.qhp"
-        COMMAND ${IVW_DOXY_QHELPGENERATOR} "-o" "${ivw_doxy_out}/help/inviwo.qch" "${ivw_doxy_out}/help/html/index.qhp"
+        COMMAND ${CMAKE_COMMAND} -E echo "Running: ${IVW_DOXY_QHELPGENERATOR} -o ${IVW_DOXY_OUT}/help/inviwo.qch ${IVW_DOXY_OUT}/help/html/index.qhp"
+        COMMAND ${IVW_DOXY_QHELPGENERATOR} "-o" "${IVW_DOXY_OUT}/help/inviwo.qch" "${IVW_DOXY_OUT}/help/html/index.qhp"
         COMMAND ${CMAKE_COMMAND} -E echo "Building inviwo.qhc"
-        COMMAND ${CMAKE_COMMAND} -E echo "Running: ${IVW_DOXY_QCOLLECTIONGENERATOR} -o ${ivw_doxy_out}/help/inviwo.qhc ${ivw_doxy_out}/help/inviwo.qhcp"
-        COMMAND ${IVW_DOXY_QCOLLECTIONGENERATOR} "-o" "${ivw_doxy_out}/help/inviwo.qhc" "${ivw_doxy_out}/help/inviwo.qhcp"
-        COMMAND ${CMAKE_COMMAND} -E echo "Copy ${ivw_doxy_out}/help/inviwo.q* to ${IVW_ROOT_DIR}/data/help/"
-        COMMAND ${CMAKE_COMMAND} -E copy "${ivw_doxy_out}/help/inviwo.qch" "${IVW_ROOT_DIR}/data/help/"
-        COMMAND ${CMAKE_COMMAND} -E copy "${ivw_doxy_out}/help/inviwo.qhc" "${IVW_ROOT_DIR}/data/help/"
-        COMMAND ${CMAKE_COMMAND} -E copy "${ivw_doxy_out}/help/inviwo.qhcp" "${IVW_ROOT_DIR}/data/help/"
+        COMMAND ${CMAKE_COMMAND} -E echo "Running: ${IVW_DOXY_QCOLLECTIONGENERATOR} -o ${IVW_DOXY_OUT}/help/inviwo.qhc ${IVW_DOXY_OUT}/help/inviwo.qhcp"
+        COMMAND ${IVW_DOXY_QCOLLECTIONGENERATOR} "-o" "${IVW_DOXY_OUT}/help/inviwo.qhc" "${IVW_DOXY_OUT}/help/inviwo.qhcp"
+        COMMAND ${CMAKE_COMMAND} -E echo "Copy ${IVW_DOXY_OUT}/help/inviwo.q* to ${IVW_ROOT_DIR}/data/help/"
+        COMMAND ${CMAKE_COMMAND} -E copy "${IVW_DOXY_OUT}/help/inviwo.qch" "${IVW_ROOT_DIR}/data/help/"
+        COMMAND ${CMAKE_COMMAND} -E copy "${IVW_DOXY_OUT}/help/inviwo.qhc" "${IVW_ROOT_DIR}/data/help/"
+        COMMAND ${CMAKE_COMMAND} -E copy "${IVW_DOXY_OUT}/help/inviwo.qhcp" "${IVW_ROOT_DIR}/data/help/"

         WORKING_DIRECTORY ${OUTPUT_DIR}
         COMMENT "Generating QCH files"
@@ -183,7 +183,7 @@
     endif()

     set(ivw_doxy_dir ${IVW_ROOT_DIR}/tools/doxygen)
-    set(ivw_doxy_out ${CMAKE_CURRENT_BINARY_DIR}/doc)
+    set(IVW_DOXY_OUT "${CMAKE_CURRENT_BINARY_DIR}/doc" CACHE PATH "Path to put the doxygen output")
     set(tag_files "")
     set(dependency_list "")

@@ -223,19 +223,19 @@

     # Group target
     add_custom_target("DOXY-ALL"
-        WORKING_DIRECTORY ${ivw_doxy_out}
+        WORKING_DIRECTORY ${IVW_DOXY_OUT}
         COMMENT "Generating ALL API documentation with Doxygen"
         VERBATIM
     )
     set_target_properties("DOXY-ALL" PROPERTIES FOLDER "doc" EXCLUDE_FROM_ALL TRUE)

     # Core
-    set(core_tag "${ivw_doxy_out}/core/ivwcore.tag")
-    ivw_make_documentation(
-        "${ivw_doxy_out}"
+    set(core_tag "${IVW_DOXY_OUT}/core/ivwcore.tag")
+    ivw_make_documentation(
+        "${IVW_DOXY_OUT}"
         "Core"
         "Core functionality of Inviwo"
-        "${IVW_CORE_INCLUDE_DIR};${IVW_CORE_SOURCE_DIR}"
+        "${IVW_CORE_INCLUDE_DIR};${IVW_CORE_SOURCE_DIR};${IVW_ROOT_DIR}/docs"
         "${core_tag}"
         "${tag_files}"
         "${extra_files}"
@@ -244,13 +244,13 @@
         ""
     )
     list(APPEND dependency_list "DOXY-Core")
-    list(APPEND tag_files "${core_tag}=${ivw_doxy_out}/core/html")
+    list(APPEND tag_files "${core_tag}=${IVW_DOXY_OUT}/core/html")

     # Ot
-    set(qt_tag "${ivw_doxy_out}/qt/ivwqt.tag")
+    set(qt_tag "${IVW_DOXY_OUT}/qt/ivwqt.tag")
     #list(APPEND tag_files "qtcore.tags=http://qt-project.org/doc/qt-5/")
     ivw_make_documentation(
-        "${ivw_doxy_out}"
+        "${IVW_DOXY_OUT}"
         "Qt"
         "Main Qt elements of Inviwo"
         "${IVW_QT_INCLUDE_DIR};${IVW_QT_SOURCE_DIR}"
@@ -265,7 +265,7 @@
         add_dependencies("DOXY-Qt" ${depends})
     endforeach()
     list(APPEND dependency_list "DOXY-Qt")
-    list(APPEND tag_files "${qt_tag}=${ivw_doxy_out}/qt/html")
+    list(APPEND tag_files "${qt_tag}=${IVW_DOXY_OUT}/qt/html")

     # Modules
     set(module_bases "")
@@ -293,9 +293,9 @@
             endif()
         endforeach()

-        set(module_tag "${ivw_doxy_out}/${desc_name_lower}/${desc_name_lower}.tag")
+        set(module_tag "${IVW_DOXY_OUT}/${desc_name_lower}/${desc_name_lower}.tag")
         ivw_make_documentation(
-            "${ivw_doxy_out}"
+            "${IVW_DOXY_OUT}"
             "${desc_name}"
             "Modules for ${desc_name}"
             "${inc_dirs}"
@@ -310,14 +310,14 @@
             add_dependencies("DOXY-${desc_name}" ${depends})
         endforeach()
         list(APPEND dependency_list "DOXY-${desc_name}")
-        list(APPEND tag_files "${module_tag}=${ivw_doxy_out}/${desc_name_lower}/html")
+        list(APPEND tag_files "${module_tag}=${IVW_DOXY_OUT}/${desc_name_lower}/html")
         MATH(EXPR index "${index}+1")
     endforeach()

     # Apps
-    set(app_tag "${ivw_doxy_out}/apps/ivwapps.tag")
-    ivw_make_documentation(
-        "${ivw_doxy_out}"
+    set(app_tag "${IVW_DOXY_OUT}/apps/ivwapps.tag")
+    ivw_make_documentation(
+        "${IVW_DOXY_OUT}"
         "Apps"
         "Applications using Inviwo Core and Modules"
         "${IVW_APPLICATION_DIR}"
@@ -332,7 +332,7 @@
         add_dependencies("DOXY-Apps" ${depends})
     endforeach()
     list(APPEND dependency_list "DOXY-Apps")
-    list(APPEND tag_files "${app_tag}={ivw_doxy_out}/apps/html")
+    list(APPEND tag_files "${app_tag}={IVW_DOXY_OUT}/apps/html")

     foreach(depends "${dependency_list}")
         add_dependencies("DOXY-ALL" ${depends})
@@ -341,7 +341,7 @@

     # All In one.
     ivw_make_documentation(
-        "${ivw_doxy_out}"
+        "${IVW_DOXY_OUT}"
         "Inviwo"
         "Inviwo documentation"
         "${all_sources}"
@@ -374,12 +374,12 @@
         "endforeach()"
     )
     string(REPLACE ";" "\n" COPY_SCRIPT "${COPY_SCRIPT_LIST}")
-    file(WRITE "${ivw_doxy_out}/copy_img.cmake" ${COPY_SCRIPT})
+    file(WRITE "${IVW_DOXY_OUT}/copy_img.cmake" ${COPY_SCRIPT})

     # make a clean help script
     set(CLEAN_HELP_SCRIPT_LIST
-        "file(GLOB save \"${ivw_doxy_out}/help/html/docpage*.html\")"
-        "file(GLOB todelete \"${ivw_doxy_out}/help/html/*.js\" \"${ivw_doxy_out}/help/html/*.html\")"
+        "file(GLOB save \"${IVW_DOXY_OUT}/help/html/docpage*.html\")"
+        "file(GLOB todelete \"${IVW_DOXY_OUT}/help/html/*.js\" \"${IVW_DOXY_OUT}/help/html/*.html\")"
         "list(REMOVE_ITEM todelete \${save})"
         "foreach(item \${todelete})"
         "    message(\"Remove: \${item}\")"
@@ -387,6 +387,6 @@
         "endforeach()"
     )
     string(REPLACE ";" "\n" CLEAN_HELP_SCRIPT "${CLEAN_HELP_SCRIPT_LIST}")
-    file(WRITE "${ivw_doxy_out}/clean_help.cmake" ${CLEAN_HELP_SCRIPT})
+    file(WRITE "${IVW_DOXY_OUT}/clean_help.cmake" ${CLEAN_HELP_SCRIPT})

  endfunction()


turn off cuda propogate host flags

turn off cuda propogate host flags

--- cmake/Dependencies.cmake
+++ cmake/Dependencies.cmake
@@ -110,7 +110,8 @@
 # ---[ CUDA
 include(cmake/Cuda.cmake)
 if(HAVE_CUDA)
-  LIST(APPEND CUDA_NVCC_FLAGS "-Xcompiler;-std=c++11")
+  SET(CUDA_PROPAGATE_HOST_FLAGS OFF)
+  LIST(APPEND CUDA_NVCC_FLAGS -Xcompiler -std=c++11)
   LIST(APPEND CUDA_NVCC_FLAGS -gencode arch=compute_52,code=sm_52)
 endif()


Fix bug 542: fix detection of compiler version on systems without the head command.

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -322,13 +322,21 @@
     endif()
   else()
     # on all other system we rely on ${CMAKE_CXX_COMPILER}
-    # supporting a "--version" flag
-    execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
-                    COMMAND head -n 1
-                    OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    # supporting a "--version" flag

-    ei_get_compilerver_from_cxx_version_string(${eigen_cxx_compiler_version_string} CNAME CVER)
+    # check whether the head command exists
+    find_program(HEAD_EXE head NO_CMAKE_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_SYSTEM_PATH)
+    if(HEAD_EXE)
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      COMMAND head -n 1
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+    else()
+      execute_process(COMMAND ${CMAKE_CXX_COMPILER} --version
+                      OUTPUT_VARIABLE eigen_cxx_compiler_version_string OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REGEX REPLACE "[\n\r].*"  ""  eigen_cxx_compiler_version_string  ${eigen_cxx_compiler_version_string})
+    endif()

+    ei_get_compilerver_from_cxx_version_string("${eigen_cxx_compiler_version_string}" CNAME CVER)
     set(${VAR} "${CNAME}-${CVER}")
   endif()
 endmacro(ei_get_compilerver)


fix SDL2_TTF_VERSION_STRING regexp

fix SDL2_TTF_VERSION_STRING regexp

before: SDL2_ttf.dll (found version "..")
after: SDL2_ttf.dll (found version "2.0.14")

`SDL_ttf.h` - Lines 42-46
```
/* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
*/
#define SDL_TTF_MAJOR_VERSION   2
#define SDL_TTF_MINOR_VERSION   0
#define SDL_TTF_PATCHLEVEL      14
```

--- cmake/FindSDL2_ttf.cmake
+++ cmake/FindSDL2_ttf.cmake
@@ -68,12 +68,12 @@
         )

 if (SDL2_TTF_INCLUDE_DIR AND EXISTS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h")
-    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
-    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL2_TTF_MINOR_VERSION[ \t]+[0-9]+$")
-    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL2_TTF_PATCHLEVEL[ \t]+[0-9]+$")
-    string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MAJOR "${SDL2_TTF_VERSION_MAJOR_LINE}")
-    string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MINOR "${SDL2_TTF_VERSION_MINOR_LINE}")
-    string(REGEX REPLACE "^#define[ \t]+SDL2_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_PATCH "${SDL2_TTF_VERSION_PATCH_LINE}")
+    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
+    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
+    file(STRINGS "${SDL2_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL2_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
+    string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MAJOR "${SDL2_TTF_VERSION_MAJOR_LINE}")
+    string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_MINOR "${SDL2_TTF_VERSION_MINOR_LINE}")
+    string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_TTF_VERSION_PATCH "${SDL2_TTF_VERSION_PATCH_LINE}")
     set(SDL2_TTF_VERSION_STRING ${SDL2_TTF_VERSION_MAJOR}.${SDL2_TTF_VERSION_MINOR}.${SDL2_TTF_VERSION_PATCH})
     unset(SDL2_TTF_VERSION_MAJOR_LINE)
     unset(SDL2_TTF_VERSION_MINOR_LINE)


fixed a bug in treecore cmake finder module

--- cmake/FindTreeCore.cmake
+++ cmake/FindTreeCore.cmake
@@ -2,8 +2,6 @@
 include(FindPackageHandleStandardArgs)
 include(TreeCoreConfig)
 include(GNUInstallDirs)
-
-find_package(TreeCoreBinBuilder)

 set(TREECORE_SEARCH_PREFIX $ENV{TREECORE_PREFIX} CACHE PATH "additional path to search for treecore")


fix cxxopts and ghc cross compilation issue

While cross compiling using openembedded yocto environment,
CXXOPTS_INCLUDE and GHC_INCLUDE variables remains empty because the search
path point to the openembedded sysroot instead of the current directory.
To avoid this situation, NO_CMAKE_FIND_ROOT_PATH must be added to the
find_path call.

Signed-off-by: Vincent ABRIOU <c7c94f60d544985b756f117e3ec96ca87688c906@st.com>
Change-Id: I3ba17a300d5ca7fbc58b6ec5c4eb15267dcee228

--- cmake/GlobalConfig.cmake
+++ cmake/GlobalConfig.cmake
@@ -142,13 +142,13 @@

 if (NOT BUILD_PIPE_ONLY)
   # cxxopts (Alternative to boost::program_options)
-  find_path(CXXOPTS_INCLUDE cxxopts/cxxopts.hpp PATHS third-party)
+  find_path(CXXOPTS_INCLUDE cxxopts/cxxopts.hpp PATHS third-party NO_CMAKE_FIND_ROOT_PATH)
   include_directories(SYSTEM "${CXXOPTS_INCLUDE}")
 endif()

 if (NOT BUILD_PIPE_ONLY)
   # ghc (Alternative to boost::filesystem)
-  find_path(GHC_INCLUDE ghc/filesystem.hpp PATHS third-party)
+  find_path(GHC_INCLUDE ghc/filesystem.hpp PATHS third-party NO_CMAKE_FIND_ROOT_PATH)
   include_directories(SYSTEM "${GHC_INCLUDE}")
 endif()


build: enable __STDC_FORMAT_MACROS macro

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -227,7 +227,7 @@
       project(${the_module})
       add_definitions(
         -D_USE_MATH_DEFINES  # M_PI constant in MSVS
-        -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS  # to use C libraries from C++ code (ffmpeg)
+        -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS  # to use C libraries from C++ code (ffmpeg)
       )
     endif()
   endif()