Some minor fixes for OSX related to libraries (linking shared libs and DYLD vs. LD).

--- opensplice-config.cmake
+++ opensplice-config.cmake
@@ -4,7 +4,7 @@

 set(OPENSPLICE_INCLUDE_DIR ${OPENSPLICE_PREFIX}/include/opensplice ${OPENSPLICE_PREFIX}/include/opensplice/sys ${OPENSPLICE_PREFIX}/include/opensplice/dcps/C++/SACPP)
 set(OPENSPLICE_INCLUDE_DIRS ${OPENSPLICE_INCLUDE_DIR})
-set(libs cmjni cmxml commonserv dcpsgapi dcpsisocpp dcpsjni dcpssacpp dcpssac dcpssaj ddsconfparser ddsconf ddsdatabase ddsi2 ddskernel ddsloccollections ddslocutil ddsosnet ddsos ddsserialization ddsuser ddsutil durability spliced)
+set(libs cmxml commonserv dcpsgapi dcpsisocpp dcpssacpp dcpssac ddsconfparser ddsconf ddsdatabase ddsi2 ddskernel ddsloccollections ddslocutil ddsosnet ddsos ddsserialization ddsuser ddsutil durability spliced)
 set(OPENSPLICE_LIBRARY "")
 foreach(lib ${libs})
   set(tmplib tmplib-NOTFOUND)
@@ -15,10 +15,14 @@
   set(OPENSPLICE_LIBRARY ${OPENSPLICE_LIBRARY} ${tmplib})
 endforeach()
 set(OPENSPLICE_LIBRARIES ${OPENSPLICE_LIBRARY})
+set(OPENSPLICE_ONLY_LIBRARIES ${OPENSPLICE_LIBRARY})
 set(OPENSPLICE_DEFINITIONS)

 # hack
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/setup.sh "export OSPL_URI=file:///${OPENSPLICE_PREFIX}/etc/opensplice/config/ospl.xml\n")
+if(APPLE)
+  file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/setup.sh "export DYLD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:\$DYLD_LIBRARY_PATH"\n)
+endif()

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE
@@ -41,12 +45,18 @@
     set(outsrcs ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}Dcps.cpp ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}Dcps_impl.cpp ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}SplDcps.cpp ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}.cpp)
     set(outhdrs ${CMAKE_CURRENT_BINARY_DIR}/idl/ccpp_${idlbase}.h ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}.h ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}Dcps.h ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}Dcps_impl.h ${CMAKE_CURRENT_BINARY_DIR}/idl/${idlbase}SplDcps.h)
     set(outfiles ${outsrcs} ${outhdrs})
+    if(APPLE)
+      set(idlcmd PATH=${OPENSPLICE_PREFIX}/bin:$ENV{PATH} OSPL_TMPL_PATH=${OPENSPLICE_PREFIX}/etc/opensplice/idlpp DYLD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:$ENV{LD_LIBRARY_PATH} ${OPENSPLICE_IDLPP} -l c++ -S ${CMAKE_CURRENT_SOURCE_DIR}/${idl})
+    else()
+      set(idlcmd PATH=${OPENSPLICE_PREFIX}/bin:$ENV{PATH} OSPL_TMPL_PATH=${OPENSPLICE_PREFIX}/etc/opensplice/idlpp LD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:$ENV{LD_LIBRARY_PATH} ${OPENSPLICE_IDLPP} -l c++ -S ${CMAKE_CURRENT_SOURCE_DIR}/${idl})
+    endif()
     add_custom_command(OUTPUT ${outfiles}
-                       COMMAND PATH=${OPENSPLICE_PREFIX}/bin:$ENV{PATH} OSPL_TMPL_PATH=${OPENSPLICE_PREFIX}/etc/opensplice/idlpp LD_LIBRARY_PATH=${OPENSPLICE_PREFIX}/lib:$ENV{LD_LIBRARY_PATH} ${OPENSPLICE_IDLPP} -l c++ -S ${CMAKE_CURRENT_SOURCE_DIR}/${idl}
+                       COMMAND ${idlcmd}
                        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/idl
                        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${idl})
     add_custom_target(idl_${idlbase} ALL DEPENDS ${outfiles})
     add_library(idl_${idlbase}lib SHARED ${outsrcs})
+    target_link_libraries(idl_${idlbase}lib ${OPENSPLICE_ONLY_LIBRARIES})
     set(OPENSPLICE_LIBRARY idl_${idlbase}lib ${OPENSPLICE_LIBRARY})
     set(OPENSPLICE_LIBRARIES ${OPENSPLICE_LIBRARY})
   endforeach()


Fix rpath (using the output of GNUInstallDirs)

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@3520 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/LibraryProjectSetup.cmake
+++ Numerics/cmake/LibraryProjectSetup.cmake
@@ -27,7 +27,7 @@
   SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

   # the RPATH to be used when installing
-  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")

   # don't add the automatically determined parts of the RPATH
   # which point to directories outside the build tree to the install RPATH


CMake: Fix tools being enabled on mobile platforms. CMake: Fix dependent options not being honored in some cases.

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -38,6 +38,12 @@
         endif ()
     endforeach()
 endif ()
+
+foreach (feature ${URHO3D_FEATURES})
+    set (URHO3D_${feature} ON)
+endforeach()
+
+include(CMakeDependentOption)

 # Define an _option or dependent _option if it's value is not defined yet.
 macro(_option VAR DESCRIPTION VALUE)
@@ -80,8 +86,6 @@
     set (DESKTOP ON CACHE BOOL "" FORCE)
 endif ()

-include(CMakeDependentOption)
-
 # Build properties
 _option(BUILD_SHARED_LIBS                        "Build engine as shared library."       ON)
 _option(URHO3D_ENABLE_ALL                        "Enable (almost) all engine features."  ON)
@@ -120,8 +124,8 @@
 set(EMSCRIPTEN_MEMORY_LIMIT 128 CACHE STRING "Memory limit in megabytes. Set to 0 for dynamic growth.")

 # Misc
-_option2(URHO3D_EXTRAS            "Build extra tools"                                     ${URHO3D_ENABLE_ALL} "NOT WEB AND NOT MOBILE"        OFF)
-_option2(URHO3D_TOOLS             "Tools enabled"                                         ${URHO3D_ENABLE_ALL} "NOT WEB AND NOT MOBILE"        OFF)
+_option2(URHO3D_EXTRAS            "Build extra tools"                                     ${URHO3D_ENABLE_ALL} "NOT WEB;NOT MOBILE"            OFF)
+_option2(URHO3D_TOOLS             "Tools enabled"                                         ${URHO3D_ENABLE_ALL} "NOT WEB;NOT MOBILE"            OFF)
 _option(URHO3D_SAMPLES            "Build samples"                                         OFF)
 _option(URHO3D_DOCS               "Build documentation."                                  OFF)
 _option2(URHO3D_MERGE_STATIC_LIBS "Merge third party dependency libs to Urho3D.a"         OFF "NOT BUILD_SHARED_LIBS"                          OFF)
@@ -170,10 +174,6 @@
     message(WARNING "Shared builds unsupported when compiling with emscripten")     # For now.
 endif ()

-foreach (feature ${URHO3D_FEATURES})
-    set (URHO3D_${feature} ON)
-endforeach()
-
 if (ANDROID)
     set (SDL_CPUINFO ON)
 endif ()


CMake: Declare URHO3D_WIN32_CONSOLE option.

Resolves #73

--- CMake/Modules/UrhoOptions.cmake
+++ CMake/Modules/UrhoOptions.cmake
@@ -102,6 +102,7 @@

 if (WIN32)
     set(URHO3D_RENDERER D3D11 CACHE STRING "Select renderer: D3D9 | D3D11 | OpenGL")
+    option(URHO3D_WIN32_CONSOLE "Show log messages in win32 console"                                     OFF                                                     )
 elseif (IOS OR ANDROID)
     set(URHO3D_RENDERER GLES2 CACHE STRING "Select renderer: GLES2 | GLES3")
 else ()


BUG: fix sse test for msvc, gnu, clang

BUG: fix sse test for msvc, gnu, clang

otbsiftfast was enabling /fp:fast option with msvc along with SSE.
This is not normal as MSDN docs doesn't mention anything about /fp:fast
when using /arch:SSE.

I think it has a problematic behaviour with otb's dashboard
testing. Many --compare-image tests we do are with zero tolerance.
So it has to go.

--- CMake/OTBCheckSSEFeatures.cmake
+++ CMake/OTBCheckSSEFeatures.cmake
@@ -8,28 +8,42 @@
       message(STATUS "For apple assume sse2 is on for all intel builds")
     return()
   endif()
+  set(sse_flags_detected)
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+    set(CMAKE_REQUIRED_FLAGS "-msse2")
+    set(sse_flags_detected "-msse2 -mfpmath=sse")
+  elseif(MSVC AND NOT CMAKE_CL_64)
+    set(CMAKE_REQUIRED_FLAGS "/arch:SSE2")
+    set(sse_flags_detected "/arch:SSE2")
+  endif()

-  if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
-    set(CMAKE_REQUIRED_FLAGS "-msse2")
-    check_cxx_source_runs("
+  check_cxx_source_runs("
     #include <emmintrin.h>
-    int main()
+    int main ()
     {
-        __m128d a, b;
-        double vals[2] = {0};
-        a = _mm_loadu_pd(vals);
-        b = _mm_add_pd(a,a);
-        _mm_storeu_pd(vals,b);
-        return 0;
-     }" HAVE_SSE2_FLAGS)
-
-    if(HAVE_SSE2_FLAGS)
-      set(${sse_flags} "-msse2 -mfpmath=sse" PARENT_SCOPE)
-      return()
-    endif()
+     __m128d a, b;
+     double vals[2] = {0};
+     a = _mm_loadu_pd (vals);
+     b = _mm_add_pd (a,a);
+     _mm_storeu_pd (vals,b);
+     return (0);
+    }"
+    HAVE_SSE2_EXTENSIONS)

+  if(HAVE_SSE2_EXTENSIONS)
+    set(${sse_flags} "${sse_flags_detected}" PARENT_SCOPE)
+    return()
+  endif()
+
+  if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
     set(CMAKE_REQUIRED_FLAGS "-msse")
