hard-code boost search path in configure_boost

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

--- CMakeModules/ModuleSetup.cmake
+++ CMakeModules/ModuleSetup.cmake
@@ -151,8 +151,8 @@
         PREFIXES ${ENV_NAALI_DEP_PATH})

     if (MSVC)
-        set (BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ENV_NAALI_DEP_PATH}/include)
-        set (BOOST_LIBRARY_DIRS ${BOOST_LIBRARY_DIRS} ${ENV_NAALI_DEP_PATH}/lib)
+        set (BOOST_INCLUDE_DIRS ${BOOST_INCLUDE_DIRS} ${ENV_NAALI_DEP_PATH}/Boost/include)
+        set (BOOST_LIBRARY_DIRS ${BOOST_LIBRARY_DIRS} ${ENV_NAALI_DEP_PATH}/Boost/lib)
     endif ()

 endmacro (configure_boost)


Update build_forge.cmake

Update build_forge.cmake

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -39,7 +39,7 @@
     -DGLEW_LIBRARY:FILEPATH=${GLEW_LIBRARY}
     -DGLEWmx_LIBRARY:FILEPATH=${GLEWmx_LIBRARY}
     -DGLFW_INCLUDE_DIR:PATH=${GLFW_INCLUDE_DIR}
-    -DGLFW_LIBRARY=${GLFW_LIBRARY}
+    -DGLFW_LIBRARY:FILEPATH=${GLFW_LIBRARY}
     ${byproducts}
     )


Increment forge version/tag to 0.9.2

Increment forge version/tag to 0.9.2

--- CMakeModules/build_forge.cmake
+++ CMakeModules/build_forge.cmake
@@ -42,13 +42,13 @@
     SET(byproducts BYPRODUCTS ${forge_location})
 ENDIF()

-SET(FORGE_VERSION 0.9.1)
+SET(FORGE_VERSION 0.9.2)

 # FIXME Tag forge correctly during release
 ExternalProject_Add(
     forge-ext
     GIT_REPOSITORY https://github.com/arrayfire/forge.git
-    GIT_TAG devel
+    GIT_TAG v${FORGE_VERSION}
     PREFIX "${prefix}"
     INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""


Use different default INSTALL_CMAKE_DIR for WIN32

--- CMakeModules/FGInstallDirs.cmake
+++ CMakeModules/FGInstallDirs.cmake
@@ -40,7 +40,12 @@

 # CMake files
 if(NOT DEFINED FG_INSTALL_CMAKE_DIR)
-    set(FG_INSTALL_CMAKE_DIR "lib/cmake/Forge" CACHE PATH "Installation path for CMake files")
+    if(WIN32)
+        set(cmake_dir "cmake")
+    else()
+        set(cmake_dir "lib/cmake/Forge")
+    endif()
+    set(FG_INSTALL_CMAKE_DIR "${cmake_dir}" CACHE PATH "Installation path for CMake files")
 endif()

 # Use absolute paths (these changes are internal and will not show up in cache)


config for cx11

config for cx11

--- cxx11_check.cmake
+++ cxx11_check.cmake
@@ -12,7 +12,7 @@

     elseif( CMAKE_COMPILER_IS_GNUCXX )                  ### CNU

-        if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.6 )
+        if( ${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS 4.8 )
             set( ${VAR_ENABLED} 0 )
         endif( )


long range occ handling

long range occ handling

Change-Id: I736b32d64d286fe305fd13c0bdaba7dab6477993

--- VAD_Ceres.cmake
+++ VAD_Ceres.cmake
@@ -64,10 +64,11 @@
         "#undef ERROR\n#define MAX_LOG_LEVEL -1" FILECONTENT "${FILECONTENT}")
   file(WRITE "${VAD_EXTERNAL_ROOT}/Ceres/internal/ceres/miniglog/glog/logging.h" "${FILECONTENT}")

-  vad_add_var(EIGENSPARSE ON CACHE BOOL "" FORCE) #use Eigen (no additional deps required - but suitesparse should be faster!)
-  vad_add_var(MINIGLOG ON CACHE BOOL "" FORCE) #use miniglog
-  vad_add_var(EIGENSPARSE ON CACHE BOOL "" FORCE)
-  vad_add_var(BUILD_TESTING OFF CACHE BOOL "" FORCE)
+  vad_add_var(EIGENSPARSE ON) #use Eigen (no additional deps required - but suitesparse should be faster!)
+  vad_add_var(MINIGLOG ON) #use miniglog
+  vad_add_var(EIGENSPARSE ON)
+  vad_add_var(BUILD_TESTING OFF)
+  vad_add_var(BUILD_SHARED_LIBS ON)

   # TODO default seems to point to checkout out dir in source?!?
   add_subdirectory("${VAD_EXTERNAL_ROOT}/Ceres" "${CMAKE_BINARY_DIR}/external/Ceres")


BUG: Mantis-1474: fix cmake script syntax

--- Packaging/post_install.cmake
+++ Packaging/post_install.cmake
@@ -18,8 +18,7 @@
 # limitations under the License.
 #

-function(sanitize_system_paths)
-  cmake_parse_arguments(SANITIZE  "" "SOURCE" "" ${ARGN} )
+function(sanitize_system_paths input_file)
   # does not support Windows ...
   if(APPLE)
     set(SHARED_EXT "\\.dylib")
@@ -28,7 +27,7 @@
   endif()
   set(filtered_content)

-  file(STRINGS "${SANITIZE_SOURCE}" source_file_content NEWLINE_CONSUME)
+  file(STRINGS "${input_file}" source_file_content NEWLINE_CONSUME)
   string(REGEX REPLACE "\n" "\n;" source_file_content "${source_file_content}")
   set(SEARCH_REGEX "(^[^#\"]+(LIBRARIES|INCLUDE_DIR[A-Z]*) +\")(.+)(\"[^\"]*)")

@@ -65,7 +64,7 @@
   endforeach()

   string(REGEX REPLACE "\n;" "\n" filtered_content "${filtered_content}")
-  file(WRITE "${SANITIZE_SOURCE}" "${filtered_content}")
+  file(WRITE "${input_file}" "${filtered_content}")
 endfunction()

 #check variables are set
@@ -93,7 +92,7 @@
       \n${cmake_file_CONTENTS}")
     endif()
     if(UNIX)
-      sanitize_system_paths(SOURCE ${cmake_file})
+      sanitize_system_paths(${cmake_file})
     endif()
   endforeach() # foreach( cmake_file
 endforeach() # foreach( p_dir


COMP: UseITK: Fix configure error due to different subproject requirements

If within a project depending on ITK two subprojects A and B requires
different IO factories by calling:

  find_package(ITK COMPONENTS <list_of_modules> <list_of_io_factory> REQUIRED)
  include(${ITK_USE_FILE})

where <list_of_io_factory> is different for both projects. The second
project will use the list "Factory_${_factory_name}_formats" from the
first project and a "Module not found" error will be reported.

This commit addresses the problem by not caching the Factory_${_factory_name}_formats
variable.

The error was encountered while updating Slicer to build against an updated
ITK.

As a result of this patch, the correct way to specify which formats will be
statically registered when configuring a project is to specify the IO
components to load when calling
`find_package(ITK COMPONENTS <list_of_modules>)`.

Specific IO modules can be added to the list of modules even when using
lists of IO factories to enforce the requirement of these specific modules:

e.g.: `find_package(ITK COMPONENTS ITKCommon ITKImageIO ITKIONRRD REQUIRED)`

Change-Id: I3ad07d295bf16b7488b53e928e30d3b366d5aaa5

--- CMake/UseITK.cmake
+++ CMake/UseITK.cmake
@@ -207,14 +207,9 @@
 # Factory registration
 #-----------------------------------------------------------------------------
 foreach(_factory_name ${ITK_FACTORY_LIST})
-  set(Factory_${_factory_name}_formats ${ITK_${_factory_name}} CACHE STRING "List of formats to register to ${_factory_name}")
-  mark_as_advanced(Factory_${_factory_name}_formats)
-endforeach()
-
-foreach(_factory_name ${ITK_FACTORY_LIST})
   string(TOUPPER ${_factory_name} factory_uc)
   string(TOLOWER ${_factory_name} factory_lc)
-  foreach(_format ${Factory_${_factory_name}_formats})
+  foreach(_format ${ITK_${_factory_name}})
     set(Module )
     foreach(_module ${ITK_FACTORY_NAMES})
       string(REGEX MATCH "^.*::${_factory_name}::${_format}$" Module_Matched "${_module}")


remove 1.7.2

remove 1.7.2

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -94,7 +94,6 @@
 endif()

 set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}")
-set (COTIRE_CMAKE_MODULE_VERSION "1.7.2")
 set (COTIRE_CMAKE_MODULE_VERSION "1.7.3")

 include(CMakeParseArguments)


Added parent folder to library target name.

--- rosidl_generator_java/cmake/rosidl_generator_java_generate_interfaces.cmake
+++ rosidl_generator_java/cmake/rosidl_generator_java_generate_interfaces.cmake
@@ -189,7 +189,7 @@
   set(_generated_msg_cpp_common_file "${_full_folder}/${_base_msg_name}.cpp")
   string(REGEX REPLACE "^rosidl_typesupport_" "" _short_typesupport_impl ${_typesupport_impl})
   set(_library_name
-    "${_base_msg_name}_${_short_typesupport_impl}"
+    "${_parent_folder}${_base_msg_name}${_short_typesupport_impl}"
   )
   set(_library_path
     "${_package_name}_${_parent_folder}_${_base_msg_name}__jni__${_typesupport_impl}"


Use v0.9.0 git-tag for SIRF

Use v0.9.0 git-tag for SIRF

--- SuperBuild/External_SIRF.cmake
+++ SuperBuild/External_SIRF.cmake
@@ -62,7 +62,7 @@
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY ${${proj}_URL}
-    GIT_TAG release-0.9.0
+    GIT_TAG v0.9.0
     SOURCE_DIR ${SOURCE_DOWNLOAD_CACHE}/${proj}

     CMAKE_ARGS


only use compiler launchers for Makefile and Ninja

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -844,7 +844,12 @@
 		set (_compilerArg1 ${CMAKE_${_language}_COMPILER_ARG1})
 	endif()
 	string (STRIP "${_compilerArg1}" _compilerArg1)
-	set (${_cmdVar} ${_compilerLauncher} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	if ("${CMAKE_GENERATOR}" MATCHES "Make|Ninja")
+		# compiler launcher is only supported for Makefile and Ninja
+		set (${_cmdVar} ${_compilerLauncher} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	else()
+		set (${_cmdVar} "${_compilerExe}" ${_compilerArg1} PARENT_SCOPE)
+	endif()
 endfunction()

 macro (cotire_add_definitions_to_cmd _cmdVar _language)


Updated jenkins cmake script

Updated jenkins cmake script

--- CTestJenkins.cmake
+++ CTestJenkins.cmake
@@ -8,7 +8,7 @@
 set(CTEST_BUILD_OPTIONS "${JENKINS_BUILD_OPTIONS}")
 set(CTEST_BUILD_CONFIGURATION "${JENKINS_BUILD_CONFIGURATION}")

-set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--xml=yes --xml-file=\"${CTEST_BINARY_DIRECTORY}/test_%p_memcheck.xml\"")
+set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--xml=yes --xml-file=${CTEST_BINARY_DIRECTORY}/test_%p_memcheck.xml")

 set(CTEST_COVERAGE_CXX_FLAGS "-DCMAKE_CXX_FLAGS:STRING=-fprofile-arcs -ftest-coverage")
 set(CTEST_COVERAGE_EXE_LD_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=-fprofile-arcs -ftest-coverage")


more defensive check for COMPILER_ID variable

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -2643,10 +2643,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 "")


updated copyright info

updated copyright info

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -95,7 +95,7 @@
   DIVISION_NAME    #<division-name>
   DIVISION_LOGO    #<division-logo>
   DIVISION_WEBSITE "http://www.github.com/ahundt/grl"
-  COPYRIGHT        "2015 Andrew Hundt, Alex Strickland, Shahriar Sefati"
+  COPYRIGHT        "2015-2016 Andrew Hundt et al"
   LICENSE          "BSD license, See COPYING file for license information."
   CONTACT          "Andrew Hundt <ATHundt@gmail.com>"
   TEMPLATE         "basis/1.1"


COMP: Need to include SlicerExecutionModel before Common.cmake

--- DTIPrepTools.cmake
+++ DTIPrepTools.cmake
@@ -13,6 +13,12 @@
   endforeach()
 endmacro()

+
+#-----------------------------------------------------------------------------
+find_package(SlicerExecutionModel NO_MODULE REQUIRED GenerateCLP)
+include(${GenerateCLP_USE_FILE})
+include(${SlicerExecutionModel_USE_FILE})
+include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)

 include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake)

@@ -88,12 +94,6 @@
 #-----------------------------------------------------------------------------
 find_package(VTK NO_MODULE REQUIRED)
 include(${VTK_USE_FILE})
-
-#-----------------------------------------------------------------------------
-find_package(SlicerExecutionModel NO_MODULE REQUIRED GenerateCLP)
-include(${GenerateCLP_USE_FILE})
-include(${SlicerExecutionModel_USE_FILE})
-include(${SlicerExecutionModel_CMAKE_DIR}/SEMMacroBuildCLI.cmake)

 #-----------------------------------------------------------------------
 # Setup locations to find externally maintained test data.


Fix test associated with HAVE_EPOLL by checking for the correct function.

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -256,7 +256,7 @@
 check_symbol_exists(ctermid      "${CFG_HEADERS}" HAVE_CTERMID)
 check_symbol_exists(ctermid_r    "${CFG_HEADERS}" HAVE_CTERMID_R)
 check_symbol_exists(dup2         "${CFG_HEADERS}" HAVE_DUP2)
-check_symbol_exists(epoll        "${CFG_HEADERS}" HAVE_EPOLL)
+check_symbol_exists(epoll_create "${CFG_HEADERS}" HAVE_EPOLL)
 check_symbol_exists(execv        "${CFG_HEADERS}" HAVE_EXECV)
 check_symbol_exists(fchdir       "${CFG_HEADERS}" HAVE_FCHDIR)
 check_symbol_exists(fchmod       "${CFG_HEADERS}" HAVE_FCHMOD)


Use GNU install directories, and rpath

Use GNU install directories, and rpath

Use the GNU install directories, and ensure the install rpath is set to
match. Warning - the prefix directory will need to be removed as lib is
always found before any other location (with CMake 2.8.11.1 at least).

Change-Id: I03e8fcd4a18a20bf5f8723c971faa90b50d31dd9

--- cmake/InstallLocation.cmake
+++ cmake/InstallLocation.cmake
@@ -4,27 +4,44 @@
 #
 # These paths attempt to adhere to the FHS, and are similar to those provided
 # by autotools and used in many Linux distributions.
+#
+# Use GNU install directories
+include(GNUInstallDirs)
 if(NOT INSTALL_RUNTIME_DIR)
-  set(INSTALL_RUNTIME_DIR "bin")
+  set(INSTALL_RUNTIME_DIR "${CMAKE_INSTALL_BINDIR}")
 endif()
 if(NOT INSTALL_LIBRARY_DIR)
