[CMake] Support distribution install for LLDB.framework

This patch adds the last bit of support to get LLVM_DISTRIBUTION_COMPONENTS working with libLLDB when built as a framework.

This patch adds dummy install targets for binaries built into the framework's Resources directory, and makes the framework's install target depend on all the binaries that get installed with the framework.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@290273 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -124,6 +124,16 @@
             RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:liblldb>/Resources
             BUILD_WITH_INSTALL_RPATH On
             INSTALL_RPATH "@loader_path/../../../../${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
+      # For things inside the framework we don't need functional install targets
+      # because CMake copies the resources and headers from the build directory.
+      # But we still need this target to exist in order to use the
+      # LLVM_DISTRIBUTION_COMPONENTS build option. We also need the
+      # install-liblldb target to depend on this tool, so that it gets put into
+      # the Resources directory before the framework is installed.
+      if(ARG_GENERATE_INSTALL)
+        add_custom_target(install-${name} DEPENDS ${name})
+        add_dependencies(install-liblldb ${name})
+      endif()
     else()
       set_target_properties(${name} PROPERTIES
             BUILD_WITH_INSTALL_RPATH On
@@ -131,7 +141,7 @@
     endif()
   endif()

-  if(ARG_GENERATE_INSTALL)
+  if(ARG_GENERATE_INSTALL AND NOT ARG_INCLUDE_IN_FRAMEWORK)
     install(TARGETS ${name}
           COMPONENT ${name}
           RUNTIME DESTINATION bin)


EXPORTED_SYMBOL_FILE using mingw and cmake

Summary: This is a fix for the command line syntax error while building LTO when using MinGW.

Patch By: jsroemer

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, beanz, llvm-commits

Differential Revision: http://reviews.llvm.org/D5476

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -85,27 +85,29 @@
   else()
     set(native_export_file "${target_name}.def")

-    set(CAT "type")
-    if(CYGWIN)
-      set(CAT "cat")
-    endif()
-
-    # Using ${export_file} in add_custom_command directly confuses cmd.exe.
-    file(TO_NATIVE_PATH ${export_file} export_file_backslashes)
+    set(CAT "cat")
+    set(export_file_nativeslashes ${export_file})
+    if(WIN32 AND NOT CYGWIN)
+      set(CAT "type")
+      # Convert ${export_file} to native format (backslashes) for "type"
+      # Does not use file(TO_NATIVE_PATH) as it doesn't create a native
+      # path but a build-system specific format (see CMake bug
+      # http://public.kitware.com/Bug/print_bug_page.php?bug_id=5939 )
+      string(REPLACE / \\ export_file_nativeslashes ${export_file})
+    endif()

     add_custom_command(OUTPUT ${native_export_file}
       COMMAND ${CMAKE_COMMAND} -E echo "EXPORTS" > ${native_export_file}
-      COMMAND ${CAT} ${export_file_backslashes} >> ${native_export_file}
+      COMMAND ${CAT} ${export_file_nativeslashes} >> ${native_export_file}
       DEPENDS ${export_file}
       VERBATIM
       COMMENT "Creating export file for ${target_name}")
-    if(CYGWIN OR MINGW)
-      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                   LINK_FLAGS " ${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
-    else()
-      set_property(TARGET ${target_name} APPEND_STRING PROPERTY
-                   LINK_FLAGS " /DEF:${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
-    endif()
+    set(export_file_linker_flag "${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    if(MSVC)
+      set(export_file_linker_flag "/DEF:${export_file_linker_flag}")
+    endif()
+    set_property(TARGET ${target_name} APPEND_STRING PROPERTY
+                 LINK_FLAGS " ${export_file_linker_flag}")
   endif()

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


updated EasyFind

updated EasyFind

--- cmake_modules/FindEasyFind.cmake
+++ cmake_modules/FindEasyFind.cmake
@@ -1,4 +1,4 @@
-# easyFind version 1.1 - 17.10.2014 - # 010
+# easyFind version 1.2 - 21.10.2016 - # 011

 # clockUtils
 # Copyright (2015) Michael Baer, Daniel Bonrath, All rights reserved.
@@ -74,7 +74,7 @@
 	IF (${LIBNAME}_notFoundList)
 		SET (${LIBNAME}_FOUND FALSE)
 		IF (${EasyFind_FIND_REQUIRED})
-			message(SEND_ERROR "${LIBNAME} marked as required, but not all components were found.")
+			message(FATAL_ERROR "${LIBNAME} marked as required, but not all components were found.")
 		ELSE (${EasyFind_FIND_REQUIRED})
 			message(WARNING "Not all components were found. Continuing anyways")
 		ENDIF (${EasyFind_FIND_REQUIRED})
@@ -97,7 +97,7 @@
 	ELSE (${LIBNAME}_HEADER)
 		SET (${LIBNAME}_FOUND FALSE)
 		IF (${EasyFind_FIND_REQUIRED})
-			message(SEND_ERROR "${LIBNAME} marked as required but header not found")
+			message(FATAL_ERROR "${LIBNAME} marked as required but header not found")
 		ELSE (${EasyFind_FIND_REQUIRED})
 			IF (NOT ${LIBNAME}_FIND_QUIETLY)
 				message(WARNING "${LIBNAME} header not found")


test for homebrew

test for homebrew

--- cmake_modules/FindFREEGLUT.cmake
+++ cmake_modules/FindFREEGLUT.cmake
@@ -18,7 +18,7 @@

 FIND_LIBRARY(
   FREEGLUT_LIBRARY
-  NAMES freeglut_static freeglut glut
+  NAMES freeglut_static freeglut
   PATH
     /opt/local/lib
     ${CMAKE_LIBRARY_PATH}


fix build w/o opencv

fix build w/o opencv

--- cmakemodules/script_opencv.cmake
+++ cmakemodules/script_opencv.cmake
@@ -6,6 +6,12 @@
 set(MRPT_OPENCV_VERSION 0.0.0)
 set(MRPT_OPENCV_VERSION_HEX "0x000")
 set(MRPT_OPENCV_SRC_DIR "") # used by MRPT exported targets
+
+# Define the interface library even if we don't have opencv in the system,
+# or its use is disabled in mrpt, to simplify specifying the list of dependencies
+# in all other libs / apps:
+add_library(imp_opencv INTERFACE IMPORTED)
+

 set(OpenCV_IGNORE_PKGCONFIG OFF CACHE BOOL "Forces using OpenCVConfig.cmake to find OpenCV")
 mark_as_advanced(OpenCV_IGNORE_PKGCONFIG)
@@ -50,7 +56,6 @@
 		message(STATUS "        OpenCV_INCLUDE_DIRS: ${OpenCV_INCLUDE_DIRS}")
 	endif($ENV{VERBOSE})

-	add_library(imp_opencv INTERFACE IMPORTED)
 	set_target_properties(imp_opencv
 		PROPERTIES
 		INTERFACE_INCLUDE_DIRECTORIES "${OpenCV_INCLUDE_DIRS}"


next try

next try

--- cmake/FindOpenALSoft.cmake
+++ cmake/FindOpenALSoft.cmake
@@ -18,6 +18,8 @@
     /usr/local/opt/openal-soft/
     # Linux Include PATH
     /usr/include/AL/
+    # Windows SDK Include PATH
+    /include/
 )

 find_library(OPENALSOFT_LIBRARY


fixed shared build on macosx (fixes #1071)

git-svn-id: e98c317c6679dcf055eb388f05b44c3a6d6b38c6@1782 152afb58-edef-0310-8abb-c4023f1b3aa9

--- cmake/LighttpdMacros.cmake
+++ cmake/LighttpdMacros.cmake
@@ -7,10 +7,14 @@
   ELSE(BUILD_STATIC)
     ADD_LIBRARY(${LIBNAME} SHARED ${SRCFILES})
     SET(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} ${LIBNAME})
-    ## Windows likes to link it thisway back to app!
+    ## Windows likes to link it this way back to app!
     IF(WIN32)
         SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS lighttpd.lib)
     ENDIF(WIN32)
+
+    IF(APPLE)
+        SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES LINK_FLAGS "-flat_namespace -undefined suppress")
+    ENDIF(APPLE)
   ENDIF(BUILD_STATIC)
 ENDMACRO(ADD_AND_INSTALL_LIBRARY)


do not use fPIE by default with cmake

do not use fPIE by default with cmake

It broke the compilation with qt5.12 (with conan)

Change-Id: I6501419a5a95aa3b0d983ac5c92b71c38824a286

--- cmake/qibuild/target.cmake
+++ cmake/qibuild/target.cmake
@@ -83,10 +83,6 @@
   qi_glob(_SRC ${ARG_SRC})

   add_executable("${name}" ${_SRC})
-
-  if(UNIX AND NOT APPLE)
-    set_target_properties("${name}" PROPERTIES COMPILE_FLAGS "-fPIE")
-  endif()

   if (NOT "${ARG_DEPENDS}" STREQUAL "")
     qi_use_lib("${name}" ${ARG_DEPENDS})


XP_CMAKE_REPO_INSYNC enhancements

XP_CMAKE_REPO_INSYNC enhancements

fixes https://github.com/smanders/externpro/issues/136

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -781,6 +781,23 @@
   set(${var} "${ignoredDirs}" PARENT_SCOPE)
 endfunction()

+function(xpGitIgnoredFiles var dir)
+  if(NOT GIT_FOUND)
+    include(FindGit)
+    find_package(Git)
+  endif()
+  execute_process(
+    COMMAND ${GIT_EXECUTABLE} ls-files --exclude-standard --ignored --others
+    WORKING_DIRECTORY ${dir}
+    ERROR_QUIET
+    OUTPUT_VARIABLE ignoredFiles
+    OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  separate_arguments(ignoredFiles UNIX_COMMAND "${ignoredFiles}")
+  xpListPrependToAll(ignoredFiles ${dir} ${ignoredFiles})
+  set(${var} "${ignoredFiles}" PARENT_SCOPE)
+endfunction()
+
 function(xpGitUntrackedFiles var dir)
   if(NOT GIT_FOUND)
     include(FindGit)
@@ -805,6 +822,8 @@
     # NOTE: By default GLOB_RECURSE omits directories from result list
     file(GLOB_RECURSE dirFiles ${globexpr})
     xpGitUntrackedFiles(untrackedFiles ${item})
+    xpGitIgnoredFiles(ignoredFiles ${item})
+    list(APPEND untrackedFiles ${ignoredFiles})
     if(dirFiles AND untrackedFiles)
       list(REMOVE_ITEM dirFiles ${untrackedFiles})
     endif()
@@ -912,7 +931,9 @@
         xpGlobFiles(fmtFiles ${item} *.c *.h *.cpp *.hpp *.cu *.cuh *.proto)
       endforeach()
       list(REMOVE_ITEM repoFiles ${masterSrcList})
-      if(NOT DEFINED XP_CMAKE_REPO_INSYNC)
+      if(DEFINED XP_CMAKE_REPO_INSYNC)
+        option(XP_CMAKE_REPO_INSYNC "cmake error if repo and cmake are not in sync" ${XP_CMAKE_REPO_INSYNC})
+      else()
         option(XP_CMAKE_REPO_INSYNC "cmake error if repo and cmake are not in sync" OFF)
       endif()
       if(repoFiles)


Enabel CFG for hostfxr and hostpolicy (#2226)

--- src/corehost/cli/setup.cmake
+++ src/corehost/cli/setup.cmake
@@ -30,6 +30,9 @@
     set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /INCREMENTAL:NO")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DEBUG /PDBCOMPRESS")
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:1572864")
+
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /guard:cf")

     # Debug build specific flags
     set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/NOVCFEATURE")


updates to FindTBB

updates to FindTBB

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -61,9 +61,9 @@
       FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib NO_DEFAULT_PATH)
     ENDIF()
   ELSE()
-    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include)
-    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4)
-    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4)
+    FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
   ENDIF()

   FIND_PATH(TBB_INCLUDE_DIR_MIC tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)


TBB for MacOSX has no libc++ folder anymore, seems to be default now

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -99,7 +99,7 @@
   INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
 ELSEIF (RTCORE_ZIP_MODE)
   IF (APPLE)