-    check_cxx_source_runs("
+    set(sse_flags_detected "-msse -mfpmath=sse")
+  elseif(MSVC AND NOT CMAKE_CL_64)
+    set(CMAKE_REQUIRED_FLAGS "/arch:SSE")
+    set(sse_flags_detected "/arch:SSE")
+  endif()
+
+  check_cxx_source_runs("
     #include <xmmintrin.h>
     int main()
     {
@@ -40,37 +54,10 @@
         b = _mm_add_ps(a,b);
         _mm_storeu_ps(vals,b);
         return 0;
-    }" HAVE_SSE_FLAGS)
-
-    if(HAVE_SSE_FLAGS)
-      set(${sse_flags} "-msse -mfpmath=sse" PARENT_SCOPE)
-      return()
-    endif()
+    }" HAVE_SSE_EXTENSIONS)

-  elseif(MSVC)
-    if(CMAKE_SIZEOF_VOID_P EQUAL 8)
-      return()
-    endif()
-    check_cxx_source_runs("
-      #include <emmintrin.h>
-
-        int main()
-        {
-          __m128d a, b;
-          double vals[2] = {0};
-          a = _mm_loadu_pd(vals);
-          b = _mm_add_pd(a,a);
-          _mm_storeu_pd(vals,b);
-          return 0;
-        }" HAVE_SSE_FLAGS)
-
-    if(HAVE_SSE_FLAGS)
-      message(STATUS "Performing Test HAVE_SSE_FLAGS - Success")
-      set(${sse_flags} "/arch:SSE2 /fp:fast -D__SSE__ -D__SSE2__" PARENT_SCOPE)
-      return()
-    else()
-      message(STATUS "Performing Test HAVE_SSE_FLAGS - Failed")
-      return()
-    endif()
-endif()
+  if(HAVE_SSE_EXTENSIONS)
+    set(${sse_flags} "${sse_flags_detected}" PARENT_SCOPE)
+    return()
+  endif()
 endfunction() #check_sse_features


Print message if CTK_{APP, LIB, PLUGIN} options set to ON because of BUILD_ALL options

See #258

--- CMake/ctkMacroOptionUtils.cmake
+++ CMake/ctkMacroOptionUtils.cmake
@@ -37,6 +37,7 @@
   ctk_option(CTK_LIB ${name} ${doc} ${default} ${ARGN})
   if(CTK_BUILD_ALL_LIBRARIES)
     set(CTK_LIB_${name} 1)
+    message(STATUS "Enabling [CTK_LIB_${name}] because of [CTK_BUILD_ALL_LIBRARIES:${CTK_BUILD_ALL_LIBRARIES}] evaluates to True")
   endif()
 endmacro()

@@ -44,6 +45,7 @@
   ctk_option(CTK_PLUGIN ${name} ${doc} ${default} ${ARGN})
   if(CTK_BUILD_ALL_PLUGINS)
     set(CTK_PLUGIN_${name} 1)
+    message(STATUS "Enabling [CTK_PLUGIN_${name}] because of [CTK_BUILD_ALL_PLUGINS:${CTK_BUILD_ALL_PLUGINS}] evaluates to True")
   endif()
 endmacro()

@@ -51,6 +53,7 @@
   ctk_option(CTK_APP ${name} ${doc} ${default} ${ARGN})
   if(CTK_BUILD_ALL_APPS)
     set(CTK_APP_${name} 1)
+    message(STATUS "Enabling [CTK_APP_${name}] because of [CTK_BUILD_ALL_APPS:${CTK_BUILD_ALL_APPS}] evaluates to True")
   endif()
 endmacro()


try fixing ninja make

try fixing ninja make

--- CMake/hoomd/HOOMDHIPSetup.cmake
+++ CMake/hoomd/HOOMDHIPSetup.cmake
@@ -2,10 +2,7 @@
     find_package(HIP)

     if (HIP_FOUND)
-        OPTION(HIP_NVCC_FLAGS "Flags used by HIP for compiling with nvcc")
-        MARK_AS_ADVANCED(HIP_NVCC_FLAGS)
-
-        # call hipcc to tell us about the nvcc options
+        # call hipcc to tell us about the backend compiler
         set(ENV{HIPCC_VERBOSE} 1)

         FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/hip_test.cc "
@@ -49,22 +46,11 @@
         set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
             "<CMAKE_CUDA_COMPILER> ${CMAKE_CUDA_HOST_FLAGS} <DEFINES> <INCLUDES> <FLAGS> -c <SOURCE> -o <OBJECT>")

+        # hipcc can write dependencies (undocumented CMake option)
+        set(CMAKE_DEPFILE_FLAGS_CUDA "-MD -MT <OBJECT> -MF <DEPFILE>"
+
         # don't let CMake examine the compiler, because it will fail
         SET(CMAKE_CUDA_COMPILER_FORCED TRUE)
-
-        # drop the compiler exeuctable and the "hipcc-cmd"
-        LIST(REMOVE_AT _hipcc_verbose_options 0 1)
-
-        # drop the -x cu option to not duplicate it with CMake's options
-        LIST(FIND _hipcc_verbose_options "-x" _idx)
-        if (NOT ${_idx} EQUAL "-1")
-        math(EXPR _idx_plus_one "${_idx} + 1")
-        LIST(REMOVE_AT _hipcc_verbose_options ${_idx} ${_idx_plus_one})
-        endif()
-
-        # finally drop the test file
-        LIST(FILTER _hipcc_verbose_options EXCLUDE REGEX test.cc)
-        SET(HIP_NVCC_FLAGS ${_hipcc_options_str})

         #search for HIP include directory
         find_path(HIP_INCLUDE_DIR hip/hip_runtime.h
@@ -93,7 +79,6 @@
         set(HIP_VERSION_MAJOR "(CUDART_VERSION/1000)")
         set(HIP_VERSION_MINOR "(CUDART_VERSION - (CUDART_VERSION/1000)*1000)/10")
         set(HIP_VERSION_PATCH "0")
-        set(HIP_NVCC_FLAGS "")
         set(HIP_PLATFORM "nvcc")
         set(CUB_INCLUDE_DIR "$<IF:$<STREQUAL:${CMAKE_PROJECT_NAME},HOOMD>,${CMAKE_CURRENT_SOURCE_DIR},${HOOMD_INSTALL_PREFIX}/${PYTHON_SITE_INSTALL_DIR}/include>/hoomd/extern/cub/")

@@ -117,7 +102,7 @@
             set_property(TARGET HIP::hip APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "__HIP_PLATFORM_HCC__")
         endif()

-        # set HIP_VERSION_* on non-CUDA targets (the version is already defined on CUDA targets through HIP_NVCC_FLAGS)
+        # set HIP_VERSION_* on non-CUDA targets (the version is already defined on AMD targets through hipcc)
         set_property(TARGET HIP::hip APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS
             $<$<NOT:$<COMPILE_LANGUAGE:CUDA>>:HIP_VERSION_MAJOR=${HIP_VERSION_MAJOR}>)
         set_property(TARGET HIP::hip APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS


Update MatchPoint third party file

Update MatchPoint third party file

Signed-off-by: Ralf Floca <fec4a647ab34f54e20bea9a9e3e1c74f13aefc78@dkfz-heidelberg.de>

--- CMakeExternals/MatchPoint.cmake
+++ CMakeExternals/MatchPoint.cmake
@@ -25,9 +25,8 @@
     set(download_step SOURCE_DIR ${MatchPoint_SOURCE_DIR})
   else()
     set(download_step
-        URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MatchPoint_rev1372.tar.gz
-        URL_MD5 bfaabc06873a532c06bf9dfea173d3aa
-        #SOURCE_DIR ${ep_prefix}/${proj}
+        URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MatchPoint_rev1481.tar.gz
+        URL_MD5 82b9b1bb3f909f2e00397e285ce8c981
        )
   endif()


Update FindFreetype.cmake

Update FindFreetype.cmake

--- CMakeModules/FindFreetype.cmake
+++ CMakeModules/FindFreetype.cmake
@@ -26,7 +26,7 @@
       NO_DEFAULT_PATH
       #PATH_SUFFIXES lib64 lib
     )
-    set(FREETYPE_LIBRARY debug ${FREETYPE_LIBRARY_DEBUG} optimized ${FREETYPE_LIBRARY_RELEASE})
+    set(FREETYPE_LIBRARY "debug ${FREETYPE_LIBRARY_DEBUG} optimized ${FREETYPE_LIBRARY_RELEASE}" CACHE INTERNAL "")
     message(${FREETYPE_LIBRARY})
 else()
     FIND_LIBRARY(FREETYPE_LIBRARY


cleanup externals file

cleanup externals file

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -1,14 +1,25 @@
+# MegaMol
+# Copyright (c) 2020, MegaMol Dev Team
+# All rights reserved.
+#
+
+# Require git
+find_package(Git REQUIRED)
+
 # Clone external script
-if(NOT EXISTS "${CMAKE_BINARY_DIR}/script-externals")
+if (NOT EXISTS "${CMAKE_BINARY_DIR}/script-externals")
   message(STATUS "Downloading external scripts")
   execute_process(COMMAND
     ${GIT_EXECUTABLE} clone -b v2.3 https://github.com/UniStuttgart-VISUS/megamol-cmake-externals.git script-externals --depth 1
     WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
     ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif()
+endif ()

 # Include external script
 include("${CMAKE_BINARY_DIR}/script-externals/cmake/External.cmake")
+
+# Commonly needed for path setup
+include(GNUInstallDirs)

 #
 # Centralized function to require externals to add them once by invoking
@@ -20,44 +31,25 @@
 function(require_external NAME)
   set(FETCHCONTENT_QUIET ON CACHE BOOL "")

-  # Header-only libraries #####################################################
+  # ###########################################################################
+  # ### Header-only libraries #################################################
+  # ###########################################################################

   # asmjit
-  if(NAME STREQUAL "asmjit")
-    if(TARGET asmjit)
-      return()
-    endif()
+  if (NAME STREQUAL "asmjit")
+    if (TARGET asmjit)
+      return()
+    endif ()

     add_external_headeronly_project(asmjit INTERFACE
       GIT_REPOSITORY https://github.com/asmjit/asmjit.git
-      GIT_TAG "8474400e82c3ea65bd828761539e5d9b25f6bd83" )
-
-  # Corsair CUE SDK
-  elseif(NAME STREQUAL "CUESDK")
-    if (TARGET CUESDK)
-      return()
-    endif()
-
-    FetchContent_Declare(
-      cuesdk_archive
-      URL https://github.com/CorsairOfficial/cue-sdk/releases/download/v3.0.378/CUESDK_3.0.378.zip)
-    FetchContent_GetProperties(cuesdk_archive)
-    if (NOT cuesdk_archive_POPULATED)
-      FetchContent_Populate(cuesdk_archive)
-      add_library(CUESDK SHARED IMPORTED GLOBAL)
-      set_target_properties(CUESDK PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${cuesdk_archive_SOURCE_DIR}/include"
-        IMPORTED_CONFIGURATIONS "Release"
-        IMPORTED_LOCATION "${cuesdk_archive_SOURCE_DIR}/redist/x64/CUESDK.x64_2017.dll"
-        IMPORTED_IMPLIB "${cuesdk_archive_SOURCE_DIR}/lib/x64/CUESDK.x64_2017.lib")
-      install(DIRECTORY "${cuesdk_archive_SOURCE_DIR}/redist/x64/" DESTINATION "bin" FILES_MATCHING PATTERN "*2017.dll")
-    endif()
+      GIT_TAG "8474400e82c3ea65bd828761539e5d9b25f6bd83")

   # Delaunator
-  elseif(NAME STREQUAL "Delaunator")
-    if(TARGET Delaunator)
-      return()
-    endif()
+  elseif (NAME STREQUAL "Delaunator")
+    if (TARGET Delaunator)
+      return()
+    endif ()

     add_external_headeronly_project(Delaunator
       GIT_REPOSITORY https://github.com/delfrrr/delaunator-cpp.git
@@ -65,30 +57,30 @@
       INCLUDE_DIR "include")

   # Eigen
-  elseif(NAME STREQUAL "Eigen")
-    if(TARGET Eigen)
-      return()
-    endif()
+  elseif (NAME STREQUAL "Eigen")
+    if (TARGET Eigen)
+      return()
+    endif ()

     add_external_headeronly_project(Eigen
       GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
       GIT_TAG "3.3.7")

   # glm
-  elseif(NAME STREQUAL "glm")
-    if(TARGET glm)
-      return()
-    endif()
+  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.9.8")

   # glowl
-  elseif(NAME STREQUAL "glowl")
-    if(TARGET glowl)
-      return()
-    endif()
+  elseif (NAME STREQUAL "glowl")
+    if (TARGET glowl)
+      return()
+    endif ()

     add_external_headeronly_project(glowl
       GIT_REPOSITORY https://github.com/invor/glowl.git
@@ -97,23 +89,23 @@
     target_compile_definitions(glowl INTERFACE GLOWL_OPENGL_INCLUDE_GLAD2)

   # json
-  elseif(NAME STREQUAL "json")
-    if(TARGET json)
-      return()
-    endif()
+  elseif (NAME STREQUAL "json")
+    if (TARGET json)
+      return()
+    endif ()

     # The repo at https://github.com/nlohmann/json is too big, add local copy to avoid very slow download!
     add_external_headeronly_project(json
       SOURCE_DIR json)
-    if(MSVC)
+    if (MSVC)
       target_sources(json INTERFACE "${CMAKE_SOURCE_DIR}/externals/json/nlohmann_json.natvis")
-    endif()
+    endif ()

   # libcxxopts
-  elseif(NAME STREQUAL "libcxxopts")
-    if(TARGET libcxxopts)
-      return()
-    endif()
+  elseif (NAME STREQUAL "libcxxopts")
+    if (TARGET libcxxopts)
+      return()
+    endif ()

     add_external_headeronly_project(libcxxopts
       GIT_REPOSITORY https://github.com/jarro2783/cxxopts.git
@@ -123,10 +115,10 @@
       INCLUDE_DIR "include")

   # mmpld_io
-  elseif(NAME STREQUAL "mmpld_io")
-    if(TARGET mmpld_io)
-      return()
-    endif()
+  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
@@ -134,96 +126,53 @@
       INCLUDE_DIR "include")

   # nanoflann
-  elseif(NAME STREQUAL "nanoflann")
-    if(TARGET nanoflann)
-      return()
-    endif()
+  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")

-  # oneTBB
-  elseif(NAME STREQUAL "tbb")
-    if (TARGET tbb)
-      return()
-    endif()
-
-    if (MSVC)
-      set(EXTERNAL_EXE_LINKER_FLAGS "${EXTERNAL_EXE_LINKER_FLAGS} /NODEFAULTLIB:tbb12_debug.lib" CACHE STRING "" FORCE)
-    endif()
-
-    set(TBB_REPO "https://github.com/oneapi-src/oneTBB.git")
-    set(TBB_TAG "v2021.3.0")
-    set(TBB_ARGS "-DTBB_TEST=OFF")
-
-    if (WIN32)
-      set(TBB_LIB "${CMAKE_INSTALL_LIBDIR}/tbb12.lib")
-      set(TBB_DLL "bin/tbb12.dll")
-
-      add_external_project(tbb SHARED
-        GIT_REPOSITORY ${TBB_REPO}
-        GIT_TAG ${TBB_TAG}
-        CMAKE_ARGS ${TBB_ARGS}
-        BUILD_BYPRODUCTS "<INSTALL_DIR>/${TBB_DLL}" "<INSTALL_DIR>/${TBB_LIB}"
-      )
-      add_external_library(tbb
-        PROJECT tbb
-        LIBRARY "${TBB_DLL}"
-        IMPORT_LIBRARY "${TBB_LIB}"
-      )
-    else()
-      # todo this is surely not portable, as always
-      set(TBB_LIB "${CMAKE_INSTALL_LIBDIR}/libtbb.so.12.3")
-
-      add_external_project(tbb SHARED
-        GIT_REPOSITORY ${TBB_REPO}
-        GIT_TAG ${TBB_TAG}
-        CMAKE_ARGS ${TBB_ARGS}
-        BUILD_BYPRODUCTS "<INSTALL_DIR>/${TBB_LIB}"
-      )
-      add_external_library(tbb
-        PROJECT tbb
-        LIBRARY "${TBB_LIB}"
-      )
-    endif()
-
   # tinygltf
-  elseif(NAME STREQUAL "tinygltf")
-    if(TARGET tinygltf)
-      return()
-    endif()
+  elseif (NAME STREQUAL "tinygltf")
+    if (TARGET tinygltf)
+      return()
+    endif ()

     add_external_headeronly_project(tinygltf
       GIT_REPOSITORY https://github.com/syoyo/tinygltf.git
       GIT_TAG "v2.5.0")
     target_compile_definitions(tinygltf INTERFACE TINYGLTF_NO_INCLUDE_JSON)

-  elseif(NAME STREQUAL "sim_sort")
-    if(TARGET sim_sort)
-      return()
-    endif()
+  # sim_sort
+  elseif (NAME STREQUAL "sim_sort")
+    if (TARGET sim_sort)
+      return()
+    endif ()

     add_external_headeronly_project(sim_sort
       GIT_REPOSITORY https://github.com/alexstraub1990/simultaneous-sort.git
       GIT_TAG 220fdf37fec2d9d3e3f7674194544ee70eb93ee7 # master on 2021-07-26, because nothing was specified here.
       INCLUDE_DIR "include")

-  # Built libraries #####################################################
+  # ###########################################################################
+  # ### Built libraries #######################################################
+  # ###########################################################################

   # adios2
-  elseif(NAME STREQUAL "adios2")
-    if(TARGET adios2)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "adios2")
+    if (TARGET adios2)
+      return()
+    endif ()
+
+    if (WIN32)
       set(ADIOS2_LIB "lib/adios2.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(ADIOS2_LIB "${CMAKE_INSTALL_LIBDIR}/libadios2.a")
-    endif()
+    endif ()

     add_external_project(adios2 STATIC
       GIT_REPOSITORY https://github.com/ornladios/ADIOS2.git
@@ -249,35 +198,17 @@
     add_external_library(adios2
       LIBRARY ${ADIOS2_LIB})

-  # libigl
-  elseif(NAME STREQUAL "libigl")
-    if(TARGET libigl)
-      return()
-    endif()
-
-    if(WIN32)
-      set(LIBIGL_LIB "")
-    else()
-      include(GNUInstallDirs)
-      set(LIBIGL_LIB "")
-    endif()
-
-    add_external_headeronly_project(libigl
-        GIT_REPOSITORY https://github.com/libigl/libigl.git
-        GIT_TAG "v2.1.0"
-        INCLUDE_DIR "include")
-
   # bhtsne
-  elseif(NAME STREQUAL "bhtsne")
-    if(TARGET bhtsne)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "bhtsne")
+    if (TARGET bhtsne)
+      return()
+    endif ()
+
+    if (WIN32)
       set(BHTSNE_LIB "lib/bhtsne.lib")
-    else()
+    else ()
       set(BHTSNE_LIB "lib/libbhtsne.a")
-    endif()
+    endif ()

     add_external_project(bhtsne STATIC
       GIT_REPOSITORY https://github.com/lvdmaaten/bhtsne.git
@@ -291,16 +222,16 @@
       LIBRARY ${BHTSNE_LIB})

   # blend2d
-  elseif(NAME STREQUAL "blend2d")
-    if(TARGET blend2d)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "blend2d")
+    if (TARGET blend2d)
+      return()
+    endif ()
+
+    if (WIN32)
       set(BLEND2D_LIB "lib/blend2d.lib")
-    else()
+    else ()
       set(BLEND2D_LIB "lib/libblend2d.a")
-    endif()
+    endif ()

     require_external(asmjit)
     external_get_property(asmjit SOURCE_DIR)
@@ -317,17 +248,38 @@
       INCLUDE_DIR "include"
       LIBRARY ${BLEND2D_LIB})

+  # Corsair CUE SDK
+  elseif (NAME STREQUAL "CUESDK")
+    if (TARGET CUESDK)
+      return()
+    endif ()
+
+    FetchContent_Declare(
+      cuesdk_archive
+      URL https://github.com/CorsairOfficial/cue-sdk/releases/download/v3.0.378/CUESDK_3.0.378.zip)
+    FetchContent_GetProperties(cuesdk_archive)
+    if (NOT cuesdk_archive_POPULATED)
+      FetchContent_Populate(cuesdk_archive)
+      add_library(CUESDK SHARED IMPORTED GLOBAL)
+      set_target_properties(CUESDK PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${cuesdk_archive_SOURCE_DIR}/include"
+        IMPORTED_CONFIGURATIONS "Release"
+        IMPORTED_LOCATION "${cuesdk_archive_SOURCE_DIR}/redist/x64/CUESDK.x64_2017.dll"
+        IMPORTED_IMPLIB "${cuesdk_archive_SOURCE_DIR}/lib/x64/CUESDK.x64_2017.lib")
+      install(DIRECTORY "${cuesdk_archive_SOURCE_DIR}/redist/x64/" DESTINATION "bin" FILES_MATCHING PATTERN "*2017.dll")
+    endif ()
+
   # expat
-  elseif(NAME STREQUAL "expat")
-    if(TARGET expat)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "expat")
+    if (TARGET expat)
+      return()
+    endif ()
+
+    if (WIN32)
       set(EXPAT_LIB "lib/expat<SUFFIX>.lib")
-    else()
+    else ()
       set(EXPAT_LIB "lib/libexpat.a")
-    endif()
+    endif ()

     # Files in core were originally at 64f3cf982a156a62c1fdb44d864144ee5871159e
     # This seems to be master at 07.06.2017, somewhere between 2.2.0 and 2.2.1
@@ -349,17 +301,16 @@
       DEBUG_SUFFIX "d")

   # fmt
-  elseif(NAME STREQUAL "fmt")
-    if(TARGET fmt)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "fmt")
+    if (TARGET fmt)
+      return()
+    endif ()
+
+    if (WIN32)
       set(FMT_LIB "lib/fmt<SUFFIX>.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(FMT_LIB "${CMAKE_INSTALL_LIBDIR}/libfmt<SUFFIX>.a")
-    endif()
+    endif ()

     add_external_project(fmt STATIC
       GIT_REPOSITORY https://github.com/fmtlib/fmt.git
@@ -375,18 +326,16 @@
       DEBUG_SUFFIX "d")

   # glad
-  elseif(NAME STREQUAL "glad")
-    if(TARGET glad)
-      return()
-    endif()
-
-    include(GNUInstallDirs)
-
-    if(WIN32)
+  elseif (NAME STREQUAL "glad")
+    if (TARGET glad)
+      return()
+    endif ()
+
+    if (WIN32)
       set(GLAD_LIB "lib/glad.lib")
-    else()
+    else ()
       set(GLAD_LIB "${CMAKE_INSTALL_LIBDIR}/libglad.a")
-    endif()
+    endif ()

     add_external_project(glad STATIC
       SOURCE_DIR glad
@@ -397,12 +346,10 @@
       LIBRARY ${GLAD_LIB})

   # glfw
-  elseif(NAME STREQUAL "glfw")
-    if(TARGET glfw)
-      return()
-    endif()
-
-    include(GNUInstallDirs)
+  elseif (NAME STREQUAL "glfw")
+    if (TARGET glfw)
+      return()
+    endif ()

     if (WIN32)
       set(GLFW_LIB "${CMAKE_INSTALL_LIBDIR}/glfw3.lib")
@@ -425,21 +372,20 @@
       LIBRARY ${GLFW_LIB})

   # IceT
-  elseif(NAME STREQUAL "IceT")
-    if(TARGET IceTCore)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "IceT")
+    if (TARGET IceTCore)
+      return()
+    endif ()
+
+    if (WIN32)
       set(ICET_CORE_LIB "lib/IceTCore.lib")
       set(ICET_GL_LIB "lib/IceTGL.lib")
       set(ICET_MPI_LIB "lib/IceTMPI.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(ICET_CORE_LIB "lib/libIceTCore.a")
       set(ICET_GL_LIB "lib/libIceTGL.a")
       set(ICET_MPI_LIB "lib/libIceTMPI.a")
-    endif()
+    endif ()

     add_external_project(IceT STATIC
       GIT_REPOSITORY https://gitlab.kitware.com/icet/icet.git
@@ -463,10 +409,10 @@
       LIBRARY ${ICET_MPI_LIB})

   # imgui
-  elseif(NAME STREQUAL "imgui")
-    if(TARGET imgui)
-      return()
-    endif()
+  elseif (NAME STREQUAL "imgui")
+    if (TARGET imgui)
+      return()
+    endif ()

     if (ENABLE_GL)
       require_external(glfw)
@@ -474,13 +420,13 @@
       set(glfw_include_dir "${INSTALL_DIR}/include")
       set(glad_include_dir "${CMAKE_SOURCE_DIR}/externals/glad/include")
       set(glfw_dep "glfw")
-    endif()
-
-    if(WIN32)
+    endif ()
+
+    if (WIN32)
       set(IMGUI_LIB "lib/imgui.lib")
-    else()
+    else ()
       set(IMGUI_LIB "lib/libimgui.a")
-    endif()
+    endif ()

     add_external_project(imgui STATIC
       GIT_REPOSITORY https://github.com/ocornut/imgui.git
@@ -512,19 +458,19 @@
       LIBRARY ${IMGUI_LIB})

   # imguizmoquat
-  elseif(NAME STREQUAL "imguizmoquat")
-    if(TARGET imguizmoquat)
-      return()
-    endif()
+  elseif (NAME STREQUAL "imguizmoquat")
+    if (TARGET imguizmoquat)
+      return()
+    endif ()

     require_external(imgui)
     external_get_property(imgui INSTALL_DIR)

-    if(WIN32)
+    if (WIN32)
       set(IMGUIZMOQUAT_LIB "lib/imguizmoquat.lib")
-    else()
+    else ()
       set(IMGUIZMOQUAT_LIB "lib/libimguizmoquat.a")
-    endif()
+    endif ()

     add_external_project(imguizmoquat STATIC
       GIT_REPOSITORY https://github.com/braunms/imGuIZMO.quat.git
@@ -538,27 +484,27 @@
         "<SOURCE_DIR>/CMakeLists.txt")

     add_external_library(imguizmoquat
-        LIBRARY ${IMGUIZMOQUAT_LIB})
+      LIBRARY ${IMGUIZMOQUAT_LIB})

   # implot