-  set(INSTALL_LIBRARY_DIR "lib")
+  set(INSTALL_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_ARCHIVE_DIR)
-  set(INSTALL_ARCHIVE_DIR "lib")
+  set(INSTALL_ARCHIVE_DIR "${CMAKE_INSTALL_LIBDIR}")
 endif()
 if(NOT INSTALL_INCLUDE_DIR)
-  set(INSTALL_INCLUDE_DIR "include")
+  set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
 endif()
 if(NOT INSTALL_DATA_DIR)
-  set(INSTALL_DATA_DIR "share")
+  set(INSTALL_DATA_DIR "${CMAKE_INSTALL_DATAROOTDIR}")
 endif()
 if(NOT INSTALL_DOC_DIR)
-  set(INSTALL_DOC_DIR "${INSTALL_DATA_DIR}/doc")
+  set(INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}")
+endif()
+if(NOT INSTALL_MAN_DIR)
+  set(INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}")
+endif()
+if(UNIX AND NOT APPLE)
+  if(NOT INSTALL_XDG_APP_DIR)
+    set(INSTALL_XDG_APPS_DIR "${INSTALL_DATA_DIR}/applications")
+  endif()
+  if(NOT INSTALL_XDG_ICON_DIR)
+    set(INSTALL_XDG_ICON_DIR "${INSTALL_DATA_DIR}/pixmaps")
+  endif()
 endif()

 # Set up RPATH for the project too.
 option(ENABLE_RPATH "Enable rpath support on Linux and Mac" ON)
+if(NOT CMAKE_INSTALL_RPATH)
+  set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
+endif()
 if(UNIX AND ENABLE_RPATH)
   set(CMAKE_SKIP_BUILD_RPATH FALSE)
   set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)


Squashed '3rdparty/github/cmake-utils/' changes from 88c03287..b3d50043

b3d50043 inttypes.h repair +

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: b3d50043e10e0163b0b6c759a3884109c8e65496

--- cmake/MyPackageRepair.cmake
+++ cmake/MyPackageRepair.cmake
@@ -2,30 +2,31 @@
   #
   # We optionaly create a __fixme__.cmake
   #
+  SET (FIXME_CMAKE_SINGLETON FALSE)
+  SET (HAVE_STDINT_H FALSE)
+  SET (HAVE_INTTYPES_H FALSE)
   IF (NOT FIXME_CMAKE_SINGLETON)
-    GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)
-    MESSAGE(STATUS "Generating a __fixme__.cmake")
-    SET (FIXME_CMAKE "__fixme__.cmake")
-    GET_FILENAME_COMPONENT(FIXME_CMAKE_ABSOLUTE ${FIXME_CMAKE} ABSOLUTE)
-    FILE(WRITE ${FIXME_CMAKE_ABSOLUTE} "# CMake settings to be propagated whenever you want - typically used for ExternalProject_Add\n")
-    MARK_AS_ADVANCED (FIXME_CMAKE_ABSOLUTE)
-    SET (FIXME_CMAKE_SINGLETON TRUE CACHE BOOL "__fixme__.cmake singleton")
-    MARK_AS_ADVANCED (FIXME_CMAKE_SINGLETON)
-  ENDIF ()
-  IF ((NOT HAVE_STDINT_H) OR (NOT HAVE_INTTYPES_H))
-    GET_PROPERTY(source_dir_set GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR SET)
-    IF (NOT ${source_dir_set})
-      MESSAGE (WARNING "Cannot repair anything if any, property MYPACKAGE_SOURCE_DIR is not set")
-    ELSE ()
+    IF ((NOT HAVE_STDINT_H) OR (NOT HAVE_INTTYPES_H))
       GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)
-      SET(MYPACKAGE_GENERATED_INCLUDE_DIR "__generated_include_dir__")
-      FILE(MAKE_DIRECTORY ${MYPACKAGE_GENERATED_INCLUDE_DIR})
-      GET_FILENAME_COMPONENT(_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE ${MYPACKAGE_GENERATED_INCLUDE_DIR} ABSOLUTE)
-      INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})
-      MESSAGE(STATUS "Appending in ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
-      FILE(APPEND ${FIXME_CMAKE_ABSOLUTE} "MESSAGE(STATUS \"Append to INCLUDE_DIRECTORIES: ${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE}\")\n")
-      FILE(APPEND ${FIXME_CMAKE_ABSOLUTE} "INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})\n")
-      IF (NOT STDINT_H_SINGLETON)
+      MESSAGE(STATUS "Generating a __fixme__.cmake")
+      SET (FIXME_CMAKE "__fixme__.cmake")
+      GET_FILENAME_COMPONENT(FIXME_CMAKE_ABSOLUTE ${FIXME_CMAKE} ABSOLUTE)
+      FILE(WRITE ${FIXME_CMAKE_ABSOLUTE} "# CMake settings to be propagated whenever you want - typically used for ExternalProject_Add\n")
+      MARK_AS_ADVANCED (FIXME_CMAKE_ABSOLUTE)
+
+      GET_PROPERTY(source_dir_set GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR SET)
+      IF (NOT ${source_dir_set})
+        MESSAGE (WARNING "Cannot repair anything if any, property MYPACKAGE_SOURCE_DIR is not set")
+      ELSE ()
+        GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)
+        SET(MYPACKAGE_GENERATED_INCLUDE_DIR "__generated_include_dir__")
+        FILE(MAKE_DIRECTORY ${MYPACKAGE_GENERATED_INCLUDE_DIR})
+        GET_FILENAME_COMPONENT(_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE ${MYPACKAGE_GENERATED_INCLUDE_DIR} ABSOLUTE)
+        INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})
+        MESSAGE(STATUS "Appending in ${FIXME_CMAKE}: INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})")
+        FILE(APPEND ${FIXME_CMAKE_ABSOLUTE} "MESSAGE(STATUS \"Append to INCLUDE_DIRECTORIES: ${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE}\")\n")
+        FILE(APPEND ${FIXME_CMAKE_ABSOLUTE} "INCLUDE_DIRECTORIES(${_MYPACKAGE_GENERATED_INCLUDE_DIR_ABSOLUTE})\n")
+
         IF (NOT HAVE_STDINT_H)
           SET (STDINT_REPAIR_H ${MYPACKAGE_GENERATED_INCLUDE_DIR}/stdint.h)
           MESSAGE(STATUS "Generating a minimal stdint.h in ${STDINT_REPAIR_H}")
@@ -33,10 +34,7 @@
           SET (HAVE_STDINT_H TRUE CACHE BOOL "C stdint.h generated file")
           MARK_AS_ADVANCED (HAVE_STDINT_H)
         ENDIF ()
-        SET (STDINT_H_SINGLETON TRUE CACHE BOOL "C stdint.h repair singleton")
-        MARK_AS_ADVANCED (STDINT_H_SINGLETON)
-      ENDIF ()
-      IF (NOT INTTYPES_H_SINGLETON)
+
         IF (NOT HAVE_INTTYPES_H)
           SET (INTTYPES_REPAIR_H ${MYPACKAGE_GENERATED_INCLUDE_DIR}/inttypes.h)
           MESSAGE(STATUS "Generating a minimal inttypes.h in ${INTTYPES_REPAIR_H}")
@@ -44,9 +42,11 @@
           SET (HAVE_INTTYPES_H TRUE CACHE BOOL "C inttypes.h generated file")
           MARK_AS_ADVANCED (HAVE_INTTYPES_H)
         ENDIF ()
-        SET (INTTYPES_H_SINGLETON TRUE CACHE BOOL "C inttypes.h repair singleton")
-        MARK_AS_ADVANCED (INTTYPES_H_SINGLETON)
+
       ENDIF ()
     ENDIF ()
+
+    SET (FIXME_CMAKE_SINGLETON TRUE CACHE BOOL "__fixme__.cmake singleton")
+    MARK_AS_ADVANCED (FIXME_CMAKE_SINGLETON)
   ENDIF ()
 ENDMACRO()


Update default.cmake

Update default.cmake

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -199,6 +199,7 @@
 hunter_config(polyclipping VERSION 4.8.8-p0) # for Assimp
 hunter_config(presentproto VERSION 1.0)
 hunter_config(pthread-stubs VERSION 0.3)
+hunter_config(pugixml VERSION 1.8.1)
 hunter_config(rabbitmq-c VERSION 0.7.0-p1)
 hunter_config(randrproto VERSION 1.3.2)
 hunter_config(renderproto VERSION 0.11.1)


Fixed problem with array subscript is above array bounds in MKL-DNN jit_uni_reorder_utils.cpp:prb_simplify function

test=develop

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -45,7 +45,7 @@
 ELSE()
     MESSAGE(FATAL_ERROR "Should enable MKLML when build MKLDNN")
 ENDIF()
-SET(MKLDNN_FLAG "-Wno-error=strict-overflow -Wno-error=unused-result")
+SET(MKLDNN_FLAG "-Wno-error=strict-overflow -Wno-error=unused-result -Wno-error=array-bounds")
 SET(MKLDNN_FLAG "${MKLDNN_FLAG} -Wno-unused-result -Wno-unused-value")
 SET(MKLDNN_CFLAG "${CMAKE_C_FLAGS} ${MKLDNN_FLAG}")
 SET(MKLDNN_CXXFLAG "${CMAKE_CXX_FLAGS} ${MKLDNN_FLAG}")


add meesage and cmake cache arg

add meesage and cmake cache arg

--- cmake/external/mkldnn.cmake
+++ cmake/external/mkldnn.cmake
@@ -43,6 +43,7 @@
     SET(MKLDNN_MKLROOT   ${MKLML_ROOT})
     SET(MKLDNN_IOMP_LIB  ${MKLML_IOMP_LIB})
     SET(MKLDNN_IOMP_DIR  ${MKLML_LIB_DIR})
+    MESSAGE(STATUS "Build MKLDNN with ${MKLDNN_MKLROOT}")
 ENDIF()

 ExternalProject_Add(
@@ -56,6 +57,7 @@
     CMAKE_ARGS          -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR}
     CMAKE_ARGS          -DMKLROOT=${MKLDNN_MKLROOT}
     CMAKE_CACHE_ARGS    -DCMAKE_INSTALL_PREFIX:PATH=${MKLDNN_INSTALL_DIR}
+                        -DMKLROOT:PATH=${MKLDNN_MKLROOT}
 )

 ADD_LIBRARY(mkldnn SHARED IMPORTED GLOBAL)


CMake separate projects: use correct name for LIBRARY_OUTPUT_DIRECTORY_${suffix}.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -106,7 +106,7 @@
       string(REPLACE ${CMAKE_CFG_INTDIR} ${build_mode} li ${libdir})
       set_target_properties(${target} PROPERTIES "RUNTIME_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${bi})
       set_target_properties(${target} PROPERTIES "ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${li})
-      set_target_properties(${target} PROPERTIES "LIBDIR__OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${li})
+      set_target_properties(${target} PROPERTIES "LIBRARY_OUTPUT_DIRECTORY_${CONFIG_SUFFIX}" ${li})
     endforeach()
   else()
     set_target_properties(${target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${bindir})


[CMake][CMP0051] Avoid for user of objlib to use llvm_update_compile_flags().

$<TARGET_OBJECTS> shouldn't require compile flags. Flags are set in obj.${name}.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -399,7 +399,10 @@
   endif()

   set_output_directory(${name} ${LLVM_RUNTIME_OUTPUT_INTDIR} ${LLVM_LIBRARY_OUTPUT_INTDIR})
-  llvm_update_compile_flags(${name})
+  # $<TARGET_OBJECTS> doesn't require compile flags.
+  if(NOT obj_name)
+    llvm_update_compile_flags(${name})
+  endif()
   add_link_opts( ${name} )
   if(ARG_OUTPUT_NAME)
     set_target_properties(${name}
@@ -597,7 +600,10 @@
     set_windows_version_resource_properties(${name} ${windows_resource_file})
   endif()

-  llvm_update_compile_flags(${name})
+  # $<TARGET_OBJECTS> doesn't require compile flags.
+  if(NOT LLVM_ENABLE_OBJLIB)
+    llvm_update_compile_flags(${name})
+  endif()
   add_link_opts( ${name} )

   # Do not add -Dname_EXPORTS to the command-line when building files in this


Remove stray cmake message

Remove stray cmake message

--- cmake/modules/FindTBB.cmake
+++ cmake/modules/FindTBB.cmake
@@ -216,7 +216,6 @@
     if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};")

       # Search for the libraries
-      message(WARNING "find_library: TBB_${_comp}_LIBRARY_RELEASE -> ${_comp}${TBB_STATIC_SUFFIX}")
       find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp}${TBB_STATIC_SUFFIX}
           HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR}
           PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH


Adding guards around adding protobuf targets (#1997)

* Adding guards around adding protobuf targets

* Moving include_dirs add into target creation

--- cmake/public/protobuf.cmake
+++ cmake/public/protobuf.cmake
@@ -6,7 +6,7 @@
   find_package(Protobuf MODULE QUIET)
 endif()

-if (TARGET protobuf::libprotobuf)
+if ((TARGET protobuf::libprotobuf OR TARGET protobuf::libprotobuf-lite) AND TARGET protobuf::protoc)
   # Hooray. This is the most ideal situation, meaning that you either have a
   # Protobuf config file installed (like on Windows), or you are using a
   # modern CMake that ships with a FindProtobuf.cmake file that produces
@@ -18,31 +18,35 @@
   # content.
   message(STATUS "Caffe2: Found protobuf with old-style protobuf targets.")
   if(PROTOBUF_LIBRARY)
-    add_library(protobuf::libprotobuf UNKNOWN IMPORTED)
-    set_target_properties(protobuf::libprotobuf PROPERTIES
-      INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}")
+    if (NOT TARGET protobuf::libprotobuf)
+      add_library(protobuf::libprotobuf UNKNOWN IMPORTED)
+      set_target_properties(protobuf::libprotobuf PROPERTIES
+          INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}")
+    endif()
     if(EXISTS "${PROTOBUF_LIBRARY}")
       set_target_properties(protobuf::libprotobuf PROPERTIES
-        IMPORTED_LOCATION "${PROTOBUF_LIBRARY}")
+          IMPORTED_LOCATION "${PROTOBUF_LIBRARY}")
     endif()
     if(EXISTS "${PROTOBUF_LIBRARY_RELEASE}")
       set_property(TARGET protobuf::libprotobuf APPEND PROPERTY
-        IMPORTED_CONFIGURATIONS RELEASE)
+          IMPORTED_CONFIGURATIONS RELEASE)
       set_target_properties(protobuf::libprotobuf PROPERTIES
-        IMPORTED_LOCATION_RELEASE "${PROTOBUF_LIBRARY_RELEASE}")
+          IMPORTED_LOCATION_RELEASE "${PROTOBUF_LIBRARY_RELEASE}")
     endif()
     if(EXISTS "${PROTOBUF_LIBRARY_DEBUG}")
       set_property(TARGET protobuf::libprotobuf APPEND PROPERTY
-        IMPORTED_CONFIGURATIONS DEBUG)
+          IMPORTED_CONFIGURATIONS DEBUG)
       set_target_properties(protobuf::libprotobuf PROPERTIES
-        IMPORTED_LOCATION_DEBUG "${PROTOBUF_LIBRARY_DEBUG}")
+          IMPORTED_LOCATION_DEBUG "${PROTOBUF_LIBRARY_DEBUG}")
     endif()
   endif()

   if(PROTOBUF_LITE_LIBRARY)