-    INSTALL(PROGRAMS ${TBB_ROOT}/lib/libc++/libtbb.dylib ${TBB_ROOT}/lib/libc++/libtbbmalloc.dylib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+    INSTALL(PROGRAMS ${TBB_ROOT}/lib/libtbb.dylib ${TBB_ROOT}/lib/libtbbmalloc.dylib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
   ELSE()
     INSTALL(PROGRAMS ${TBB_ROOT}/lib/intel64/gcc4.4/libtbb.so.2 ${TBB_ROOT}/lib/intel64/gcc4.4/libtbbmalloc.so.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
   ENDIF()


removed verbosity flag

removed verbosity flag

--- cmake/EthExecutableHelper.cmake
+++ cmake/EthExecutableHelper.cmake
@@ -91,7 +91,7 @@

 	elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
 		add_custom_command(TARGET ${EXECUTABLE} POST_BUILD
-			COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir} --verbose 100"
+			COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir}"
 			WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
 		)
 		#workaround for https://bugreports.qt.io/browse/QTBUG-42083


Delete FindStlsoft module

Delete FindStlsoft module

--- cmake/Modules/FindStlsoft.cmake
+++ cmake/Modules/FindStlsoft.cmake
@@ -1,56 +0,0 @@
-#----------------------------------------------------------------------------------
-# (C) 2009 Sergey Nikulov
-#
-# Usage as follows:
-#  - just add FIND_PACKAGE(Stlsoft) in your CMakeLists.txt, then check variables
-#----------------------------------------------------------------------------------
-# STLSOFT_FOUND       - TRUE/FALSE - Found/not found
-# STLSOFT_INCLUDE_DIR - path to include
-# STLSOFT_VER_MAJOR
-# STLSOFT_VER_MINOR
-# STLSOFT_VER_REVISION
-#----------------------------------------------------------------------------------
-# TODO: need to implement FIND_PACKAGE(Stlsoft [here required version string])
-#----------------------------------------------------------------------------------
-
-set(STLSOFT_FOUND FALSE)
-
-# try get environment var first...
-set(_STLSOFT_ROOT $ENV{STLSOFT})
-
-if(_STLSOFT_ROOT)
-       # add include folder to ENVIRONMENT path...
-
-       file(TO_CMAKE_PATH ${_STLSOFT_ROOT} _STLSOFT_ROOT)
-       set(STLSOFT_INCLUDE_DIR ${_STLSOFT_ROOT}/include)
-
-else(_STLSOFT_ROOT)
-       # try to find in well known for CMake includes
-
-       find_path(STLSOFT_INCLUDE_DIR "stlsoft/stlsoft.h")
-
-endif(_STLSOFT_ROOT)
-
-if(STLSOFT_INCLUDE_DIR)
-       file(READ "${STLSOFT_INCLUDE_DIR}/stlsoft/stlsoft.h" _stlsoft_h_CONTENT)
-       string(REGEX REPLACE ".*#define[ ]+_STLSOFT_VER_MAJOR[ ]+([0-9]+).*" "\\1" STLSOFT_VER_MAJOR "${_stlsoft_h_CONTENT}")
-       string(REGEX REPLACE ".*#define[ ]+_STLSOFT_VER_MINOR[ ]+([0-9]+).*" "\\1" STLSOFT_VER_MINOR "${_stlsoft_h_CONTENT}")
-       string(REGEX REPLACE ".*#define[ ]+_STLSOFT_VER_REVISION[ ]+([0-9]+).*" "\\1" STLSOFT_VER_REVISION "${_stlsoft_h_CONTENT}")
-
-       MESSAGE("Found STLSOFT Ver. ${STLSOFT_VER_MAJOR}.${STLSOFT_VER_MINOR}.${STLSOFT_VER_REVISION} here - ${STLSOFT_INCLUDE_DIR}")
-
-       if(STLSOFT_VER_MAJOR AND STLSOFT_VER_MINOR AND STLSOFT_VER_REVISION)
-
-           set(STLSOFT_FOUND TRUE)
-
-       endif(STLSOFT_VER_MAJOR AND STLSOFT_VER_MINOR AND STLSOFT_VER_REVISION)
-
-else(STLSOFT_INCLUDE_DIR)
-     message("No Stlsoft found... Please point us with STLSOFT env var")
-endif(STLSOFT_INCLUDE_DIR)
-
-MARK_AS_ADVANCED(
-	STLSOFT_INCLUDE_DIR
-	STLSOFT_VER_MAJOR
-	STLSOFT_VER_MINOR
-	STLSOFT_VER_REVISION)


Minor change required for merge from viewer-development

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -106,13 +106,12 @@
   # To support a different SDK update these Xcode settings:
   if (XCODE_VERSION GREATER 4.2)
   	set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
-	set(CMAKE_OSX_SYSROOT macosx10.6)
-	set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
   else (XCODE_VERSION GREATER 4.2)
   	set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
-    set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
-  	set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
   endif (XCODE_VERSION GREATER 4.2)
+
+  set(CMAKE_OSX_SYSROOT macosx10.6)
+  set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")

   set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)


Got static linking working with ld.  Turns out I needed to order the linker input files from dependents to dependencies.

--- scripts/project.cmake
+++ scripts/project.cmake
@@ -110,84 +110,6 @@
     target_link_libraries(${target} "${MYTHIC_DEPENDENCIES}/googletest/lib/libgtest_main.a")
   endif ()
 endmacro(create_test)
-
-macro(append_dependency_hierarchy libraries output_variable)
-  #  message("${libraries}")
-  foreach (library_name ${libraries})
-    list(FIND ${output_variable} ${library_name} already_added)
-    #    message("'${${output_variable}}' ${library_name} ${already_added}")
-    if (${already_added} EQUAL "-1")
-      list(APPEND ${output_variable} ${library_name})
-      append_dependency_hierarchy("${${library_name}_dependencies}" ${output_variable})
-    endif ()
-  endforeach ()
-endmacro()
-
-macro(get_dependency_hierarchy libraries output_variable)
-  set(${output_variable} "")
-  append_dependency_hierarchy("${libraries}" ${output_variable})
-endmacro()
-
-macro(include_project library_name)
-  if (${library_name}_includes)
-    include_directories(${${library_name}_includes})
-  else ()
-    #    message("${library_name}_DIR ${${library_name}_DIR}")
-    #    find_package(${library_name} REQUIRED)
-    include(${${library_name}_DIR}/${library_name}-config.cmake)
-  endif ()
-
-  #
-  #  set(temp ${${library_name}_dependencies})
-  #  foreach (dependency IN LISTS temp)
-  #    include_project(${dependency})
-  #  endforeach ()
-endmacro()
-
-macro(require)
-
-  if (LOCAL_TARGET)
-    get_dependency_hierarchy("${ARGN}" all_dependencies)
-    #    message("  ${CURRENT_TARGET}: ${all_dependencies}")
-    foreach (library_name ${all_dependencies})
-      include_project(${library_name})
-      if (TARGET ${library_name} AND IS_EXECUTABLE)
-        target_link_libraries(${CURRENT_TARGET}
-          $<TARGET_FILE:${library_name}>
-          )
-
-        if (${library_name}_external_dependencies)
-          #          message("*** ${${library_name}_external_dependencies}")
-          set(temp ${${library_name}_external_dependencies})
-          foreach (external_library IN LISTS temp)
-            message("Linking dynamic: ${external_library}")
-            link_external(${external_library})
-          endforeach ()
-        endif ()
-
-        if (${library_name}_external_static_dependencies)
-          #          message("*** ${${library_name}_external_dependencies}")
-          set(temp ${${library_name}_external_static_dependencies})
-          foreach (external_library IN LISTS temp)
-            message("Linking  static: ${external_library}")
-            link_external_static(${external_library})
-            #            link_external_static(${external_library} ${external_library} ${external_library_${libname}_is_dynamc})
-          endforeach ()
-        endif ()
-      endif ()
-    endforeach ()
-
-    foreach (library_name ${ARGN})
-      if (TARGET ${library_name})
-        add_dependencies(${CURRENT_TARGET}
-          ${library_name}
-          )
-        list(APPEND "${CURRENT_TARGET}_dependencies" "${library_name}")
-        set(${CURRENT_TARGET}_dependencies ${${CURRENT_TARGET}_dependencies} PARENT_SCOPE)
-      endif ()
-    endforeach ()
-  endif ()
-endmacro()

 if (IOS)
   macro(add_project project_name)
@@ -319,6 +241,117 @@
   endif ()
 endfunction()

+macro(append_dependency_hierarchy libraries output_variable parent_name)
+  set(parent ${parent_name})
+  foreach (library_name ${libraries})
+    list(FIND ${output_variable} ${library_name} library_index)
+    #    message("'${${output_variable}}' ${library_name} ${library_index}")
+    if (${library_index} EQUAL "-1")
+      list(APPEND ${output_variable} ${library_name})
+      append_dependency_hierarchy("${${library_name}_dependencies}" ${output_variable} ${library_name})
+    elseif (IS_EXECUTABLE AND NOT "${parent_name}" STREQUAL "")
+      #      message("check ${library_index}, ${parent_index}")
+      list(FIND ${output_variable} ${parent_name} parent_index)
+      if (${parent_index} GREATER ${library_index})
+        message("move ${library_index}, ${parent_index}")
+        #        message("before ${${output_variable}}")
+        list(REMOVE_AT ${output_variable} ${parent_index})
+        list(INSERT ${output_variable} ${library_index} ${parent_name})
+        #        message("after ${${output_variable}}")
+      endif ()
+    endif ()
+  endforeach ()
+endmacro()
+
+macro(get_dependency_hierarchy libraries output_variable)
+  set(${output_variable} "")
+  append_dependency_hierarchy("${libraries}" ${output_variable} "")
+endmacro()
+
+macro(include_project library_name)
+  if (${library_name}_includes)
+    include_directories(${${library_name}_includes})
+  else ()
+    include(${${library_name}_DIR}/${library_name}-config.cmake)
+  endif ()
+endmacro()
+
+macro(require)
+
+  if (LOCAL_TARGET)
+    get_dependency_hierarchy("${ARGN}" all_dependencies)
+    #    message("  ${CURRENT_TARGET}: ${all_dependencies}")
+
+    if (IS_EXECUTABLE)
+      #      set(reverse_list ${all_dependencies})
+      #      list(REVERSE reverse_list)
+
+      foreach (library_name ${all_dependencies})
+        if (TARGET ${library_name})
+          #          message("Linking  local: ${library_name}")
+          target_link_libraries(${CURRENT_TARGET} $<TARGET_FILE:${library_name}>)
+        endif ()
+      endforeach ()
+    endif ()
+
+    foreach (library_name ${all_dependencies})
+      include_project(${library_name})
+
+      #      if (TARGET ${library_name})
+      #        message("link ${CURRENT_TARGET} ${library_name}")
+      #        target_link_libraries(${CURRENT_TARGET} $<TARGET_FILE:${library_name}>)
+      #      endif ()
+
+      if (TARGET ${library_name} AND IS_EXECUTABLE)
+        #        target_link_libraries(${CURRENT_TARGET} $<TARGET_FILE:${library_name}>)
+
+        if (${library_name}_external_dependencies)
+          #          message("*** ${${library_name}_external_dependencies}")
+          set(temp ${${library_name}_external_dependencies})
+          foreach (external_library IN LISTS temp)
+            #            message("Linking dynamic: ${external_library}")
+            link_external(${external_library})
+          endforeach ()
+        endif ()
+
+        if (${library_name}_external_static_dependencies)
+          #          message("*** ${${library_name}_external_dependencies}")
+          set(temp ${${library_name}_external_static_dependencies})
+          foreach (external_library IN LISTS temp)
+            #            message("Linking  static: ${external_library}")
+            link_external_static(${external_library})
+            #            link_external_static(${external_library} ${external_library} ${external_library_${libname}_is_dynamc})
+          endforeach ()
+        endif ()
+
+        if (${library_name}_system_dependencies)
+          #          message("*** ${${library_name}_external_dependencies}")
+          set(temp ${${library_name}_system_dependencies})
+          foreach (external_library IN LISTS temp)
+            #            message("Linking  system: ${external_library}")
+            if (MSVC)
+              target_link_libraries(${CURRENT_TARGET} ${external_library})
+            else ()
+              target_link_libraries(${CURRENT_TARGET} "-l${external_library}")
+            endif ()
+            #            link_external_static(${external_library} ${external_library} ${external_library_${libname}_is_dynamc})
+          endforeach ()
+        endif ()
+      endif ()
+    endforeach ()
+
+    foreach (library_name ${ARGN})
+      if (TARGET ${library_name})
+        add_dependencies(${CURRENT_TARGET}
+          ${library_name}
+          )
+        list(APPEND "${CURRENT_TARGET}_dependencies" "${library_name}")
+        set(${CURRENT_TARGET}_dependencies ${${CURRENT_TARGET}_dependencies} PARENT_SCOPE)
+      endif ()
+    endforeach ()
+  endif ()
+endmacro()
+
 macro(doctor varname path name extension)
   if (path AND EXISTS ${path}/${name}.${extension})
   elseif (NOT MSVC)
@@ -426,7 +459,7 @@
     doctor_static(libname ${fullpath} ${is_dynamic})

     #  message("${CURRENT_TARGET} ${fullpath}/${libname}")
-    message("${CURRENT_TARGET} ${fullpath}/${libname} ${is_dynamic}")
+    #    message("${CURRENT_TARGET} ${fullpath}/${libname} ${is_dynamic}")

     if (IOS)
       target_link_libraries(${CURRENT_TARGET} "-l${fullpath}/${libname}")
@@ -454,9 +487,8 @@
     list(APPEND "${CURRENT_TARGET}_external_dependencies" "${libname}")
     set(${CURRENT_TARGET}_external_dependencies ${${CURRENT_TARGET}_external_dependencies} PARENT_SCOPE)
     #    set(external_library_${libname}_is_dynamic TRUE)
-  endif (
-
-  )
+  endif ()
+
   if (IOS)
     link_external_static(${path} ${libname})
   else ()
@@ -479,12 +511,7 @@
   endif ()
 endmacro()

-#if (ANRDOID_NDK)
-macro(add_system_libraries)
-  #    if (NOT "${ARGN}" STREQUAL "")
-  set(${CURRENT_TARGET}_system_libraries ${${CURRENT_TARGET}_system_libraries} ${ARGN})
-  list(REMOVE_DUPLICATES ${CURRENT_TARGET}_system_libraries)
-  set(${CURRENT_TARGET}_system_libraries ${${CURRENT_TARGET}_system_libraries} PARENT_SCOPE)
-  #    endif ()
-endmacro()
-#endif ()+macro(link_system_library library_name)
+  list(APPEND "${CURRENT_TARGET}_system_dependencies" "${library_name}")
+  set(${CURRENT_TARGET}_system_dependencies ${${CURRENT_TARGET}_system_dependencies} PARENT_SCOPE)
+endmacro()


enable compile cap in debug mode

enable compile cap in debug mode

that was an easy fix :)
how did I miss that...

--- cpp/test/cmake/macros.cmake
+++ cpp/test/cmake/macros.cmake
@@ -8,7 +8,7 @@
     TARGET_LINK_LIBRARIES(${TEST_NAME}.exe ${Boost_SYSTEM_LIBRARY})
     TARGET_LINK_LIBRARIES(${TEST_NAME}.exe ${Boost_CHRONO_LIBRARY})
     IF(ENABLE_DEAL_II)
-        TARGET_LINK_LIBRARIES(${TEST_NAME}.exe deal_II)
+        DEAL_II_SETUP_TARGET(${TEST_NAME}.exe)
     ENDIF()
     IF(ENABLE_GSL)
         TARGET_LINK_LIBRARIES(${TEST_NAME}.exe ${GSL_LIBRARIES})


Trivial change to cmake macro

Trivial change to cmake macro

--- cpp/test/cmake/CapAddTest.cmake
+++ cpp/test/cmake/CapAddTest.cmake
@@ -14,10 +14,10 @@
     else()
         set(NUMBER_OF_PROCESSES_TO_EXECUTE 1)
     endiF()
-    foreach(PROCS ${NUMBER_OF_PROCESSES_TO_EXECUTE})
+    foreach(NPROC ${NUMBER_OF_PROCESSES_TO_EXECUTE})
         add_test(
-            NAME ${TEST_NAME}_cpp_${PROCS}_procs
-            COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${PROCS} ./${TEST_NAME}.exe
+            NAME ${TEST_NAME}_cpp_${NPROC}
+            COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${NPROC} ./${TEST_NAME}.exe
         )
     endforeach()
 endfunction()