-  elseif(NAME STREQUAL "implot")
-    if(TARGET implot)
-      return()
-    endif()
+  elseif (NAME STREQUAL "implot")
+    if (TARGET implot)
+      return()
+    endif ()

     require_external(imgui)

-    if(WIN32)
+    if (WIN32)
       set(IMPLOT_LIB "lib/implot.lib")
-    else()
+    else ()
       set(IMPLOT_LIB "lib/libimplot.a")
-    endif()
-
-    if(WIN32)
+    endif ()
+
+    if (WIN32)
       set(IMGUI_LIB "lib/imgui.lib")
-    else()
+    else ()
       set(IMGUI_LIB "lib/libimgui.a")
-    endif()
+    endif ()

     external_get_property(imgui INSTALL_DIR)

@@ -573,36 +519,51 @@
         -DCMAKE_C_FLAGS=-fPIC
         -DCMAKE_CXX_FLAGS=-fPIC
       PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-          "${CMAKE_SOURCE_DIR}/externals/implot/CMakeLists.txt"
-          "<SOURCE_DIR>/CMakeLists.txt")
+        "${CMAKE_SOURCE_DIR}/externals/implot/CMakeLists.txt"
+        "<SOURCE_DIR>/CMakeLists.txt")

     add_external_library(implot
-        LIBRARY ${IMPLOT_LIB})
+      LIBRARY ${IMPLOT_LIB})

     external_get_property(implot SOURCE_DIR)
     target_include_directories(implot INTERFACE "${SOURCE_DIR}")

+  # libigl
+  elseif (NAME STREQUAL "libigl")
+    if (TARGET libigl)
+      return()
+    endif ()
+
+    if (WIN32)
+      set(LIBIGL_LIB "")
+    else ()
+      set(LIBIGL_LIB "")
+    endif ()
+
+    add_external_headeronly_project(libigl
+      GIT_REPOSITORY https://github.com/libigl/libigl.git
+      GIT_TAG "v2.1.0"
+      INCLUDE_DIR "include")
+
   # libpng
-  elseif(NAME STREQUAL "libpng")
-    if(TARGET libpng)
-      return()
-    endif()
+  elseif (NAME STREQUAL "libpng")
+    if (TARGET libpng)
+      return()
+    endif ()

     require_external(zlib)

-    if(MSVC)
+    if (MSVC)
       set(LIBPNG_LIB "lib/libpng16_static<SUFFIX>.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(LIBPNG_LIB "${CMAKE_INSTALL_LIBDIR}/libpng16<SUFFIX>.a")
-    endif()
-
-    if(MSVC)
+    endif ()
+
+    if (MSVC)
       set(ZLIB_LIB "lib/zlibstatic$<$<CONFIG:Debug>:d>.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(ZLIB_LIB "lib/libz.a")
-    endif()
+    endif ()

     external_get_property(zlib INSTALL_DIR)

@@ -634,27 +595,25 @@
       DEBUG_SUFFIX d)

   # libzmq / libcppzmq
-  elseif(NAME STREQUAL "libzmq" OR NAME STREQUAL "libcppzmq")
-    if(TARGET libzmq OR TARGET libcppzmq)
-      return()
-    endif()
+  elseif (NAME STREQUAL "libzmq" OR NAME STREQUAL "libcppzmq")
+    if (TARGET libzmq OR TARGET libcppzmq)
+      return()
+    endif ()

     set(ZMQ_VER "4_3_3")
     string(REPLACE "_" "." ZMQ_TAG "v${ZMQ_VER}")

-    if(MSVC_IDE)
+    if (MSVC_IDE)
       set(MSVC_TOOLSET "-${CMAKE_VS_PLATFORM_TOOLSET}")
-    else()
+    else ()
       set(MSVC_TOOLSET "")
-    endif()
-
-    include(GNUInstallDirs)
-
-    if(WIN32)
+    endif ()
+
+    if (WIN32)
       set(ZMQ_LIB "${CMAKE_INSTALL_LIBDIR}/libzmq${MSVC_TOOLSET}-mt-s<SUFFIX>-${ZMQ_VER}.lib")
-    else()
+    else ()
       set(ZMQ_LIB "${CMAKE_INSTALL_LIBDIR}/libzmq.a")
-    endif()
+    endif ()

     add_external_project(libzmq STATIC
       GIT_REPOSITORY https://github.com/zeromq/libzmq.git
@@ -676,9 +635,9 @@
       INTERFACE_COMPILE_DEFINITIONS "ZMQ_STATIC")

     # TODO libzmq cmake does a lot more checks and options. This will probably work only in some configurations.
-    if(WIN32)
+    if (WIN32)
       target_link_libraries(libzmq INTERFACE ws2_32 iphlpapi)
-    endif()
+    endif ()

     add_external_headeronly_project(libcppzmq
       DEPENDS libzmq
@@ -686,16 +645,16 @@
       GIT_TAG "v4.6.0")

   # lua
-  elseif(NAME STREQUAL "lua")
-    if(TARGET lua)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "lua")
+    if (TARGET lua)
+      return()
+    endif ()
+
+    if (WIN32)
       set(LUA_LIB "lib/lua.lib")
-    else()
+    else ()
       set(LUA_LIB "lib/liblua.a")
-    endif()
+    endif ()

     add_external_project(lua STATIC
       GIT_REPOSITORY https://github.com/lua/lua.git
@@ -712,39 +671,38 @@
       LIBRARY ${LUA_LIB})

   # megamol-shader-factory
-  elseif(NAME STREQUAL "megamol-shader-factory")
-      if(TARGET megamol-shader-factory)
-        return()
-      endif()
-
-      require_external(glad)
-
-      if(WIN32)
-        set(MEGAMOL_SHADER_FACTORY_LIB "lib/msf_combined.lib")
-      else()
-        set(MEGAMOL_SHADER_FACTORY_LIB "lib/libmsf_combined.a")
-      endif()
-
-      add_external_project(megamol-shader-factory STATIC
-        GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/megamol-shader-factory.git
-        GIT_TAG "v0.5"
-        BUILD_BYPRODUCTS
-        "<INSTALL_DIR>/${MEGAMOL_SHADER_FACTORY_LIB}"
-        DEPENDS glad)
-
-      add_external_library(megamol-shader-factory
-        LIBRARY ${MEGAMOL_SHADER_FACTORY_LIB}
-        INTERFACE_LIBRARIES glad)
-      if(UNIX)
-        target_link_libraries(megamol-shader-factory INTERFACE "stdc++fs")
-      endif()
-      target_compile_definitions(megamol-shader-factory INTERFACE MSF_OPENGL_INCLUDE_GLAD2)
+  elseif (NAME STREQUAL "megamol-shader-factory")
+    if (TARGET megamol-shader-factory)
+      return()
+    endif ()
+
+    require_external(glad)
+
+    if (WIN32)
+      set(MEGAMOL_SHADER_FACTORY_LIB "lib/msf_combined.lib")
+    else ()
+      set(MEGAMOL_SHADER_FACTORY_LIB "lib/libmsf_combined.a")
+    endif ()
+
+    add_external_project(megamol-shader-factory STATIC
+      GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/megamol-shader-factory.git
+      GIT_TAG "v0.5"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${MEGAMOL_SHADER_FACTORY_LIB}"
+      DEPENDS glad)
+
+    add_external_library(megamol-shader-factory
+      LIBRARY ${MEGAMOL_SHADER_FACTORY_LIB}
+      INTERFACE_LIBRARIES glad)
+    if (UNIX)
+      target_link_libraries(megamol-shader-factory INTERFACE "stdc++fs")
+    endif ()
+    target_compile_definitions(megamol-shader-factory INTERFACE MSF_OPENGL_INCLUDE_GLAD2)

   # obj-io
   elseif (NAME STREQUAL "obj-io")
-    if(TARGET obj-io)
-      return()
-    endif()
+    if (TARGET obj-io)
+      return()
+    endif ()

     add_external_headeronly_project(obj-io INTERFACE
       GIT_REPOSITORY https://github.com/thinks/obj-io.git
@@ -752,16 +710,16 @@
       INCLUDE_DIR "include/thinks")

   # qhull
-  elseif(NAME STREQUAL "qhull")
-    if(TARGET qhull)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "qhull")
+    if (TARGET qhull)
+      return()
+    endif ()
+
+    if (WIN32)
       set(QHULL_LIB "lib/qhull.lib")
-    else()
+    else ()
       set(QUHULL_LIB "lib/libqhull.a")
