Rename Superbuild CMake variable to SimpleITK_USE_SYSTEM_*

This following the SimpleITK project naming convention, and best
practices done in ITK.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -281,9 +281,10 @@
 #------------------------------------------------------------------------------
 # Lua
 #------------------------------------------------------------------------------
-option ( USE_SYSTEM_LUA "Use a pre-compiled version of LUA 5.1 previously configured for your system" OFF )
-mark_as_advanced(USE_SYSTEM_LUA)
-if ( USE_SYSTEM_LUA )
+option ( SimpleITK_USE_SYSTEM_LUA "Use a pre-compiled version of LUA 5.1 previously configured for your system" OFF )
+sitk_legacy_naming( SimpleITK_USE_SYSTEM_LUA USE_SYSTEM_LUA)
+mark_as_advanced(SimpleITK_USE_SYSTEM_LUA)
+if ( SimpleITK_USE_SYSTEM_LUA )
   find_package( LuaInterp REQUIRED 5.1 )
   set( SimpleITK_LUA_EXECUTABLE ${LUA_EXECUTABLE} CACHE PATH "Lua executable used for code generation." )
   mark_as_advanced( SimpleITK_LUA_EXECUTABLE )
@@ -291,16 +292,15 @@
 else()
   include(External_Lua)
   list(APPEND ${CMAKE_PROJECT_NAME}_DEPENDENCIES Lua)
-  set( SimpleITK_LUA_EXECUTABLE ${SimpleITK_LUA_EXECUTABLE} CACHE PATH "Lua executable used for code generation." )
-  mark_as_advanced( SimpleITK_LUA_EXECUTABLE )
 endif()

 #------------------------------------------------------------------------------
 # Swig
 #------------------------------------------------------------------------------
-option ( USE_SYSTEM_SWIG "Use a pre-compiled version of SWIG 3.0 previously configured for your system" OFF )
-mark_as_advanced(USE_SYSTEM_SWIG)
-if(USE_SYSTEM_SWIG)
+option ( SimpleITK_USE_SYSTEM_SWIG "Use a pre-compiled version of SWIG 3.0 previously configured for your system" OFF )
+sitk_legacy_naming( SimpleITK_USE_SYSTEM_SWIG USE_SYSTEM_SWIG )
+mark_as_advanced(SimpleITK_USE_SYSTEM_SWIG)
+if(SimpleITK_USE_SYSTEM_SWIG)
   find_package ( SWIG 3 REQUIRED )
 else()
   include(External_Swig)
@@ -310,10 +310,11 @@
 #------------------------------------------------------------------------------
 # Google Test
 #------------------------------------------------------------------------------
-option( USE_SYSTEM_GTEST "Use an external version of GoogleTest. " OFF )
-mark_as_advanced(USE_SYSTEM_GTEST)
+option( SimpleITK_USE_SYSTEM_GTEST "Use an external version of GoogleTest. " OFF )
+sitk_legacy_naming( SimpleITK_USE_SYSTEM_GTEST USE_SYSTEM_GTEST )
+mark_as_advanced(SimpleITK_USE_SYSTEM_GTEST)
 if ( BUILD_TESTING )
-  if (USE_SYSTEM_GTEST)
+  if (SimpleITK_USE_SYSTEM_GTEST)
     if (DEFINED GTEST_ROOT AND EXISTS "${GTEST_ROOT}/CMakeLists.txt")
       list(APPEND SimpleITK_VARS GTEST_ROOT)
     else()
@@ -330,10 +331,11 @@
 #------------------------------------------------------------------------------
 # Python virtualenv
 #------------------------------------------------------------------------------
-option( USE_SYSTEM_VIRTUALENV "Use a system version of Python's virtualenv. " OFF )
-mark_as_advanced(USE_SYSTEM_VIRTUALENV)
+option( SimpleITK_USE_SYSTEM_VIRTUALENV "Use a system version of Python's virtualenv. " OFF )
+sitk_legacy_naming( SimpleITK_USE_SYSTEM_VIRTUALENV USE_SYSTEM_VIRTUALENV)
+mark_as_advanced(SimpleITK_USE_SYSTEM_VIRTUALENV)
 if( NOT DEFINED SimpleITK_PYTHON_USE_VIRTUALENV OR SimpleITK_PYTHON_USE_VIRTUALENV )
-  if ( USE_SYSTEM_VIRTUALENV )
+  if ( SimpleITK_USE_SYSTEM_VIRTUALENV )
     find_package( PythonVirtualEnv REQUIRED)
   else()
     include(External_virtualenv)
@@ -353,9 +355,10 @@
 if(ITK_WRAPPING)
   list(APPEND ITK_DEPENDENCIES Swig)
 endif()
-option(USE_SYSTEM_ITK "Use a pre-built version of ITK" OFF)
-mark_as_advanced(USE_SYSTEM_ITK)
-if(USE_SYSTEM_ITK)
+option(SimpleITK_USE_SYSTEM_ITK "Use a pre-built version of ITK" OFF)
+sitk_legacy_naming( SimpleITK_USE_SYSTEM_ITK USE_SYSTEM_ITK )
+mark_as_advanced(SimpleITK_USE_SYSTEM_ITK)
+if(SimpleITK_USE_SYSTEM_ITK)
   find_package(ITK REQUIRED)
   #we require certain packages be turned on in ITK
   include(sitkCheckForITKModuleDependencies)
@@ -395,6 +398,8 @@
     if (NOT _varName MATCHES "^SITK_LANGUAGES_VARS"
           AND
         NOT _varName MATCHES "^SimpleITK_VARS"
+          AND
+        NOT _varName MATCHES "^SimpleITK_USE_SYSTEM"
           AND
         NOT _varName MATCHES "^SimpleITK_.*_COMPILE_OPTIONS"
           AND


Separate suite test parallelism from build parallelism

Separates the test suite's test execution parallelism from build
parallelism, and reduces the former to not exceed the processor count
(which typically does not help performance and may hinder it, unlike for
build parallelism).

Review-URL: https://codereview.appspot.com/264710043

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -259,7 +259,9 @@
   endif()
 endif()

-math(EXPR PROCESSOR_COUNT "${PROCESSOR_COUNT} + 2")
+math(EXPR PARALLEL_COUNT_BUILD "${PROCESSOR_COUNT} + 2")
+# Typically no benefit and sometimes detrimental to exceed core count here
+math(EXPR PARALLEL_COUNT_TEST "${PROCESSOR_COUNT}")

 # CTest goes and does our builds and then wants to configure
 # and build again and complains there's no top-level setting of
@@ -326,7 +328,7 @@
     # can't repro w/ VERBOSE=1
     set(CTEST_BUILD_COMMAND_BASE "${MAKE_COMMAND} -j2")
   else (have_cygwin)
-    set(CTEST_BUILD_COMMAND_BASE "${MAKE_COMMAND} -j${PROCESSOR_COUNT}")
+    set(CTEST_BUILD_COMMAND_BASE "${MAKE_COMMAND} -j${PARALLEL_COUNT_BUILD}")
   endif (have_cygwin)
 elseif (arg_use_nmake)
   set(CTEST_CMAKE_GENERATOR "NMake Makefiles")
@@ -617,7 +619,7 @@
         # Note that adding -j to CMAKE_COMMAND does not work, though invoking
         # this script with -j does work, but we want parallel by default.
         ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}"
-          PARALLEL_LEVEL ${PROCESSOR_COUNT} ${ctest_test_args})
+          PARALLEL_LEVEL ${PARALLEL_COUNT_TEST} ${ctest_test_args})
       else (RUN_PARALLEL)
         ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" ${ctest_test_args})
       endif (RUN_PARALLEL)


fixed gccxml sanity test on linux

fixed gccxml sanity test on linux

git-svn-id: acd62226d57a1f8808639dd2a1c642f569255c24@2164 e431c221-245b-724f-9001-839d8ccdb2d3

--- build/cmake/JagConfig.cmake
+++ build/cmake/JagConfig.cmake
@@ -122,6 +122,7 @@
     set(_GCCXML_COMPILER_FLAGS "--gccxml-path=${GCCXML}" "--gccxml-cache=${CMAKE_BINARY_DIR}/gcccache")
     if(JAG_GCCXML_COMPILER)
       list(APPEND _GCCXML_COMPILER_FLAGS "--gccxml-compiler=${JAG_GCCXML_COMPILER}")
+      set(GCCXML_TEST_FLAG --gccxml-compiler ${JAG_GCCXML_COMPILER})
     endif()

     list(APPEND _RESULT ${_GCCXML_INCLUDE_ARG})
@@ -132,10 +133,10 @@
       execute_process(
         COMMAND
         "${GCCXML}" ${_GCCXML_INCLUDE_ARG}
-        --gccxml-compiler
-        ${JAG_GCCXML_COMPILER}
-        ${CMAKE_SOURCE_DIR}/code/include/pdflib/interfaces/canvas.h
-        RESULT_VARIABLE GCCXML_EXIT)
+        ${GCCXML_TEST_FLAG}
+        "${CMAKE_SOURCE_DIR}/code/include/pdflib/interfaces/canvas.h"
+        RESULT_VARIABLE GCCXML_EXIT
+        OUTPUT_QUIET ERROR_QUIET)
       set(GCCXML_TESTED TRUE CACHE INTERNAL "whether gccxml santity check has been run")
       if(NOT GCCXML_EXIT EQUAL 0)
         message(STATUS "GCCXML does not work, disabling.")


Add new freetype version.

Add new freetype version.

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype252 freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype253 freetype252 freetype251 freetype2501 freetype250 freetype2412 freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Backing out changeset ad1007009255 (a better fix should be found)

--- CMake/otbIncludeDirectories.cmake
+++ CMake/otbIncludeDirectories.cmake
@@ -272,7 +272,6 @@
   ObjectDetection
   ApplicationEngine
   Utilities
-  Utilities/ITK
   Utilities/otbsvm
   Utilities/InsightJournal
   Utilities/otb6S


CMake: [skip ci] use FILTER of list command only for v3.6 or later

--- cMake/FindOpenCasCade.cmake
+++ cMake/FindOpenCasCade.cmake
@@ -37,10 +37,12 @@
   # we first try to find opencascade directly:
   if(NOT OCCT_CMAKE_FALLBACK)
     find_package(OpenCASCADE CONFIG QUIET)
-    get_property(flags DIRECTORY PROPERTY COMPILE_DEFINITIONS)
-    # OCCT 7.5 adds this define that causes hundreds of compiler warnings with Qt5.x, so remove it again
-    list(FILTER flags EXCLUDE REGEX [[GL_GLEXT_LEGACY]])
-    set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${flags})
+    if(NOT (CMAKE_VERSION VERSION_LESS 3.6.0))
+        get_property(flags DIRECTORY PROPERTY COMPILE_DEFINITIONS)
+        # OCCT 7.5 adds this define that causes hundreds of compiler warnings with Qt5.x, so remove it again
+        list(FILTER flags EXCLUDE REGEX [[GL_GLEXT_LEGACY]])
+        set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS ${flags})
+    endif()
   endif(NOT OCCT_CMAKE_FALLBACK)
   if(OpenCASCADE_FOUND)
     set(OCC_FOUND ${OpenCASCADE_FOUND})


Avoid build time on generated files from pyside-rcc and pyside-uic.

Fixes build compare:
[ 3218s] RPM file checksum differs.
[ 3218s] Extracting packages
[ 3232s] /usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py differs (Python script, ASCII text executable, with very long lines)
[ 3232s] --- old//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-21 20:26:34.000000000 +0000
[ 3232s] +++ new//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-23 11:41:24.000000000 +0000
[ 3232s] @@ -2,7 +2,7 @@
[ 3232s]
[ 3232s]  # Resource object code
[ 3232s]  #
[ 3232s] -# Created: Wed Jan 21 20:26:34 2015
[ 3232s] +# Created: Fri Jan 23 11:41:24 2015
[ 3232s]  #      by: The Resource Compiler for PySide (Qt v4.8.4)
[ 3232s]  #
[ 3232s]  # WARNING! All changes made in this file will be lost!

--- cMake/FindPySideTools.cmake
+++ cMake/FindPySideTools.cmake
@@ -31,10 +31,20 @@
     #ADD_CUSTOM_TARGET(${it} ALL
     #  DEPENDS ${outfile}
     #)
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-      COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
-      MAIN_DEPENDENCY ${infile}
-    )
+    if(WIN32)
+        ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+          COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
+          MAIN_DEPENDENCY ${infile}
+        )
+    else(WIN32)
+        # Especially on Open Build Service we don't want changing date like
+        # pyside-uic generates in comments at beginning.
+        EXECUTE_PROCESS(
+          COMMAND ${PYSIDEUIC4BINARY} ${infile}
+          COMMAND sed "/^# /d"
+          OUTPUT_FILE ${outfile}
+        )
+    endif(WIN32)
     SET(${outfiles} ${${outfiles}} ${outfile})
   ENDFOREACH(it)
 ENDMACRO (PYSIDE_WRAP_UI)
@@ -47,10 +57,20 @@
     #ADD_CUSTOM_TARGET(${it} ALL
     #  DEPENDS ${outfile}
     #)
-    ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-      COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
-      MAIN_DEPENDENCY ${infile}
-    )
+    if(WIN32)
+        ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
+          COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
+          MAIN_DEPENDENCY ${infile}
+        )
+    else(WIN32)
+        # Especially on Open Build Service we don't want changing date like
+        # pyside-rcc generates in comments at beginning.
+        EXECUTE_PROCESS(
+          COMMAND ${PYSIDERCC4BINARY} ${infile}
+          COMMAND sed "/^# /d"
+          OUTPUT_FILE ${outfile}
+       )
+    endif(WIN32)
     SET(${outfiles} ${${outfiles}} ${outfile})
   ENDFOREACH(it)
 ENDMACRO (PYSIDE_WRAP_RC)


Xcode attributes for no code signing

Xcode attributes for no code signing

--- flags/ios_nocodesign.cmake
+++ flags/ios_nocodesign.cmake
@@ -50,3 +50,6 @@
     )
   endif()
 endif()