Move the ParaView SHA to master as of now

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- versions.cmake
+++ versions.cmake
@@ -80,7 +80,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision locally before proposing a move
-  set(_paraview_revision "13d89b983295f890eb80a5b12ea6b0f0f1988fd2")
+  set(_paraview_revision "e18817ab55ee31a7533e84ab139ba7430e38d500")
 endif()
 # Locally patched ParaView repo, or main repo
 #set(_paraview_repo "https://gitlab.kitware.com/paraview/paraview.git")


Bump ParaView SHA

Bump ParaView SHA

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- versions.cmake
+++ versions.cmake
@@ -85,7 +85,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision locally before proposing a move
-  set(_paraview_revision "4054602f6ce1e74e6f23611e877d6045945bf94e")
+  set(_paraview_revision "10938cd09bfd2fae80955c4886a4e1cdac782b50")
 endif()
 # Locally patched ParaView repo, or main repo
 #set(_paraview_repo "https://gitlab.kitware.com/paraview/paraview.git")


Allow GNU extensions for clang

Allow GNU extensions for clang

--- CMake/mitkMacroCreateModule.cmake
+++ CMake/mitkMacroCreateModule.cmake
@@ -143,6 +143,7 @@
             else()
               mitkFunctionCheckCompilerFlags("-Werror" module_compile_flags)
               mitkFunctionCheckCompilerFlags("-Wno-c++0x-static-nonintegral-init" module_compile_flags)
+              mitkFunctionCheckCompilerFlags("-Wno-gnu" module_compile_flags)
             endif()
           endif(MODULE_WARNINGS_AS_ERRORS)


HPCC-11329 Update minimum required platform version

Signed-off-by: Gleb Aronsky <9746c29e6ed593f1e1ccbe1aacaf8f0320155813@lexisnexis.com>

--- platform-version-prereq.cmake
+++ platform-version-prereq.cmake
@@ -2,10 +2,10 @@
 ## This file describes the required HPCC build version.
 ###
 set ( HPCC_PROJECT_REQ "community" )
-set ( HPCC_MAJOR_REQ 4 )
-set ( HPCC_MINOR_REQ 3 )
+set ( HPCC_MAJOR_REQ 5 )
+set ( HPCC_MINOR_REQ 0 )
 set ( HPCC_POINT_REQ 0 )
-set ( HPCC_MATURITY_REQ "trunk" )
+set ( HPCC_MATURITY_REQ "rc")
 set ( HPCC_SEQUENCE_REQ 1 )
 ###


Update version to 2.2.0 for development

Update version to 2.2.0 for development

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

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


update

update

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -6,9 +6,8 @@
     set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${COMMON_COMPILE_FLAGS} -Wno-implicit-function-declaration -Wno-incompatible-pointer-types")
   else()
     # C4146: unary minus operator applied to unsigned type, result still unsigned