-    endif()
+    endif ()

     add_external_project(qhull STATIC
       GIT_REPOSITORY https://github.com/qhull/qhull.git
@@ -776,16 +734,16 @@
       LIBRARY ${QHULL_LIB})

   # quickhull
-  elseif(NAME STREQUAL "quickhull")
-    if(TARGET quickhull)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "quickhull")
+    if (TARGET quickhull)
+      return()
+    endif ()
+
+    if (WIN32)
       set(QUICKHULL_LIB "lib/quickhull.lib")
-    else()
+    else ()
       set(QUICKHULL_LIB "lib/libquickhull.a")
-    endif()
+    endif ()

     add_external_project(quickhull STATIC
       GIT_REPOSITORY https://github.com/akuukka/quickhull.git
@@ -799,17 +757,16 @@
       LIBRARY ${QUICKHULL_LIB})

   # snappy
-  elseif(NAME STREQUAL "snappy")
-    if(TARGET snappy)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "snappy")
+    if (TARGET snappy)
+      return()
+    endif ()
+
+    if (WIN32)
       set(SNAPPY_LIB "lib/snappy.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(SNAPPY_LIB "${CMAKE_INSTALL_LIBDIR}/libsnappy.a")
-    endif()
+    endif ()

     add_external_project(snappy STATIC
       GIT_REPOSITORY https://github.com/google/snappy.git
@@ -824,19 +781,18 @@
       LIBRARY ${SNAPPY_LIB})

   # spdlog
-  elseif(NAME STREQUAL "spdlog")
-    if(TARGET spdlog)
-      return()
-    endif()
+  elseif (NAME STREQUAL "spdlog")
+    if (TARGET spdlog)
+      return()
+    endif ()

     require_external(fmt)

-    if(WIN32)
+    if (WIN32)
       set(SPDLOG_LIB "lib/spdlog<SUFFIX>.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(SPDLOG_LIB "${CMAKE_INSTALL_LIBDIR}/libspdlog<SUFFIX>.a")
-    endif()
+    endif ()

     external_get_property(fmt BINARY_DIR)

@@ -859,18 +815,60 @@

     target_compile_definitions(spdlog INTERFACE SPDLOG_FMT_EXTERNAL;SPDLOG_COMPILED_LIB)

+  # oneTBB
+  elseif (NAME STREQUAL "tbb")
+    if (TARGET tbb)
+      return()
+    endif ()
+
+    if (MSVC)
+      set(EXTERNAL_EXE_LINKER_FLAGS "${EXTERNAL_EXE_LINKER_FLAGS} /NODEFAULTLIB:tbb12_debug.lib" CACHE STRING "" FORCE)
+    endif ()
+
+    set(TBB_REPO "https://github.com/oneapi-src/oneTBB.git")
+    set(TBB_TAG "v2021.3.0")
+    set(TBB_ARGS "-DTBB_TEST=OFF")
+
+    if (WIN32)
+      set(TBB_LIB "${CMAKE_INSTALL_LIBDIR}/tbb12.lib")
+      set(TBB_DLL "bin/tbb12.dll")
+
+      add_external_project(tbb SHARED
+        GIT_REPOSITORY ${TBB_REPO}
+        GIT_TAG ${TBB_TAG}
+        CMAKE_ARGS ${TBB_ARGS}
+        BUILD_BYPRODUCTS "<INSTALL_DIR>/${TBB_DLL}" "<INSTALL_DIR>/${TBB_LIB}")
+      add_external_library(tbb
+        PROJECT tbb
+        LIBRARY "${TBB_DLL}"
+        IMPORT_LIBRARY "${TBB_LIB}")
+    else ()
+      # todo this is surely not portable, as always
+      set(TBB_LIB "${CMAKE_INSTALL_LIBDIR}/libtbb.so.12.3")
+
+      add_external_project(tbb SHARED
+        GIT_REPOSITORY ${TBB_REPO}
+        GIT_TAG ${TBB_TAG}
+        CMAKE_ARGS ${TBB_ARGS}
+        BUILD_BYPRODUCTS "<INSTALL_DIR>/${TBB_LIB}"
+        )
+      add_external_library(tbb
+        PROJECT tbb
+        LIBRARY "${TBB_LIB}"
+        )
+    endif ()
+
   # tinyobjloader
-  elseif(NAME STREQUAL "tinyobjloader")
-    if(TARGET tinyobjloader)
-      return()
-    endif()
-
-    if(WIN32)
+  elseif (NAME STREQUAL "tinyobjloader")
+    if (TARGET tinyobjloader)
+      return()
+    endif ()
+
+    if (WIN32)
       set(TINYOBJLOADER_LIB "lib/tinyobjloader.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(TINYOBJLOADER_LIB "${CMAKE_INSTALL_LIBDIR}/libtinyobjloader.a")
-    endif()
+    endif ()

     add_external_project(tinyobjloader STATIC
       GIT_REPOSITORY https://github.com/syoyo/tinyobjloader.git
@@ -881,18 +879,16 @@
       LIBRARY ${TINYOBJLOADER_LIB})

   # tinyply
-  elseif(NAME STREQUAL "tinyply")
-    if(TARGET tinyply)
-      return()
-    endif()
-
-    include(GNUInstallDirs)
-
-    if(WIN32)
+  elseif (NAME STREQUAL "tinyply")
+    if (TARGET tinyply)
+      return()
+    endif ()
+
+    if (WIN32)
       set(TNY_LIB "${CMAKE_INSTALL_LIBDIR}/tinyply<SUFFIX>.lib")
-    else()
+    else ()
       set(TNY_LIB "${CMAKE_INSTALL_LIBDIR}/libtinyply<SUFFIX>.a")
-    endif()
+    endif ()

     add_external_project(tinyply STATIC
       GIT_REPOSITORY https://github.com/ddiakopoulos/tinyply.git
@@ -907,14 +903,14 @@
       DEBUG_SUFFIX d)

   # tracking
-  elseif(NAME STREQUAL "tracking")
-    if(TARGET tracking)
-      return()
-    endif()
-
-    if(NOT WIN32)
+  elseif (NAME STREQUAL "tracking")
+    if (TARGET tracking)
+      return()
+    endif ()
+
+    if (NOT WIN32)
       message(WARNING "External 'tracking' requested, but not available on non-Windows systems")
-    endif()
+    endif ()

     set(TRACKING_LIB "lib/tracking.lib")
     set(TRACKING_NATNET_LIB "lib/NatNetLib.lib")
@@ -938,90 +934,24 @@
     external_get_property(tracking SOURCE_DIR)
     set(tracking_files "${SOURCE_DIR}/tracking/conf/tracking.conf" PARENT_SCOPE)

-  # zfp
-  elseif(NAME STREQUAL "zfp")
-    if(TARGET zfp)
-      return()
-    endif()
-
-    if(WIN32)
-      set(ZFP_LIB "lib/zfp.lib")
-    else()
-      include(GNUInstallDirs)
-      set(ZFP_LIB "${CMAKE_INSTALL_LIBDIR}/libzfp.a")
-    endif()
-
-    add_external_project(zfp STATIC
-      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
-        -DBUILD_TESTING=OFF
-        -DZFP_WITH_ALIGNED_ALLOC=ON
-        -DZFP_WITH_CACHE_FAST_HASH=ON
-        -DCMAKE_BUILD_TYPE=Release)
-
-    add_external_library(zfp
-      LIBRARY ${ZFP_LIB})
-
-  # zlib
-  elseif(NAME STREQUAL "zlib")
-    if(TARGET zlib)
-      return()
-    endif()
-
-    if(MSVC)
-      set(ZLIB_LIB "lib/zlibstatic<SUFFIX>.lib")
-    else()
-      include(GNUInstallDirs)
-      set(ZLIB_LIB "lib/libz.a")
-    endif()
-
-    add_external_project(zlib STATIC
-      GIT_REPOSITORY https://github.com/madler/zlib.git
-      GIT_TAG "v1.2.11"
-      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ZLIB_LIB}"
-      DEBUG_SUFFIX d
-      CMAKE_ARGS
-        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)
-
-    add_external_library(zlib
-      LIBRARY ${ZLIB_LIB}
-      DEBUG_SUFFIX d)
-
-    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()
-    endif()
+  elseif (NAME STREQUAL "vtkm")
+    if (TARGET vtkm)
+      return()
+    endif ()

     set(VTKM_VER 1.4)
     set(LIB_VER 1)

-    if(WIN32)
+    if (WIN32)
       set(VTKM_CONT_LIB "lib/vtkm_cont-${VTKM_VER}.lib")
       set(VTKM_RENDERER_LIB "lib/vtkm_rendering-${VTKM_VER}.lib")
       set(VTKM_WORKLET_LIB "lib/vtkm_worklet-${VTKM_VER}.lib")
-    else()
-      include(GNUInstallDirs)
+    else ()
       set(VTKM_CONT_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_cont-${VTKM_VER}.a")
       set(VTKM_RENDERER_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_rendering-${VTKM_VER}.a")
       set(VTKM_WORKLET_LIB "${CMAKE_INSTALL_LIBDIR}/libvtkm_worklet-${VTKM_VER}.a")
-    endif()
+    endif ()

     add_external_project(vtkm STATIC
       GIT_REPOSITORY https://gitlab.kitware.com/vtk/vtk-m.git
@@ -1040,7 +970,7 @@
         -DVTKm_INSTALL_ONLY_LIBRARIES:BOOL=ON
         -DVTKm_USE_64BIT_IDS:BOOL=OFF
         #-DCMAKE_BUILD_TYPE=Release
-        )
+      )

     add_external_library(vtkm
       PROJECT vtkm
@@ -1054,9 +984,72 @@
       PROJECT vtkm
       LIBRARY ${VTKM_WORKLET_LIB})

-  else()
+  # zfp
+  elseif (NAME STREQUAL "zfp")
+    if (TARGET zfp)
+      return()
+    endif ()
+
+    if (WIN32)
+      set(ZFP_LIB "lib/zfp.lib")
+    else ()
+      set(ZFP_LIB "${CMAKE_INSTALL_LIBDIR}/libzfp.a")
+    endif ()
+
+    add_external_project(zfp STATIC
+      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
+        -DBUILD_TESTING=OFF
+        -DZFP_WITH_ALIGNED_ALLOC=ON
+        -DZFP_WITH_CACHE_FAST_HASH=ON
+        -DCMAKE_BUILD_TYPE=Release)
+
+    add_external_library(zfp
+      LIBRARY ${ZFP_LIB})
+
+  # zlib
+  elseif (NAME STREQUAL "zlib")
+    if (TARGET zlib)
+      return()
+    endif ()
+
+    if (MSVC)
+      set(ZLIB_LIB "lib/zlibstatic<SUFFIX>.lib")
+    else ()
+      set(ZLIB_LIB "lib/libz.a")
+    endif ()
+
+    add_external_project(zlib STATIC
+      GIT_REPOSITORY https://github.com/madler/zlib.git
+      GIT_TAG "v1.2.11"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${ZLIB_LIB}"
+      DEBUG_SUFFIX d
+      CMAKE_ARGS
+        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON)
+
+    add_external_library(zlib
+      LIBRARY ${ZLIB_LIB}
+      DEBUG_SUFFIX d)
+
+    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)
+
+  else ()
     message(FATAL_ERROR "Unknown external required \"${NAME}\"")
-  endif()
+  endif ()

   mark_as_advanced(FORCE FETCHCONTENT_BASE_DIR)
   mark_as_advanced(FORCE FETCHCONTENT_FULLY_DISCONNECTED)


PKG: surround cmake with quotes when equating with STREQUAL

--- SuperBuild/Packaging/PackageHelper.cmake
+++ SuperBuild/Packaging/PackageHelper.cmake
@@ -1,7 +1,7 @@
 macro(macro_super_package)
   cmake_parse_arguments(PKG  "" "STAGE_DIR" "SEARCHDIRS" ${ARGN} )

-  if("${PKG_STAGE_DIR}" STREQUAL "")
+  if(${PKG_STAGE_DIR} STREQUAL "")
     message(FATAL_ERROR "PKG_STAGE_DIR is emtpy. Just can't continue.")
   endif()


highgui: fix config verification for GTK

--- modules/highgui/cmake/detect_gtk.cmake
+++ modules/highgui/cmake/detect_gtk.cmake
@@ -41,3 +41,4 @@
 endif()

 set(HAVE_GTK ${HAVE_GTK} PARENT_SCOPE)
+set(HAVE_GTK3 ${HAVE_GTK3} PARENT_SCOPE)


ENH: Update elastix to revision 5414

ENH: Update elastix to revision 5414

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

 set( ELASTIX_GIT_REPOSITORY ${git_protocol}://github.com/kaspermarstal/elastix )
-set( ELASTIX_GIT_TAG 098f973472f3a51bbffbe2967440fae970518001 )
+set( ELASTIX_GIT_TAG 41c558e3d4c33421451d2498059f0c3cf1a4da75 )

 ExternalProject_Add( ${proj}
   GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}


fixed: linker problem

fixed: linker problem

--- share/hugh/cmake/compiler/common-clang-gnu.cmake
+++ share/hugh/cmake/compiler/common-clang-gnu.cmake
@@ -21,6 +21,9 @@
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
 endif()

+# [http://stackoverflow.com/questions/17150075]
+set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-as-needed")
+
 # linker flags
 if("Release" STREQUAL "${CMAKE_BUILD_TYPE}")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-O1")


Update some ParaView cmake variables

Update some ParaView cmake variables

The most important one is PARAVIEW_ENABLE_PYTHON => PARAVIEW_USE_PYTHON.

These changes reflect the changes in tomviz in these two commits:

https://github.com/OpenChemistry/tomviz/commit/a431346ba9a9024a49841d0f9402e4a6dbed33cf
https://github.com/OpenChemistry/tomviz/commit/7273b44d768b9e850ea73dcc97301d439172b190

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -29,15 +29,12 @@
     -DVTK_PYTHON_FULL_THREADSAFE:BOOL=ON
     -DVTK_NO_PYTHON_THREADS:BOOL=OFF
     -DVTK_PYTHON_VERSION:STRING=3
-    -DPARAVIEW_ENABLE_PYTHON:BOOL=ON
-    -DPARAVIEW_ENABLE_CATALYST:BOOL=OFF
+    -DPARAVIEW_USE_PYTHON:BOOL=ON
     -DPARAVIEW_ENABLE_COMMANDLINE_TOOLS:BOOL=OFF
     -DPARAVIEW_ENABLE_WEB:BOOL=ON
     -DPARAVIEW_USE_QTHELP:BOOL=OFF
     -DPARAVIEW_USE_VTKM:BOOL=OFF
     -DPARAVIEW_PLUGINS_DEFAULT:BOOL=OFF
-    -DVTK_MODULE_ENABLE_ParaView_VTKExtensionsExtractionPython:STRING=YES
-    -DVTK_MODULE_ENABLE_ParaView_RemotingViewsPython:STRING=YES
     # Disable for now as kits requires CMake 3.12
     #    -DPARAVIEW_ENABLE_KITS:BOOL=ON
     -DPARAVIEW_ENABLE_FFMPEG:BOOL=ON


[CMAKE] Get rid of `add_compiler_flags_to_var`

Summary:
The last callsite is in the `check_linker_flags` function. Adding the
logic at the callsite allow to remove this function from the API.

There is no change in behavior.

Depends on D4961.

Test Plan:
  ninja check

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D5002

--- cmake/modules/AddCompilerFlags.cmake
+++ cmake/modules/AddCompilerFlags.cmake
@@ -14,20 +14,6 @@
 		message(FATAL_ERROR "check_compiler_flag LANGUAGE should be C or CXX")
 	endif()
 	set(${RESULT} ${${TEST_NAME}} PARENT_SCOPE)
-endfunction()
-
-function(add_compiler_flags_to_var TARGET LANGUAGE)
-	foreach(f ${ARGN})
-		# If the flag is already set, avoid duplicating it
-		string(FIND "${${TARGET}}" "${f}" FLAG_POSITION)
-		if(${FLAG_POSITION} LESS 0)
-			check_compiler_flag(FLAG_IS_SUPPORTED ${LANGUAGE} ${f})
-			if(${FLAG_IS_SUPPORTED})
-				string(APPEND ${TARGET} " ${f}")
-			endif()
-		endif()
-	endforeach()
-	set(${TARGET} ${${TARGET}} PARENT_SCOPE)
 endfunction()

 function(add_compiler_flags_for_language LANGUAGE)
@@ -122,11 +108,11 @@
 	# Using -Werror will promote these warnings to errors so
 	# CHECK_CXX_COMPILER_FLAG() will return false, preventing the flag from
 	# being set.
-	add_compiler_flags_to_var(
-		CMAKE_REQUIRED_FLAGS
-		CXX
-		"-Werror=unused-command-line-argument"
-	)
+	set(WERROR_UNUSED_ARG -Werror=unused-command-line-argument)
+	check_compiler_flag(IS_WERROR_SUPPORTED CXX ${WERROR_UNUSED_ARG})
+	if(${IS_WERROR_SUPPORTED})
+		set(CMAKE_REQUIRED_FLAGS ${WERROR_UNUSED_ARG})
+	endif()

 	# Save the current linker flags
 	set(SAVE_CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS})


Create empty stub source file before actually compiling it.

--- cmake/usFunctionEmbedResources.cmake
+++ cmake/usFunctionEmbedResources.cmake
@@ -130,6 +130,7 @@
     if(APPLE)
       add_custom_command(
         OUTPUT ${_source_output}
+        COMMAND ${CMAKE_COMMAND} -E touch stub.cpp
         COMMAND ${CMAKE_CXX_COMPILER} -c stub.cpp -o stub.o
         COMMAND ${CMAKE_LINKER} -r -sectcreate __TEXT us_resources ${_zip_archive_name} stub.o -o ${_source_output}
         DEPENDS ${_zip_archive}


Add a warning when a module does not produce a target.

--- CPM.cmake
+++ CPM.cmake
@@ -996,6 +996,10 @@
   # Append target to pre-existing libraries.
   if (TARGET ${CPM_TARGET_NAME})
     set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
+  else()
+    message(WARNING "Module ${name} did not produce a target. add_dependencies may fail.")
+    message(WARNING "All modules should produce a target, even header only libraries.")
+    message(WARNING "See: add_custom_target")
   endif()

   set(CPM_DEFINITIONS ${CPM_DEFINITIONS} PARENT_SCOPE)


ENH: OTB uses external libKML and boost

ENH: OTB uses external libKML and boost

--- CMake/External_OTB.cmake
+++ CMake/External_OTB.cmake
@@ -63,7 +63,33 @@
     -DTINYXML_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
     -DTINYXML_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libtinyXML.so
     )
-  list(APPEND ${proj}_DEPENDENCIES MUPARSER)
+  list(APPEND ${proj}_DEPENDENCIES TINYXML)
+endif()
+
+if(USE_SYSTEM_BOOST)
+  set(OTB_SB_BOOST_CONFIG)
+else()
+  set(OTB_SB_BOOST_CONFIG
+    -DBOOST_ROOT:PATH=${CMAKE_INSTALL_PREFIX}
+    )
+  list(APPEND ${proj}_DEPENDENCIES BOOST)
+endif()
+
+if(USE_SYSTEM_LIBKML)
+  set(OTB_SB_LIBKML_CONFIG)
+else()
+  set(OTB_SB_LIBKML_CONFIG
+    # TODO : split LIBKML build into 7 libraries
+    -DLIBKML_INCLUDE_DIR:PATH=${CMAKE_INSTALL_PREFIX}/include
+    -DLIBKML_BASE_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmlbase.so
+    -DLIBKML_CONVENIENCE_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmlconvenience.so
+    -DLIBKML_DOM_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmldom.so
+    -DLIBKML_ENGINE_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmlengine.so
+    -DLIBKML_REGIONATOR_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmlregionator.so
+    -DLIBKML_XSD_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libkmlxsd.so
+    -DLIBKML_MINIZIP_LIBRARY:PATH=${CMAKE_INSTALL_PREFIX}/lib/libminizip.so
+    )
+  list(APPEND ${proj}_DEPENDENCIES LIBKML)
 endif()

 ExternalProject_Add(${proj}
@@ -84,12 +110,16 @@
       -DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX}
       -DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}
       -DOTB_USE_EXTERNAL_OSSIM:BOOL=ON
+      -DOTB_USE_EXTERNAL_LIBKML:BOOL=ON
+      -DOTB_USE_EXTERNAL_BOOST:BOOL=ON
       ${OTB_SB_ITK_CONFIG}
       ${OTB_SB_OSSIM_CONFIG}
       ${OTB_SB_GDAL_CONFIG}
       ${OTB_SB_MUPARSER_CONFIG}
       ${OTB_SB_MUPARSERX_CONFIG}
       ${OTB_SB_TINYXML_CONFIG}
+      ${OTB_SB_BOOST_CONFIG}
+      ${OTB_SB_LIBKML_CONFIG}
     CMAKE_COMMAND
       # use 'env' because CTest launcher doesn't perform shell interpretation
       env LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/lib


Upgrade CTK and use default version of qRestAPI

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

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 0c2a619a)
+    set(revision_tag 6c0eddaa)

     set(ctk_optional_cache_args )
     if(MITK_USE_Python)
