Added Windows functionality to FindMatlab. Untested

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -36,6 +36,9 @@
     foreach (DIR_ ${SEARCH_DIRS_})
       file(GLOB MATLAB_ROOT_DIR ${DIR_}/*matlab*)
       if (MATLAB_ROOT_DIR)
+        list(SORT MATLAB_ROOT_DIR)
+        list(REVERSE MATLAB_ROOT_DIR)
+        list(GET MATLAB_ROOT_DIR 0 MATLAB_ROOT_DIR)
         break()
       endif()
     endforeach()
@@ -47,12 +50,30 @@
     foreach (DIR_ ${SEARCH_DIRS_})
       file(GLOB MATLAB_ROOT_DIR ${DIR_}/*matlab*)
       if (MATLAB_ROOT_DIR)
+        list(SORT MATLAB_ROOT_DIR)
+        list(REVERSE MATLAB_ROOT_DIR)
+        list(GET MATLAB_ROOT_DIR 0 MATLAB_ROOT_DIR)
         break()
       endif()
     endforeach()

   # --- WINDOWS ---
   elseif (WIN32)
+    # query the registry
+    set(REG_ROOTS_ "HKEY_LOCAL_MACHINE" "HKEY_CURRENT_USER")
+    foreach(REG_ROOT_ REG_ROOTS_)
+      execute_process(COMMAND reg query ${REG_ROOT_}\\SOFTWARE\\MathWorks\\MATLAB /f * /k OUTPUT_VARIABLE VERSIONS_)
+      if (VERSIONS_)
+        # sort in order from highest to lowest
+        list(SORT VERSIONS_)
+        list(REVERSE VERSIONS_)
+        list(GET VERSIONS_ 0 VERSION_)
+        get_filename_component(MATLAB_ROOT_DIR [${REG_ROOT_}\\SOFTWARE\\MathWorks\\MATLAB\\${VERSION_};Install_Dir] ABSOLUTE PATH)
+        if (MATLAB_ROOT_DIR)
+          break()
+        endif()
+      endif()
+    endforeach()
   endif()
   # unset local variables
   unset(SEARCH_DIRS_)
@@ -67,30 +88,31 @@
 # (include directory and libraries) under the root. If everything is found,
 # sets the variable MATLAB_FOUND to TRUE
 MACRO(locate_matlab_components MATLAB_ROOT_DIR)
+  # get the mex extension
   if (UNIX)
-    # get the mex extension
     execute_process(COMMAND ${MATLAB_ROOT_DIR}/bin/mexext OUTPUT_VARIABLE MATLAB_MEXEXT)
-    string(STRIP ${MATLAB_MEXEXT} MATLAB_MEXEXT)
-    string(REPLACE "mex" "" MATLAB_ARCH ${MATLAB_MEXEXT})
+  elseif (WIN32)
+    execute_process(COMMAND ${MATLAB_ROOT_DIR}/bin/mexext.bat OUTPUT_VARIABLE MATLAB_MEXEXT)
+  endif()
+
+  string(STRIP ${MATLAB_MEXEXT} MATLAB_MEXEXT)
+  string(REPLACE "mex" "" MATLAB_ARCH ${MATLAB_MEXEXT})

-    # get the path to the libraries
-    set(MATLAB_LIBRARY_DIRS ${MATLAB_ROOT_DIR}/bin/${MATLAB_ARCH})
+  # get the path to the libraries
+  set(MATLAB_LIBRARY_DIRS ${MATLAB_ROOT_DIR}/bin/${MATLAB_ARCH})

-    # get the libraries
-    find_library(MATLAB_LIB_MX  mx  PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
-    find_library(MATLAB_LIB_MEX mex PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
-    find_library(MATLAB_LIB_MAT mat PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
-    set(MATLAB_LIBS ${MATLAB_LIB_MX} ${MATLAB_LIB_MEX} ${MATLAB_LIB_MAT})
+  # get the libraries
+  find_library(MATLAB_LIB_MX  mx  PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
+  find_library(MATLAB_LIB_MEX mex PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
+  find_library(MATLAB_LIB_MAT mat PATHS ${MATLAB_LIBRARY_DIRS} NO_DEFAULT_PATH)
+  set(MATLAB_LIBS ${MATLAB_LIB_MX} ${MATLAB_LIB_MEX} ${MATLAB_LIB_MAT})

-    # get the include path
-    find_path(MATLAB_INCLUDE_DIRS mex.h ${MATLAB_ROOT_DIR}/extern/include)
+  # get the include path
+  find_path(MATLAB_INCLUDE_DIRS mex.h ${MATLAB_ROOT_DIR}/extern/include)

-    # get the mex shell script
-    find_file(MATLAB_MEX_SCRIPT NAMES mex mex.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
-
-  elseif (WIN32)
-  endif()
-
+  # get the mex shell script
+  find_file(MATLAB_MEX_SCRIPT NAMES mex mex.bat PATHS ${MATLAB_ROOT_DIR}/bin NO_DEFAULT_PATH)
+
   # verify that everything has been found successfully
   if (MATLAB_LIB_MX AND MATLAB_LIB_MEX AND MATLAB_LIB_MAT AND MATLAB_INCLUDE_DIRS AND MATLAB_MEX_SCRIPT)
     set(MATLAB_FOUND TRUE)


Removed tabs from sources, only spaces are allowed!

--- cmake/Platform/Arduino.cmake
+++ cmake/Platform/Arduino.cmake
@@ -1617,8 +1617,8 @@
             string(REPLACE "\n" " " SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
             string(REPLACE "{" "" SKETCH_PROTOTYPE "${SKETCH_PROTOTYPE}")
             arduino_debug_msg("\tprototype: ${SKETCH_PROTOTYPE};")
-			# " else if(var == other) {" shoudn't be listed as prototype
-			if(NOT SKETCH_PROTOTYPE MATCHES "(if[ ]?[\n]?[\t]*[ ]*[)])")
+            # " else if(var == other) {" shoudn't be listed as prototype
+            if(NOT SKETCH_PROTOTYPE MATCHES "(if[ ]?[\n]?[\t]*[ ]*[)])")
                 file(APPEND ${SKETCH_CPP} "${SKETCH_PROTOTYPE};\n")
             else()
                 arduino_debug_msg("\trejected prototype: ${SKETCH_PROTOTYPE};")


[cmake] link __wrap_fcntl even if not directly called

when compiled with -coverage, fcntl is referenced from libgcov

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -499,11 +499,12 @@
 				log2
 				)

+			set(_WRAPPER_FLAGS "-u __wrap_memcpy -Wl") # link memcpy even if not directly called (used in libstdc++)
+
 			if (${TARGET_CPU} STREQUAL "x86")
+				set(_WRAPPER_FLAGS "-u __wrap_fcntl ${_WRAPPER_FLAGS}") # link fcntl even if not directly called (used when compiled with -coverage)
 				list(APPEND _FUNC_LIST fcntl)
 			endif()
-
-			set(_WRAPPER_FLAGS "-u __wrap_memcpy -Wl") # link memcpy even if not directly used (it is used in libstdc++)

 			foreach (_FUNC ${_FUNC_LIST})
 				string(APPEND _WRAPPER_FLAGS ",--wrap=${_FUNC}")


Add an option to get list of generated bindings (#304)

--- cmake/chimeraFunctions.cmake
+++ cmake/chimeraFunctions.cmake
@@ -10,12 +10,13 @@
 #
 # add_chimera_binding(TARGET target
 #                     [DESTINATION destination_dir] # Defaults to `target`
-#                     [MODULE module]  # Defaults to `target`
-#                     [BINDING binding] # Binding definition (overrides config)
+#                     [MODULE module]               # Defaults to `<BINARY_DIR>/target`
+#                     [BINDING binding]             # Binding definition (overrides config)
 #                     [CONFIGURATION config_file]
 #                     [NAMESPACES namespace1 namespace2 ...])
 #                     SOURCES source1_file [source2_file ...]
 #                     [EXTRA_SOURCES source1_file ...]
+#                     [GENERATED_BINDING_SOURCES]      # Output variable containing list of generated binding source files
 #                     [DEBUG] [EXCLUDE_FROM_ALL]
 function(add_chimera_binding)
     include(ExternalProject)
@@ -24,7 +25,7 @@
     # Unparsed arguments can be found in variable ARG_UNPARSED_ARGUMENTS.
     set(prefix binding)
     set(options DEBUG EXCLUDE_FROM_ALL)
-    set(oneValueArgs TARGET MODULE CONFIGURATION DESTINATION BINDING)
+    set(oneValueArgs TARGET MODULE CONFIGURATION DESTINATION BINDING GENERATED_BINDING_SOURCES)
     set(multiValueArgs SOURCES NAMESPACES EXTRA_SOURCES LINK_LIBRARIES)
     cmake_parse_arguments("${prefix}" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

@@ -189,4 +190,9 @@
     set_target_properties("${binding_TARGET}_REBUILD" PROPERTIES EXCLUDE_FROM_ALL TRUE)
     add_dependencies("${binding_TARGET}" "${binding_TARGET}_REBUILD")

+    # Set ${binding_GENERATED_BINDING_SOURCES} with the list of generated bindings
+    if(binding_GENERATED_BINDING_SOURCES)
+        set(${binding_GENERATED_BINDING_SOURCES} ${binding_GENERATED} PARENT_SCOPE)
+    endif()
+
 endfunction(add_chimera_binding)


[cmake] When compiling swift libraries that are not pure swift on macOS be sure to set the linker language to cxx.

I already did this for executables. The reason why we must do this is that right
now there are bugs in cmake's swift support that makes it so that one can not
use swiftc to link targets with mixed c/c++/swift content even if the swift
content is indirectly added via linking. To work around this we must also ensure
that all libraries with mixed c/c++/swift objects link using clang. As an
additional side-effect of this, we must pass to the clang linker -L flags that
swiftc would normally provide for the linker. The two cases where I needed to do
this were:

1. -L path for the compatibility libraries. This path points into the toolchain
where these live. This is important since otherwise we will fail to link given
the minimum deployment target that swift (both host/stdlib) target today (10.9).

2. -L path to the SDK. This path points to the SDKs lib/swift/${HOST_PLATFORM}
for swiftCore and friends.

That being said, we still want people to be able to link pure swift libraries
using swiftc, so we introduce an option called PURE_SWIFT to add_host_library
that preserves this and is used to also set
IGNORE_LLVM_UPDATE_COMPILE_FLAGS (which arguably should have been called
PURE_SWIFT).

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -390,7 +390,7 @@
 #     [SHARED]
 #     [STATIC]
 #     [OBJECT]
-#     [IGNORE_LLVM_UPDATE_COMPILE_FLAGS]
+#     [PURE_SWIFT]
 #     [LLVM_LINK_COMPONENTS comp1 ...]
 #     source1 [source2 source3 ...])
 #
@@ -409,10 +409,9 @@
 # LLVM_LINK_COMPONENTS
 #   LLVM components this library depends on.
 #
-# IGNORE_LLVM_UPDATE_COMPILE_FLAGS
-#   If set do not use llvm_update_compile_flags to generate cflags/etc.  This is
-#   generally used when compiling a mixed c/c++/swift library and one wants to
-#   disable this for the swift part.
+# PURE_SWIFT
+#   This has two effects if set: we do not use llvm_update_compile_flags to
+#   generate cflags/etc and we leave the linking mode of the library as swift.
 #
 # source1 ...
 #   Sources to add into this library.
@@ -421,7 +420,7 @@
         SHARED
         STATIC
         OBJECT
-        IGNORE_LLVM_UPDATE_COMPILE_FLAGS)
+        PURE_SWIFT)
   set(single_parameter_options)
   set(multiple_parameter_options
         LLVM_LINK_COMPONENTS)
@@ -467,7 +466,7 @@

   add_library(${name} ${libkind} ${ASHL_SOURCES})
   add_dependencies(${name} ${LLVM_COMMON_DEPENDS})
-  if (NOT ASHL_IGNORE_LLVM_UPDATE_COMPILE_FLAGS)
+  if (NOT ASHL_PURE_SWIFT)
     llvm_update_compile_flags(${name})
   endif()
   swift_common_llvm_config(${name} ${ASHL_LLVM_LINK_COMPONENTS})
@@ -528,6 +527,12 @@
       NO_SONAME YES)
   endif()

+  # Always link as CXX even if we have swift content unless we only contain
+  # swift content signaled via us being marked "PURE_SWIFT".
+  if (NOT ASHL_PURE_SWIFT)
+    set_target_properties(${name} PROPERTIES LINKER_LANGUAGE CXX)
+  endif()
+
   if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
     target_link_options(${name} PRIVATE
       "LINKER:-compatibility_version,1")
@@ -536,8 +541,24 @@
         "LINKER:-current_version,${SWIFT_COMPILER_VERSION}")
     endif()

-    # For now turn off in swift targets, debug info if we are compiling a static
-    # library.
+    # If we found a swift compiler and are going to use swift code in swift
+    # host side tools but link with clang, add the appropriate -L paths so we
+    # find all of the necessary swift libraries on Darwin.
+    if (NOT ASHL_PURE_SWIFT)
+      if (CMAKE_Swift_COMPILER)
+        # Add in the SDK directory for the host platform and add an rpath.
+        target_link_directories(${name} PRIVATE
+          ${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_ARCH_${SWIFT_HOST_VARIANT_ARCH}_PATH}/usr/lib/swift)
+        # Add in the toolchain directory so we can grab compatibility libraries
+        get_filename_component(TOOLCHAIN_BIN_DIR ${CMAKE_Swift_COMPILER} DIRECTORY)
+        get_filename_component(TOOLCHAIN_LIB_DIR "${TOOLCHAIN_BIN_DIR}/../lib/swift/macosx" ABSOLUTE)
+        target_link_directories(${name} PUBLIC ${TOOLCHAIN_LIB_DIR})
+      endif()
+    endif()
+
+    # For now turn off on Darwin swift targets, debug info if we are compiling a static
+    # library and set up an rpath so that if someone works around this by using
+    # shared libraries that in the short term we can find shared libraries.
     if (ASHL_STATIC)
       target_compile_options(${name} PRIVATE $<$<COMPILE_LANGUAGE:Swift>:-gnone>)
     endif()
@@ -605,9 +626,23 @@
       JOB_POOL_LINK swift_link_job_pool)
   endif()
   if(${SWIFT_HOST_VARIANT_SDK} IN_LIST SWIFT_APPLE_PLATFORMS)
+    # Lists of rpaths that we are going to add to our executables.
+    #
+    # Please add each rpath separately below to the list, explaining why you are
+    # adding it.
+    set(RPATH_LIST)
+
+    # We also want to be able to find libraries from the base toolchain
+    # directory. This is so swiftc can rely on its own host side dylibs that may
+    # contain swift content.
+    list(APPEND RPATH_LIST "@executable_path/../lib")
+
+    # Also include the swift specific resource dir in our rpath.
+    list(APPEND RPATH_LIST "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
+
     set_target_properties(${executable} PROPERTIES
       BUILD_WITH_INSTALL_RPATH YES
-      INSTALL_RPATH "@executable_path/../lib/swift/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}")
+      INSTALL_RPATH "${RPATH_LIST}")
   endif()

   llvm_update_compile_flags(${executable})


Start including LLVM bitcode sections in Swift dylibs

This ports staged changes on the Xcode 7 branch back to master.
This change requires 7A113 or greater, or 7A92k or greater.

rdar://problem/20730441

Swift SVN r28537

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -39,23 +39,6 @@
 endfunction()

-# Use 16K segment alignment on 32-bit arm.
-# The linker does this by default for iOS 8+ deployment,
-# but we deploy to iOS 7.
-function(append_darwin_segalign_link_flags
-    arch result_var_name)
-  set(result ${${result_var_name}})
-
-  string(FIND "${arch}" "arm" armprefix)
-  if ("${armprefix}" STREQUAL "0" AND NOT "${arch}" STREQUAL "arm64")
-    # arch starts with "arm" and is not "arm64"
-    list(APPEND result "-Xlinker" "-segalign" "-Xlinker" "0x4000")
-  endif()
-
-  set("${result_var_name}" "${result}" PARENT_SCOPE)
-endfunction()
-
-
 function(_add_variant_c_compile_link_flags
     sdk arch build_type enable_assertions result_var_name)
   set(result ${${result_var_name}})
@@ -70,8 +53,6 @@
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks"
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/AppleInternal/Library/Frameworks"
         "-m${SWIFT_SDK_${sdk}_VERSION_MIN_NAME}-version-min=${SWIFT_SDK_${sdk}_DEPLOYMENT_VERSION}")
-
-    append_darwin_segalign_link_flags("${arch}" result)
   endif()

   set("${result_var_name}" "${result}" PARENT_SCOPE)
@@ -128,8 +109,6 @@
     list(APPEND result
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/Library/Frameworks"
         "-F" "${SWIFT_SDK_${sdk}_PATH}/../../../Developer/AppleInternal/Library/Frameworks")
-
-    append_darwin_segalign_link_flags("${arch}" result)
   endif()

   is_build_type_optimized("${build_type}" optimized)


build: remove `MODULE_TARGETS` from `_add_swift_host_library_single`

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -674,7 +674,6 @@
 #   _add_swift_host_library_single(
 #     target
 #     name
-#     [MODULE_TARGETS]
 #     [SHARED]
 #     [STATIC]
 #     [SDK sdk]
@@ -696,9 +695,6 @@
 #
 # name
 #   Name of the library (e.g., swiftParse).
-#
-# MODULE_TARGETS
-#   Names of the module target (e.g., swiftParse-swiftmodule-IOS-armv7).
 #
 # SHARED
 #   Build a shared library.
@@ -770,8 +766,7 @@
         LINK_LIBRARIES
         LLVM_LINK_COMPONENTS
         PRIVATE_LINK_LIBRARIES
-        SWIFT_COMPILE_FLAGS
-        MODULE_TARGETS)
+        SWIFT_COMPILE_FLAGS)

   cmake_parse_arguments(SWIFTLIB_SINGLE
                         "${SWIFTLIB_SINGLE_options}"
@@ -885,15 +880,6 @@
   # If there were any swift sources, then a .swiftmodule may have been created.
   # If that is the case, then add a target which is an alias of the module files.
   set(VARIANT_SUFFIX "-${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}-${SWIFTLIB_SINGLE_ARCHITECTURE}")
-
-  if(NOT "${SWIFTLIB_SINGLE_MODULE_TARGETS}" STREQUAL "" AND NOT "${swift_module_dependency_target}" STREQUAL "")
-    foreach(module_target ${SWIFTLIB_SINGLE_MODULE_TARGETS})
-      add_custom_target("${module_target}"
-        DEPENDS ${swift_module_dependency_target})
-      set_target_properties("${module_target}" PROPERTIES
-        FOLDER "Swift libraries/Modules")
-    endforeach()
-  endif()

   # For standalone overlay builds to work
   if(NOT BUILD_STANDALONE)


[cmake] Enable cross-module-optimization when compiling swift libraries in release/relwithdebinfo.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -527,6 +527,11 @@
     endif()
   endif()

+  # If we are compiling in release or release with deb info, compile swift code
+  # with -cross-module-optimization enabled.
+  target_compile_options(${name} PRIVATE
+    $<$<AND:$<COMPILE_LANGUAGE:Swift>,$<OR:$<CONFIG:Release>,$<CONFIG:RelWithDebInfo>>>:-cross-module-optimization>)
+
   add_dependencies(dev ${name})
   if(NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     swift_install_in_component(TARGETS ${name}


Fix typo

Fix typo

--- cmake/modules/BuildLua.cmake
+++ cmake/modules/BuildLua.cmake
@@ -47,9 +47,9 @@
 )

 if(WIN32)
-  set(LUA_LIBRARY "${install_dir}/lib/lua51.lib")
+  set(LUA_LIBRARY "${install_dir}/lib/liblua.lib")
   set(LUA_LIBRARIES "${LUA_LIBRARY}")
-  set(LUA_INSTALL_LIBS "${install_dir}/lib/lua51.dll")
+  set(LUA_INSTALL_LIBS "${install_dir}/lib/liblua.dll")
 else()
   set(LUA_LIBRARY "${install_dir}/lib/liblua.a")
   set(LUA_LIBRARIES "${LUA_LIBRARY}" "${LUA_DL_LIBRARY}" "${LUA_MATH_LIBRARY}")


Cleanup

Cleanup

--- cmake/modules/FindGLFW.cmake
+++ cmake/modules/FindGLFW.cmake
@@ -161,7 +161,7 @@
                             "${GLFW_cocoa_LIBRARY}"
                             "${GLFW_iokit_LIBRARY}"
                             "${GLFW_corevideo_LIBRARY}" )
-        set( GLFW_FOUND "YES" )
+        set (GLFW_FOUND "YES")
         set (GLFW_LIBRARY "${GLFW_LIBRARIES}")
         set (GLFW_INCLUDE_PATH "${GLFW_INCLUDE_DIR}")
     endif(GLFW_glfw_LIBRARY)
@@ -214,10 +214,3 @@
     FAIL_MESSAGE
      "Could NOT find GLFW, it will be downloaded on first build."
 )
-
-mark_as_advanced(
-  GLFW_INCLUDE_DIR
-  GLFW_LIBRARIES
-  GLFW_glfw_LIBRARY
-  GLFW_cocoa_LIBRARY
-)


Fix PHP build Approved: Paul J. Lucas, William Candillon

--- cmake_modules/FindPHP5.cmake
+++ cmake_modules/FindPHP5.cmake
@@ -103,7 +103,8 @@
     __zend_hash_add_or_update
     _php_strtolower
     _executor_globals
-    _call_user_function
+    _call_user_function
+    _php_sprintf
     )
     SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
       "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")


Update compiler.cmake

Update compiler.cmake

added -Wc++98-compat for boost suppression

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -206,6 +206,7 @@
                      " -Wno-conditional-uninitialized"
                      " -Wno-exit-time-destructors"
                      " -Wno-undefined-func-template"
+                     " -Wnoc++98-compat"
                      )
              string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
              #endif ()


removed FORCE

removed FORCE

--- opengm.cmake
+++ opengm.cmake
@@ -13,8 +13,7 @@

 external_git_repo (opengm
     HEAD
-    https://github.com/ilastik/opengm
-    FORCE)
+    https://github.com/ilastik/opengm)

 message ("Installing ${opengm_NAME} into FlyEM build area: ${BUILDEM_DIR} ...")


Update CppUTestConfigurationOptions.cmake

Setting HAS_INF and HAS_NAN to OFF for Borland compiler
Setting CPPUTEST_HAS_INF and CPPUTEST_HAS_NAN to 1 if HAS_INF and HAS_NAN are on respectively

--- cmake/Modules/CppUTestConfigurationOptions.cmake
+++ cmake/Modules/CppUTestConfigurationOptions.cmake
@@ -15,9 +15,11 @@
     set(CMAKE_CXX_LINK_FLAGS "--semihosting --config ${LINKER_SCRIPT} --map mapfile.map")
 elseif (BORLAND)
     set(CPP_PLATFORM Borland)
-    set(MEMORY_LEAK_DETECTION False)
+    set(MEMORY_LEAK_DETECTION OFF)
     set(LONGLONG OFF)
     set(CPPUTEST_CXX_FLAGS "${CPPUTEST_CXX_FLAGS} -w-8008 -w-8066")
+    set(HAS_INF OFF)
+    set(HAS_NAN OFF)
 elseif (STD_C)
     if(NOT CPP_PLATFORM)
         set(CPP_PLATFORM Gcc)
@@ -60,6 +62,14 @@
 if (LONGLONG)
     set(CPPUTEST_USE_LONG_LONG 1)
 endif (LONGLONG)
+
+if (HAS_INF)
+    set(CPPUTEST_HAS_INF 1)
+endif (HAS_INF)
+
+if (HAS_NAN)
+    set(CPPUTEST_HAS_NAN 1)
+endif (HAS_NAN)

 if (MAP_FILE AND NOT MSVC)
     set(CPPUTEST_LD_FLAGS "${CPPUTEST_LD_FLAGS} -Wl,-Map,$<.map.txt")


Update the cpack file components according to the frontend refactoring


updated sourceforge download links

updated sourceforge download links

--- version_config.cmake
+++ version_config.cmake
@@ -27,8 +27,7 @@
 set(Boost_MD5 3c706b3fc749884ea5510c39474fd732)

 ## Armadillo
-set(Armadillo_URL   https://downloads.sourceforge.net/project/arma/armadillo-7.800.2.tar.xz?r=http%3A%2F%2Farma.sourceforge.net%2Fdownload.html&ts=1492950217&use_mirror=freefr
- )
+set(Armadillo_URL   https://downloads.sourceforge.net/project/arma/armadillo-7.800.2.tar.xz)
 set(Armadillo_MD5 c601f3a5ec6d50666aa3a539fa20e6ca )

 ## FFTW3
@@ -53,10 +52,10 @@

 ## SWIG
 if (WIN32)
-  set(SWIG_URL http://prdownloads.sourceforge.net/swig/swigwin-3.0.12.zip  )
+  set(SWIG_URL http://downloads.sourceforge.net/swig/swigwin-3.0.12.zip  )
   set(SWIG_MD5 a49524dad2c91ae1920974e7062bfc93 )
 else(WIN32)
-  set(SWIG_URL http://prdownloads.sourceforge.net/swig/swig-3.0.12.tar.gz )
+  set(SWIG_URL http://downloads.sourceforge.net/swig/swig-3.0.12.tar.gz )
   set(SWIG_MD5 82133dfa7bba75ff9ad98a7046be687c )
 endif(WIN32)
 option(DEVEL_BUILD "Use current versions of major packages" OFF)


Added checks to flag macros

Added checks to flag macros

--- build/macros.cmake
+++ build/macros.cmake
@@ -193,16 +193,25 @@
 endmacro()

 macro(append_all_compiler_flag _flag)
+	if(NOT ${_flag} MATCHES "^(/|-)")
+		message(FATAL_ERROR "All MSVC and GCC flag start with a slash or dash: ${_flag}")
+	endif()
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
 endmacro()

 macro(append_debug_flag _flag)
+	if(NOT ${_flag} MATCHES "^(/|-)")
+		message(FATAL_ERROR "All MSVC and GCC flag start with a slash or dash: ${_flag}")
+	endif()
 	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${_flag}")
 	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${_flag}")
 endmacro()

 macro(append_release_flag _flag)
+	if(NOT ${_flag} MATCHES "^(/|-)")
+		message(FATAL_ERROR "All MSVC and GCC flag start with a slash or dash: ${_flag}")
+	endif()
 	set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${_flag}")
 	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${_flag}")
 	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${_flag}")
@@ -212,6 +221,9 @@
 endmacro()

 macro(replace_or_append_compiler_flag _flags_var _regex_str _flag_str)
+	if(NOT ${_flag_str} MATCHES "^(/|-)")
+		message(FATAL_ERROR "All MSVC and GCC flag start with a slash or dash: ${_flag_str}")
+	endif()
 	if(_regex_str MATCHES "IMPOSIBLE")
 		#Useful for one-line compiler-specific options
 	elseif(${_flags_var} MATCHES ${_regex_str})


Applied global replace to remaining warning flags

--- build/macros.cmake
+++ build/macros.cmake
@@ -322,11 +322,7 @@
 macro(set_advanced_warnings)
 	get_compiler_name(COMPILER)
 	if(COMPILER MATCHES "vc")
-		if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-			string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-		elseif(NOT CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Wall")
-		endif()
+		replace_or_append_all_flag("/W[[0-4]|all]" "/Wall")
 		append_all_compiler_flag("/sdl") #Security Development Lifecycle checks
 		append_debug_flag("/RTCc") #Smaller type checks
 		add_definitions(-D_ALLOW_RTCc_IN_STL) #Acknowledge STL does not support this check
@@ -340,7 +336,7 @@

 		append_release_flag("/wd4711") #Function selected for automatic inline expansion
 	elseif(COMPILER MATCHES "gcc")
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -pedantic")
+		append_all_compiler_flag("-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -pedantic")
 	else()
 		message(FATAL_ERROR "Compiler not recognized: ${COMPILER}")
 	endif()


Bugfix

Bugfix

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31110 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_custom_targets.cmake
+++ deal.II/cmake/setup_custom_targets.cmake
@@ -18,7 +18,7 @@
 # Add convenience targets that build and install only a specific component:
 #

-FOREACH(_component library examples)
+FOREACH(_component library)
   ADD_CUSTOM_TARGET(${_component}
     COMMAND ${CMAKE_COMMAND}
       -DCOMPONENT="${_component}" -P cmake_install.cmake
@@ -27,7 +27,7 @@
     )
 ENDFOREACH()

-FOREACH(_component compat_files documentation mesh_converter parameter_gui)
+FOREACH(_component compat_files documentation examples mesh_converter parameter_gui)
   STRING(TOUPPER "${_component}" _component_uppercase)
   IF(DEAL_II_COMPONENT_${_component_uppercase})


bump version number

bump version number

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,2 +1,2 @@
 # This version number is loaded by the package and the project.
-SET( VERSION "0.9.5" )
+SET( VERSION "0.10.0" )


Install deps using cget instead of cmake-get (#922)

--- install_deps.cmake
+++ install_deps.cmake
@@ -1,4 +1,12 @@
 #!/usr/bin/cmake -P
+
+function(cget_exec)
+    execute_process(${ARGN} RESULT_VARIABLE RESULT)
+    if(NOT RESULT EQUAL 0)
+        message("${RESULT}")
+        message(FATAL_ERROR "Process failed: ${ARGN}")
+    endif()
+endfunction()

 set(ARGS)
 foreach(i RANGE 3 ${CMAKE_ARGC})
@@ -34,73 +42,79 @@

 get_filename_component(PREFIX ${_PREFIX} ABSOLUTE)

-find_package(CMakeGet QUIET PATHS ${PREFIX})
+find_program(VIRTUALENV_PYTHON_EXE python3)
+if(NOT VIRTUALENV_PYTHON_EXE)
+    find_program(VIRTUALENV_PYTHON_EXE python)
+endif()

-if(NOT CMakeGet_FOUND)
-    set(FILENAME ${PREFIX}/tmp/cmake-get-install.cmake)
-    file(DOWNLOAD https://raw.githubusercontent.com/pfultz2/cmake-get/master/install.cmake ${FILENAME} STATUS RESULT_LIST)
-    list(GET RESULT_LIST 0 RESULT)
-    list(GET RESULT_LIST 1 RESULT_MESSAGE)
-    if(NOT RESULT EQUAL 0)
-        message(FATAL_ERROR "Download for install.cmake failed: ${RESULT_MESSAGE}")
-    endif()
-    execute_process(COMMAND ${CMAKE_COMMAND} -P ${FILENAME} ${PREFIX})
-    file(REMOVE ${FILENAME})
-    find_package(CMakeGet REQUIRED PATHS ${PREFIX})
-endif()
+function(virtualenv_create)
+    cget_exec(
+        COMMAND ${VIRTUALENV_PYTHON_EXE} -m venv ${PREFIX}
+    )
+endfunction()
+
+function(virtualenv_install)
+    virtualenv_create()
+    # TODO: Check result
+    message("${PREFIX}/pip install ${ARGN}")
+    cget_exec(
+        COMMAND ${PREFIX}/bin/python ${PREFIX}/bin/pip install ${ARGN}
+    )
+endfunction()
+
+virtualenv_install(cget)

 # Set compiler to hcc if not set
 if(NOT DEFINED ENV{CXX} AND NOT DEFINED CMAKE_CXX_COMPILER AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
-    find_program(HCC hcc
+    find_program(CLANGXX clang++
         PATHS
-            /opt/rocm/hcc
+            /opt/rocm/llvm
             /opt/rocm
         PATH_SUFFIXES
             bin
     )
-    if(HCC)
-        set(ENV{CXX} ${HCC})
+    if(CLANGXX)
+        set(ENV{CXX} ${CLANGXX})
     else()
-	    message(STATUS "Cannot find hcc")
-        find_program(CLANGXX clang++
-            PATHS
-                /opt/rocm/llvm
-                /opt/rocm
-            PATH_SUFFIXES
-                bin
-        )
-        if(CLANGXX)
-            set(ENV{CXX} ${CLANGXX})
-        else()
-            message(FATAL_ERROR "Cannot find clang++")
-        endif()
+        message(FATAL_ERROR "Cannot find clang++")
     endif()
 endif()

 if(NOT DEFINED ENV{CC} AND NOT DEFINED CMAKE_C_COMPILER AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
     find_program(CLANGC clang
-	    PATHS
-	        /opt/rocm/llvm
-		    /opt/rocm
-	    PATH_SUFFIXES
-	        bin
-	)
-	if(CLANGC)
-	    set(ENV{CC} ${CLANGC})
-	else()
+        PATHS
+            /opt/rocm/llvm
+            /opt/rocm
+        PATH_SUFFIXES
+            bin
+    )
+    if(CLANGC)
+        set(ENV{CC} ${CLANGC})
+    else()
         message(STATUS "Cannot find clang to set to CC")
-	endif()
+    endif()
 endif()

-cmake_get(pfultz2/rocm-recipes PREFIX ${PREFIX} CMAKE_ARGS ${PARSE_UNPARSED_ARGUMENTS})
+function(cget)
+    cget_exec(COMMAND ${PREFIX}/bin/cget -p ${PREFIX} ${ARGN})
+endfunction()

+# Clean directory
+# Skip clean since relative symlinks are incorrectly removed
+# cget(clean -y)
+
+set(TOOLCHAIN_FLAG)
+if(DEFINED CMAKE_TOOLCHAIN_FILE)
+    set(TOOLCHAIN_FLAG -t ${CMAKE_TOOLCHAIN_FILE})
+endif()
+# Initialize directory
+cget(init ${TOOLCHAIN_FLAG} -DCMAKE_INSTALL_RPATH=${PREFIX}/lib ${PARSE_UNPARSED_ARGUMENTS})
+
+# Install dependencies
+cget(install -U pfultz2/rocm-recipes)
 if(PARSE_--minimum)
-    message(STATUS "MIOpen minimum dependency install.")
-    set(REQFILE ${CMAKE_CURRENT_LIST_DIR}/min-requirements.txt)
+    cget(install -U -f min-requirements.txt)
 else()
-    message(STATUS "MIOpen normal dependency install.")
-    set(REQFILE ${CMAKE_CURRENT_LIST_DIR}/requirements.txt)
+    cget(install -U -f requirements.txt)
 endif()
-
-cmake_get_from(${REQFILE} PREFIX ${PREFIX} CMAKE_ARGS -DCMAKE_INSTALL_RPATH=${PREFIX}/lib ${PARSE_UNPARSED_ARGUMENTS})


fPIC check is not conditional on language being wrapped

Configurations which only build static libraries do not require the
fPIC flag. So the check for the required flag only occours when a
language is enabled which requires shared libraries.

--- CMake/SITKLanguageOptions.cmake
+++ CMake/SITKLanguageOptions.cmake
@@ -11,9 +11,10 @@

 # for wrapping to wrok correctly fPIC is needed on certain system.
 macro(check_PIC_flag Language)
-  if ( UNIX AND NOT APPLE )
+  string( TOUPPER ${Language} LANGUAGE )
+  if ( UNIX AND NOT APPLE AND WRAP_${LANGUAGE} )
     if ( NOT ${CMAKE_CXX_FLAGS} MATCHES "-fPIC")
-      message ( FATAL_ERROR "${Language} wrapping requires CMAKE_CXX_FLAGS (or equivalent) to include -fPIC and ITK built with this flag" )
+      message ( FATAL_ERROR "${Language} wrapping requires CMAKE_CXX_FLAGS (or equivalent) to include -fPIC and ITK built with this flag." )
     endif()
   endif()
 endmacro()
@@ -38,8 +39,8 @@
   PYTHON_INCLUDE_DIR
 #  PYTHON_INCLUDE_PATH ( depricated )
    )
+option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )
 check_PIC_flag ( Python )
-option( WRAP_PYTHON "Wrap Python" ${WRAP_PYTHON_DEFAULT} )

 find_package ( Java COMPONENTS Development Runtime QUIET )
 find_package ( JNI QUIET )
@@ -48,7 +49,6 @@
 else ( ${JAVA_FOUND} AND ${JNI_FOUND} )
   set( WRAP_JAVA_DEFAULT OFF )
 endif ( ${JAVA_FOUND} AND ${JNI_FOUND} )
-check_PIC_flag ( Java )
 list( APPEND SITK_LANGUAGES_VARS
   Java_JAVA_EXECUTABLE
   Java_JAVAC_EXECUTABLE
@@ -71,6 +71,7 @@

   )
 option ( WRAP_JAVA "Wrap Java" ${WRAP_JAVA_DEFAULT} )
+check_PIC_flag ( Java )

 find_package ( TCL QUIET )
 if ( ${TCL_FOUND} )
@@ -102,6 +103,7 @@
   RUBY_FOUND
   RUBY_INCLUDE_PATH )
 option ( WRAP_RUBY "Wrap Ruby" ${WRAP_RUBY_DEFAULT} )
+check_PIC_flag ( Ruby )

 find_package( CSharp QUIET )
 if ( ${CSHARP_FOUND} )


Manually add dependencies for test plugins.

--- CMake/ctkMacroBuildPlugin.cmake
+++ CMake/ctkMacroBuildPlugin.cmake
@@ -77,6 +77,14 @@
   SET(Plugin-SymbolicName )
   SET(Plugin-Vendor )
   SET(Plugin-Version )
+
+  IF(MY_TEST_PLUGIN)
+    # Since the test plug-ins are not considered when calculating
+    # target dependencies via DGraph, we add the dependencies
+    # manually here
+    #MESSAGE("${lib_name}_DEPENDENCIES ${MY_TARGET_LIBRARIES}")
+    LIST(APPEND ${lib_name}_DEPENDENCIES ${MY_TARGET_LIBRARIES})
+  ENDIF()

   # If a file named manifest_headers.cmake exists, read it
   SET(manifest_headers_dep )


Added extra search paths to add compatibility with Kubuntu/Ubuntu 14.04 now locaton for freetype

--- CMakeModules/FindFreeType.cmake
+++ CMakeModules/FindFreeType.cmake
@@ -48,7 +48,7 @@
   /opt/csw
   /opt
   /usr/freeware
-  PATH_SUFFIXES include
+  PATH_SUFFIXES include include/freetype2
 )

 FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
@@ -61,6 +61,20 @@
   PATH_SUFFIXES include/freetype2
 )
 FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
+  /usr/local/include/freetype2
+  /usr/include/freetype2
+  /usr/local/X11R6/include/freetype2
+  /usr/local/X11/include/freetype2
+  /usr/X11R6/include/freetype2
+  /usr/X11/include/freetype2
+  /sw/include/freetype2
+  /opt/local/include/freetype2
+  /opt/csw/include/freetype2
+  /opt/include/freetype2
+  /usr/freeware/include/freetype2
+)
+
+FIND_PATH(FREETYPE_INCLUDE_DIR_freetype2 config/ftheader.h
   /usr/local/include/freetype2
   /usr/include/freetype2
   /usr/local/X11R6/include/freetype2


Yet another attept at fixing FindLibevent.cmake

--- CMakeModules/FindLibevent.cmake
+++ CMakeModules/FindLibevent.cmake
@@ -26,7 +26,7 @@
 )

 # On windows for some reason there are no distinct openssl and threading libs
-if (!WIN)
+if (NOT WIN32)
     find_Library(LIBEVENT_LIB_PTHREADS NAMES event_pthreads
         HINTS ${PC_LIBEVENT_LIBDIR} ${PC_LIBEVENT_LIBRARY_DIRS}
     )
@@ -34,7 +34,7 @@

 if (LIBEVENT_LIB AND LIBEVENT_LIB_CORE AND LIBEVENT_LIB_EXTRA)
     set(LIBEVENT_LIBRARIES ${LIBEVENT_LIB} ${LIBEVENT_LIB_CORE} ${LIBEVENT_LIB_EXTRA})
-    if (!WIN)
+    if (NOT WIN32)
         list(APPEND LIBEVENT_LIBRARIES ${LIBEVENT_LIB_OPENSSL} ${LIBEVENT_LIB_PTHREADS})
     endif()
     message(STATUS "libevent libs: ${LIBEVENT_LIBRARIES}")
@@ -49,7 +49,7 @@
     LIBEVENT_LIBRARIES LIBEVENT_INCLUDE_DIRS)

 mark_as_advanced(LIBEVENT_LIB LIBEVENT_LIB_CORE LIBEVENT_LIB_EXTRA)
-if (NOT WIN)
+if (NOT WIN32)
     mark_as_advanced(LIBEVENT_LIB_OPENSSL LIBEVENT_LIB_PTHREADS)
 endif()


SWDEV-273235 - Restore missing LinuxPro option

Change-Id: Iccc0206f3f2c5b3c03f6ed313537f0f364a4ca29

--- cmake/ROCclr.cmake
+++ cmake/ROCclr.cmake
@@ -91,6 +91,13 @@
   target_compile_definitions(rocclr PUBLIC ATI_OS_WIN)
 else()
   target_compile_definitions(rocclr PUBLIC ATI_OS_LINUX)
+
+  # Additional settings for LinuxPro
+  option(BUILD_LINUXPRO "Build LinuxPro" OFF)
+  if(BUILD_LINUXPRO)
+    target_compile_definitions(rocclr PUBLIC
+      ROCCLR_DISABLE_PREVEGA ROCCLR_ENABLE_GL_SHARING)
+  endif()
 endif()

 target_compile_definitions(rocclr PUBLIC


update CMake description for OSPRAY_TASKING_SYSTEM to be more accurate

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -346,7 +346,7 @@
   #ENDIF()

   SET(OSPRAY_TASKING_SYSTEM ${TASKING_DEFAULT} CACHE STRING
-      "Use TBB or OpenMP as for per-node thread tasking system")
+      "Per-node thread tasking system [TBB,OpenMP,Cilk,Debug]")

   SET_PROPERTY(CACHE OSPRAY_TASKING_SYSTEM PROPERTY
                STRINGS TBB ${CILK_STRING} OpenMP Debug)


ci cfg

ci cfg

--- cmake/shared.cmake
+++ cmake/shared.cmake
@@ -66,12 +66,12 @@
     if(MSVC)
         message("Using clang-cl")
         set(CLANG_CL 1)
-
-        #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -std=c++14 -Xclang -Wno-missing-braces -Xclang -Wmissing-field-initializers")#	-Xclang -fsanitize=alignment")
-
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14 /GX")
-
-		#add_definitions(-DJSON_NOEXCEPTION)
+
+		if(CMAKE_GENERATOR MATCHES "Visual Studio")
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++14 /GX")
+		else()
+			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -std=c++14 -Xclang -Wno-missing-braces -Xclang -Wmissing-field-initializers")#	-Xclang -fsanitize=alignment")
+		endif()

         if(BUILD_SANITIZE_MEMORY)
             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Xclang -fsanitize=alignment")


Use gcc 10 on darwin.

Use gcc 10 on darwin.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -278,8 +278,8 @@
   unset(DEFAULT_CMAKE_CXX_COMPILER)
   if(NOT DEFINED VESPA_COMPILER_VARIANT OR VESPA_COMPILER_VARIANT STREQUAL "gcc")
     if(APPLE)
-      set(DEFAULT_CMAKE_C_COMPILER "/usr/local/bin/gcc-9")
-      set(DEFAULT_CMAKE_CXX_COMPILER "/usr/local/bin/g++-9")
+      set(DEFAULT_CMAKE_C_COMPILER "/usr/local/bin/gcc-10")
+      set(DEFAULT_CMAKE_CXX_COMPILER "/usr/local/bin/g++-10")
     endif()
   elseif(VESPA_COMPILER_VARIANT STREQUAL "clang")
     if(APPLE)


Set default ITK modules configuration as override-able variables

Use the mechanism which passes ITK/Module_ITK prefixed CMake variables
to the external ITK project. Implemented for the Review module and the
build default modules options.  This allows the user to disable
arbitrary ITK modules in the SimpleITK Superbuild, and have SimpleITK
not wrap them to create a smaller ( faster build ) of SimpleITK.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -10,6 +10,15 @@
     ON)
   mark_as_advanced(ITK_USE_64BITS_IDS)
 endif()
+
+if(NOT DEFINED ITK_BUILD_DEFAULT_MODULES)
+  set(ITK_BUILD_DEFAULT_MODULES ON)
+endif()
+
+if(NOT DEFINED Module_ITKReview)
+  set(Module_ITKReview ON)
+endif()
+

 get_cmake_property( _varNames VARIABLES )

@@ -80,8 +89,6 @@
   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
   -DITK_LEGACY_REMOVE:BOOL=ON
   -DITK_USE_KWSTYLE:BOOL=OFF
-  -DITK_BUILD_DEFAULT_MODULES:BOOL=ON
-  -DModule_ITKReview:BOOL=ON
   -DITK_USE_GIT_PROTOCOL:BOOL=${ITK_USE_GIT_PROTOCOL}
   BUILD_COMMAND ${BUILD_COMMAND_STRING}
   DEPENDS


Update ITK Superbuild version along 4.13 release  branch

This include a patch for fix some CMake warnings.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -52,7 +52,7 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-set(ITK_GIT_TAG "4a6e8c84198a741d18a2a39e616c26dda09b6686" CACHE
+set(ITK_GIT_TAG "8bbd7e7ac6ee71932bfb4b00a34c70f1ac02f7e7" CACHE
   STRING "Tag in ITK git repo") # release-4.13
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


use ITK 4.6.1 for superbuild

use ITK 4.6.1 for superbuild

Change-Id: I9698732985fc4b08662efc9b3d0ca5649b77c8a0

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -2,7 +2,7 @@
 # Get and build itk

 if( NOT ITK_TAG )
-  set( ITK_TAG "v4.6.0" )
+  set( ITK_TAG "v4.6.1" )
 endif()

 set( _vtk_args )


Packaging: use "macos" rather than something like "universal-mac-os-x-10.15.2".

Indeed, no point/need to distinguish between the different version of macOS.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -202,11 +202,7 @@
   if(WIN32)
     set(SYSTEM_NAME "Windows" )
   elseif(APPLE)
-    execute_process(COMMAND sw_vers -productName RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE PRODUCT_NAME )
-    string(STRIP ${PRODUCT_NAME} PRODUCT_NAME )
-    execute_process(COMMAND sw_vers -productVersion RESULT_VARIABLE COMMAND_RESULT OUTPUT_VARIABLE PRODUCT_VERSION )
-    string(STRIP ${PRODUCT_VERSION} PRODUCT_VERSION )
-    string(REPLACE " " "-" SYSTEM_NAME "${PRODUCT_NAME} ${PRODUCT_VERSION}" )
+    set(SYSTEM_NAME "macOS" )
   elseif(UNIX)
     find_program(LSB lsb_release DOC "Distribution information tool")
     mark_as_advanced(LSB)


ClangTidy: don't need the readability-use-anyofallof in the end.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -190,7 +190,7 @@
       -readability-convert-member-functions-to-static
       -readability-magic-numbers
       -readability-qualified-auto
-      -readability-use-anyofallof
+#      -readability-use-anyofallof
       ${_DISABLED_READABILITY_CHECKS}
     )
     string(REPLACE ";" ","


do not add -Wno-reserved-id-macro to warnings for XCode < 7.0.0

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -101,8 +101,13 @@
       -Wno-global-constructors
       -Wno-missing-prototypes
       -Wno-padded
-      -Wno-reserved-id-macro
     )
+    if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 7.0.0)
+      set(_COMPILE_OPTIONS
+        ${_COMPILE_OPTIONS}
+        -Wno-reserved-id-macro
+      )
+    endif()

   if(NOT "${_TARGET}" STREQUAL "cellml")
     list(APPEND _COMPILE_OPTIONS


Update cotire to 1.7.9

Update cotire to 1.7.9

--- cmake/cotire.cmake
+++ cmake/cotire.cmake
@@ -43,7 +43,7 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.8")
+set (COTIRE_CMAKE_MODULE_VERSION "1.7.9")

 # activate select policies
 if (POLICY CMP0025)
@@ -450,22 +450,21 @@
 		endforeach()
 	endif()
 	# handle language standard properties
-	if (_target)
-		get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
-		get_target_property(_targetLanguageExtensions ${_target} ${_language}_EXTENSIONS)
-		get_target_property(_targetLanguageStandardRequired ${_target} ${_language}_STANDARD_REQUIRED)
-		if (_targetLanguageExtensions)
-			if (CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION)
-				list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageExtensions}_EXTENSION_COMPILE_OPTION}")
-			endif()
-		elseif (_targetLanguageStandard)
-			if (_targetLanguageStandardRequired)
-				if (CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION)
-					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_STANDARD_COMPILE_OPTION}")
-				endif()
-			else()
-				if (CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION)
-					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_EXTENSION_COMPILE_OPTION}")
+	if (CMAKE_${_language}_STANDARD_DEFAULT)
+		# used compiler supports language standard levels
+		if (_target)
+			get_target_property(_targetLanguageStandard ${_target} ${_language}_STANDARD)
+			if (_targetLanguageStandard)
+				set (_type "EXTENSION")
+				get_property(_isSet TARGET ${_target} PROPERTY ${_language}_EXTENSIONS SET)
+				if (_isSet)
+					get_target_property(_targetUseLanguageExtensions ${_target} ${_language}_EXTENSIONS)
+					if (NOT _targetUseLanguageExtensions)
+						set (_type "STANDARD")
+					endif()
+				endif()
+				if (CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION)
+					list (APPEND _compileFlags "${CMAKE_${_language}${_targetLanguageStandard}_${_type}_COMPILE_OPTION}")
 				endif()
 			endif()
 		endif()
@@ -627,6 +626,25 @@
 	list (REMOVE_DUPLICATES _systemIncludeDirs)
 	if (CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES)
 		list (REMOVE_ITEM _includeDirs ${CMAKE_${_language}_IMPLICIT_INCLUDE_DIRECTORIES})
+	endif()
+	if (WIN32)
+		# convert Windows paths in include directories to CMake paths
+		if (_includeDirs)
+			set (_paths "")
+			foreach (_dir ${_includeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_includeDirs ${_paths})
+		endif()
+		if (_systemIncludeDirs)
+			set (_paths "")
+			foreach (_dir ${_systemIncludeDirs})
+				file (TO_CMAKE_PATH "${_dir}" _path)
+				list (APPEND _paths "${_path}")
+			endforeach()
+			set (_systemIncludeDirs ${_paths})
+		endif()
 	endif()
 	if (COTIRE_DEBUG AND _includeDirs)
 		message (STATUS "Target ${_target} include dirs: ${_includeDirs}")
@@ -1184,7 +1202,7 @@

 function (cotire_scan_includes _includesVar)
 	set(_options "")
-	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES)
+	set(_oneValueArgs COMPILER_ID COMPILER_EXECUTABLE COMPILER_ARG1 COMPILER_VERSION LANGUAGE UNPARSED_LINES SCAN_RESULT)
 	set(_multiValueArgs COMPILE_DEFINITIONS COMPILE_FLAGS INCLUDE_DIRECTORIES SYSTEM_INCLUDE_DIRECTORIES
 		IGNORE_PATH INCLUDE_PATH IGNORE_EXTENSIONS INCLUDE_PRIORITY_PATH COMPILER_LAUNCHER)
 	cmake_parse_arguments(_option "${_options}" "${_oneValueArgs}" "${_multiValueArgs}" ${ARGN})
@@ -1256,6 +1274,9 @@
 	set (${_includesVar} ${_includes} PARENT_SCOPE)
 	if (_option_UNPARSED_LINES)
 		set (${_option_UNPARSED_LINES} ${_unparsedLines} PARENT_SCOPE)
+	endif()
+	if (_option_SCAN_RESULT)
+		set (${_option_SCAN_RESULT} ${_result} PARENT_SCOPE)
 	endif()
 endfunction()

@@ -1444,12 +1465,13 @@
 		INCLUDE_PATH ${_option_INCLUDE_PATH}
 		IGNORE_EXTENSIONS ${_option_IGNORE_EXTENSIONS}
 		INCLUDE_PRIORITY_PATH ${_option_INCLUDE_PRIORITY_PATH}
-		UNPARSED_LINES _unparsedLines)
+		UNPARSED_LINES _unparsedLines
+		SCAN_RESULT _scanResult)
 	cotire_generate_unity_source("${_prefixFile}"
 		PROLOGUE ${_prologue} EPILOGUE ${_epilogue} LANGUAGE "${_option_LANGUAGE}" ${_selectedHeaders})
 	set (_unparsedLinesFile "${_prefixFile}.log")
 	if (_unparsedLines)
-		if (COTIRE_VERBOSE OR NOT _selectedHeaders)
+		if (COTIRE_VERBOSE OR _scanResult OR NOT _selectedHeaders)
 			list (LENGTH _unparsedLines _skippedLineCount)
 			message (STATUS "${_skippedLineCount} line(s) skipped, see ${_unparsedLinesFile}")
 		endif()
@@ -1856,10 +1878,31 @@
 	endif()
 	get_target_property(_launcher ${_target} ${_language}_COMPILER_LAUNCHER)
 	if (CMAKE_${_language}_COMPILER MATCHES "ccache" OR _launcher MATCHES "ccache")
-		if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros|pch_defines")
-			set (${_msgVar}
-				"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
-				PARENT_SCOPE)
+		if (DEFINED ENV{CCACHE_SLOPPINESS})
+			if (NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "pch_defines" OR NOT "$ENV{CCACHE_SLOPPINESS}" MATCHES "time_macros")
+				set (${_msgVar}
+					"ccache requires the environment variable CCACHE_SLOPPINESS to be set to \"pch_defines,time_macros\"."
+					PARENT_SCOPE)
+			endif()
+		else()
+			if (_launcher MATCHES "ccache")
+				get_filename_component(_ccacheExe "${_launcher}" REALPATH)
+			else()
+				get_filename_component(_ccacheExe "${CMAKE_${_language}_COMPILER}" REALPATH)
+			endif()
+			execute_process(
+				COMMAND "${_ccacheExe}" "--print-config"
+				WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+				RESULT_VARIABLE _result
+				OUTPUT_VARIABLE _ccacheConfig OUTPUT_STRIP_TRAILING_WHITESPACE
+				ERROR_QUIET)
+			if (_result OR NOT
+				_ccacheConfig MATCHES "sloppiness.*=.*time_macros" OR NOT
+				_ccacheConfig MATCHES "sloppiness.*=.*pch_defines")
+				set (${_msgVar}
+					"ccache requires configuration setting \"sloppiness\" to be set to \"pch_defines,time_macros\"."
+					PARENT_SCOPE)
+			endif()
 		endif()
 	endif()
 	if (APPLE)
@@ -2206,14 +2249,18 @@
 			else()
 				file (RELATIVE_PATH _pchFileLogPath "${CMAKE_BINARY_DIR}" "${_pchFile}")
 			endif()
+			# make precompiled header compilation depend on the actual compiler executable used to force
+			# re-compilation when the compiler executable is updated. This prevents "created by a different GCC executable"
+			# warnings when the precompiled header is included.
+			get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 			if (COTIRE_DEBUG)
-				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
+				message (STATUS "add_custom_command: OUTPUT ${_pchFile} ${_cmds} DEPENDS ${_prefixFile} ${_realCompilerExe} IMPLICIT_DEPENDS ${_language} ${_prefixFile}")
 			endif()
 			set_property (SOURCE "${_pchFile}" PROPERTY GENERATED TRUE)
 			add_custom_command(
 				OUTPUT "${_pchFile}"
 				COMMAND ${_cmds}
-				DEPENDS "${_prefixFile}"
+				DEPENDS "${_prefixFile}" "${_realCompilerExe}"
 				IMPLICIT_DEPENDS ${_language} "${_prefixFile}"
 				WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 				COMMENT "Building ${_language} precompiled header ${_pchFileLogPath}"
@@ -2445,8 +2492,12 @@
 	cotire_set_cmd_to_prologue(_prefixCmd)
 	list (APPEND _prefixCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "prefix" "${_targetScript}" "${_prefixFile}" ${_unityFiles})
 	set_property (SOURCE "${_prefixFile}" PROPERTY GENERATED TRUE)
+	# make prefix header generation depend on the actual compiler executable used to force
+	# re-generation when the compiler executable is updated. This prevents "file not found"
+	# errors for compiler version specific system header files.
+	get_filename_component(_realCompilerExe "${CMAKE_${_language}_COMPILER}" ABSOLUTE)
 	if (COTIRE_DEBUG)
-		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources}")
+		message (STATUS "add_custom_command: OUTPUT ${_prefixFile} COMMAND ${_prefixCmd} DEPENDS ${_unityFile} ${_dependencySources} ${_realCompilerExe}")
 	endif()
 	if (MSVC_IDE)
 		file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileLogPath)
@@ -2478,7 +2529,7 @@
 	add_custom_command(
 		OUTPUT "${_prefixFile}" "${_prefixFile}.log"
 		COMMAND ${_prefixCmd}
-		DEPENDS ${_unityFiles} ${_dependencySources}
+		DEPENDS ${_unityFiles} ${_dependencySources} "${_realCompilerExe}"
 		COMMENT "${_comment}"
 		WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
 		VERBATIM)
@@ -2639,10 +2690,12 @@
 			set (${_targetLanguagesVar} "" PARENT_SCOPE)
 			return()
 		endif()
-		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND NOT "${CMAKE_${_language}_COMPILER_ID}" STREQUAL "")
-			cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
-			if (_disableMsg)
-				set (_targetUsePCH FALSE)
+		if (_targetUsePCH AND "${_language}" MATCHES "^C|CXX$" AND DEFINED CMAKE_${_language}_COMPILER_ID)
+			if (CMAKE_${_language}_COMPILER_ID)
+				cotire_check_precompiled_header_support("${_language}" "${_target}" _disableMsg)
+				if (_disableMsg)
+					set (_targetUsePCH FALSE)
+				endif()
 			endif()
 		endif()
 		set (_sourceFiles "")
@@ -2857,6 +2910,16 @@
 	endif()
 endfunction()

+function (cotire_filter_object_libraries _target _objectLibrariesVar)
+	set (_objectLibraries "")
+	foreach (_source ${ARGN})
+		if (_source MATCHES "^\\$<TARGET_OBJECTS:.+>$")
+			list (APPEND _objectLibraries "${_source}")
+		endif()
+	endforeach()
+	set (${_objectLibrariesVar} ${_objectLibraries} PARENT_SCOPE)
+endfunction()
+
 function (cotire_collect_unity_target_sources _target _languages _unityTargetSourcesVar)
 	get_target_property(_targetSourceFiles ${_target} SOURCES)
 	set (_unityTargetSources ${_targetSourceFiles})
@@ -2875,6 +2938,15 @@
 			list (APPEND _unityTargetSources ${_unityFiles})
 		endif()
 	endforeach()
+	get_target_property(_linkLibrariesStrategy ${_target} COTIRE_UNITY_LINK_LIBRARIES_INIT)
+	if ("${_linkLibrariesStrategy}" MATCHES "^COPY_UNITY$")
+		cotire_filter_object_libraries(${_target} _objectLibraries ${_targetSourceFiles})
+		if (_objectLibraries)
+			cotire_map_libraries("${_linkLibrariesStrategy}" _unityObjectLibraries ${_objectLibraries})
+			list (REMOVE_ITEM _unityTargetSources ${_objectLibraries})
+			list (APPEND _unityTargetSources ${_unityObjectLibraries})
+		endif()
+	endif()
 	set (${_unityTargetSourcesVar} ${_unityTargetSources} PARENT_SCOPE)
 endfunction()

@@ -2933,9 +3005,16 @@
 	else()
 		add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
 	endif()
-	if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
-		# depend on the original target's implicity generated <targetname>_automoc target
-		add_dependencies(${_unityTargetName} ${_target}_automoc)
+	if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+		# depend on original target's automoc target, if it exists
+		if (TARGET ${_target}_automoc)
+			add_dependencies(${_unityTargetName} ${_target}_automoc)
+		endif()
+	else()
+		if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
+			# depend on the original target's implicity generated <targetname>_automoc target
+			add_dependencies(${_unityTargetName} ${_target}_automoc)
+		endif()
 	endif()
 	# copy output location properties
 	set (_outputDirProperties
@@ -2990,7 +3069,8 @@
 		POSITION_INDEPENDENT_CODE
 		C_COMPILER_LAUNCHER CXX_COMPILER_LAUNCHER
 		C_INCLUDE_WHAT_YOU_USE CXX_INCLUDE_WHAT_YOU_USE
-		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN)
+		C_VISIBILITY_PRESET CXX_VISIBILITY_PRESET VISIBILITY_INLINES_HIDDEN
+		C_CLANG_TIDY CXX_CLANG_TIDY)
 	# copy compile features
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		C_EXTENSIONS C_STANDARD C_STANDARD_REQUIRED
@@ -3013,7 +3093,8 @@
 		LINK_INTERFACE_MULTIPLICITY LINK_INTERFACE_MULTIPLICITY_<CONFIG>
 		LINK_SEARCH_START_STATIC LINK_SEARCH_END_STATIC
 		STATIC_LIBRARY_FLAGS STATIC_LIBRARY_FLAGS_<CONFIG>
-		NO_SONAME SOVERSION VERSION)
+		NO_SONAME SOVERSION VERSION
+		LINK_WHAT_YOU_USE)
 	# copy cmake stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		IMPLICIT_DEPENDS_INCLUDE_TRANSFORM RULE_LAUNCH_COMPILE RULE_LAUNCH_CUSTOM RULE_LAUNCH_LINK)
@@ -3036,7 +3117,9 @@
 		VS_SCC_AUXPATH VS_SCC_LOCALPATH VS_SCC_PROJECTNAME VS_SCC_PROVIDER
 		VS_WINDOWS_TARGET_PLATFORM_MIN_VERSION
 		VS_WINRT_COMPONENT VS_WINRT_EXTENSIONS VS_WINRT_REFERENCES
-		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS)
+		WIN32_EXECUTABLE WINDOWS_EXPORT_ALL_SYMBOLS
+		DEPLOYMENT_REMOTE_DIRECTORY VS_CONFIGURATION_TYPE
+		VS_SDK_REFERENCES)
 	# copy Android platform specific stuff
 	cotire_copy_set_properites("${_configurations}" TARGET ${_target} ${_unityTargetName}
 		ANDROID_API ANDROID_API_MIN ANDROID_GUI
@@ -3151,9 +3234,15 @@
 		if (_library MATCHES "^\\$<LINK_ONLY:(.+)>$")
 			set (_libraryName "${CMAKE_MATCH_1}")
 			set (_linkOnly TRUE)
+			set (_objectLibrary FALSE)
+		elseif (_library MATCHES "^\\$<TARGET_OBJECTS:(.+)>$")
+			set (_libraryName "${CMAKE_MATCH_1}")
+			set (_linkOnly FALSE)
+			set (_objectLibrary TRUE)
 		else()
 			set (_libraryName "${_library}")
 			set (_linkOnly FALSE)
+			set (_objectLibrary FALSE)
 		endif()
 		if ("${_strategy}" MATCHES "COPY_UNITY")
 			cotire_is_target_supported(${_libraryName} _isSupported)
@@ -3163,6 +3252,8 @@
 				if (TARGET "${_libraryUnityTargetName}")
 					if (_linkOnly)
 						list (APPEND _mappedLibraries "$<LINK_ONLY:${_libraryUnityTargetName}>")
+					elseif (_objectLibrary)
+						list (APPEND _mappedLibraries "$<TARGET_OBJECTS:${_libraryUnityTargetName}>")
 					else()
 						list (APPEND _mappedLibraries "${_libraryUnityTargetName}")
 					endif()


CMake: copy libortools to .libs in pyhon package

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -114,7 +114,7 @@
 	COMMAND ${CMAKE_COMMAND} -E echo "  cmdclass={'install': InstallPlatlib}," >> setup.py
 	COMMAND ${CMAKE_COMMAND} -E echo "  packages=find_packages()," >> setup.py
 	COMMAND ${CMAKE_COMMAND} -E echo "  package_data={" >> setup.py
-	COMMAND ${CMAKE_COMMAND} -E echo "  'ortools':[$<$<NOT:$<PLATFORM_ID:Windows>>:'../$<TARGET_SONAME_FILE_NAME:ortools>'>]," >> setup.py
+	COMMAND ${CMAKE_COMMAND} -E echo "  'ortools':[$<$<NOT:$<PLATFORM_ID:Windows>>:'.libs/*', '../$<TARGET_SONAME_FILE_NAME:ortools>'>]," >> setup.py
 	COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.constraint_solver':['$<TARGET_FILE_NAME:_pywrapcp>']," >> setup.py
 	COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.linear_solver':['$<TARGET_FILE_NAME:_pywraplp>']," >> setup.py
 	COMMAND ${CMAKE_COMMAND} -E echo "  'ortools.sat':['$<TARGET_FILE_NAME:_pywrapsat>']," >> setup.py


cdash...

cdash...

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

--- Numerics/cmake/DartConfig.cmake
+++ Numerics/cmake/DartConfig.cmake
@@ -1,14 +1,11 @@
-IF(WITH_DART_IRISA)
-  SET (DROP_METHOD "xmlrpc")
-  SET (DROP_SITE "http://dart.irisa.fr")
-  SET (DROP_LOCATION "Siconos")
-  SET (COMPRESS_SUBMISSION ON)
-  SET (NIGHTLY_START_TIME "9:00PM")
-ELSE(WITH_DART_IRISA)
-  SET(CTEST_PROJECT_NAME "Siconos")
-  SET(NIGHTLY_START_TIME "00:00:00 EST")
-  SET(DROP_METHOD "http")
-  SET(DROP_SITE "cdash.inria.fr")
-  SET(DROP_LOCATION "/CDash/submit.php?project=Siconos")
-  SET(DROP_SITE_CDASH TRUE)
-ENDIF(WITH_DART_IRISA)
+SET(CTEST_PROJECT_NAME "Siconos")
+SET(NIGHTLY_START_TIME "20:00:00 CEST")
+SET(DROP_METHOD "http")
+SET(DROP_SITE "cdash.inria.fr")
+SET(DROP_LOCATION "/CDash/submit.php?project=Siconos")
+SET(DROP_SITE_CDASH TRUE)
+SET(CTEST_DROP_METHOD "http")
+SET(CTEST_DROP_SITE "cdash.inria.fr")
+SET(CTEST_DROP_LOCATION "/CDash/submit.php?project=Siconos")
+SET(CTEST_DROP_SITE_CDASH TRUE)
+


use the pcl cmake config file to configure pcl

--- cMake/UseLibPackCLbundler.cmake
+++ cMake/UseLibPackCLbundler.cmake
@@ -67,61 +67,65 @@
 endif(FREECAD_USE_FREETYPE)

 link_directories(${FREECAD_LIBPACK_DIR}/lib)
-set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7)
-set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib)
+find_package(PCL)
+if(NOT EXISTS ${PCL_INCLUDE_DIRS})
+  set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7)
+  set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib)

-set(PCL_COMMON_LIBRARIES optimized pcl_common_release debug pcl_common_debug)
-set(PCL_FEATURES_LIBRARIES optimized pcl_features_release debug pcl_features_debug)
-set(PCL_FILTERS_LIBRARIES optimized pcl_filters_release debug pcl_filters_debug)
-set(PCL_IO_LIBRARIES optimized pcl_io_release debug pcl_io_debug)
-set(PCL_IO_PLY_LIBRARIES optimized pcl_io_ply_release debug pcl_io_ply_debug)
-set(PCL_KDTREE_LIBRARIES optimized pcl_kdtree_release debug pcl_kdtree_debug)
-set(PCL_KEYPOINTS_LIBRARIES optimized pcl_keypoints_release debug pcl_keypoints_debug)
-set(PCL_ML_LIBRARIES optimized pcl_ml_release debug pcl_ml_debug)
-set(PCL_OCTREE_LIBRARIES optimized pcl_octree_release debug pcl_octree_debug)
-set(PCL_RECOGNITION_LIBRARIES optimized pcl_recognition_release debug pcl_recognition_debug)
-set(PCL_REGISTRATION_LIBRARIES optimized pcl_registration_release debug pcl_registration_debug)
-set(PCL_SAMPLE_CONSENSUS_LIBRARIES optimized pcl_sample_consensus_release debug pcl_sample_consensus_debug)
-set(PCL_SEARCH_LIBRARIES optimized pcl_search_release debug pcl_search_debug)
-set(PCL_SEGMENTATION_LIBRARIES optimized pcl_segmentation_release debug pcl_segmentation_debug)
-set(PCL_STEREO_LIBRARIES optimized pcl_stereo_release debug pcl_stereo_debug)
-set(PCL_SURFACE_LIBRARIES optimized pcl_surface_release debug pcl_surface_debug)
-set(PCL_TRACKING_LIBRARIES optimized pcl_tracking_release debug pcl_tracking_debug)
+  set(PCL_COMMON_LIBRARIES optimized pcl_common_release debug pcl_common_debug)
+  set(PCL_FEATURES_LIBRARIES optimized pcl_features_release debug pcl_features_debug)
+  set(PCL_FILTERS_LIBRARIES optimized pcl_filters_release debug pcl_filters_debug)
+  set(PCL_IO_LIBRARIES optimized pcl_io_release debug pcl_io_debug)
+  set(PCL_IO_PLY_LIBRARIES optimized pcl_io_ply_release debug pcl_io_ply_debug)
+  set(PCL_KDTREE_LIBRARIES optimized pcl_kdtree_release debug pcl_kdtree_debug)
+  set(PCL_KEYPOINTS_LIBRARIES optimized pcl_keypoints_release debug pcl_keypoints_debug)
+  set(PCL_ML_LIBRARIES optimized pcl_ml_release debug pcl_ml_debug)
+  set(PCL_OCTREE_LIBRARIES optimized pcl_octree_release debug pcl_octree_debug)
+  set(PCL_RECOGNITION_LIBRARIES optimized pcl_recognition_release debug pcl_recognition_debug)
+  set(PCL_REGISTRATION_LIBRARIES optimized pcl_registration_release debug pcl_registration_debug)
+  set(PCL_SAMPLE_CONSENSUS_LIBRARIES optimized pcl_sample_consensus_release debug pcl_sample_consensus_debug)
+  set(PCL_SEARCH_LIBRARIES optimized pcl_search_release debug pcl_search_debug)
+  set(PCL_SEGMENTATION_LIBRARIES optimized pcl_segmentation_release debug pcl_segmentation_debug)
+  set(PCL_STEREO_LIBRARIES optimized pcl_stereo_release debug pcl_stereo_debug)
+  set(PCL_SURFACE_LIBRARIES optimized pcl_surface_release debug pcl_surface_debug)
+  set(PCL_TRACKING_LIBRARIES optimized pcl_tracking_release debug pcl_tracking_debug)

-set(PCL_LIBRARIES
-    ${PCL_COMMON_LIBRARIES}
-    ${PCL_FEATURES_LIBRARIES}
-    ${PCL_FILTERS_LIBRARIES}
-    ${PCL_IO_LIBRARIES}
-    ${PCL_IO_PLY_LIBRARIES}
-    ${PCL_KDTREE_LIBRARIES}
-    ${PCL_KEYPOINTS_LIBRARIES}
-    ${PCL_ML_LIBRARIES}
-    ${PCL_OCTREE_LIBRARIES}
-    ${PCL_RECOGNITION_LIBRARIES}
-    ${PCL_REGISTRATION_LIBRARIES}
-    ${PCL_SAMPLE_CONSENSUS_LIBRARIES}
-    ${PCL_SEARCH_LIBRARIES}
-    ${PCL_SEGMENTATION_LIBRARIES}
-    ${PCL_STEREO_LIBRARIES}
-    ${PCL_SURFACE_LIBRARIES}
-    ${PCL_TRACKING_LIBRARIES}
-)
-set(PCL_FOUND TRUE)
-set(PCL_COMMON_FOUND TRUE)
-set(PCL_FEATURES_FOUND TRUE)
-set(PCL_FILTERS_FOUND TRUE)
-set(PCL_IO_FOUND TRUE)
-set(PCL_IO_PLY_FOUND TRUE)
-set(PCL_KDTREE_FOUND TRUE)
-set(PCL_KEYPOINTS_FOUND TRUE)
-set(PCL_ML_FOUND TRUE)
-set(PCL_OCTREE_FOUND TRUE)
-set(PCL_RECOGNITION_FOUND TRUE)
-set(PCL_REGISTRATION_FOUND TRUE)
-set(PCL_SAMPLE_CONSENSUS_FOUND TRUE)
-set(PCL_SEARCH_FOUND TRUE)
-set(PCL_SEGMENTATION_FOUND TRUE)
-set(PCL_STEREO_FOUND TRUE)
-set(PCL_SURFACE_FOUND TRUE)
-set(PCL_TRACKING_FOUND TRUE)
+  set(PCL_LIBRARIES
+      ${PCL_COMMON_LIBRARIES}
+      ${PCL_FEATURES_LIBRARIES}
+      ${PCL_FILTERS_LIBRARIES}
+      ${PCL_IO_LIBRARIES}
+      ${PCL_IO_PLY_LIBRARIES}
+      ${PCL_KDTREE_LIBRARIES}
+      ${PCL_KEYPOINTS_LIBRARIES}
+      ${PCL_ML_LIBRARIES}
+      ${PCL_OCTREE_LIBRARIES}
+      ${PCL_RECOGNITION_LIBRARIES}
+      ${PCL_REGISTRATION_LIBRARIES}
+      ${PCL_SAMPLE_CONSENSUS_LIBRARIES}
+      ${PCL_SEARCH_LIBRARIES}
+      ${PCL_SEGMENTATION_LIBRARIES}
+      ${PCL_STEREO_LIBRARIES}
+      ${PCL_SURFACE_LIBRARIES}
+      ${PCL_TRACKING_LIBRARIES}
+  )
+  set(PCL_FOUND TRUE)
+  set(PCL_COMMON_FOUND TRUE)
+  set(PCL_FEATURES_FOUND TRUE)
+  set(PCL_FILTERS_FOUND TRUE)
+  set(PCL_IO_FOUND TRUE)
+  set(PCL_IO_PLY_FOUND TRUE)
+  set(PCL_KDTREE_FOUND TRUE)
+  set(PCL_KEYPOINTS_FOUND TRUE)
+  set(PCL_ML_FOUND TRUE)
+  set(PCL_OCTREE_FOUND TRUE)
+  set(PCL_RECOGNITION_FOUND TRUE)
+  set(PCL_REGISTRATION_FOUND TRUE)
+  set(PCL_SAMPLE_CONSENSUS_FOUND TRUE)
+  set(PCL_SEARCH_FOUND TRUE)
+  set(PCL_SEGMENTATION_FOUND TRUE)
+  set(PCL_STEREO_FOUND TRUE)
+  set(PCL_SURFACE_FOUND TRUE)
+  set(PCL_TRACKING_FOUND TRUE)
+endif()
+


Add cuda libraries to LIBRARIES and add include dir and other cuda settings.

--- add_dependencies.cmake
+++ add_dependencies.cmake
@@ -10,7 +10,12 @@

 find_package(CUDA 7.0 REQUIRED)
 set(CUDA_SEPARABLE_COMPILATION ON)
-set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 -std=c++11 -gencode arch=compute_30,code=sm_30)
+set(CUDA_VERBOSE_BUILD ON)
+set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS};-O3 -gencode arch=compute_30,code=sm_30)
+add_definitions(-DUSECUDA)
+include_directories(${CUDA_INCLUDE_DIRS})
+list(APPEND LIBRARIES ${CUDA_LIB})
+list(APPEND LIBRARIES ${CUDA_LIBRARIES})

 find_package(OpenGL REQUIRED)
 include_directories(${OpenGL_INCLUDE_DIRS})


Force -swift-version 3 for Standard Library and overlays.

--- cmake/modules/SwiftSource.cmake
+++ cmake/modules/SwiftSource.cmake
@@ -268,6 +268,11 @@
     endif()
   endif()

+  # Force swift 3 compatibility mode for Standard Library and overlay.
+  if (SWIFTFILE_IS_STDLIB_CORE OR SWIFTFILE_IS_SDK_OVERLAY)
+    list(APPEND swift_flags "-swift-version" "3")
+  endif()
+
   if(SWIFTFILE_IS_SDK_OVERLAY)
     list(APPEND swift_flags "-autolink-force-load")
   endif()


Configure iOS build to use c++14

Configure iOS build to use c++14

--- toolchains/iOS.cmake
+++ toolchains/iOS.cmake
@@ -7,7 +7,7 @@
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
     -fobjc-abi-version=2
     -fobjc-arc
-    -std=gnu++11
+    -std=c++14
     -stdlib=libc++
     -isysroot ${CMAKE_IOS_SDK_ROOT}")
 set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")


Fixed FUSE api detection

Fixed FUSE api detection

--- cmake/FindFUSE.cmake
+++ cmake/FindFUSE.cmake
@@ -30,7 +30,7 @@
         file(READ "${FUSE_INCLUDE_DIR}/fuse/fuse_common.h" _FUSE_COMMON_H_CONTENTS)
         string(REGEX REPLACE "^(.*\n)?#define[ \t]+FUSE_MINOR_VERSION[ \t]+([0-9]+).*"
                 "\\2" FUSE_MINOR_VERSION ${_FUSE_COMMON_H_CONTENTS})
-        if( FUSE_MINOR_VERSION GREATER_EQUAL 6)
+        if( FUSE_MINOR_VERSION AND FUSE_MINOR_VERSION GREATER 5)
             set(FUSE_API_VERSION 26)
         else()
             set(FUSE_API_VERSION 21)
@@ -83,4 +83,4 @@
     FUSE_LIBRARIES FUSE_INCLUDE_DIR FUSE_API_VERSION)

-mark_as_advanced (FUSE_INCLUDE_DIR FUSE_LIBRARIES)+mark_as_advanced (FUSE_INCLUDE_DIR FUSE_LIBRARIES)


Fix FindMaya.cmake

Fix FindMaya.cmake

- switch PATHS to HINTS to make sure that we pick up the correct location for various files & libs
- fix the list append to dereference variables properly
- minor code style cleanup

fixes #266

--- cmake/FindMaya.cmake
+++ cmake/FindMaya.cmake
@@ -51,54 +51,60 @@
 #  License text for the above reference.)

 if(APPLE)
-    find_path(MAYA_BASE_DIR ../../devkit/include/maya/MFn.h PATH
-        ${MAYA_LOCATION}
-        $ENV{MAYA_LOCATION}
-        "/Applications/Autodesk/maya2014/Maya.app/Contents"
-        "/Applications/Autodesk/maya2013.5/Maya.app/Contents"
-        "/Applications/Autodesk/maya2013/Maya.app/Contents"
-        "/Applications/Autodesk/maya2012.17/Maya.app/Contents"
-        "/Applications/Autodesk/maya2012/Maya.app/Contents"
-        "/Applications/Autodesk/maya2011/Maya.app/Contents"
-        "/Applications/Autodesk/maya2010/Maya.app/Contents"
+    find_path(MAYA_BASE_DIR
+            ../../devkit/include/maya/MFn.h
+        HINTS
+            ${MAYA_LOCATION}
+            $ENV{MAYA_LOCATION}
+            "/Applications/Autodesk/maya2014/Maya.app/Contents"
+            "/Applications/Autodesk/maya2013.5/Maya.app/Contents"
+            "/Applications/Autodesk/maya2013/Maya.app/Contents"
+            "/Applications/Autodesk/maya2012.17/Maya.app/Contents"
+            "/Applications/Autodesk/maya2012/Maya.app/Contents"
+            "/Applications/Autodesk/maya2011/Maya.app/Contents"
+            "/Applications/Autodesk/maya2010/Maya.app/Contents"
     )
     find_path(MAYA_LIBRARY_DIR libOpenMaya.dylib
-        PATHS
+        HINTS
             ${MAYA_LOCATION}
             $ENV{MAYA_LOCATION}
             ${MAYA_BASE_DIR}
         PATH_SUFFIXES
             Maya.app/contents/MacOS/
-        DOC
+        DOC
             "Maya's libraries path"
     )
 endif(APPLE)

 if(UNIX)
-    find_path(MAYA_BASE_DIR include/maya/MFn.h PATH
-        ${MAYA_LOCATION}
-        $ENV{MAYA_LOCATION}
-        "/usr/autodesk/maya2013-x64"
-        "/usr/autodesk/maya2012.17-x64"
-        "/usr/autodesk/maya2012-x64"
-        "/usr/autodesk/maya2011-x64"
-        "/usr/autodesk/maya2010-x64"
-    )
-    find_path(MAYA_LIBRARY_DIR libOpenMaya.so
-        PATHS
+    find_path(MAYA_BASE_DIR
+            include/maya/MFn.h
+        HINTS
+            ${MAYA_LOCATION}
+            $ENV{MAYA_LOCATION}
+            "/usr/autodesk/maya2013-x64"
+            "/usr/autodesk/maya2012.17-x64"
+            "/usr/autodesk/maya2012-x64"
+            "/usr/autodesk/maya2011-x64"
+            "/usr/autodesk/maya2010-x64"
+    )
+    find_path(MAYA_LIBRARY_DIR
+            libOpenMaya.so
+        HINTS
             ${MAYA_LOCATION}
             $ENV{MAYA_LOCATION}
             ${MAYA_BASE_DIR}
         PATH_SUFFIXES
             lib/
-        DOC
+        DOC
             "Maya's libraries path"
     )
 endif(UNIX)

 if(WIN32)
-    find_path(MAYA_BASE_DIR include/maya/MFn.h
-        PATH
+    find_path(MAYA_BASE_DIR
+            include/maya/MFn.h
+        HINTS
             ${MAYA_LOCATION}
             $ENV{MAYA_LOCATION}
             "C:/Program Files/Autodesk/Maya2013.5-x64"
@@ -122,46 +128,50 @@
             "C:/Program Files (x86)/Autodesk/Maya2010"
             "C:/Autodesk/maya-2010x64"
     )
-    find_path(MAYA_LIBRARY_DIR OpenMaya.lib
-        PATHS
+    find_path(MAYA_LIBRARY_DIR
+            OpenMaya.lib
+        HINTS
             ${MAYA_LOCATION}
             $ENV{MAYA_LOCATION}
             ${MAYA_BASE_DIR}
         PATH_SUFFIXES
             lib/
-        DOC
+        DOC
             "Maya's libraries path"
     )
 endif(WIN32)

-find_path(MAYA_INCLUDE_DIR maya/MFn.h
-    PATHS
+find_path(MAYA_INCLUDE_DIR
+        maya/MFn.h
+    HINTS
         ${MAYA_LOCATION}
         $ENV{MAYA_LOCATION}
         ${MAYA_BASE_DIR}
     PATH_SUFFIXES
         ../../devkit/include/
         include/
-    DOC
+    DOC
         "Maya's devkit headers path"
 )

-find_path(MAYA_LIBRARY_DIR OpenMaya
-    PATHS
+find_path(MAYA_LIBRARY_DIR
+        OpenMaya
+    HINTS
         ${MAYA_LOCATION}
         $ENV{MAYA_LOCATION}
         ${MAYA_BASE_DIR}
     PATH_SUFFIXES
         ../../devkit/include/
         include/
-    DOC
+    DOC
         "Maya's devkit headers path"
 )

 list(APPEND MAYA_INCLUDE_DIRS ${MAYA_INCLUDE_DIR})

-find_path(MAYA_DEVKIT_INC_DIR GL/glext.h
-    PATHS
+find_path(MAYA_DEVKIT_INC_DIR
+       GL/glext.h
+    HINTS
         ${MAYA_LOCATION}
         $ENV{MAYA_LOCATION}
         ${MAYA_BASE_DIR}
@@ -186,25 +196,28 @@
     cg
     cgGL)

-    find_library(MAYA_${MAYA_LIB}_LIBRARY ${MAYA_LIB}
-        PATHS
+    find_library(MAYA_${MAYA_LIB}_LIBRARY
+            ${MAYA_LIB}
+        HINTS
             ${MAYA_LOCATION}
             $ENV{MAYA_LOCATION}
             ${MAYA_BASE_DIR}
         PATH_SUFFIXES
             MacOS/
             lib/
-        DOC
+        DOC
             "Maya's ${MAYA_LIB} library path"
     )

+
     if (MAYA_${MAYA_LIB}_LIBRARY)
-        list(APPEND ${MAYA_LIBRARIES} MAYA_${MAYA_LIB}_LIBRARY)
+        list(APPEND MAYA_LIBRARIES ${MAYA_${MAYA_LIB}_LIBRARY})
     endif()
 endforeach(MAYA_LIB)

-find_program(MAYA_EXECUTABLE maya
-    PATHS
+find_program(MAYA_EXECUTABLE
+        maya
+    HINTS
         ${MAYA_LOCATION}
         $ENV{MAYA_LOCATION}
         ${MAYA_BASE_DIR}
@@ -226,11 +239,11 @@
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(Maya
-    REQUIRED_VARS
-        ${MAYA_LIBRARIES}
-        MAYA_EXECUTABLE
+find_package_handle_standard_args(Maya
+    REQUIRED_VARS
+        MAYA_EXECUTABLE
         MAYA_INCLUDE_DIRS
+        MAYA_LIBRARIES
     VERSION_VAR
-        MAYA_API_VERSION
-)
+        MAYA_API_VERSION
+)


Explicitly filter libm in findOTF2. Fixes #45.

CMake. Such fun. Much wow.

--- cmake/FindOTF2.cmake
+++ cmake/FindOTF2.cmake
@@ -48,7 +48,10 @@
         IF(${_ARG} MATCHES "^-l")
             STRING(REGEX REPLACE "^-l" "" _ARG "${_ARG}")
             STRING(STRIP "${_ARG}" _ARG)
-            # NO_DEFAULT_PATH - We have to "filter" -lm, as g++ links it anyways. And then stuff explodes
+            # We have to "filter" -lm, as g++ links it anyways. And then stuff explodes
+            IF(${_ARG} STREQUAL "m")
+                continue()
+            ENDIF()
             FIND_LIBRARY(_OTF2_LIB_FROM_ARG NAMES ${_ARG}
                 HINTS ${OTF2_LINK_DIRS} NO_DEFAULT_PATH
             )
@@ -80,7 +83,8 @@
         # Note for MacOS: libm is a symlink to libSystem, so there is no harm to link it anyways, but it isn't required
         INTERFACE_LINK_LIBRARIES "m"
     )
-
+    # make sure, if anyone uses the old interface, they still link libm
+    LIST(APPEND OTF2_LIBRARIES "m")
 else()
     unset(OTF2_PRINT)
     unset(OTF2_LINK_DIRS)


Add internal WebP compilation. Refactor libwebp folder.

--- cmake/FindWebP.cmake
+++ cmake/FindWebP.cmake
@@ -12,27 +12,27 @@
 #Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
 #
-#* Redistributions of source code must retain the above copyright notice,
+#* Redistributions of source code must retain the above copyright notice,
 #this list of conditions and the following disclaimer.
 #
-#* Redistributions in binary form must reproduce the above copyright notice,
-#this list of conditions and the following disclaimer in the documentation
+#* Redistributions in binary form must reproduce the above copyright notice,
+#this list of conditions and the following disclaimer in the documentation
 #and/or other materials provided with the distribution.
 #
-#* Neither the names of Kitware, Inc., the Insight Software Consortium, nor
-#the names of their contributors may be used to endorse or promote products
+#* Neither the names of Kitware, Inc., the Insight Software Consortium, nor
+#the names of their contributors may be used to endorse or promote products
 #derived from this software without specific prior written  permission.
 #
-#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+#LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 #POSSIBILITY OF SUCH DAMAGE.
 #=============================================================================

@@ -44,7 +44,7 @@
 FIND_LIBRARY(WEBP_LIBRARY NAMES webp)
 MARK_AS_ADVANCED(WEBP_LIBRARY)

-# handle the QUIETLY and REQUIRED arguments and set WEBFOUND_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set WEBFOUND_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WebP DEFAULT_MSG WEBP_LIBRARY WEBP_INCLUDE_DIR)
@@ -68,5 +68,5 @@
 endif()

 if(NOT _WEBP_COMPILATION_TEST)
-  message(FATAL_ERROR "You need libwebp 0.2.0 or later")
+  set( USE_INTERNAL_WEBP 1 )
 endif()


Open64 does not support the AVX intrinsics


fix copy-paste error: disable use of XOP on MSVC

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -293,7 +293,7 @@
       set(Vc_DEFINITIONS "${Vc_DEFINITIONS} -DNOMINMAX")

       # MSVC doesn't implement the XOP intrinsics
-      set(Vc_XOP_INTRINSICS_BROKEN false)
+      set(Vc_XOP_INTRINSICS_BROKEN true)
    elseif(Vc_COMPILER_IS_CLANG)
       # for now I don't know of any arguments I want to pass. -march and stuff is tried by OptimizeForArchitecture...


use single intel mkl dynamic library

use single intel mkl dynamic library

--- cmake/centos_6.cmake
+++ cmake/centos_6.cmake
@@ -30,7 +30,7 @@
 SET (BLAS_ARCHIVE
 #http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor
 #requires duplicate library for 1-pass linker
- $ENV{HOME}/anaconda/lib -Wl,--no-as-needed -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl
+ $ENV{HOME}/anaconda/lib -Wl,--no-as-needed -lmkl_rt -lpthread -lm -ldl
 )
 SET (ZLIB_ARCHIVE $ENV{HOME}/anaconda/lib/libz.a)
 SET (SQLITE3_ARCHIVE $ENV{HOME}/anaconda/lib/libsqlite3.a)


improve comments on find_package(Protobuf)

--- cmake/protobuf.cmake
+++ cmake/protobuf.cmake
@@ -53,6 +53,11 @@
   endif()
 elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package")
   find_package(Protobuf REQUIRED ${gRPC_PROTOBUF_PACKAGE_TYPE})
+
+  # {Protobuf,PROTOBUF}_FOUND is defined based on find_package type ("MODULE" vs "CONFIG").
+  # For "MODULE", the case has also changed between cmake 3.5 and 3.6.
+  # We use the legacy uppercase version for *_LIBRARIES AND *_INCLUDE_DIRS variables
+  # as newer cmake versions provide them too for backward compatibility.
   if(Protobuf_FOUND OR PROTOBUF_FOUND)
     if(TARGET protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME})
       set(_gRPC_PROTOBUF_LIBRARIES protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME})


Udpating to ITK tag v4.3.1

Udpating to ITK tag v4.3.1

Change-Id: Ia2c9a5c1ec0991ae12266ffaa1d1b96a852fcbc2

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -15,8 +15,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the
-# this is the has where the v4.3.1 tag will be
-set(ITK_TAG_COMMAND GIT_TAG 57a9c5f07019e113ed3eff855bacd08a0935cc36
+set(ITK_TAG_COMMAND GIT_TAG v4.3.1
  )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )


Fix compilation problem on Windows

Fix compilation problem on Windows

--- adm_local/cmake_files/FindSMESH.cmake
+++ adm_local/cmake_files/FindSMESH.cmake
@@ -40,3 +40,4 @@
 FIND_LIBRARY(StdMeshersGUI StdMeshersGUI ${SMESH_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(StdMeshers StdMeshers ${SMESH_ROOT_DIR}/lib/salome)
 FIND_LIBRARY(SMESHUtils SMESHUtils ${SMESH_ROOT_DIR}/lib/salome)
+FIND_LIBRARY(MeshDriverGMF MeshDriverGMF ${SMESH_ROOT_DIR}/lib/salome)


xc/xc7: Add NeTV2 xc7a100t variant to boards

Signed-off-by: Jan Kowalewski <2e8e4e3eff87a9260f1f165e4a72a8840d9a1b45@antmicro.com>

--- xc/xc7/boards.cmake
+++ xc/xc7/boards.cmake
@@ -96,6 +96,13 @@
   PART xc7a100tcsg324-1
 )

+add_xc_board(
+  BOARD netv2-a100t
+  DEVICE xc7a100t
+  PACKAGE test
+  PART xc7a100tfgg484-2
+)
+
 # TODO: https://github.com/SymbiFlow/symbiflow-arch-defs/issues/344
 add_xc_board(
   BOARD zybo


Defined _DEBUG

Defined _DEBUG

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

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

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


ccpi framework branch

ccpi framework branch

--- version_config.cmake
+++ version_config.cmake
@@ -203,7 +203,7 @@
   set(CIL_VERSION "v19.07")
   set(RGL_VERSION "19.06")
   set(DEFAULT_CCPi-Framework_URL https://github.com/vais-ral/CCPi-Framework.git)
-  set(DEFAULT_CCPi-Framework_TAG ${CIL_VERSION})
+  set(DEFAULT_CCPi-Framework_TAG origin/finite_diff_for_sirf)
   set(DEFAULT_CCPi-RGL_URL https://github.com/vais-ral/CCPi-Regularisation-Toolkit.git )
   set(DEFAULT_CCPi-RGL_TAG "${RGL_VERSION}")
   set(DEFAULT_CCPi-FrameworkPlugins_URL https://github.com/vais-ral/CCPi-FrameworkPlugins.git)


[ioninja] release 3.4.5

[ioninja] release 3.4.5

[axl] release 5.3.8
[jancy] release 1.5.7

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     1)
 set (VERSION_MINOR     5)
-set (VERSION_REVISION  6)
+set (VERSION_REVISION  7)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")


FindLLVM: allow LLVM/Clang 3.7

FindLLVM: allow LLVM/Clang 3.7

As beignet now works with LLVM/Clang 3.7, accept this version
when searching for llvm-config.

Signed-off-by: Rebecca Palmer <2decb937e7eca5e941ec22bc308fd452fe4ab2bb@zoho.com>
Reviewed-by: Yang Rong <78759e37dc7114caed18f74e7515c5cb519dbf6d@intel.com>

--- CMake/FindLLVM.cmake
+++ CMake/FindLLVM.cmake
@@ -8,12 +8,12 @@
 # LLVM_FOUND       - True if llvm found.
 if (LLVM_INSTALL_DIR)
   find_program(LLVM_CONFIG_EXECUTABLE
-               NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
+               NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-37 llvm-config-3.7 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
                DOC "llvm-config executable"
                PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
 else (LLVM_INSTALL_DIR)
   find_program(LLVM_CONFIG_EXECUTABLE
-               NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
+               NAMES llvm-config-35 llvm-config-3.5 llvm-config-36 llvm-config-3.6 llvm-config-37 llvm-config-3.7 llvm-config-33 llvm-config-3.3 llvm-config-34 llvm-config-3.4 llvm-config
                DOC "llvm-config executable")
 endif (LLVM_INSTALL_DIR)


iox-#468 more explicit cmake warning

iox-#468 more explicit cmake warning

Signed-off-by: Dietrich Krönke <ea45bc0219d3b6c3a6b9cf3abdfa172e6bfa16ff@apex.ai>

--- iceoryx_utils/cmake/IceoryxDoxygen.cmake
+++ iceoryx_utils/cmake/IceoryxDoxygen.cmake
@@ -26,8 +26,11 @@
     if(EXISTS "/usr/share/plantuml/plantuml.jar")
         set(DOXYGEN_PLANTUML_JAR_PATH /usr/share/plantuml/plantuml.jar)
     else()
-        message(WARNING "plantuml.jar not found at '/usr/share/plantuml/', please set environment variable PLANTUML_JAR_PATH to the correct location.")
-        set(DOXYGEN_PLANTUML_JAR_PATH "$ENV{PLANTUML_JAR_PATH}" CACHE STRING "PLANTUML location." )
+        if(DEFINED $ENV{PLANTUML_JAR_PATH})
+            set(DOXYGEN_PLANTUML_JAR_PATH "$ENV{PLANTUML_JAR_PATH}" CACHE STRING "PLANTUML location.")
+        else()
+            message(WARNING "plantuml.jar not found at '/usr/share/plantuml/', please set environment variable PLANTUML_JAR_PATH to the correct location.")
+        endif()
     endif()

     set(DOXYGEN_ALIASES


GCC version check

GCC version check

--- CMakeCompilers.cmake
+++ CMakeCompilers.cmake
@@ -34,6 +34,11 @@

 # GNU compiler
 if (CMAKE_COMPILER_IS_GNUCXX)
+    exec_program(${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE _GCC_COMPILER_VERSION)
+    string(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
+                   _GCC_COMPILER_VERSION ${_GCC_COMPILER_VERSION})
+    message("-- GCC version -- ${_GCC_COMPILER_VERSION}")
+
     # first, add "-ggdb -g3" flag to generate more debug info
     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3 -ggdb")
     set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g3 -ggdb")
@@ -50,7 +55,11 @@
     endif (SE_ENABLE_GCOV)

     # set warning level
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused -Wno-missing-field-initializers -Wno-deprecated")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unused -Wno-deprecated")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused -Wno-uninitialized")

+    if (_GCC_COMPILER_VERSION STRGREATER "40")
+      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-missing-field-initializers")
+    endif (_GCC_COMPILER_VERSION STRGREATER "40")
+
 endif(CMAKE_COMPILER_IS_GNUCXX)


Fix for gli linking on unix systems.

Fix for gli linking on unix systems.

--- FindGLI.cmake
+++ FindGLI.cmake
@@ -3,20 +3,20 @@
 #
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
 # Software is furnished to do so, subject to the following conditions:
 #
-# The above copyright notice and this permission notice shall be included
+# The above copyright notice and this permission notice shall be included
 # in all copies or substantial portions of the Software.
 #
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 #==============================================================================
 #
@@ -25,7 +25,7 @@
 # GLI_FOUND, if true, library is found
 # GLI_INCLUDE_DIR, directory path where to find
 # 	GLI library directory with all necessary headers.
-#
+#
 # $GLI_ROOT is an environment variable that
 # would correspond to the installation path.
 #
@@ -36,8 +36,10 @@
 find_path(GLI_INCLUDE_DIR gli/gli.hpp
 	PATH_SUFFIXES include/gli
 	PATHS ${GLI_PATHS}
+  "/usr/include"
+  "/usr/local/include"
 )

 include(FindPackageHandleStandardArgs)

-find_package_handle_standard_args(GLI REQUIRED_VARS GLI_INCLUDE_DIR)+find_package_handle_standard_args(GLI REQUIRED_VARS GLI_INCLUDE_DIR)