-    # C4200: nonstandard extension used : zero-sized array in struct/union
     # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4146 /wd4200 /wd4244")
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS} /wd4146 /wd4244")
   endif()
   add_library(HdrHistogram ${SOURCE_FILES})
   target_include_directories(HdrHistogram PRIVATE "zlib" PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/zlib")


update common.cmake

update common.cmake

--- jdksavdecc-c/common.cmake
+++ jdksavdecc-c/common.cmake
@@ -16,8 +16,8 @@

 if(CMAKE_USE_PTHREADS_INIT)
     if( ${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
-        set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-pthread")
-        set(CMAKE_C_FLAGS ${CMAKE_CXX_FLAGS} "-pthread")
+        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
     endif()
 endif()
@@ -25,11 +25,11 @@
 if (${CXX11} MATCHES "ON")
     # Compiler-specific C++11 activation.
     if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
-        set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
-        set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
-        set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
-        set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+        set(CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
+        set(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
+        set(CMAKE_CXX_FLAGS_MINSIZEREL     "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG")
+        set(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE} -O4 -DNDEBUG")
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g")

         execute_process(
             COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
@@ -38,15 +38,15 @@
         endif ()
     elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")

-        set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
-        set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
-        set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
-        set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+        set(CMAKE_CXX_FLAGS                "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
+        set(CMAKE_CXX_FLAGS_DEBUG          "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
+        set(CMAKE_CXX_FLAGS_MINSIZEREL     "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os -DNDEBUG")
+        set(CMAKE_CXX_FLAGS_RELEASE        "${CMAKE_CXX_FLAGS_RELEASE} -O4 -DNDEBUG")
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O2 -g")

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
     elseif(${CMAKE_MAKE_PROGRAM} MATCHES "(msdev|devenv|nmake|MSBuild)")
-        add_definitions("/W2")
+        add_definitions("/W3")
     else ()
         message(FATAL_ERROR "Your C++ compiler does not support C++11.")
     endif ()
@@ -64,7 +64,6 @@
 include_directories( include  )

 set(PROJECT_INCLUDES_GLOBS ${PROJECT_INCLUDES_GLOBS} "include/*.h" "include/*.hpp" "include/*/*.h" "include/*/*.hpp" "include/*/*/*.h" "include/*/*/*.hpp")
-
 set(PROJECT_SRC_GLOBS ${PROJECT_SRC_GLOBS} "src/*.c" "src/*.cpp" "src/*/*.c" "src/*/*.cpp" "src/*/*/*.c" "src/*/*/*.cpp")

 file(GLOB PROJECT_INCLUDES ${PROJECT_INCLUDES_GLOBS} )


improve `cmake` module error messages

improve `cmake` module error messages

--- mpt-config.cmake
+++ mpt-config.cmake
@@ -74,7 +74,7 @@
       unset(Mpt_${_up} CACHE)
       unset(Mpt_${_up}_BUILD_DIR CACHE)
       list(REMOVE_ITEM modules "${_mod}")
-      message(STATUS "no definition for component ${_mod}")
+      message(WARNING "no definition for component ${_mod}")
     endif()
   endforeach()
 endif()
@@ -146,3 +146,7 @@
     endif()
   endforeach(_mod)
 endif(components)
+
+if(components)
+  message(FATAL_ERROR "unknown components: ${components}")
+endif(components)


VWR-24347 Fix reversion--allow VS2005 Express user to specify location of msvc* files

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -66,6 +66,7 @@
 if (MSVC80)
     FIND_PATH(debug_msvc8_redist_path msvcr80d.dll
         PATHS
+		${MSVC_DEBUG_REDIST_PATH}
          [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/Debug_NonRedist/x86/Microsoft.VC80.DebugCRT
         NO_DEFAULT_PATH
         NO_DEFAULT_PATH
@@ -90,6 +91,7 @@

     FIND_PATH(release_msvc8_redist_path msvcr80.dll
         PATHS
+		${MSVC_REDIST_PATH}
          [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir]/redist/x86/Microsoft.VC80.CRT
         NO_DEFAULT_PATH
         NO_DEFAULT_PATH


- Try to fix WBEM link

- Try to fix WBEM link

--- cmake/Find/FindStandardLibs.cmake
+++ cmake/Find/FindStandardLibs.cmake
@@ -140,7 +140,7 @@
             shell32
             version
             ws2_32
-#            iwbemuuid
+            wbemuuid
             )
     else()
         list ( APPEND CORE_EXTRA_LIBRARIES


[CMake] Log output of configure/build/install steps for instrumented libcxx to reduce noise

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@208632 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -200,6 +200,9 @@
                -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS}
                -DCMAKE_BUILD_TYPE=Release
                -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+    LOG_BUILD 1
+    LOG_CONFIGURE 1
+    LOG_INSTALL 1
     )

   ExternalProject_Add_Step(${name} force-reconfigure


cmake: fix compiler flags

cmake: fix compiler flags

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -203,7 +203,10 @@
   endif()

   set(OPENCV_EXTRA_FLAGS_RELEASE "${OPENCV_EXTRA_FLAGS_RELEASE} -DNDEBUG")
-  set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0 -DDEBUG -D_DEBUG")
+  if(NOT " ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG} " MATCHES "-O")
+    set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -O0")
+  endif()
+  set(OPENCV_EXTRA_FLAGS_DEBUG "${OPENCV_EXTRA_FLAGS_DEBUG} -DDEBUG -D_DEBUG")
 endif()

 if(MSVC)


start updating TelepathyQt to use newer farstream

--- cmake/modules/FindFarstream.cmake
+++ cmake/modules/FindFarstream.cmake
@@ -23,9 +23,9 @@
     # in the find_path() and find_library() calls
     find_package(PkgConfig)
     if (FARSTREAM_MIN_VERSION)
-        PKG_CHECK_MODULES(PC_FARSTREAM farstream-0.1>=${FARSTREAM_MIN_VERSION})
+        PKG_CHECK_MODULES(PC_FARSTREAM farstream-0.2>=${FARSTREAM_MIN_VERSION})
     else (FARSTREAM_MIN_VERSION)
-        PKG_CHECK_MODULES(PC_FARSTREAM farstream-0.1)
+        PKG_CHECK_MODULES(PC_FARSTREAM farstream-0.2)
     endif (FARSTREAM_MIN_VERSION)
     set(FARSTREAM_DEFINITIONS ${PC_FARSTREAM_CFLAGS_OTHER})
 endif (NOT WIN32)
@@ -34,10 +34,10 @@
    PATHS
    ${PC_FARSTREAM_INCLUDEDIR}
    ${PC_FARSTREAM_INCLUDE_DIRS}
-   PATH_SUFFIXES farstream-0.1
+   PATH_SUFFIXES farstream-0.2
    )

-find_library(FARSTREAM_LIBRARIES NAMES farstream-0.1
+find_library(FARSTREAM_LIBRARIES NAMES farstream-0.2
    PATHS
    ${PC_FARSTREAM_LIBDIR}
    ${PC_FARSTREAM_LIBRARY_DIRS}


[cxxmodules] Move rootmaps and rdicts next to the dll on Windows.

Patch by Bertrand Bellenot and me!

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -188,6 +188,28 @@
   endif()

 endmacro()
+
+#---------------------------------------------------------------------------------------------------
+#---ROOT_GENERATE_DICTIONARY( result_var )
+# Returns the path to the .so file or .dll file. In the latter case Windows defines the dll files as
+# executables and puts them in the $ROOTSYS/bin folder.
+function(ROOT_GET_LIBRARY_OUTPUT_DIR result)
+  set(library_output_dir)
+  if(MSVC)
+    if(DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY AND NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY STREQUAL "")
+      set(library_output_dir ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+    else()
+      set(library_output_dir ${CMAKE_CURRENT_BINARY_DIR})
+    endif()
+  else()
+    if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY AND NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY STREQUAL "")
+      set(library_output_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+    else()
+      set(library_output_dir ${CMAKE_CURRENT_BINARY_DIR})
+    endif()
+  endif()
+  SET(${result} "${library_output_dir}" PARENT_SCOPE)
+endfunction(ROOT_GET_LIBRARY_OUTPUT_DIR)

 #---------------------------------------------------------------------------------------------------
 #---ROOT_GENERATE_DICTIONARY( dictionary headerfiles NODEPHEADERS ghdr1 ghdr2 ...
@@ -320,12 +342,7 @@
   endif()

   #---Set the library output directory-----------------------
-  if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY AND NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY STREQUAL "")
-    set(library_output_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-  else()
-    set(library_output_dir ${CMAKE_CURRENT_BINARY_DIR})
-  endif()
-
+  ROOT_GET_LIBRARY_OUTPUT_DIR(library_output_dir)
   if(ARG_MODULE)
     set(library_name ${libprefix}${ARG_MODULE}${libsuffix})
     if(ARG_MULTIDICT)
@@ -777,11 +794,7 @@
   get_filename_component(path ${library} PATH)

   #---Set the library output directory-----------------------
-  if(DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-    set(library_output_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-  else()
-    set(library_output_dir ${CMAKE_CURRENT_BINARY_DIR})
-  endif()
+  ROOT_GET_LIBRARY_OUTPUT_DIR(library_output_dir)

   set(outfile ${library_output_dir}/${libprefix}${libname}.rootmap)
   foreach( f ${ARG_LINKDEF})
@@ -812,7 +825,7 @@
   set_target_properties(${libprefix}${library}.rootmap PROPERTIES FOLDER RootMaps )
   #---Install the rootmap file------------------------------------
   install(FILES ${outfile} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
-endfunction()
+endfunction(ROOT_GENERATE_ROOTMAP)

 #---------------------------------------------------------------------------------------------------
 #---ROOT_FIND_DIRS_WITH_HEADERS([dir1 dir2 ...] OPTIONS [options])


don't build nanogui in OSX by default

don't build nanogui in OSX by default

--- cmakemodules/script_nanogui.cmake
+++ cmakemodules/script_nanogui.cmake
@@ -4,7 +4,13 @@
 set(CMAKE_MRPT_HAS_NANOGUI 0)
 set(CMAKE_MRPT_HAS_NANOGUI_SYSTEM 0)

-set(BUILD_NANOGUI ON CACHE BOOL "Build an embedded version of nanogui (OpenGL GUIs)")
+if (APPLE)
+  set(def_ OFF)
+else()
+  set(def_ ON)
+endif()
+set(BUILD_NANOGUI ${def_} CACHE BOOL "Build an embedded version of nanogui (OpenGL GUIs)")
+unset(def_)

 find_package(PkgConfig QUIET)
 if (PKG_CONFIG_FOUND)


Add the GTEST library but not test runner

--- tools/cmake/ANHLibrary.cmake
+++ tools/cmake/ANHLibrary.cmake
@@ -157,6 +157,7 @@

         TARGET_LINK_LIBRARIES(${name}_test
             ${ANHLIB_DEPENDS}
+            ${GTEST_LIBRARIES}
             ${GMOCK_LIBRARIES})
         add_dependencies(${name}_test DEPS)


Remove duplicate config definitions installs.

--- install_java.cmake
+++ install_java.cmake
@@ -147,46 +147,14 @@
     docproc/src/main/resources/configdefinitions/docproc.def
     docproc/src/main/resources/configdefinitions/schemamapping.def
     docproc/src/main/resources/configdefinitions/splitter-joiner-document-processor.def
-    document/src/vespa/document/config/documentmanager.def
-    document/src/vespa/document/config/documenttypes.def
-    documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def
     fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def
-    filedistribution/src/vespa/filedistribution/distributor/filedistributor.def
-    filedistribution/src/vespa/filedistribution/model/filereferences.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.client.http-client.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.connector.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.server.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.servlet-paths.def
-    logd/src/main/resources/configdefinitions/logd.def
-    messagebus/src/main/config/messagebus.def
-    metrics/src/vespa/metrics/metricsmanager.def
     persistence/src/main/resources/configdefinitions/persistence-rpc.def
-    searchcore/src/vespa/searchcore/config/fdispatchrc.def
-    searchcore/src/vespa/searchcore/config/partitions.def
-    searchcore/src/vespa/searchcore/config/proton.def
-    searchcore/src/vespa/searchcore/config/ranking-constants.def
-    searchlib/src/vespa/searchlib/config/translogserver.def
-    searchsummary/src/vespa/searchsummary/config/juniperrc.def
     simplemetrics/src/main/resources/configdefinitions/manager.def
     statistics/src/main/resources/configdefinitions/statistics.def
-    storage/src/vespa/storage/bucketdb/stor-bucket-init.def
-    storage/src/vespa/storage/bucketdb/stor-bucketdb.def
-    storage/src/vespa/storage/config/rpc-provider.def
-    storage/src/vespa/storage/config/stor-bouncer.def
-    storage/src/vespa/storage/config/stor-bucketmover.def
-    storage/src/vespa/storage/config/stor-communicationmanager.def
-    storage/src/vespa/storage/config/stor-distributormanager.def
-    storage/src/vespa/storage/config/stor-integritychecker.def
-    storage/src/vespa/storage/config/stor-messageforwarder.def
-    storage/src/vespa/storage/config/stor-opslogger.def
-    storage/src/vespa/storage/config/stor-prioritymapping.def
-    storage/src/vespa/storage/config/stor-server.def
-    storage/src/vespa/storage/config/stor-status.def
-    storage/src/vespa/storage/config/stor-visitordispatcher.def
-    storage/src/vespa/storage/visiting/stor-visitor.def
-    vsm/src/vespa/vsm/config/vsm.def
-    vsm/src/vespa/vsm/config/vsmfields.def
-    vsm/src/vespa/vsm/config/vsmsummary.def
     vespaclient-core/src/main/resources/configdefinitions/feeder.def
     vespaclient-core/src/main/resources/configdefinitions/spooler.def
     docker-api/src/main/resources/configdefinitions/docker.def


Set CEGUI_INCLUDE_DIRS for v0.7 as well

Set CEGUI_INCLUDE_DIRS for v0.7 as well

--HG--
branch : v0-8

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -493,9 +493,11 @@
 # its parent rather than directly the subdirectory. Otherwise we'll get compiler errors.
 if ("${CEGUI_VERSION}" VERSION_GREATER "0.8.0")
     add_parent_dir(CEGUI_INCLUDE_DIRS_TEMP CEGUI_INCLUDE_DIR)
-    set(CEGUI_INCLUDE_DIRS ${CEGUI_INCLUDE_DIRS_TEMP})
+    # we basically overwrite CEGUI_INCLUDE_DIR so that it contains only the parent directory.
+    set(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS_TEMP})
 endif()
-set(CEGUI_INCLUDE_DIR ${CEGUI_INCLUDE_DIRS})
+
+set(CEGUI_INCLUDE_DIRS ${CEGUI_INCLUDE_DIR})

 mark_as_advanced(CEGUI_CONFIG_INCLUDE_DIR)


remove unused messages

remove unused messages

--- cmake/FindGTest.cmake
+++ cmake/FindGTest.cmake
@@ -20,7 +20,6 @@
         IF (GTEST_LINK_LIBRARIES_FOUND)
             SET (GTEST_LINK_LIBRARIES ${GTEST_LINK_LIBRARIES_FOUND}
                 ${CMAKE_THREAD_LIBS_INIT} CACHE STRING "Link to Google Test")
-            MESSAGE (STATUS ${CMAKE_THREAD_LIBS_INIT})
             MESSAGE (STATUS
                 "Found Google Test libraries: ${GTEST_LINK_LIBRARIES}")
         ELSE (GTEST_LINK_LIBRARIES_FOUND)


Fixed the sip cmake fix :-)

Fixed the sip cmake fix :-)

--- cmake/SIPMacros.cmake
+++ cmake/SIPMacros.cmake
@@ -76,7 +76,7 @@
     SET(_sip_output_files)
     FOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )
         IF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
-            SET(_sip_output_files ${_sip_output_files} ${SIP_MODULE_BINARY_DIR}/sip${OUTPUT_BASENAME}part${CONCAT_NUM}.cpp )
+            SET(_sip_output_files ${_sip_output_files} ${SIP_MODULE_BINARY_DIR}/sip${MODULE_NAME}part${CONCAT_NUM}.cpp )
         ENDIF( ${CONCAT_NUM} LESS ${SIP_CONCAT_PARTS} )
     ENDFOREACH(CONCAT_NUM RANGE 0 ${SIP_CONCAT_PARTS} )


Fixes wrong -march=aarch64 option in compiler-rt

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@224362 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -149,7 +149,7 @@
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch32")
     test_target_arch(aarch32 "-march=armv8-a")
   elseif("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "aarch64")
-    test_target_arch(aarch64 "-march=aarch64")
+    test_target_arch(aarch32 "-march=armv8-a")
   endif()
   set(COMPILER_RT_OS_SUFFIX "")
 endif()


remove test from pcl.dot

remove test from pcl.dot

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@2369 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/dep_graph.cmake
+++ cmake/dep_graph.cmake
@@ -22,9 +22,4 @@
         endforeach(_dep)
       endif()
     endforeach(_ss)
-
-    file(APPEND ${_dot_file}
-        "  \"test\" [style=\"filled\" fillcolor=\"#A3A27C\" shape=\"box\"];\n ")
-    file(APPEND ${_dot_file} "}\n")
 endfunction(MAKE_DEP_GRAPH)
-


[cmakeswitch to master branch for nd as external project

--- cmake/nd-config.cmake
+++ cmake/nd-config.cmake
@@ -12,7 +12,7 @@
   set(ND_GIT_REPOSITORY ssh://git@bitbucket.org/nclack/nd.git CACHE STRING "Location of the git repository for libnd.")
   ExternalProject_Add(libnd
     GIT_REPOSITORY ${ND_GIT_REPOSITORY}
-    GIT_TAG spin-off-plugins
+    # GIT_TAG spin-off-plugins
     # UPDATE_COMMAND ""
     # UPDATE_COMMAND ${GIT_EXECUTABLE} pull origin master
     LIST_SEPARATOR ^^


Check cmake version and warn user if lower than required

--- cmake/stm32_gcc.cmake
+++ cmake/stm32_gcc.cmake
@@ -1,3 +1,7 @@
+if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
+    message(WARNING "Current CMake verision is ${CMAKE_VERSION}. stm32-cmake requires CMake 3.16 or greater")
+endif()
+
 get_filename_component(STM32_CMAKE_DIR ${CMAKE_CURRENT_LIST_FILE} DIRECTORY)
 list(APPEND CMAKE_MODULE_PATH ${STM32_CMAKE_DIR})


add generated constant definitions to library

Summary: when trying to build openr with `getDeps.py` constant definitions where not available since they were not part of the generated thrift lib. this fixes it.

Reviewed By: chadaustin

Differential Revision: D16064417

fbshipit-source-id: ee2b3e061caf67235f4a873405cf6cd6fb663ef4

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -59,12 +59,12 @@
   # Compute the list of generated files
   list(APPEND generated_headers
     "${output_dir}/gen-cpp2/${base}_constants.h"
-    "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_types.h"
     "${output_dir}/gen-cpp2/${base}_types.tcc"
     "${output_dir}/gen-cpp2/${base}_types_custom_protocol.h"
   )
   list(APPEND generated_sources
+    "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_data.h"
     "${output_dir}/gen-cpp2/${base}_data.cpp"
     "${output_dir}/gen-cpp2/${base}_types.cpp"


grl added optional CAMODOCAL dependency

grl added optional CAMODOCAL dependency

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -117,6 +117,7 @@
     CisstNetlib # https://github.com/jhu-cisst/cisstNetlib  used for inverse kinematics plugin
     cisst{cisstNumerical,cisstOSAbstraction,cisstVector,cisstCommon} # used for inverse kinematics plugin
     sawConstraintController #  used for inverse kinematics plugin
+    CAMODOCAL # used for hand eye calibration plugin
   TEST_DEPENDS
     #<test-dependency>
   OPTIONAL_TEST_DEPENDS


Add back comment and fix white space in CommonCompilerConfig.cmake

--- CommonCompilerConfig.cmake
+++ CommonCompilerConfig.cmake
@@ -200,10 +200,9 @@

   if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU" AND NOT MINGW)
     set(optimization_flags_cc "${optimization_flags_cc} -fuse-ld=gold")
-
     # NOTE -flto must go together in both cc and ld flags; also, it's presently incompatible
     # with the -g option in at least some GNU compilers (saw in `man gcc` on Ubuntu)
-    set(optimization_flags_cc "${optimization_flags_cc} -fuse-linker-plugin -flto-report -flto")
+    set(optimization_flags_cc "${optimization_flags_cc} -fuse-linker-plugin -flto-report -flto")#TODO fix LTO for clang
     set(optimization_flags_lt "${optimization_flags_lt} -flto") #TODO LTO for clang too
   endif()
 endif()


ENH: Use GitHub Pages as the first ExternalData resource

GitHub pages are made available with the Fastly CDN for good performance
around the world.

Change-Id: Ic5a1ff2860b33f234473191e9bd121c419780747

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -31,6 +31,9 @@
 mark_as_advanced(ExternalData_URL_TEMPLATES)
 if(NOT ITK_FORBID_DOWNLOADS)
   list(APPEND ExternalData_URL_TEMPLATES
+    # Data published on GitHub Pages
+    "https://insightsoftwareconsortium.github.io/ITKTestingData/%(algo)/%(hash)"
+
     # Data published on Girder
     "https://data.kitware.com:443/api/v1/file/hashsum/%(algo)/%(hash)/download"


Auto-init modules that define/implement/use abstract interfaces

The per-module export headers (<mod>Module.h) inject auto-init logic
into applications to ensure that implementations of abstract interfaces
are registered.  Limit invocations of VTK_AUTOINIT to modules that
define or implement an abstract interface.  Include the headers from
each module's dependencies in its own header to propagate auto-init.
This is necessary when a module's implementation uses an abstract
interface from another module not directly used by the application to
ensure that an implementation of said interface is registered.

Change-Id: Ic6ad697f5c0bb3326117bf23bad9b60c40cb3d37

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -298,18 +298,40 @@
     target_link_libraries(${vtk-module} ${${dep}_LIBRARIES})
   endforeach()

-  # Generate the export macro header for symbol visibility/Windows DLL declspec
+  set(sep "")
   if(${vtk-module}_EXPORT_CODE)
-    set(${vtk-module}_EXPORT_CODE "${${vtk-module}_EXPORT_CODE}\n\n")
-  endif()
-  set(${vtk-module}_EXPORT_CODE
-    "${${vtk-module}_EXPORT_CODE}#if defined(${vtk-module}_INCLUDE)
+    set(sep "\n\n")
+  endif()
+
+  # Include module headers from dependencies that need auto-init.
+  set(mod_autoinit_deps "")
+  foreach(dep IN LISTS VTK_MODULE_${vtk-module}_LINK_DEPENDS)
+    get_property(dep_autoinit GLOBAL PROPERTY ${dep}_NEEDS_AUTOINIT)
+    if(dep_autoinit)
+      set(mod_autoinit_deps "${mod_autoinit_deps}\n#include \"${dep}Module.h\"")
+    endif()
+  endforeach()
+  if(mod_autoinit_deps)
+    set(${vtk-module}_EXPORT_CODE "${${vtk-module}_EXPORT_CODE}${sep}/* AutoInit dependencies.  */${mod_autoinit_deps}")
+    set(sep "\n\n")
+    set_property(GLOBAL PROPERTY ${vtk-module}_NEEDS_AUTOINIT 1)
+  endif()
+
+  # Perform auto-init if this module has or implements an interface.
+  if(${vtk-module}_IMPLEMENTED OR VTK_MODULE_${vtk-module}_IMPLEMENTS)
+    set_property(GLOBAL PROPERTY ${vtk-module}_NEEDS_AUTOINIT 1)
+    set(${vtk-module}_EXPORT_CODE
+      "${${vtk-module}_EXPORT_CODE}${sep}/* AutoInit implementations.  */
+#if defined(${vtk-module}_INCLUDE)
 # include ${vtk-module}_INCLUDE
 #endif
 #if defined(${vtk-module}_AUTOINIT)
 # include \"vtkAutoInit.h\"
 VTK_AUTOINIT(${vtk-module})
 #endif")
+  endif()
+
+  # Generate the export macro header for symbol visibility/Windows DLL declspec
   generate_export_header(${vtk-module} EXPORT_FILE_NAME ${vtk-module}Module.h)
   add_compiler_export_flags(my_abi_flags)
   set_property(TARGET ${vtk-module} APPEND
@@ -419,6 +441,11 @@
           vtk_add_test_module(${_lang})
         endif()
       endforeach()
+      if(VTK_MODULE_${vtk-module}_IMPLEMENTS)
+        foreach(dep IN LISTS VTK_MODULE_${vtk-module}_IMPLEMENTS)
+          set(${dep}_IMPLEMENTED 1)
+        endforeach()
+      endif()
     endif()
   endforeach()
   unset(vtk-module)


export: OBJECT libraries may not be exported

Change-Id: I5a32714a2fb260e62529f72de4b44d7b8f22970e

--- CMake/vtkModuleMacros.cmake
+++ CMake/vtkModuleMacros.cmake
@@ -516,7 +516,9 @@

 function(vtk_add_library name)
   add_library(${name} ${ARGN} ${headers})
-  vtk_target(${name})
+  if(NOT ARGV1 STREQUAL OBJECT)
+    vtk_target(${name})
+  endif()
 endfunction()

 function(vtk_add_executable name)


Don't invalidate precompiled headers on cmake run

--- CMake/common.cmake
+++ CMake/common.cmake
@@ -61,7 +61,9 @@

 	# Create a cpp file which cmake can build to get the precompiled header file
 	set(precompiled_cpp ${CMAKE_CURRENT_BINARY_DIR}/precompiled_cpp.cpp)
-	file(WRITE ${precompiled_cpp} "\n")
+	if(NOT EXISTS ${precompiled_cpp})
+		file(WRITE ${precompiled_cpp} "\n")
+	endif()

 	# The precompiled header target
 	add_library(${precompiled} OBJECT src/precompiled.h ${precompiled_cpp})
@@ -80,7 +82,6 @@
 		COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${precompiled}.dir/precompiled_cpp.cpp.o ${CMAKE_BINARY_DIR}/${precompiledSubDir}/precompiled.h.gch
 		DEPENDS ${precompiled}
 	)
-

 	add_dependencies(${targetName} ${precompiledCopy})
 	target_compile_options(${targetName} PRIVATE -include ${CMAKE_BINARY_DIR}/${precompiledSubDir}/precompiled.h)


Support for bzip2, zlib.

Support for bzip2, zlib.

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

--- seqan/util/cmake/FindSeqAn.cmake
+++ seqan/util/cmake/FindSeqAn.cmake
@@ -284,11 +284,27 @@
 #  * CUDA

 macro (seqan_find_dependencies)
-    find_package (ZLIB QUIET)
-    find_package (BZip2 QUIET)
-    find_package (OpenMP QUIET)
-    find_package (CUDA)
-    find_package (TR1)
+  find_package (ZLIB QUIET)
+  if (ZLIB_FOUND)
+    add_definitions(-DSEQAN_HAS_ZLIB=1)
+    include_directories(${ZLIB_INCLUDE_DIRS})
+  endif (ZLIB_FOUND)
+
+  find_package (BZip2 QUIET)
+  if (BZIP2_FOUND)
+    include_directories(${BZIP_INCLUDE_DIRS})
+    add_definitions(-DSEQAN_HAS_BZIP2=1)
+  endif (BZIP2_FOUND)
+
+  find_package (OpenMP QUIET)
+  find_package (CUDA)
+  find_package (TR1)
+
+  include(CheckIncludeFiles)
+  check_include_files(execinfo.h HAVE_EXECINFO)
+  if (HAVE_EXECINFO)
+    add_definitions(-DSEQAN_HAS_EXECINFO=1)
+  endif (HAVE_EXECINFO)
 endmacro (seqan_find_dependencies)

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


Bug Fix

Bug Fix

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -163,7 +163,7 @@

     # Capturing lcov counters and generating report
     COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory ${CMAKE_BINARY_DIR} --no-external --capture --output-file ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info
-    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${OUTPUT}.info 'tests/*' '/usr/include/*' '/usr/local/*' --output-file ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info.cleaned
+    COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info 'tests/*' '/usr/include/*' '/usr/local/*' --output-file ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info.cleaned
     COMMAND ${CMAKE_COMMAND} -E rename ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info.cleaned ${SETUP_TARGET_FOR_COVERAGE_OUTPUT}.info
   )

@@ -192,7 +192,7 @@
 	# Show info where to find the report
 	ADD_CUSTOM_COMMAND(TARGET ${SETUP_TARGET_FOR_COVERAGE_TARGET} POST_BUILD
 		COMMAND ;
-		COMMENT "Open ./${OUTPUT}/index.html in your browser to view the coverage report."
+		COMMENT "Open ./${SETUP_TARGET_FOR_COVERAGE_OUTPUT}/index.html in your browser to view the coverage report."
 		)

 ENDFUNCTION() # SETUP_TARGET_FOR_COVERAGE


bug fix

bug fix

--- CodeCoverage.cmake
+++ CodeCoverage.cmake
@@ -140,7 +140,7 @@
     # Capturing lcov counters and generating report
     COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --directory . --capture --output-file ${_outputname}.info
     COMMAND ${LCOV_PATH} --gcov-tool ${GCOV_PATH} --remove ${_outputname}.info 'tests/*' '/usr/*' --output-file ${_outputname}.info.cleaned
-    COMMAND ${CMAKE_COMMAND} -E renamecd . ${_outputname}.info.cleaned ${_outputname}.info
+    COMMAND ${CMAKE_COMMAND} -E rename ${_outputname}.info.cleaned ${_outputname}.info
   )

 	# Setup target


Update External_CCPi-Regularisation-Toolkit to use global CMAKE_BUILD_TYPE

--- SuperBuild/External_CCPi-Regularisation-Toolkit.cmake
+++ SuperBuild/External_CCPi-Regularisation-Toolkit.cmake
@@ -81,7 +81,7 @@
       # external projects
       CONFIGURE_COMMAND ${CMAKE_COMMAND} -E env CIL_VERSION=${${proj}_TAG} ${CMAKE_COMMAND} ${${proj}_SOURCE_DIR}
         -DCMAKE_INSTALL_PREFIX:PATH=${${proj}_INSTALL_DIR}
-        -DCMAKE_BUILD_TYPE:STRING=Release
+        -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
         -DBUILD_PYTHON_WRAPPER:BOOL=ON
         -DBUILD_CUDA:BOOL=${${proj}_USE_CUDA} -DCONDA_BUILD:BOOL=OFF
         -DPYTHON_EXECUTABLE:FILEPATH=${PYTHON_EXECUTABLE}


:lipstick: add safeguards around directory

--- modules/LookUpGTest.cmake
+++ modules/LookUpGTest.cmake
@@ -36,7 +36,7 @@

 ExternalProject_Add(
     GTest
-    PREFIX ${EXTERNAL_ROOT}
+    PREFIX "${EXTERNAL_ROOT}"
     ${arguments}
     # Force separate output paths for debug and release builds to allow easy
     # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
@@ -44,6 +44,7 @@
         -C "${EXTERNAL_ROOT}/src/GTestVariables.cmake"
         -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
         ${cmake_args}
+
     # Wrap download, configure and build steps in a script to log output
     INSTALL_COMMAND ""
     UPDATE_COMMAND ""


Removing debug code

Removing debug code

--- scripts/TargetCopyFiles.cmake
+++ scripts/TargetCopyFiles.cmake
@@ -34,7 +34,6 @@
   else()
     set(copy_target ${FILECOPIER_TARGET})
   endif()
-    message(STATUS "[copier] ${copy_target}")

   if(NOT "${FILECOPIER_REPLACE}" STREQUAL "")
     list(LENGTH FILECOPIER_REPLACE replace_length)


document details of static lib needs

document details of static lib needs

--- cmake/toolchains/Edison-intel-mpich-mkl.cmake
+++ cmake/toolchains/Edison-intel-mpich-mkl.cmake
@@ -1,6 +1,15 @@
-#
+# In your environment:
+# export CRAY_LINK_TYPE=static
+# module load cmake (must use patched version)
 # module load cray-mpich/7* (any 7+ version is ok)
 # module load gcc/4.9.2 && module load PrgEnv-intel
+# module unload darshan (causes more trouble than it is worth)
+#
+# You must invoke CMake with "-DBUILD_SHARED_LIBS=OFF", which will disable Python.
+#
+# Here is an example:
+#
+# cd /tmp/build-elemental && export CRAY_LINK_TYPE=static ; module load cmake ; module load gcc ; module unload darshan ; rm -rf * && cmake /global/project/projectdirs/m1907/Elemental/ -DCMAKE_TOOLCHAIN_FILE=/global/project/projectdirs/m1907/Elemental/cmake/toolchains/Edison-intel-mpich-mkl.cmake -DCMAKE_INSTALL_PREFIX=/global/project/projectdirs/m1907/Elemental/install-intel-mpich-mkl -DBUILD_SHARED_LIBS=OFF
 #

 # The Cray wrappers
@@ -33,3 +42,7 @@
 set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
 set(BUILD_SHARED_LIBS OFF)
 set(CMAKE_EXE_LINKER_FLAGS "-static")
+
+set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS " ")
+set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS " ")
+set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS " ")


[new] testing multiple configurations

[new] testing multiple configurations

--- testing/run_tests.sh.cmake
+++ testing/run_tests.sh.cmake
@@ -55,7 +55,8 @@
     test=$1
     trg=$2
     stage=$3
-    FAILED_TESTS+="$test/$trg/$stage "
+    config=$4
+    FAILED_TESTS+="$test/$trg/$stage/$config "
 }

 function finish()
@@ -92,6 +93,109 @@
     fi
     echo "Testing stopped (some tests are not done)."
     finish
+}
+
+function generate_empty_translation_configuration()
+{
+    echo -n "" > config.empty
+    echo config.empty
+}
+
+function generate_translation_configurations_ref()
+{
+    if [ $# -gt 0 ]; then
+	echo $1
+    else
+	generate_empty_translation_configuration
+    fi
+}
+
+function generate_translation_configurations_cuda()
+{
+    local configs=""
+    if [ $# -gt 0 ]; then
+	configs=$*
+    else
+	configs=config.empty
+	echo -n "" > config.empty
+    fi
+    local pre_calc='true false'
+    local bsize="64,4,1 32,8,1"
+    local new_configs=""
+    local idx=0
+    for i in $pre_calc; do
+	for j in $bsize; do
+	    for k in $configs; do
+		local c=config.cuda.$idx
+		idx=$(($idx + 1))
+		cat $k > $c
+		echo "CUDA_PRE_CALC_GRID_ADDRESS = $i" >> $c
+		echo "CUDA_BLOCK_SIZE = {$j}" >> $c
+		new_configs="$new_configs $c"
+	    done
+	done
+    done
+    echo $new_configs
+}
+
+function generate_translation_configurations_mpi()
+{
+    if [ $# -gt 0 ]; then
+	echo $1
+    else
+	generate_empty_translation_configuration
+    fi
+}
+
+function generate_translation_configurations_mpi_cuda()
+{
+    local configs=""
+    if [ $# -gt 0 ]; then
+	configs=$*
+    else
+	configs=config.empty
+	echo -n "" > config.empty
+    fi
+    configs=$(generate_translation_configurations_cuda "$configs")
+    local overlap='true false'
+    local multistream='true fale'
+    local new_configs=""
+    local idx=0
+    for i in $overlap; do
+	for j in $multistream; do
+	    for k in $configs; do
+		local c=config.mpi-cuda.$idx
+		idx=$(($idx + 1))
+		cat $k > $c
+		echo "MPI_OVERLAP = $i" >> $c
+		echo "MULTISTREAM_BOUNDARY = $j" >> $c
+		new_configs="$new_configs $c"
+	    done
+	done
+    done
+    echo $new_configs
+}
+
+function generate_translation_configurations()
+{
+    target=$1
+    case $target in
+	ref)
+	    generate_translation_configurations_ref
+	    ;;
+	cuda)
+	    generate_translation_configurations_cuda
+	    ;;
+	mpi)
+	    generate_translation_configurations_mpi
+	    ;;
+	mpi-cuda)
+	    generate_translation_configurations_mpi_cuda
+	    ;;
+	*)
+	    generate_empty_compile_configuration
+	    ;;
+    esac
 }

 function compile()
@@ -338,39 +442,43 @@
 	for TEST in $TESTS; do
 	    SHORTNAME=$(basename $TEST)
 	    DESC=$(grep -o '\WTEST: .*$' $TEST | sed 's/\WTEST: \(.*\)$/\1/')
-	    echo "Testing with $SHORTNAME ($DESC)"
-	    echo "[TRANSLATE] Processing $SHORTNAME for $TARGET target"
-	    if $PHYSISC --$TARGET -I${CMAKE_SOURCE_DIR}/include $TEST \
-		> $(basename $TEST).$TARGET.log 2>&1; then
-		echo "[TRANSLATE] SUCCESS"
-		NUM_SUCCESS_TRANS=$(($NUM_SUCCESS_TRANS + 1))
-	    else
-		echo "[TRANSLATE] FAIL"
-		NUM_FAIL_TRANS=$(($NUM_FAIL_TRANS + 1))
-		fail $SHORTNAME $TARGET translate
-		continue
-	    fi
-	    if [ "$STAGE" = "TRANSLATE" ]; then continue; fi
-	    echo "[COMPILE] Processing $SHORTNAME for $TARGET target"
-	    if compile $SHORTNAME $TARGET; then
-		echo "[COMPILE] SUCCESS"
-		NUM_SUCCESS_COMPILE=$(($NUM_SUCCESS_COMPILE + 1))
-	    else
-		echo "[COMPILE] FAIL"
-		NUM_FAIL_COMPILE=$(($NUM_FAIL_COMPILE + 1))
-		fail $SHORTNAME $TARGET compile
-		continue
-	    fi
-	    if [ "$STAGE" = "COMPILE" ]; then continue; fi
-	    if execute $SHORTNAME $TARGET; then
-		echo "[EXECUTE] SUCCESS"
-		NUM_SUCCESS_EXECUTE=$(($NUM_SUCCESS_EXECUTE + 1))
-	    else
-		echo "[EXECUTE] FAIL"
-		NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
-		fail $SHORTNAME $TARGET execute
-		continue
-	    fi
+	    for CONFIG in $(generate_translation_configurations $TARGET); do
+		echo "Testing with $SHORTNAME ($DESC)"
+		echo "Configuration ($CONFIG):"
+		cat $CONFIG
+		echo "[TRANSLATE] Processing $SHORTNAME for $TARGET target"
+		if $PHYSISC --$TARGET -I${CMAKE_SOURCE_DIR}/include --config $CONFIG \
+		    $TEST > $(basename $TEST).$TARGET.log 2>&1; then
+		    echo "[TRANSLATE] SUCCESS"
+		    NUM_SUCCESS_TRANS=$(($NUM_SUCCESS_TRANS + 1))
+		else
+		    echo "[TRANSLATE] FAIL"
+		    NUM_FAIL_TRANS=$(($NUM_FAIL_TRANS + 1))
+		    fail $SHORTNAME $TARGET translate $CONFIG
+		    continue
+		fi
+		if [ "$STAGE" = "TRANSLATE" ]; then continue; fi
+		echo "[COMPILE] Processing $SHORTNAME for $TARGET target"
+		if compile $SHORTNAME $TARGET; then
+		    echo "[COMPILE] SUCCESS"
+		    NUM_SUCCESS_COMPILE=$(($NUM_SUCCESS_COMPILE + 1))
+		else
+		    echo "[COMPILE] FAIL"
+		    NUM_FAIL_COMPILE=$(($NUM_FAIL_COMPILE + 1))
+		    fail $SHORTNAME $TARGET compile $CONFIG
+		    continue
+		fi
+		if [ "$STAGE" = "COMPILE" ]; then continue; fi
+		if execute $SHORTNAME $TARGET; then
+		    echo "[EXECUTE] SUCCESS"
+		    NUM_SUCCESS_EXECUTE=$(($NUM_SUCCESS_EXECUTE + 1))
+		else
+		    echo "[EXECUTE] FAIL"
+		    NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
+		    fail $SHORTNAME $TARGET execute $CONFIG
+		    continue
+		fi
+	    done
 	done
     done
     finish


Bugfixing

Bugfixing

--- modules/asio.cmake
+++ modules/asio.cmake
@@ -3,7 +3,7 @@
   # Module library
   file(GLOB SOURCE_FILES "asio/asio/src/*.cpp")
   if(NOT MSVC)
-    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "${PEDANTIC_COMPILE_FLAGS}")
+    set_source_files_properties(${SOURCE_FILES} PROPERTIES COMPILE_FLAGS "")
   else()
     # C4127: conditional expression is constant
     # C4702: unreachable code


update

update

--- modules/zlib.cmake
+++ modules/zlib.cmake
@@ -28,6 +28,9 @@
     add_definitions(-DNO_FSEEKO)
   endif()
   check_include_file(unistd.h Z_HAVE_UNISTD_H)
+  if(Z_HAVE_UNISTD_H)
+    add_definitions(-DZ_HAVE_UNISTD_H)
+  endif()

   # Module definitions
   if(MSVC)
@@ -36,7 +39,7 @@
   endif()

   # Module assembler files
-  if(CMAKE_COMPILER_IS_GNUCC)
+  if(CMAKE_COMPILER_IS_GNUCC AND NOT CYGWIN)
     add_definitions(-DASMV)
     set(ASSEMBLER_FILES "zlib/contrib/amd64/amd64-match.S")
     set_source_files_properties(${ASSEMBLER_FILES} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)


ENH: Support use of extension wizard simplify setting of EXTENSION_* vars

--- ShapePopulationViewer.cmake
+++ ShapePopulationViewer.cmake
@@ -2,8 +2,7 @@
 # SLICER EXTENSION
 #-----------------------------------------------------------------------------
 if( ShapePopulationViewer_BUILD_SLICER_EXTENSION )
-  set(EXTENSION_NAME ${LOCAL_PROJECT_NAME} )
-  set(MODULE_NAME ${LOCAL_PROJECT_NAME} )
+  set(EXTENSION_NAME "ShapePopulationViewer")
   set(EXTENSION_HOMEPAGE "https://www.nitrc.org/projects/shapepopviewer/")
   set(EXTENSION_CATEGORY "Shape Visualization")
   set(EXTENSION_CONTRIBUTORS "Alexis Girault (NIRAL, UNC), Francois Budin (NIRAL, UNC), Laura Pascal (DCBIA-OrthoLab, UofM)")


build folly first

build folly first

--- cmake/InstallExternalProjects.cmake
+++ cmake/InstallExternalProjects.cmake
@@ -2,6 +2,8 @@

 set (EXTERNAL_PROJECT_DIR ${CMAKE_BINARY_DIR}/externals)
 set_directory_properties(PROPERTIES EP_PREFIX ${EXTERNAL_PROJECT_DIR})
+
+list(APPEND CMAKE_MODULE_PATH ${EXTERNAL_PROJECT_DIR}/lib/cmake)

 message(STATUS "Install external dependencies to ${EXTERNAL_PROJECT_DIR}")

@@ -21,5 +23,5 @@
 install_external_project(GLog)
 install_external_project(GTest)
 install_external_project(GBench)
+install_external_project(Folly)
 install_external_project(Thrift)
-install_external_project(Folly)


OFA: rename skylake-xeon to skylake-avx512

GCC6 calls it -march=skylake-avx512, so just go with that name. For
compatibility, keep the possibility to set TARGET_ARCHITECTURE to
skylake-xeon.

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -116,7 +116,7 @@
          elseif(_cpu_model EQUAL 0x66)
             set(TARGET_ARCHITECTURE "cannonlake")
          elseif(_cpu_model EQUAL 0x55)
-            set(TARGET_ARCHITECTURE "skylake-xeon")
+            set(TARGET_ARCHITECTURE "skylake-avx512")
          elseif(_cpu_model EQUAL 0x4E OR _cpu_model EQUAL 0x5E)
             set(TARGET_ARCHITECTURE "skylake")
          elseif(_cpu_model EQUAL 0x3D OR _cpu_model EQUAL 0x47 OR _cpu_model EQUAL 0x56)
@@ -183,7 +183,7 @@
 Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
 Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
 \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
-\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"cannonlake\", \"silvermont\", \
+\"haswell\", \"broadwell\", \"skylake\", \"skylake-avx512\", \"cannonlake\", \"silvermont\", \
 \"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
 \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
 \"AMD 14h\", \"AMD 16h\".")
@@ -240,13 +240,14 @@
       list(APPEND _march_flag_list "skylake")
       _broadwell()
    endmacro()
-   macro(_skylake_xeon)
+   macro(_skylake_avx512)
+      list(APPEND _march_flag_list "skylake-avx512")
       _skylake()
       list(APPEND _available_vector_units_list "avx512f" "avx512cd" "avx512dq" "avx512bw" "avx512vl")
    endmacro()
    macro(_cannonlake)
       list(APPEND _march_flag_list "cannonlake")
-      _skylake_xeon()
+      _skylake_avx512()
       list(APPEND _available_vector_units_list "avx512ifma" "avx512vbmi")
    endmacro()
    macro(_knightslanding)
@@ -277,8 +278,8 @@
       _knightslanding()
    elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
       _cannonlake()
-   elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon")
-      _skylake_xeon()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon" OR TARGET_ARCHITECTURE STREQUAL "skylake-avx512")
+      _skylake_avx512()
    elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
       _skylake()
    elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")


Qt 5.10 OSX: CglSupport doesn't exist

Qt 5.10 OSX: CglSupport doesn't exist

--- cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
+++ cmake/Qt5Gui_ZZZ_HunterPlugin.cmake
@@ -173,12 +173,14 @@
         "${_qt_install_prefix}/lib/libQt5ClipboardSupport_debug.a"
     )

-    # qcgl_createNSOpenGLPixelFormat
-    _qt_cmake_extra_helpers_add_interface_release_debug(
-        Qt5::QCocoaIntegrationPlugin
-        "${_qt_install_prefix}/lib/libQt5CglSupport.a"
-        "${_qt_install_prefix}/lib/libQt5CglSupport_debug.a"
-    )
+    if(Qt5Core_VERSION VERSION_LESS 5.10)
+      # qcgl_createNSOpenGLPixelFormat
+      _qt_cmake_extra_helpers_add_interface_release_debug(
+          Qt5::QCocoaIntegrationPlugin
+          "${_qt_install_prefix}/lib/libQt5CglSupport.a"
+          "${_qt_install_prefix}/lib/libQt5CglSupport_debug.a"
+      )
+    endif()

     # QCoreTextFontEngine::antialiasingThreshold
     _qt_cmake_extra_helpers_add_interface_release_debug(


Enable clang's sign-conversion diagnostic since it does not warn on any code

--- cmake/compiler-warnings-clang.cmake
+++ cmake/compiler-warnings-clang.cmake
@@ -13,7 +13,7 @@
 set (CLANG_DISABLED_WARNING_FLAGS
   "c++98-compat"
   "c++98-compat-pedantic"
-  "conversion"
+  "conversion" # FIXME: really need to enable this one
   "covered-switch-default"
   "deprecated"
   "double-promotion"
@@ -22,7 +22,6 @@
   "gnu-zero-variadic-macro-arguments"
   "old-style-cast"
   "padded"
-  "sign-conversion"
   "switch-enum"
   "unused-macros"
   "unused-parameter"


Clang: undisable -Wzero-as-null-pointer-constant

IIRC it was having false-positives due to the pthread mutex init macro,
and fixing that false-positive was blatantly stonewalled by the warning's author.

Now that pthread is no longer used directly, there should be no need for this.

--- cmake/compiler-warnings-clang.cmake
+++ cmake/compiler-warnings-clang.cmake
@@ -26,7 +26,6 @@
   "unused-macros"
   "unused-parameter"
   "weak-vtables"
-  "zero-as-null-pointer-constant" # temporary
 )

 # Yes, these have to be *re-enabled* after CLANG_DISABLED_WARNING_FLAGS.


register Poco release 1.7.6-p0

register Poco release 1.7.6-p0

--- cmake/projects/PocoCpp/hunter.cmake
+++ cmake/projects/PocoCpp/hunter.cmake
@@ -3,6 +3,17 @@
 include(hunter_pick_scheme)
 include(hunter_cacheable)
 include(hunter_download)
+
+hunter_add_version(
+    PACKAGE_NAME
+    PocoCpp
+    VERSION
+    1.7.6-p0
+    URL
+    "https://github.com/hunter-packages/poco/archive/v1.7.6-p0.zip"
+    SHA1
+    a4b577d4fd6907c87d20dff31fa5caf4bd94bc89
+)

 hunter_add_version(
     PACKAGE_NAME


add jsoncpp 0.6.0-rc2

add jsoncpp 0.6.0-rc2

--- cmake/projects/jsoncpp/hunter.cmake
+++ cmake/projects/jsoncpp/hunter.cmake
@@ -10,6 +10,17 @@
 include(hunter_cmake_args)

 # List of versions:
+
+hunter_add_version(
+    PACKAGE_NAME
+    jsoncpp
+    VERSION
+    "0.6.0-rc2"
+    URL
+    "http://jenkins-clone.v4core.os-n3.hw:8081/repository/hunter-projects/jsoncpp-0.6.0-rc2.tar.bz2"
+    SHA1
+    3b86f0589c84dff5082454e2d539dce7bc65db86
+)

 hunter_add_version(
     PACKAGE_NAME


COMP: Avoid MetaIO config conflict with USE_SYSTEM_GDCM.

When a system GDCM with configured with VTK support, its UseGDCM.cmake file
can call include(${VTK_USE_FILE}).  This can cause VTK's include directories
to fall before ITK's, the system can find VTK's metaIOConfig.h first, and
MetaIO build failures will occurue.

Change-Id: Ided8ec692a10fdde423f9f4fec521727d7b4b83e

--- Modules/ThirdParty/GDCM/itk-module-init.cmake
+++ Modules/ThirdParty/GDCM/itk-module-init.cmake
@@ -3,5 +3,8 @@

 if(ITK_USE_SYSTEM_GDCM)
   find_package(GDCM REQUIRED)
+  # Avoid UseGDCM.cmake calling include(${VTK_USE_FILE}), which include's
+  # VTK's include paths before ITK and causes a MetaIO conflict.
+  set(GDCM_USE_VTK FALSE)
   include(${GDCM_USE_FILE})
 endif()


enh: Add SOVERSION to BasisProject.cmake template file

--- Templates/mirtk-module/1.0/BasisProject.cmake
+++ Templates/mirtk-module/1.0/BasisProject.cmake
@@ -42,7 +42,8 @@
   # ----------------------------------------------------------------------------
   # meta-data
   NAME        #<project>
-  VERSION     "0.0.0"
+  VERSION     "0.0.0" # version of this module, 0.0.0: no version assigned
+  SOVERSION   "0"     # ABI version, 0: API unstable
   PACKAGE     "MIRTK"
   AUTHORS     #<author>
   DESCRIPTION #<description>


CondorConfigure: remove old SYS_NAME hack on OSX

which will definitely break builds on arm macs, this hasn't been required since cmake-3.0.0,
see https://gitlab.kitware.com/cmake/cmake/-/commit/9d2a0900ed48eb4ae2df0e7672b9ede5af28e193

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -18,10 +18,7 @@

 # OS pre mods
 if(${OS_NAME} STREQUAL "DARWIN")
-	# All recent versions of Mac OS X are 64-bit, but 'uname -p'
-	# (the source for SYS_ARCH) reports 'i386'.
-	# Override that to set the actual architecture.
-	set (SYS_ARCH "X86_64")
+	#this needs to be evaluated in order due to WIN collision.
 elseif(${OS_NAME} MATCHES "WIN")
 	set(WINDOWS ON)


Ticket #3137 Only enable -flto on gcc >= 4.7.0 otherwise punt

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -715,11 +715,17 @@
 	#	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os")
 	#	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Os")
 	#endif(cxx_Os)
-	check_cxx_compiler_flag(-flto cxx_lto)
-	if (cxx_lto)
-		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
-		set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
-	endif(cxx_lto)
+
+	if (CMAKE_CXX_COMPILER_VERSION STRGREATER "4.7.0" OR CMAKE_CXX_COMPILER_VERSION STREQUAL "4.7.0")
+
+	  check_cxx_compiler_flag(-flto cxx_lto)
+	  if (cxx_lto)
+		  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
+		  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto")
+	  endif(cxx_lto)
+	else()
+	  dprint("skipping cxx_lto flag check")
+	endif()

 	check_cxx_compiler_flag(-W cxx_W)
 	if (cxx_W)


Set SYS_ARCH properly for Mac OS X 10.8.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -20,7 +20,7 @@
 # OS pre mods
 if(${OS_NAME} STREQUAL "DARWIN")
   exec_program (sw_vers ARGS -productVersion OUTPUT_VARIABLE TEST_VER)
-  if(${TEST_VER} MATCHES "10.[67]" AND ${SYS_ARCH} MATCHES "I386")
+  if(${TEST_VER} MATCHES "10.[678]" AND ${SYS_ARCH} MATCHES "I386")
 	set (SYS_ARCH "X86_64")
   endif()
 elseif(${OS_NAME} MATCHES "WIN")


Using system freetype and fontconfig for Linux.

--- doc/vcpkg/qt5-base/portfile.cmake
+++ doc/vcpkg/qt5-base/portfile.cmake
@@ -162,7 +162,6 @@
             "ZLIB_LIBS=${ZLIB_RELEASE}"
             "LIBPNG_LIBS=${LIBPNG_RELEASE} ${ZLIB_RELEASE}"
             "PCRE2_LIBS=${PCRE2_RELEASE}"
-            "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}"
             "QMAKE_LIBS_PRIVATE+=${BZ2_RELEASE}"
             "QMAKE_LIBS_PRIVATE+=${LIBPNG_RELEASE}"
             )
@@ -170,7 +169,6 @@
             "ZLIB_LIBS=${ZLIB_DEBUG}"
             "LIBPNG_LIBS=${LIBPNG_DEBUG} ${ZLIB_DEBUG}"
             "PCRE2_LIBS=${PCRE2_DEBUG}"
-            "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}"
             "QMAKE_LIBS_PRIVATE+=${BZ2_DEBUG}"
             "QMAKE_LIBS_PRIVATE+=${LIBPNG_DEBUG}"
             )
@@ -187,17 +185,19 @@
     endif()
     list(APPEND RELEASE_OPTIONS
             "SQLITE_LIBS=${SQLITE_RELEASE}"
+            "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}"
             "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL}"
             "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib"
         )

     list(APPEND DEBUG_OPTIONS
             "SQLITE_LIBS=${SQLITE_DEBUG}"
+            "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}"
             "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL}"
             "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} ws2_32.lib secur32.lib advapi32.lib shell32.lib crypt32.lib user32.lib gdi32.lib"
         )
 elseif(VCPKG_TARGET_IS_LINUX)
-    list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb -linuxfb)
+    list(APPEND CORE_OPTIONS -fontconfig -xcb-xlib -xcb)
     if (NOT EXISTS "/usr/include/GL/glu.h")
         message(FATAL_ERROR "qt5 requires libgl1-mesa-dev and libglu1-mesa-dev, please use your distribution's package manager to install them.\nExample: \"apt-get install libgl1-mesa-dev libglu1-mesa-dev\"")
     endif()
@@ -205,13 +205,11 @@
             "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread"
             "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL} ${GLIB_RELEASE} -lpthread"
             "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread"
-            "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE}"
         )
     list(APPEND DEBUG_OPTIONS
             "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread"
             "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL} ${GLIB_DEBUG} -lpthread"
             "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread"
-            "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG}"
         )
 elseif(VCPKG_TARGET_IS_OSX)
     list(APPEND CORE_OPTIONS -fontconfig)
@@ -239,12 +237,14 @@
     #list(APPEND QT_PLATFORM_CONFIGURE_OPTIONS HOST_PLATFORM ${TARGET_MKSPEC})
     list(APPEND RELEASE_OPTIONS
             "SQLITE_LIBS=${SQLITE_RELEASE} -ldl -lpthread"
+            "FREETYPE_LIBS=${FREETYPE_RELEASE_ALL}"
             "HARFBUZZ_LIBS=${HARFBUZZ_RELEASE} ${FREETYPE_RELEASE_ALL} -framework ApplicationServices"
             "OPENSSL_LIBS=${SSL_RELEASE} ${EAY_RELEASE} -ldl -lpthread"
             "FONTCONFIG_LIBS=${FONTCONFIG_RELEASE} ${FREETYPE_RELEASE} ${EXPAT_RELEASE} -liconv"
         )
     list(APPEND DEBUG_OPTIONS
             "SQLITE_LIBS=${SQLITE_DEBUG} -ldl -lpthread"
+            "FREETYPE_LIBS=${FREETYPE_DEBUG_ALL}"
             "HARFBUZZ_LIBS=${HARFBUZZ_DEBUG} ${FREETYPE_DEBUG_ALL} -framework ApplicationServices"
             "OPENSSL_LIBS=${SSL_DEBUG} ${EAY_DEBUG} -ldl -lpthread"
             "FONTCONFIG_LIBS=${FONTCONFIG_DEBUG} ${FREETYPE_DEBUG} ${EXPAT_DEBUG} -liconv"


Print reason for core count

Print reason for core count

Former-commit-id: 15795b1a02a2134b68a67d4eb4eccb9a71908c99

--- cmake-modules/GetNumThreads.cmake
+++ cmake-modules/GetNumThreads.cmake
@@ -1,32 +1,33 @@
 function(get_num_threads num_threads)
     cmake_host_system_information(RESULT _host_name   QUERY HOSTNAME)
-    if(${_host_name} MATCHES "travis|TRAVIS|Travis")
-        message("Using make -j 2 (travis-ci)")
+    if(${_host_name} MATCHES "travis|TRAVIS|Travis|fv-")
+        message(STATUS "Using make -j 2 (ci)")
         set(${num_threads} 2 PARENT_SCOPE)
         return()
     endif()
     if(CMAKE_BUILD_PARALLEL_LEVEL)
-        message("Using make -j ${CMAKE_BUILD_PARALLEL_LEVEL}")
+        message(STATUS "Using make -j ${CMAKE_BUILD_PARALLEL_LEVEL} (as defined in CMAKE_BUILD_PARALLEL_LEVEL)")
         set(${num_threads} ${CMAKE_BUILD_PARALLEL_LEVEL} PARENT_SCOPE)
         set(ENV{CMAKE_BUILD_PARALLEL_LEVEL} ${CMAKE_BUILD_PARALLEL_LEVEL})
         return()
     endif()

     if(${_host_name} MATCHES "ThinkStation")
-        message("Using make -j 8")
+        message(STATUS "Using make -j 8 (${_host_name})")
         set(${num_threads} 8 PARENT_SCOPE)
         return()
     endif()
     if(${_host_name} MATCHES "raken")
-        message("NUM_THREADS : 32")
+        message(STATUS "Using make -j 32 (${_host_name})")
         set(${num_threads} 32 PARENT_SCOPE)
         return()
     endif()
+
     if(DEFINED ENV{MAKEFLAGS})
         string(REGEX MATCH "-j[ ]*[0-9]+|--jobs[ ]*[0-9]+" REGMATCH "$ENV{MAKEFLAGS}")
         string(REGEX MATCH "[0-9]+" NUM "${REGMATCH}")
         if(NUM)
-            message("NUM_THREADS : ${NUM}")
+            message(STATUS "Using make -j ${NUM} (as defined in ENV MAKEFLAGS)")
             set(${num_threads} ${NUM} PARENT_SCOPE)
             return()
         endif()
@@ -35,7 +36,7 @@
         string(REGEX MATCH "-j[ ]*[0-9]+|--jobs[ ]*[0-9]+" REGMATCH "${MAKE_THREADS}")
         string(REGEX MATCH "[0-9]+" NUM "${REGMATCH}")
         if(NUM)
-            message("Using make -j ${NUM}")
+            message(STATUS "Using make -j ${NUM} (as defined in MAKEFLAGS)")
             set(${num_threads} ${NUM} PARENT_SCOPE)
             return()
         endif()
@@ -43,7 +44,7 @@
     include(ProcessorCount)
     ProcessorCount(NUM)
     if(NUM)
-        message("Using make -j ${NUM}")
+        message(STATUS "Using make -j ${NUM} (as defined in ProcessorCount)")
         set(${num_threads} ${NUM} PARENT_SCOPE)
         return()
     endif()


Improve the Cmake Coveralls script to support patterns exclusion.

--- cmake/CoverallsGenerateGcov.cmake
+++ cmake/CoverallsGenerateGcov.cmake
@@ -5,7 +5,7 @@
 # - Merging of GCDA file results (very important when the files to cover are
 #   used in different libraries/binaries)
 #
-# [1]see https://github.com/JoakimSoderberg/coveralls-cmake)
+# [1]see https://github.com/JoakimSoderberg/coveralls-cmake
 #
 # This is intended to be run by a custom target in a CMake project like this.
 # 0. Compile program with coverage support.
@@ -26,8 +26,9 @@
 # ADD_CUSTOM_TARGET(coveralls
 #   # Generate the output
 #   COMMAND ${CMAKE_COMMAND}
-#     -DCOVERAGE_SRCS_PATH="${PROJECT_SOURCE_DIR}/Code"
-#     -DCOVERAGE_SRCS_EXCLUDED=""
+#     -DCOVERAGE_SRC_PATH="${PROJECT_SOURCE_DIR}/Code"
+#     -DCOVERAGE_SRC_EXCLUDED=""
+#     -DCOVERAGE_BIN_EXCLUDED=""
 #     -DCOVERALLS_OUTPUT_FILE="${COVERALLS_FILE}"
 #     -DCOV_PATH="${PROJECT_BINARY_DIR}"
 #     -DPROJECT_ROOT="${PROJECT_SOURCE_DIR}"
@@ -47,8 +48,8 @@
   message(FATAL_ERROR "Coveralls: Missing coverage directory path where gcov files will be generated. Please set COV_PATH")
 ENDIF()

-IF(NOT COVERAGE_SRCS_PATH)
-  message(FATAL_ERROR "Coveralls: Missing the path of source files that we should get the coverage data for COVERAGE_SRCS_PATH")
+IF(NOT COVERAGE_SRC_PATH)
+  message(FATAL_ERROR "Coveralls: Missing the path of source files that we should get the coverage data for COVERAGE_SRC_PATH")
 ENDIF()

 if (NOT PROJECT_ROOT)
@@ -101,21 +102,33 @@

 # Get the files to cover
 FOREACH(_EXT h hh hpp hxx c cc cpp cxx tpp txx)
-  FILE(GLOB_RECURSE _COVERAGE_SRCS RELATIVE "${COVERAGE_SRCS_PATH}" "${COVERAGE_SRCS_PATH}/*.${_EXT}")
+  FILE(GLOB_RECURSE _COVERAGE_SRCS RELATIVE "${COVERAGE_SRC_PATH}" "${COVERAGE_SRC_PATH}/*.${_EXT}")
   LIST(APPEND COVERAGE_SRCS ${_COVERAGE_SRCS})
 ENDFOREACH()
 LIST(SORT COVERAGE_SRCS)

-# Transform the optional string argument COVERAGE_SRCS_EXCLUDED into a list
-string(REGEX REPLACE "\\::" ";" COVERAGE_SRCS_EXCLUDED "${COVERAGE_SRCS_EXCLUDED}")
+# Transform the optional string argument COVERAGE_SRC_EXCLUDED into a list
+string(REGEX REPLACE "\\::" ";" COVERAGE_SRC_EXCLUDED "${COVERAGE_SRC_EXCLUDED}")
+
+# Transform the optional string argument COVERAGE_BIN_EXCLUDED into a list
+string(REGEX REPLACE "\\::" ";" COVERAGE_BIN_EXCLUDED "${COVERAGE_BIN_EXCLUDED}")

 # Get the coverage data.
 FILE(GLOB_RECURSE GCDA_FILES RELATIVE "${COV_PATH}" "${COV_PATH}/*.gcda")
 # Get a list of all the object directories needed by gcov
 # (The directories the .gcda files and .o files are found in)
 # and run gcov on those.
-file(MAKE_DIRECTORY ${COV_PATH}/_temp_gcov)
+FILE(MAKE_DIRECTORY ${COV_PATH}/_temp_gcov)
 FOREACH(GCDA ${GCDA_FILES})
+  FOREACH(_PATTERN ${COVERAGE_BIN_EXCLUDED})
+    STRING(REGEX MATCH ${_PATTERN} _FOUND ${GCDA})
+    IF(_FOUND)
+      BREAK()
+    ENDIF()
+  ENDFOREACH()
+  IF(_FOUND)
+    CONTINUE()
+  ENDIF()
   GET_FILENAME_COMPONENT(GCDA_DIR ${GCDA} PATH)
   EXECUTE_PROCESS(
     COMMAND ${GCOV_EXECUTABLE} -pl -o "${COV_PATH}/${GCDA_DIR}" "${COV_PATH}/${GCDA}"
@@ -129,9 +142,10 @@
 SET(INC 0)
 FOREACH(_GCOV_FILE ${_GCOV_FILES})
   GET_SOURCE_PATH_FROM_GCOV_FILENAME(_GCOV_SRC_FILE ${_GCOV_FILE})
-  STRING(FIND "${_GCOV_SRC_FILE}" "${COVERAGE_SRCS_PATH}" FOUND)
+  STRING(FIND "${_GCOV_SRC_FILE}" "${COVERAGE_SRC_PATH}" FOUND)
   IF(NOT FOUND EQUAL -1)
-    FILE(RELATIVE_PATH _GCOV_SRC_REL_VAR "${COVERAGE_SRCS_PATH}" "${_GCOV_SRC_FILE}")
+    MESSAGE(STATUS "Processing: ${_GCOV_SRC_FILE}")
+    FILE(RELATIVE_PATH _GCOV_SRC_REL_VAR "${COVERAGE_SRC_PATH}" "${_GCOV_SRC_FILE}")
     STRING(REGEX REPLACE "/" "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
     STRING(REGEX REPLACE "\\." "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
     LIST(APPEND "${_GCOV_SRC_REL_VAR}" ${INC})
@@ -139,29 +153,35 @@
   MATH(EXPR INC "${INC}+1")
 ENDFOREACH()

-LIST(LENGTH COVERAGE_SRCS COVERAGE_SRCS_LENGTH)
+string(ASCII 27 Esc)
+LIST(LENGTH COVERAGE_SRCS COVERAGE_SRC_LENGTH)
 SET(INC 0)
 FOREACH(_COVERAGE_SRC ${COVERAGE_SRCS})
   MATH(EXPR INC "${INC}+1")
   # Check if the file is not excluded from the coverage
-  LIST(FIND COVERAGE_SRCS_EXCLUDED "${_COVERAGE_SRC}" FOUND)
-  IF(NOT FOUND EQUAL -1)
-    MESSAGE(STATUS "EXCLUDED: ${_COVERAGE_SRC}")
+  FOREACH(_PATTERN ${COVERAGE_SRC_EXCLUDED})
+    STRING(REGEX MATCH ${_PATTERN} _FOUND ${_COVERAGE_SRC})
+    IF(_FOUND)
+      BREAK()
+    ENDIF()
+  ENDFOREACH()
+  IF(_FOUND)
+    MESSAGE(STATUS "${Esc}[36mExcluded${Esc}[m: ${_COVERAGE_SRC}")
   ELSE()
-    FILE(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${COVERAGE_SRCS_PATH}/${_COVERAGE_SRC}")
-    FILE(MD5 "${COVERAGE_SRCS_PATH}/${_COVERAGE_SRC}" GCOV_CONTENTS_MD5)
+    FILE(RELATIVE_PATH GCOV_SRC_REL_PATH "${PROJECT_ROOT}" "${COVERAGE_SRC_PATH}/${_COVERAGE_SRC}")
+    FILE(MD5 "${COVERAGE_SRC_PATH}/${_COVERAGE_SRC}" GCOV_CONTENTS_MD5)
     # Check if the file is covered or not
     SET(_GCOV_SRC_REL_VAR "${_COVERAGE_SRC}")
     STRING(REGEX REPLACE "/" "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
     STRING(REGEX REPLACE "\\." "_" _GCOV_SRC_REL_VAR ${_GCOV_SRC_REL_VAR})
     IF(DEFINED ${_GCOV_SRC_REL_VAR})
-      MESSAGE(STATUS "COVERED: ${_COVERAGE_SRC}")
+      MESSAGE(STATUS "${Esc}[32mCovered${Esc}[m: ${_COVERAGE_SRC}")
       SET(GCOV_FILE_COVERAGE "[")
       # The file is covered but might be used by different GCDA files. We need to merge their results together
       LIST(GET _GCOV_FILES ${${_GCOV_SRC_REL_VAR}} _SRC_GCOV_FILES)
       # Reset the total number of calls by line
       SET(INC_LINE 1)
-      FILE(STRINGS "${COVERAGE_SRCS_PATH}/${_COVERAGE_SRC}" SRC_LINES)
+      FILE(STRINGS "${COVERAGE_SRC_PATH}/${_COVERAGE_SRC}" SRC_LINES)
       FOREACH(_SRC_LINE ${SRC_LINES})
         UNSET(_GCOV_LINE_CALL_${INC_LINE})
         MATH(EXPR INC_LINE "${INC_LINE}+1")
@@ -204,14 +224,14 @@
               IF (NOT DEFINED _GCOV_LINE_CALL_${LINE})
                 SET(_GCOV_LINE_CALL_${LINE} 0)
               ENDIF()
-              IF(${HITCOUNT} STREQUAL "#####")
+              IF((${HITCOUNT} STREQUAL "#####") OR (${HITCOUNT} STREQUAL "====="))
                 MATH(EXPR _GCOV_LINE_CALL_${LINE} "${_GCOV_LINE_CALL_${LINE}}+0")
               ELSE()
                 MATH(EXPR _GCOV_LINE_CALL_${LINE} "${_GCOV_LINE_CALL_${LINE}}+${HITCOUNT}")
               ENDIF()
             ENDIF()
           ELSE()
-            MESSAGE(WARNING "Failed to properly parse line (RES_COUNT = ${RES_COUNT}) ${GCOV_FILE}:${GCOV_LINE_COUNT}\n-->${GCOV_LINE}")
+            MESSAGE(WARNING "Failed to properly parse line (RES_COUNT = ${RES_COUNT}) ${_SRC_GCOV_FILE}:${GCOV_LINE_COUNT}\n-->${GCOV_LINE}")
           ENDIF()

           IF(RESET_SKIP)
@@ -231,9 +251,9 @@
         MATH(EXPR INC_LINE "${INC_LINE}+1")
       ENDFOREACH()
     ELSE()
-      MESSAGE(STATUS "NOT COVERED: ${_COVERAGE_SRC}")
+      MESSAGE(STATUS "${Esc}[31mNOT COVERED${Esc}[m: ${_COVERAGE_SRC}")
       # The file is not covered and all these lines are set to 0 (no call)
-      FILE(STRINGS "${COVERAGE_SRCS_PATH}/${_COVERAGE_SRC}" SRC_LINES)
+      FILE(STRINGS "${COVERAGE_SRC_PATH}/${_COVERAGE_SRC}" SRC_LINES)
       SET(GCOV_FILE_COVERAGE "[")
       FOREACH(SOURCE ${SRC_LINES})
         SET(GCOV_FILE_COVERAGE "${GCOV_FILE_COVERAGE}0, ")
@@ -245,7 +265,7 @@
          "      \"source_digest\": \"${GCOV_CONTENTS_MD5}\",\n"
          "      \"coverage\": ${GCOV_FILE_COVERAGE}\n"
       "  }")
-    IF(INC LESS COVERAGE_SRCS_LENGTH)
+    IF(INC LESS COVERAGE_SRC_LENGTH)
       FILE(APPEND "${COVERALLS_OUTPUT_FILE}" ", ")
     ENDIF()
   ENDIF()


cmake: enable override warnings (requires C++11 compilation mode)

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -103,6 +103,13 @@
   add_extra_compiler_option(-Wsign-promo)
   add_extra_compiler_option(-Wuninitialized)
   add_extra_compiler_option(-Winit-self)
+  if(HAVE_CXX11)
+    if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+      add_extra_compiler_option(-Wsuggest-override)
+    elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+      add_extra_compiler_option(-Winconsistent-missing-override)
+    endif()
+  endif()

   if(ENABLE_NOISY_WARNINGS)
     add_extra_compiler_option(-Wcast-align)


cmake: exclude -pthread from Emscripten default build

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -177,7 +177,13 @@
   endif()

   # We need pthread's
-  if(UNIX AND NOT ANDROID AND NOT (APPLE AND CV_CLANG)) # TODO
+  if((UNIX
+          AND NOT ANDROID
+          AND NOT (APPLE AND CV_CLANG)
+          AND NOT EMSCRIPTEN
+      )
+      OR (EMSCRIPTEN AND WITH_PTHREADS_PF)  # https://github.com/opencv/opencv/issues/20285
+  )
     add_extra_compiler_option(-pthread)
   endif()


Fix catkin_install_python(): ignore whitespaces in shebang (#1156)

--- cmake/catkin_install_python.cmake
+++ cmake/catkin_install_python.cmake
@@ -27,7 +27,7 @@
       stamp(${source_file})
       # read file and check shebang line
       file(READ ${source_file} data)
-      set(regex "^#![ \t]*/([^\r\n]+)/env[ \t]+python([\r\n])")
+      set(regex "^#![ \t]*/([^\r\n]+)/env[ \t]+python([ \t]*[\r\n])")
       string(REGEX MATCH "${regex}" shebang_line "${data}")
       string(LENGTH "${shebang_line}" length)
       string(SUBSTRING "${data}" 0 ${length} prefix)


do not fail in older cmake versions

do not fail in older cmake versions

--- cmakemodules/script_gl_glut.cmake
+++ cmakemodules/script_gl_glut.cmake
@@ -35,7 +35,12 @@
 endif()

 # EGL:
-find_package(EGL)
+if(CMAKE_VERSION VERSION_LESS 3.16.0)
+	message(WARNING "You need cmake >=3.16.0 to detect EGL. Disabling it, some features (FBO off-screen rendering) will not be enabled in MRPT.")
+else()
+	find_package(EGL)
+endif()
+
 if (EGL_FOUND)
 	set(CMAKE_MRPT_HAS_EGL 1)
 	set(CMAKE_MRPT_HAS_EGL_SYSTEM 1)


Can't use 64BIT test here, use CMAKE_SIZEOF_VOID_P instead.

--- packaging/WiX/CPackWixConfig.cmake
+++ packaging/WiX/CPackWixConfig.cmake
@@ -3,8 +3,7 @@
  MESSAGE("Essentials!")
  SET(CPACK_COMPONENTS_USED "Server;Client;DataFiles")
  SET(CPACK_WIX_UI "WixUI_InstallDir")
- MATH(EXPR bits ${CMAKE_SIZEOF_VOID_P}*8)
- IF(64BIT)
+ IF(CMAKE_SIZEOF_VOID_P MATCHES 8)
   SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-winx64")
  ELSE()
   SET(CPACK_PACKAGE_FILE_NAME  "mysql-essential-${VERSION}-win32")


ENH: build libkml in CI

ENH: build libkml in CI

--- CI/sb_configure_options.cmake
+++ CI/sb_configure_options.cmake
@@ -24,8 +24,7 @@
 CMAKE_INSTALL_PREFIX:PATH=${CTEST_INSTALL_DIRECTORY}")

 set ( temporary_option
-"OTB_USE_LIBKML=OFF
-OTB_USE_MPI=OFF")
+"OTB_USE_MPI=OFF")

 set(concat_options
 "${cmake_configure_option}


Cmake Build Changes

Cmake Build Changes

--- CMake/SurgSimBuildFlags.cmake
+++ CMake/SurgSimBuildFlags.cmake
@@ -85,3 +85,14 @@
 if(WIN32)
 	add_definitions( -D_WIN32_WINNT=0x0501 )  # request compatibility with WinXP
 endif(WIN32)
+
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+	set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
+ 	set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
+	set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
+	set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
+	set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
+	set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
+	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+endif()


Fixed STDINT_INCLUDE path

Fixed STDINT_INCLUDE path

--- CMakeModules/FindFFmpeg.cmake
+++ CMakeModules/FindFFmpeg.cmake
@@ -130,9 +130,7 @@

     SET(FFMPEG_FOUND "YES")

-    SET(FFMPEG_INCLUDE_DIRS ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS})
-
-    SET(FFMPEG_INCLUDE_DIRS
+    SET(FFMPEG_INCLUDE_DIRS
         ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS} ${FFMPEG_LIBAVFORMAT_INCLUDE_DIRS}/libavformat
         ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS} ${FFMPEG_LIBAVDEVICE_INCLUDE_DIRS}/libavdevice
         ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS} ${FFMPEG_LIBAVCODEC_INCLUDE_DIRS}/libavcodec
@@ -141,7 +139,8 @@

     IF (${FFMPEG_STDINT_INCLUDE_DIR})
         SET(FFMPEG_INCLUDE_DIRS
-            $PFFMPEG_INCLUDE_DIRS}
+            ${FFMPEG_INCLUDE_DIRS}
+            ${FFMPEG_STDINT_INCLUDE_DIR}
             ${FFMPEG_STDINT_INCLUDE_DIR}/libavformat
             ${FFMPEG_STDINT_INCLUDE_DIR}/libavdevice
             ${FFMPEG_STDINT_INCLUDE_DIR}/libavcodec


FindEigen.cmake - add possible eigen path locations.

--- CMakeModules/FindEigen3.cmake
+++ CMakeModules/FindEigen3.cmake
@@ -63,6 +63,10 @@

   find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
       PATHS
+      ../eigen
+      ../../eigen
+      /usr/local/include
+      /opt/local/include
       ${CMAKE_INSTALL_PREFIX}/include
       ${KDE4_INCLUDE_DIR}
       PATH_SUFFIXES eigen3 eigen


FFMPEG: Use exact ffmpeg include path.

FFMPEG: Use exact ffmpeg include path.

--- CMakeModules/FindFFMPEG.cmake
+++ CMakeModules/FindFFMPEG.cmake
@@ -56,13 +56,13 @@
    include(CheckCXXSourceCompiles)

    CHECK_CXX_SOURCE_COMPILES(
-     "#include <libavformat/avformat.h>
+     "#include \"${AVCODEC_INCLUDE_DIR}/libavformat/avformat.h\"
       int main() {
         &AVFormatContext::max_analyze_duration;
       }" HAVE_FFMPEG_MAX_ANALYZE_DURATION
    )
    CHECK_CXX_SOURCE_COMPILES(
-     "#include <libavformat/avformat.h>
+     "#include \"${AVCODEC_INCLUDE_DIR}/libavformat/avformat.h\"
       int main() {
         &avformat_alloc_output_context2;
       }" HAVE_FFMPEG_AVFORMAT_ALLOC_OUTPUT_CONTEXT2


Support pleora on ARM platforms

Support pleora on ARM platforms

--- CMakeModules/FindPleora.cmake
+++ CMakeModules/FindPleora.cmake
@@ -5,19 +5,23 @@
 #  Pleora_LIBRARIES - link these to use pleora eUSB SDK
 #  Pleora_BASE_DIR - set env varivales to this to use pleora eUSB SDK

+if(NOT PLEORA_ARCH)
+  set(PLEORA_ARCH "Ubuntu-12.04-x86_64")
+endif()

 set( INCLUDE_SEARCH_PATHS
-	"/opt/pleora/ebus_sdk/Ubuntu-12.04-x86_64/include"
+	"/opt/pleora/ebus_sdk/${PLEORA_ARCH}/include"
 	"$ENV{ProgramFiles}/Pleora Technologies Inc/eBUS SDK/Includes"
 )

 set( LIBRARIES_SEARCH_PATHS
-	"/opt/pleora/ebus_sdk/Ubuntu-12.04-x86_64/lib"
+	"/opt/pleora/ebus_sdk/${PLEORA_ARCH}/lib"
 	"$ENV{ProgramFiles}/Pleora Technologies Inc/eBUS SDK/Libraries"
 )

 set( GENAPI_SEARCH_PATHS
-   "/opt/pleora/ebus_sdk/Ubuntu-12.04-x86_64/lib/genicam/bin/Linux64_x64"
+   "/opt/pleora/ebus_sdk/${PLEORA_ARCH}/lib/genicam/bin/Linux64_x64"
+   "/opt/pleora/ebus_sdk/${PLEORA_ARCH}/lib/genicam/bin/Linux32_ARM"
    "$ENV{ProgramW6432}/GenICam_v2_4/library/CPP/lib/Win64_x64"
 )

@@ -115,7 +119,7 @@
 )
 FIND_LIBRARY(
   GENAPI_LIBRARY
-  NAMES GenApi_gcc40_v2_4 GenApi_MD_VC80_v2_4
+  NAMES GenApi_gcc40_v2_4 GenApi_gcc43_v2_4 GenApi_MD_VC80_v2_4
   HINTS ${PC_GENAPI_LIBRARY_DIR}
   PATH ${GENAPI_SEARCH_PATHS}
 )


COMP: Change test variable for DTIProcess_BUILD_SLICER_EXTENSION

--- Common.cmake
+++ Common.cmake
@@ -181,7 +181,7 @@
 if(NOT DEFINED HAS_STD_CPP11_FLAG)
   set(_msg "Forcing HAS_STD_CPP11_FLAG to OFF")
   message(STATUS "${_msg}")
-  if(DEFINED Slicer_DIR)
+  if(DTIProcess_BUILD_SLICER_EXTENSION)
     set(_config "${Slicer_DIR}/SlicerConfig.cmake")
     if(NOT EXISTS ${_config})
       message(FATAL_ERROR "Slicer_DIR [${Slicer_DIR}] is specified but doesn't contain SlicerConfig.cmake")


Include proper file

Include proper file

--- Common.cmake
+++ Common.cmake
@@ -171,7 +171,7 @@
 endif(APPLE)

 # hooks to gather all targets (libraries & executables)
-include(ParseArguments)
+include(CMakeParseArguments)
 set(ALL_DEP_TARGETS "")
 set(ALL_LIB_TARGETS "")
 macro(add_executable _target)