@@ -57,8 +57,7 @@
     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 e1f94ba0199eccf335ec2c2b48e155da
-      # PATCH_COMMAND ${PATCH_COMMAND} -N -p1 -i ${CMAKE_CURRENT_LIST_DIR}/CTK.patch
+      URL_MD5 c8025c0009d5dd207cd442eadca409b4
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}
@@ -82,7 +81,6 @@
         -DCTK_PLUGIN_org.commontk.configadmin:BOOL=ON
         -DCTK_USE_GIT_PROTOCOL:BOOL=OFF
         -DDCMTK_DIR:PATH=${DCMTK_DIR}
-        -DqRestAPI_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/qRestAPI_c5e4c2a7_patched.tar.gz
         -DPythonQt_URL:STRING=${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/PythonQt_e39be131.tar.gz # From https://github.com/kislinsk/PythonQt.git
       CMAKE_CACHE_ARGS
         ${ep_common_cache_args}


put prophet in the correct spot

put prophet in the correct spot

--- Tools/CMake/Modules.cmake
+++ Tools/CMake/Modules.cmake
@@ -40,13 +40,13 @@
     "jaspLearnBayes"
     "jaspMachineLearning"
     "jaspMetaAnalysis"
-    #"jaspNetwork" #gdata not available
+    "jaspNetwork"
     "jaspProcessControl"
+    "jaspProphet"
     "jaspReliability"
     "jaspSem"
     "jaspSummaryStatistics"
-    "jaspVisualModeling"
-    #"jaspProphet"
+    "jaspVisualModeling"
     )

 list(


FIX: LAPACKEyy typo

FIX: LAPACKEyy typo

--- cmake/DependenciesConfig.cmake
+++ cmake/DependenciesConfig.cmake
@@ -61,7 +61,7 @@
   find_package( BLAS REQUIRED )
   endif()

-  add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKEyy)
+  add_definitions(-DEIGEN_USE_BLAS -DEIGEN_USE_LAPACKE)

   message(STATUS BLAS: ${BLAS_LIBRARIES} )


Change compilation flags to support clang >3.4

removing the unsupported flag "-fno-reorder-blocks". In addition leverage the
fact that the minimum gcc version is 4.8 to provide a relwithdebinfo build
with the Og optimisation level.
From https://gcc.gnu.org/gcc-4.8/changes.html:
"A new general optimization level, -Og, has been introduced. It addresses the
need for fast compilation and a superior debugging experience while providing
a reasonable level of runtime performance. Overall experience for development
should be better than the default optimization level -O0."

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

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

   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -Woverloaded-virtual -fPIC")
   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pipe ${BIT_ENVIRONMENT} -Wall -W -fPIC")
@@ -60,15 +94,15 @@
   # Select flags.
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
   set(CMAKE_CXX_FLAGS_RELEASE        "-O2")