-    add_library(protobuf::libprotobuf-lite UNKNOWN IMPORTED)
-    set_target_properties(protobuf::libprotobuf-lite PROPERTIES
-        INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}")
+    if (NOT TARGET protobuf::libprotobuf-lite)
+      add_library(protobuf::libprotobuf-lite UNKNOWN IMPORTED)
+      set_target_properties(protobuf::libprotobuf-lite PROPERTIES
+          INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}")
+    endif()
     if(EXISTS "${PROTOBUF_LITE_LIBRARY}")
       set_target_properties(protobuf::libprotobuf-lite PROPERTIES
           IMPORTED_LOCATION "${PROTOBUF_LITE_LIBRARY}")
@@ -62,7 +66,9 @@
   endif()

   if(PROTOBUF_PROTOC_EXECUTABLE)
-    add_executable(protobuf::protoc IMPORTED)
+    if (NOT TARGET protobuf::protoc)
+      add_executable(protobuf::protoc IMPORTED)
+    endif()
     set_property(TARGET protobuf::protoc PROPERTY
         IMPORTED_LOCATION ${PROTOBUF_PROTOC_EXECUTABLE})
   endif()


A quick fix mechanism to resolve the VTK Xwindows bug pro tem.

--- cmake_modules/FindVTK.cmake
+++ cmake_modules/FindVTK.cmake
@@ -57,13 +57,10 @@
 #=============================================================================

 # VTK 5.10 has a bug that causes a crash in Xwindows upon closing.
-# Revert to 5.6 on Linux for now. 5.10 seems to work fine on windows.
+# Uncomment/comment appropriately below to use 5.6 on Linux for now. 5.10 seems to work fine on windows.
 #
-if(WIN32)
-    set(VERSION 5.10)
-else()
-    set(VERSION 5.6)
-endif()
+set(VERSION 5.10)
+#set(VERSION 5.6)

 # Assume not found.
 set(VTK_FOUND 0)


fixed: allow external projects to include other external dirs

--- CMake/OSGExternalProjectHelper.cmake
+++ CMake/OSGExternalProjectHelper.cmake
@@ -454,6 +454,53 @@
           DESTINATION share/OpenSG/cmake)
 #          COMPONENT development_configuration)

+  OSG_SET_CACHE(OSG_EXTRA_EXTERNAL_MODULES "" STRING
+                "Extra modules that OpenSG will try to import.")
+
+  OSG_SET_CACHE(OSG_EXTERNAL_MODULES_INCLUDE "" FILEPATH
+                "Include file of extra modules")
+
+  IF(EXISTS "${OSG_EXTERNAL_MODULES_INCLUDE}")
+    INCLUDE("${OSG_EXTERNAL_MODULES_INCLUDE}")
+  ENDIF()
+
+  FOREACH(EXTERNAL ${OSG_EXTRA_EXTERNAL_MODULES})
+    OPTION(OSGBUILD_${EXTERNAL}
+           "Build using ${EXTERNAL} module" OFF)
+
+    IF(OSGBUILD_${EXTERNAL})
+      FIND_PATH(OSG_${EXTERNAL}_SOURCE_DIR
+                CMakeLists.Lib.${EXTERNAL}.txt
+                ${CMAKE_CURRENT_SOURCE_DIR}/../${EXTERNAL})
+
+      OSG_ADD_OPT(OSG_${EXTERNAL}_SOURCE_DIR)
+
+      IF(NOT EXISTS
+            ${OSG_${EXTERNAL}_SOURCE_DIR}/CMakeLists.Lib.${EXTERNAL}.txt)
+
+        MESSAGE(SEND_ERROR "Cannot find ${EXTERNAL} sources directory: "
+                           "${OSG_${EXTERNAL}_SOURCE_DIR}")
+      ELSE()
+        LIST(APPEND OSG_EXTERNAL_CONFIGS "${EXTERNAL}")
+
+        GET_FILENAME_COMPONENT(_EXT_SRC_DIR
+                               "${OSG_${EXTERNAL}_SOURCE_DIR}/.."
+                               REALPATH                         )
+
+        IF(EXISTS "${OSG_${EXTERNAL}_SOURCE_DIR}/CMakeLists.PackagePrepare.cmake")
+          LIST(APPEND OSG_EXTERNAL_PREPARE "${OSG_${EXTERNAL}_SOURCE_DIR}")
+        ENDIF()
+
+        IF(EXISTS "${_EXT_SRC_DIR}/CMakeLists.PackagePrepare.cmake")
+          LIST(APPEND OSG_EXTERNAL_PREPARE "${_EXT_SRC_DIR}")
+        ENDIF()
+      ENDIF()
+    ENDIF()
+  ENDFOREACH(EXTERNAL)
+
+IF(OSG_EXTERNAL_PREPARE)
+  LIST(REMOVE_DUPLICATES OSG_EXTERNAL_PREPARE)
+ENDIF()
 ENDMACRO(OSG_INIT)

@@ -570,6 +617,22 @@
     ENDIF()
   ENDFOREACH(LIBCONFIGFILE)

+  FOREACH(EXTERNAL_PREPARE ${OSG_EXTERNAL_PREPARE})
+    INCLUDE("${EXTERNAL_PREPARE}/CMakeLists.PackagePrepare.cmake")
+  ENDFOREACH()
+
+  FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
+    IF(EXISTS ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
+      INCLUDE(${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
+    ENDIF(EXISTS
+    ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Prepare.cmake)
+  ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
+
+  FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
+    IF(EXISTS ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.PrePasses.cmake)
+      INCLUDE(${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.PrePasses.cmake)
+    ENDIF(EXISTS ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.PrePasses.cmake)
+  ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})

   # run build passes
   FOREACH(PASS ${OSG_CMAKE_PASSES})
@@ -586,6 +649,11 @@
         ADD_SUBDIRECTORY("${LIBCONFIGDIR}" "${OSG_PASSDIR_${PASS}}/${LIBFILENAME}")

     ENDFOREACH(LIBCONFIGFILE)
+
+    FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
+        ADD_SUBDIRECTORY("${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}"
+                         "External/${EXTERNAL_CONFIG}/${OSG_PASSDIR_${PASS}}")
+    ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})

   ENDFOREACH()

@@ -622,6 +690,11 @@
                       GROUP_READ
                       WORLD_READ)

+  FOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})
+    IF(EXISTS ${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Finalize.cmake)
+      INCLUDE(${OSG_${EXTERNAL_CONFIG}_SOURCE_DIR}/${EXTERNAL_CONFIG}.Finalize.cmake)
+    ENDIF()
+  ENDFOREACH(EXTERNAL_CONFIG ${OSG_EXTERNAL_CONFIGS})

 ENDMACRO(_OSG_RUN_PASSES)


disabled undefined sanitization on Mac OS X, as it is not supported there

--- toolchains/clang.cmake
+++ toolchains/clang.cmake
@@ -13,7 +13,10 @@
 list( APPEND TNUN_compiler_optimize_for_speed -fvectorize -fslp-vectorize -fslp-vectorize-aggressive )
 list( APPEND TNUN_compiler_optimize_for_speed -Rpass=loop-.* ) #-Rpass-missed=loop-vectorize -Rpass-analysis=loop-vectorize -mllvm -bb-vectorize-aligned-only

-# http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
-set( TNUN_compiler_runtime_sanity_checks -fsanitize=undefined -fsanitize=integer )
+# https://github.com/P-H-C/phc-winner-argon2/issues/103
+if(NOT APPLE)
+    # http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
+    set( TNUN_compiler_runtime_sanity_checks -fsanitize=undefined -fsanitize=integer )
+endif()

 add_compile_options( -Wheader-guard )


Split build commands as suggested by @Youw

--- tensorflow_cc/cmake/TensorflowShared.cmake
+++ tensorflow_cc/cmake/TensorflowShared.cmake
@@ -16,17 +16,15 @@
         COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/patches/v1.15.0-workspace.bzl.patch" .
         COMMAND git apply v1.15.0-workspace.bzl.patch
   CONFIGURE_COMMAND tensorflow/contrib/makefile/compile_linux_protobuf.sh
-            # Do not fail on warnings when building nsync
-            COMMAND sed -i "s/ -Werror//g" tensorflow/contrib/makefile/compile_nsync.sh
-            COMMAND tensorflow/contrib/makefile/compile_nsync.sh
-            COMMAND "${CMAKE_CURRENT_BINARY_DIR}/build_tensorflow.sh"
-            COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_links.sh" .
-            # For some reason, Bazel sometimes puts the headers into
-            # `bazel-genfiles/genfiles` and sometimes just to `bazel-genfiles`.
-            # So we just create and include both the directories.
-            COMMAND mkdir -p bazel-genfiles/genfiles
-            COMMAND touch bazel-genfiles/_placeholder.h
-            COMMAND touch bazel-genfiles/genfiles/_placeholder.h
-  BUILD_COMMAND ""
-  INSTALL_COMMAND ""
+           # Do not fail on warnings when building nsync
+           COMMAND sed -i "s/ -Werror//g" tensorflow/contrib/makefile/compile_nsync.sh
+           COMMAND tensorflow/contrib/makefile/compile_nsync.sh
+  BUILD_COMMAND "${CMAKE_CURRENT_BINARY_DIR}/build_tensorflow.sh"
+  INSTALL_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy_links.sh" .
+         # For some reason, Bazel sometimes puts the headers into
+         # `bazel-genfiles/genfiles` and sometimes just to `bazel-genfiles`.
+         # So we just create and include both the directories.
+         COMMAND mkdir -p bazel-genfiles/genfiles
+         COMMAND touch bazel-genfiles/_placeholder.h
+         COMMAND touch bazel-genfiles/genfiles/_placeholder.h
 )


No. Not again.

No. Not again.

--- cmake/BuildOptionsPONA.cmake
+++ cmake/BuildOptionsPONA.cmake
@@ -12,9 +12,9 @@
 		SET(CMAKE_EXE_LINKER_FLAGS "-m64 ${CMAKE_EXE_LINKER_FLAGS}")
 	ENDIF(PONA_BUILD64)
 ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-	IF(CMAKE_SYSTEM_VERSION GREATER 9.9.9)
+	IF(CMAKE_SYSTEM_VERSION GREATER 9.7.9)
 		ADD_DEFINITIONS(-D_XOPEN_SOURCE)
-	ENDIF(CMAKE_SYSTEM_VERSION GREATER 9.9.9)
+	ENDIF(CMAKE_SYSTEM_VERSION GREATER 9.7.9)
 	SET(CMAKE_SHARED_LINKER_FLAGS "-U_undefined -undefined dynamic_lookup ${CMAKE_SHARED_LINKER_FLAGS}")
 	SET(PONA_BUILD64 ON CACHE BOOL "Build 64 bit version of libPONA.")
 	IF(PONA_BUILD64)


Coalesce protocol conformance sections on FreeBSD.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1090,10 +1090,11 @@
     set(PLIST_INFO_BUILD_VERSION)
   endif()

-  # On Linux add the linker script that coalesces protocol conformance
-  # sections. This wouldn't be necessary if the link was done by the swift
-  # binary: rdar://problem/19007002
-  if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
+  # On Linux and FreeBSD add the linker script that coalesces protocol
+  # conformance sections. This wouldn't be necessary if the link was done by
+  # the swift binary: rdar://problem/19007002
+  if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR
+    "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
     list(APPEND link_flags
         "-Xlinker" "-T"
         "-Xlinker" "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}/swift.ld")


An attempt to workaround usrsctp comilation failure while https://github.com/sctplab/usrsctp/issues/586 is still unsolved

--- cmake/modules/IrisSCTP.cmake
+++ cmake/modules/IrisSCTP.cmake
@@ -40,6 +40,9 @@
         -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
         -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
         -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
+    if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+        list(APPEND USRSCTP_BUILD_OPTIONS -DCMAKE_C_FLAGS="-Wno-maybe-uninitialized")
+    endif()
     if (EXISTS ${USRSCTP_SOURCE_DIR})
         message(STATUS "USRSCTP: found bundled sources")
         ExternalProject_Add(UsrSCTPProject


Updated LIBXSMM.

Updated LIBXSMM.

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -13,8 +13,8 @@

   FetchContent_Declare(
     xsmm
-    URL https://github.com/libxsmm/libxsmm/archive/62957fff702e89dee61ef9a895716ff455b18aef.tar.gz
-    URL_HASH SHA256=e4b0240c7fd3270b982475baedd01a444230f151c4fb8ea409c00648d54c180b
+    URL https://github.com/libxsmm/libxsmm/archive/f58b32fb89c52a1a074c1de1ec19f8cd07ddbeb1.tar.gz
+    URL_HASH SHA256=23ef5b38d538067db5cfe3d5027973abb59761cbf53152e98429010069a06530
   )

   FetchContent_GetProperties(xsmm)


Backup. Changing over to cmake-supplied "Find" scripts.

--- cmake_modules/Find7Zip.cmake
+++ cmake_modules/Find7Zip.cmake
@@ -1,21 +0,0 @@
-# Copyright (c) 2013 Limit Point Systems, Inc.
-
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-
-#   http://www.apache.org/licenses/LICENSE-2.0
-
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-find_program(7ZA NAMES 7za 7za.exe
-	PATHS ENV${PATH}
-	)
-if(7ZA)
-  set(7ZIP_FOUND "YES" )
-endif(7ZA)


fixed typo

fixed typo

--- cmake_modules/FindFuse.cmake
+++ cmake_modules/FindFuse.cmake
@@ -47,7 +47,7 @@
   IF(NOT Fuse_FIND_QUIETLY)
     MESSAGE(STATUS "Found Fuse: ${FUSE_LIBRARY}")
   ENDIF(NOT Fuse_FIND_QUIETLY)
-ELSE(Fuse_FOUND)
+ELSE(FUSE_FOUND)
   IF(Fuse_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR "Could not find Fuse")
   ENDIF(Fuse_FIND_REQUIRED)


- Get the VS path from register and search GLFW in it

--- cmake_modules/FindGLFW.cmake
+++ cmake_modules/FindGLFW.cmake
@@ -23,6 +23,17 @@
   MESSAGE(STATUS "${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): ${_MSG}")
 ENDMACRO(DBG_MSG)

+IF(WIN32)
+    IF(MSVC10)
+        GET_FILENAME_COMPONENT(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] REALPATH CACHE)
+    ELSEIF(MSVC90)
+        GET_FILENAME_COMPONENT(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;ProductDir] REALPATH CACHE)
+    ELSEIF(MSVC80)
+        GET_FILENAME_COMPONENT(VS_DIR [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;ProductDir] REALPATH CACHE)
+    ENDIF()
+    MESSAGE(STATUS "Found MS in " ${VS_DIR})
+ENDIF()
+
 # find the GLFW include directory
 FIND_PATH(GLFW_INCLUDE_DIR  GL/glfw.h GL/glfw3.h
                             DOC "Path to GLFW header."
@@ -43,6 +54,7 @@
                             /opt/local/  # DarwinPorts
                             /opt/csw/    # Blastwave
                             /opt/
+                            ${VS_DIR}/VC/include
                             ${GLFWDIR}
                             $ENV{GLFWDIR}
 )
