manually merged cmakeexternals and vtkm external project

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -6,118 +6,531 @@
 # of the external target to guard against duplicated targets.
 #
 function(require_external NAME)
-  if(NAME STREQUAL "libzmq" OR NAME STREQUAL "libcppzmq")
-    if(TARGET libzmq OR TARGET libcppzmq)
-      return()
+  set(FETCHCONTENT_QUIET ON CACHE BOOL "")
+  set(FETCHCONTENT_UPDATES_DISCONNECTED ON CACHE BOOL "")
+
+  # Header-only libraries #####################################################
+
+  # Delaunator
+  if(NAME STREQUAL "Delaunator")
+    if(TARGET Delaunator)
+      return()
+    endif()
+
+    add_external_headeronly_project(Delaunator
+      GIT_REPOSITORY https://github.com/delfrrr/delaunator-cpp.git
+      GIT_TAG "v0.4.0"
+      INCLUDE_DIR "include")
+
+  # Eigen
+  elseif(NAME STREQUAL "Eigen")
+    if(TARGET Eigen)
+      return()
+    endif()
+
+    add_external_headeronly_project(Eigen
+      GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
+      GIT_TAG "3.3.4")
+
+  # glm
+  elseif(NAME STREQUAL "glm")
+    if(TARGET glm)
+      return()
+    endif()
+
+    add_external_headeronly_project(glm
+      GIT_REPOSITORY https://github.com/g-truc/glm.git
+      GIT_TAG "0.9.8")
+
+  # glowl
+  elseif(NAME STREQUAL "glowl")
+    if(TARGET glowl)
+      return()
+    endif()
+
+    add_external_headeronly_project(glowl
+      GIT_REPOSITORY https://github.com/invor/glowl.git
+      GIT_TAG "v0.3"
+      INCLUDE_DIR "include")
+
+  # json
+  elseif(NAME STREQUAL "json")
+    if(TARGET json)
+      return()
+    endif()
+
+    add_external_headeronly_project(json
+      GIT_REPOSITORY https://github.com/azadkuh/nlohmann_json_release.git
+      GIT_TAG "v3.5.0")
+
+  # libcxxopts
+  elseif(NAME STREQUAL "libcxxopts")
+    if(TARGET libcxxopts)
+      return()
+    endif()
+
+    add_external_headeronly_project(libcxxopts
+      DEPENDS libzmq
+      GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
+      GIT_TAG "v2.1.1"
+      INCLUDE_DIR "include")
+
+  # mmpld_io
+  elseif(NAME STREQUAL "mmpld_io")
+    if(TARGET mmpld_io)
+      return()
+    endif()
+
+    add_external_headeronly_project(mmpld_io
+      GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/mmpld_io.git
+      INCLUDE_DIR "include")
+
+  # nanoflann
+  elseif(NAME STREQUAL "nanoflann")
+    if(TARGET nanoflann)
+      return()
+    endif()
+
+    add_external_headeronly_project(nanoflann
+      GIT_REPOSITORY https://github.com/jlblancoc/nanoflann.git
+      GIT_TAG "v1.3.0"
+      INCLUDE_DIR "include")
+
+  # Built libraries #####################################################
+
+  # adios2
+  elseif(NAME STREQUAL "adios2")
+    if(TARGET adios2)
+      return()
+    endif()
+
+    if(WIN32)
+      set(ADIOS2_IMPORT_LIB "lib/adios2.lib")
+      set(ADIOS2_LIB "bin/adios2.dll")
+    else()
+      include(GNUInstallDirs)
+      set(ADIOS2_IMPORT_LIB "${CMAKE_INSTALL_LIBDIR}/libadios2.so")
+      set(ADIOS2_LIB "${CMAKE_INSTALL_LIBDIR}/libadios2.so")
+    endif()
+
+    add_external_project(adios2
+      GIT_REPOSITORY https://github.com/ornladios/ADIOS2.git
+      GIT_TAG "v2.3.1"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ADIOS2_IMPORT_LIB}"
+      CMAKE_ARGS
+        -DBUILD_TESTING=OFF -DADIOS2_USE_BZip2=OFF
+        -DADIOS2_USE_Fortran=OFF -DADIOS2_USE_HDF5=OFF
+        -DADIOS2_USE_Python=OFF -DADIOS2_USE_SST=OFF
+        -DADIOS2_USE_SZ=OFF -DADIOS2_USE_SysVShMem=OFF
+        -DADIOS2_USE_ZFP=OFF -DADIOS2_USE_ZeroMQ=OFF
+        -DMPI_GUESS_LIBRARY_NAME=${MPI_GUESS_LIBRARY_NAME})
+
+    add_external_library(adios2 SHARED
+      IMPORT_LIBRARY ${ADIOS2_IMPORT_LIB}
+      LIBRARY ${ADIOS2_LIB})
+
+  # bhtsne
+  elseif(NAME STREQUAL "bhtsne")
+    if(TARGET bhtsne)
+      return()
+    endif()
+
+    set(BHTSNE_LIB_DEBUG "lib/${CMAKE_STATIC_LIBRARY_PREFIX}bhtsned${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(BHTSNE_LIB_RELEASE "lib/${CMAKE_STATIC_LIBRARY_PREFIX}bhtsne${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
+    add_external_project(bhtsne
+      GIT_REPOSITORY https://github.com/lvdmaaten/bhtsne.git
+      GIT_TAG "36b169c88250d0afe51828448dfdeeaa508f13bc"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/lib/${CMAKE_STATIC_LIBRARY_PREFIX}bhtsne<SUFFIX>${CMAKE_STATIC_LIBRARY_SUFFIX}"
+      DEBUG_SUFFIX d
+      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        "${CMAKE_SOURCE_DIR}/cmake/bhtsne/CMakeLists.txt"
+        "<SOURCE_DIR>/CMakeLists.txt")
+
+    add_external_library(bhtsne STATIC
+      LIBRARY_DEBUG ${BHTSNE_LIB_DEBUG}
+      LIBRARY_RELEASE ${BHTSNE_LIB_RELEASE})
+
+  # glfw3
+  elseif(NAME STREQUAL "glfw3")
+    if(TARGET glfw3)
+      return()
+    endif()
+
+    if (MSVC)
+      set(GLFW_PRODUCT "lib/glfw3dll.lib")
+      set(GLFW_IMPORT_LIBRARY "lib/glfw3dll.lib")
+      set(GLFW_LIBRARY "lib/glfw3.dll")
+    else()
+      set(GLFW_PRODUCT "lib/libglfw.so")
+      set(GLFW_IMPORT_LIBRARY "")
+      set(GLFW_LIBRARY "lib/libglfw.so")
+    endif()
+
+    add_external_project(glfw
+      GIT_REPOSITORY https://github.com/glfw/glfw.git
+      GIT_TAG "3.2.1"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${GLFW_PRODUCT}"
+      CMAKE_ARGS
+        -DBUILD_SHARED_LIBS=ON
+        -DGLFW_BUILD_EXAMPLES=OFF
+        -DGLFW_BUILD_TESTS=OFF
+        -DGLFW_BUILD_DOCS=OFF)
+
+    add_external_library(glfw3 SHARED
+      PROJECT glfw
+      IMPORT_LIBRARY ${GLFW_IMPORT_LIBRARY}
+      LIBRARY ${GLFW_LIBRARY})
+
+  # IceT
+  elseif(NAME STREQUAL "IceT")
+    if(TARGET IceTCore)
+      return()
+    endif()
+
+    if(WIN32)
+      set(ICET_CORE_PRODUCT "lib/IceTCore.lib")
+      set(ICET_CORE_IMPORT_LIB "lib/IceTCore.lib")
+      set(ICET_CORE_LIB "bin/IceTCore.dll")
+      set(ICET_GL_PRODUCT "lib/IceTGL.lib")
+      set(ICET_GL_IMPORT_LIB "lib/IceTGL.lib")
+      set(ICET_GL_LIB "bin/IceTGL.dll")
+      set(ICET_MPI_PRODUCT "lib/IceTMPI.lib")
+      set(ICET_MPI_IMPORT_LIB "lib/IceTMPI.lib")
+      set(ICET_MPI_LIB "bin/IceTMPI.dll")
+    else()
+      include(GNUInstallDirs)
+      set(ICET_CORE_PRODUCT "lib/libIceTCore.so")
+      set(ICET_CORE_LIB "lib/libIceTCore.so")
+      set(ICET_GL_PRODUCT "lib/libIceTGL.so")
+      set(ICET_GL_LIB "lib/libIceTGL.so")
+      set(ICET_MPI_PRODUCT "lib/libIceTMPI.so")
+      set(ICET_MPI_LIB "lib/libIceTMPI.so")
     endif()

-    set(ZMQ_VER "4_2_3")
+    add_external_project(IceT
+      GIT_REPOSITORY https://gitlab.kitware.com/icet/icet.git
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ICET_CORE_PRODUCT}" "<INSTALL_DIR>/${ICET_GL_PRODUCT}" "<INSTALL_DIR>/${ICET_MPI_PRODUCT}"
+      CMAKE_ARGS
+        -DBUILD_SHARED_LIBS=ON
+        -DICET_BUILD_TESTING=OFF
+        -DMPI_GUESS_LIBRARY_NAME=${MPI_GUESS_LIBRARY_NAME})
+
+    add_external_library(IceTCore SHARED
+      PROJECT IceT
+      IMPORT_LIBRARY_DEBUG ${ICET_CORE_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${ICET_CORE_IMPORT_LIB}
+      LIBRARY_DEBUG ${ICET_CORE_LIB}
+      LIBRARY_RELEASE ${ICET_CORE_LIB})
+
+    add_external_library(IceTGL SHARED
+      PROJECT IceT
+      IMPORT_LIBRARY_DEBUG ${ICET_GL_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${ICET_GL_IMPORT_LIB}
+      LIBRARY_DEBUG ${ICET_GL_LIB}
+      LIBRARY_RELEASE ${ICET_GL_LIB})
+
+    add_external_library(IceTMPI SHARED
+      PROJECT IceT
+      IMPORT_LIBRARY_DEBUG ${ICET_MPI_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${ICET_MPI_IMPORT_LIB}
+      LIBRARY_DEBUG ${ICET_MPI_LIB}
+      LIBRARY_RELEASE ${ICET_MPI_LIB})
+
+  # imgui
+  elseif(NAME STREQUAL "imgui")
+    if(TARGET imgui)
+      return()
+    endif()
+
+    set(IMGUI_LIB "lib/${CMAKE_STATIC_LIBRARY_PREFIX}imgui${CMAKE_STATIC_LIBRARY_SUFFIX}")
+
+    add_external_project(imgui
+      GIT_REPOSITORY https://github.com/ocornut/imgui.git
+      GIT_TAG "v1.70"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${IMGUI_LIB}"
+      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        "${CMAKE_SOURCE_DIR}/cmake/imgui/CMakeLists.txt"
+        "<SOURCE_DIR>/CMakeLists.txt")
+
+    external_get_property(imgui SOURCE_DIR)
+
+    add_external_library(imgui STATIC
+      LIBRARY ${IMGUI_LIB})
+
+    target_include_directories(imgui INTERFACE "${SOURCE_DIR}/examples" "${SOURCE_DIR}/misc/cpp")
+
+    set(imgui_files
+      "${SOURCE_DIR}/examples/imgui_impl_opengl3.cpp"
+      "${SOURCE_DIR}/examples/imgui_impl_opengl3.h"
+      "${SOURCE_DIR}/misc/cpp/imgui_stdlib.cpp"
+      "${SOURCE_DIR}/misc/cpp/imgui_stdlib.h"
+      PARENT_SCOPE)
+
+  # libpng
+  elseif(NAME STREQUAL "libpng")
+    if(TARGET libpng)
+      return()
+    endif()
+
+    require_external(zlib)
+
+    if(MSVC)
+      set(LIBPNG_PRODUCT "lib/libpng16_static<SUFFIX>${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(LIBPNG_DEBUG "lib/libpng16_staticd${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(LIBPNG_RELEASE "lib/libpng16_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    else()
+      include(GNUInstallDirs)
+      set(LIBPNG_PRODUCT "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}png16<SUFFIX>${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(LIBPNG_DEBUG "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}png16d${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(LIBPNG_RELEASE "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}png16${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    endif()
+
+    if(MSVC)
+      set(ZLIB_LIBRARY "lib/zlibstatic<SUFFIX>${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    else()
+      include(GNUInstallDirs)
+      set(ZLIB_LIBRARY "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    endif()
+
+    external_get_property(zlib INSTALL_DIR)
+
+    add_external_project(libpng
+      GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/libpng.git
+      GIT_TAG "v1.6.34"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${LIBPNG_PRODUCT}"
+      DEBUG_SUFFIX d
+      DEPENDS zlib_ext
+      CMAKE_ARGS
+        -DPNG_BUILD_ZLIB=ON
+        -DPNG_SHARED=OFF
+        -DPNG_TESTS=OFF
+        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+        -DZLIB_LIBRARY:PATH=${INSTALL_DIR}/${ZLIB_LIBRARY}
+        -DZLIB_INCLUDE_DIR:PATH=${INSTALL_DIR}/include
+        -DZLIB_VERSION_STRING:STRING=${ZLIB_VERSION_STRING}
+        -DZLIB_VERSION_MAJOR:STRING=${ZLIB_VERSION_MAJOR}
+        -DZLIB_VERSION_MINOR:STRING=${ZLIB_VERSION_MINOR}
+        -DZLIB_VERSION_PATCH:STRING=${ZLIB_VERSION_PATCH}
+        -DZLIB_VERSION_TWEAK:STRING=${ZLIB_VERSION_TWEAK}
+        -DZLIB_MAJOR_VERSION:STRING=${ZLIB_VERSION_MAJOR}
+        -DZLIB_MINOR_VERSION:STRING=${ZLIB_VERSION_MINOR}
+        -DZLIB_PATCH_VERSION:STRING=${ZLIB_VERSION_PATCH})
+
+    add_external_library(libpng STATIC
+      LIBRARY_DEBUG ${LIBPNG_DEBUG}
+      LIBRARY_RELEASE ${LIBPNG_RELEASE}
+      INTERFACE_LIBRARIES zlib)
+
+  # libzmq / libcppzmq
+  elseif(NAME STREQUAL "libzmq" OR NAME STREQUAL "libcppzmq")
+    if(TARGET libzmq)
+      return()
+    endif()
+
+    set(ZMQ_VER "4_3_3")
     string(REPLACE "_" "." ZMQ_TAG "v${ZMQ_VER}")
+
     if(MSVC_IDE)
       set(MSVC_TOOLSET "-${CMAKE_VS_PLATFORM_TOOLSET}")
     else()
       set(MSVC_TOOLSET "")
     endif()
-    if(WIN32)
+
+    if(WIN32)
+      set(ZMQ_PRODUCT "lib/libzmq${MSVC_TOOLSET}-mt<SUFFIX>-${ZMQ_VER}.lib")
       set(ZMQ_IMPORT_DEBUG "lib/libzmq${MSVC_TOOLSET}-mt-gd-${ZMQ_VER}.lib")
       set(ZMQ_IMPORT_RELEASE "lib/libzmq${MSVC_TOOLSET}-mt-${ZMQ_VER}.lib")
       set(ZMQ_DEBUG "bin/libzmq${MSVC_TOOLSET}-mt-gd-${ZMQ_VER}.dll")
       set(ZMQ_RELEASE "bin/libzmq${MSVC_TOOLSET}-mt-${ZMQ_VER}.dll")
     else()
       include(GNUInstallDirs)
+      set(ZMQ_PRODUCT "${CMAKE_INSTALL_LIBDIR}/libzmq.so")
       set(ZMQ_IMPORT_DEBUG "")
       set(ZMQ_IMPORT_RELEASE "")
       set(ZMQ_DEBUG "${CMAKE_INSTALL_LIBDIR}/libzmq.so")
       set(ZMQ_RELEASE ${ZMQ_DEBUG})
     endif()

-    add_external_project(libzmq_ext
+    add_external_project(libzmq
       GIT_REPOSITORY https://github.com/zeromq/libzmq.git
-      GIT_TAG ${ZMQ_TAG}
-      CMAKE_ARGS
-        -DZMQ_BUILD_TESTS=OFF)
-      add_external_library(libzmq SHARED
-      DEPENDS libzmq_ext
+      GIT_TAG 56ace6d03f521b9abb5a50176ec7763c1b77afa9
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ZMQ_PRODUCT}"
+      DEBUG_SUFFIX -gd
+      CMAKE_ARGS
+        -DZMQ_BUILD_TESTS=OFF
+        -DENABLE_PRECOMPILED=OFF)
+
+    add_external_library(libzmq SHARED
       IMPORT_LIBRARY_DEBUG ${ZMQ_IMPORT_DEBUG}
       IMPORT_LIBRARY_RELEASE ${ZMQ_IMPORT_RELEASE}
       LIBRARY_DEBUG ${ZMQ_DEBUG}
       LIBRARY_RELEASE ${ZMQ_RELEASE})

-    add_external_project(libcppzmq_ext
+    add_external_headeronly_project(libcppzmq
       DEPENDS libzmq
       GIT_REPOSITORY https://github.com/zeromq/cppzmq.git
-      GIT_TAG ${ZMQ_TAG}
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND "")
-    add_external_library(libcppzmq INTERFACE
-      DEPENDS libcppzmq_ext
-      INCLUDE_DIR "src/libcppzmq_ext/")
-
-  elseif(NAME STREQUAL "zlib")
-    if(TARGET zlib)
-      return()
-    endif()
-
-    if(MSVC)
-      set(ZLIB_DEBUG "lib/zlibstaticd${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(ZLIB_RELEASE "lib/zlibstatic${CMAKE_STATIC_LIBRARY_SUFFIX}")
-    else()
-      include(GNUInstallDirs)
-      #set(ZLIB_DEBUG "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      #set(ZLIB_RELEASE "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(ZLIB_DEBUG "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(ZLIB_RELEASE "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
-    endif()
-    add_external_project(zlib_ext
-      GIT_REPOSITORY https://github.com/madler/zlib.git
-      GIT_TAG "v1.2.11"
-      CMAKE_ARGS
-        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)
-    add_external_library(zlib STATIC
-      DEPENDS zlib_ext
-      INCLUDE_DIR "include"
-      LIBRARY_DEBUG ${ZLIB_DEBUG}
-      LIBRARY_RELEASE ${ZLIB_RELEASE})
-
-  elseif(NAME STREQUAL "libpng")
-    if(TARGET libpng)
-      return()
-    endif()
-
-    require_external(zlib)
-
-    if(MSVC)
-      set(LIBPNG_DEBUG "lib/libpng16_staticd${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(LIBPNG_RELEASE "lib/libpng16_static${CMAKE_STATIC_LIBRARY_SUFFIX}")
-    else()
-      include(GNUInstallDirs)
-      set(LIBPNG_DEBUG "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}png16${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(LIBPNG_RELEASE "${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}png16${CMAKE_STATIC_LIBRARY_SUFFIX}")
-    endif()
-    ExternalProject_Get_Property(zlib_ext INSTALL_DIR)
-    add_external_project(libpng_ext
-      GIT_REPOSITORY https://git.code.sf.net/p/libpng/code
-      GIT_TAG "v1.6.34"
-      DEPENDS zlib_ext
-      CMAKE_ARGS
-        -DPNG_SHARED=OFF
-        -DPNG_TESTS=OFF
-        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-        -DCMAKE_PREFIX_PATH:PATH=${INSTALL_DIR})
-    add_external_library(libpng STATIC
-      DEPENDS libpng_ext
-      INCLUDE_DIR "include"
-      LIBRARY_DEBUG ${LIBPNG_DEBUG}
-      LIBRARY_RELEASE ${LIBPNG_RELEASE}
-      INTERFACE_LIBRARIES zlib)
-
+      GIT_TAG "v4.4.1")
+
+  # quickhull
+  elseif(NAME STREQUAL "quickhull")
+    if(TARGET quickhull)
+      return()
+    endif()
+
+    if(WIN32)
+      set(QUICKHULL_IMPORT_LIB "lib/quickhull.lib")
+      set(QUICKHULL_LIB "bin/quickhull.dll")
+      set(QUICKHULL_CMAKE_ARGS "")
+    else()
+      set(QUICKHULL_IMPORT_LIB "lib/libquickhull.so")
+      set(QUICKHULL_LIB "lib/libquickhull.so")
+      set(QUICKHULL_CMAKE_ARGS -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC")
+    endif()
+
+    add_external_project(quickhull
+      GIT_REPOSITORY https://github.com/akuukka/quickhull.git
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${QUICKHULL_IMPORT_LIB}"
+      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        "${CMAKE_SOURCE_DIR}/cmake/quickhull/CMakeLists.txt"
+        "<SOURCE_DIR>/CMakeLists.txt"
+      CMAKE_ARGS
+        ${QUICKHULL_CMAKE_ARGS})
+
+    add_external_library(quickhull SHARED
+      IMPORT_LIBRARY ${QUICKHULL_IMPORT_LIB}
+      LIBRARY ${QUICKHULL_LIB})
+
+  # snappy
+  elseif(NAME STREQUAL "snappy")
+    if(TARGET snappy)
+      return()
+    endif()
+
+    if(WIN32)
+      set(SNAPPY_PRODUCT "lib/snappy.lib")
+      set(SNAPPY_IMPORT_LIB "lib/snappy.lib")
+      set(SNAPPY_LIB "bin/snappy.dll")
+    else()
+      include(GNUInstallDirs)
+      set(SNAPPY_PRODUCT "lib/libsnappy.so")
+      set(SNAPPY_LIB "${CMAKE_INSTALL_LIBDIR}/libsnappy.so")
+    endif()
+
+    add_external_project(snappy
+      GIT_REPOSITORY https://github.com/google/snappy.git
+      GIT_TAG "1.1.7"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${SNAPPY_PRODUCT}"
+      CMAKE_ARGS
+        -DBUILD_SHARED_LIBS=ON
+        -DSNAPPY_BUILD_TESTS=OFF
+        -DCMAKE_BUILD_TYPE=Release)
+
+    add_external_library(snappy SHARED
+      IMPORT_LIBRARY_DEBUG ${SNAPPY_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${SNAPPY_IMPORT_LIB}
+      LIBRARY_DEBUG ${SNAPPY_LIB}
+      LIBRARY_RELEASE ${SNAPPY_LIB})
+
+  # tinyobjloader
+  elseif(NAME STREQUAL "tinyobjloader")
+    if(TARGET tinyobjloader)
+      return()
+    endif()
+
+    if(WIN32)
+      set(TINYOBJLOADER_LIB "lib/tinyobjloader.lib")
+    else()
+      include(GNUInstallDirs)
+      set(TINYOBJLOADER_LIB "${CMAKE_INSTALL_LIBDIR}/libtinyobjloader.a")
+    endif()
+
+    add_external_project(tinyobjloader
+      GIT_REPOSITORY https://github.com/syoyo/tinyobjloader.git
+      GIT_TAG "v2.0.0-rc1"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${TINYOBJLOADER_LIB}"
+      CMAKE_ARGS
+        -DCMAKE_C_FLAGS=-fPIC
+        -DCMAKE_CXX_FLAGS=-fPIC)
+
+    add_external_library(tinyobjloader STATIC
+      LIBRARY ${TINYOBJLOADER_LIB})
+
+  # tinyply
+  elseif(NAME STREQUAL "tinyply")
+    if(TARGET tinyply)
+      return()
+    endif()
+
+    if(WIN32)
+      set(TNY_PRODUCT "lib/tinyply<SUFFIX>.lib")
+      set(TNY_IMPORT_LIB "lib/tinyply.lib")
+      set(TNY_IMPORT_LIB_DEBUG "lib/tinyplyd.lib")
+      set(TNY_LIB "bin/tinyply.dll")
+      set(TNY_LIB_DEBUG "bin/tinyplyd.dll")
+    else()
+      include(GNUInstallDirs)
+      set(TNY_PRODUCT "lib/libtinyply<SUFFIX>.so")
+      set(TNY_IMPORT_LIB_DEBUG "lib/libtinyplyd.so")
+      set(TNY_IMPORT_LIB "lib/libtinyply.so")
+      set(TNY_LIB_DEBUG "lib/libtinyplyd.so")
+      set(TNY_LIB "lib/libtinyply.so")
+    endif()
+
+    add_external_project(tinyply
+      GIT_REPOSITORY https://github.com/ddiakopoulos/tinyply.git
+      GIT_TAG "2.1"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${TNY_PRODUCT}"
+      DEBUG_SUFFIX d
+      CMAKE_ARGS
+        -DSHARED_LIB=true)
+
+    add_external_library(tinyply SHARED
+      IMPORT_LIBRARY_DEBUG ${TNY_IMPORT_LIB_DEBUG}
+      IMPORT_LIBRARY_RELEASE ${TNY_IMPORT_LIB}
+      LIBRARY_DEBUG ${TNY_LIB_DEBUG}
+      LIBRARY_RELEASE ${TNY_LIB})
+
+  # tracking
+  elseif(NAME STREQUAL "tracking")
+    if(TARGET tracking)
+      return()
+    endif()
+
+    set(TRACKING_LIB "bin/tracking.dll")
+    set(TRACKING_IMPORT_LIB "lib/tracking.lib")
+    set(TRACKING_NATNET_LIB "src/tracking_ext/tracking/natnet/lib/x64/NatNetLib.dll")
+    set(TRACKING_NATNET_IMPORT_LIB "src/tracking_ext/tracking/natnet/lib/x64/NatNetLib.lib")
+
+    add_external_project(tracking
+      GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/mm-tracking
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${TRACKING_IMPORT_LIB}" "<INSTALL_DIR>/${TRACKING_NATNET_IMPORT_LIB}"
+      CMAKE_ARGS
+        -DCREATE_TRACKING_TEST_PROGRAM=OFF)
+
+    add_external_library(tracking SHARED
+      IMPORT_LIBRARY_DEBUG ${TRACKING_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${TRACKING_IMPORT_LIB}
+      LIBRARY_DEBUG ${TRACKING_LIB}
+      LIBRARY_RELEASE ${TRACKING_LIB})
+
+    add_external_library(natnet SHARED
+      PROJECT tracking
+      IMPORT_LIBRARY_DEBUG ${TRACKING_NATNET_IMPORT_LIB}
+      IMPORT_LIBRARY_RELEASE ${TRACKING_NATNET_IMPORT_LIB}
+      LIBRARY_DEBUG ${TRACKING_NATNET_LIB}
+      LIBRARY_RELEASE ${TRACKING_NATNET_LIB})
+
+    add_external_library(tracking_int INTERFACE
+      PROJECT tracking
+      INCLUDE_DIR "src/tracking_ext/tracking/include")
+
+  # zfp
   elseif(NAME STREQUAL "zfp")
     if(TARGET zfp)
       return()
     endif()
-
+
     if(WIN32)
       set(ZFP_LIB "lib/zfp.lib")
     else()
@@ -125,9 +538,10 @@
       set(ZFP_LIB "${CMAKE_INSTALL_LIBDIR}/libzfp.a")
     endif()

-    add_external_project(zfp_ext
+    add_external_project(zfp
       GIT_REPOSITORY https://github.com/LLNL/zfp.git
       GIT_TAG "0.5.2"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ZFP_LIB}"
       CMAKE_ARGS
         -DBUILD_SHARED_LIBS=OFF
         -DBUILD_UTILITIES=OFF
@@ -135,107 +549,52 @@
         -DZFP_WITH_ALIGNED_ALLOC=ON
         -DZFP_WITH_CACHE_FAST_HASH=ON
         -DCMAKE_BUILD_TYPE=Release)
+
     add_external_library(zfp STATIC
-      DEPENDS zfp_ext
       LIBRARY ${ZFP_LIB})

-  elseif(NAME STREQUAL "glm")
-    if(TARGET glm)
-      return()
-    endif()
-
-    add_external_project(glm_ext
-      GIT_REPOSITORY https://github.com/g-truc/glm.git
-      GIT_TAG "0.9.8"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND ""
-      CMAKE_ARGS -DGLM_TEST_ENABLE=OFF)
-    add_external_library(glm INTERFACE
-      DEPENDS glm_ext
-      INCLUDE_DIR "src/glm_ext/")
-
-  elseif(NAME STREQUAL "glowl")
-    if(TARGET glowl)
-      return()
-    endif()
-
-    add_external_project(glowl_ext
-      GIT_REPOSITORY https://github.com/invor/glowl.git
-      GIT_TAG "v0.1"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND "")
-    add_external_library(glowl INTERFACE
-      DEPENDS glowl_ext
-      INCLUDE_DIR "src/glowl_ext/include")
-
-  elseif(NAME STREQUAL "json")
-    if(TARGET json)
-      return()
-    endif()
-
-    add_external_project(json_ext
-      GIT_REPOSITORY https://github.com/azadkuh/nlohmann_json_release.git
-      GIT_TAG "v3.5.0"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND ""
-      CMAKE_ARGS -DBUILD_TESTING=OFF)
-    add_external_library(json INTERFACE
-      DEPENDS json_ext
-      INCLUDE_DIR "src/json_ext/")
-
-  elseif(NAME STREQUAL "Eigen")
-    if(TARGET Eigen)
-      return()
-    endif()
-
-    add_external_project(Eigen_ext
-      GIT_REPOSITORY https://github.com/eigenteam/eigen-git-mirror.git
-      GIT_TAG "3.3.4"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND "")
-    add_external_library(Eigen INTERFACE
-      DEPENDS Eigen_ext
-      INCLUDE_DIR "src/Eigen_ext")
-
-  elseif(NAME STREQUAL "nanoflann")
-    if(TARGET nanoflann)
-      return()
-    endif()
-
-    add_external_project(nanoflann_ext
-      GIT_REPOSITORY https://github.com/jlblancoc/nanoflann.git
-      GIT_TAG "v1.3.0"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND "")
-    add_external_library(nanoflann INTERFACE
-      DEPENDS nanoflann_ext
-      INCLUDE_DIR "src/nanoflann_ext/include")
-
-  elseif(NAME STREQUAL "Delaunator")
-    if(TARGET Delaunator)
-      return()
-    endif()
-
-    add_external_project(Delaunator_ext
-      GIT_REPOSITORY https://github.com/delfrrr/delaunator-cpp.git
-      GIT_TAG "v0.4.0"
-      CONFIGURE_COMMAND ""
-      BUILD_COMMAND ""
-      INSTALL_COMMAND ""
-      TEST_COMMAND "")
-    add_external_library(Delaunator INTERFACE
-      DEPENDS Delaunator_ext
-      INCLUDE_DIR "src/Delaunator_ext/include")
+  # zlib
+  elseif(NAME STREQUAL "zlib")
+    if(TARGET zlib)
+      return()
+    endif()
+
+    if(MSVC)
+      set(ZLIB_PRODUCT "lib/zlibstatic<SUFFIX>${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(ZLIB_DEBUG "lib/zlibstaticd${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(ZLIB_RELEASE "lib/zlibstatic${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    else()
+      include(GNUInstallDirs)
+      set(ZLIB_PRODUCT "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(ZLIB_DEBUG "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
+      set(ZLIB_RELEASE "lib/${CMAKE_STATIC_LIBRARY_PREFIX}z${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    endif()
+
+    add_external_project(zlib
+      GIT_REPOSITORY https://github.com/madler/zlib.git
+      GIT_TAG "v1.2.11"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ZLIB_PRODUCT}"
+      DEBUG_SUFFIX d
+      CMAKE_ARGS
+        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)
+
+    add_external_library(zlib STATIC
+      LIBRARY_DEBUG ${ZLIB_DEBUG}
+      LIBRARY_RELEASE ${ZLIB_RELEASE})
+
+    set(ZLIB_VERSION_STRING "1.2.11" CACHE STRING "" FORCE)
+    set(ZLIB_VERSION_MAJOR 1 CACHE STRING "" FORCE)
+    set(ZLIB_VERSION_MINOR 2 CACHE STRING "" FORCE)
+    set(ZLIB_VERSION_PATCH 11 CACHE STRING "" FORCE)
+    set(ZLIB_VERSION_TWEAK "" CACHE STRING "" FORCE)
+
+    mark_as_advanced(FORCE ZLIB_VERSION_STRING)
+    mark_as_advanced(FORCE ZLIB_VERSION_MAJOR)
+    mark_as_advanced(FORCE ZLIB_VERSION_MINOR)
+    mark_as_advanced(FORCE ZLIB_VERSION_PATCH)
+    mark_as_advanced(FORCE ZLIB_VERSION_TWEAK)
+
+  # vtkm
   elseif(NAME STREQUAL "vtkm")
     if(TARGET vtkm)
       return()
@@ -284,8 +643,13 @@
       DEPENDS vtkm_ext
       LIBRARY_RELEASE "${VTKM_LIB_WORKLET}"
       LIBRARY_DEBUG "${VTKM_LIB_DEBUG_WORKLET}")
-
+
   else()
     message(FATAL_ERROR "Unknown external required \"${NAME}\"")
   endif()
+
+  mark_as_advanced(FORCE FETCHCONTENT_BASE_DIR)
+  mark_as_advanced(FORCE FETCHCONTENT_FULLY_DISCONNECTED)
+  mark_as_advanced(FORCE FETCHCONTENT_QUIET)
+  mark_as_advanced(FORCE FETCHCONTENT_UPDATES_DISCONNECTED)
 endfunction(require_external)


Fixed path for tests when run through ctest

--- test/cmake/base.cmake
+++ test/cmake/base.cmake
@@ -5,4 +5,4 @@
                             ${CMAKE_CURRENT_BINARY_DIR}
                             ${CMAKE_CURRENT_SOURCE_DIR}/../../include)

-add_test(${TESTNAME} ${TESTNAME})+add_test(${TESTNAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TESTNAME})


Control Center -> System Settings

Control Center -> System Settings

svn path=/trunk/KDE/kdepim/; revision=1052161

--- kmail/kmail.kcfg.cmake
+++ kmail/kmail.kcfg.cmake
@@ -222,7 +222,7 @@

     <group name="IMAP Resource">
       <entry name="TheIMAPResourceEnabled" type="Bool">
-        <whatsthis>
Enabling this makes it possible to store the entries from the Kontact applications (KOrganizer, KAddressBook, and KNotes.)

If you want to set this option you must also set the applications to use the IMAP resource; this is done in the KDE Control Center.
</whatsthis>
+        <whatsthis>
Enabling this makes it possible to store the entries from the Kontact applications (KOrganizer, KAddressBook, and KNotes.)

If you want to set this option you must also set the applications to use the IMAP resource; this is done in the KDE System Settings.
</whatsthis>
         <default>false</default>
       </entry>


bump

bump

--- VERSION.cmake
+++ VERSION.cmake
@@ -46,5 +46,5 @@

 SET(LIBSATSOLVER_MAJOR "0")
 SET(LIBSATSOLVER_MINOR "0")
-SET(LIBSATSOLVER_PATCH "32")
+SET(LIBSATSOLVER_PATCH "33")


skip nonexists external projects

skip nonexists external projects

--- cmake/InstallExternalProjects.cmake
+++ cmake/InstallExternalProjects.cmake
@@ -13,54 +13,56 @@
 macro(install_external_project project_name)
     include(Install${project_name})

-    if ($ENV{TRAVIS})
-        ExternalProject_Add_Step(${project_name} ${project_name}_download
-            COMMAND     echo "travis_fold:start:${project_name}.download\tDownload ${project_name}"
-            DEPENDERS   download
-        )
-        ExternalProject_Add_Step(${project_name} ${project_name}_configure
-            COMMAND     echo "travis_fold:end:${project_name}.download"
-            COMMAND     echo "travis_fold:start:${project_name}.configure\tConfigure ${project_name}"
-            DEPENDEES   download
-            DEPENDERS   configure
-        )
+    if (TARGET ${project_name})
+        if ($ENV{TRAVIS})
+            ExternalProject_Add_Step(${project_name} ${project_name}_download
+                COMMAND     echo "travis_fold:start:${project_name}.download\tDownload ${project_name}"
+                DEPENDERS   download
+            )
+            ExternalProject_Add_Step(${project_name} ${project_name}_configure
+                COMMAND     echo "travis_fold:end:${project_name}.download"
+                COMMAND     echo "travis_fold:start:${project_name}.configure\tConfigure ${project_name}"
+                DEPENDEES   download
+                DEPENDERS   configure
+            )

-        ExternalProject_Add_Step(${project_name} ${project_name}_build
-            COMMAND     echo "travis_fold:end:${project_name}.configure"
-            COMMAND     echo "travis_fold:start:${project_name}.build\tBuild ${project_name}"
-            DEPENDEES   configure
-            DEPENDERS   build
-        )
+            ExternalProject_Add_Step(${project_name} ${project_name}_build
+                COMMAND     echo "travis_fold:end:${project_name}.configure"
+                COMMAND     echo "travis_fold:start:${project_name}.build\tBuild ${project_name}"
+                DEPENDEES   configure
+                DEPENDERS   build
+            )

-        ExternalProject_Add_Step(${project_name} ${project_name}_install
-            COMMAND     echo "travis_fold:end:${project_name}.build"
-            COMMAND     echo "travis_fold:start:${project_name}.install\tInstall ${project_name}"
-            DEPENDEES   build
-            DEPENDERS   install
-        )
+            ExternalProject_Add_Step(${project_name} ${project_name}_install
+                COMMAND     echo "travis_fold:end:${project_name}.build"
+                COMMAND     echo "travis_fold:start:${project_name}.install\tInstall ${project_name}"
+                DEPENDEES   build
+                DEPENDERS   install
+            )

-        ExternalProject_Get_Property(${project_name} TEST_COMMAND)
+            ExternalProject_Get_Property(${project_name} TEST_COMMAND)

-        if (${TEST_COMMAND})
-            ExternalProject_Add_Step(${project_name} ${project_name}_test
-                COMMAND     echo "travis_fold:end:${project_name}.install"
-                COMMAND     echo "travis_fold:start:${project_name}.test\tTest ${project_name}"
-                DEPENDEES   install
-                DEPENDERS   test
-            )
-            ExternalProject_Add_Step(${project_name} ${project_name}_test
-                COMMAND     echo "travis_fold:end:${project_name}.test"
-                DEPENDEES   test
-            )
-        elseif ()
-            ExternalProject_Add_Step(${project_name} ${project_name}_end
-                COMMAND     echo "travis_fold:end:${project_name}.install"
-                DEPENDEES   install
-                DEPENDERS   test
-            )
+            if (${TEST_COMMAND})
+                ExternalProject_Add_Step(${project_name} ${project_name}_test
+                    COMMAND     echo "travis_fold:end:${project_name}.install"
+                    COMMAND     echo "travis_fold:start:${project_name}.test\tTest ${project_name}"
+                    DEPENDEES   install
+                    DEPENDERS   test
+                )
+                ExternalProject_Add_Step(${project_name} ${project_name}_test
+                    COMMAND     echo "travis_fold:end:${project_name}.test"
+                    DEPENDEES   test
+                )
+            elseif ()
+                ExternalProject_Add_Step(${project_name} ${project_name}_end
+                    COMMAND     echo "travis_fold:end:${project_name}.install"
+                    DEPENDEES   install
+                    DEPENDERS   test
+                )
+            endif ()
         endif ()
-    endif()
-endmacro()
+    endif ()
+endmacro ()

 install_external_project(ZLib)
 install_external_project(CURL)


Fixing compilation problems with Ninja build system

--- cmake/modules/GoogleBenchmark.cmake
+++ cmake/modules/GoogleBenchmark.cmake
@@ -1,6 +1,9 @@
 include(ExternalProject)
 #---Removing -Woverloaded-virtual from inherited ROOT compilation flags (gbenchmark is crashing)
 string(REPLACE "-Woverloaded-virtual" "" GBENCHMARK_CMAKE_CXX_FLAGS ${ROOT_CXX_FLAGS})
+
+set(GBENCHMARK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/googlebenchmark-prefix")
+set(GBENCHMARK_LIBRARY_NAME ${CMAKE_STATIC_LIBRARY_PREFIX}benchmark${CMAKE_STATIC_LIBRARY_SUFFIX})

 #---Find and install google benchmark
 ExternalProject_Add(
@@ -15,15 +18,15 @@
   #            -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
   #            -Dgtest_force_shared_crt=ON
   CMAKE_ARGS -G ${CMAKE_GENERATOR}
+  -DCMAKE_INSTALL_PREFIX:PATH=${GBENCHMARK_PREFIX}
   -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
   -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
   -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
   -DCMAKE_CXX_FLAGS=${GBENCHMARK_CMAKE_CXX_FLAGS}
-  -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
   # Disable install step
   INSTALL_COMMAND ""
-  BUILD_BYPRODUCTS "${CMAKE_BINARY_DIR}/googlebenchmark-prefix/src/googlebenchmark-build/src/libbenchmark.a"
+  BUILD_BYPRODUCTS "${GBENCHMARK_PREFIX}/src/googlebenchmark-build/src/${GBENCHMARK_LIBRARY_NAME}"
   # Wrap download, configure and build steps in a script to log output
   LOG_DOWNLOAD ON
   LOG_CONFIGURE ON
@@ -40,4 +43,4 @@
 # Register googlebenchmark
 add_library(gbenchmark IMPORTED STATIC GLOBAL)
 set_property(TARGET gbenchmark PROPERTY IMPORTED_LOCATION ${_GBENCH_LIBRARY_PATH}/src/libbenchmark.a)
-add_dependencies(gbenchmark googlebenchmark)
+add_dependencies(gbenchmark googlebenchmark)


trying to disable testing in imported modules

--- cmake/mtao_fetch_dependencies.cmake
+++ cmake/mtao_fetch_dependencies.cmake
@@ -8,6 +8,7 @@
         GIT_TAG ${GIT_TAG}
         )
     if(ADD_SUBDIR)
+        set(BUILD_TESTING)
         if(${CMAKE_VERSION} VERSION_LESS 3.14)
             FetchContent_Populate(${REPO_NAME})
             add_subdirectory(${${REPO_NAME}_SOURCE_DIR} ${${REPO_NAME}_BINARY_DIR})


cmake: fix qt_flib (qtutils.cmake)

cmake: fix qt_flib (qtutils.cmake)

Change-Id: Ib254dd0a32964462de3bffd94b24773bfcea7de3
Reviewed-on: http://gerrit.aldebaran.lan:8080/628
Reviewed-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>
Tested-by: cgestes <ddb78fe00abb42f91254c16a0860e38eb0781789@aldebaran-robotics.com>

--- cmake/qibuild/modules/qtutils.cmake
+++ cmake/qibuild/modules/qtutils.cmake
@@ -17,6 +17,8 @@
     qi_append_uniq_global(QT_${_suffix}_INCLUDE_DIRS "${QT_${_suffix}_INCLUDE_DIR}")
     qi_append_uniq_global(QT_${_suffix}_INCLUDE_DIRS "${QT_INCLUDE_DIR}")
     qi_append_uniq_global(QT_${_suffix}_LIBRARIES    "${QT_LIBRARIES}")
+    set(QT_${_suffix}_LIBRARIES ${QT_${_suffix}_LIBRARIES} PARENT_SCOPE)
+    set(QT_${_suffix}_INCLUDE_DIRS ${QT_${_suffix}_INCLUDE_DIRS} PARENT_SCOPE)
     return()
   endif()


ENH (#4036): MITK_USE_MODULE and MITK_CHECK_MODULE now also accept packages as dependencies.

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -317,8 +317,16 @@
 ENDMACRO(MITK_CREATE_MODULE)

 MACRO(MITK_USE_MODULE)
-  SET(DEPENDS "${ARGN}")
+  SET(DEPENDS "")
   SET(DEPENDS_BEFORE "not initialized")
+  # check for each parameter if it is a package (3rd party)
+  FOREACH(package ${ARGN})
+    IF(EXISTS "${MITK_SOURCE_DIR}/CMake/MITK_${package}_Config.cmake")
+      LIST(APPEND PACKAGE_DEPENDS ${package})
+    ELSE()
+      LIST(APPEND DEPENDS ${package})
+    ENDIF()
+  ENDFOREACH(package)
   WHILE(NOT "${DEPENDS}" STREQUAL "${DEPENDS_BEFORE}")
     SET(DEPENDS_BEFORE ${DEPENDS})
     FOREACH(dependency ${DEPENDS})
@@ -360,10 +368,20 @@
 # check if all required modules exist and stores missing module names in RESULT_VAR.
 MACRO(MITK_CHECK_MODULE RESULT_VAR)
   SET(${RESULT_VAR} "")
-  SET(DEPENDS "${ARGN}")
+  SET(DEPENDS "")
   SET(DEPENDS_BEFORE "not initialized")
   SET(PACKAGE_DEPENDS "")

+
+  # check for each parameter if it is a package (3rd party)
+  FOREACH(package ${ARGN})
+    IF(EXISTS "${MITK_SOURCE_DIR}/CMake/MITK_${package}_Config.cmake")
+      LIST(APPEND PACKAGE_DEPENDS ${package})
+    ELSE()
+      LIST(APPEND DEPENDS ${package})
+    ENDIF()
+  ENDFOREACH(package)
+
   # create a list of all lowercase module names
   FILE(GLOB _ALL_MODULES RELATIVE ${MITK_MODULES_CONF_DIR} ${MITK_MODULES_CONF_DIR}/*Config.cmake)
   SET(_ALL_MODULES_LOWERCASE "")
@@ -371,7 +389,7 @@
     STRING(TOLOWER ${_module} _lowermodule)
     LIST(APPEND _ALL_MODULES_LOWERCASE ${_lowermodule})
   ENDFOREACH(_module ${_ALL_MODULES})
-
+
   WHILE(NOT "${DEPENDS}" STREQUAL "${DEPENDS_BEFORE}")
     SET(DEPENDS_BEFORE ${DEPENDS})
     FOREACH(dependency ${DEPENDS})


Correct paths in sitkAddTest for multi-project configurations

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -2,7 +2,7 @@
 include(CMakeParseArguments)

 set(SimpleITK_DATA_ROOT ${SimpleITK_SOURCE_DIR}/Testing/Data)
-set(SimpleITK_TEST_OUTPUT_DIR ${SimpleITK_BINARY_DIR}/Testing/Temporary)
+set(SimpleITK_TEST_OUTPUT_DIR ${CMAKE_BINARY_DIR}/Testing/Temporary)

 #-----------------------------------------------------------------------------
 # SimpleITK wrapper for add_test that adds support for external data,
@@ -76,7 +76,7 @@
   endif()
   if (NOT SimpleITK_PYTHON_USE_VIRTUALENV)
     set_property(TEST Python.${name}
-      APPEND PROPERTY ENVIRONMENT PYTHONPATH=${SimpleITK_BINARY_DIR}/Wrapping/Python
+      APPEND PROPERTY ENVIRONMENT PYTHONPATH=${SimpleITK_Python_BINARY_DIR}
       )
   endif()

@@ -195,9 +195,9 @@

   set( _JAVA_LIBRARY_PATH  "$<TARGET_FILE_DIR:SimpleITKJava_JAVA>")
   if(WIN32)
-    set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}$<SEMICOLON>${_class_path}" )
+    set( _JAVA_CLASSPATH "${SimpleITK_Java_BINARY_DIR}/${JAR_FILE}$<SEMICOLON>${_class_path}" )
   else()
-    set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}:${_class_path}" )
+    set( _JAVA_CLASSPATH "${SimpleITK_Java_BINARY_DIR}/${JAR_FILE}:${_class_path}" )
   endif()

   if (NOT TARGET ${_java_class}Java)
@@ -262,7 +262,7 @@
     PROPERTY LABELS R
     )

-  file(TO_NATIVE_PATH "${SimpleITK_BINARY_DIR}/Wrapping/R/R_libs" _native_path)
+  file(TO_NATIVE_PATH "${SimpleITK_R_BINARY_DIR}/R_libs" _native_path)

   set_property(TEST R.${name}
     PROPERTY ENVIRONMENT R_LIBS=${_native_path}


Add CMOCKA_INCLUDE_DIR for backwards compatibility

--- test/cmake/Modules/FindCMocka.cmake
+++ test/cmake/Modules/FindCMocka.cmake
@@ -7,7 +7,8 @@
 #
 # Read-Only variables:
 #  CMOCKA_FOUND - system has CMocka
-#  CMOCKA_INCLUDE_DIR - the CMocka include directory
+#  CMOCKA_INCLUDE_DIRS - the CMocka include directories
+#  CMOCKA_INCLUDE_DIR - for backwards compatiblity, the same as CMOCKA_INCLUDE_DIRS
 #  CMOCKA_LIBRARIES - Link these to use CMocka
 #  CMOCKA_DEFINITIONS - Compiler switches required for using CMocka
 #
@@ -16,7 +17,7 @@

 set(CMOCKA_ROOT_DIR ${CMOCKA_ROOT_DIR} CACHE PATH "Root installation directory of CMocka")

-find_path(CMOCKA_INCLUDE_DIR
+find_path(CMOCKA_INCLUDE_DIRS
   NAMES cmocka.h
   PATHS ${CMOCKA_ROOT_DIR}/include
   NO_DEFAULT_PATH
@@ -28,8 +29,7 @@
   NO_DEFAULT_PATH
 )

-message(STATUS "CMOCKA_INCLUDE_DIR = " ${CMOCKA_INCLUDE_DIR})
-message(STATUS "CMOCKA_LIBRARY = " ${CMOCKA_LIBRARY})
+set(CMOCKA_INCLUDE_DIR ${CMOCKA_INCLUDE_DIRS})

 find_package_handle_standard_args(CMocka DEFAULT_MSG CMOCKA_LIBRARY CMOCKA_INCLUDE_DIR)


Remove SVN revision check in VERSION.cmake

--- VERSION.cmake
+++ VERSION.cmake
@@ -6,19 +6,3 @@

 set(LIBRARY_VERSION "3.0.1")
 set(LIBRARY_SOVERSION "3")
-
-## SVN revision ##
-set(SVN_REVISION "")
-if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
-  execute_process(COMMAND svn info --xml
-    WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-    OUTPUT_VARIABLE SVN_INFO ERROR_QUIET)
-  if(SVN_INFO)
-    string(REGEX MATCH "<entry[^>]+" SVN_REVISION "${SVN_INFO}")
-    string(REGEX REPLACE "^.*revision=\"([0-9]+)\".*$" "\\1" SVN_REVISION "${SVN_REVISION}")
-  endif(SVN_INFO)
-endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
-
-if(SVN_REVISION)
-  set(PROJECT_VERSION_FULL "svn-r${SVN_REVISION}")
-endif(SVN_REVISION)


Bumping version to 2.1 for development

Bumping version to 2.1 for development

--- Version.cmake
+++ Version.cmake
@@ -9,7 +9,7 @@
 # Version info

 set(SimpleITK_VERSION_MAJOR 2)
-set(SimpleITK_VERSION_MINOR 0)
+set(SimpleITK_VERSION_MINOR 1)
 set(SimpleITK_VERSION_PATCH 0)
 #set(SimpleITK_VERSION_TWEAK "")


ENH: Updating Version in development branch to 0.5.0

--- Version.cmake
+++ Version.cmake
@@ -1,6 +1,6 @@
 # Version info
 set(SimpleITK_Major 0)
-set(SimpleITK_Minor 4)
+set(SimpleITK_Minor 5)
 set(SimpleITK_Patch 0)

 include(GetGitRevisionDescription)


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -14,13 +14,13 @@
 	set(CMAKI_PATH ${CMAKE_MODULE_PATH})
 ENDIF()

-# MESSAGE("CMAKI_PATH = ${CMAKI_PATH}")
-# MESSAGE("ARTIFACTS_PATH = ${ARTIFACTS_PATH}")
-# MESSAGE("CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
-# MESSAGE("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
-# MESSAGE(FATAL_ERROR)
-
-set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/bin)
+if(DEFINED CMAKI_DEBUG)
+	MESSAGE("CMAKI_PATH = ${CMAKI_PATH}")
+	MESSAGE("ARTIFACTS_PATH = ${ARTIFACTS_PATH}")
+	MESSAGE("CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
+	MESSAGE("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}")
+	MESSAGE(FATAL_ERROR)
+endif()

 IF(WIN32)
 	if(MSVC12)
@@ -68,7 +68,7 @@
 		MESSAGE(FATAL_ERROR "CMAKI_REPOSITORY: is not defined")
 	ENDIF()

-	# get version now
+	# 1. obtener la version actual (o ninguno en caso de no tener el artefacto)
 	execute_process(
 		COMMAND python ${ARTIFACTS_PATH}/get_package.py --name=${PACKAGE} --depends=${CMAKI_PATH}/../depends.json
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -82,7 +82,7 @@
 	endif()

 	#######################################################
-	# get version in local cache or remote artifacts server
+	# 2. obtener la mejor version buscando en la cache local y remota
 	execute_process(
 		COMMAND python ${ARTIFACTS_PATH}/check_remote_version.py --server=${CMAKI_REPOSITORY} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE} ${EXTRA_VERSION}
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -91,17 +91,16 @@
 		list(GET RESULT_VERSION 0 PACKAGE_MODE)
 		list(GET RESULT_VERSION 1 PACKAGE_NAME)
 		list(GET RESULT_VERSION 2 VERSION)
-		# message("---- found ${PACKAGE_NAME} (${VERSION})")
 		set(FORCE_GENERATE_ARTIFACT FALSE)
+		message("-- cached package ${PACKAGE_NAME} (${VERSION})")
 	else()
-		message("can't get version for: ${PACKAGE}, request: ${VERSION_REQUEST}, will be generated.")
-		# generate artifact with version request
 		set(VERSION ${VERSION_REQUEST})
 		set(FORCE_GENERATE_ARTIFACT TRUE)
+		message("-- need build package ${PACKAGE_NAME} can't get version: ${VERSION_REQUEST}, will be generated.")
 	endif()
 	#######################################################

-	# si no tengo los ficheros de cmake del paquete
+	# 3. si no tengo los ficheros de cmake, los intento descargar
 	set(depends_bin_package "${CMAKI_PATH}/../depends/${PACKAGE}-${VERSION}")
 	set(depends_package ${CMAKE_PREFIX_PATH}/${PACKAGE}-${VERSION})
 	if((NOT EXISTS "${depends_package}") OR ${FORCE_GENERATE_ARTIFACT})
@@ -115,14 +114,16 @@
 		set(package_uncompressed_file "${CMAKE_PREFIX_PATH}/${PACKAGE}.tmp")
 		set(package_cmake_filename ${PACKAGE}-${VERSION}-${CMAKI_PLATFORM}-cmake.tar.gz)
 		set(http_package_cmake_filename ${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename})
+		# 4. descargo el fichero que se supone tienes los ficheros cmake
 		cmaki_download_file("${http_package_cmake_filename}" "${package_uncompressed_file}")
-		# Si no puede descargar el artefacto (es posible no tener la version definida)
+		# Si no puede descargar el artefacto ya hecho (es que necesito compilarlo y subirlo)
 		if((NOT "${COPY_SUCCESFUL}") OR ${FORCE_GENERATE_ARTIFACT})

 			file(REMOVE "${depends_bin_package}")
 			file(REMOVE "${depends_package}")
 			file(REMOVE "${package_uncompressed_file}")

+			# 5. compilo y genera el paquete en local
 			execute_process(
 				COMMAND python ${ARTIFACTS_PATH}/build.py ${PACKAGE} --depends=${CMAKI_PATH}/../depends.json --cmakefiles=${CMAKI_PATH} --prefix=${CMAKE_PREFIX_PATH} --third-party-dir=${CMAKE_PREFIX_PATH} -o -d
 				WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -132,23 +133,18 @@
 				message(FATAL_ERROR "can't create artifact ${PACKAGE}")
 			endif()

-			# TODO: must set recent artifact created
-			# or integrate in pipeline
-
 			#######################################################
-			# llamar a check_remote_version
-			# dando el nombre recibo la version
+			# 6: obtengo la version del paquete recien creado
 			execute_process(
 				COMMAND python ${ARTIFACTS_PATH}/check_remote_version.py --server=${CMAKI_REPOSITORY} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE}
 				WORKING_DIRECTORY "${ARTIFACTS_PATH}"
 				OUTPUT_VARIABLE RESULT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-			#MESSAGE("RESULT_VERSION2 = ${RESULT_VERSION}")
 			list(GET RESULT_VERSION 0 PACKAGE_MODE)
 			list(GET RESULT_VERSION 1 PACKAGE_NAME)
 			list(GET RESULT_VERSION 2 VERSION)
 			#######################################################

-			# 2. Opcionalmente subo el artefacto
+			# 7. subo el artefacto y los ficheros de cmake
 			set(package_filename ${PACKAGE}-${VERSION}-${CMAKI_PLATFORM}.tar.gz)
 			set(package_cmake_filename ${PACKAGE}-${VERSION}-${CMAKI_PLATFORM}-cmake.tar.gz)
 			set(package_generated_file ${CMAKE_PREFIX_PATH}/${package_filename})
@@ -170,7 +166,7 @@
 				message(FATAL_ERROR "error in upload ${package_cmake_generated_file})")
 			endif()

-			# 3. Obligatoriamente descomprimo el artefacto
+			# 8. descomprimo el artefacto
 			execute_process(
 				COMMAND "${CMAKE_COMMAND}" -E tar zxf "${package_cmake_generated_file}"
 				WORKING_DIRECTORY "${CMAKE_PREFIX_PATH}/"
@@ -179,13 +175,15 @@
 			if(uncompress_result)
 				message(FATAL_ERROR "Extracting ${package_cmake_generated_file} failed! Error ${uncompress_result}")
 			endif()
+
+			# 9. borro los 2 tar gz
 			file(REMOVE "${package_generated_file}")
 			file(REMOVE "${package_cmake_generated_file}")

 		# me lo he descargdo y existe
 		elseif(EXISTS "${package_uncompressed_file}")

-			# lo descomprimo cacheado
+			# 10. lo descomprimo cacheado
 			execute_process(
 				COMMAND "${CMAKE_COMMAND}" -E tar zxf "${package_uncompressed_file}"
 				WORKING_DIRECTORY "${CMAKE_PREFIX_PATH}/"
@@ -199,6 +197,7 @@
 		endif()
 	endif()

+	# 11. Guardar nuestra version en uso
 	execute_process(
 		COMMAND python ${ARTIFACTS_PATH}/save_package.py --name=${PACKAGE} --version=${VERSION} --depends=${CMAKI_PATH}/../depends.json
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
@@ -208,6 +207,7 @@
 		message(FATAL_ERROR "can't save package version: ${PACKAGE} ${VERSION}")
 	endif()

+	# 12. hacer find_package tradicional, ahora que tenemos todo
 	if(${PACKAGE_MODE} STREQUAL "EXACT")
 		# message("-- using ${PACKAGE} in EXACT")
 		find_package(${PACKAGE} ${VERSION} EXACT REQUIRED)
@@ -216,24 +216,24 @@
 		find_package(${PACKAGE} ${VERSION} REQUIRED)
 	endif()

+	# 13 añadir los includes
 	string(TOUPPER "${PACKAGE}" PACKAGE_UPPER)
-
 	foreach(INCLUDE_DIR ${${PACKAGE_UPPER}_INCLUDE_DIRS})
 		list(APPEND CMAKI_INCLUDE_DIRS "${INCLUDE_DIR}")
 	endforeach()
+
+	# 14. añadir los libdir
 	foreach(LIB_DIR ${${PACKAGE_UPPER}_LIBRARIES})
 		list(APPEND CMAKI_LIBRARIES "${LIB_DIR}")
 	endforeach()

+	# 15. añadir variables especificas
 	set(${PACKAGE_UPPER}_INCLUDE_DIRS "${${PACKAGE_UPPER}_INCLUDE_DIRS}" PARENT_SCOPE)
 	set(${PACKAGE_UPPER}_LIBRARIES "${${PACKAGE_UPPER}_LIBRARIES}" PARENT_SCOPE)

+	# 16. añaadir variabes generales
 	set(CMAKI_INCLUDE_DIRS "${CMAKI_INCLUDE_DIRS}" PARENT_SCOPE)
 	set(CMAKI_LIBRARIES "${CMAKI_LIBRARIES}" PARENT_SCOPE)
-
-	# MESSAGE("package = ${PACKAGE}")
-	# MESSAGE("includes = ${CMAKI_INCLUDE_DIRS}")
-	# MESSAGE("libraries = ${CMAKI_LIBRARIES}")

 endfunction()

@@ -302,7 +302,7 @@
 		MESSAGE(FATAL_ERROR "CMAKI_REPOSITORY: is not defined")
 	ENDIF()
 	get_filename_component(package_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
-	# ${package_name} en realidad es paquete + version
+	# ${package_name} en realidad es paquete + version (asyncply-0.0.0.0)
 	get_filename_component(package_name "${package_dir}" NAME)
 	set(package_cmake_filename ${package_name}-${CMAKI_PLATFORM}.tar.gz)
 	set(http_package_cmake_filename ${CMAKI_REPOSITORY}/download.php?file=${package_cmake_filename})
@@ -417,7 +417,6 @@
 					DESTINATION ${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE})
 	endforeach()
-	generate_vcxproj_user(${_LIBRARY_NAME})

 endfunction()

@@ -448,7 +447,6 @@
 					DESTINATION ${BUILD_TYPE}
 					CONFIGURATIONS ${BUILD_TYPE})
 	endforeach()
-	generate_vcxproj_user(${_LIBRARY_NAME})

 endfunction()

@@ -483,4 +481,3 @@
 	cmaki_find_package(google-gmock)
 	cmaki2_test(${ARGV})
 endfunction()
-


Remove unused CMake module.

Remove unused CMake module.

--- cmake/Modules/CheckCXXCompilerFlag.cmake
+++ cmake/Modules/CheckCXXCompilerFlag.cmake
@@ -1,16 +0,0 @@
-# - Check whether the compiler supports a given flag.
-# CHECK_CXX_COMPILER_FLAG(FLAG VARIABLE)
-#
-#  FLAG - the compiler flag
-#  VARIABLE - variable to store the result
-#
-
-INCLUDE(CheckCXXSourceCompiles)
-
-MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
-	SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
-	SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
-	CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT})
-	SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
-ENDMACRO (CHECK_CXX_COMPILER_FLAG)
-


Fix incomplete boot on new EKF config

Fix incomplete boot on new EKF config

--- cmake/configs/nuttx_px4fmu-v2_ekf2.cmake
+++ cmake/configs/nuttx_px4fmu-v2_ekf2.cmake
@@ -2,7 +2,7 @@

 set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Toolchain-arm-none-eabi.cmake)

-set(config_uavcan_num_ifaces 1)
+set(config_uavcan_num_ifaces 2)

 set(config_module_list
 	#
@@ -79,7 +79,10 @@
 	# Estimation modules (EKF/ SO3 / other filters)
 	#
 	# Too high RAM usage due to static allocations
+	# modules/attitude_estimator_ekf
+	modules/attitude_estimator_q
 	modules/ekf2
+	modules/position_estimator_inav

 	#
 	# Vehicle Control
@@ -166,6 +169,10 @@
 	sercon
 	)

+set(config_io_board
+	px4io-v2
+	)
+
 set(config_extra_libs
 	${CMAKE_SOURCE_DIR}/src/lib/mathlib/CMSIS/libarm_cortexM4lf_math.a
 	uavcan


boards: lpcxpresso55s69: Enable pyocd runner

Enables the pyocd runner on the lpcxpresso55s69 board. Note that this
currently requires building pycod from source to pick up fixes in
https://github.com/mbedmicro/pyOCD/pull/690

Signed-off-by: Maureen Helm <87a696db5547fa477bda9f9e0f00013c839c14d3@nxp.com>

--- boards/arm/lpcxpresso55s69/board.cmake
+++ boards/arm/lpcxpresso55s69/board.cmake
@@ -22,4 +22,7 @@
 board_runner_args(jlink "--device=LPC55S69_core1")
 endif()

+board_runner_args(pyocd "--target=lpc55s69")
+
 include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
+include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)


package: deb/rpm: fix invalid dependency nanyc

--- bootstrap/cmake/packages-deb-rpm.cmake
+++ bootstrap/cmake/packages-deb-rpm.cmake
@@ -7,7 +7,7 @@
 		endif()

 		add_custom_target(package-${output}
-			DEPENDS libnanyc nany nanyc-check-syntax nanyc-dump-ast
+			DEPENDS libnanyc nanyc nanyc-check-syntax nanyc-dump-ast
 			COMMAND rm -rf "${destdir}"

 			COMMAND "${CMAKE_COMMAND}" "-E" echo ""


BUG: Revert to FADTTS release version with support for VTK7.0

--- SuperBuild/External_FADTTS.cmake
+++ SuperBuild/External_FADTTS.cmake
@@ -64,7 +64,7 @@

   ### --- End Project specific additions
   set( ${proj}_REPOSITORY ${git_protocol}://github.com/NIRALUser/FADTTSter.git)
-  set( ${proj}_GIT_TAG release )
+  set( ${proj}_GIT_TAG release-vtk7.0 )
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}
     GIT_TAG ${${proj}_GIT_TAG}


CMake (MSVC): cmake automatically adds the /EHsc and /GR compiler
options. If we are building with exceptions/rtti disabled, we replace
/EHsc with /EHs-c- and /GR with /GR-, respectively. If we just add the
disabling options we get warnings like this:

cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'

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

--- cmake/modules/LLVMProcessSources.cmake
+++ cmake/modules/LLVMProcessSources.cmake
@@ -42,7 +42,7 @@
     if( CMAKE_COMPILER_IS_GNUCXX )
       add_definitions( -fno-exceptions )
     elseif( MSVC )
-      add_definitions( /EHs-c- )
+      string( REGEX REPLACE "[ ^]/EHsc ?" " /EHs-c- " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
       add_definitions( /D_HAS_EXCEPTIONS=0 )
     endif()
   endif()
@@ -50,7 +50,7 @@
     if( CMAKE_COMPILER_IS_GNUCXX )
       add_definitions( -fno-rtti )
     elseif( MSVC )
-      add_definitions( /GR- )
+      string( REGEX REPLACE "[ ^]/GR ?" " /GR- " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
     endif()
   endif()


Qt 5.9: qcocoa dependencies

Qt 5.9: qcocoa dependencies

--- cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
+++ cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
@@ -91,6 +91,48 @@
         "${_qt_install_prefix}/lib/libqtlibpng.a"
         "${_qt_install_prefix}/lib/libqtlibpng_debug.a"
     )
+
+    # qt_mac_addToGlobalMimeList(QMacInternalPasteboardMime*)
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5ClipboardSupport.a"
+        "${_qt_install_prefix}/lib/libQt5ClipboardSupport_debug.a"
+    )
+
+    # qcgl_createNSOpenGLPixelFormat
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5CglSupport.a"
+        "${_qt_install_prefix}/lib/libQt5CglSupport_debug.a"
+    )
+
+    # QCoreTextFontEngine::antialiasingThreshold
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5FontDatabaseSupport.a"
+        "${_qt_install_prefix}/lib/libQt5FontDatabaseSupport_debug.a"
+    )
+
+    # QRasterBackingStore::beginPaint
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5GraphicsSupport.a"
+        "${_qt_install_prefix}/lib/libQt5GraphicsSupport_debug.a"
+    )
+
+    # QAccessibleBridgeUtils::effectiveActionNames
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5AccessibilitySupport.a"
+        "${_qt_install_prefix}/lib/libQt5AccessibilitySupport_debug.a"
+    )
+
+    # QAbstractFileIconEngine::actualSize
+    _qt_cmake_extra_helpers_add_interface_release_debug(
+        Qt5::QCocoaIntegrationPlugin
+        "${_qt_install_prefix}/lib/libQt5ThemeSupport.a"
+        "${_qt_install_prefix}/lib/libQt5ThemeSupport_debug.a"
+    )
   endif()
 elseif(UNIX)
   # Linux


[cmake] added -ftemplate-backtrace-limit=0 to CMAKE_CXX_FLAGS_DEBUG * not sure if gcc and icc understand this

--- cmake/modules/DuneStuffMacros.cmake
+++ cmake/modules/DuneStuffMacros.cmake
@@ -63,7 +63,7 @@
 SET( CMAKE_CXX_FLAGS "-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS=1 ${CMAKE_CXX_FLAGS}" )

 SET( CMAKE_CXX_FLAGS_DEBUG
-  "-O0 -DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor" )
+  "-O0 -DDNDEBUG -g3 -ggdb  -Wunused-variable -Winline -fno-strict-aliasing -fPIC -Wall -Wextra -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow  -Wundef -Wnon-virtual-dtor -ftemplate-backtrace-limit=0" )

 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
   set( CMAKE_CXX_FLAGS_DEBUG


Library was not installed with new configuration

--- cmake/Qt5Multimedia_QMultimediaDeclarativeModulePlugin.cmake
+++ cmake/Qt5Multimedia_QMultimediaDeclarativeModulePlugin.cmake
@@ -58,11 +58,11 @@
     )
   endif()

-  _qt_cmake_extra_helpers_add_interface_release_debug(
-      Qt5::QMultimediaDeclarativeModule
-      "${_qt_install_prefix}/lib/libQt5MultimediaQuick_p.a"
-      "${_qt_install_prefix}/lib/libQt5MultimediaQuick_p_debug.a"
-  )
+  #_qt_cmake_extra_helpers_add_interface_release_debug(
+  #    Qt5::QMultimediaDeclarativeModule
+  #    "${_qt_install_prefix}/lib/libQt5MultimediaQuick_p.a"
+  #    "${_qt_install_prefix}/lib/libQt5MultimediaQuick_p_debug.a"
+  #)
 endif()

 _qt_cmake_extra_helpers_add_source(


host-gcc/target.cmake: stop discarding CMAKE_<tool>_FLAGS for x86

Prepend -m32 to existing flags as opposed to silently override and
discard them:

- set(CMAKE_<tool>_FLAGS                -m32 )
+ string(PREPEND CMAKE_<tool>_FLAGS   " -m32")

This stops discarding additional flags passed with either cmake
-DCMAKE_<tool>_FLAGS="-fu -bar" or cmake -C params.cmake.

Note this bug was affecting only the combination of x86 and
CMAKE_<tool>_FLAGS. x86_64 wasn't affected and other, non-empty
CMAKE_<tool>_FLAGS_[DEBUG/RELEASE/etc.] weren't affected either.

Also convert flags string to list when invoking --print-libgcc-file-name
to support more than one CMAKE_C_FLAGS.

Signed-off-by: Marc Herbert <77e7c7d746b52c6eb01119b65a031ae1f650246d@intel.com>

--- cmake/compiler/host-gcc/target.cmake
+++ cmake/compiler/host-gcc/target.cmake
@@ -17,10 +17,10 @@
 # Maybe the -m32/-miamcu FLAGS should all be next to -march= in the
 # longer term?
 if(NOT CONFIG_X86_64)
-  set(CMAKE_ASM_FLAGS           -m32 )
-  set(CMAKE_C_FLAGS             -m32 )
-  set(CMAKE_CXX_FLAGS           -m32 )
-  set(CMAKE_SHARED_LINKER_FLAGS -m32 ) # unused?
+  string(PREPEND CMAKE_ASM_FLAGS             "-m32 ")
+  string(PREPEND CMAKE_C_FLAGS               "-m32 ")
+  string(PREPEND CMAKE_CXX_FLAGS             "-m32 ")
+  string(PREPEND CMAKE_SHARED_LINKER_FLAGS   "-m32 ") # unused?
 endif()

 if(CONFIG_CPLUSPLUS)
@@ -41,9 +41,11 @@
 # -mx32 --print-libgcc-file-name) so don't fail to build for something
 # that is currently not needed. See comments in compiler/gcc/target.cmake
 if (NOT CONFIG_X86_64)
+  # Convert to list as cmake Modules/*.cmake do it
+  STRING(REGEX REPLACE " +" ";" PRINT_LIBGCC_ARGS ${CMAKE_C_FLAGS})
   # This libgcc code is partially duplicated in compiler/*/target.cmake
   execute_process(
-    COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS} --print-libgcc-file-name
+    COMMAND ${CMAKE_C_COMPILER} ${PRINT_LIBGCC_ARGS} --print-libgcc-file-name
     OUTPUT_VARIABLE LIBGCC_FILE_NAME
     OUTPUT_STRIP_TRAILING_WHITESPACE
     )


On arm, vc default value is off

On arm, vc default value is off

--- cmake/modules/RootBuildOptions.cmake
+++ cmake/modules/RootBuildOptions.cmake
@@ -87,6 +87,12 @@
  set(unuran_defvalue OFF)
  set(vc_defvalue OFF)
 endif()
+
+# VC does not support yet Arm processors.
+if (ROOT_ARCHITECTURE STREQUAL "linuxarm64")
+  set(vc_defvalue OFF)
+endif()
+

 ROOT_BUILD_OPTION(afdsmgrd OFF "Dataset manager for PROOF-based analysis facilities")
 ROOT_BUILD_OPTION(afs OFF "AFS support, requires AFS libs and objects")


new md5sums for openni

new md5sums for openni

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@7880 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_all_in_one_installer.cmake
+++ cmake/pcl_all_in_one_installer.cmake
@@ -25,10 +25,10 @@
     if(CMAKE_CL_64)
         set(OPENNI_PACKAGE "OpenNI-Win64-1.5.4-Dev.msi")
         set(OPENNI_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_PACKAGE}")
-        set(OPENNI_MD5 e54b5ede27b293c579c42dcede33b289)
+        set(OPENNI_MD5 95087985e8271552d7c87dad03b41b21)
         set(OPENNI_SENSOR_PACKAGE "Sensor-Win-OpenSource64-5.1.0.msi")
         set(OPENNI_SENSOR_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_SENSOR_PACKAGE}")
-        set(OPENNI_SENSOR_MD5 cbf4ce02d5ef430dca17833d5588e060)
+        set(OPENNI_SENSOR_MD5 1db3babe0291add6c07314c2e11582d5)
     else(CMAKE_CL_64)
         set(OPENNI_PACKAGE "OpenNI-Win32-1.5.4-Dev.msi")
         set(OPENNI_URL "http://www.pointclouds.org/assets/files/dependencies/${OPENNI_PACKAGE}")


esp32s2: remove -nostdlib accidentally added

-nostdlib was removed in 9a2af7a and then accidentally added
in 1c2cc54.

The issue manifested itself as a failure to link some symbols from
libgcc, even though libgcc should implicitly appear at the end of the
linker command line when -nostdlib is not given.

--- tools/cmake/toolchain-esp32s2.cmake
+++ tools/cmake/toolchain-esp32s2.cmake
@@ -4,6 +4,5 @@
 set(CMAKE_CXX_COMPILER xtensa-esp32s2-elf-g++)
 set(CMAKE_ASM_COMPILER xtensa-esp32s2-elf-gcc)

-set(CMAKE_EXE_LINKER_FLAGS "-nostdlib" CACHE STRING "Linker Base Flags")
 set(CMAKE_C_FLAGS "-mlongcalls" CACHE STRING "C Compiler Base Flags")
 set(CMAKE_CXX_FLAGS "-mlongcalls" CACHE STRING "C++ Compiler Base Flags")


[Build] Added support to read the version from the CMake cache.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -139,6 +139,8 @@
 macro (store_in_cache)
   # Force some variables that could be defined in the command line to be
   # written to cache
+  set (PACKAGE_VERSION "${PACKAGE_VERSION}" CACHE STRING
+  "Version of the project/package")
   set (BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}" CACHE BOOL
 	"Set to OFF to build static libraries" FORCE)
   set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH


fix mkpatch step for newer versions of cmake

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -67,26 +67,28 @@
       endif()
       ExternalProject_Add(${prj}_repo
         GIT_REPOSITORY ${P_GIT_ORIGIN} GIT_TAG ${P_GIT_TAG}
-        PATCH_COMMAND ${patchCmd}
-        UPDATE_COMMAND ${GIT_EXECUTABLE} remote add upstream ${P_GIT_UPSTREAM}
-        CONFIGURE_COMMAND ${GIT_EXECUTABLE} fetch upstream
-        BUILD_COMMAND ${GIT_EXECUTABLE} branch ${upstreamCmd}
+        #DOWNLOAD_COMMAND # tricky: must not be defined for git clone to happen
+        PATCH_COMMAND ${GIT_EXECUTABLE} remote add upstream ${P_GIT_UPSTREAM}
+        UPDATE_COMMAND ${GIT_EXECUTABLE} fetch --all
+        CONFIGURE_COMMAND ${GIT_EXECUTABLE} branch ${upstreamCmd}
+        BUILD_COMMAND ${patchCmd}
+        INSTALL_COMMAND ""
         BUILD_IN_SOURCE 1 # <BINARY_DIR>==<SOURCE_DIR>
-        INSTALL_COMMAND "" DOWNLOAD_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
+        DOWNLOAD_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
         )
     else()
       ExternalProject_Add(${prj}_repo
         GIT_REPOSITORY ${P_GIT_ORIGIN} GIT_TAG ${P_GIT_TAG}
-        PATCH_COMMAND ${patchCmd}
-        UPDATE_COMMAND "" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ""
-        DOWNLOAD_DIR ${NULL_DIR} BINARY_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
+        #DOWNLOAD_COMMAND # tricky: must not be defined for git clone to happen
+        PATCH_COMMAND ""
+        UPDATE_COMMAND ${GIT_EXECUTABLE} fetch --all
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ${patchCmd}
+        INSTALL_COMMAND ""
+        BUILD_IN_SOURCE 1 # <BINARY_DIR>==<SOURCE_DIR>
+        DOWNLOAD_DIR ${NULL_DIR} INSTALL_DIR ${NULL_DIR}
         )
     endif()
-    ExternalProject_Add_Step(${prj}_repo patch_always
-      COMMAND ${CMAKE_COMMAND} -E echo "Custom external project step forces patch"
-        "and later steps to run"
-      DEPENDEES download DEPENDERS patch ALWAYS 1
-      )
   endif()
 endfunction()


[ESP32] Fix flashing_script dependency on partition table (#15643)

#### Problem

`gen_flashing_script.py` for ESP32 occasionally fails; it turns out
that there is no dependency declared on the partition table, which
is a required input.

#### Change overview

Add the depencency.

#### Testing

Manual build works (but may have merely won the race).

--- examples/common/cmake/idf_flashing.cmake
+++ examples/common/cmake/idf_flashing.cmake
@@ -84,6 +84,7 @@
             --use-sdkconfig ${project_path}/sdkconfig
     WORKING_DIRECTORY ${build_dir}
     DEPENDS "${build_dir}/${board_firmware_utils}"
+            "${build_dir}/${partition_table}"
             "${build_dir}/firmware_utils.py"
             "${build_dir_deps}"
     COMMENT "To flash ${build_dir}/${CMAKE_PROJECT_NAME}.bin run ./build/${CMAKE_PROJECT_NAME}.flash.py"


Fix for openJpeg library find

Fix for openJpeg library find

It might be situated in the /usr/lib/<architecture> on the multiarch systems.

--- src/cmake/modules/FindOpenJpeg.cmake
+++ src/cmake/modules/FindOpenJpeg.cmake
@@ -67,6 +67,7 @@

 set (OpenJpeg_library_paths
   /usr/lib
+  /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
   /usr/local/lib
   /sw/lib
   /opt/local/lib)


ENH: Sync ExternalData.cmake with upstream CMake 3.6.2

Change-Id: I14e5a2471f78fd0278ece2608252b52223dacbb6

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -1,3 +1,6 @@
+# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
+# file Copyright.txt or https://cmake.org/licensing for details.
+
 #.rst:
 # ExternalData
 # ------------
@@ -251,7 +254,8 @@
 # ``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir``
 # directory on the command line and ensure that the directory contains
 # files corresponding to every file or content link in the ``MyDataDir``
-# source directory.
+# source directory.  In order to match associated files in subdirectories,
+# specify a ``RECURSE:`` option, e.g. ``DATA{MyDataDir/,RECURSE:,REGEX:.*}``.
 #
 # Hash Algorithms
 # ^^^^^^^^^^^^^^^
@@ -308,39 +312,6 @@
 #   When a custom fetch script fails to fetch the requested content,
 #   it must set this variable to a short one-line message describing
 #   the reason for failure.
-
-#=============================================================================
-# Copyright 2010-2015 Kitware, Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# * Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-#
-# * Neither the names of Kitware, Inc., the Insight Software Consortium,
-#   nor the names of their contributors may be used to endorse or promote
-#   products derived from this software without specific prior written
-#   permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#=============================================================================

 function(ExternalData_add_test target)
   # Expand all arguments as a single string to preserve escaped semicolons.
@@ -510,17 +481,14 @@
 #-----------------------------------------------------------------------------
 # Private helper interface

-set(_ExternalData_REGEX_ALGO "MD5")
-set(_ExternalData_REGEX_EXT "md5")
+set(_ExternalData_REGEX_ALGO "MD5|SHA1|SHA224|SHA256|SHA384|SHA512")
+set(_ExternalData_REGEX_EXT "md5|sha1|sha224|sha256|sha384|sha512")
 set(_ExternalData_SELF "${CMAKE_CURRENT_LIST_FILE}")
 get_filename_component(_ExternalData_SELF_DIR "${_ExternalData_SELF}" PATH)

 function(_ExternalData_compute_hash var_hash algo file)
   if("${algo}" MATCHES "^${_ExternalData_REGEX_ALGO}$")
-    # TODO: Require CMake 2.8.7 to support other hashes with file(${algo} ...)
-    execute_process(COMMAND "${CMAKE_COMMAND}" -E md5sum "${file}"
-      OUTPUT_VARIABLE output)
-    string(SUBSTRING "${output}" 0 32 hash)
+    file("${algo}" "${file}" hash)
     set("${var_hash}" "${hash}" PARENT_SCOPE)
   else()
     message(FATAL_ERROR "Hash algorithm ${algo} unimplemented.")
@@ -625,6 +593,7 @@

   # Process options.
   set(series_option "")
+  set(recurse_option "")
   set(associated_files "")
   set(associated_regex "")
   foreach(opt ${options})
@@ -634,6 +603,9 @@
     elseif(opt STREQUAL ":")
       # Activate series matching.
       set(series_option "${opt}")
+    elseif(opt STREQUAL "RECURSE:")
+      # Activate recursive matching in directories.
+      set(recurse_option "${opt}")
     elseif("x${opt}" MATCHES "^[^][:/*?]+$")
       # Specific associated file.
       list(APPEND associated_files "${opt}")
@@ -649,6 +621,9 @@
     endif()
     if(associated_files OR associated_regex)
       message(FATAL_ERROR "Series option \"${series_option}\" not allowed with associated files.")
+    endif()
+    if(recurse_option)
+      message(FATAL_ERROR "Recurse option \"${recurse_option}\" allowed only with directories.")
     endif()
     # Load a whole file series.
     _ExternalData_arg_series()
@@ -662,6 +637,9 @@
         "must list associated files.")
     endif()
   else()
+    if(recurse_option)
+      message(FATAL_ERROR "Recurse option \"${recurse_option}\" allowed only with directories.")
+    endif()
     # Load the named data file.
     _ExternalData_arg_single()
     if(associated_files OR associated_regex)
@@ -709,11 +687,18 @@
     set(reldir "${reldir}/")
   endif()
   _ExternalData_exact_regex(reldir_regex "${reldir}")
+  if(recurse_option)
+    set(glob GLOB_RECURSE)
+    set(reldir_regex "${reldir_regex}(.+/)?")
+  else()
+    set(glob GLOB)
+  endif()

   # Find files named explicitly.
   foreach(file ${associated_files})
     _ExternalData_exact_regex(file_regex "${file}")
-    _ExternalData_arg_find_files("${reldir}${file}" "${reldir_regex}${file_regex}")
+    _ExternalData_arg_find_files(${glob} "${reldir}${file}"
+      "${reldir_regex}${file_regex}")
   endforeach()

   # Find files matching the given regular expressions.
@@ -723,13 +708,13 @@
     set(all "${all}${sep}${reldir_regex}${regex}")
     set(sep "|")
   endforeach()
-  _ExternalData_arg_find_files("${reldir}" "${all}")
+  _ExternalData_arg_find_files(${glob} "${reldir}" "${all}")
 endmacro()

 macro(_ExternalData_arg_single)
   # Match only the named data by itself.
   _ExternalData_exact_regex(data_regex "${reldata}")
-  _ExternalData_arg_find_files("${reldata}" "${data_regex}")
+  _ExternalData_arg_find_files(GLOB "${reldata}" "${data_regex}")
 endmacro()

 macro(_ExternalData_arg_series)
@@ -784,12 +769,15 @@
   # Then match base, number, and extension.
   _ExternalData_exact_regex(series_base "${relbase}")
   _ExternalData_exact_regex(series_ext "${ext}")
-  _ExternalData_arg_find_files("${relbase}*${ext}"
+  _ExternalData_arg_find_files(GLOB "${relbase}*${ext}"
     "${series_base}${series_match}${series_ext}")
 endmacro()

-function(_ExternalData_arg_find_files pattern regex)
-  file(GLOB globbed RELATIVE "${top_src}" "${top_src}/${pattern}*")
+function(_ExternalData_arg_find_files glob pattern regex)
+  cmake_policy(PUSH)
+  cmake_policy(SET CMP0009 NEW)
+  file(${glob} globbed RELATIVE "${top_src}" "${top_src}/${pattern}*")
+  cmake_policy(POP)
   foreach(entry IN LISTS globbed)
     if("x${entry}" MATCHES "^x(.*)(\\.(${_ExternalData_REGEX_EXT}))$")
       set(relname "${CMAKE_MATCH_1}")


Fixed Gtkmm.cmake

Fixed Gtkmm.cmake

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

--- CMakeModules/Gtkmm.cmake
+++ CMakeModules/Gtkmm.cmake
@@ -9,8 +9,8 @@

 macro (INCLUDE_GTKMM)
     if (MSVC)
-        include_directories
-            ($ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
+        include_directories (
+		    $ENV{GTKMM_BASEPATH}/include/gtk-2.0/gdk
             $ENV{GTKMM_BASEPATH}/include/atk-1.0
             $ENV{GTKMM_BASEPATH}/lib/gtk-2.0/include
             $ENV{GTKMM_BASEPATH}/include/gdkmm-2.4


Adapt to changes in Thrift DSO layout

Adapt to changes in Thrift DSO layout

Summary: Builds were failing after some changes in Thrift.

Differential Revision: D6045268

fbshipit-source-id: 8c06a2aa05116dd96e696caf3f55f951a1f10a8b

--- bistro/cmake/setup.cmake
+++ bistro/cmake/setup.cmake
@@ -36,13 +36,18 @@
   libproxygenhttpserver.so
   libpthread.so
   libsqlite3.so
-  libthrift.so
-  libthriftcpp2.so
-  libprotocol.so
-  libthriftprotocol.so
   libwangle.so
   libz.so
   libzstd.so
+
+  # Thrift comes in a bajillion tiny pieces :'(
+  libasync.so
+  libconcurrency.so
+  libprotocol.so
+  libthrift.so
+  libthriftcpp2.so
+  libthriftprotocol.so
+  libtransport.so
 )

 # Use this instead of target_link_libraries() because pretty much everything


cmake: remove BOTAN_INCLUDE_DIRS from ElektraCache.cmake

--- scripts/cmake/ElektraCache.cmake
+++ scripts/cmake/ElektraCache.cmake
@@ -389,7 +389,6 @@
 	NPM_EXECUTABLE
 	RONN_LOC
 	Boost_DIR
-	BOTAN_INCLUDE_DIRS
 	LIBGCRYPT_INCLUDE_DIR
 	XercesC_DIR
 	OPENSSL_INCLUDE_DIR


clang-format .proto files with 'make format'

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -860,7 +860,7 @@
     list(SORT topdir) # sort list in-place alphabetically
     foreach(item ${topdir})
       xpGlobFiles(repoFiles ${item} *)
-      xpGlobFiles(fmtFiles ${item} *.c *.h *.cpp *.hpp *.cu *.cuh)
+      xpGlobFiles(fmtFiles ${item} *.c *.h *.cpp *.hpp *.cu *.cuh *.proto)
     endforeach()
     list(REMOVE_ITEM repoFiles ${masterSrcList})
     if(repoFiles)


Add precoverage and postcoverage

Add precoverage and postcoverage

Modify coverage to call precoverage and postcoverage

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -2144,16 +2144,24 @@
       endif()
       list(APPEND XP_COVERAGE_RM '${CMAKE_BINARY_DIR}/*')
       list(REMOVE_DUPLICATES XP_COVERAGE_RM)
-      add_custom_target(coverage
+      add_custom_target(precoverage
         COMMAND ${XP_PATH_LCOV} --directory ${CMAKE_BINARY_DIR} --zerocounters
         COMMAND ${XP_PATH_LCOV} --capture --initial --directory ${CMAKE_BINARY_DIR} --output-file ${PROJECT_NAME}-base.info
-        COMMAND make test
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+        )
+      add_custom_target(postcoverage
         COMMAND ${XP_PATH_LCOV} --directory ${CMAKE_BINARY_DIR} --capture --output-file ${PROJECT_NAME}-test.info
         COMMAND ${XP_PATH_LCOV} -a ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-base.info
           -a ${CMAKE_BINARY_DIR}/${PROJECT_NAME}-test.info -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.info
         COMMAND ${XP_PATH_LCOV} --remove ${PROJECT_NAME}.info ${XP_COVERAGE_RM} --output-file ${PROJECT_NAME}-cleaned.info
         COMMAND ${XP_PATH_GENHTML} -o report ${PROJECT_NAME}-cleaned.info
         COMMAND ${CMAKE_COMMAND} -E remove ${PROJECT_NAME}*.info
+        WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+        )
+      add_custom_target(coverage
+        COMMAND make precoverage
+        COMMAND make test
+        COMMAND make postcoverage
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
         )
       xpStringAppendIfDne(CMAKE_CXX_FLAGS_DEBUG "--coverage")


new xpAddSubdirectoryProject and supporting xpParseDir functions

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -770,6 +770,41 @@
   set(${var} ${${var}} ${listVar} PARENT_SCOPE)
 endfunction()

+function(xpParseDir dir group)
+  file(GLOB items LIST_DIRECTORIES true RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${dir}/*)
+  list(SORT items)
+  set(files)
+  if(group)
+    set(group "${group}\\\\")
+  endif()
+  foreach(item ${items})
+    if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${item})
+      get_filename_component(dirName ${item} NAME)
+      xpParseDir(${item} "${group}${dirName}")
+    else()
+      list(APPEND files ${item})
+    endif()
+  endforeach()
+  if(files)
+    source_group("${group}" FILES ${files})
+    list(APPEND ${projectName}_srcs ${files})
+  endif()
+  set(${projectName}_srcs ${${projectName}_srcs} PARENT_SCOPE)
+endfunction()
+
+function(xpAddSubdirectoryProject dir)
+  cmake_parse_arguments(P "" "PROJECT_NAME" "" ${ARGN})
+  if(DEFINED P_PROJECT_NAME)
+    set(projectName ${P_PROJECT_NAME})
+  else()
+    get_filename_component(projectName ${dir} NAME)
+  endif()
+  xpParseDir(${dir} "")
+  add_custom_target(${projectName} SOURCES ${${projectName}_srcs}) # creates utility project in MSVC
+  set_property(TARGET ${projectName} PROPERTY FOLDER ${folder})
+  xpSourceListAppend(${${projectName}_srcs})
+endfunction()
+
 macro(xpSourceListAppend)
   set(_dir ${CMAKE_CURRENT_SOURCE_DIR})
   if(EXISTS ${_dir}/CMakeLists.txt)
@@ -805,8 +840,10 @@
     list(APPEND masterSrcList ${crFiles})
     file(RELATIVE_PATH relPath ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
     string(REPLACE "/" "" custTgt .codereview${relPath})
-    add_custom_target(${custTgt} SOURCES ${crFiles}) # creates utility project in MSVC
-    set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
+    if(NOT TARGET ${custTgt})
+      add_custom_target(${custTgt} SOURCES ${crFiles}) # creates utility project in MSVC
+      set_property(TARGET ${custTgt} PROPERTY FOLDER ${folder})
+    endif()
   endif()
   if(NOT ${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
     set(masterSrcList "${masterSrcList}" PARENT_SCOPE)


remove overlayexampleplugin from PluginList.cmake

--- Plugins/PluginList.cmake
+++ Plugins/PluginList.cmake
@@ -45,5 +45,4 @@
   org.mitk.gui.qt.ugvisualization:OFF
   org.mitk.gui.qt.ultrasound:OFF
   org.mitk.gui.qt.volumevisualization:OFF
-  org.mitk.gui.qt.overlayexampleplugin:OFF
 )


BUG: We need to call otb_module_impl() in all cases

--- CMake/OTBModuleExternal.cmake
+++ CMake/OTBModuleExternal.cmake
@@ -40,6 +40,7 @@
 if(OTB_BUILD_MODULE_AS_STANDALONE)
   message(STATUS "You are building this module as a standalone CMake project. Beware that dependencies to other remote modules will not be tracked.")
   include(OTBStandaloneModuleMacros)
+  otb_module_impl()
 else()

   # Setup build locations.


Fix finding Ogre framework on OS X

Fix finding Ogre framework on OS X

--HG--
branch : v1-8

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -69,7 +69,11 @@
 endif ()

-set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+if(APPLE)
+	set(OGRE_LIBRARY_NAMES "Ogre${OGRE_LIB_SUFFIX}")
+else()
+    set(OGRE_LIBRARY_NAMES "OgreMain${OGRE_LIB_SUFFIX}")
+endif()
 get_debug_names(OGRE_LIBRARY_NAMES)

 # construct search paths from environmental hints and


Re-added accidentally removed test

Re-added accidentally removed test

--- Core/Code/Testing/files.cmake
+++ Core/Code/Testing/files.cmake
@@ -143,6 +143,7 @@

 set(MODULE_CUSTOM_TESTS
     mitkDataStorageTest.cpp
+    mitkDicomSeriesReaderTest.cpp
     mitkDICOMLocaleTest.cpp
     mitkDataNodeTest.cpp
     mitkEventMapperTest.cpp


Removed commented-out code from Windows 64 CMake toolchain file.

	modified:   w64.cmake

--- w64.cmake
+++ w64.cmake
@@ -21,13 +21,6 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

-# https://cmake.org/Bug/view.php?id=9985
-# set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
-# set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
-
-# http://stackoverflow.com/questions/17721619/cmake-cross-compile-libraries-are-not-found
-# set(CMAKE_LIBRARY_PATH ../cross-tools/include/)
-
 set(CMAKE_CXX_FLAGS "-std=c++11 -static-libgcc -static-libstdc++ -static -O3 -s")
 set(CMAKE_C_FLAGS "-static-libgcc -static-libstdc++ -static -O3 -s")
 set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-static-libgcc -static-libstdc++ -static -O3 -s")


[platformer] Begin adding cutscenes.

[platformer] Begin adding cutscenes.

--- cmake/FileList.cmake
+++ cmake/FileList.cmake
@@ -213,6 +213,7 @@
 src/platformer/game/animation.cpp
 src/platformer/game/background.cpp
 src/platformer/game/camera.cpp
+src/platformer/game/cutscene.cpp
 src/platformer/game/game.cpp
 src/platformer/game/tile.cpp
 src/platformer/game/world.cpp


rm findcurl

rm findcurl

--- cmake/FindCURL.cmake
+++ cmake/FindCURL.cmake
@@ -1,45 +0,0 @@
-# - Find CURL
-#
-# Find the CURL includes and libraries
-# This module defines
-#  CURL_FOUND           - TRUE if found, FALSE otherwise
-#  CURL_INCLUDE_DIR     - Include directories for CURL
-#  CURL_LIBRARIES       - The libraries to link against to use CURL
-
-FIND_PACKAGE(PackageHandleStandardArgs)
-
-SET(CURL_SEARCHPATH
-    /usr/include/
-    /usr/local/include/
-    /opt/include/
-    /opt/local/include/
-    )
-
-FIND_PATH(CURL_INCLUDE_DIR
-    NAMES curl/curl.h
-    PATHS ${CURL_SEARCHPATH}
-    DOC "The CURL include directory")
-
-FIND_LIBRARY(CURL_LIBRARIES
-    NAMES CURL libCURL
-    PATHS
-    /usr/lib
-    /usr/local/lib
-    /usr/lib64
-    /usr/local/lib64
-    /opt/lib
-    /opt/local/lib
-    /opt/lib64
-    /opt/local/lib64
-    DOC "The CURL libraries")
-
-IF(CURL_INCLUDE_DIR AND CURL_LIBRARIES)
-    SET(CURL_FOUND TRUE)
-ELSE(CURL_INCLUDE_DIR AND CURL_LIBRARIES)
-    SET(CURL_FOUND FALSE)
-ENDIF(CURL_INCLUDE_DIR AND CURL_LIBRARIES)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL REQUIRED_VARS CURL_INCLUDE_DIR CURL_LIBRARIES)
-
-MARK_AS_ADVANCED( CURL_INCLUDE_DIR CURL_LIBRARIES )


CMake: check for PKG_CONFIG_FOUND in FindPOPT.cmake

--- cmake/FindPOPT.cmake
+++ cmake/FindPOPT.cmake
@@ -4,13 +4,15 @@
 #
 #  POPT_FOUND - System has popt
 #  POPT_INCLUDE_DIR - The popt include directory
-#  POPT_LIBRARIES - The libraries needed to use popt
+#  POPT_LIBRARY - The libraries needed to use popt

 # use pkg-config to get the directories and then use these values
 # in the FIND_PATH() and FIND_LIBRARY() calls

 find_package(PkgConfig QUIET)
-pkg_search_module(PC_POPT QUIET popt)
+if (PKG_CONFIG_FOUND)
+  pkg_search_module(PC_POPT QUIET popt)
+endif ()

 # Find the include directories
 FIND_PATH(POPT_INCLUDE_DIR


Support extra args in p4c_add_test_with_args

These args will be added directly to the test script.

--- cmake/P4CUtils.cmake
+++ cmake/P4CUtils.cmake
@@ -61,6 +61,10 @@
   set (CPPLINT_FILES ${CPPLINT_FILES} ${__cpplintFileList} PARENT_SCOPE)
 endmacro(add_cpplint_files)

+macro(p4c_test_set_name name tag alias)
+  set(${name} ${tag}/${alias})
+endmacro(p4c_test_set_name)
+
 # add a single test to the testsuite
 # Arguments:
 #   - tag is a label for the set of test suite where this test belongs
@@ -84,7 +88,7 @@
   file (APPEND ${__testfile} "cd ${P4C_BINARY_DIR}\n")
   file (APPEND ${__testfile} "${driver} ${P4C_SOURCE_DIR} $* ${P4C_SOURCE_DIR}/${p4test}")
   execute_process(COMMAND chmod +x ${__testfile})
-  set(__testname ${tag}/${alias})
+  p4c_test_set_name(__testname ${tag} ${alias})
   add_test (NAME ${__testname}
     COMMAND ${tag}/${p4test}.test ${args}
     WORKING_DIRECTORY ${P4C_BINARY_DIR})
@@ -123,10 +127,10 @@
     foreach(t ${__testfiles})
       list (FIND __xfail_list ${t} __xfail_test)
       if(__xfail_test GREATER -1)
-        p4c_add_test_with_args (${tag} ${driver} TRUE ${t} ${t} "")
+        p4c_add_test_with_args (${tag} ${driver} TRUE ${t} ${t} "${ARGN}")
         math (EXPR __xfailCounter "${__xfailCounter} + 1")
       else()
-        p4c_add_test_with_args (${tag} ${driver} FALSE ${t} ${t} "")
+        p4c_add_test_with_args (${tag} ${driver} FALSE ${t} ${t} "${ARGN}")
       endif() # __xfail_test
     endforeach() # testfiles
     math (EXPR __testCounter "${__testCounter} + ${__nTests}")


BUG: refs #0107. Fix a bug in midas_add_test macro

Make it so it's safe for multiple tests running in parallel to reference
the same file.

--- Application/CMakeScript/MIDAS.cmake
+++ Application/CMakeScript/MIDAS.cmake
@@ -122,7 +122,13 @@
   endforeach(arg)

   file(WRITE "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake"
-       "#This is an auto generated file -- do not edit\n\n")
+# Start file content
+"#This is an auto generated file -- do not edit
+
+set(midas_test_name \"${testName}\")
+")
+# End file content
+
   list(REMOVE_DUPLICATES downloadScripts)
   foreach(downloadScript ${downloadScripts})
     file(APPEND "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake" "include(\"${downloadScript}\")\n")
@@ -161,49 +167,55 @@
     set(cmake_symlink copy) # Windows has no symlinks; copy instead.
   endif()
   file(WRITE "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake"
-  "message(STATUS \"Data is here: ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\")
+# Start file content
+"message(STATUS \"Data is here: ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\")
 if(NOT EXISTS \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
-  file(DOWNLOAD \"${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\" \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
+  file(DOWNLOAD \"${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\" \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
   list(GET status 0 exitCode)
   list(GET status 1 errMsg)
   if(NOT exitCode EQUAL 0)
-    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\")
+    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\")
     message(FATAL_ERROR \"Error downloading ${checksum}: \${errMsg}\")
   endif(NOT exitCode EQUAL 0)

-  execute_process(COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" OUTPUT_VARIABLE output)
+  execute_process(COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\" OUTPUT_VARIABLE output)
   string(SUBSTRING \${output} 0 32 computedChecksum)

   if(NOT computedChecksum STREQUAL ${checksum})
-    file(READ \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" serverResponse)
-    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\")
+    file(READ \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\" serverResponse)
+    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\")
     message(FATAL_ERROR \"Error: Computed checksum (\${computedChecksum}) did not match expected (${checksum}). Server response: \${serverResponse}\")
   else(NOT computedChecksum STREQUAL ${checksum})
-    file(RENAME \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
+    file(RENAME \"${MIDAS_DATA_DIR}/MIDAS_Hashes/\${midas_test_name}_${checksum}\" \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
   endif(NOT computedChecksum STREQUAL ${checksum})
 endif(NOT EXISTS \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")

 file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${base_filepath}\")
-file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${testName}_${base_filepath}\")
-")
+file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_filepath}\")
+")
+# End file content

   if(${extractTgz})
     file(APPEND "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake"
-         "# Extract the contents of the tgz
+# Start file content
+"# Extract the contents of the tgz
 get_filename_component(dirName \"${base_filename}\" NAME_WE)
-file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${testName}_${base_filepath}/\${dirName}\")
+file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_filepath}/\${dirName}\")
 execute_process(COMMAND \"${CMAKE_COMMAND}\" -E tar xzf \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\"
-                WORKING_DIRECTORY \"${MIDAS_DATA_DIR}/${testName}_${base_filepath}/\${dirName}\")
+                WORKING_DIRECTORY \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_filepath}/\${dirName}\")
 file(REMOVE_RECURSE \"${MIDAS_DATA_DIR}/${base_filepath}/\${dirName}\")
-file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${base_filepath}/\${dirName}\" \"${MIDAS_DATA_DIR}/${base_filepath}/\${dirName}\")
-")
+file(RENAME \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_filepath}/\${dirName}\" \"${MIDAS_DATA_DIR}/${base_filepath}/\${dirName}\")
+")
+# End file content
   else()
     file(APPEND "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake"
-         "# Create a human-readable file name for the data.
-file(REMOVE \"${MIDAS_DATA_DIR}/${testName}_${base_file}\")
-execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${cmake_symlink} \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" WORKING_DIRECTORY \"${MIDAS_DATA_DIR}\")
-file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" \"${MIDAS_DATA_DIR}/${base_file}\")
-")
+# Start file content
+"# Create a human-readable file name for the data.
+file(REMOVE \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_file}\")
+execute_process(COMMAND \"${CMAKE_COMMAND}\" -E ${cmake_symlink} \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_file}\" WORKING_DIRECTORY \"${MIDAS_DATA_DIR}\")
+file(RENAME \"${MIDAS_DATA_DIR}/\${midas_test_name}_${base_file}\" \"${MIDAS_DATA_DIR}/${base_file}\")
+")
+# End file content
   endif(${extractTgz})

   list(APPEND downloadScripts "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake")


exclude subdriectories with test code from coverage report

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -142,7 +142,7 @@

 		# Capturing lcov counters and generating report
 		COMMAND ${LCOV_PATH} --directory . --capture --output-file ${_outputname}.info
-                COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' '/opt/*' --output-file ${_outputname}.info.cleaned
+                COMMAND ${LCOV_PATH} --remove ${_outputname}.info 'tests/*' 'test/*' '/usr/*' '/opt/*' --output-file ${_outputname}.info.cleaned
 		COMMAND ${GENHTML_PATH} -o ${_outputname} ${_outputname}.info.cleaned
 		COMMAND ${CMAKE_COMMAND} -E remove ${_outputname}.info ${_outputname}.info.cleaned


show coverage for Python wrappers

show coverage for Python wrappers

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -17,7 +17,7 @@
 add_custom_target(coverage-cpp
     COMMAND ${LCOV_EXECUTABLE}
     --capture
-    --directory ${CMAKE_BINARY_DIR}/cpp
+    --directory ${CMAKE_BINARY_DIR}
     --output-file=${CPP_COVERAGE_FILE}
     COMMAND ${GENHTML_EXECUTABLE} ${CPP_COVERAGE_FILE}
     --output-directory ${CPP_COVERAGE_OUTPUT_DIRECTORY}


Update date.

Update date.

--- cmake/FindPrimitiv.cmake
+++ cmake/FindPrimitiv.cmake
@@ -22,7 +22,7 @@
 #
 # Author: Yusuke Oda (odashi) <yus.takara@gmail.com>
 # Created: 2017/08/13
-# Updated: 2017/12/15
+# Updated: 2017/12/16
 #
 # This script is provided as a part of the primitiv core library.
 # Redistributing and using this script is allowed according to


cmake: Fix compiler warnings when testing for vargs

--- cmake/StdargDetect.cmake
+++ cmake/StdargDetect.cmake
@@ -40,6 +40,7 @@
     foreach (KEYWORD "va_copy" "_va_copy" "__va_copy")
         check_c_source_compiles ("
                      #include <stdio.h>
+                     #include <stdlib.h>
                      #include <stdarg.h>

                      void f (int i, ...) {


Update luajit check

Update luajit check

--- cmake/check_luajit.cmake
+++ cmake/check_luajit.cmake
@@ -6,6 +6,6 @@
   RESULT_VARIABLE RESULT
 )

-if(RESULT EQUAL 0)
+if(RESULT EQUAL 1)
   message(FATAL_ERROR "luajit doesn't support being embedded; to use color_coded, you must install vim without luajit")
 endif()


cmake: don't create share/ and examples/ in the build directory

Conventionally, 'share' means read-only files, so it is not an
appropriate place for configuration files.  Instead:

- configurations files (written by applications) go in <build>/config
- resource files (like default configurations files) go in <src>/share

And about the 'examples' directory: according to grep, it is useless.

Former-commit-id: 91be52cf8981e3d6b556fe3e2a6fdff7dbfdf34a

--- cmake/dependencies.cmake
+++ cmake/dependencies.cmake
@@ -182,17 +182,3 @@
         endforeach()
     endif()
 endif()
-
-# creating examples/Object and examples/Objects folder
-file(MAKE_DIRECTORY "${SOFA_BUILD_DIR}/examples/Object")
-file(MAKE_DIRECTORY "${SOFA_BUILD_DIR}/examples/Objects")
-
-# copying default config files
-if(NOT CONFIG_FILES_ALREADY_COPIED)
-    file(GLOB configFiles "${SOFA_SRC_DIR}/share/config/default/*.*")
-    foreach(configFile ${configFiles})
-        file(COPY ${configFile} DESTINATION "${SOFA_BUILD_DIR}/share/config")
-    endforeach()
-
-    set(CONFIG_FILES_ALREADY_COPIED 1 CACHE INTERNAL "Config files copied" FORCE)
-endif()


With this example there's no need for opencv 3.0

--- src/cmake/findDependencies.cmake
+++ src/cmake/findDependencies.cmake
@@ -2,8 +2,8 @@
 #
 # you may need to set OpenCV_DIR variable to the absolute path to the directory
 # containing OpenCVConfig.cmake file via the command line or GUI
-#find_package(OpenCV REQUIRED)
-find_package(OpenCV 3.1.0 EXACT REQUIRED)
+find_package(OpenCV REQUIRED)
+# find_package(OpenCV 3.1.0 EXACT REQUIRED)

 # If the package has been found, several variables will
 # be set, you can find the full list with descriptions


Allow CPack generator to be set on the cmdline

Allow commandline Cpack generator setting arguments to override default so we are not forced to always build debs on rpm based systems or vise versa

--- src/ibp/cmake/LStoreCommon.cmake
+++ src/ibp/cmake/LStoreCommon.cmake
@@ -123,8 +123,12 @@
 # Below is used for building packages
 set(CPACK_PACKAGE_NAME "accre-${LSTORE_PROJECT_NAME}")
 set(CPACK_PACKAGE_VERSION "${LSTORE_PROJECT_VERSION}")
-set(CPACK_GENERATOR "RPM;DEB")
-set(CPACK_SOURCE_GENERATOR "RPM;DEB")
+if(NOT DEFINED CPACK_GENERATOR)
+    set(CPACK_GENERATOR "RPM;DEB")
+endif(NOT DEFINED CPACK_GENERATOR)
+if(NOT DEFINED CPACK_SOURCE_GENERATOR)
+    set(CPACK_SOURCE_GENERATOR "RPM;DEB")
+endif(NOT DEFINED CPACK_SOURCE_GENERATOR)
 set(CPACK_PACKAGE_RELEASE ${LSTORE_PROJECT_REVISION})
 set(CPACK_PACKAGE_CONTACT "Andrew Melo or Alan Tackett")
 set(CPACK_PACKAGE_VENDOR "Advanced Computing Center for Research and Education, Vanderbilt University")


Tiny modif on cmake target

Tiny modif on cmake target

--- share/FindLustre.cmake
+++ share/FindLustre.cmake
@@ -82,7 +82,7 @@
   endif()

   if(LUS_NODE)
-    set(LUSTRE_NODE_OPT "-node ${LUS_NODE}")
+    set(LUSTRE_NODE_OPT "-node;${LUS_NODE}")
     set(LUSTRE_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/lus_${LUS_LIBNAME}/${LUS_NODE}")
   else()
     set(LUSTRE_NODE_OPT "")
@@ -90,7 +90,7 @@
   endif()

   if (LUS_VERBOSE)
-    set(LUSTRE_VERBOSE_OPT "-verbose ${LUS_VERBOSE}")
+    set(LUSTRE_VERBOSE_OPT "-verbose;${LUS_VERBOSE}")
   else()
     # the default is to be quiet.
     set(LUSTRE_VERBOSE_OPT "-verbose;0")
@@ -105,6 +105,10 @@
     get_filename_component(E ${LFILE} EXT)
     if ("${E}" STREQUAL ".lus")
       set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h ${LUSTRE_OUTPUT_DIR}/${L}.c ${LUSTRE_OUTPUT_DIR}/${L}_alloc.h)
+      if(LUS_NODE)
+         list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}_main.c)
+         list(APPEND LUSTRE_GENERATED_FILES ${LUSTRE_INCLUDE_DIR}/io_frontend.c)
+      endif()
     elseif("${E}" STREQUAL ".lusi")
       set(LUSTRE_GENERATED_FILES ${LUSTRE_OUTPUT_DIR}/${L}.h)
     endif()
@@ -121,9 +125,15 @@
   endforeach()

   include_directories(${LUSTRE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${LUSTRE_OUTPUT_DIR})
+  if(LUS_NODE)
+  add_executable(${LUS_LIBNAME}
+              ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
+              )
+  else()
   add_library(${LUS_LIBNAME} SHARED
               ${GLOBAL_LUSTRE_GENERATED_C_FILES} ${LUS_USER_C_FILES}
               )
+  endif()
   set_target_properties(${LUS_LIBNAME} PROPERTIES COMPILE_FLAGS "-std=c99")
   set(LUSTRE_GENERATED_C_FILES_${LUS_LIBNAME} "${GLOBAL_LUSTRE_GENERATED_C_FILES}" PARENT_SCOPE)
   message(STATUS "Lustre: Added rule for building lustre library: ${LUS_LIBNAME}")


Temporarily disable bridge generation under Windows

--- CMake/CompileAllogenInterface.cmake
+++ CMake/CompileAllogenInterface.cmake
@@ -56,7 +56,7 @@
     set(multiValueArgs IDL IMPORT)
     cmake_parse_arguments(IFT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-    if (NOT Maven_FOUND OR NOT ALLOGEN_COMPILER)
+    if (NOT Maven_FOUND OR NOT ALLOGEN_COMPILER OR ${CMAKE_HOST_SYSTEM_NAME} MATCHES "Windows")
         file(WRITE ${IFT_MODULE_NAME} "")
         return()
     endif ()
@@ -64,7 +64,10 @@
     set(import_args "")
     if(IFT_IMPORT)
         foreach(dir ${IFT_IMPORT})
-            set(import_args ${import_args} --import '${dir}')
+            if(NOT IS_ABSOLUTE ${dir})
+                set(dir ${CMAKE_CURRENT_SOURCE_DIR}/${dir})
+            endif()
+            set(import_args ${import_args} --import $<SHELL_PATH:${dir}>)
         endforeach()
     endif()

@@ -80,8 +83,11 @@

     set(idls)
     foreach(idl ${IFT_IDL})
-        string(REPLACE " " "\\ " idl_repl ${idl})
-        list(APPEND idls '${idl_repl}')
+        #string(REPLACE " " "\\ " idl_repl ${idl})
+        if(NOT IS_ABSOLUTE ${idl})
+            set(dir ${CMAKE_CURRENT_SOURCE_DIR}/${idl})
+        endif()
+        list(APPEND idls $<SHELL_PATH:${idl}>)
     endforeach()

     set(args "")
@@ -89,11 +95,23 @@
         list(APPEND args --pinvokedll ${IFT_PINVOKE_DLL})
     endif()

+    if(NOT IS_ABSOLUTE ${IFT_TARGET_DIR})
+        set(IFT_TARGET_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${IFT_TARGET_DIR})
+    endif()
+
+    if(NOT IS_ABSOLUTE ${IFT_BRIDGE_DIR})
+        set(IFT_BRIDGE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${IFT_BRIDGE_DIR})
+    endif()
+
+#        MESSAGE(${Maven_EXECUTABLE} compile exec:java
+#                -f $<SHELL_PATH:${ALLOGEN_COMPILER}>
+#                -Dexec.args=\"--target '${IFT_LANGUAGE}' --target-dir $<SHELL_PATH:${IFT_TARGET_DIR}> --bridge-dir $<SHELL_PATH:${IFT_BRIDGE_DIR}> ${ns_attr} ${module_args} ${args} ${import_args} ${idls}\")
+
     add_custom_command(
             OUTPUT ${IFT_MODULE_NAME}
             COMMAND ${Maven_EXECUTABLE} compile exec:java
-                -f ${ALLOGEN_COMPILER}
-                -Dexec.args=\"--target '${IFT_LANGUAGE}' --target-dir '${IFT_TARGET_DIR}' --bridge-dir '${IFT_BRIDGE_DIR}' ${ns_attr} ${module_args} ${args} ${import_args} ${idls}\"
+                -f $<SHELL_PATH:${ALLOGEN_COMPILER}>
+                -Dexec.args=\"--target '${IFT_LANGUAGE}' --target-dir $<SHELL_PATH:${IFT_TARGET_DIR}> --bridge-dir $<SHELL_PATH:${IFT_BRIDGE_DIR}> ${ns_attr} ${module_args} ${args} ${import_args} ${idls}\"
             COMMENT "Compiling Allogen interface files..."
             DEPENDS ${IFT_IDL} ${IFT_IMPORT})
     if(IFT_TARGET)


Update toolchain.arm-none-eabi.cmake (#2437)

--- CMake/toolchain.arm-none-eabi.cmake
+++ CMake/toolchain.arm-none-eabi.cmake
@@ -18,7 +18,7 @@

 find_program(COMPILER_ON_PATH "${TARGET_TRIPLET}gcc${TOOLCHAIN_EXT}" CMAKE_FIND_ROOT_PATH_BOTH)

-if(DEFINED ENV{ARM_GCC_PATH})
+if(DEFINED $ENV{ARM_GCC_PATH})
     # try to find GCC using the environment variable first
     file(TO_CMAKE_PATH $ENV{ARM_GCC_PATH} ARM_TOOLCHAIN_PATH)
     message(STATUS "Using ENV variable ARM_GCC_PATH = '${ARM_TOOLCHAIN_PATH}'")