-  set(CMAKE_CXX_FLAGS_DEBUG          "-g  -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+  set(CMAKE_CXX_FLAGS_DEBUG          "-g -fno-schedule-insns -fno-inline")
   set(CMAKE_CXX_FLAGS_DEBUGFULL      "-g3 -fno-inline")
   set(CMAKE_CXX_FLAGS_PROFILE        "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
   set(CMAKE_C_FLAGS_RELWITHDEBINFO   "-O2 -g")
   set(CMAKE_C_FLAGS_RELEASE          "-O2")
-  set(CMAKE_C_FLAGS_DEBUG            "-g  -fno-reorder-blocks -fno-schedule-insns -fno-inline")
+  set(CMAKE_C_FLAGS_DEBUG            "-g  -fno-schedule-insns -fno-inline")
   set(CMAKE_C_FLAGS_DEBUGFULL        "-g3 -fno-inline")
   set(CMAKE_C_FLAGS_PROFILE          "-g3 -fno-inline -ftest-coverage -fprofile-arcs")
-
+
   #Settings for cint
   set(CPPPREP "${CXX} -E -C")
   set(CXXOUT "-o ")


updated FindOpenCV.cmake

updated FindOpenCV.cmake

git-svn-id: 5c3bb4a0fea81dff653294223dbc7ab7b926c710@305 f169173b-cf89-36c8-b27e-44dbe73f0c83

--- cmake_modules/FindOpenCV.cmake
+++ cmake_modules/FindOpenCV.cmake
@@ -47,244 +47,41 @@
 #
 #----------------------------------------------------------

-# typical root dirs of installations, exactly one of them is used
-SET (OpenCV_POSSIBLE_ROOT_DIRS
-  "$ENV{OpenCV_DIR}"
-  /usr/local
-  /usr/opt
-  /usr
-  )
-
-# Add ROS OpenCV directory if ROS is installed
-FIND_PROGRAM(ROSPACK_EXEC NAME rospack PATHS)
-IF(ROSPACK_EXEC)
-    MESSAGE(STATUS "Found rospack executable : ${ROSPACK_EXEC}")
-	EXECUTE_PROCESS(COMMAND ${ROSPACK_EXEC} find opencv2
-			   	    OUTPUT_VARIABLE OPENCV_ROS_PATH
-					OUTPUT_STRIP_TRAILING_WHITESPACE
-					WORKING_DIRECTORY "./"
-	)
-	IF(OPENCV_ROS_PATH)
-	    MESSAGE(STATUS "Found OpenCV ROS pkg : ${OPENCV_ROS_PATH}")
-	    SET(OpenCV_POSSIBLE_ROOT_DIRS
-	        ${OPENCV_ROS_PATH}/opencv
-	        ${OpenCV_POSSIBLE_ROOT_DIRS}
-	    )
-	ENDIF(OPENCV_ROS_PATH)
-ENDIF(ROSPACK_EXEC)
+SET(OpenCV_DIR "$ENV{OpenCV_DIR}")

-find_path(OpenCV_DIR "OpenCVConfig.cmake" HINTS ${OpenCV_POSSIBLE_ROOT_DIRS} DOC "Root directory of OpenCV")
-if(NOT EXISTS "${OpenCV_DIR}")
-  if(NOT WIN32)
-     find_path(OpenCV_DIR "share/opencv/OpenCVConfig.cmake" HINTS ${OpenCV_POSSIBLE_ROOT_DIRS} DOC "Root directory of OpenCV")
-     if(NOT OpenCV_DIR)
-       include(FindPkgConfig)
-       if(PKG_CONFIG_FOUND)
-         pkg_check_modules(OPENCV_PKGCONF opencv)
-         set(OpenCV_DIR ${OPENCV_PKGCONF_PREFIX})
-       endif(PKG_CONFIG_FOUND)
-     endif(NOT OpenCV_DIR)
-  else()
-    set(OpenCV_DIR "$ENV{OpenCV_DIR}")
-  endif ()
-endif(NOT EXISTS "${OpenCV_DIR}")
+if(NOT OpenCV_DIR)
+	# Add ROS OpenCV directory if ROS is installed
+	FIND_PROGRAM(ROSPACK_EXEC NAME rospack PATHS)
+	IF(ROSPACK_EXEC)
+	    #MESSAGE(STATUS "Found rospack executable : ${ROSPACK_EXEC}")
+		EXECUTE_PROCESS(COMMAND ${ROSPACK_EXEC} find opencv2
+				   	    OUTPUT_VARIABLE OPENCV_ROS_PATH
+						OUTPUT_STRIP_TRAILING_WHITESPACE
+						WORKING_DIRECTORY "./"
+		)
+		IF(OPENCV_ROS_PATH)
+		    #MESSAGE(STATUS "Found OpenCV ROS pkg : ${OPENCV_ROS_PATH}")
+		    SET(OpenCV_DIR ${OPENCV_ROS_PATH}/opencv/share/opencv)
+		ENDIF(OPENCV_ROS_PATH)
+	ENDIF(ROSPACK_EXEC)
+endif(NOT OpenCV_DIR)

 ##====================================================
 ## Find OpenCV libraries
 ##----------------------------------------------------
 if(EXISTS "${OpenCV_DIR}")
+	## Include the standard CMake script
+	include("${OpenCV_DIR}/OpenCVConfig.cmake")

-  set(OpenCV_configScript "${OpenCV_DIR}/OpenCVConfig.cmake")
-  if(NOT EXISTS "${OpenCV_configScript}")
-    set(OpenCV_configScript "${OpenCV_DIR}/share/opencv/OpenCVConfig.cmake")
-  endif(NOT EXISTS "${OpenCV_configScript}")
+	## Search for a specific version
+	set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")

-
-  #When its possible to use the Config script use it.
-  if(EXISTS "${OpenCV_configScript}")
-
-    MESSAGE(STATUS "OpenCV: using configuration file ${OpenCV_configScript}")
-
-    ## Include the standard CMake script
-    include("${OpenCV_configScript}")
-
-    ## Search for a specific version
-    if(WIN32 OR NOT PKG_CONFIG_FOUND)
-      set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
-    endif(WIN32 OR NOT PKG_CONFIG_FOUND)
-
-    ##Boris:TODO: check for correct OpenCV version in pkg-config case !!!
-
-
-    #Otherwise it try to guess it.
-  else(EXISTS "${OpenCV_configScript}")
-
-
-    find_path(OpenCV_INCLUDE_DIR "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "")
-    if(EXISTS  ${OpenCV_INCLUDE_DIR})
-      include_directories(${OpenCV_INCLUDE_DIR})
-    endif(EXISTS  ${OpenCV_INCLUDE_DIR})
-
-    if(NOT EXISTS ${VERSION_FILE_DIR}) #may alreay be in cache
-
-      #Find OpenCV version by looking at cvver.h or core/version.hpp
-      find_path(VERSION_FILE_DIR "version.hpp" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" "include/opencv2" "include/opencv2/core" DOC "")
-      if(NOT EXISTS ${VERSION_FILE_DIR})
-	find_path(VERSION_FILE_DIR "cvver.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "")
-	if(NOT EXISTS ${VERSION_FILE_DIR})
-	  message(FATAL_ERROR "OpenCV version file not found")
-	else(NOT EXISTS ${VERSION_FILE_DIR})
-	  set(VERSION_FILE ${VERSION_FILE_DIR}/cvver.h)
-	endif(NOT EXISTS ${VERSION_FILE_DIR})
-
-      else(NOT EXISTS ${VERSION_FILE_DIR})
-	set(VERSION_FILE ${VERSION_FILE_DIR}/version.hpp)
-
-      endif(NOT EXISTS ${VERSION_FILE_DIR})
-
-      #file(STRINGS ${OpenCV_INCLUDE_DIR}/cvver.h OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$")
-      file(STRINGS ${VERSION_FILE} OpenCV_VERSIONS_TMP REGEX "^#define CV_[A-Z]+_VERSION[ \t]+[0-9]+$")
-
-      string(REGEX REPLACE ".*#define CV_MAJOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MAJOR ${OpenCV_VERSIONS_TMP})
-      string(REGEX REPLACE ".*#define CV_MINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_MINOR ${OpenCV_VERSIONS_TMP})
-      string(REGEX REPLACE ".*#define CV_SUBMINOR_VERSION[ \t]+([0-9]+).*" "\\1" OpenCV_VERSION_PATCH ${OpenCV_VERSIONS_TMP})
-      set(OpenCV_VERSION ${OpenCV_VERSION_MAJOR}.${OpenCV_VERSION_MINOR}.${OpenCV_VERSION_PATCH} CACHE STRING "" FORCE)
-
-      if(WIN32 OR NOT PKG_CONFIG_FOUND)
-	set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
-      endif(WIN32 OR NOT PKG_CONFIG_FOUND)
-
-      ##Boris:TODO: check for correct OpenCV version in pklg-config case !!!
-
-
-    endif(NOT EXISTS ${VERSION_FILE_DIR})
-
-    if(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-      set(OPENCV_LIB_COMPONENTS calib3d contrib core features2d ffmpeg flann gpu highgui imgproc legacy ml objdetect ts video)
-
-      #Add parent directory of ${OpenCV_INCLUDE_DIR} to ${OpenCV_INCLUDE_DIR} itself
-      #to be able to do both
-      #include <cv.h> and #include <opencv2/core/core.hpp>
-      get_filename_component(PARENT_DIR ${OpenCV_INCLUDE_DIR} PATH)
-      set(OpenCV_INCLUDE_DIR "${OpenCV_INCLUDE_DIR};${PARENT_DIR}")
-
-    else(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-      set(OPENCV_LIB_COMPONENTS cxcore cv ml highgui cvaux)
-    endif(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-
-  endif(EXISTS "${OpenCV_configScript}")
-
-
-  if(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-
-    set(CVLIB_SUFFIX ".${OpenCV_VERSION}")
-    if(WIN32 OR NOT PKG_CONFIG_FOUND)
-      set(CVLIB_SUFFIX "${OpenCV_VERSION_MAJOR}${OpenCV_VERSION_MINOR}${OpenCV_VERSION_PATCH}")
-    endif(WIN32 OR NOT PKG_CONFIG_FOUND)
-
-    ## Initiate the variable before the loop
-    set(OpenCV_LIBS "")
-    set(OpenCV_FOUND_TMP true)
-
-    ## Loop over each components
-    foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
-
-      find_library(OpenCV_${__CVLIB}_LIBRARY_DEBUG NAMES "${__CVLIB}${CVLIB_SUFFIX}d" "lib${__CVLIB}${CVLIB_SUFFIX}d" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH)
-      find_library(OpenCV_${__CVLIB}_LIBRARY_RELEASE NAMES "${__CVLIB}${CVLIB_SUFFIX}" "lib${__CVLIB}${CVLIB_SUFFIX}" "opencv_${__CVLIB}${CVLIB_SUFFIX}" "opencv_${__CVLIB}" "${__CVLIB}" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH)
-
-      #On MacOSX libraries are named:  libopencv_${__CVLIB}${CVLIB_SUFFIX}.dylib
-      #On Linux libraries are named:  libopencv_${__CVLIB}.so${CVLIB_SUFFIX}
-      # but with pkg-config ${OPENCV_LIB_COMPONENTS} are already prefixed with opencv_ ?
-
-      #we add: "opencv_${__CVLIB}${CVLIB_SUFFIX}" for MacOSX
-      #we add: "${__CVLIB}" for linux (but version is not checked !)
-
-
-      #Remove the cache value
-      set(OpenCV_${__CVLIB}_LIBRARY "" CACHE STRING "" FORCE)
-
-      #both debug/release
-      if(OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE)
-        set(OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE}  CACHE STRING "" FORCE)
-
-        #only debug
-      elseif(OpenCV_${__CVLIB}_LIBRARY_DEBUG)
-        set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG}  CACHE STRING "" FORCE)
-
-        #only release
-      elseif(OpenCV_${__CVLIB}_LIBRARY_RELEASE)
-        set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE}  CACHE STRING "" FORCE)
-
-        #no library found
-      else()
-        set(OpenCV_FOUND_TMP false)
-
-      endif()
-
-
-      #Add to the general list
-      if(OpenCV_${__CVLIB}_LIBRARY)
-        set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY})
-      endif(OpenCV_${__CVLIB}_LIBRARY)
-
-    endforeach(__CVLIB)
-
-
-    set(OpenCV_FOUND ${OpenCV_FOUND_TMP} CACHE BOOL "" FORCE)
-
-
-  else(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-
-
-    ## Initiate the variable before the loop
-    set(OpenCV_LIBS "")
-    set(OpenCV_FOUND_TMP true)
-
-    ## Loop over each components
-    foreach(__CVLIB ${OPENCV_LIB_COMPONENTS})
-
-      find_library(OpenCV_${__CVLIB}_LIBRARY_DEBUG NAMES "${__CVLIB}${CVLIB_SUFFIX}d" "lib${__CVLIB}${CVLIB_SUFFIX}d" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH)
-      find_library(OpenCV_${__CVLIB}_LIBRARY_RELEASE NAMES "${__CVLIB}${CVLIB_SUFFIX}" "lib${__CVLIB}${CVLIB_SUFFIX}" PATHS "${OpenCV_DIR}/lib" NO_DEFAULT_PATH)
-
-
-
-      #Remove the cache value
-      set(OpenCV_${__CVLIB}_LIBRARY "" CACHE STRING "" FORCE)
-
-      #both debug/release
-      if(OpenCV_${__CVLIB}_LIBRARY_DEBUG AND OpenCV_${__CVLIB}_LIBRARY_RELEASE)
-        set(OpenCV_${__CVLIB}_LIBRARY debug ${OpenCV_${__CVLIB}_LIBRARY_DEBUG} optimized ${OpenCV_${__CVLIB}_LIBRARY_RELEASE}  CACHE STRING "" FORCE)
-
-        #only debug
-      elseif(OpenCV_${__CVLIB}_LIBRARY_DEBUG)
-        set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_DEBUG}  CACHE STRING "" FORCE)
-
-        #only release
-      elseif(OpenCV_${__CVLIB}_LIBRARY_RELEASE)
-        set(OpenCV_${__CVLIB}_LIBRARY ${OpenCV_${__CVLIB}_LIBRARY_RELEASE}  CACHE STRING "" FORCE)
-
-        #no library found
-      else()
-        set(OpenCV_FOUND_TMP false)
-
-      endif()
-
-      #Add to the general list
-      if(OpenCV_${__CVLIB}_LIBRARY)
-        set(OpenCV_LIBS ${OpenCV_LIBS} ${OpenCV_${__CVLIB}_LIBRARY})
-      endif(OpenCV_${__CVLIB}_LIBRARY)
-
-
-    endforeach(__CVLIB)
-
-
-    set(OpenCV_FOUND ${OpenCV_FOUND_TMP} CACHE BOOL "" FORCE)
-
-  endif(${OpenCV_VERSION} VERSION_GREATER 2.1.0)
-
+	if(OpenCV_INCLUDE_DIRS AND OpenCV_LIBS)
+		set(OpenCV_FOUND true)
+	endif(OpenCV_INCLUDE_DIRS AND OpenCV_LIBS)

 else(EXISTS "${OpenCV_DIR}")
-  set(ERR_MSG "Please specify OpenCV directory using OpenCV_DIR env. variable")
+        set(ERR_MSG "Please specify OpenCV directory using OpenCV_DIR env. variable (the folder containing OpenCVConfig.cmake)")
 endif(EXISTS "${OpenCV_DIR}")
 ##====================================================

@@ -302,17 +99,19 @@
   endif(NOT OpenCV_FIND_QUIETLY)
 else()
    if(NOT OpenCV_FIND_QUIETLY)
-     message(STATUS "Found OpenCV ${OpenCV_VERSION}")
+     message(STATUS "Found OpenCV ${OpenCV_VERSION} : ${OpenCV_DIR}")
    endif(NOT OpenCV_FIND_QUIETLY)
 endif()
 ##====================================================

 ##====================================================
-## Backward compatibility
+## Backward compatibility	        ${OpenCV_POSSIBLE_ROOT_DIRS}
+
 ##----------------------------------------------------
 if(OpenCV_FOUND)
   set(OpenCV_INCLUDE_DIRS "${OpenCV_INCLUDE_DIR}")
+  set(OpenCV_LIBRARIES "${OpenCV_LIBS}")
   #option(OpenCV_BACKWARD_COMPA "Add some variable to make this script compatible with the other version of FindOpenCV.cmake" false)
   #if(OpenCV_BACKWARD_COMPA)
   #  find_path(OpenCV_INCLUDE_DIRS "cv.h" PATHS "${OpenCV_DIR}" PATH_SUFFIXES "include" "include/opencv" DOC "Include directory")


FW fix for Stereo HW desync when extended is enabled

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "0c2087fb546ecd10b529e9e11668aed4d9ac2610")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "b9bcdd06b299b36c9719b5e3724228ad69d89ebb")

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


Stereo: Add support for extended and subpixel together

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "ade89030cc99e5fb7045bd4eda5705b134631af2")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "6d55842132d2ef37b6a6aeaaf810a8e745cd457c")

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


Update FW: configurable FPS and fix enumeration issues with AR0234

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "09389b417b6a358f866e9619a6e937641ba006ac")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "b7a1378f5f3b5c93d281f39659a8bfb3982340ff")

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


Always fail if Python or its libraries are not found

This is necessary to give the user a clear error message,
since otherwise the build will go on and fail anyway with
a cryptic message. See ROOT-9441.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -441,18 +441,14 @@

 #---Check for Python installation-------------------------------------------------------
 if(python)
-  if(fail-on-missing)
-    find_package(PythonInterp ${python_version} REQUIRED)
-    find_package(PythonLibs ${python_version} REQUIRED)
-    if (tmva)
+  find_package(PythonInterp ${python_version} REQUIRED)
+  find_package(PythonLibs ${python_version} REQUIRED)
+  if (tmva)
+    if(fail-on-missing)
       find_package(NumPy REQUIRED)
     else()
       find_package(NumPy)
     endif()
-  else()
-    find_package(PythonInterp ${python_version})
-    find_package(PythonLibs ${python_version})
-    find_package(NumPy)
   endif()
 endif()


Change the libsuffix for DAVIX library installation (CMake)

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -722,7 +722,7 @@
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DLIB_SUFFIX=
     )
     set(DAVIX_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include/davix)
-    set(DAVIX_LIBRARY -L${CMAKE_BINARY_DIR}/lib64 -ldavix)
+    set(DAVIX_LIBRARY -L${CMAKE_BINARY_DIR}/lib -ldavix)
     set(DAVIX_INCLUDE_DIRS ${DAVIX_INCLUDE_DIR})
     set(DAVIX_LIBRARIES ${DAVIX_LIBRARY})
 endif()


cmake: now we build packages with VERBOSE=1

--- cmake/Modules/DebSourcePPA.cmake
+++ cmake/Modules/DebSourcePPA.cmake
@@ -198,7 +198,7 @@
     "build:\n"
     "	mkdir $(BUILDDIR)\n"
     "	cd $(BUILDDIR); cmake -DDEB_SRC_PPA_ONCE=1 -DCMAKE_BUILD_TYPE=Release ${CPACK_DEBIAN_CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=/usr ../package/debian\n"
-    "	$(MAKE) -C $(BUILDDIR) preinstall\n"
+    "	$(MAKE) VERBOSE=1 -C $(BUILDDIR) preinstall\n"
     "	touch build\n"
     "\n"
     "binary: binary-indep binary-arch\n"


emscripten compile option tweaks

emscripten compile option tweaks

--- cmake/emscripten.toolchain.cmake
+++ cmake/emscripten.toolchain.cmake
@@ -18,13 +18,12 @@
 # at least I'm having weird startup problems...
 set(EMSCRIPTEN_TOTAL_MEMORY 134217728)
 set(EMSCRIPTEN_TOTAL_MEMORY_WORKER 16777216)
-set(EMSCRIPTEN_USE_MEMORY_INIT_FILE 0)
+set(EMSCRIPTEN_USE_MEMORY_INIT_FILE 1)
 set(EMSCRIPTEN_USE_LTO 1)
-set(EMSCRIPTEN_USE_CLOSURE 0)
+set(EMSCRIPTEN_USE_CLOSURE 1)
 set(EMSCRIPTEN_ASSERTIONS 0)
 set(EMSCRIPTEN_BUILD_VERBOSE 0)
 set(EMSCRIPTEN_OUTLINING_LIMIT 20000)
-# set(EMSCRIPTEN_LLVM_TARGET_DEFS "-s TARGET_X86=1 -s TARGET_LE32=0 ")

 message("EMSCRIPTEN_TOTAL_MEMORY: ${EMSCRIPTEN_TOTAL_MEMORY}")
 message("EMSCRIPTEN_TOTAL_MEMORY_WORKER: ${EMSCRIPTEN_TOTAL_MEMORY_WORKER}")