@@ -105,6 +117,7 @@
                             /sw
                             $ENV{GLFWDIR}/support/msvc80/Debug
                             $ENV{GLFWDIR}/support/msvc80/Release
+                            ${VS_DIR}/VC/lib
                             ${GLFWDIR}
                             $ENV{GLFWDIR}
 )


Update compiler.cmake

Update compiler.cmake

- removed -stdlib=libstdc++ for windows clang build

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -73,8 +73,10 @@
      set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g")
      if (APPLE)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libc++")
-     else ()
+     elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
+     else()
+         set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")


cmake: dts fixups

cmake: dts fixups

Trivial dts.cmake cleanups.

Signed-off-by: Robert Lubos <9d28997c6894a2d0321a7bb399169af7ce99b64e@nordicsemi.no>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -32,6 +32,9 @@
   ${BOARD_DIR}
   ${ZEPHYR_BASE}
   )
+list(REMOVE_DUPLICATES
+  DTS_ROOT
+  )

 list(REMOVE_DUPLICATES DTS_ROOT)

@@ -73,6 +76,7 @@
     math(EXPR i "${i}+1")
   endforeach()

+  unset(DTS_ROOT_SYSTEM_INCLUDE_DIRS)
   foreach(dts_root ${DTS_ROOT})
     foreach(dts_root_path
         include
@@ -90,6 +94,7 @@
     endforeach()
   endforeach()

+  unset(DTS_ROOT_BINDINGS)
   foreach(dts_root ${DTS_ROOT})
     set(full_path ${dts_root}/dts/bindings)
     if(EXISTS ${full_path})


ecp5: cmake: Search for pytrellis.so in multiple locations

If a distro-specific "trellis-devel" package is used, the
pytrellis.so library might be located in a dedicated directory,
rather than under TRELLIS_ROOT.

Search for pytrellis.so in a list of directories, then subsequently
use the first match as part of PYTHONPATH.

Signed-off-by: Gabriel Somlo <d0c2f4d05face87728371216d88c0cb4d74f917a@gmail.com>

--- ecp5/family.cmake
+++ ecp5/family.cmake
@@ -6,11 +6,18 @@
     set(TRELLIS_ROOT "/usr/local/share/trellis")
 endif()

-file(GLOB found_pytrellis ${TRELLIS_ROOT}/libtrellis/pytrellis.*)
+file(GLOB found_pytrellis ${TRELLIS_ROOT}/libtrellis/pytrellis.*
+                          /usr/lib/pytrellis.*
+                          /usr/lib64/pytrellis.*
+                          /usr/lib/trellis/pytrellis.*
+                          /usr/lib64/trellis/pytrellis.*)

 if ("${found_pytrellis}" STREQUAL "")
-    message(FATAL_ERROR "failed to find pytrellis library in ${TRELLIS_ROOT}/libtrellis/")
+    message(FATAL_ERROR "failed to locate pytrellis library!")
 endif()
+
+list(GET found_pytrellis 0 PYTRELLIS_LIB)
+get_filename_component(PYTRELLIS_LIBDIR ${PYTRELLIS_LIB} DIRECTORY)

 set(DB_PY ${CMAKE_CURRENT_SOURCE_DIR}/ecp5/trellis_import.py)

@@ -20,9 +27,9 @@
 target_include_directories(ecp5_chipdb PRIVATE ${family}/)

 if (CMAKE_HOST_WIN32)
-set(ENV_CMD ${CMAKE_COMMAND} -E env "PYTHONPATH=\"${TRELLIS_ROOT}/libtrellis\;${TRELLIS_ROOT}/util/common\;${TRELLIS_ROOT}/timing/util\"")
+set(ENV_CMD ${CMAKE_COMMAND} -E env "PYTHONPATH=\"${PYTRELLIS_LIBDIR}\;${TRELLIS_ROOT}/util/common\;${TRELLIS_ROOT}/timing/util\"")
 else()
-set(ENV_CMD ${CMAKE_COMMAND} -E env "PYTHONPATH=${TRELLIS_ROOT}/libtrellis:${TRELLIS_ROOT}/util/common:${TRELLIS_ROOT}/timing/util")
+set(ENV_CMD ${CMAKE_COMMAND} -E env "PYTHONPATH=${PYTRELLIS_LIBDIR}\:${TRELLIS_ROOT}/util/common:${TRELLIS_ROOT}/timing/util")
 endif()

 if (MSVC)


Install dir was not passed to QtTesting

Install dir was not passed to QtTesting

ep_common_args doesn't exit, ep_common_cache_args exists.
It properly set the CMAKE_INSTALL_PREFIX

--- CMakeExternals/QtTesting.cmake
+++ CMakeExternals/QtTesting.cmake
@@ -55,15 +55,15 @@
         PREFIX ${proj}${ep_suffix}
         ${location_args}
         CMAKE_GENERATOR ${gen}
-        INSTALL_COMMAND ""
         UPDATE_COMMAND ""
-        CMAKE_ARGS
-          ${ep_common_args}
+        CMAKE_CACHE_ARGS
+          ${ep_common_cache_args}
           -DBUILD_SHARED_LIBS:BOOL=ON
           -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
         DEPENDS
           ${proj_DEPENDENCIES}
         )
+      set(QtTesting_INSTALL_DIR ${ep_install_dir})
       set(QtTesting_DIR ${CMAKE_BINARY_DIR}/${proj}-build)

       # Since QtTesting is statically build, there is not need to add its corresponding
@@ -73,7 +73,10 @@
       ctkMacroEmptyExternalproject(${proj} "${proj_DEPENDENCIES}")
     endif()

-    list(APPEND CTK_SUPERBUILD_EP_VARS QtTesting_DIR:PATH)
+    list(APPEND CTK_SUPERBUILD_EP_VARS
+      QtTesting_INSTALL_DIR:PATH
+      QtTesting_DIR:PATH
+      )

   endif()


Update ModuleOpenIGTLink.cmake

Update ModuleOpenIGTLink.cmake

for OpenIGTLink 3.1 on Mac

--- cmake/ModuleOpenIGTLink.cmake
+++ cmake/ModuleOpenIGTLink.cmake
@@ -9,8 +9,8 @@
         )
     elseif(APPLE)
         fast_download_dependency(OpenIGTLink
-                2.1
-                48f0eb32d45153a3bbb7d6529c4f64a41a618d7df3c6903f82c22b3788324020
+                3.1
+                cf378861fa4a4d6324a60c4d23c41f19582f92029212bfb3fbccc57455afb4b0
                 libOpenIGTLink.dylib
         )
     else()


one more try with m32

one more try with m32

--- cmake/Toolchain-gcc-m32.cmake
+++ cmake/Toolchain-gcc-m32.cmake
@@ -4,13 +4,3 @@
 # which compilers to use for C and C++
 set(CMAKE_C_COMPILER gcc -m32)
 set(CMAKE_CXX_COMPILER g++ -m32)
-
-# here is the target environment located
-set(CMAKE_FIND_ROOT_PATH   /usr/lib32 )
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