+
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO CACHE STRING "" FORCE)
+set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "" CACHE STRING "" FORCE)


Fix building on CUDA 11.0. (#7187)

Fix building on CUDA 11.0. (#7187)

--- cmake/Utils.cmake
+++ cmake/Utils.cmake
@@ -90,8 +90,10 @@
   endif()
   # Set up architecture flags
   if(NOT flags)
-    if (CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
+    if (CUDA_VERSION VERSION_GREATER_EQUAL "11.1")
       set(flags "50;52;60;61;70;75;80;86")
+    elseif (CUDA_VERSION VERSION_GREATER_EQUAL "11.0")
+      set(flags "35;50;52;60;61;70;75;80")
     elseif(CUDA_VERSION VERSION_GREATER_EQUAL "10.0")
       set(flags "35;50;52;60;61;70;75")
     elseif(CUDA_VERSION VERSION_GREATER_EQUAL "9.0")


Added add_rostest().  Don't know yet whether it works.

--- cmake/tests.cmake
+++ cmake/tests.cmake
@@ -1,5 +1,6 @@
 macro(initialize_tests)
   if(NOT TARGET tests)
+    message("TODO: use rostest-check-results to verify that result files were generated")
     add_custom_target(tests)
   endif()
   if(NOT TARGET test)
@@ -146,3 +147,22 @@
   string(REPLACE "/" "." output_file_name ${dir})
   append_test_to_cache(catkin-tests "${nosetests_path} --where=${_dir_name} --with-xunit --xunit-file=${output_dir_name}/${output_file_name}.xml ${_covarg}")
 endfunction()
+
+function(add_rostest file)
+  # Check that we can find rostest
+  find_program(rostest_exe rostest PATHS ${CMAKE_BINARY_DIR}/bin)
+  if(NOT rostest_exe)
+    message(FATAL_ERROR "Can't find rostest executable")
+  endif()
+
+  # Check that the file exists, #1621
+  set(_file_name _file_name-NOTFOUND)
+  find_file(_file_name ${file}
+            PATHS ${CMAKE_CURRENT_SOURCE_DIR}
+            NO_DEFAULT_PATH)
+  if(NOT _file_name)
+    message(FATAL_ERROR "Can't find rostest file \"${file}\"")
+  endif()
+
+  append_test_to_cache(catkin-tests "${rostest_exe} ${_file_name}")
+endfunction()


[cmake] don't use a too new function in lua_source() (broken builds).

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -43,7 +43,8 @@
     set (tmpfile "${CMAKE_CURRENT_BINARY_DIR}/${filename}.new.c")
     set (dstfile "${CMAKE_CURRENT_BINARY_DIR}/${filename}.c")
     get_filename_component(module ${filename} NAME_WE)
-    get_filename_component(dstdir ${dstfile} DIRECTORY)
+    get_filename_component(_name ${dstfile} NAME)
+    string(REGEX REPLACE "${_name}$" "" dstdir ${dstfile})
     if (IS_DIRECTORY ${dstdir})
     else()
         file(MAKE_DIRECTORY ${dstdir})


COMP: Fix KWSTYLE_DASHBOARD_SUDBMISSION superbuild warning.

--- CMake/SuperBuild.cmake
+++ CMake/SuperBuild.cmake
@@ -367,6 +367,10 @@
 ## TubeTK - Normal Build
 ##
 set( proj TubeTK )
+if( TubeTK_USE_KWSTYLE )
+  set( kwstyle_dashboard_submission_arg
+    "-DKWSTYLE_DASHBOARD_SUBMISSION:BOOL=${KWSTYLE_DASHBOARD_SUBMISSION}" )
+endif()
 ExternalProject_Add( ${proj}
   DOWNLOAD_COMMAND ""
   SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -387,7 +391,7 @@
     -DTubeTK_USE_SUPERBUILD:BOOL=FALSE
     -DTubeTK_USE_VTK:BOOL=${TubeTK_USE_VTK}
     -DTubeTK_USE_KWSTYLE:BOOL=${TubeTK_USE_KWSTYLE}
-    -DKWSTYLE_DASHBOARD_SUBMISSION:BOOL=${KWSTYLE_DASHBOARD_SUBMISSION}
+    ${kwstyle_dashboard_submission_arg}
     -DTubeTK_USE_CTK:BOOL=${TubeTK_USE_CTK}
     -DTubeTK_USE_QT:BOOL=${TubeTK_USE_QT}
     -DTubeTK_USE_ITKV4:BOOL=${TubeTK_USE_ITKV4}


COMP: Constrain x86_64 optimization flags according to CMAKE_SYSTEM_PROCESSOR

CMAKE_SYSTEM_PROCESSOR defines the target compilation architecture. When
we want x86_64 optimizations, e.g. -march=corei7, only add these flags
when building for this architecture. On Linux/macOS (GCC/AppleClang),
CMAKE_SYSTEM_PROCESSOR is "x86_64" and on Windows (Visual Studio) it is
"AMD64".

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -212,41 +212,43 @@
   set(${c_optimization_flags_var} "" PARENT_SCOPE)
   set(${cxx_optimization_flags_var} "" PARENT_SCOPE)

-  if(MSVC)
-    check_avx_flags(InstructionSetOptimizationFlags)
-    if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
-       list(APPEND InstructionSetOptimizationFlags
-            /arch:SSE /arch:SSE2)
-    endif()
-  elseif(NOT EMSCRIPTEN)
-    if (${CMAKE_C_COMPILER} MATCHES "icc.*$")
-      set(USING_INTEL_ICC_COMPILER TRUE)
-    endif()
-    if (${CMAKE_CXX_COMPILER} MATCHES "icpc.*$")
-      set(USING_INTEL_ICC_COMPILER TRUE)
-    endif()
-    if(USING_INTEL_ICC_COMPILER)
-      set(InstructionSetOptimizationFlags "")
-    else()
-      set(InstructionSetOptimizationFlags "")
-    endif ()
-
-    # Check this list on C compiler only
-    set(c_flags "")
-
-    # Check this list on C++ compiler only
-    set(cxx_flags "")
-
-    # Check this list on both C and C++ compilers
-    set(InstructionSetOptimizationFlags
-       # https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/i386-and-x86_002d64-Options.html
-       # NOTE the corei7 release date was 2008
-       #-mtune=native # Tune the code for the computer used compile ITK, but allow running on generic cpu archetectures
-       -mtune=generic # for reproducible results https://github.com/InsightSoftwareConsortium/ITK/issues/1939
-       -march=corei7 # Use ABI settings to support corei7 (circa 2008 ABI feature sets, core-avx circa 2013)
-       )
-  endif()
-  set(c_and_cxx_flags ${InstructionSetOptimizationFlags})
+  if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(x86_64|AMD64)")
+    if(MSVC)
+      check_avx_flags(InstructionSetOptimizationFlags)
+      if("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
+         list(APPEND InstructionSetOptimizationFlags
+              /arch:SSE /arch:SSE2)
+      endif()
+    elseif(NOT EMSCRIPTEN)
+      if (${CMAKE_C_COMPILER} MATCHES "icc.*$")
+        set(USING_INTEL_ICC_COMPILER TRUE)
+      endif()
+      if (${CMAKE_CXX_COMPILER} MATCHES "icpc.*$")
+        set(USING_INTEL_ICC_COMPILER TRUE)
+      endif()
+      if(USING_INTEL_ICC_COMPILER)
+        set(InstructionSetOptimizationFlags "")
+      else()
+        set(InstructionSetOptimizationFlags "")
+      endif ()
+
+      # Check this list on C compiler only
+      set(c_flags "")
+
+      # Check this list on C++ compiler only
+      set(cxx_flags "")
+
+      # Check this list on both C and C++ compilers
+      set(InstructionSetOptimizationFlags
+         # https://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/i386-and-x86_002d64-Options.html
+         # NOTE the corei7 release date was 2008
+         #-mtune=native # Tune the code for the computer used compile ITK, but allow running on generic cpu archetectures
+         -mtune=generic # for reproducible results https://github.com/InsightSoftwareConsortium/ITK/issues/1939
+         -march=corei7 # Use ABI settings to support corei7 (circa 2008 ABI feature sets, core-avx circa 2013)
+         )
+    endif()
+    set(c_and_cxx_flags ${InstructionSetOptimizationFlags})
+  endif()

   check_c_compiler_flags(    CMAKE_C_WARNING_FLAGS ${c_and_cxx_flags} ${c_flags})
   check_cxx_compiler_flags(CMAKE_CXX_WARNING_FLAGS ${c_and_cxx_flags} ${cxx_flags})


COMP: Suppress inline warning on new gcc compilers

Change-Id: I51893adf9207b107479199cfd5e02e232acdf001

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -85,6 +85,7 @@
     -Wshadow
     -Wunused
     -Wwrite-strings
+    -funit-at-a-time
   )

   # Check this list on C++ compiler only


fbcode_builder: cmake: propagate thrift include dependencies correctly

Summary:
Update `add_thrift_cpp2_library()` to pass in the correct `-I` flags when
invoking the thrift compiler so that it can find all of the other thrift files
that this library depends on.

D16062657 was a previous attempt to do this, but suffered from a few problems:
- It required all dependencies to be defined before
  `add_thrift_cpp2_library()` was called.  This requires users to carefully
  order their CMake files and subdirectory include ordering.
- It only handled one level of dependencies, and did not propagate include
  paths for deeper dependencies.
- It set the include path for dependencies to the source directory path where
  the dependency was originally built, rather than the directory where the
  thrift file for that dependency would be installed.

This change does require CMake 3.8+.  Previous versions of CMake do not
support using generator expressions to generate multiple arguments for a
custom command.

Reviewed By: strager

Differential Revision: D17005381

fbshipit-source-id: 31190beba94b4d1010445375a5e2791450230f7d

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -17,13 +17,24 @@
 #   The sub-directory where generated headers will be installed.
 #   Defaults to "include" if not specified.  The caller must still call
 #   install() to install the thrift library if desired.
+# - THRIFT_INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "${INCLUDE_DIR}/thrift-files" if not specified.
+#   The caller must still call install() to install the thrift library if
+#   desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
   set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()
+  if(NOT DEFINED ARG_THRIFT_INCLUDE_DIR)
+    set(ARG_THRIFT_INCLUDE_DIR "${ARG_INCLUDE_DIR}/thrift-files")
+  endif()

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -39,9 +50,6 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
-  if(NOT DEFINED ARG_INCLUDE_DIR)
-    set(ARG_INCLUDE_DIR "include")
-  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -78,22 +86,21 @@
     )
   endforeach()

-  list(APPEND thrift_include_options -I "${CMAKE_SOURCE_DIR}")
-  foreach(depends IN LISTS ARG_DEPENDS)
-    get_property(thrift_include_directory
-      TARGET ${depends}
-      PROPERTY THRIFT_INCLUDE_DIRECTORY)
-
-    if (thrift_include_directory STREQUAL "")
-      message(STATUS "No thrift dependency found for ${depends}")
-    else()
-      list(
-        APPEND thrift_include_options
-        -I "${thrift_include_directory}"
-      )
-    endif()
-  endforeach()
-
+  # This generator expression gets the list of include directories required
+  # for all of our dependencies.
+  # It requires using COMMAND_EXPAND_LISTS in the add_custom_command() call
+  # below.  COMMAND_EXPAND_LISTS is only available in CMake 3.8+
+  # If we really had to support older versions of CMake we would probably need
+  # to use a wrapper script around the thrift compiler that could take the
+  # include list as a single argument and split it up before invoking the
+  # thrift compiler.
+  if (NOT POLICY CMP0067)
+    message(FATAL_ERROR "add_thrift_cpp2_library() requires CMake 3.8+")
+  endif()
+  set(
+    thrift_include_options
+    "-I;$<JOIN:$<TARGET_PROPERTY:${LIB_NAME}.thrift_includes,INTERFACE_INCLUDE_DIRECTORIES>,;-I;>"
+  )
   file(
     GLOB_RECURSE THRIFT_TEMPLATE_FILES
     FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/cpp2/*.mustache"
@@ -104,6 +111,7 @@
     OUTPUT
       ${generated_headers}
       ${generated_sources}
+    COMMAND_EXPAND_LISTS
     COMMAND
       "${CMAKE_COMMAND}" -E make_directory "${output_dir}"
     COMMAND
@@ -111,7 +119,7 @@
       --strict
       --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
-      ${thrift_include_options}
+      "${thrift_include_options}"
       -o "${output_dir}"
       "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
     WORKING_DIRECTORY
@@ -159,11 +167,27 @@
     PROPERTY PUBLIC_HEADER ${generated_headers}
   )

+  # Define a dummy interface library to help propagate the thrift include
+  # directories between dependencies.
+  add_library("${LIB_NAME}.thrift_includes" INTERFACE)
+  target_include_directories(
+    "${LIB_NAME}.thrift_includes"
+    INTERFACE
+      "$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_THRIFT_INCLUDE_DIR}>"
+  )
+  foreach(dep IN LISTS ARG_DEPENDS)
+    target_link_libraries(
+      "${LIB_NAME}.thrift_includes"
+      INTERFACE "${dep}.thrift_includes"
+    )
+  endforeach()
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
-      EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
-      THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      EXPORT_PROPERTIES "THRIFT_INSTALL_DIR"
+      THRIFT_INSTALL_DIR "${ARG_THRIFT_INCLUDE_DIR}/${include_prefix}"
       HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
 endfunction()


When falling back on Windows host system makes a copy immediately. Close #918.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -660,12 +660,11 @@
             else ()
                 set (COMMAND COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ABS_SOURCE} ${ABS_DESTINATION})
             endif ()
+            # Fallback to copy only one time
+            execute_process (${COMMAND})
             if (TARGET ${TARGET_NAME})
                 # Fallback to copy everytime the target is built
                 add_custom_command (TARGET ${TARGET_NAME} POST_BUILD ${COMMAND})
-            else ()
-                # Fallback to copy only one time
-                execute_process (${COMMAND})
             endif ()
         else ()
             message (WARNING "Unable to create symbolic link on this host system, you may need to manually copy file/dir from \"${SOURCE}\" to \"${DESTINATION}\"")


fbcode_builder: support installing thrift generated header files

Summary:
Update add_thrift_cpp2_library() to add a PUBLIC_HEADER property to the
generated library target, so that the generated headers can be installed using
an `install()` call.  Also add a `HEADER_INSTALL_DIR` property which indicates
the directory they should be installed into.  A `INCLUDE_DIR` argument was
added to customize the include installation path, should anyone care to do so.

This also removes code that was previously incorrectly installing the
generated headers into the source tree.

Reviewed By: wez

Differential Revision: D16853404

fbshipit-source-id: 6f640b2bd347c99804e074fca0209dda37c8a9cf

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -4,10 +4,26 @@

 include(FBCMakeParseArgs)

+# Generate a C++ library from a thrift file
+#
+# Parameters:
+# - SERVICES <svc1> [<svc2> ...]
+#   The names of the services defined in the thrift file.
+# - DEPENDS <dep1> [<dep2> ...]
+#   A list of other thrift C++ libraries that this library depends on.
+# - OPTIONS <opt1> [<opt2> ...]
+#   A list of options to pass to the thrift compiler.
+# - INCLUDE_DIR <path>
+#   The sub-directory where generated headers will be installed.
+#   Defaults to "include" if not specified.  The caller must still call
+#   install() to install the thrift library if desired.
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
+  set(one_value_args INCLUDE_DIR)
   set(multi_value_args SERVICES DEPENDS OPTIONS)
-  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")
+  fb_cmake_parse_args(
+    ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
+  )

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -23,6 +39,9 @@
     "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
   )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)
+  if(NOT DEFINED ARG_INCLUDE_DIR)
+    set(ARG_INCLUDE_DIR "include")
+  endif()

   if (NOT "${include_prefix}" STREQUAL "")
     list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
@@ -110,19 +129,11 @@
     ${generated_sources}
   )

-  install(
-    FILES ${generated_headers}
-    DESTINATION $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/gen-cpp2
-  )
-
   target_include_directories(
     "${LIB_NAME}"
-    PRIVATE
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
     PUBLIC
-      ${FOLLY_INCLUDE_DIR}
-      ${FBTHRIFT_INCLUDE_DIR}
+      "$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>"
+      "$<INSTALL_INTERFACE:${ARG_INCLUDE_DIR}>"
   )
   target_link_libraries(
     "${LIB_NAME}"
@@ -132,14 +143,27 @@
       Folly::folly
   )

+  # Add ${generated_headers} to the PUBLIC_HEADER property for ${LIB_NAME}
+  #
+  # This allows callers to install it using
+  # "install(TARGETS ${LIB_NAME} PUBLIC_HEADER)"
+  # However, note that CMake's PUBLIC_HEADER behavior is rather inflexible,
+  # and does have any way to preserve header directory structure.  Callers
+  # must be careful to use the correct PUBLIC_HEADER DESTINATION parameter
+  # when doing this, to put the files the correct directory themselves.
+  # We define a HEADER_INSTALL_DIR property with the include directory prefix,
+  # so typically callers should specify the PUBLIC_HEADER DESTINATION as
+  # "$<TARGET_PROPERTY:${LIB_NAME},HEADER_INSTALL_DIR>"
+  set_property(
+    TARGET "${LIB_NAME}"
+    PROPERTY PUBLIC_HEADER ${generated_headers}
+  )
+
   set_target_properties(
     "${LIB_NAME}"
     PROPERTIES
       EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
       THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
+      HEADER_INSTALL_DIR "${ARG_INCLUDE_DIR}/${include_prefix}/gen-cpp2"
   )
-
-  get_property(thrift_include_directory
-    TARGET "${LIB_NAME}"
-    PROPERTY THRIFT_INCLUDE_DIRECTORY)
 endfunction()


Added support for more pip libraries

Added support for more pip libraries

--- third_party/pip_libraries.cmake
+++ third_party/pip_libraries.cmake
@@ -4,7 +4,7 @@
 endif ()
 set(THIRD_PARTY_PIP_LIBRARIES_CMAKE_ TRUE)

-function(pip_library LIB)
+function(pip_library LIB REF)
   set(FULL_NAME third_party.pip.${LIB})
   set(${FULL_NAME} "dummy" PARENT_SCOPE)  # No link occurs in python case.
   set(TARGET ${FULL_NAME}_target)
@@ -13,22 +13,25 @@
   add_dependencies(${TARGET} ${VIRTUALENV_TARGET})
   add_custom_command(
     TARGET ${TARGET} POST_BUILD
-    COMMAND ${ARGN} /usr/bin/env pip install "${LIB}" >/dev/null
+    COMMAND ${ARGN} /usr/bin/env pip install "${REF}" >/dev/null
     DEPENDS ${VIRTUALENV_TARGET})
 endfunction(pip_library)

 pip_library(
-    Pillow CC=/usr/bin/gcc
+    Pillow Pillow CC=/usr/bin/gcc
     ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future)
-pip_library(PyTrie)
-pip_library(beautifulsoup4)
-pip_library(cssselect)
-pip_library(django)
-pip_library(marisa-trie CC=/usr/bin/gcc CXX=/usr/bin/g++)
-pip_library(numpy CC=/usr/bin/gcc)
-pip_library(psd-tools)
-pip_library(pycountry)
-pip_library(python-gflags)
-pip_library(requests)
-pip_library(scikit-learn CC=/usr/bin/gcc CXX=/usr/bin/g++)
-pip_library(scipy CC=/usr/bin/gcc CXX=/usr/bin/g++)
+pip_library(PyTrie PyTrie)
+pip_library(beautifulsoup4 beautifulsoup4)
+pip_library(cssselect cssselect)
+pip_library(django django)
+pip_library(django-nonrel git+git://github.com/django-nonrel/django)
+pip_library(djangotoolbox git+git://github.com/django-nonrel/djangotoolbox)
+pip_library(marisa-trie marisa-trie CC=/usr/bin/gcc CXX=/usr/bin/g++)
+pip_library(mongodb-engine git+git://github.com/django-nonrel/mongodb-engine)
+pip_library(numpy numpy CC=/usr/bin/gcc)
+pip_library(psd-tools psd-tools)
+pip_library(pycountry pycountry)
+pip_library(python-gflags python-gflags)
+pip_library(requests requests)
+pip_library(scikit-learn scikit-learn CC=/usr/bin/gcc CXX=/usr/bin/g++)
+pip_library(scipy scipy CC=/usr/bin/gcc CXX=/usr/bin/g++)


cmake: Add compiler check for -fstack-protector-strong

--- CompilerChecks.cmake
+++ CompilerChecks.cmake
@@ -63,10 +63,15 @@
         endif()
     endif()

-    check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
-    if (WITH_STACK_PROTECTOR)
-        list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
-    endif()
+    check_c_compiler_flag_ssp("-fstack-protector-strong" WITH_STACK_PROTECTOR_STRONG)
+    if (WITH_STACK_PROTECTOR_STRONG)
+        list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector-strong")
+    else (WITH_STACK_PROTECTOR_STRONG)
+        check_c_compiler_flag_ssp("-fstack-protector" WITH_STACK_PROTECTOR)
+        if (WITH_STACK_PROTECTOR)
+            list(APPEND SUPPORTED_COMPILER_FLAGS "-fstack-protector")
+        endif()
+    endif (WITH_STACK_PROTECTOR_STRONG)

     if (PICKY_DEVELOPER)
         add_c_compiler_flag("-Wno-error=deprecated-declarations" SUPPORTED_COMPILER_FLAGS)


COMP: deactivated ToFImageRecorderFilterTest

--- Modules/ToFHardware/Testing/files.cmake
+++ Modules/ToFHardware/Testing/files.cmake
@@ -20,7 +20,7 @@
   mitkToFImageCsvWriterTest.cpp
   mitkToFImageGrabberTest.cpp
   #mitkToFImageRecorderTest.cpp
-  mitkToFImageRecorderFilterTest.cpp
+  #mitkToFImageRecorderFilterTest.cpp
   mitkToFImageWriterTest.cpp
   mitkToFNrrdImageWriterTest.cpp
   mitkToFOpenCVImageGrabberTest.cpp


Only define CI variables if they're set on environment.

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -2,9 +2,15 @@

 # Gitlab CI support
-add_definitions(-DCI_PIPELINE_ID=$ENV{CI_PIPELINE_ID})
-add_definitions(-DCI_COMMIT_SHA=$ENV{CI_COMMIT_SHA})
-add_definitions(-DCI_COMMIT_REF_SLUG=$ENV{CI_COMMIT_REF_SLUG})
+if ($ENV{CI_PIPELINE_ID})
+	add_definitions(-DCI_PIPELINE_ID=$ENV{CI_PIPELINE_ID})
+endif()
+if ($ENV{CI_COMMIT_SHA})
+	add_definitions(-DCI_COMMIT_SHA=$ENV{CI_COMMIT_SHA})
+endif()
+if ($ENV{CI_COMMIT_REF_SLUG})
+	add_definitions(-DCI_COMMIT_REF_SLUG=$ENV{CI_COMMIT_REF_SLUG})
+endif()

 # C++14 support


Fix bug that prevented XCode to switch between Release and Debug build type.

--- cmake/PlatformMacOS.cmake
+++ cmake/PlatformMacOS.cmake
@@ -19,8 +19,11 @@
     # type (cf. http://www.cmake.org/pipermail/cmake/2006-December/012288.html)
     # Therefore, we re-define the CMAKE_CONFIGURATION_TYPES here according to the value
     # in CMAKE_BUILD_TYPES.
-    set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
-    message(STATUS ">> Re-defining variable CMAKE_CONFIGURATION_TYPES := ${CMAKE_CONFIGURATION_TYPES}")
+    if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
+	set(CMAKE_CONFIGURATION_TYPES "Release;Debug")
+    else ()
+        set(CMAKE_CONFIGURATION_TYPES "Debug;Release")
+    endif ()

 endif()


fix(cmake): Default module flags based on libs

--- cmake/build/options.cmake
+++ cmake/build/options.cmake
@@ -1,6 +1,41 @@
 #
 # Build options
 #
+
+# Default value for: ENABLE_ALSA {{{
+
+find_package(ALSA QUIET)
+if(NOT DEFINED ENABLE_ALSA AND NOT ALSA_FOUND)
+  set(ENABLE_ALSA OFF CACHE STRING "Module support for alsa-lib")
+endif()
+
+# }}}
+# Default value for: ENABLE_NETWORK {{{
+
+find_package(Libiw QUIET)
+if(NOT DEFINED ENABLE_NETWORK AND NOT LIBIW_FOUND)
+  set(ENABLE_NETWORK OFF CACHE STRING "Module support for wireless_tools")
+endif()
+
+# }}}
+# Default value for: ENABLE_MPD {{{
+
+find_package(LibMPDClient QUIET)
+if(NOT DEFINED ENABLE_MPD AND NOT LIBMPDCLIENT_FOUND)
+  set(ENABLE_MPD OFF CACHE STRING "Module support for libmpdclient")
+endif()
+
+# }}}
+# Default value for: ENABLE_I3 {{{
+
+find_program(I3_BINARY i3)
+if(NOT DEFINED ENABLE_I3 AND NOT I3_BINARY)
+  set(ENABLE_I3 OFF CACHE STRING "Module support for i3wm")
+endif()
+
+# }}}
+
+# Define build options {{{

 option(CXXLIB_CLANG       "Link against libc++"        OFF)
 option(CXXLIB_GCC         "Link against stdlibc++"     OFF)
@@ -18,6 +53,9 @@
 option(ENABLE_RANDR_EXT   "Enable RandR X extension"   ON)
 option(ENABLE_RENDER_EXT  "Enable Render X extension"  OFF)
 option(ENABLE_DAMAGE_EXT  "Enable Damage X extension"  OFF)
+
+# }}}
+# Set cache vars {{{

 set(SETTING_ALSA_SOUNDCARD "default"
   CACHE STRING "Name of the ALSA soundcard driver")
@@ -42,19 +80,4 @@
 set(SETTING_PATH_TEMPERATURE_INFO "/sys/class/thermal/thermal_zone%zone%/temp"
   CACHE STRING "Path to file containing the current temperature")

-find_package(ALSA QUIET)
-if(NOT ALSA_FOUND)
-  set(ENABLE_ALSA OFF)
-endif()
-find_package(Libiw QUIET)
-if(NOT LIBIW_FOUND)
-  set(ENABLE_NETWORK OFF)
-endif()
-find_package(LibMPDClient QUIET)
-if(NOT LIBMPDCLIENT_FOUND)
-  set(ENABLE_MPD OFF)
-endif()
-find_program(I3_BINARY i3)
-if(NOT I3_BINARY)
-  set(ENABLE_I3 OFF)
-endif()
+# }}}


Fix test-results directory

Fix test-results directory

Change-Id: I13aa43c0096dea85978b5afc064d4040502f1b0f
Reviewed-on: http://gerrit.aldebaran.lan:8080/15279
Tested-by: gerrit
Reviewed-by: jlanca <2850f9ac832158534655add240a0c79d492c91ed@aldebaran-robotics.com>
Tested-by: jlanca <2850f9ac832158534655add240a0c79d492c91ed@aldebaran-robotics.com>
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -13,7 +13,7 @@
 #

-set(_TESTS_RESULTS_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/test-results" CACHE INTERNAL "" FORCE)
+set(_TESTS_RESULTS_FOLDER "${CMAKE_BINARY_DIR}/test-results" CACHE INTERNAL "" FORCE)

 #! Create a new test that can be run by CTest or `qibuild test`


Fixing issue #1395: Undefined symbol: cudaGetDevice (#1396)

--- cmake/util/FindCUDA.cmake
+++ cmake/util/FindCUDA.cmake
@@ -28,11 +28,11 @@
     set(CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_ROOT_DIR}/include)
     set(CUDA_FOUND TRUE)
     if(MSVC)
-      find_library(CUDA_CUDAT_LIBRARY cudart
+      find_library(CUDA_CUDART_LIBRARY cudart
         ${CUDA_TOOLKIT_ROOT_DIR}/lib64
         ${CUDA_TOOLKIT_ROOT_DIR}/lib)
     else(MSVC)
-      find_library(CUDA_CUDAT_LIBRARY cudart
+      find_library(CUDA_CUDART_LIBRARY cudart
         ${CUDA_TOOLKIT_ROOT_DIR}/lib64
         ${CUDA_TOOLKIT_ROOT_DIR}/lib)
     endif(MSVC)


Fix patch for Boost install-path on OSX.

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -95,7 +95,7 @@

     IF (APPLE)
         EXTERNALPROJECT_ADD_STEP(boost patch-install-path
-            COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPSRC}/boost/tools/build/v2/tools/darwin.jam
+            COMMAND sed -i ".bak" "s|-install_name \"|&${TPDIST}/lib/|" ${TPBUILD}/boost/tools/build/v2/tools/darwin.jam
             DEPENDERS build
             DEPENDEES download)
     ENDIF (APPLE)


Set Boost V1.61.0 as default

Set Boost V1.61.0 as default

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -37,6 +37,7 @@
 hunter_config(Async++ VERSION 0.0.3-hunter)
 hunter_config(Avahi VERSION 0.6.31)
 hunter_config(BZip2 VERSION 1.0.6-p1)
+hunter_config(Boost VERSION 1.61.0)
 hunter_config(BoostCompute VERSION 0.5-p0)
 hunter_config(BoostProcess VERSION 0.5)
 hunter_config(CLAPACK VERSION 3.2.1)
@@ -142,14 +143,6 @@
 hunter_config(xshmfence VERSION 1.2)
 hunter_config(xtrans VERSION 1.2.7)

-if(MINGW)
-  # 1.60.0 broken:
-  # * https://ci.appveyor.com/project/ingenue/hunter/build/1.0.216/job/twgm1vpxgn6w6dds
-  hunter_config(Boost VERSION 1.58.0-p1)
-else()
-  hunter_config(Boost VERSION 1.60.0)
-endif()
-
 if(MINGW OR MSVC80)
   hunter_config(GTest VERSION 1.7.0-hunter-6)
 else()


Windows build fixes, hopefully last part.

r198153 fixed the msvs bot problem, but broke a msysgit bot. This change
hopefully makes both variants happy.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -44,8 +44,13 @@
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
-    set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                 LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/symbol.def")
+    if(CYGWIN)
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "${CMAKE_CURRENT_BINARY_DIR}/symbol.def")
+    else()
+      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                   LINK_FLAGS "/DEF:${CMAKE_CURRENT_BINARY_DIR}/symbol.def")
+    endif()
   endif()

   add_custom_target(${target_name}_exports DEPENDS ${native_export_file})


[cmake] Restrict resource file usage to Windows build hosts

Resource file compilation requires a working resource compiler.
Unfortunately, llvm-rc isn't quite there yet [1], and cmake's rc
invocation only works on Windows [2]. Until both those issues are
addressed, disable resource file usage on non-Windows build hosts, to
unblock Windows cross-compilation. This is also consistent with the
existing comment, which says "If *on Windows* and building with MSVC".

[1] http://lists.llvm.org/pipermail/llvm-dev/2017-October/118433.html
[2] https://public.kitware.com/pipermail/cmake/2017-October/066441.html

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -263,14 +263,14 @@
 #
 function(add_windows_version_resource_file OUT_VAR)
   set(sources ${ARGN})
-  if (MSVC)
+  if (MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
     set(resource_file ${LLVM_SOURCE_DIR}/resources/windows_version_resource.rc)
     if(EXISTS ${resource_file})
       set(sources ${sources} ${resource_file})
       source_group("Resource Files" ${resource_file})
       set(windows_resource_file ${resource_file} PARENT_SCOPE)
     endif()
-  endif(MSVC)
+  endif(MSVC AND CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")

   set(${OUT_VAR} ${sources} PARENT_SCOPE)
 endfunction(add_windows_version_resource_file)


[CMake] Fix set_output_directory to do nothing if *_OUTPUT_INTDIR was not given.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -150,6 +150,11 @@
 # Note: Don't set variables CMAKE_*_OUTPUT_DIRECTORY any more,
 # or a certain builder, for eaxample, msbuild.exe, would be confused.
 function(set_output_directory target bindir libdir)
+  # Do nothing if *_OUTPUT_INTDIR is empty.
+  if("${bindir}" STREQUAL "")
+    return()
+  endif()
+
   if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
     foreach(build_mode ${CMAKE_CONFIGURATION_TYPES})
       string(TOUPPER "${build_mode}" CONFIG_SUFFIX)


cmake fix for embree

cmake fix for embree

--- tutorial/cmake/FindEMBREE.cmake
+++ tutorial/cmake/FindEMBREE.cmake
@@ -44,5 +44,5 @@
    )
    SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR} ${EMBREE_INCLUDE_DIR}/embree)
 ELSE (EMBREE_FOUND)
-    message(FATAL_ERROR "could NOT find EMBREE")
+    message(STATUS "could NOT find EMBREE")
 ENDIF (EMBREE_FOUND)


BUG: Do not convert any tests if the input list is empty...

--- Utilities/vtkTclTest2Py/vtkConvertTclTestToPy.cmake
+++ Utilities/vtkTclTest2Py/vtkConvertTclTestToPy.cmake
@@ -1,72 +1,74 @@
 # Macro to convert tcl tests to python and add those tests.
 # Assumes VTK_WRAP_PYTHON is on and PYTHON_EXECUTABLE is defined.
-MACRO (CONVERT_TCL_TEST_TO_PY tcl_tests kit_name)
-  SET (input_dir ${VTK_SOURCE_DIR}/${kit_name}/Testing/Tcl)
-  SET (output_dir ${VTK_BINARY_DIR}/${kit_name}/Testing/Python)
-  SET (target_name ${kit_name}PythonTests)
+MACRO (CONVERT_TCL_TEST_TO_PY tcl_tests kit_name)
+  IF(NOT "${${tcl_tests}}" STREQUAL "")
+    SET (input_dir ${VTK_SOURCE_DIR}/${kit_name}/Testing/Tcl)
+    SET (output_dir ${VTK_BINARY_DIR}/${kit_name}/Testing/Python)
+    SET (target_name ${kit_name}PythonTests)

-  SET(CMD ${PYTHON_EXECUTABLE})
-  SET (CONVERTED_TESTS)
-  SET (CONVERTER_SCRIPT "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/vtkTclToPyConvertor.py")
-  SET (TESTS_TO_CONVERT)
-  SET (CONVERSIONLIST)
+    SET(CMD ${PYTHON_EXECUTABLE})
+    SET (CONVERTED_TESTS)
+    SET (CONVERTER_SCRIPT "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/vtkTclToPyConvertor.py")
+    SET (TESTS_TO_CONVERT)
+    SET (CONVERSIONLIST)

-  FOREACH(test ${${tcl_tests}})
-    SET(input "${input_dir}/${test}.tcl")
-    SET(output "${output_dir}/${test}.py")
+    FOREACH(test ${${tcl_tests}})
+      SET(input "${input_dir}/${test}.tcl")
+      SET(output "${output_dir}/${test}.py")

-    SET (CONVERTED_TESTS ${CONVERTED_TESTS} "${output}")
-    SET (CONVERSIONLIST ${CONVERSIONLIST} "${input};${output}")
-    SET (TESTS_TO_CONVERT ${TESTS_TO_CONVERT} "${input}")
+      SET (CONVERTED_TESTS ${CONVERTED_TESTS} "${output}")
+      SET (CONVERSIONLIST ${CONVERSIONLIST} "${input};${output}")
+      SET (TESTS_TO_CONVERT ${TESTS_TO_CONVERT} "${input}")

-    #Add the py test.
-    IF (${VTK_DATA_ROOT})
-      ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
-        ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
-        ${output}
-        -D ${VTK_DATA_ROOT}
-        -T ${VTK_BINARY_DIR}/Testing/Temporary
-        -V Baseline/${kit_name}/${test}.png
-        -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
-        -A "${VTK_LIBRARY_DIR}"
-        )
-    ELSE (${VTK_DATA_ROOT})
-      ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
-        ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
-        ${output}
-        -T ${VTK_BINARY_DIR}/Testing/Temporary
-        -V Baseline/${kit_name}/${test}.png
-        -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
-        -A "${VTK_LIBRARY_DIR}"
-        )
-    ENDIF (${VTK_DATA_ROOT})
-  ENDFOREACH(test)
+      #Add the py test.
+      IF (${VTK_DATA_ROOT})
+        ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
+          ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
+          ${output}
+          -D ${VTK_DATA_ROOT}
+          -T ${VTK_BINARY_DIR}/Testing/Temporary
+          -V Baseline/${kit_name}/${test}.png
+          -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+          -A "${VTK_LIBRARY_DIR}"
+          )
+      ELSE (${VTK_DATA_ROOT})
+        ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
+          ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
+          ${output}
+          -T ${VTK_BINARY_DIR}/Testing/Temporary
+          -V Baseline/${kit_name}/${test}.png
+          -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+          -A "${VTK_LIBRARY_DIR}"
+          )
+      ENDIF (${VTK_DATA_ROOT})
+    ENDFOREACH(test)

-  CONFIGURE_FILE(
-    ${VTK_SOURCE_DIR}/Utilities/vtkTclTest2Py/vtkTestsToConvert.in
-    ${output_dir}/vtkTestsToConvert
-    @ONLY
-    )
+    CONFIGURE_FILE(
+      ${VTK_SOURCE_DIR}/Utilities/vtkTclTest2Py/vtkTestsToConvert.in
+      ${output_dir}/vtkTestsToConvert
+      @ONLY
+      )

-  ADD_CUSTOM_COMMAND(
-    OUTPUT "${output_dir}/conversion_complete"
-    COMMAND ${CMD}
-    ARGS ${CONVERTER_SCRIPT}
-    -l "${output_dir}/vtkTestsToConvert"
-    -t "${output_dir}/conversion_complete"
-    -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
-    -A "${VTK_BINARY_DIR}/Wrapping/Python"
-    -A "${VTK_LIBRARY_DIR}"
-    DEPENDS ${TESTS_TO_CONVERT}
-    ${output_dir}/vtkTestsToConvert
-    ${CONVERTER_SCRIPT}
-    COMMENT "Converting Tcl test"
-    )
-  ADD_CUSTOM_TARGET(${target_name} ALL DEPENDS
-    "${output_dir}/conversion_complete")
+    ADD_CUSTOM_COMMAND(
+      OUTPUT "${output_dir}/conversion_complete"
+      COMMAND ${CMD}
+      ARGS ${CONVERTER_SCRIPT}
+      -l "${output_dir}/vtkTestsToConvert"
+      -t "${output_dir}/conversion_complete"
+      -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+      -A "${VTK_BINARY_DIR}/Wrapping/Python"
+      -A "${VTK_LIBRARY_DIR}"
+      DEPENDS ${TESTS_TO_CONVERT}
+      ${output_dir}/vtkTestsToConvert
+      ${CONVERTER_SCRIPT}
+      COMMENT "Converting Tcl test"
+      )
+    ADD_CUSTOM_TARGET(${target_name} ALL DEPENDS
+      "${output_dir}/conversion_complete")

-  ADD_DEPENDENCIES(${target_name} vtktcltest2py_pyc)
+    ADD_DEPENDENCIES(${target_name} vtktcltest2py_pyc)

-  # TODO: add explicit dependency between the vtk{Name}Kit.cmake files and the
-  # the test conversion.
+    # TODO: add explicit dependency between the vtk{Name}Kit.cmake files and the
+    # the test conversion.
+  ENDIF(NOT "${${tcl_tests}}" STREQUAL "")
 ENDMACRO (CONVERT_TCL_TEST_TO_PY)


Fixed a tiny bug in FindosgViewer

Fixed a tiny bug in FindosgViewer

--- CMakeModules/FindosgViewer.cmake
+++ CMakeModules/FindosgViewer.cmake
@@ -64,7 +64,7 @@
   /opt
 )

-FIND_LIBRARY(OSGVIEWER_DEBUG_LIBRARY
+FIND_LIBRARY(OSGVIEWER_LIBRARY_DEBUG
   NAMES osgViewerd
   HINTS
   $ENV{OSGVIEWER_DIR}


FindPythonLibs Py3k fixes from cmake master.

Since Python 3.2, the python libraries and include directories can
have the suffixes m (pymalloc), u (wide unicode), and d (debug).
The first two (m and u) are now included in the default search path.
If someone wants the debug library on Linux/OS X, they must select
it explicitly.

Everything in this change came from the master branch of make.

--- CMake/FindPythonLibs.cmake
+++ CMake/FindPythonLibs.cmake
@@ -29,9 +29,37 @@
 # (To distribute this file outside of CMake, substitute the full
 #  License text for the above reference.)

-INCLUDE(CMakeFindFrameworks)
+# Use the executable's path as a hint
+set(_Python_LIBRARY_PATH_HINT)
+if(PYTHON_EXECUTABLE)
+  if(WIN32)
+    get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
+    if(_Python_PREFIX)
+      set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/libs)
+    endif()
+    unset(_Python_PREFIX)
+  else()
+    get_filename_component(_Python_PREFIX ${PYTHON_EXECUTABLE} PATH)
+    get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
+    if(_Python_PREFIX)
+      set(_Python_LIBRARY_PATH_HINT ${_Python_PREFIX}/lib)
+    endif()
+    unset(_Python_PREFIX)
+  endif()
+endif()
+
+include(CMakeFindFrameworks)
 # Search for the python framework on Apple.
 CMAKE_FIND_FRAMEWORKS(Python)
+
+# Save CMAKE_FIND_FRAMEWORK
+if(DEFINED CMAKE_FIND_FRAMEWORK)
+  set(_PythonLibs_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
+else()
+  unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
+endif()
+# To avoid picking up the system Python.h pre-maturely.
+set(CMAKE_FIND_FRAMEWORK LAST)

 set(_PythonInterp_VERSION)
 if(PYTHONINTERP_FOUND)
@@ -44,32 +72,45 @@
   ${Python_ADDITIONAL_VERSIONS} ${_PythonInterp_VERSION}
   2.7 2.6 2.5 3.6 3.5 3.4 3.3 3.2)

-FOREACH(_CURRENT_VERSION ${_Python_VERSIONS})
-  STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
-
-  set(_FRAMEWORK_LIB_DIRS)
-  foreach(dir ${Python_FRAMEWORKS})
-    list(APPEND _FRAMEWORK_LIB_DIRS ${dir}/Versions/${_CURRENT_VERSION}/lib)
-  endforeach()
-
-  IF(WIN32)
-    FIND_LIBRARY(PYTHON_DEBUG_LIBRARY
+foreach(_CURRENT_VERSION ${_Python_VERSIONS})
+  string(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
+  if(WIN32)
+    find_library(PYTHON_DEBUG_LIBRARY
       NAMES python${_CURRENT_VERSION_NO_DOTS}_d python
+      HINTS ${_Python_LIBRARY_PATH_HINT}
       PATHS
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs )
-  ENDIF()
-
-  FIND_LIBRARY(PYTHON_LIBRARY
-    NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
+      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
+      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+      )
+  endif()
+
+  set(PYTHON_FRAMEWORK_LIBRARIES)
+  if(Python_FRAMEWORKS AND NOT PYTHON_LIBRARY)
+    foreach(dir ${Python_FRAMEWORKS})
+      list(APPEND PYTHON_FRAMEWORK_LIBRARIES
+           ${dir}/Versions/${_CURRENT_VERSION}/lib)
+    endforeach()
+  endif()
+  find_library(PYTHON_LIBRARY
+    NAMES
+      python${_CURRENT_VERSION_NO_DOTS}
+      python${_CURRENT_VERSION}mu
+      python${_CURRENT_VERSION}m
+      python${_CURRENT_VERSION}u
+      python${_CURRENT_VERSION}
+    HINTS
+      ${_Python_LIBRARY_PATH_HINT}
     PATHS
-      ${_FRAMEWORK_LIB_DIRS}
+      ${PYTHON_FRAMEWORK_LIBRARIES}
       [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
+      [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
     # Avoid finding the .dll in the PATH.  We want the .lib.
     NO_SYSTEM_ENVIRONMENT_PATH
   )
   # Look for the static library in the Python config directory
-  FIND_LIBRARY(PYTHON_LIBRARY
+  find_library(PYTHON_LIBRARY
     NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION}
     # Avoid finding the .dll in the PATH.  We want the .lib.
     NO_SYSTEM_ENVIRONMENT_PATH
@@ -77,41 +118,55 @@
     PATH_SUFFIXES python${_CURRENT_VERSION}/config
   )

-  # Only look for include directory if library was found, this ensures
-  # that version will be matched between include dir and library
-  IF(PYTHON_LIBRARY)
-    SET(PYTHON_FRAMEWORK_INCLUDES)
-    IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
-      FOREACH(dir ${Python_FRAMEWORKS})
-        LIST(APPEND PYTHON_FRAMEWORK_INCLUDES
-          ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}
-          ${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}m)
-      ENDFOREACH()
-    ENDIF()
-
-    # Search frameworks and registry locations first
-    FIND_PATH(PYTHON_INCLUDE_DIR
+  # Don't search for include dir until library location is known
+  if(PYTHON_LIBRARY)
+
+    # Use the library's install prefix as a hint
+    set(_Python_INCLUDE_PATH_HINT)
+    get_filename_component(_Python_PREFIX ${PYTHON_LIBRARY} PATH)
+    get_filename_component(_Python_PREFIX ${_Python_PREFIX} PATH)
+    if(_Python_PREFIX)
+      set(_Python_INCLUDE_PATH_HINT ${_Python_PREFIX}/include)
+    endif()
+    unset(_Python_PREFIX)
+
+    # Add framework directories to the search paths
+    set(PYTHON_FRAMEWORK_INCLUDES)
+    if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
+      foreach(dir ${Python_FRAMEWORKS})
+        list(APPEND PYTHON_FRAMEWORK_INCLUDES
+          ${dir}/Versions/${_CURRENT_VERSION}/include)
+      endforeach()
+    endif()
+
+    find_path(PYTHON_INCLUDE_DIR
       NAMES Python.h
+      HINTS
+        ${_Python_INCLUDE_PATH_HINT}
       PATHS
         ${PYTHON_FRAMEWORK_INCLUDES}
         [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
-      NO_DEFAULT_PATH
-    )
-
-    # Broaden to default paths as a second step (mainly for UNIX)
-    FIND_PATH(PYTHON_INCLUDE_DIR
-      NAMES Python.h
+        [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include
       PATH_SUFFIXES
+        python${_CURRENT_VERSION}mu
+        python${_CURRENT_VERSION}m
+        python${_CURRENT_VERSION}u
         python${_CURRENT_VERSION}
     )
-  ENDIF()
-
-  # For backward compatibility, set PYTHON_INCLUDE_PATH
-  SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
-
-ENDFOREACH()
-
-MARK_AS_ADVANCED(
+  endif()
+
+  # For backward compatibility, set PYTHON_INCLUDE_PATH.
+  set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
+
+  if(PYTHON_LIBRARY AND PYTHON_INCLUDE_DIR)
+    break()
+  endif()
+endforeach()
+
+unset(_Python_INCLUDE_PATH_HINT)
+unset(_Python_LIBRARY_PATH_HINT)
+
+mark_as_advanced(
   PYTHON_DEBUG_LIBRARY
   PYTHON_LIBRARY
   PYTHON_INCLUDE_DIR
@@ -146,5 +201,13 @@
 SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")

-INCLUDE(FindPackageHandleStandardArgs)
+# Restore CMAKE_FIND_FRAMEWORK
+if(DEFINED _PythonLibs_CMAKE_FIND_FRAMEWORK)
+  set(CMAKE_FIND_FRAMEWORK ${_PythonLibs_CMAKE_FIND_FRAMEWORK})
+  unset(_PythonLibs_CMAKE_FIND_FRAMEWORK)
+else()
+  unset(CMAKE_FIND_FRAMEWORK)
+endif()
+
+include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)


deleted FindMKL

deleted FindMKL

--- CMakeModules/FindMKL.cmake
+++ CMakeModules/FindMKL.cmake
@@ -1,280 +0,0 @@
-# Copyright (c) 2018, ArrayFire
-# All rights reserved.
-#
-# This file is distributed under 3-clause BSD license. The complete license
-# agreement can be obtained at: http://arrayfire.com/licenses/BSD-3-Clause
-#
-# A FindMKL script based on the recommendations by the Intel's Link Line
-# Advisor. It currently only tested on the 2018 version of MKL on Windows,
-# Linux, and OSX but it should work on older versions.
-#
-# To use this module call the mklvars.(sh,bat) script before you call cmake. This
-# script is located in the bin folder of your mkl installation. This will set the
-# MKLROOT environment variable which will be used to find the libraries on your system.
-#
-# Example:
-# set(MKL_THREAD_LAYER "TBB")
-# find_package(MKL)
-#
-# add_executable(myapp main.cpp)
-# target_link_libraries(myapp PRIVATE MKL::MKL)
-#
-# This module bases its behavior based on the following variables:
-#
-# ``MKL_THREAD_LAYER``
-#   The threading layer that needs to be used by the MKL library. This
-#   Defines which library will be used to parallelize the MKL kernels. Possible
-#   options are TBB(Default), GNU OpenMP, Intel OpenMP, Sequential
-#
-# This module provides the following :prop_tgt:'IMPORTED' targets:
-#
-# ``MKL::MKL``
-#   Target used to define and link all MKL libraries required by Intel's Link
-#   Line Advisor. This usually the only thing you need to link against unless
-#   you want to link against the single dynamic library version of MKL
-#   (libmkl_rt.so)
-#
-#  Optional:
-#
-# ``MKL::ThreadLayer{_STATIC}``
-#   Target used to define the threading layer(TBB, OpenMP, etc.) based on
-#   MKL_THREAD_LAYER variable.
-#
-# ``MKL::ThreadingLibrary``
-#   Target used to define the threading library(libtbb, libomp, etc) that the
-#   application will need to link against.
-#
-# ``MKL::Interface``
-#   Target used to determine which interface library to use(32bit int or 64bit
-#   int).
-#
-# ``MKL::Core``
-#   Target for the dynamic library dispatcher
-#
-# ``MKL::RT``
-#   Target for the single dynamic library
-#
-# ``MKL::{mkl_def;mkl_mc;mkl_mc3;mkl_avx;mkl_avx2;mkl_avx512}{_STATIC}``
-#   Targets for MKL kernel libraries.
-
-include(CheckTypeSize)
-
-check_type_size("int" INT_SIZE
-  BUILTIN_TYPES_ONLY LANGUAGE C)
-
-set(MKL_THREAD_LAYER "TBB" CACHE STRING "The thread layer to choose for MKL")
-set_property(CACHE MKL_THREAD_LAYER PROPERTY STRINGS "TBB" "GNU OpenMP" "Intel OpenMP" "Sequential")
-
-if(NOT MKL_THREAD_LAYER STREQUAL MKL_THREAD_LAYER_LAST)
-  unset(MKL::ThreadLayer CACHE)
-  unset(MKL::ThreadingLibrary CACHE)
-  unset(MKL_ThreadLayer_LINK_LIBRARY CACHE)
-  unset(MKL_ThreadLayer_STATIC_LINK_LIBRARY CACHE)
-  unset(MKL_ThreadLayer_DLL_LIBRARY CACHE)
-  unset(MKL_ThreadingLibrary_LINK_LIBRARY CACHE)
-  unset(MKL_ThreadingLibrary_STATIC_LINK_LIBRARY CACHE)
-  unset(MKL_ThreadingLibrary_DLL_LIBRARY CACHE)
-  set(MKL_THREAD_LAYER_LAST ${MKL_THREAD_LAYER} CACHE INTERNAL "" FORCE)
-endif()
-
-find_path(MKL_INCLUDE_DIR
-  NAMES
-    mkl.h
-    mkl_blas.h
-    mkl_cblas.h
-  PATHS
-    /opt/intel
-    /opt/intel/mkl
-    $ENV{MKLROOT}
-    /opt/intel/compilers_and_libraries/linux/mkl
-  PATH_SUFFIXES
-    include
-    IntelSWTools/compilers_and_libraries/windows/mkl/include
-    )
-mark_as_advanced(MKL_INCLUDE_DIR)
-
-find_path(MKL_FFTW_INCLUDE_DIR
-  NAMES
-    fftw3_mkl.h
-  HINTS
-    ${MKL_INCLUDE_DIR}/fftw)
-mark_as_advanced(MKL_FFTW_INCLUDE_DIR)
-
-
-if(WIN32)
-  if(${MSVC_VERSION} GREATER_EQUAL 1900)
-    set(msvc_dir "vc_mt")
-    set(shared_suffix "_dll")
-    set(md_suffix "md")
-  else()
-    message(WARNING "MKL: MS Version not supported for MKL")
-  endif()
-endif()
-
-# Finds and creates libraries for MKL with the MKL:: prefix
-#
-# Parameters:
-#    NAME:         A variable name describing the library
-#    LIBRARY_NAME: The library that needs to be searched
-#
-# Output Libraries:
-#    MKL::${NAME}
-#    MKL::${NAME}_STATIC
-#
-# Output Variables
-#    MKL_INCLUDE_DIR:                Include directory for MKL
-#    MKL_FFTW_INCLUDE_DIR:           Include directory for the MKL FFTW interface
-#    MKL_${NAME}_LINK_LIBRARY:        on Unix: *.so on Windows *.lib
-#    MKL_${NAME}_STATIC_LINK_LIBRARY: on Unix: *.a  on Windows *.lib
-#    MKL_${NAME}_DLL_LIBRARY:         on Unix: ""   on Windows *.dll
-function(find_mkl_library)
-  set(options "")
-  set(single_args NAME LIBRARY_NAME)
-  set(multi_args "")
-
-  cmake_parse_arguments(mkl_args "${options}" "${single_args}" "${multi_args}" ${ARGN})
-
-  add_library(MKL::${mkl_args_NAME}        SHARED IMPORTED)
-  add_library(MKL::${mkl_args_NAME}_STATIC SHARED IMPORTED)
-  find_library(MKL_${mkl_args_NAME}_LINK_LIBRARY
-    NAMES
-      ${mkl_args_LIBRARY_NAME}${shared_suffix}
-      ${mkl_args_LIBRARY_NAME}${md_suffix}
-      lib${mkl_args_LIBRARY_NAME}${md_suffix}
-      ${mkl_args_LIBRARY_NAME}
-    PATHS
-      /opt/intel/mkl/lib
-      /opt/intel/tbb/lib
-      /opt/intel/lib
-      $ENV{MKLROOT}/lib
-      /opt/intel/compilers_and_libraries/linux/mkl/lib
-    PATH_SUFFIXES
-      IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64
-      IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64
-      IntelSWTools/compilers_and_libraries/windows/tbb/lib/intel64/${msvc_dir}
-      ""
-      intel64
-      intel64/gcc4.7)
-  mark_as_advanced(MKL_${mkl_args_NAME}_LINK_LIBRARY)
-
-  #message(STATUS "NAME: ${mkl_args_NAME} LIBNAME: ${mkl_args_LIBRARY_NAME} MKL_${mkl_args_NAME}_LINK_LIBRARY  ${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
-
-  # The rt library does not have a static library
-  if(NOT ${mkl_args_NAME} STREQUAL "rt")
-    find_library(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY
-      NAMES
-        ${CMAKE_STATIC_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
-      PATHS
-        /opt/intel/mkl/lib
-        /opt/intel/tbb/lib
-        /opt/intel/lib
-        $ENV{MKLROOT}/lib
-        /opt/intel/compilers_and_libraries/linux/mkl/lib
-      PATH_SUFFIXES
-        ""
-        intel64
-        intel64/gcc4.7
-        IntelSWTools/compilers_and_libraries/windows/mkl/lib/intel64
-        IntelSWTools/compilers_and_libraries/windows/compiler/lib/intel64
-        IntelSWTools/compilers_and_libraries/windows/tbb/lib/intel64/${msvc_dir}
-        )
-      mark_as_advanced(MKL_${mkl_args_NAME}_STATIC_LINK_LIBRARY)
-    endif()
-
-    set_target_properties(MKL::${mkl_args_NAME}
-      PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR}"
-        IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_LINK_LIBRARY}"
-        IMPORTED_NO_SONAME TRUE)
-    if(WIN32)
-      find_file(MKL_${mkl_args_NAME}_DLL_LIBRARY
-        NAMES
-          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
-          ${CMAKE_SHARED_LIBRARY_PREFIX}${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
-          lib${mkl_args_LIBRARY_NAME}${md_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}
-        PATH_SUFFIXES
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/mkl
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/compiler
-          IntelSWTools/compilers_and_libraries/windows/redist/intel64/tbb/${msvc_dir}
-        NO_SYSTEM_ENVIRONMENT_PATH)
-
-      set_target_properties(MKL::${mkl_args_NAME}
-        PROPERTIES
-          IMPORTED_LOCATION "${MKL_${mkl_args_NAME}_DLL_LIBRARY}"
-          IMPORTED_IMPLIB "${MKL_${mkl_args_NAME}_LINK_LIBRARY}")
-
-      mark_as_advanced(MKL_${mkl_args_NAME}_DLL_LIBRARY)
-    endif()
-endfunction()
-
-
-find_mkl_library(NAME Core LIBRARY_NAME mkl_core)
-find_mkl_library(NAME RT LIBRARY_NAME mkl_rt)
-
-# MKL can link against Intel OpenMP, GNU OpenMP, TBB, and Sequential
-if(MKL_THREAD_LAYER STREQUAL "Intel OpenMP")
-  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_intel_thread)
-  find_mkl_library(NAME ThreadingLibrary LIBRARY_NAME iomp5)
-elseif(MKL_THREAD_LAYER STREQUAL "GNU OpenMP")
-  find_package(OpenMP REQUIRED)
-  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_gnu_thread)
-  add_library(MKL::ThreadingLibrary SHARED IMPORTED)
-  set_target_properties(MKL::ThreadingLibrary
-    PROPERTIES
-      IMPORTED_LOCATION "${OpenMP_gomp_LIBRARY}"
-      INTERFACE_LINK_LIBRARIES OpenMP::OpenMP_CXX)
-elseif(MKL_THREAD_LAYER STREQUAL "TBB")
-  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_tbb_thread)
-  find_mkl_library(NAME ThreadingLibrary LIBRARY_NAME tbb)
-elseif(MKL_THREAD_LAYER STREQUAL "Sequential")
-  find_mkl_library(NAME ThreadLayer LIBRARY_NAME mkl_sequential)
-endif()
-
-if("${INT_SIZE}" EQUAL 4)
-  find_mkl_library(NAME Interface LIBRARY_NAME mkl_intel_lp64)
-else()
-  find_mkl_library(NAME Interface LIBRARY_NAME mkl_intel_ilp64)
-endif()
-
-set(MKL_RUNTIME_KERNEL_LIBRARIES "" CACHE FILEPATH "MKL kernel libraries targeting different CPU architectures")
-set(MKL_KernelLibraries "mkl_def;mkl_mc;mkl_mc3;mkl_avx;mkl_avx2;mkl_avx512")
-
-foreach(lib ${MKL_KernelLibraries})
-  find_mkl_library(NAME ${lib} LIBRARY_NAME ${lib})
-  if(MKL_${lib}_LINK_LIBRARY OR MKL_${lib}_DLL_LIBRARY)
-    list(APPEND MKL_RUNTIME_KERNEL_LIBRARIES $<TARGET_FILE:MKL::${lib}>)
-  endif()
-endforeach()
-mark_as_advanced(MKL_RUNTIME_KERNEL_LIBRARIES)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MKL
-  REQUIRED_VARS MKL_INCLUDE_DIR MKL_Core_LINK_LIBRARY)
-if(NOT WIN32)
-  find_library(M_LIB m)
-  mark_as_advanced(M_LIB)
-endif()
-if(MKL_FOUND)
-  add_library(MKL::MKL SHARED IMPORTED)
-  if(MKL_THREAD_LAYER STREQUAL "Sequential")
-    set_target_properties(MKL::MKL
-      PROPERTIES
-        IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
-        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;${CMAKE_DL_LIBS};${M_LIB}"
-        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
-        IMPORTED_NO_SONAME TRUE)
-  else()
-    set_target_properties(MKL::MKL
-      PROPERTIES
-        IMPORTED_LOCATION "${MKL_Core_LINK_LIBRARY}"
-        INTERFACE_LINK_LIBRARIES "MKL::Interface;MKL::ThreadLayer;MKL::ThreadingLibrary;${CMAKE_DL_LIBS};${M_LIB}"
-        INTERFACE_INCLUDE_DIRECTORIES "${MKL_INCLUDE_DIR};${MKL_FFTW_INCLUDE_DIR}"
-        IMPORTED_NO_SONAME TRUE)
-  endif()
-  if(WIN32)
-    set_target_properties(MKL::MKL
-      PROPERTIES
-        IMPORTED_LOCATION "${MKL_Core_DLL_LIBRARY}"
-        IMPORTED_IMPLIB "${MKL_Core_LINK_LIBRARY}")
-  endif()
-endif()


Renaming product

Renaming product

--- client/Android/aFreeRDP/AndroidManifest.xml.cmake
+++ client/Android/aFreeRDP/AndroidManifest.xml.cmake
@@ -101,7 +101,7 @@

         <provider
             android:name="com.freerdp.freerdpcore.services.FreeRDPSuggestionProvider"
-            android:authorities="com.freerdp.afreerdp.services.freerdpsuggestionprovider" >
+            android:authorities="com.cameyo.player.services.freerdpsuggestionprovider" >
         </provider>
     </application>


Missing quotes were leading cmake to believe that a source directory was passed

--- utilities/ITKCudaCommon/CMake/itkCUDA.cmake
+++ utilities/ITKCudaCommon/CMake/itkCUDA.cmake
@@ -32,9 +32,8 @@
       DEPENDS ${PTX_FILES}
       COMMAND ${CMAKE_COMMAND} ARGS
         -D "_BUILD_CUDA_KERNEL=TRUE"
-        -D "PTXKernels:STRING=${PTX_FILES}"
-        #-P "${CMAKE_SOURCE_DIR}/Modules/External/ITKCudaCommon/CMake/itkCUDA.cmake" # call to itself!
-	    -P "${ITKCudaCommon_SOURCE_DIR}/CMake/itkCUDA.cmake" # call to itself!
+        -D "PTXKernels:STRING=\"${PTX_FILES}\""
+	-P "${ITKCudaCommon_SOURCE_DIR}/CMake/itkCUDA.cmake" # call to itself!
       WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
       COMMENT "Building CUDA PTX wrappers"
     )


Fixed OgreInstallDependencies.cmake to copy the GLES DLL only if the GLES render system is selected.

--- Dependencies/OgreInstallDependencies.cmake
+++ Dependencies/OgreInstallDependencies.cmake
@@ -65,21 +65,45 @@
     ${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
 	  DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
   )
+
+  # install GLES dlls
+  if (OGRE_BUILD_RENDERSYSTEM_GLES)
+	  install(FILES
+		${OGRE_DEP_BIN_DIR}/debug/libgles_cm.dll
+		  DESTINATION bin/debug CONFIGURATIONS Debug
+	  )
+	  install(FILES
+		${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
+		  DESTINATION bin/release CONFIGURATIONS Release None ""
+	  )
+	  install(FILES
+		${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
+		  DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
+	  )
+	  install(FILES
+		${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll
+		  DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
+	  )
+  endif ()
 endif ()

 # copy the required DLLs to the build directory (configure_file is the only copy-like op I found in CMake)
 configure_file(${OGRE_DEP_BIN_DIR}/debug/cg.dll ${OGRE_BINARY_DIR}/bin/debug/cg.dll COPYONLY)
 configure_file(${OGRE_DEP_BIN_DIR}/debug/OIS_d.dll ${OGRE_BINARY_DIR}/bin/debug/OIS_d.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/debug/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/debug/libgles_cm.dll COPYONLY)

 configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/release/cg.dll COPYONLY)
 configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/release/OIS.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/release/libgles_cm.dll COPYONLY)

 configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/cg.dll COPYONLY)
 configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/OIS.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/libgles_cm.dll COPYONLY)

 configure_file(${OGRE_DEP_BIN_DIR}/release/cg.dll ${OGRE_BINARY_DIR}/bin/minsizerel/cg.dll COPYONLY)
 configure_file(${OGRE_DEP_BIN_DIR}/release/OIS.dll ${OGRE_BINARY_DIR}/bin/minsizerel/OIS.dll COPYONLY)
-configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/minsizerel/libgles_cm.dll COPYONLY)
+
+if (OGRE_BUILD_RENDERSYSTEM_GLES)
+	configure_file(${OGRE_DEP_BIN_DIR}/debug/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/debug/libgles_cm.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/release/libgles_cm.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/relwithdebinfo/libgles_cm.dll COPYONLY)
+	configure_file(${OGRE_DEP_BIN_DIR}/release/libgles_cm.dll ${OGRE_BINARY_DIR}/bin/minsizerel/libgles_cm.dll COPYONLY)
+endif ()
+


SVN_SILENT made messages (.desktop file)

--- src/vlc.desktop.cmake
+++ src/vlc.desktop.cmake
@@ -18,6 +18,7 @@
 Name[es]=VLC
 Name[fi]=VLC
 Name[fr]=VLC
+Name[gl]=VLC
 Name[id]=VLC
 Name[nb]=VLC
 Name[nl]=VLC
@@ -40,6 +41,7 @@
 Comment[es]=Motor VLC para Phonon
 Comment[fi]=Phonon VLC -taustajärjestelmä
 Comment[fr]=Module VLC pour Phonon
+Comment[gl]=Infraestrutura de VLC para Phonon
 Comment[id]=Backend phonon VLC
 Comment[nb]=Phonon VLC-motor
 Comment[nl]=VLC-backend van Phonon


Add some warning flags

Add some warning flags

--- CMake/cpp.cmake
+++ CMake/cpp.cmake
@@ -169,7 +169,11 @@
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 7.0)
       message("-- Add warning flags implemented in gcc 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" C_WARNING_FLAGS "${C_WARNING_FLAGS}")
-      set(C_WARNING_FLAGS "${C_WARNING_FLAGS} -Wduplicated-branches")
+      foreach(WARNING_FLAG
+          -Wduplicated-branches
+          -Wshadow-local)
+        set(C_WARNING_FLAGS "${C_WARNING_FLAGS} ${WARNING_FLAG}")
+      endforeach(WARNING_FLAG)
     endif()
     if(CMAKE_C_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_C_COMPILER_VERSION VERSION_EQUAL 8.0)
       message("-- Add warning flags implemented in gcc 8.0")
@@ -202,6 +206,7 @@
     set(CXX_WARNING_FLAGS "${GNU_COMMON_WARNING_FLAGS}")
     foreach(WARNING_FLAG
         -Weffc++
+        -Wctor-dtor-privacy
         -Wnon-virtual-dtor
         -Wold-style-cast
         -Woverloaded-virtual
@@ -211,6 +216,10 @@
       set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
     endforeach(WARNING_FLAG)

+    if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.3 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.3)
+      message("-- Add warning flags implemented in g++ 4.3")
+      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wc++0x-compat")
+    endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.6 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.6)
       message("-- Add warning flags implemented in g++ 4.6")
       foreach(WARNING_FLAG
@@ -225,8 +234,8 @@
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.7 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 4.7)
       message("-- Add warning flags implemented in g++ 4.7")
-      foreach(WARNING_FLAG
-          -Wc++11-compat
+      string(REGEX REPLACE "-Wc\\+\\+0x-compat" "-Wc++11-compat" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
+      foreach(WARNING_FLAG
           -Wdelete-non-virtual-dtor
           -Wvector-operation-performance
           -Wno-return-local-addr
@@ -264,7 +273,12 @@
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.0)
       message("-- Add warning flags implemented in g++ 7.0")
       string(REGEX REPLACE "-Wabi" "-Wabi=11" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wduplicated-branches")
+      foreach(WARNING_FLAG
+          -Wc++17-compat
+          -Wduplicated-branches
+          -Wshadow-local)
+        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
+      endforeach(WARNING_FLAG)
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 8.0)
       message("-- Add warning flags implemented in g++ 8.0")
@@ -275,6 +289,7 @@
     foreach(WARNING_FLAG
         -Wc++11-compat
         -Weffc++
+        -Wctor-dtor-privacy
         -Wdelete-non-virtual-dtor
         -Wnon-virtual-dtor
         -Wold-style-cast
@@ -289,10 +304,15 @@
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.8 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 3.8)
       message("-- Add warning flags implemented in clang++ 3.8")
-      set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wdouble-promotion")
+      foreach(WARNING_FLAG
+          -Wc++1z-compat
+          -Wdouble-promotion)
+        set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} ${WARNING_FLAG}")
+      endforeach(WARNING_FLAG)
     endif()
     if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0 OR CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 5.0)
       message("-- Add warning flags implemented in clang++ 5.0")
+      string(REGEX REPLACE "-Wc\\+\\+1z-compat" "-Wc++17-compat" CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS}")
       set(CXX_WARNING_FLAGS "${CXX_WARNING_FLAGS} -Wzero-as-null-pointer-constant")
     endif()
   endif()
@@ -332,12 +352,14 @@
 string(REGEX REPLACE "^ +" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

+option(ENABLE_TESTING "Enable testing with Google Test." OFF)
 if(ENABLE_TESTING)
   enable_testing()
   include(cmake/gtest.cmake)
   add_subdirectory(test)
 endif()

+option(ENABLE_DOXYGEN "Enable to generate document with Doxygen." OFF)
 if(ENABLE_DOXYGEN)
   include(Doxygen/doxygen.cmake)
   add_doxygen(main)


Added new version for openJpeg

Added new version for openJpeg

--- cmake/CMakeModules/FindOpenJPEG.cmake
+++ cmake/CMakeModules/FindOpenJPEG.cmake
@@ -24,6 +24,7 @@
     openjpeg-1.5
     openjpeg-2.1
     openjpeg-2.3
+    openjpeg-2.5
   DOC "Location of OpenJPEG Headers"
 )
 FIND_LIBRARY(MINIZIP_LIBRARY NAMES ${MINIZIP_NAMES} )


[libcxx][cmake] Remove libatomic temporarily from CMAKE_REQUIRED_LIBRARIES when configuring

When libcxx is built in tree for a host which requires libatomic, LLVM's
configuration steps will determine it is required and add it to
CMAKE_REQUIRED_LIBRARIES. When libcxx is later configured, it tests if it
has C++ atomics without libatomic. The test erroneously passes as libatomic
is already part of the set of required libraries.

In turn, a number of the atomic tests will fail as they require libatomic
but the test suite is configured not to use libatomic.

Address this by always dropping libatomic from the set of required libraries
before determining if LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB is true,
then restoring the set of required libraries.

Reviewers: EricWF

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

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@329167 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/CheckLibcxxAtomic.cmake
+++ cmake/Modules/CheckLibcxxAtomic.cmake
@@ -31,7 +31,14 @@
   set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
 endfunction(check_cxx_atomics)

+# Perform the check for 64bit atomics without libatomic. It may have been
+# added to the required libraries during in the configuration of LLVM, which
+# would cause the check for CXX atomics without libatomic to incorrectly pass.
+set(OLD_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
+list(REMOVE_ITEM CMAKE_REQUIRED_LIBRARIES "atomic")
 check_cxx_atomics(LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)
+set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})
+
 check_library_exists(atomic __atomic_fetch_add_8 "" LIBCXX_HAS_ATOMIC_LIB)
 # If not, check if the library exists, and atomics work with it.
 if(NOT LIBCXX_HAVE_CXX_ATOMICS_WITHOUT_LIB)


fix date dependency

fix date dependency

--- cmake/modules/Build-HinnantDate.cmake
+++ cmake/modules/Build-HinnantDate.cmake
@@ -6,6 +6,7 @@
   GIT_TAG 3e82a52d665cdaaa51027f15906bf503b6896142
   CMAKE_ARGS -G ${CMAKE_GENERATOR} -DCMAKE_INSTALL_PREFIX=${DATE_INSTALL_DIR} -DENABLE_DATE_TESTING=OFF
   INSTALL_DIR ${DATE_INSTALL_DIR}
+  DEPENDS CURL::CURL
   BUILD_COMMAND cmake --build . --target install
 )


Don't use -z,defs on FreeBSD.

Don't use -z,defs on FreeBSD.

Looks like environ is defined only in the main binary.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -106,8 +106,9 @@

 # Pass -Wl,-z,defs. This makes sure all symbols are defined. Otherwise a DSO
 # build might work on ELF but fail on MachO/COFF.
-if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32) AND
-  NOT LLVM_USE_SANITIZER)
+if(NOT (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32 OR
+        ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") AND
+   NOT LLVM_USE_SANITIZER)
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
 endif()


closes #5379 add TOKU_PTHREAD_DEBUG for debug builds

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -18,6 +18,9 @@
   __STDC_FORMAT_MACROS
   __STDC_LIMIT_MACROS
   )
+
+## add TOKU_PTHREAD_DEBUG for debug builds
+set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG)

 if (CMAKE_SYSTEM_NAME STREQUAL Darwin OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
   message(WARNING "Setting TOKU_ALLOW_DEPRECATED on Darwin and with clang.  TODO: remove this.")


Optimized external header dependencies to not force rebuilds when make is run several times.

--- cmake_scripts/external-projects.cmake
+++ cmake_scripts/external-projects.cmake
@@ -16,13 +16,12 @@
     GIT_TAG "master"
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
-    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
-        <SOURCE_DIR>/include ${CMAKE_BINARY_DIR}/installed/include
+    INSTALL_COMMAND ""
     LOG_DOWNLOAD ON
     LOG_INSTALL ON
     )

-set(EXTERNAL_RAPIDJSON_INCLUDE_DIR ${CMAKE_BINARY_DIR}/installed/include/rapidjson)
+set(EXTERNAL_RAPIDJSON_INCLUDE_DIR ${EXTERNAL_PROJECTS_PREFIX}/src/externalRapidJson/include/rapidjson)

 ExternalProject_Add(
     externalLest
@@ -31,8 +30,7 @@
     GIT_TAG "master"
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
-    INSTALL_COMMAND ${CMAKE_COMMAND} -E copy_directory
-        <SOURCE_DIR>/include ${CMAKE_BINARY_DIR}/installed/include
+    INSTALL_COMMAND ""
     LOG_DOWNLOAD ON
     LOG_INSTALL ON
     )
@@ -43,4 +41,7 @@
     install(DIRECTORY ${EXTERNAL_RAPIDJSON_INCLUDE_DIR} DESTINATION include)
 endif()

-include_directories(${CMAKE_BINARY_DIR}/installed/include)
+include_directories(
+     ${EXTERNAL_PROJECTS_PREFIX}/src/externalRapidJson/include
+     ${EXTERNAL_PROJECTS_PREFIX}/src/externalLest/include/
+    )


try to fix issue with python3.lib being added automatically

--- cmake/appveyor.cmake
+++ cmake/appveyor.cmake
@@ -23,7 +23,7 @@
 SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:strict ${WARNINGS_IGNORE}")

 SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
-SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
+SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO /NODEFAULTLIB:python3")
 SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")

 #SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NODEFAULTLIB:LIBCMT")


Fallback to c++11 if c++14 not available

--- support/cmake/cxx14.cmake
+++ support/cmake/cxx14.cmake
@@ -40,6 +40,17 @@
     check_cxx_compiler_flag(-std=c++1y HAVE_STD_CPP1Y_FLAG)
     if (HAVE_STD_CPP1Y_FLAG)
       set(CPP14_FLAG -std=c++1y)
+    else ()
+      # Fallback on c++11 if c++14 is not available.
+      check_cxx_compiler_flag(-std=c++11 HAVE_STD_CPP11_FLAG)
+      if (HAVE_STD_CPP11_FLAG)
+        set(CPP14_FLAG -std=c++11)
+      else ()
+        check_cxx_compiler_flag(-std=c++0x HAVE_STD_CPP11_FLAG)
+        if (HAVE_STD_CPP0X_FLAG)
+          set(CPP14_FLAG -std=c++0x)
+        endif ()
+      endif ()
     endif ()
   endif ()
 endif ()


Fix ISPC selection for MSVC15

Fix ISPC selection for MSVC15

--- components/ospcommon/cmake/ispc.cmake
+++ components/ospcommon/cmake/ispc.cmake
@@ -24,7 +24,7 @@
     SET(ISPC_DIR_SUFFIX "osx")
   ELSEIF(WIN32)
     SET(ISPC_DIR_SUFFIX "windows")
-    IF (MSVC14)
+    IF (MSVC_VERSION GREATER_EQUAL 1900)
       LIST(APPEND ISPC_DIR_SUFFIX "windows-vs2015")
     ELSE()
       LIST(APPEND ISPC_DIR_SUFFIX "windows-vs2013")
@@ -38,7 +38,7 @@
     ENDFOREACH()
   ENDFOREACH()

-  FIND_PROGRAM(ISPC_EXECUTABLE ispc PATHS ${ISPC_DIR_HINT} DOC "Path to the ISPC executable.")
+  FIND_PROGRAM(ISPC_EXECUTABLE ispc HINTS ${ISPC_DIR_HINT} DOC "Path to the ISPC executable.")
   IF (NOT ISPC_EXECUTABLE)
     MESSAGE("********************************************")
     MESSAGE("Could not find ISPC (looked in PATH and ${ISPC_DIR_HINT})")


COMP: add missing dependent module for ITKv3 examples

--- Modules/Registration/Common/itk-module.cmake
+++ Modules/Registration/Common/itk-module.cmake
@@ -15,6 +15,8 @@
   ITKImageCompare
   ITKIOTransformBase
   ITKIOImageBase
+  ITKPDEDeformableRegistration
+  ITKFFT
 )
 endif()


cmake: fix mconf path for existing mconf

Fixes https://github.com/espressif/esp-idf/issues/2771
Fixes https://github.com/espressif/esp-idf/issues/2722

--- tools/cmake/kconfig.cmake
+++ tools/cmake/kconfig.cmake
@@ -12,6 +12,64 @@

     set(ROOT_KCONFIG ${IDF_PATH}/Kconfig)
 endmacro()
+
+if(CMAKE_HOST_WIN32)
+    # Prefer a prebuilt mconf-idf on Windows
+    if(DEFINED ENV{MSYSTEM})
+        find_program(WINPTY winpty)
+    else()
+        unset(WINPTY CACHE)  # in case previous CMake run was in a tty and this one is not
+    endif()
+    find_program(MCONF mconf-idf)
+
+    # Fall back to the old binary which was called 'mconf' not 'mconf-idf'
+    if(NOT MCONF)
+        find_program(MCONF mconf)
+        if(MCONF)
+            message(WARNING "Falling back to mconf binary '${MCONF}' not mconf-idf. "
+                "This is probably because an old version of IDF mconf is installed and this is fine. "
+                "However if there are config problems please check the Getting Started guide for your platform.")
+        endif()
+    endif()
+
+    if(NOT MCONF)
+        find_program(NATIVE_GCC gcc)
+        if(NOT NATIVE_GCC)
+            message(FATAL_ERROR
+                "Windows requires a prebuilt mconf-idf for your platform "
+                "on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. "
+                "Consult the setup docs for ESP-IDF on Windows.")
+        endif()
+    elseif(WINPTY)
+        set(MCONF "${WINPTY}" "${MCONF}")
+    endif()
+endif()
+
+if(NOT MCONF)
+    # Use the existing Makefile to build mconf (out of tree) when needed
+    #
+    set(MCONF ${CMAKE_BINARY_DIR}/kconfig_bin/mconf-idf)
+
+    externalproject_add(mconf-idf
+        SOURCE_DIR ${IDF_PATH}/tools/kconfig
+        CONFIGURE_COMMAND ""
+        BINARY_DIR "kconfig_bin"
+        BUILD_COMMAND make -f ${IDF_PATH}/tools/kconfig/Makefile mconf-idf
+        BUILD_BYPRODUCTS ${MCONF}
+        INSTALL_COMMAND ""
+        EXCLUDE_FROM_ALL 1
+        )
+
+    file(GLOB mconf_srcfiles ${IDF_PATH}/tools/kconfig/*.c)
+    externalproject_add_stepdependencies(mconf-idf build
+        ${mconf_srcfiles}
+        ${IDF_PATH}/tools/kconfig/Makefile
+        ${CMAKE_CURRENT_LIST_FILE})
+    unset(mconf_srcfiles)
+
+    set(menuconfig_depends DEPENDS mconf-idf)
+
+endif()

 # Find all Kconfig files for all components
 function(kconfig_process_config)
@@ -68,7 +126,7 @@
         "IDF_CMAKE=y"
         "KCONFIG_CONFIG=${SDKCONFIG}"
         "IDF_TARGET=${IDF_TARGET}"
-        ${CMAKE_BINARY_DIR}/${MCONF} ${ROOT_KCONFIG}
+        ${MCONF} ${ROOT_KCONFIG}
         VERBATIM
         USES_TERMINAL)

@@ -111,63 +169,4 @@
         ADDITIONAL_MAKE_CLEAN_FILES
         "${SDKCONFIG_HEADER}" "${SDKCONFIG_CMAKE}")

-endfunction()
-
-if(CMAKE_HOST_WIN32)
-    # Prefer a prebuilt mconf-idf on Windows
-    if(DEFINED ENV{MSYSTEM})
-        find_program(WINPTY winpty)
-    else()
-        unset(WINPTY CACHE)  # in case previous CMake run was in a tty and this one is not
-    endif()
-    find_program(MCONF mconf-idf)
-
-    # Fall back to the old binary which was called 'mconf' not 'mconf-idf'
-    if(NOT MCONF)
-        find_program(MCONF mconf)
-        if(MCONF)
-            message(WARNING "Falling back to mconf binary '${MCONF}' not mconf-idf. "
-                "This is probably because an old version of IDF mconf is installed and this is fine. "
-                "However if there are config problems please check the Getting Started guide for your platform.")
-        endif()
-    endif()
-
-    if(NOT MCONF)
-        find_program(NATIVE_GCC gcc)
-        if(NOT NATIVE_GCC)
-            message(FATAL_ERROR
-                "Windows requires a prebuilt mconf-idf for your platform "
-                "on the PATH, or an MSYS2 version of gcc on the PATH to build mconf-idf. "
-                "Consult the setup docs for ESP-IDF on Windows.")
-        endif()
-    elseif(WINPTY)
-        set(MCONF "${WINPTY}" "${MCONF}")
-    endif()
-endif()
-
-if(NOT MCONF)
-    # Use the existing Makefile to build mconf (out of tree) when needed
-    #
-    set(MCONF kconfig_bin/mconf-idf)
-
-    externalproject_add(mconf-idf
-        SOURCE_DIR ${IDF_PATH}/tools/kconfig
-        CONFIGURE_COMMAND ""
-        BINARY_DIR "kconfig_bin"
-        BUILD_COMMAND make -f ${IDF_PATH}/tools/kconfig/Makefile mconf-idf
-        BUILD_BYPRODUCTS ${MCONF}
-        INSTALL_COMMAND ""
-        EXCLUDE_FROM_ALL 1
-        WORKING_DIRECTORY ${CMAKE_BINARY_DIR} # Put built files on top level build directory
-        )
-
-    file(GLOB mconf_srcfiles ${IDF_PATH}/tools/kconfig/*.c)
-    externalproject_add_stepdependencies(mconf-idf build
-        ${mconf_srcfiles}
-        ${IDF_PATH}/tools/kconfig/Makefile
-        ${CMAKE_CURRENT_LIST_FILE})
-    unset(mconf_srcfiles)
-
-    set(menuconfig_depends DEPENDS mconf-idf)
-
-endif()+endfunction()


Add magic -D switch to work around OS X 10.5 bug in ucontext.h

--- indra/cmake/00-Common.cmake
+++ indra/cmake/00-Common.cmake
@@ -179,11 +179,17 @@

 if (DARWIN)
-  add_definitions(-DLL_DARWIN=1)
+  # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html):
+  # > Why the bus error? What am I doing wrong?
+  # This is a known issue where getcontext(3) is writing past the end of the
+  # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ).
+  # As a workaround, define _XOPEN_SOURCE before including ucontext.h.
+  add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE)
   set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
+  set(DARWIN_extra_cstar_flags "-mlong-branch")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  ${DARWIN_extra_cstar_flags}")
   # NOTE: it's critical that the optimization flag is put in front.
   # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
   set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O0 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")


Add Python 3.6 requirement

Add Python 3.6 requirement

--- cMake/FreeCAD_Helpers/SetupPython.cmake
+++ cMake/FreeCAD_Helpers/SetupPython.cmake
@@ -1,9 +1,5 @@
 macro(SetupPython)
 # -------------------------------- Python --------------------------------
-
-    # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598
-    # Acceptable versions of Python
-    set(Python_ADDITIONAL_VERSIONS "2.7")

     # For building on OS X
     if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)
@@ -118,31 +114,29 @@

     endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT BUILD_WITH_CONDA)

-    find_package(PythonInterp REQUIRED)
+    if(${CMAKE_VERSION} VERSION_LESS "3.12")
+        set(Python_ADDITIONAL_VERSIONS ${Python_ADDITIONAL_VERSIONS} "3.10" "3.9" "3.8" "3.7" "3.6")
+        find_package(PythonInterp REQUIRED)
+        set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
+        if (NOT DEFINED PYTHON_VERSION_STRING)
+            find_package(PythonLibs REQUIRED)
+        else (NOT DEFINED PYTHON_VERSION_STRING)
+            find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
+        endif(NOT DEFINED PYTHON_VERSION_STRING)
+    else()
+        find_package(Python3 COMPONENTS Interpreter Development)
+    endif()

-    # Issue in cmake prevents finding pythonlibs 3.x when python 2.7 is present
-    # setting NOTFOUND here resolves the issue
-    set(PYTHON_INCLUDE_DIR "NOTFOUND")
-    set(PYTHON_LIBRARY "NOTFOUND")
-
-    set(Python_ADDITIONAL_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
-    if (NOT DEFINED PYTHON_VERSION_STRING)
-        find_package(PythonLibs REQUIRED)
-    else (NOT DEFINED PYTHON_VERSION_STRING)
-        find_package(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
-    endif(NOT DEFINED PYTHON_VERSION_STRING)
-
-
     if(NOT PYTHONLIBS_FOUND)
         message(FATAL_ERROR "=================================\n"
                             "Python not found, install Python!\n"
                             "=================================\n")
     else(NOT PYTHONLIBS_FOUND)
-        # prevent python3 lower than 3.3 (not enough utf8<->unicode tools)
+        # prevent python3 lower than 3.6 (not enough utf8<->unicode tools)
         if(PYTHON_VERSION_MAJOR EQUAL 3)
-            if(PYTHON_VERSION_MINOR LESS 4)
-                message(FATAL_ERROR "To build FreeCAD with Python3, you need at least version 3.4\n")
-            endif(PYTHON_VERSION_MINOR LESS 4)
+            if(PYTHON_VERSION_MINOR LESS 6)
+                message(FATAL_ERROR "To build FreeCAD you need at least Python 3.6\n")
+            endif(PYTHON_VERSION_MINOR LESS 6)
         endif(PYTHON_VERSION_MAJOR EQUAL 3)
     endif(NOT PYTHONLIBS_FOUND)


Boost.iostreams: Fix library detection for MinGW

--- cmake/modules/hunter_boost_component_b2_args.cmake
+++ cmake/modules/hunter_boost_component_b2_args.cmake
@@ -133,8 +133,8 @@
         endif()
         get_filename_component(zlib_dir ${zlib_path} DIRECTORY)
         get_filename_component(zlib_name ${zlib_path} NAME_WE)
-        if(NOT WIN32)
-          string(REPLACE "lib" "" zlib_name ${zlib_name})
+        if(NOT WIN32 OR MINGW)
+          string(REGEX REPLACE "^lib" "" zlib_name ${zlib_name})
         endif()
         list(APPEND myList "-s" "ZLIB_INCLUDE=${zlib_include}" "-s" "ZLIB_LIBPATH=${zlib_dir}" "-s" "ZLIB_BINARY=${zlib_name}")
         set(BOOST_CONFIG_LINK_ZLIB 1 PARENT_SCOPE)
@@ -163,8 +163,8 @@
         endif()
         get_filename_component(bzip2_dir ${bzip2_path} DIRECTORY)
         get_filename_component(bzip2_name ${bzip2_path} NAME_WE)
-        if(NOT WIN32)
-          string(REPLACE "lib" "" bzip2_name ${bzip2_name})
+        if(NOT WIN32 OR MINGW)
+          string(REGEX REPLACE "^lib" "" bzip2_name ${bzip2_name})
         endif()
         list(APPEND myList "-s" "BZIP2_INCLUDE=${bzip2_include}" "-s" "BZIP2_LIBPATH=${bzip2_dir}" "-s" "BZIP2_BINARY=${bzip2_name}")
         set(BOOST_CONFIG_LINK_BZIP2 1 PARENT_SCOPE)


[ci skip] Disable warning C4312, C4244 (caused by imgui-sfml)

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -83,6 +83,8 @@
 		# /wd4201     # -> disable warning: nonstandard extension used: nameless struct/union (caused by GLM)
 		# /wd4127     # -> disable warning: conditional expression is constant (caused by Qt)
 		/wd4189       # -> disable warning: local variable is initialized but not referenced (caused by imgui)
+		/wd4312       # -> disable warning: 'type cast': conversion from 'unsigned int' to 'void *' of greater size (caused by imgui-sfml)
+		/wd4244       # -> disable warning: conversion from 'const float' to 'int', possible loss of data (caused by imgui-sfml)

 		#$<$<CONFIG:Debug>:
 		#/RTCc        # -> value is assigned to a smaller data type and results in a data loss


Use -Wextra compiler flag by default.

Use -Wextra compiler flag by default.

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

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

   check_c_compiler_flag("-fstack-protector" WITH_STACK_PROTECTOR)
   if (WITH_STACK_PROTECTOR)


ORC-1188: Fix `ORC_PREFER_STATIC_ZLIB`

ORC-1188: Fix `ORC_PREFER_STATIC_ZLIB`

### What changes were proposed in this pull request?

This PR aims to fix

### Why are the changes needed?

To be consistent with the definition.
https://github.com/apache/orc/blob/8f038a068c61cdac72c4c58ad023ad3c4ab10e38/cmake_modules/ThirdpartyToolchain.cmake#L147-L151

### How was this patch tested?

Closes #1138

Closes #1140 from dongjoon-hyun/ORC-1188.

Authored-by: Dongjoon Hyun <6ff48b33cbb828151035af58a92f18a39f1d1036@apache.org>
Signed-off-by: Dongjoon Hyun <6ff48b33cbb828151035af58a92f18a39f1d1036@apache.org>

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -145,9 +145,9 @@
 add_library (orc_zlib INTERFACE)
 add_library (orc::zlib ALIAS orc_zlib)
 if (ORC_PREFER_STATIC_ZLIB AND ${ZLIB_STATIC_LIB})
+  target_link_libraries (orc_zlib INTERFACE ${ZLIB_STATIC_LIB})
+else ()
   target_link_libraries (orc_zlib INTERFACE ${ZLIB_LIBRARY})
-else ()
-  target_link_libraries (orc_zlib INTERFACE ${ZLIB_STATIC_LIB})
 endif ()
 target_include_directories (orc_zlib SYSTEM INTERFACE ${ZLIB_INCLUDE_DIR})


ORC-1010: Bump tzdata from tzdata-2020e-1.tar.xz to tzdata-2021b-1.tar.xz (#918)

### What changes were proposed in this pull request?

```cmd
CUSTOMBUILD : error : downloading 'ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2020e-1.tar.xz' failed [C:\projects\orc\build\tzdata_ep.vcxproj]
           status_code: 78
           status_string: "Remote file not found"
           log:
           --- LOG BEGIN ---
           timeout on name lookup is not supported
```
https://cygwin.osuosl.org/noarch/release/tzdata/
It looks like the archive tzdata-2020e-1.tar.xz has been deleted and tzdata-2021b-1-src.tar.xz was created two days ago.
![image](https://user-images.githubusercontent.com/4069905/134888938-7f810c06-3efa-4e1d-b620-c59aee6779d0.png)

### Why are the changes needed?

Fix CI for winodw.

### How was this patch tested?

Pass the CIs.

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -275,8 +275,8 @@

 if (WIN32)
   ExternalProject_Add(tzdata_ep
-    URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2020e-1.tar.xz"
-    URL_HASH MD5=f387bd21bd54a68ef73a0b9fa20a9ff5
+    URL "ftp://cygwin.osuosl.org/pub/cygwin/noarch/release/tzdata/tzdata-2021b-1.tar.xz"
+    URL_HASH MD5=d0de6f00f5a37ee211cfabeae9eb0937
     CONFIGURE_COMMAND ""
     BUILD_COMMAND ""
     INSTALL_COMMAND "")


STYLE: minor fix in debug mode and clearer code intent by using macros

Change-Id: I4004f9e91d320e7a38bff8e7c7996504f9a4ce5b

--- Modules/Remote/IOSTL.remote.cmake
+++ Modules/Remote/IOSTL.remote.cmake
@@ -3,5 +3,5 @@
   "This module contains classes for reading and writing QuadEdgeMeshes using
   the STL (STereoLithography)file format. https://hdl.handle.net/10380/3452"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKSTLMeshIO.git
-  GIT_TAG 24e006e5f79ef43467ff6a7fcc7399d059a26d66
+  GIT_TAG 6e01a0e741a3c80533bf1c773d01daafe1dc263e
   )


Add pre-processor macros for all plug-ins for accessing a module context.

--- CMake/mitkMacroCreateCTKPlugin.cmake
+++ CMake/mitkMacroCreateCTKPlugin.cmake
@@ -39,6 +39,9 @@
       MODULES MitkCore ${_PLUGIN_MODULE_DEPENDENCIES} ${_PLUGIN_MODULE_DEPENDS}
       PACKAGES ${_PLUGIN_PACKAGE_DEPENDS}
      )
+
+    set_property(TARGET ${PLUGIN_TARGET} APPEND PROPERTY COMPILE_DEFINITIONS US_MODULE_NAME=${PLUGIN_TARGET})
+    set_property(TARGET ${PLUGIN_TARGET} PROPERTY US_MODULE_NAME ${PLUGIN_TARGET})

     if(ALL_META_DEPENDENCIES)
       add_dependencies(${PLUGIN_TARGET} ${ALL_META_DEPENDENCIES})


Temporaly fix to cmake OpenSSL issue.

Temporaly fix to cmake OpenSSL issue.

--- CMakeModules/ConfigurePackages.cmake
+++ CMakeModules/ConfigurePackages.cmake
@@ -370,22 +370,21 @@
 endmacro (configure_mumbleclient)

 macro (configure_openssl)
-	# NOTE: This doesn't work with CMake 2.8 Windows version
-	#       CMake 2.6 must be used
     sagase_configure_package(OPENSSL
         NAMES openssl
         COMPONENTS libeay32 ssleay32 ssl
         PREFIXES ${ENV_NAALI_DEP_PATH}/OpenSSL)
-    # remove 'NOTFOUND' entry which makes to linking impossible
+    # remove 'NOTFOUND' entry which makes to linking impossible
     if (MSVC)
-        list(REMOVE_ITEM OPENSSL_LIBRARIES NOTFOUND)
+        list(REMOVE_ITEM OPENSSL_LIBRARIES debug optimized SSL_EAY_RELEASE-NOTFOUND LIB_EAY_RELEASE-NOTFOUND SSL_EAY_DEBUG-NOTFOUND LIB_EAY_DEBUG-NOTFOUND NOTFOUND)
+    message(----------)
+    message(${OPENSSL_LIBRARIES})
+    message(----------)
     endif ()
     sagase_configure_report (OPENSSL)
 endmacro (configure_openssl)

 macro (configure_protobuf)
-	message(PROTOBUF_INCLUDE_DIR=${PROTOBUF_INCLUDE_DIR})
-	message(PROTOBUF_LIBRARY=${PROTOBUF_LIBRARY})
     sagase_configure_package(PROTOBUF
         NAMES google protobuf
         COMPONENTS libprotobuf


removed optimize nvcc command line parameter for linux

--- build/cmake/custom_scripts/schism_cuda.cmake
+++ build/cmake/custom_scripts/schism_cuda.cmake
@@ -25,7 +25,7 @@
 	endif (${SCHISM_PLATFORM} MATCHES ${PLATFORM_WIN64})
 elseif (UNIX)
    #todo make gencode variable
-   set(SCM_CUDA_NVCC_OPTIONS --gpu-architecture=compute_20 --gpu-code=sm_20,compute_20 --optimize 3 --compile CACHE STRING "schism cuda internal" FORCE)
+   set(SCM_CUDA_NVCC_OPTIONS --gpu-architecture=compute_20 --gpu-code=sm_20,compute_20 --compile CACHE STRING "schism cuda internal" FORCE)
     set(SCM_CUDA_NVCC_PATH                  /opt/cuda/current/cuda/bin                CACHE PATH   "schism cuda internal")
     # set(CUDA_NVCC_OPTIONS              -ccbin \"/usr/bin\")
 endif (WIN32)