@@ -93,22 +92,22 @@

 # c++ compiler flags
 set(CMAKE_CXX_FLAGS "${ORYOL_PLATFORM_DEFINES} -std=c++11 -stdlib=libstdc++ -fno-exceptions -fstrict-aliasing -Wall -Wno-warn-absolute-paths -Wno-multichar -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-deprecated-writable-strings -Wno-unused-volatile-lvalue")
-set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
+set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG")
 set(CMAKE_CXX_FLAGS_DEBUG "-O2 -g -D_DEBUG_ -D_DEBUG -DORYOL_DEBUG=1")

 # c compiler flags
 set(CMAKE_C_FLAGS "${ORYOL_PLATFORM_DEFINES} -fstrict-aliasing -Wall -Wno-warn-absolute-paths -Wextra -Wno-multichar -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-deprecated-writable-strings -Wno-unused-volatile-lvalue")
-set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
+set(CMAKE_C_FLAGS_RELEASE "-Os -DNDEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-O2 -g -D_DEBUG_ -D_DEBUG -DORYOL_DEBUG=1")

 # linker flags
 set(CMAKE_EXE_LINKER_FLAGS "--memory-init-file ${EMSCRIPTEN_USE_MEMORY_INIT_FILE} -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY} -s DISABLE_EXCEPTION_CATCHING=1")
-set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-O2 --llvm-lto ${EMSCRIPTEN_USE_LTO} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-Os --llvm-lto ${EMSCRIPTEN_USE_LTO} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-O2 -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE}")

 # dynamic lib linker flags
 set(CMAKE_SHARED_LINKER_FLAGS "-shared --memory-init-file 0 -s WARN_ON_UNDEFINED_SYMBOLS=1 -s TOTAL_MEMORY=${EMSCRIPTEN_TOTAL_MEMORY_WORKER} -s BUILD_AS_WORKER=1 -s EXPORTED_FUNCTIONS=[\\\"_dowork\\\"] -s DISABLE_EXCEPTION_CATCHING=1")
-set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-O2 --llvm-lto ${EMSCRIPTEN_USE_LTO} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
+set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Os --llvm-lto ${EMSCRIPTEN_USE_LTO} -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} -s ASM_JS=1 -s ASSERTIONS=${EMSCRIPTEN_ASSERTIONS} -s OUTLINING_LIMIT=${EMSCRIPTEN_OUTLINING_LIMIT} --closure ${EMSCRIPTEN_USE_CLOSURE}")
 set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "-O2 -g -s ASM_JS=1 -s VERBOSE=${EMSCRIPTEN_BUILD_VERBOSE} --closure 0")

 # update cache variables for cmake gui


no longer needed

no longer needed

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

--- cmake/modules/QtDBusMacros.cmake
+++ cmake/modules/QtDBusMacros.cmake
@@ -1,57 +0,0 @@
-#
-# QtDBus macros, documentation see FindQtDBus.cmake
-#
-
-macro(qdbus_add_interfaces _sources)
-   foreach (_i ${ARGN})
-      get_filename_component(_xml_file ${_i} ABSOLUTE)
-      string(REGEX REPLACE ".*\\.([^\\.]+)\\.xml$" "\\1" _basename ${_i})
-      string(TOLOWER ${_basename} _basename)
-      set(_target_base ${CMAKE_CURRENT_BINARY_DIR}/${_basename}interface)
-
-      add_custom_command(OUTPUT ${_target_base}.cpp ${_target_base}.h
-         COMMAND ${QDBUS_IDL2CPP_EXECUTABLE}
-         ARGS -m -p ${_target_base} ${_xml_file}
-         DEPENDS ${_xml_file}
-      )
-
-      qt4_generate_moc(${_target_base}.h ${_target_base}.moc)
-      macro_add_file_dependencies(${_target_base}.h ${_target_base}.moc )
-      set_source_files_properties(${_target_base}.cpp PROPERTIES SKIP_AUTOMOC true)
-
-      set(${_sources} ${${_sources}} ${_target_base}.cpp)
-   endforeach (_i ${ARGN})
-endmacro(qdbus_add_interfaces)
-
-macro(qdbus_generate_interface _header)
-   get_filename_component(_in_file ${_header} ABSOLUTE)
-   get_filename_component(_basename ${_header} NAME_WE)
-   set(_target ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.xml)
-
-   add_custom_command(OUTPUT ${_target}
-      COMMAND ${QDBUS_CPP2XML_EXECUTABLE}
-      ARGS ${_in_file} > ${_target}
-      DEPENDS ${_in_file}
-   )
-endmacro(qdbus_generate_interface)
-
-macro(qdbus_add_adaptors _sources)
-   foreach (_i ${ARGN})
-      get_filename_component(_xml_file ${_i} ABSOLUTE)
-      string(REGEX REPLACE ".*\\.([^\\.]+)\\.xml$" "\\1" _basename ${_i})
-      string(TOLOWER ${_basename} _basename)
-      set(_target_base ${CMAKE_CURRENT_BINARY_DIR}/${_basename}adaptor)
-
-      add_custom_command(OUTPUT ${_target_base}.cpp ${_target_base}.h
-         COMMAND ${QDBUS_IDL2CPP_EXECUTABLE}
-         ARGS -m -a ${_basename}adaptor ${_xml_file}
-         DEPENDS ${_xml_file}
-      )
-
-      qt4_generate_moc(${_target_base}.h ${_target_base}.moc)
-      macro_add_file_dependencies(${_target_base}.h ${_target_base}.moc)
-      set_source_files_properties(${_target_base}.cpp PROPERTIES SKIP_AUTOMOC true)
-
-      set(${_sources} ${${_sources}} ${_target_base}.cpp)
-   endforeach (_i ${ARGN})
-endmacro(qdbus_add_adaptors)


Fix missing rt lib

Fix missing rt lib

--- cmake/posix/px4_impl_posix.cmake
+++ cmake/posix/px4_impl_posix.cmake
@@ -176,6 +176,10 @@
 		-include ${PX4_INCLUDE_DIR}visibility.h
                 )

+        set(added_exe_linker_flags
+		-lpthread
+		)
+
 else()

         set(added_definitions
@@ -185,11 +189,12 @@
 		-Dnoreturn_function=__attribute__\(\(noreturn\)\)
 		-include ${PX4_INCLUDE_DIR}visibility.h
                 )
+
+        set(added_exe_linker_flags
+		-lpthread -lrt
+		)
+
 endif()
-
-        set(added_exe_linker_flags
-		-lpthread
-		)

 	# Add the toolchain specific flags


ENH: GeoTIFF version parsing

ENH: GeoTIFF version parsing

--- CMake/FindGeoTIFF.cmake
+++ CMake/FindGeoTIFF.cmake
@@ -4,10 +4,31 @@
 #   GEOTIFF_FOUND        - True if GEOTIFF found.
 #   GEOTIFF_INCLUDE_DIRS - where to find geotiff.h
 #   GEOTIFF_LIBRARIES    - List of libraries to link when using GEOTIFF.
+#   GEOTIFF_VERSION        - version string
+#   GEOTIFF_VERSION_MAJOR  - version major number
+#   GEOTIFF_VERSION_MINOR  - version minor number
+#   GEOTIFF_VERSION_PATCH  - version patch number
+#   GEOTIFF_VERSION_NUMBER - version number ((major*100)+minor)*100+patch
+
 #

 find_path( GEOTIFF_INCLUDE_DIR geotiff.h
            PATH_SUFFIXES geotiff libgeotiff )
+
+if(EXISTS "${GEOTIFF_INCLUDE_DIR}/geotiff.h")
+  file(READ "${GEOTIFF_INCLUDE_DIR}/geotiff.h" _geotiff_h_CONTENTS)
+  string(REGEX REPLACE ".*# *define +LIBGEOTIFF_VERSION +([0-9])([0-9])([0-9])([0-9]).*" "\\1" GEOTIFF_VERSION_MAJOR "${_geotiff_h_CONTENTS}")
+  string(REGEX REPLACE ".*# *define +LIBGEOTIFF_VERSION +([0-9])([0-9])([0-9])([0-9]).*" "\\2" GEOTIFF_VERSION_MINOR "${_geotiff_h_CONTENTS}")
+  string(REGEX REPLACE ".*# *define +LIBGEOTIFF_VERSION +([0-9])([0-9])([0-9])([0-9]).*" "\\3" GEOTIFF_VERSION_PATCH "${_geotiff_h_CONTENTS}")
+  set(GEOTIFF_VERSION "${GEOTIFF_VERSION_MAJOR}.${GEOTIFF_VERSION_MINOR}.${GEOTIFF_VERSION_PATCH}")
+  math(EXPR GEOTIFF_VERSION_NUMBER
+    "((${GEOTIFF_VERSION_MAJOR})*100+${GEOTIFF_VERSION_MINOR})*100+${GEOTIFF_VERSION_PATCH}")
+else()
+  if(NOT GEOTIFF_FIND_QUIETLY)
+  message(WARNING "geotiff.h not found !")
+  endif()
+endif()
+

 set( GEOTIFF_NAMES ${GEOTIFF_NAMES} geotiff_i geotiff libgeotiff_i libgeotiff )
 find_library( GEOTIFF_LIBRARY NAMES ${GEOTIFF_NAMES} )


Fix ITKv3 build within Slicer

Fix ITKv3 build within Slicer

MakeOutput(0) error in itkImageToImageRegistrationMethod.txx

--- CMake/Superbuild/External_Slicer.cmake
+++ CMake/Superbuild/External_Slicer.cmake
@@ -91,7 +91,7 @@
     BINARY_DIR ${${proj}_DIR}
     PREFIX ${proj}${ep_suffix}
     GIT_REPOSITORY "git://public.kitware.com/Bender/Slicer.git"
-    GIT_TAG "47c1add73f333d515293afb4418c40f58372d04d"
+    GIT_TAG "93a820bde6a85fc94b873a540eab1ef839bfbf30"
     ${bender_external_update}
     INSTALL_COMMAND ""
     CMAKE_GENERATOR ${gen}


Add auto-load dependencies to test drivers.

--- CMake/mitkMacroCreateModuleTests.cmake
+++ CMake/mitkMacroCreateModuleTests.cmake
@@ -62,6 +62,11 @@
       foreach(subproject ${MODULE_SUBPROJECTS})
         add_dependencies(${subproject} ${TESTDRIVER})
       endforeach()
+    endif()
+
+    # Add meta dependencies (e.g. on auto-load modules from depending modules)
+    if(ALL_META_DEPENDENCIES)
+      add_dependencies(${TESTDRIVER} ${ALL_META_DEPENDENCIES})
     endif()

     #


Update NativeObject cmake files.

Update NativeObject cmake files.

--- cmake/LuaNativeObjects.cmake
+++ cmake/LuaNativeObjects.cmake
@@ -6,6 +6,9 @@
 				"Directory to LuaNativeObjects bindings generator.")
 set(USE_PRE_GENERATED_BINDINGS TRUE CACHE BOOL
 				"Set this to FALSE to re-generate bindings using LuaNativeObjects")
+
+set(GENERATE_LUADOCS TRUE CACHE BOOL
+				"Set this to FALSE to avoid generation of docs using LuaDoc")

 macro(GenLuaNativeObjects _src_files_var)
 	set(_new_src_files)
@@ -20,14 +23,16 @@
 			)
 			set_source_files_properties(${_src_file_out} PROPERTIES GENERATED TRUE)
 			set_source_files_properties(${_ffi_file_out} PROPERTIES GENERATED TRUE)
-			string(REGEX REPLACE ".nobj.lua" "" _doc_base ${_src_file})
-			string(REGEX REPLACE ".nobj.lua" ".luadoc" _doc_file_out ${_src_file})
-			add_custom_target(${_doc_file_out} ALL
-				COMMAND lua ${LUA_NATIVE_OBJECTS_PATH}/native_objects.lua -outpath docs -gen luadoc ${_src_file}
-				COMMAND luadoc -nofiles -d docs docs
-				WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-				DEPENDS ${_src_file}
-			)
+			if (${GENERATE_LUADOCS})
+				string(REGEX REPLACE ".nobj.lua" "" _doc_base ${_src_file})
+				string(REGEX REPLACE ".nobj.lua" ".luadoc" _doc_file_out ${_src_file})
+				add_custom_target(${_doc_file_out} ALL
+					COMMAND lua ${LUA_NATIVE_OBJECTS_PATH}/native_objects.lua -outpath docs -gen luadoc ${_src_file}
+					COMMAND luadoc -nofiles -d docs docs
+					WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+					DEPENDS ${_src_file}
+				)
+			endif()
 			set_source_files_properties(${_doc_file_out} PROPERTIES GENERATED TRUE)
 			set(_new_src_files ${_new_src_files} ${_src_file_out})
 		else(_src_file MATCHES ".nobj.lua")


Search for libglfw3 instead of libglfw

Search for libglfw3 instead of libglfw

--- cmake/Modules/FindGLFW.cmake
+++ cmake/Modules/FindGLFW.cmake
@@ -1,4 +1,4 @@
-find_library(GLFW_LIBRARY glfw)
+find_library(GLFW_LIBRARY glfw3)
 find_path(GLFW_INCLUDE_DIR glfw3.h PATH_SUFFIXES GLFW)

 include(FindPackageHandleStandardArgs)


Add a few tweaks for OS X

Add a few tweaks for OS X

--- cmake/ThirdPartyScotch.cmake
+++ cmake/ThirdPartyScotch.cmake
@@ -16,10 +16,16 @@

         SET(SCOTCH_SRC ${TPSRC}/src/scotch-6.0.0/src)

-        IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
-            SET(SCOTCH_MAKE Makefile.inc.x86-64_pc_linux2)
+        IF (APPLE)
+            SET(SCOTCH_MAKE Makefile.inc.i686_mac_darwin8)
+            SET(SCOTCH_LDFLAGS "")
         ELSE ()