[skip-ci][win] Fix Visual Studio versions and add VS 2022 (#10033)

* [skip-ci][win] Fix Visual Studio versions and add VS 2022

* [skip-ci][win] Add win64

* [skip-ci][win] Add a warning if MSVC_VERSION is not implemented


Reduce the number of binary package formats to be generated and copied to root.cern.ch

--- cmake/modules/RootCPack.cmake
+++ cmake/modules/RootCPack.cmake
@@ -110,14 +110,14 @@
 set(CPACK_PACKAGE_EXECUTABLES "root" "ROOT")

 if(WIN32)
-  set(CPACK_GENERATOR "ZIP;NSIS;TGZ")
+  set(CPACK_GENERATOR "ZIP;NSIS")
   set(CPACK_SOURCE_GENERATOR "TGZ;ZIP")
 elseif(APPLE)
   set(CPACK_GENERATOR "TGZ;PackageMaker")
   set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
 else()
-  set(CPACK_GENERATOR "STGZ;TGZ")
-  set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;ZIP")
+  set(CPACK_GENERATOR "TGZ")
+  set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
 endif()

 #----------------------------------------------------------------------------------------------------


Detect non-virtualenv pyarrow installations on Windows

--- cmake_scripts/FindArrow.cmake
+++ cmake_scripts/FindArrow.cmake
@@ -48,8 +48,13 @@
       $ENV{VIRTUAL_ENV}/lib/*/site-packages/pyarrow/include)
     get_filename_component(ARROW_SEARCH_LIB_PATH ${ARROW_INCLUDE_DIR} DIRECTORY)
   else()
-    find_path(ARROW_INCLUDE_DIR arrow/api.h HINTS
-      /usr/local/lib/*/dist-packages/pyarrow/include)
+    if (MSVC)
+      find_path(ARROW_INCLUDE_DIR arrow/api.h HINTS
+        $ENV{PYTHON}/lib/site-packages/pyarrow/include)
+    else()
+      find_path(ARROW_INCLUDE_DIR arrow/api.h HINTS
+        /usr/local/lib/*/dist-packages/pyarrow/include)
+    endif()
     get_filename_component(ARROW_SEARCH_LIB_PATH ${ARROW_INCLUDE_DIR} DIRECTORY)
   endif()
 else()


Provide good error if VCS tool not available.

--- modules/DownloadModules.cmake
+++ modules/DownloadModules.cmake
@@ -71,6 +71,10 @@
     if (_getmod)
       message ("Downloading module '${_modname}'...")
       if (${_modvc} STREQUAL "svn")
+        if (NOT svn)
+          message (FATAL_ERROR
+            "Subversion client not found - required for ${_modname} module!")
+        endif (NOT svn)
         # QQQ Ridiculous and slow hack, but Sourceforge has been
         # incredibly unreliable lately so this is the best choice I've
         # got to make the remote queue semi-stable
@@ -80,6 +84,10 @@
         endforeach (s 1 2)

       elseif (${_modvc} STREQUAL "bzr")
+        if (NOT bzr)
+          message (FATAL_ERROR
+            "Bazaar client not found - required for ${_modname} module!")
+        endif (NOT bzr)
         execute_process (COMMAND "${bzr}" branch "${_modurl}" "${_modname}"
           WORKING_DIRECTORY "${outdir}" TIMEOUT 60)


Null change to test remote queue feature.

--- test/remote/SvnPackage.cmake
+++ test/remote/SvnPackage.cmake
@@ -15,7 +15,6 @@
 # Utility routines to package a local SVN working copy's changes into
 # a single file, and for applying that file to a fresh SVN enlistment
 # elsewhere.
-

 MACRO (find_prereqs)
   # Definitely need svn here.


mpv: Log pack-binary and download-font steps

--- packages/mpv.cmake
+++ packages/mpv.cmake
@@ -70,6 +70,7 @@
     COMMAND ${CMAKE_COMMAND} -E remove ../mpv-${TARGET_CPU}-${BUILDDATE}.7z
     COMMAND 7z a -m0=lzma2 -mx=9 -ms=on ../mpv-${TARGET_CPU}-${BUILDDATE}.7z mpv.exe libquvi-scripts fonts fonts.conf
     COMMENT "Packing mpv binary"
+    LOG 1
 )

 ExternalProject_Add_Step(mpv download-font
@@ -77,4 +78,5 @@
     DEPENDERS pack-binary
     COMMAND wget "https://github.com/android/platform_frameworks_base/raw/master/data/fonts/DroidSansFallbackFull.ttf"
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/fonts
+    LOG 1
 )


list libboost-python versions explicitly, so that install from ppa might work.

--- src/package_details.cmake
+++ src/package_details.cmake
@@ -11,7 +11,15 @@

 # the debian source-package builder wants dependencies as an array
 set(DEBSRC_BUILD_DEPENDS debhelper python git cmake libboost-dev "libqd0 | libqd2c2a" libqd-dev libboost-python-dev libgomp1 CACHE STRINGS "name")
-set(DEBSRC_PACKAGE_DEPENDS python git cmake libboost-python "libqd0 | libqd2c2a" CACHE STRING "name")
+
+# we need to explicitly list the libboost-python versions here. why??
+# precise has 1.48.0
+# oneiric has 1.46.1
+# natty/maverick has 1.42.0
+# lucid has 1.40.0
+set(DEBSRC_PACKAGE_DEPENDS python git cmake
+                "libboost-python1.48.0 | libboost-python1.46.1 | libboost-python1.42.0 | libboost-python1.40.0"
+                "libqd0 | libqd2c2a" CACHE STRING "name")

 # however CPack wants dependencies as a single comma separated string!
 set(CPACK_DEBIAN_PACKAGE_DEPENDS)


minor changes

minor changes

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -80,8 +80,6 @@
 		set(VERSION_REQUEST "")
 		set(EXTRA_VERSION "")
 	endif()
-
-	# MESSAGE(" python ${ARTIFACTS_PATH}/check_remote_version.py --server=${PACKAGE_BASE_URL} --artifacts=${CMAKE_PREFIX_PATH} --platform=${CMAKI_PLATFORM} --name=${PACKAGE} ${EXTRA_VERSION} ")

 	#######################################################
 	# get version in local cache or remote artifacts server
@@ -131,6 +129,9 @@
 			if(artifacts_result)
 				message(FATAL_ERROR "can't create artifact ${PACKAGE}")
 			endif()
+
+			# TODO: must set recent artifact created
+			# or integrate in pipeline

 			#######################################################
 			# llamar a check_remote_version


save revision

save revision

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -197,7 +197,7 @@
 	endif()

 	execute_process(
-		COMMAND python ${ARTIFACTS_PATH}/save_package.py --name=${PACKAGE} --version=${VERSION_REQUEST} --depends=${CMAKI_PATH}/../depends.json
+		COMMAND python ${ARTIFACTS_PATH}/save_package.py --name=${PACKAGE} --version=${VERSION} --depends=${CMAKI_PATH}/../depends.json
 		WORKING_DIRECTORY "${ARTIFACTS_PATH}"
 		RESULT_VARIABLE artifacts_result
 		)


fix missing module name in BUILDNAME

fix missing module name in BUILDNAME

--- Build/CTestDriver.cmake
+++ Build/CTestDriver.cmake
@@ -10,6 +10,8 @@
   message(STATUS "set mode to Experimental")
   set(MODE "Experimental")
 endif()
+
+set(BUILDNAME ${MODULE})

 set(CTEST_SOURCE_DIRECTORY "${SOURCE_DIRECTORY}/${MODULE}")
 set(CTEST_BINARY_DIRECTORY "${BINARY_DIRECTORY}")


FIX (#4432): fix linux multi-application install

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -529,10 +529,19 @@
     ENDMACRO(gp_item_default_embedded_path_override)

     MACRO(gp_resolved_file_type_override file type)
-      GET_FILENAME_COMPONENT(_file_name \"\${file}\" NAME)
-      GET_FILENAME_COMPONENT(_file_path \"\${file}\" PATH)
-      IF(_file_name MATCHES \"^liborg\")
-        # SET(\${type} \"system\")
+      IF(NOT APPLE)
+        GET_FILENAME_COMPONENT(_file_path \"\${file}\" PATH)
+        GET_FILENAME_COMPONENT(_file_name \"\${file}\" NAME)
+        IF(_file_path MATCHES \"^\${CMAKE_INSTALL_PREFIX}\")
+          SET(\${type} \"local\")
+          # On linux, rpaths are removed from the plugins
+          # if installing more than on application. This override
+          # should prevent this.
+          IF(_file_name MATCHES \"^liborg\")
+            SET(\${type} \"system\")
+          ENDIF(_file_name MATCHES \"^liborg\")
+
+         ENDIF()
       ENDIF()
     ENDMACRO(gp_resolved_file_type_override)


using lemon official download

using lemon official download

--- lemon.cmake
+++ lemon.cmake
@@ -34,10 +34,10 @@

 # Using special cached tarball.  See note above.
 external_source (lemon
-    snapshot-473c71baff72
-	lemon-snapshot-473c71baff72.tar.gz
-	d33dc5d3d3e7f7b56ca9b4ee2cdb525f
-    http://janelia-flyem.github.io/downloads)
+  1.2.3
+  lemon-1.2.3.tar.gz
+  750251a77be450ddddedab14e5163afb
+  http://lemon.cs.elte.hu/pub/sources)

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


Changed git url from http to https (HTML error 400 in Ubuntu 10.04 with standard git)

--- openblas.cmake
+++ openblas.cmake
@@ -11,7 +11,7 @@

 external_git_repo (openblas
     0.2.8
-    http://github.com/xianyi/OpenBLAS)
+    https://github.com/xianyi/OpenBLAS)

 message ("Installing ${openblas_NAME} into ilastik build area: ${BUILDEM_DIR} ...")
 ExternalProject_Add(${openblas_NAME}


Hopefully disabling non-zero ctest warning in CTest.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@8683 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/cmake/CTestConfig.cmake
+++ seqan/projects/library/cmake/CTestConfig.cmake
@@ -11,3 +11,8 @@
 set(CTEST_DROP_SITE "www.seqan.de")
 set(CTEST_DROP_LOCATION "/cdash/submit.php?project=SeqAn")
 set(CTEST_DROP_SITE_CDASH TRUE)
+
+SET(CTEST_CUSTOM_WARNING_EXCEPTION
+  ${CTEST_CUSTOM_WARNING_EXCEPTION}
+  "WARNING non-zero return value in ctest from"
+)


added: cma_fetch_url function

added: cma_fetch_url function

--- share/hugh/cmake/functions/cma_utilities.cmake
+++ share/hugh/cmake/functions/cma_utilities.cmake
@@ -72,3 +72,40 @@
   add_definitions(-ZW)
   add_definitions(-EHsc)
 endfunction()
+
+# .rst
+# cma_fetch_url(URL FILE)::
+#   URL    - url to fetch
+#   FILE   - file to safe to
+#   ALWAYS - always fetch, do not check if already available
+#
+function(cma_fetch_url URL FILE)
+  include(CMakeParseArguments)
+
+  set(OARGS ALWAYS)
+  set(SARGS)
+  set(MARGS)
+  cmake_parse_arguments(CMA_FETCH_URL "${OARGS}" "${SARGS}" "${MARGS}" ${ARGN})
+
+  set(SRC ${URL})
+  set(DST ${FILE})
+
+  if(CMA_FETCH_URL_ALWAYS OR NOT EXISTS ${DST})
+    if(VERBOSE)
+      message(STATUS "Downloding '${SRC}' to '${DST}'")
+    else()
+      message(STATUS "Downloding '${SRC}'")
+    endif()
+    file(DOWNLOAD ${SRC} ${DST} STATUS RESULT)
+    list(GET RESULT 0 RESULT0)
+    if(NOT 0 EQUAL ${RESULT0})
+      list(GET RESULT 1 RESULT1)
+      message(FATAL_ERROR "Download failed: ${RESULT1} (${RESULT0})")
+      file(REMOVE ${DST})
+    else()
+      if(VERBOSE)
+	message(STATUS "Downloaded '${SRC}' to '${DST}'")
+      endif()
+    endif()
+  endif()
+endfunction()


added KMP_NESTED_HOT_TEAMS macro definition

git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@231383 91177308-0d34-0410-b5e6-96231b3b80d8

--- runtime/cmake/Definitions.cmake
+++ runtime/cmake/Definitions.cmake
@@ -23,6 +23,7 @@
     append_definitions("-D BUILD_I8")
     append_definitions("-D KMP_LIBRARY_FILE=\\\\\"${lib_file}\\\\\"") # yes... you need 5 backslashes...
     append_definitions("-D KMP_VERSION_MAJOR=${version}")
+    append_definitions("-D KMP_NESTED_HOT_TEAMS")

     # customize to 128 bytes for ppc64
     if(${PPC64})


Require graviton2 for aarch64i as default.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -239,6 +239,8 @@
       else()
         set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-mtune=intel")
       endif()
+    elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
+      set(DEFAULT_VESPA_CPU_ARCH_FLAGS "-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=neoverse-n1")
     endif()
   endif()
   if(DEFINED DEFAULT_CMAKE_PREFIX_PATH)


Use llvm 13 on darwin.

Use llvm 13 on darwin.

--- default_build_settings.cmake
+++ default_build_settings.cmake
@@ -46,7 +46,7 @@

 function(setup_vespa_default_build_settings_darwin)
   message("-- Setting up default build settings for darwin")
-  set(DEFAULT_VESPA_LLVM_VERSION "12" PARENT_SCOPE)
+  set(DEFAULT_VESPA_LLVM_VERSION "13" PARENT_SCOPE)
   set(DEFAULT_CMAKE_PREFIX_PATH "${VESPA_DEPS}" "/usr/local/opt/bison" "/usr/local/opt/flex" "/usr/local/opt/openssl@1.1" "/usr/local/opt/openblas" "/usr/local/opt/icu4c" PARENT_SCOPE)
   set(DEFAULT_EXTRA_LINK_DIRECTORY "${VESPA_DEPS}/lib" "/usr/local/opt/bison/lib" "/usr/local/opt/flex/lib" "/usr/local/opt/icu4c/lib" "/usr/local/opt/openssl@1.1/lib" "/usr/local/opt/openblas/lib")
   list(APPEND DEFAULT_EXTRA_LINK_DIRECTORY "/usr/local/lib")


update

update

--- src/CMake/FindSigC++.cmake
+++ src/CMake/FindSigC++.cmake
@@ -13,8 +13,8 @@
 # Main include dir
 find_path(SigC++_INCLUDE_DIR
   NAMES sigc++/sigc++.h
-  PATHS ${SigC++_PKGCONF_INCLUDE_DIRS}
-  PATH_SUFFIXES sigc++-2.0
+  PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} ${SigC++_PKGCONF_INCLUDE_DIRS}/include
+  PATH_SUFFIXES include/sigc++-2.0 sigc++-2.0
 )

 # Glib-related libraries also use a separate config header, which is in lib dir


CMake, Fix build of lib in general case.

	* build-aux/cmake/modules/UModule.cmake:
	(add_module): Remove duplicates in UMODULE_LINKS.
	(add_library_for_uobject): Build lib with engine/remote
	environement if use lib for engine/remote.
	(search_env_of_dependency): New.
	(handler_engine_dependency, handler_remote_dependency): Use
	if(TARGET ...) in place of get_target_property, and change debug
	message.

--- build-aux/cmake/modules/UModule.cmake
+++ build-aux/cmake/modules/UModule.cmake
@@ -143,6 +143,10 @@
             endforeach(i ${UMODULE_INSTALL_TYPES})
         endforeach(UMODULE_DEPENDS_DIR)
     endif(UMODULE_DEPENDS)
+
+    if(UMODULE_LINKS)
+      list(REMOVE_DUPLICATES UMODULE_LINKS)
+    endif()

     add_subdirectory(${UMODULE_SOURCE_DIR} ${UMODULE_BINARY_DIR})

@@ -418,8 +422,19 @@
   if(NOT UOBJECT_LIBRARY_ENV_ENGINE AND NOT UOBJECT_LIBRARY_ENV_REMOTE)
     set(TARGET ${PROJECT_NAME}${UMODULE_LIBRARY_TARGET_SUFFIX})

-    add_library(${TARGET} ${${UMODULE_DIR}_UOBJECT_SOURCES})
-    target_link_libraries(${TARGET} ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+    search_env_of_dependency(env ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+    if (NOT env)
+      add_library(${TARGET} ${${UMODULE_DIR}_UOBJECT_SOURCES})
+      target_link_libraries(${TARGET}
+        ${UMODULE_LINKS} ${UOBJECT_LIBRARY_DEPENDS})
+    else()
+      # If one of the dependence is build is engine/remote
+      # environment, we don't build general lib, but a lib with
+      # particulary environment.
+      foreach(i ${env})
+        set(UOBJECT_LIBRARY_ENV_${i} TRUE)
+      endforeach()
+    endif()
   endif()

   # Case of engine environment
@@ -441,6 +456,27 @@
   endif()

 ENDMACRO(add_library_for_uobject)
+
+# Macro use by add_library_for_uobject.
+# It search build environment of all dependence and fill ${OUT} var.
+macro(search_env_of_dependency OUT)
+  set(${OUT})
+  foreach(DEPEND ${ARGN})
+    if(${DEPEND}_TARGET_NAME)
+      if(NOT TARGET ${${DEPEND}_TARGET_NAME})
+        if(TARGET ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
+          # depend of an lib engine
+          list(APPEND ${OUT} ENGINE)
+        endif()
+        if(TARGET ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
+          # depend of an lib remote
+          list(APPEND ${OUT} REMOTE)
+        endif()
+      endif()
+    endif()
+  endforeach(DEPEND)
+  list(REMOVE_DUPLICATES ${OUT})
+endmacro()

 #------------------------------------------------------------------------------
 #               Handler for dependency between umodule
@@ -458,22 +494,20 @@
         target_link_libraries(${TARGET} ${DEPEND})
       else()
         # Check if target exist
-        get_target_property(res ${${DEPEND}_TARGET_NAME} TYPE)
-
-        if(res)
+        if(TARGET ${${DEPEND}_TARGET_NAME})
           # Link to a standard library
           target_link_libraries(${TARGET} ${DEPEND})
-        else(res)
+        else()
           # Check if a library only for engine exist
-          get_target_property(res
-            ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX} TYPE)
-          if(res)
+          if(TARGET ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
             # Link with it
             target_link_libraries(${TARGET}
               ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
           else()
+            set(suffix ${UMODULE_LIBRARY_ENGINE_TARGET_SUFFIX})
             message(SEND_ERROR
-              "${DEPEND} can't be link to ${TARGET}")
+              "Target '${DEPEND}' can't be link to target '${TARGET}'\n"
+              "We have not found target '${DEPEND}' or '${DEPEND}${suffix}'\n")
           endif()
         endif()

@@ -490,22 +524,20 @@
         target_link_libraries(${TARGET} ${DEPEND})
       else()
         # Check if target exist
-        get_target_property(res ${${DEPEND}_TARGET_NAME} TYPE)
-
-        if(res)
+        if(TARGET ${${DEPEND}_TARGET_NAME})
           # Link to a standard library
           target_link_libraries(${TARGET} ${DEPEND})
         else(res)
           # Check if a library only for remote exist
-          get_target_property(res
-            ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX} TYPE)
-          if(res)
+          if(TARGET ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
             # Link with it
             target_link_libraries(${TARGET}
               ${${DEPEND}_TARGET_NAME}${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
           else()
+            set(suffix ${UMODULE_LIBRARY_REMOTE_TARGET_SUFFIX})
             message(SEND_ERROR
-              "${DEPEND} can't be link to ${TARGET}")
+              "Target '${DEPEND}' can't be link to target '${TARGET}'\n"
+              "We have not found target '${DEPEND}' or '${DEPEND}${suffix}'\n")
           endif()
         endif()


Fail if compiling qt without CMAKE_OSX_SYSROOT or CMAKE_OSX_ARCHITECTURES configured

--- Superbuild/Projects/qt.cmake
+++ Superbuild/Projects/qt.cmake
@@ -12,6 +12,9 @@
                     ${SuperBuild_PROJECTS_DIR}/patches/qt.src.3rdparty.webkit.Source.WebKit.pri
                     <SOURCE_DIR>/src/3rdparty/webkit/Source/WebKit.pri)
 elseif (APPLE)
+  if (NOT DEFINED CMAKE_OSX_SYSROOT OR NOT DEFINED CMAKE_OSX_ARCHITECTURES)
+    message(FATAL "CMAKE_OSX_SYSROOT or CMAKE_OSX_ARCHITECTURES are not configured")
+  endif()
   list (APPEND qt_options
               -sdk ${CMAKE_OSX_SYSROOT}
               -arch ${CMAKE_OSX_ARCHITECTURES}


Fixed cmake module syntax error

Fixed cmake module syntax error

--- .cmake/Modules/Submodules.cmake
+++ .cmake/Modules/Submodules.cmake
@@ -25,3 +25,5 @@
         WORKING_DIRECTORY   ${PROJECT_SOURCE_DIR}
     )
 endif()
+
+endif()


STYLE: Give error message when deprecated filename is encountered

Provide an error message when an incorrect filename pattern
is encountered.

--- Wrapping/TypedefMacros.cmake
+++ Wrapping/TypedefMacros.cmake
@@ -565,16 +565,15 @@
   endforeach()
   set(WRAPPER_AUTO_INCLUDE_HEADERS ON)

-  # Now include the file.
+  # Now include the .wrap file.
   if(EXISTS "${WRAPPER_LIBRARY_SOURCE_DIR}/${module}.wrap")
       include("${WRAPPER_LIBRARY_SOURCE_DIR}/${module}.wrap")
   else()
-    # for backward compatibility
+    # for backward compatibility, to be removed in ITKv6
     if(EXISTS "${WRAPPER_LIBRARY_SOURCE_DIR}/wrap_${module}.cmake")
-        include("${WRAPPER_LIBRARY_SOURCE_DIR}/wrap_${module}.cmake")
-    else()
-      message(SEND_ERROR "Module ${WRAPPER_LIBRARY_SOURCE_DIR}/${module}.wrap or ${WRAPPER_LIBRARY_SOURCE_DIR}/wrap_${module}.cmake not found.")
-    endif()
+        message(FATAL_ERROR "INCORRECT FILE NAME PATTERN: ${WRAPPER_LIBRARY_SOURCE_DIR}/wrap_${module}.cmake should be named ${WRAPPER_LIBRARY_SOURCE_DIR}/${module}.cmake")
+    endif()
+    message(SEND_ERROR "Module ${WRAPPER_LIBRARY_SOURCE_DIR}/${module}.wrap not found.")
   endif()

   itk_wrap_modules_set_prefix()


COMP: Set CMP0048 to new in ITK (Remote) Modules

Remote and external modules have established the practice of defining
"cmake_minimum_required" which resets the CMake Policies. This patch
sets CMP0048 default policy to "NEW" for all modules to address CMake
warnings.

--- CMake/ITKModuleEnablement.cmake
+++ CMake/ITKModuleEnablement.cmake
@@ -316,6 +316,8 @@
     init_module_vars()
   endif()
   include("${${itk-module}_SOURCE_DIR}/itk-module-init.cmake" OPTIONAL)
+  # Set CMP0048 to new in all modules
+  set(CMAKE_POLICY_DEFAULT_CMP0048 "NEW")
   add_subdirectory("${${itk-module}_SOURCE_DIR}" "${${itk-module}_BINARY_DIR}")
 endforeach()


Add PIC to gcc flags

Add PIC to gcc flags

--- CMakeModules/CompileFlags.cmake
+++ CMakeModules/CompileFlags.cmake
@@ -30,7 +30,7 @@
         set( EIGEN_ALIGNMENT_FLAG "" )
     endif()

-    set(CMAKE_CXX_FLAGS                "-Wall -Wextra  -pthread -std=c++1y -msse3 -Wno-sign-compare -Wno-unused-parameter -fno-exceptions ${OMP_FLAG} ${EIGEN_ALIGNMENT_FLAG} ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_CXX_FLAGS                "-Wall -Wextra  -pthread -std=c++1y -msse3 -Wno-sign-compare -Wno-unused-parameter -fno-exceptions -fPIC ${OMP_FLAG} ${EIGEN_ALIGNMENT_FLAG} ${CMAKE_CXX_FLAGS}")
     set(CMAKE_CXX_FLAGS_DEBUG          "-D_DEBUG -DCORE_DEBUG -g3 -ggdb ${CMAKE_CXX_FLAGS_DEBUG}")
     set(CMAKE_CXX_FLAGS_RELEASE        "-DNDEBUG -O3 ${MATH_FLAG}")
     set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g3 -ggdb ${CMAKE_CXX_FLAGS_RELEASE}")


CMake path fix.

CMake path fix.

--- cmake/SetEnv.cmake
+++ cmake/SetEnv.cmake
@@ -61,4 +61,4 @@
 set(CMAKE_INSTALL_RPATH ${INSTALL_LIB_DIR})

 # CMake Registry
-include(${CMAKE_SOURCE_DIR}/cmake/CMakeRegistry.cmake)
+include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeRegistry.cmake)


Do not build Celero examples (which also trigger a compile warning).

--- cmake/celero.cmake
+++ cmake/celero.cmake
@@ -11,7 +11,7 @@
   PATCH_COMMAND ""

   SOURCE_DIR "${CMAKE_SOURCE_DIR}/ext/Celero-2.0.5"
-  CMAKE_ARGS -DCELERO_COMPILE_DYNAMIC_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${CELERO_PREFIX}
+  CMAKE_ARGS -DCELERO_ENABLE_EXPERIMENTS=OFF -DCELERO_COMPILE_DYNAMIC_LIBRARIES=OFF -DCMAKE_INSTALL_PREFIX=${CELERO_PREFIX}

   TEST_COMMAND ""
 )


Refactor lib macro

Refactor lib macro


Fix determination of MATLAB version for Windows

--- cmake/config.cmake
+++ cmake/config.cmake
@@ -39,41 +39,59 @@
 #------------------------------------------------------------------------------
 function(drake_setup_java_for_matlab)
   if(NOT MATLAB_JVM_VERSION)
-    # Set arguments for running matlab
+    if(NOT MATLAB_EXECUTABLE)
+      message(WARNING
+        "Could not determine MATLAB JVM version because MATLAB executable was not set")
+      return()
+    endif()
+
+    # Set arguments for running MATLAB
     set(_args -nodesktop -nodisplay -nosplash)
+    set(_input_file /dev/null)
     if(WIN32)
       set(_args ${_args} -wait)
+      set(_input_file NUL)
     endif()
+    set(_logfile "${CMAKE_CURRENT_BINARY_DIR}/drake_setup_java_for_matlab.log")

     # Ask matlab for its JVM version
     execute_process(
-      COMMAND ${MATLAB_EXECUTABLE} ${_args} -r "version -java,quit"
-      RESULT_VARIABLE _result
-      ERROR_VARIABLE _output
-      OUTPUT_VARIABLE _output
-      TIMEOUT 180)
+      COMMAND "${MATLAB_EXECUTABLE}" ${_args} -logfile "${_logfile}" -r "version -java,quit"
+      WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" TIMEOUT 300
+      RESULT_VARIABLE _result OUTPUT_QUIET INPUT_FILE ${_input_file})

-    # Test for a valid result
-    if(NOT _result AND _output MATCHES "Java ([0-9]+\\.[0-9]+)\\.[0-9_.]+")
-      set(MATLAB_JVM_VERSION ${CMAKE_MATCH_1} CACHE INTERNAL "")
-      set(_jdk_version "${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}")
+    if(NOT _result AND EXISTS ${_logfile})
+      file(READ ${_logfile} _output)

-      # Compare against JDK version
-      if(NOT MATLAB_JVM_VERSION VERSION_EQUAL _jdk_version)
+      # Test for a valid result
+      if(_output MATCHES "Java ([0-9]+\\.[0-9]+)\\.([0-9_.]+)")
+        set(MATLAB_JVM_VERSION ${CMAKE_MATCH_1} CACHE INTERNAL "")
+        set(_jdk_version "${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}")
+
+        # Compare against JDK version
+        if(MATLAB_JVM_VERSION VERSION_EQUAL _jdk_version)
+          message(STATUS
+            "The MATLAB JVM version is ${CMAKE_MATCH_1}.${CMAKE_MATCH_2}")
+        else()
+          message(WARNING
+            "MATLAB JVM version (${MATLAB_JVM_VERSION}) does not match "
+            "installed Java Development Kit version (${_jdk_version})")
+
+          # If JDK is newer, set build options to build Java code compatible
+          # with the MATLAB JVM
+          if(MATLAB_JVM_VERSION VERSION_LESS _jdk_version)
+            set(CMAKE_JAVA_COMPILE_FLAGS
+              -source ${MATLAB_JVM_VERSION} -target ${MATLAB_JVM_VERSION}
+              CACHE INTERNAL "")
+          endif()
+        endif()
+      else()
         message(WARNING
-        "MATLAB JVM version (${MATLAB_JVM_VERSION}) does not match "
-        "installed Java Development Kit version (${_jdk_version})")
-
-        # If JDK is newer, set build options to build Java code compatible
-        # with the matlab JVM
-        if(MATLAB_JVM_VERSION VERSION_LESS _jdk_version)
-          set(CMAKE_JAVA_COMPILE_FLAGS
-            -source ${MATLAB_JVM_VERSION} -target ${MATLAB_JVM_VERSION}
-            CACHE INTERNAL "")
-        endif()
+          "Could not determine MATLAB JVM version because regular expression was not matched")
       endif()
     else()
-      message(WARNING "Could not determine MATLAB JVM version")
+      message(WARNING
+        "Could not determine MATLAB JVM version because MATLAB log file was not created")
     endif()
   endif()
 endfunction()


Fix CMake cross-compiling

Fix CMake cross-compiling

Without specifying thread count, NUM_THREADS would not be defined and CMake would fail.
This is because core count cannot be determined when cross-compiling.

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -97,7 +97,7 @@
 endif()

 if (NOT DEFINED NUM_THREADS)
-  if (NOT NUM_CORES EQUAL 0)
+  if (DEFINED NUM_CORES AND NOT NUM_CORES EQUAL 0)
     # HT?
     set(NUM_THREADS ${NUM_CORES})
   else ()


Add /d2ssa-cfg-sink- workaround for MSVC NEON

--- Source/cmake_core.cmake
+++ Source/cmake_core.cmake
@@ -204,6 +204,12 @@
                     ASTCENC_F16C=0)
         endif()

+        # Workaround MSVC codegen bug for NEON builds see:
+        # https://developercommunity.visualstudio.com/t/inlining-turns-constant-into-register-operand-for/1394798
+        target_compile_options(${NAME}
+            PRIVATE
+            $<$<CXX_COMPILER_ID:MSVC>:/d2ssa-cfg-sink->)
+
     elseif((${ISA_SIMD} MATCHES "sse2") OR (${UNIVERSAL_BUILD} AND ${ISA_SSE2}))
         if(NOT ${UNIVERSAL_BUILD})
             target_compile_definitions(${NAME}


printing number of build errors and warnings

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -146,8 +146,12 @@
 ENDIF()
 ctest_configure()

-ctest_build(RETURN_VALUE retval)
+ctest_build(RETURN_VALUE retval
+            NUMBER_ERRORS build_errors
+            NUMBER_WARNINGS build_warnings)
 message("test.cmake: ctest_build return value = ${retval}")
+message("test.cmake: ctest_build #errors = ${build_errors}")
+message("test.cmake: ctest_build #warnings = ${build_warnings}")
 IF (NOT retval EQUAL 0)
   message(FATAL_ERROR "test.cmake: build failed")
 ENDIF()


SuperBuild: fix last macro call

SuperBuild: fix last macro call


ENH: Upgrade EXPAT to 2.4.8

ENH: Upgrade EXPAT to 2.4.8

--- SuperBuild/CMake/External_expat.cmake
+++ SuperBuild/CMake/External_expat.cmake
@@ -24,8 +24,8 @@

 ExternalProject_Add(EXPAT
   PREFIX EXPAT
-  URL "https://downloads.sourceforge.net/project/expat/expat/2.4.6/expat-2.4.6.tar.gz"
-  URL_MD5 f1a94f57311ba32e7a525ab0a098cccf
+  URL "https://downloads.sourceforge.net/project/expat/expat/2.4.8/expat-2.4.8.tar.gz"
+  URL_MD5 ce5fa3fa4d866d83ab0cfb00bb95b77a
   BINARY_DIR ${EXPAT_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}


Fix wrong folder path for cmake libbullet. Folder MiniCLTask and scalar

--- Tools/CMake/libraries/libbullet.cmake
+++ Tools/CMake/libraries/libbullet.cmake
@@ -40,9 +40,9 @@
   addDef( "WIN32" )

   addPath( "${libDir}/bullet/src/BulletMultiThreaded" )
-  addPath( "${libDir}/bullet/src/BulletMultiThreaded/MiniCLTask" )
+  addPath( "${libDir}/bullet/src/MiniCL/MiniCLTask" )
   addPath( "${libDir}/bullet/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask" )
-  addInclude( "${libDir}/bullet/src/BulletMultiThreaded/vectormath/scalar/cpp" )
+  addInclude( "${libDir}/bullet/src/vectormath/scalar" )
 endif()

 addInclude( "${libDir}/bullet/src" )


Disabling gbenchmark for now because intel

--- tests/hunter.cmake
+++ tests/hunter.cmake
@@ -16,11 +16,11 @@
   message(FATAL_ERROR "Did not use hunter to download CCFits")
 endif()

-hunter_add_package(GBenchmark)
-find_package(GBenchmark REQUIRED)
-if(NOT GBENCHMARK_INCLUDE_DIR MATCHES "${HUNTER_ROOT}/.*")
-  message(FATAL_ERROR "Did not use hunter to download GBenchmark")
-endif()
+# hunter_add_package(GBenchmark)
+# find_package(GBenchmark REQUIRED)
+# if(NOT GBENCHMARK_INCLUDE_DIR MATCHES "${HUNTER_ROOT}/.*")
+#   message(FATAL_ERROR "Did not use hunter to download GBenchmark")
+# endif()

 hunter_add_package(F2C)
 find_package(F2C REQUIRED)


Adding support for easybuild modules

Adding support for easybuild modules

Former-commit-id: 8d5aca3f18c4992d49f44dc2394720dadc19ac61

--- cmake-modules/Fetch_Glog.cmake
+++ cmake-modules/Fetch_Glog.cmake
@@ -4,12 +4,12 @@

 if(TARGET glog::glog)
-    message(STATUS "Searching for glog 0.4.x - Success: ${GLOG_LIBRARIES}")
     get_target_property(GLOG_INCLUDE_DIR glog::glog INTERFACE_INCLUDE_DIRECTORIES)
     get_target_property(GLOG_LIBRARIES   glog::glog INTERFACE_LINK_LIBRARIES)
+    message(STATUS "Searching for glog 0.4.x - Success: LIB: ${GLOG_LIBRARIES}")
+    message(STATUS "Searching for glog 0.4.x - Success: INC: ${GLOG_INCLUDE_DIR}")
     set_target_properties(glog::glog PROPERTIES INTERFACE_LINK_LIBRARIES "${INSTALL_DIRECTORY}/glog/lib/libglog${CUSTOM_SUFFIX}")
     set_target_properties(glog::glog PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${GLOG_INCLUDE_DIR}")
-    message(STATUS "glog FOUND IN SYSTEM: ${GLOG_INCLUDE_DIR}")
 else()
     message(STATUS "Searching for glog 0.4.x - failed")
     message(STATUS "glog will be installed into ${INSTALL_DIRECTORY}/glog on first build.")


MSVC: static linker flag for release when LTCG enabled is set incorrectly?

--- cmake-toolchains/windows.cmake
+++ cmake-toolchains/windows.cmake
@@ -84,7 +84,7 @@
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /GL")
     set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG")
-    set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS} /LTCG")
+    set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} /LTCG")
 endif()

 # update cache variables for cmake gui


change to setting CMAKE_CXX_STANDARD

change to setting CMAKE_CXX_STANDARD

--- cmake/DefaultConfigTypes.cmake
+++ cmake/DefaultConfigTypes.cmake
@@ -4,9 +4,10 @@
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
 endif()

-set(CMAKE_CXX_FLAGS_RELEASE "-std=c++14 -pedantic -O2 -DNDEBUG")
+set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_CXX_FLAGS_RELEASE "-pedantic -O2 -DNDEBUG")
 set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_DEBUG "-std=c++14 -pedantic -g  -O0 -DDEBUG -D_DEBUG")
+set(CMAKE_CXX_FLAGS_DEBUG "-pedantic -g  -O0 -DDEBUG -D_DEBUG")
 set(CMAKE_C_FLAGS_DEBUG "-g -O0 -DDEBUG -D_DEBUG")
 # Handle some compile flag options
 option(DEBUG_FLAG_GLIBCXX_DEBUG "use gcc flag -D_GLIBCXX_DEBUG when CMAKE_BUILD_TYPE is Debug" OFF)


SWDEV-320486 - Correctly set HSAIL_ELFTOOLCHAIN_DIR

Change-Id: Icb39b376eaf3a8132b210bd1bd4eeecaa97bea9d

--- cmake/FindAMD_HSA_LOADER.cmake
+++ cmake/FindAMD_HSA_LOADER.cmake
@@ -51,6 +51,7 @@
 # TODO compiler team requested supporting sp3 disassembly
 set(NO_SI_SP3 "yes" CACHE FORCE "")
 set(HSAIL_COMPILER_SOURCE_DIR "${AMD_LIBELF_INCLUDE_DIR}/../../../../..")
+set(HSAIL_ELFTOOLCHAIN_DIR ${HSAIL_COMPILER_SOURCE_DIR}/lib/loaders/elf/utils)
 add_subdirectory("${AMD_LIBELF_INCLUDE_DIR}" ${CMAKE_CURRENT_BINARY_DIR}/libelf)
 add_subdirectory("${AMD_HSAIL_INCLUDE_DIR}/../ext/libamdhsacode" ${CMAKE_CURRENT_BINARY_DIR}/libamdhsacode)
 add_subdirectory("${AMD_HSAIL_INCLUDE_DIR}/../ext/loader" ${CMAKE_CURRENT_BINARY_DIR}/loader)


look for libav unconditionally

look for libav unconditionally

--- cmake/modules/FindFFmpeg.cmake
+++ cmake/modules/FindFFmpeg.cmake
@@ -104,10 +104,7 @@
 FFMPEG_FIND(LIBAVUTIL   avutil   avutil.h)
 FFMPEG_FIND(LIBSWSCALE  swscale  swscale.h)  # not sure about the header to look for here.
 FFMPEG_FIND(LIBSWRESAMPLE  swresample  swresample.h)  # not sure about the header to look for here.
-
-IF(NOT FFMPEG_LIBSWRESAMPLE_FOUND)
-	FFMPEG_FIND(LIBAVRESAMPLE  avresample  avresample.h)
-ENDIF()
+FFMPEG_FIND(LIBAVRESAMPLE  avresample  avresample.h)

 SET(FFMPEG_FOUND "NO")
 # Note we don't check FFMPEG_LIBSWSCALE_FOUND here, it's optional.


Let CMake manage RPATH entries

Let CMake manage RPATH entries

Adding RPATH entries manually and via CMAKE_*RPATH* facilities may lead
to conflict of authorities. This instance in particular tries to add the
same RPATH entry twice (fails on MacOS).

--- cmake/modules/SetUpMacOS.cmake
+++ cmake/modules/SetUpMacOS.cmake
@@ -139,7 +139,7 @@
   endif()

   #---Set Linker flags----------------------------------------------------------------------
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}  -mmacosx-version-min=${MACOSX_VERSION} -Wl,-rpath,@loader_path/../lib")
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}")

 else (CMAKE_SYSTEM_NAME MATCHES Darwin)


cmake: reuse interface lib for compile options if it already exists

Fixes: #43835

In zephyr_library_compile_options() the existence of the compile
options interface library is checked and function returns if it already
exists. This results in #43835 meaning two libraries cannot add the
same option.

This commit fixes this by re-using the already created unique interface
library and link this to the Zephyr library.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/modules/extensions.cmake
+++ cmake/modules/extensions.cmake
@@ -500,13 +500,11 @@
   string(MD5 uniqueness ${item})
   set(lib_name options_interface_lib_${uniqueness})

-  if (TARGET ${lib_name})
-    # ${item} already added, ignoring duplicate just like CMake does
-    return()
-  endif()
-
-  add_library(           ${lib_name} INTERFACE)
-  target_compile_options(${lib_name} INTERFACE ${item} ${ARGN})
+  if (NOT TARGET ${lib_name})
+    # Create the unique target only if it doesn't exist.
+    add_library(           ${lib_name} INTERFACE)
+    target_compile_options(${lib_name} INTERFACE ${item} ${ARGN})
+  endif()

   target_link_libraries(${ZEPHYR_CURRENT_LIBRARY} PRIVATE ${lib_name})
 endfunction()


find zmq.h

find zmq.h

--- cmake_modules/FindZeroMQ.cmake
+++ cmake_modules/FindZeroMQ.cmake
@@ -13,7 +13,7 @@

 	# Include dir
 	find_path(ZeroMQ_INCLUDE_DIR
-	  NAMES zmq.hpp
+	  NAMES zmq.h
 	  PATHS ${ZEROMQ_ROOT}/include ${ZeroMQ_PKGCONF_INCLUDE_DIRS}
 	)

@@ -24,7 +24,7 @@
 	)
 ELSEIF (WIN32)
 	find_path(ZeroMQ_INCLUDE_DIR
-	  NAMES zmq.hpp
+	  NAMES zmq.h
 	  PATHS ${ZEROMQ_ROOT}/include ${CMAKE_INCLUDE_PATH}
 	)
 	# Finally the library itself


Exclude files starting with ex_

Exclude files starting with ex_

--- modules/CommonFunctions.cmake
+++ modules/CommonFunctions.cmake
@@ -44,6 +44,8 @@
       "${dir}/*.cpp"
   )

+  LIST(FILTER source_list EXCLUDE REGEX "ex\\_")
+
   foreach(source IN LISTS source_list)
     if (IS_ABSOLUTE "${source}")
         file(RELATIVE_PATH source_rel "${dir}" "${source}")


cmake bugfix: don't ignore multiple arguments

--- lib/Summary.cmake
+++ lib/Summary.cmake
@@ -9,13 +9,13 @@
   if (${namelength} GREATER ${max_name_length})
       set (max_name_length ${namelength})
   endif (${namelength} GREATER ${max_name_length})
-  if (${test})
+  if (${test} ${ARGN})
       list(APPEND summary_willbuild "${name}")
       list(APPEND summary_willbuild_d "${description}")
-  else (${test})
+  else (${test} ${ARGN})
       list(APPEND summary_willnotbuild "${name}")
       list(APPEND summary_willnotbuild_d "${description}")
-  endif (${test})
+  endif (${test} ${ARGN})
 endmacro(summary_add)

 macro(summary_show_part variable descriptions title)


build: fix FLB_OPTION cmake macro (#1802)

This patch fixes FLB_OPTION cmake macro's argument order to avoid cmake
warning.

Signed-off-by: Lee Byeoksan <efd928a762d94c0737b7efcc346ace0a5da782be@gmail.com>

--- cmake/macros.cmake
+++ cmake/macros.cmake
@@ -6,5 +6,5 @@
 endmacro()

 macro(FLB_OPTION option value)
-  set(${option} ${value} CACHE "" INTERNAL FORCE)
+  set(${option} ${value} CACHE INTERNAL "" FORCE)
 endmacro()


versions: update URLs for new repo locations

--- versions.cmake
+++ versions.cmake
@@ -43,9 +43,9 @@
   URL_MD5 2edbe4d6c2eff33ef91732602f3518eb)

 add_revision(paraview
-  GIT_REPOSITORY git://paraview.org/stage/ParaView.git
+  GIT_REPOSITORY https://gitlab.kitware.com/paraview/paraview.git
   GIT_TAG master)

 add_revision(tomviz
-  GIT_REPOSITORY https://github.com/cryos/matviz
+  GIT_REPOSITORY https://github.com/OpenChemistry/matviz
   GIT_TAG master)


Use the branch name for matviz

Use the branch name for matviz

--- versions.cmake
+++ versions.cmake
@@ -28,4 +28,4 @@

 add_revision(matviz
   GIT_REPOSITORY https://github.com/mathstuf/matviz
-  GIT_TAG 1d5045b60dbf289a3b021d3f49bee5ccbc783c23) # install rules
+  GIT_TAG dev/add-install-rules)


Build: Produce lower case gppkg (4.3ORCA -> 4.3orca)

--- src/ports/greenplum/cmake/GreenplumUtils.cmake
+++ src/ports/greenplum/cmake/GreenplumUtils.cmake
@@ -13,7 +13,8 @@
     set(${OUT_FEATURES} "${${OUT_FEATURES}}" PARENT_SCOPE)
 endfunction(define_greenplum_features)

-function(add_gppkg GPDB_VERSION GPDB_VARIANT GPDB_VARIANT_SHORT UPGRADE_SUPPORT)
+function(add_gppkg GPDB_VERSION_UC GPDB_VARIANT GPDB_VARIANT_SHORT UPGRADE_SUPPORT)
+    string(TOLOWER ${GPDB_VERSION_UC} GPDB_VERSION)
     string(REPLACE "." "_" VERSION_ "${GPDB_VERSION}")

     file(WRITE "${CMAKE_BINARY_DIR}/deploy/gppkg/${GPDB_VARIANT}_${VERSION_}_gppkg.cmake" "


[cmake] compilation broken if lpsolve library found without headers

--- Numerics/cmake/FindLpSolve.cmake
+++ Numerics/cmake/FindLpSolve.cmake
@@ -1,28 +1,30 @@
 #Please note that we are using lpsolve 5.5
 FIND_PATH(LpSolve_INCLUDE_DIR lpsolve/lp_lib.h)

-# debian nonsense: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503314
-if(EXISTS "/etc/debian_version")
-  FIND_LIBRARY(LpSolve_LIBRARY lpsolve55 PATH_SUFFIXES "lp_solve")
-  IF(LpSolve_LIBRARY AND "${LpSolve_LIBRARY}" MATCHES ".a$" AND NOT I_WANT_STATIC_LPSOLVE)
-    SET(LpSolve_LIBRARY FALSE)
+IF (NOT LpSolve_INCLUDE_DIR)
+  MESSAGE(STATUS "Cannot find LPSOLVE headers")
+ELSE()
+  # debian nonsense: see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=503314
+  if(EXISTS "/etc/debian_version")
+    FIND_LIBRARY(LpSolve_LIBRARY lpsolve55 PATH_SUFFIXES "lp_solve")
+    IF(LpSolve_LIBRARY AND "${LpSolve_LIBRARY}" MATCHES ".a$" AND NOT I_WANT_STATIC_LPSOLVE)
+      SET(LpSolve_LIBRARY FALSE)
+    ENDIF()
+  ELSE()
+    FIND_LIBRARY(LpSolve_LIBRARY lpsolve55)
   ENDIF()
-ELSE()
-  FIND_LIBRARY(LpSolve_LIBRARY lpsolve55)
-ENDIF()
-
-IF (NOT LpSolve_INCLUDE_DIR)
-  MESSAGE("Cannot find LPSOLVE headers!")
+
+  IF (LpSolve_LIBRARY)
+    GET_FILENAME_COMPONENT(LpSolve_LIBRARY_DIRS ${LpSolve_LIBRARY} PATH)
+    GET_FILENAME_COMPONENT(LpSolve_LIBRARIES ${LpSolve_LIBRARY} NAME)
+    GET_FILENAME_COMPONENT(LpSolve_LIBRARY_DIRS_DIR ${LpSolve_LIBRARY_DIRS} PATH)
+    SET(LpSolve_FOUND 1)
+  ELSE(LpSolve_LIBRARY)
+    MESSAGE("Cannot find LPSOLVE libraries!")
+  ENDIF (LpSolve_LIBRARY)
+  IF (NOT LpSolve_FIND_QUIETLY)
+    MESSAGE(STATUS "Found LpSolve: ${LpSolve_LIBRARY}")
+    MESSAGE(STATUS "LpSolve_LIBRARIES: ${LpSolve_LIBRARIES}")
+  ENDIF (NOT LpSolve_FIND_QUIETLY)
+
 ENDIF (NOT LpSolve_INCLUDE_DIR)
-IF (LpSolve_LIBRARY)
-  GET_FILENAME_COMPONENT(LpSolve_LIBRARY_DIRS ${LpSolve_LIBRARY} PATH)
-  GET_FILENAME_COMPONENT(LpSolve_LIBRARIES ${LpSolve_LIBRARY} NAME)
-  GET_FILENAME_COMPONENT(LpSolve_LIBRARY_DIRS_DIR ${LpSolve_LIBRARY_DIRS} PATH)
-  SET(LpSolve_FOUND 1)
-ELSE(LpSolve_LIBRARY)
-  MESSAGE("Cannot find LPSOLVE libraries!")
-ENDIF (LpSolve_LIBRARY)
-IF (NOT LpSolve_FIND_QUIETLY)
-  MESSAGE(STATUS "Found LpSolve: ${LpSolve_LIBRARY}")
-  MESSAGE(STATUS "LpSolve_LIBRARIES: ${LpSolve_LIBRARIES}")
-ENDIF (NOT LpSolve_FIND_QUIETLY)


ENH: Update ITK version

ENH: Update ITK version

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -33,7 +33,7 @@
 #if(DEFINED ${extProjName}_DIR AND NOT EXISTS ${${extProjName}_DIR})
 #  message(FATAL_ERROR "${extProjName}_DIR variable is defined but corresponds to non-existing directory (${${extProjName}_DIR})")
 #endif()
-set(${proj}_DEPENDENCIES "")
+set(${proj}_DEPENDENCIES "VTK")

 if(NOT ( DEFINED "USE_SYSTEM_${extProjName}" AND "${USE_SYSTEM_${extProjName}}" ) )
   #message(STATUS "${__indent}Adding project ${proj}")
@@ -159,6 +159,8 @@
       -DITK_WRAPPING:BOOL=OFF #${BUILD_SHARED_LIBS} ## HACK:  QUICK CHANGE
       -DITK_USE_SYSTEM_DCMTK:BOOL=${${PROJECT_NAME}_BUILD_DICOM_SUPPORT}
       -DModule_ITKIOPhilipsREC:BOOL=ON
+      -DModule_ITKVtkGlue:BOOL=ON
+      -DVTK_DIR:PATH=${VTK_DIR}
       ${${proj}_TIFF_ARGS}
       ${${proj}_JPEG_ARGS}
       ${${proj}_ZLIB_ARGS}
@@ -170,8 +172,8 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_GIT_TAG 9dc4f194046cedb4b392e181caec73b629ae7564)
-  set(ITK_VERSION_ID ITK-4.6)
+  set(${proj}_GIT_TAG 74155d0b7059fde841832c92a9aec78c79bc68c0)
+  set(ITK_VERSION_ID ITK-4.8)

   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${${proj}_REPOSITORY}


Update PythonExternal.cmake

Update PythonExternal.cmake

--- Superbuild/PythonExternal.cmake
+++ Superbuild/PythonExternal.cmake
@@ -162,7 +162,7 @@
       SET(SCI_PYTHON_64BIT_MODULE_LIBRARY_PATH ${INSTALL_DIR}/lib64/${SCI_PYTHON_NAME} CACHE INTERNAL "Python modules." FORCE)
     ENDIF()
     SET(SCI_PYTHON_EXE ${INSTALL_DIR}/bin/${SCI_PYTHON_NAME})
-    SET(SCI_PYTHON_LIBRARY ${SCI_PYTHON_NAME}${ABIFLAGS})
+    SET(SCI_PYTHON_LIBRARY ${SCI_PYTHON_NAME})

     # required by interpreter interface
     SET(PYTHON_MODULE_SEARCH_PATH ${SCI_PYTHON_MODULE_PARENT_PATH}/${SCI_PYTHON_NAME} CACHE INTERNAL "Python modules." FORCE)


[numerics] modify tolerances to avoid timeout in debug mode

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -568,9 +568,9 @@
     INTERNAL_IPARAM SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP
     WILL_FAIL)

-  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_AC 1e-2 1000)
-  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_FB 1e-3 1000)
-  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_NM 1e-3 1000)
+  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_AC 5e-2 1000)
+  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_FB 5e-2 1000)
+  NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat SICONOS_FRICTION_3D_NSN_NM 5e-2 1000)

   NEW_FC_3D_TEST(KaplasTower-i1061-4.hdf5.dat
     SICONOS_FRICTION_3D_PROX  1e-3 10
@@ -732,7 +732,7 @@
   NEW_GFC_3D_TEST(problem-checkTwoRods1.dat SICONOS_GLOBAL_FRICTION_3D_NSN_AC_WR 0 0
     0 0 0
     INTERNAL_IPARAM 0 1000
-    INTERNAL_DPARAM 0 1e-5)
+    INTERNAL_DPARAM 0 1e-10)
   NEW_GFC_3D_TEST(problem-checkTwoRods1.dat SICONOS_GLOBAL_FRICTION_3D_NSGS)
   NEW_TEST(gfc3d_NSGS_WR_ONECONTACT_NSN_AC_GP_problem-checkTwoRods1 gfc3d_test15.c)
   NEW_GFC_3D_TEST(problem-check.dat SICONOS_GLOBAL_FRICTION_3D_NSN_AC)


[numerics] add a test that forces NM_SPARSE strorage for fc3d_admm

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -955,9 +955,14 @@
       0 0 0
       IPARAM SICONOS_FRICTION_3D_ADMM_IPARAM_RHO_STRATEGY  SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING)

-    NEW_FC_3D_TEST_HDF5(LMGC_100_PR_PerioBox-i00361-60-03000.hdf5 SICONOS_FRICTION_3D_ADMM 1e-08 10000
+    NEW_FC_3D_TEST_HDF5(LMGC_100_PR_PerioBox-i00361-60-03000.hdf5 SICONOS_FRICTION_3D_ADMM 1e-08 100000
       0 0 0
       IPARAM SICONOS_FRICTION_3D_ADMM_IPARAM_RHO_STRATEGY  SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING)
+
+    NEW_FC_3D_TEST_HDF5(LMGC_100_PR_PerioBox-i00361-60-03000.hdf5 SICONOS_FRICTION_3D_ADMM 1e-08 100000
+      0 0 0
+      IPARAM SICONOS_FRICTION_3D_ADMM_IPARAM_RHO_STRATEGY  SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_RESIDUAL_BALANCING
+      IPARAM SICONOS_FRICTION_3D_ADMM_IPARAM_SPARSE_STORAGE  SICONOS_FRICTION_3D_ADMM_FORCED_SPARSE_STORAGE)

     NEW_GFC_3D_TEST_HDF5(LMGC_GFC3D_CubeH8.hdf5 SICONOS_GLOBAL_FRICTION_3D_NSGS)
     NEW_GFC_3D_TEST_HDF5(LMGC_GFC3D_CubeH8.hdf5 SICONOS_GLOBAL_FRICTION_3D_NSN_AC)


[nuemerics] Remove one unstable test with UMFPACK 	    - the reason of failing is unknown for the moment. The matrix seems to be singular 	    - hoping that is not due to recent modifications in NM_copy.

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -361,6 +361,7 @@

   IF(WITH_UMFPACK)
     SET(fc3d__ADMM_Tol_1e-5_Max_10000_inTol_0_inMax_0_IPARAM_SICONOS_FRICTION_3D_ADMM_RHO_STRATEGY_CONSTANT_Confeti-ex13-Fc3D-SBM_PROPERTIES WILL_FAIL TRUE)
+    SET(fc3d__NSN_AC_Tol_5e-2_Max_1000_inTol_0_inMax_0_KaplasTower-i1061-4.hdf5_PROPERTIES WILL_FAIL TRUE)
   ENDIF()


deactivate LIBKML and OpenCV for msvc

deactivate LIBKML and OpenCV for msvc

--- CMake/External_OTB.cmake
+++ CMake/External_OTB.cmake
@@ -5,6 +5,9 @@
 set(OTB_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)

 set(${proj}_DEPENDENCIES)
+
+set(BUILD_LIBKML OFF)
+set(BUILD_OPENCV OFF)

 if(USE_SYSTEM_GDAL)
   set(OTB_SB_GDAL_CONFIG)
@@ -111,6 +114,22 @@
   list(APPEND ${proj}_DEPENDENCIES CURL)
 endif()

+if(MSVC)
+    set(OTB_SB_GDAL_CONFIG)
+    set(OTB_SB_OSSIM_CONFIG)
+    set(OTB_SB_MUPARSER_CONFIG)
+    set(OTB_SB_MUPARSERX_CONFIG)
+    set(OTB_SB_TINYXML_CONFIG)
+    set(OTB_SB_LIBKML_CONFIG)
+    set(OTB_SB_OPENCV_CONFIG)
+    set(OTB_SB_CURL_CONFIG)
+    #force libkml and opencv OFF)
+    set(BUILD_LIBKML OFF)
+    set(BUILD_OPENCV OFF)
+    list(REMOVE_ITEM ${proj}_DEPENDENCIES CURL)
+    list(REMOVE_ITEM ${proj}_DEPENDENCIES LIBKML)
+    list(REMOVE_ITEM ${proj}_DEPENDENCIES OPENCV)
+endif()
 ExternalProject_Add(${proj}
     DEPENDS ${${proj}_DEPENDENCIES}
     PREFIX ${proj}
@@ -129,9 +148,14 @@
       -DCMAKE_PREFIX_PATH:STRING=${CMAKE_INSTALL_PREFIX}
       -DOTB_DATA_ROOT:STRING=${OTB_DATA_ROOT}
       -DOTB_USE_EXTERNAL_OSSIM:BOOL=ON
-      -DOTB_USE_EXTERNAL_LIBKML:BOOL=ON
       -DOTB_USE_EXTERNAL_BOOST:BOOL=ON
-      -DOTB_USE_OPENCV:BOOL=ON
+      -DOTB_USE_EXTERNAL_ITK:BOOL=ON
+      -DOTB_USE_EXTERNAL_MUPARSER:BOOL=ON
+      -DOTB_USE_EXTERNAL_MUPARSERX:BOOL=ON
+      -DOTB_USE_EXTERNAL_TINYXML:BOOL=ON
+      -DOTB_USE_EXTERNAL_EXPAT:BOOL=ON
+      -DOTB_USE_EXTERNAL_LIBKML:BOOL=${BUILD_LIBKML}
+      -DOTB_USE_OPENCV:BOOL=${BUILD_OPENCV}
       ${OTB_SB_ITK_CONFIG}
       ${OTB_SB_OSSIM_CONFIG}
       ${OTB_SB_GDAL_CONFIG}


modules: topo-sort modules with kits as well

When kits are enabled, we need to group modules together into kits and
then topo-sort.

Change-Id: I013f432558b78a1946100b9f0ca739b73c94841e

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -199,6 +199,42 @@
 # Order list to satisfy dependencies.
 include(CMake/TopologicalSort.cmake)
 topological_sort(VTK_MODULES_ENABLED "" _DEPENDS)
+set(vtk_modules_and_kits ${VTK_MODULES_ENABLED})
+if(VTK_ENABLE_KITS)
+  set(vtk_kits)
+  foreach(module IN LISTS VTK_MODULES_ENABLED)
+    if(${module}_KIT)
+      set(kit ${${module}_KIT})
+      # Set kit management variables.
+      set(_${kit}_is_kit 1)
+      list(APPEND _${kit}_modules ${module})
+      list(APPEND vtk_kits ${kit})
+      list(APPEND ${kit}_KIT_DEPENDS ${module})
+    else()
+      set(kit ${module})
+    endif()
+
+    foreach(dep IN LISTS ${module}_DEPENDS)
+      if(${dep}_KIT)
+        # Ignore self dependencies.
+        if(NOT kit STREQUAL ${dep}_KIT)
+          # Depend on the dependency's kit.
+          list(APPEND ${module}_KIT_DEPENDS ${${dep}_KIT})
+        endif()
+      endif()
+
+      # Keep the original dependency.
+      list(APPEND ${module}_KIT_DEPENDS ${dep})
+    endforeach()
+  endforeach()
+
+  # Put all kits in the list (if they are not dependencies of any module, they
+  # will be dropped otherwise).
+  list(APPEND vtk_modules_and_kits ${vtk_kits})
+
+  # Sort all modules and kits.
+  topological_sort(vtk_modules_and_kits "" _KIT_DEPENDS)
+endif()

 # Report what will be built.


Fix for ROOT-8444 - Export cmake targets into own namespace

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -645,7 +645,7 @@
 install(FILES ${CMAKE_BINARY_DIR}/ROOTConfig-version.cmake
               ${CMAKE_BINARY_DIR}/installtree/ROOTUseFile.cmake
               ${CMAKE_BINARY_DIR}/installtree/ROOTConfig.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})
-install(EXPORT ${CMAKE_PROJECT_NAME}Exports FILE ROOTConfig-targets.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})
+install(EXPORT ${CMAKE_PROJECT_NAME}Exports NAMESPACE ROOT:: FILE ROOTConfig-targets.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})

 #---Especial definitions for root-config et al.--------------------------------------------------------------


PS-7622 - Improve checking for supported flags in TokuDB

- Rename `CHECK_<LANG>_COMPILER_FLAG` to
  `TOKUDB_CHECK_<LANG>_COMPILER_FLAG` to avoid a name clash with the one
defined in `Check<LANG>CompilerFlag`.

- Use `CMAKE_PUSH_CHECK_STATE` with RESET.

- Use a variable result per flag to avoid using the cached one.

- Add new entries to the `FAIL REGEX` array that detected during the
  compilation.

- Fix the expression restoring the value of CMAKE_<LANG>_FLAGS

- Remove `include(CheckCCompilerFlag)` as it not used anymore

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -43,59 +43,64 @@
   find_program(COVERAGE_COMMAND NAMES gcov47 gcov)
 endif (USE_GCOV)

-include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CMakePushCheckState)
-
-MACRO (CHECK_C_COMPILER_FLAG FLAG RESULT)
-  CMAKE_PUSH_CHECK_STATE()
-  set(OLD_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
-  set(CMAKE_C_FLAGS "")
+include(CheckCSourceCompiles)
+include(CheckCXXSourceCompiles)
+
+SET(fail_patterns
+  FAIL_REGEX "unknown argument ignored"
+  FAIL_REGEX "argument unused during compilation"
+  FAIL_REGEX "unsupported .*option"
+  FAIL_REGEX "unknown .*option"
+  FAIL_REGEX "unrecognized .*option"
+  FAIL_REGEX "ignoring unknown option"
+  FAIL_REGEX "[Ww]arning: [Oo]ption"
+  FAIL_REGEX "error: visibility"
+  FAIL_REGEX "warning: visibility"
+  FAIL_REGEX "warning:.*is valid for.*but not for"
+  FAIL_REGEX "error:.*is valid for.*but not for"
+  )
+
+MACRO (TOKUDB_CHECK_C_COMPILER_FLAG FLAG RESULT)
+  CMAKE_PUSH_CHECK_STATE(RESET)
+  SET(OLD_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+  SET(CMAKE_C_FLAGS)
+
   SET(CMAKE_REQUIRED_FLAGS "-Werror ${FLAG}")
-  CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT}
-          FAIL_REGEX "unknown argument ignored"
-          FAIL_REGEX "argument unused during compilation"
-          FAIL_REGEX "unsupported .*option"
-          FAIL_REGEX "unknown .*option"
-          FAIL_REGEX "unrecognized .*option"
-          FAIL_REGEX "ignoring unknown option"
-          FAIL_REGEX "[Ww]arning: [Oo]ption"
-          FAIL_REGEX "error: visibility"
-          FAIL_REGEX "warning: visibility"
-          )
-  set(${CMAKE_C_FLAGS} OLD_CMAKE_C_FLAGS)
+  CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} ${fail_patterns})
+
+  SET(CMAKE_C_FLAGS ${OLD_CMAKE_C_FLAGS})
   CMAKE_POP_CHECK_STATE()
 ENDMACRO()

-MACRO (CHECK_CXX_COMPILER_FLAG FLAG RESULT)
-  CMAKE_PUSH_CHECK_STATE()
-  set(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-  set(CMAKE_CXX_FLAGS "")
+MACRO (TOKUDB_CHECK_CXX_COMPILER_FLAG FLAG RESULT)
+  CMAKE_PUSH_CHECK_STATE(RESET)
+  SET(OLD_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
+  SET(CMAKE_CXX_FLAGS)
+
   SET(CMAKE_REQUIRED_FLAGS "-Werror ${FLAG}")
-  CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT}
-          FAIL_REGEX "unknown argument ignored"
-          FAIL_REGEX "argument unused during compilation"
-          FAIL_REGEX "unsupported .*option"
-          FAIL_REGEX "unknown .*option"
-          FAIL_REGEX "unrecognized .*option"
-          FAIL_REGEX "ignoring unknown option"
-          FAIL_REGEX "[Ww]arning: [Oo]ption"
-          FAIL_REGEX "error: visibility"
-          FAIL_REGEX "warning: visibility"
-          )
-  set(${CMAKE_CXX_FLAGS} OLD_CMAKE_CXX_FLAGS)
+  CHECK_CXX_SOURCE_COMPILES("int main(void) { return 0; }" ${RESULT} ${fail_patterns})
+
+  SET(CMAKE_CXX_FLAGS ${OLD_CMAKE_CXX_FLAGS})
   CMAKE_POP_CHECK_STATE()
 ENDMACRO()

 ## prepends a compiler flag if the compiler supports it
 MACRO (prepend_cflags_if_supported)
   FOREACH (flag ${ARGN})
-    CHECK_C_COMPILER_FLAG("${flag}" C_RESULT)
-    CHECK_CXX_COMPILER_FLAG("${flag}" CXX_RESULT)
-    IF(C_RESULT)
+    # Create a result variable per flag to avoid reusing the same cached result
+    STRING(REGEX REPLACE "[-,= +]" "_" FLAG2 ${flag})
+
+    SET(VAR_RES "C_RESULT_${FLAG2}")
+    TOKUDB_CHECK_C_COMPILER_FLAG(${flag} ${VAR_RES})
+    IF(${VAR_RES})
       SET (CMAKE_C_FLAGS "${flag} ${CMAKE_C_FLAGS}")
     ENDIF()
-    IF(CXX_RESULT)
+
+    SET(VAR_RES "CXX_RESULT_${FLAG2}")
+    TOKUDB_CHECK_CXX_COMPILER_FLAG(${flag} ${VAR_RES})
+    IF(${VAR_RES})
       SET (CMAKE_CXX_FLAGS "${flag} ${CMAKE_CXX_FLAGS}")
     ENDIF()
   ENDFOREACH (flag)


i#2924 VS2017: Fix mismatched CMake if/endif (#4010)

Fixes this error reported by CMake caused by 53577d7 (PR #3860):

CMake Warning (dev) at C:/projects/dynamorio/suite/runsuite.cmake:275 (testbuild_ex):
  A logical block opening on the line
    C:/projects/dynamorio/suite/runsuite_common_pre.cmake:534 (if)
  closes on the line
    C:/projects/dynamorio/suite/runsuite_common_pre.cmake:562 (endif)
  with mis-matching arguments.

Issue: #2924

--- suite/runsuite_common_pre.cmake
+++ suite/runsuite_common_pre.cmake
@@ -1,5 +1,5 @@
 # **********************************************************
-# Copyright (c) 2011-2019 Google, Inc.    All rights reserved.
+# Copyright (c) 2011-2020 Google, Inc.    All rights reserved.
 # Copyright (c) 2009-2010 VMware, Inc.    All rights reserved.
 # **********************************************************

@@ -559,7 +559,7 @@
             message("Env setup: setting LIBPATH to ${newlibpath}")
           endif ()
           set(ENV{LIBPATH} "${newlibpath}")
-        endif ("$ENV{LIB}" MATCHES "[Aa][Mm][Dd]64")
+        endif ()
       endif (is64)
     else (WIN32)
       if (ARCH_IS_X86)