-            SET(SCOTCH_MAKE Makefile.inc.i686_pc_linux2)
+            IF (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+                SET(SCOTCH_MAKE Makefile.inc.x86-64_pc_linux2)
+            ELSE ()
+                SET(SCOTCH_MAKE Makefile.inc.i686_pc_linux2)
+            ENDIF ()
+            SET(SCOTCH_LDFLAGS "-lz -lm -lrt -lpthread")
         ENDIF ()

         INCLUDE(ExternalProject)
@@ -34,7 +40,7 @@
                 ${SCOTCH_SRC}/Make.inc/${SCOTCH_MAKE}
                 ${SCOTCH_SRC}/Makefile.inc
             BUILD_COMMAND $(MAKE) -C ${TPSRC}/src/scotch-6.0.0/src
-                "LDFLAGS=-lz -lm -lrt -lpthread"
+                "LDFLAGS=${SCOTCH_LDFLAGS}"
                 "CLIBFLAGS=-fPIC" scotch
             INSTALL_COMMAND $(MAKE) -C ${TPSRC}/src/scotch-6.0.0/src
                 prefix=${TPSRC}/dist install


cmake: Do not use compiler visibility on Windows

--- cmake/VisibilityDetect.cmake
+++ cmake/VisibilityDetect.cmake
@@ -1,4 +1,10 @@
 function (plibsys_detect_visibility cflags ldflags)
+        if (WIN32 OR CYGWIN OR MSYS)
+            set (${cflags} "" PARENT_SCOPE)
+            set (${ldflags} "" PARENT_SCOPE)
+            return()
+        endif()
+
         # Check GCC
         check_c_source_compiles ("int main () {
                                         #if (__GNUC__ >= 4) && \\\\


cmake lazy linking?

cmake lazy linking?

--- cmake/dispatched_build.cmake
+++ cmake/dispatched_build.cmake
@@ -104,6 +104,9 @@
         target_include_directories(${target_name}.${branch}.obj PUBLIC ${gtest_SOURCE_DIR}/include ${target_includes})
         target_link_libraries("${target_name}.${branch}.obj" PRIVATE gtest zacc.system zacc.interface.${branch})

+        if(APPLE)
+            target_compile_options("${target_name}.${branch}.obj" PUBLIC -lazy-lz)
+        endif()
         add_dependencies("${target_name}.${branch}.obj" "zacc.generate.${branch}.types" "zacc.generate.${branch}.tests" ${target_dependencies})
         #target_link_libraries("${target_name}.${branch}.lib" gtest zacc.system ${target_libraries})


Add cuSPARSE support in the build system

--- cmake/modules/FindCUDA.cmake
+++ cmake/modules/FindCUDA.cmake
@@ -43,7 +43,7 @@
   MESSAGE(STATUS "Configured to use CUDA installation at ${CUDA_TOOLKIT_ROOT_DIR}")
 ENDIF()

-SET(_cuda_libraries ${CUDA_LIBRARIES})
+SET(_cuda_libraries ${CUDA_LIBRARIES} ${CUDA_cusparse_LIBRARY})
 SET(_cuda_include_dirs ${CUDA_INCLUDE_DIRS})
 DEAL_II_PACKAGE_HANDLE(CUDA
   LIBRARIES REQUIRED _cuda_libraries
@@ -58,7 +58,6 @@
     CUDA_cupti_LIBRARY
     CUDA_curand_LIBRARY
     CUDA_cusolver_LIBRARY
-    CUDA_cusparse_LIBRARY
     CUDA_HOST_COMPILER
     CUDA_nppc_LIBRARY
     CUDA_nppi_LIBRARY


BUG: FIND_FILE should be used instead of FIND_PATH.  We are looking for the actual UseCABLE.cmake file, not its directory.

--- Wrapping/FindCABLE.cmake
+++ Wrapping/FindCABLE.cmake
@@ -4,7 +4,7 @@
 # Sets CABLE_USE_FILE to the "UseCABLE.cmake".
 #

-FIND_PATH(CABLE_USE_FILE UseCABLE.cmake
+FIND_FILE(CABLE_USE_FILE UseCABLE.cmake
   /usr/local/lib/Cable
   /usr/lib/Cable
 )


WIP: add module activation option

WIP: add module activation option

--- Modules/Wrappers/QGIS/otb-module.cmake
+++ Modules/Wrappers/QGIS/otb-module.cmake
@@ -11,3 +11,4 @@
   DESCRIPTION
     "${DOCUMENTATION}"
 )
+otb_module_activation_option("Generating descriptors for QGIS processing" OFF)


Rolled back to a working version with quotes

--- cmake/FindCUDA_wrap.cmake
+++ cmake/FindCUDA_wrap.cmake
@@ -14,7 +14,7 @@
   if (CMAKE_COMPILER_IS_GNUCC)
     set (CUDA_PROPAGATE_HOST_FLAGS OFF)
     if (CMAKE_C_FLAGS)
-        set (CUDA_NVCC_FLAGS --compiler-options "${CMAKE_C_FLAGS}")
+        set (CUDA_NVCC_FLAGS "--compiler-options \"${CMAKE_C_FLAGS}\"")
     endif ()
   endif ()


Fixed a small omission in FindGreenplum.cmake

--- cmake/FindGreenplum.cmake
+++ cmake/FindGreenplum.cmake
@@ -81,6 +81,7 @@
             OUTPUT_VARIABLE GREENPLUM_ADDITIONAL_INCLUDE_DIRS
             OUTPUT_STRIP_TRAILING_WHITESPACE
         )
+        set(GREENPLUM_ADDITIONAL_INCLUDE_DIRS "${GREENPLUM_ADDITIONAL_INCLUDE_DIRS}/internal")
     else(GREENPLUM_PACKAGE_NAME STREQUAL "Greenplum Database")
         message(STATUS "Found pg_config at \"${GREENPLUM_PG_CONFIG}\", but it does not point to a Greenplum installation.")
         unset(GREENPLUM_CLIENT_INCLUDE_DIR)


Add specific linkers for MacOSPlatform

Add specific linkers for MacOSPlatform

--- cmake/PlatformMacOS.cmake
+++ cmake/PlatformMacOS.cmake
@@ -29,5 +29,8 @@
 set(DEFAULT_COMPILE_DEFS_DEBUG   ${MACOS_COMPILE_DEFS} _DEBUG) # Debug build
 set(DEFAULT_COMPILE_DEFS_RELEASE ${MACOS_COMPILE_DEFS} NDEBUG) # Release build

+set(MACOS_LINKER_FLAGS "-framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo")
+set(DEFAULT_LINKER_FLAGS_RELEASE ${MACOS_LINKER_FLAGS})
+
 set(MACOS_COMPILE_FLAGS)
 set(DEFAULT_COMPILE_FLAGS ${MACOS_COMPILE_FLAGS})


get rid of cmake/PlatformSetup.cmake

get rid of cmake/PlatformSetup.cmake

--- cmake/PlatformSetup.cmake
+++ cmake/PlatformSetup.cmake
@@ -1,84 +0,0 @@
-include(CheckCXXCompilerFlag)
-set(CMAKE_CXX_STANDARD 14)
-set(CMAKE_STANDARD_REQUIRED ON)
-
-string(REGEX MATCH "Clang"  IS_CLANG "${CMAKE_CXX_COMPILER_ID}")
-string(REGEX MATCH "GNU"    IS_GNUXX "${CMAKE_CXX_COMPILER_ID}")
-string(REGEX MATCH "Linux"  IS_LINUX "${CMAKE_SYSTEM_NAME}")
-string(REGEX MATCH "Darwin" IS_MACOS "${CMAKE_SYSTEM_NAME}")
-
-if(NOT CMAKE_BUILD_TYPE)
-    set(CMAKE_BUILD_TYPE Release CACHE STRING
-        "Choose the type of build: Release Debug"
-        FORCE)
-endif()
-
-# custom build options
-option(BUILD_AS_STATIC "build against static c++ runtime" OFF)
-
-# os dependent configs
-if(IS_LINUX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
-elseif(IS_MACOS)
-    option(BUILD_AS_BUNDLE "make MacOS bundle apps"    OFF)
-    if(BUILD_SHARED_LIBS)
-        message("@warning: rpath is skipped by default under OS X")
-        set(CMAKE_SKIP_RPATH TRUE)
-        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
-    endif()
-elseif(WIN32)
-    option(BUILD_AS_X32   "build for a 32bit (Win7+) targets"   OFF)
-    option(BUILD_AS_X32XP "build for a 32bit (XP/2003) targets" OFF)
-    # base definitions
-    add_definitions(-D_WINDOWS -DWIN32 -DNDEBUG
-        -DWIN32_LEAN_AND_MEAN -DNOMINMAX
-        -D_UNICODE -DUNICODE -D_CRT_SECURE_NO_WARNINGS
-        )
-    # old win32_xp sdk, needs to redefine windows version macro
-    # may needd a toolset flag as -T v140_xp for cmake
-    if(BUILD_AS_X32XP)
-        add_definitions(-D_WIN32_WINNT=0x0502 -DWINVER=0x0502)
-    else()
-        add_definitions(-DWIN64)
-    endif()
-endif()
-
-# architecture type, 32bit is only tested under windows (static Qt libs)
-if(CMAKE_SYSTEM_PROCESSOR MATCHES "[AMD64|x86_64]" AND NOT (BUILD_AS_X32 OR BUILD_AS_X32XP))
-    message(STATUS "compiling on x64 system ...")
-    set(ARCH_TYPE 64)
-else()
-    message(STATUS "compiling on x32 system ...")
-    set(ARCH_TYPE 32)
-endif()
-
-# compiler dependent settings
-if(IS_CLANG OR IS_GNUXX)
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-        -Wall -Wextra -W -Wwrite-strings -Wshadow -pedantic -Wcast-align \
-        -Wunused -Wno-unused-parameter -Wpointer-arith \
-        -Wnon-virtual-dtor -Woverloaded-virtual")
-    set(CMAKE_CXX_FLAGS_RELEASE "-O3 -g0")
-    set(CMAKE_CXX_FLAGS_DEBUG   "-O0 -g3")
-
-    if(BUILD_AS_STATIC AND IS_GNUXX)
-         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
-            -static-libstdc++ -static-libgcc")
-    endif()
-
-elseif(MSVC)
-    set(CMAKE_C_FLAGS_RELEASE   "-nologo -Zc:wchar_t -FS -O2 -MD -Zc:strictStrings -W3 -MP")
-    set(CMAKE_C_FLAGS_DEBUG     "${CMAKE_C_FLAGS_DEBUG} -MDd -MP")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
-    set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_C_FLAGS_DEBUG}")
-
-    set(CMAKE_SHARED_LINKER_FLAGS_RELEASE
-            "${CMAKE_SHARED_LINKER_FLAGS_RELASE} /Gy /GF /OPT:REF /OPT:ICF")
-
-    if(BUILD_AS_STATIC)
-        string(REPLACE "-MD"  "-MT"  CMAKE_C_FLAGS_RELEASE   "${CMAKE_C_FLAGS_RELEASE}")
-        string(REPLACE "-MD"  "-MT"  CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-        string(REPLACE "-MDd" "-MTd" CMAKE_C_FLAGS_DEBUG     "${CMAKE_C_FLAGS_DEBUG}")
-        string(REPLACE "-MDd" "-MTd" CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}")
-    endif()
-endif()


Make sure find_package(Sqlpp11) can be done multiple times (#306)

It is expected that CMake packages can be found multiple times without
errors. The target generated and defined by CMake, e.g. in a
*Targets.cmake file have a similar guard.

--- cmake/Sqlpp11Config.cmake
+++ cmake/Sqlpp11Config.cmake
@@ -31,15 +31,14 @@
 include("${CMAKE_CURRENT_LIST_DIR}/Sqlpp11Targets.cmake")

 # Import "ddl2cpp" script
-if(TARGET sqlpp11::ddl2cpp)
-  message(FATAL_ERROR "Target sqlpp11::ddl2cpp already defined")
+if(NOT TARGET sqlpp11::ddl2cpp)
+  get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
+  if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
+    message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
+  endif()
+  add_executable(sqlpp11::ddl2cpp IMPORTED)
+  set_target_properties(sqlpp11::ddl2cpp PROPERTIES
+    IMPORTED_LOCATION "${sqlpp11_ddl2cpp_location}"
+  )
+  unset(sqlpp11_ddl2cpp_location)
 endif()
-get_filename_component(sqlpp11_ddl2cpp_location "${CMAKE_CURRENT_LIST_DIR}/../../../bin/sqlpp11-ddl2cpp" REALPATH)
-if(NOT EXISTS "${sqlpp11_ddl2cpp_location}")
-  message(FATAL_ERROR "The imported target sqlpp11::ddl2cpp references the file '${sqlpp11_ddl2cpp_location}' but this file does not exists.")
-endif()
-add_executable(sqlpp11::ddl2cpp IMPORTED)
-set_target_properties(sqlpp11::ddl2cpp PROPERTIES
-  IMPORTED_LOCATION "${sqlpp11_ddl2cpp_location}"
-)
-unset(sqlpp11_ddl2cpp_location)


rename enable_python in messages.

rename enable_python in messages.

--- cmake/enable_python.cmake
+++ cmake/enable_python.cmake
@@ -14,12 +14,12 @@
   set(PACKAGE_PYTHONPATH "")
   foreach(d ${ARGN})
     if(d STREQUAL PROJECT_NAME)
-      message(WARNING "enable_python: Don't specify package name anymore")
+      message(WARNING "catkin_export_python: Don't specify package name anymore")
       set(d "src") #tmp hack: translate pkg name to 'src' to not break existing stuff
     endif()
     set(PYTHON_DIR_FULL ${CMAKE_CURRENT_SOURCE_DIR}/${d})
     if(NOT IS_DIRECTORY ${PYTHON_DIR_FULL})
-      message(WARNING "enable_python: Python directory ${PYTHON_DIR_FULL} not found")
+      message(WARNING "catkin_export_python: Python directory ${PYTHON_DIR_FULL} not found")
     else()
       list(APPEND PACKAGE_PYTHONPATH ${PYTHON_DIR_FULL})
     endif()


Change CINN tag, prepare for CINN release/v0.2 (#42063)

As the title

--- cmake/external/cinn.cmake
+++ cmake/external/cinn.cmake
@@ -26,7 +26,7 @@
 ######################################
 include(ExternalProject)
 set(CINN_PREFIX_DIR ${THIRD_PARTY_PATH}/CINN)
-set(CINN_GIT_TAG eedb801ca39bfc6b9621bc76c24a0bf98cb8404b)
+set(CINN_GIT_TAG release/v0.2)
 set(CINN_OPTIONAL_ARGS -DPY_VERSION=${PY_VERSION}
                        -DWITH_CUDA=${WITH_GPU}
                        -DWITH_CUDNN=${WITH_GPU}


Automated g4 rollback of changelist 278905557.

*** Reason for rollback ***

Reverted curl version to check if kokoro builds correctly again

*** Original change description ***

Firebase cpp: Updated opensource curl version to match internal curl version

***

PiperOrigin-RevId: 280521763

--- cmake/external/curl.cmake
+++ cmake/external/curl.cmake
@@ -22,7 +22,7 @@
   curl

   GIT_REPOSITORY https://github.com/curl/curl.git
-  GIT_TAG        curl-7_66_0
+  GIT_TAG        curl-7_58_0

   PREFIX ${PROJECT_BINARY_DIR}


pass the Python Executable

pass the Python Executable

--- SuperBuild/External_CCPi-RGL.cmake
+++ SuperBuild/External_CCPi-RGL.cmake
@@ -89,8 +89,8 @@
    # apparently this is the only way to pass environment variables to
    # external projects
     CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${CIL_VERSION}         cmake ${${proj}_SOURCE_DIR}  -DCMAKE_INSTALL_PREFIX=${libcilreg_Install_Dir}
-        -DBUILD_PYTHON_WRAPPERS=ON -DCMAKE_BUILD_TYPE=Release
-        -DBUILD_CUDA=OFF -DCONDA_BUILD=OFF
+        -DBUILD_PYTHON_WRAPPER=ON -DCMAKE_BUILD_TYPE=Release
+        -DBUILD_CUDA=ON -DCONDA_BUILD=OFF -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
         -DPYTHON_DEST=${PYTHON_DEST_DIR}
     BUILD_COMMAND make
     INSTALL_COMMAND make install