COMP: fix module graph topological sort

COMP: fix module graph topological sort

--- CMake/OTBModuleEnablement.cmake
+++ CMake/OTBModuleEnablement.cmake
@@ -167,6 +167,13 @@
 foreach(otb-module ${OTB_MODULES_ALL})
   if(${otb-module}_ENABLED)
     list(APPEND OTB_MODULES_ENABLED ${otb-module})
+
+    # We will sort modules according to their dependency graph,
+    # to enable them in order. To solve the modules dependency graph,
+    # we join both DEPENDS and OPTIONAL_DEPENDS
+    set(OTB_MODULE_${otb-module}_DEPENDS_FOR_SORT "")
+    list(APPEND OTB_MODULE_${otb-module}_DEPENDS_FOR_SORT ${OTB_MODULE_${otb-module}_DEPENDS})
+    list(APPEND OTB_MODULE_${otb-module}_DEPENDS_FOR_SORT ${OTB_MODULE_${otb-module}_OPTIONAL_DEPENDS})
   else()
     list(APPEND OTB_MODULES_DISABLED ${otb-module})
   endif()
@@ -176,7 +183,7 @@

 # Order list to satisfy dependencies.
 include(CMake/TopologicalSort.cmake)
-topological_sort(OTB_MODULES_ENABLED OTB_MODULE_ _DEPENDS)
+topological_sort(OTB_MODULES_ENABLED OTB_MODULE_ _DEPENDS_FOR_SORT)

 # TODO : shall we set up CPack ?
 # #


ENH (#1687): Added feature (implemented with a new property) to indicate the orientation of planes for intersection lines 2D views

--- Core/DataStructures/files.cmake
+++ Core/DataStructures/files.cmake
@@ -83,6 +83,7 @@
   mitkPlaneGeometry.cpp
   mitkPlaneLandmarkProjector.cpp
   mitkPlaneOperation.cpp
+  mitkPlaneDecorationProperty.cpp
   mitkPointData.cpp
   mitkPointOperation.cpp
   mitkPointSet.cpp


BUG: Remove ExternalData MD5 content link generation

We now use ITK/Utilities/UploadBinaryData.sh to generate SHA512 content
links and upload binary data. Prevent the CMake ExternalData module from
consuming binary data files.

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -45,10 +45,6 @@
     )
 endif()

-# Tell ExternalData commands to transform raw files to content links.
-# TODO: Condition this feature on presence of our pre-commit hook.
-set(ExternalData_LINK_CONTENT MD5)
-
 # Emscripten currently has difficulty reading symlinks.
 if(EMSCRIPTEN)
   set(ExternalData_NO_SYMLINKS 1)


优化更新第三方库的cmake构建工具

优化更新第三方库的cmake构建工具

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -12,6 +12,7 @@
 #     BUILD_WITH_CUSTOM_COMMAND
 #     CONFIGURE_FLAGS [configure options...]
 #     CMAKE_FLAGS [cmake options...]
+#     CMAKE_INHIRT_BUILD_ENV
 #     SCONS_FLAGS [scons options...]
 #     CUSTOM_BUILD_COMMAND [custom build cmd...]
 #     MAKE_FLAGS [make options...]
@@ -117,7 +118,7 @@

 macro (FindConfigurePackage)
     include(CMakeParseArguments)
-    set(optionArgs BUILD_WITH_CONFIGURE BUILD_WITH_CMAKE BUILD_WITH_SCONS BUILD_WITH_CUSTOM_COMMAND)
+    set(optionArgs BUILD_WITH_CONFIGURE BUILD_WITH_CMAKE BUILD_WITH_SCONS BUILD_WITH_CUSTOM_COMMAND CMAKE_INHIRT_BUILD_ENV)
     set(oneValueArgs PACKAGE WORKING_DIRECTORY BUILD_DIRECTORY PREFIX_DIRECTORY SRC_DIRECTORY_NAME PROJECT_DIRECTORY MSVC_CONFIGURE ZIP_URL TAR_URL SVN_URL GIT_URL GIT_BRANCH)
     set(multiValueArgs CONFIGURE_CMD CONFIGURE_FLAGS CMAKE_FLAGS SCONS_FLAGS MAKE_FLAGS CUSTOM_BUILD_COMMAND PREBUILD_COMMAND)
     cmake_parse_arguments(FindConfigurePackage "${optionArgs}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
@@ -313,13 +314,58 @@
                     set(BUILD_WITH_CMAKE_PROJECT_DIR ".")
                 endif()
                 message(STATUS "@${FindConfigurePackage_BUILD_DIRECTORY} Run: ${CMAKE_COMMAND} ${BUILD_WITH_CMAKE_PROJECT_DIR} -G '${CMAKE_GENERATOR}' -DCMAKE_INSTALL_PREFIX=${FindConfigurePackage_PREFIX_DIRECTORY} ${FindConfigurePackage_CMAKE_FLAGS}")
+                set (FindConfigurePackage_BUILD_WITH_CMAKE_GENERATOR -G ${CMAKE_GENERATOR})
+                if (CMAKE_GENERATOR_PLATFORM)
+                    list (APPEND FindConfigurePackage_BUILD_WITH_CMAKE_GENERATOR -A ${CMAKE_GENERATOR_PLATFORM})
+                endif ()
+                list (APPEND FindConfigurePackage_BUILD_WITH_CMAKE_GENERATOR "-DCMAKE_INSTALL_PREFIX=${FindConfigurePackage_PREFIX_DIRECTORY}")
+
+                if (FindConfigurePackage_CMAKE_INHIRT_BUILD_ENV)
+                    set (FindConfigurePackage_CMAKE_INHIRT_BUILD_ENV OFF)
+                    set (INHERIT_VARS
+                        CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_MINSIZEREL
+                        CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL
+                        CMAKE_ASM_FLAGS CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS CMAKE_STATIC_LINKER_FLAGS
+                        CMAKE_TOOLCHAIN_FILE CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_AR
+                        CMAKE_C_COMPILER_LAUNCHER CMAKE_CXX_COMPILER_LAUNCHER CMAKE_RANLIB CMAKE_SYSTEM_NAME
+                        CMAKE_SYSROOT CMAKE_SYSROOT_COMPILE # CMAKE_SYSTEM_LIBRARY_PATH # CMAKE_SYSTEM_LIBRARY_PATH ninja里解出的参数不对，原因未知
+                        CMAKE_OSX_SYSROOT CMAKE_OSX_ARCHITECTURES
+                        ANDROID_TOOLCHAIN ANDROID_ABI ANDROID_STL ANDROID_PIE ANDROID_PLATFORM ANDROID_CPP_FEATURES
+                        ANDROID_ALLOW_UNDEFINED_SYMBOLS ANDROID_ARM_MODE ANDROID_ARM_NEON ANDROID_DISABLE_NO_EXECUTE ANDROID_DISABLE_RELRO
+                        ANDROID_DISABLE_FORMAT_STRING_CHECKS ANDROID_CCACHE
+                    )
+
+                    foreach (VAR_NAME IN LISTS INHERIT_VARS)
+                        # message(STATUS "${VAR_NAME}=${${VAR_NAME}}")
+                        if (DEFINED ${VAR_NAME})
+                            # message(STATUS "DEFINED ${VAR_NAME}")
+                            set(VAR_VALUE "${${VAR_NAME}}")
+                            if (VAR_VALUE)
+                                # message(STATUS "SET ${VAR_NAME}")
+                                list (APPEND FindConfigurePackage_BUILD_WITH_CMAKE_GENERATOR "-D${VAR_NAME}=${VAR_VALUE}")
+                            endif ()
+                            unset(VAR_VALUE)
+                        endif ()
+                    endforeach ()
+
+                    unset (INHERIT_VARS)
+                endif ()
+
                 execute_process(
                     COMMAND
                         ${CMAKE_COMMAND} ${BUILD_WITH_CMAKE_PROJECT_DIR}
-                        -G "${CMAKE_GENERATOR}"
-                        "-DCMAKE_INSTALL_PREFIX=${FindConfigurePackage_PREFIX_DIRECTORY}" ${FindConfigurePackage_CMAKE_FLAGS}
+                        ${FindConfigurePackage_BUILD_WITH_CMAKE_GENERATOR}
+                        ${FindConfigurePackage_CMAKE_FLAGS}
                     WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                 )
+
+                if (MSVC)
+                    set(FindConfigurePackage_BUILD_WITH_CMAKE_MULTI_CORE_BUILD_FLAG "--" "/m")
+                else ()
+                    include(ProcessorCount)
+                    ProcessorCount(CPU_CORE_NUM)
+                    set(FindConfigurePackage_BUILD_WITH_CMAKE_MULTI_CORE_BUILD_FLAG "--" "-j${CPU_CORE_NUM}")
+                endif ()

                 # cmake --build and install
                 if(MSVC)
@@ -328,14 +374,19 @@
                     endif()
                     execute_process(
                         COMMAND ${CMAKE_COMMAND} --build . --target install --config ${FindConfigurePackage_MSVC_CONFIGURE}
+                            ${FindConfigurePackage_BUILD_WITH_CMAKE_MULTI_CORE_BUILD_FLAG}
                         WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                     )
                 else()
                     execute_process(
                         COMMAND ${CMAKE_COMMAND} --build . --target install
+                            ${FindConfigurePackage_BUILD_WITH_CMAKE_MULTI_CORE_BUILD_FLAG}
                         WORKING_DIRECTORY ${FindConfigurePackage_BUILD_DIRECTORY}
                     )
                 endif()
+
+                # adaptor for new cmake module
+                set ("${FindConfigurePackage_PACKAGE}_ROOT" ${FindConfigurePackage_PREFIX_DIRECTORY})

             # build using scons
             elseif(FindConfigurePackage_BUILD_WITH_SCONS)


ENH: DELIVER_CONTINUOUS_EMAIL is now is Dart.cmake module (cache value).

--- DartConfig.cmake
+++ DartConfig.cmake
@@ -21,8 +21,8 @@
 CONFIGURE_FILE(${VTK_SOURCE_DIR}/TestingLogo.gif ${VTK_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)

 # Continuous email delivery variables
-SET (DELIVER_CONTINUOUS_EMAIL "Off")
 SET (CONTINUOUS_FROM "lorensen@crd.ge.com")
 SET (SMTP_MAILHOST "public.kitware.com")
 SET (CONTINUOUS_MONITOR_LIST "lorensen@crd.ge.com millerjv@crd.ge.com")
 SET (CONTINUOUS_BASE_URL "http://public.kitware.com/VTK/Testing")
+


Define the PYLOGLEVEL variable used in KERNEL_PY

--- salome_adm/cmake_files/SalomeSetupPlatform.cmake
+++ salome_adm/cmake_files/SalomeSetupPlatform.cmake
@@ -38,6 +38,13 @@
 IF(NOT CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE Release)
 ENDIF(NOT CMAKE_BUILD_TYPE)
+
+## Define the log level according to the build type
+IF(CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR CMAKE_BUILD_TYPE STREQUAL "Debug")
+  SET(PYLOGLEVEL DEBUG)
+ELSE()
+  SET(PYLOGLEVEL WARNING)
+ENDIF()

 ## Make all warnings errors on non-windows platforms
 #  CURRENTLY DISABLED
@@ -104,4 +111,3 @@
   SET(CMAKE_CXX_COMPILER g++)
   # because default is clang(llvm) with mountain lion at least
 ENDIF()
-


revert: non-std features vs compilability

--- share/hugh/cmake/compiler/msvc.cmake
+++ share/hugh/cmake/compiler/msvc.cmake
@@ -22,7 +22,7 @@
 list(APPEND DISABLED_WARNINGS /wd4100)

 # nonstandard extension used : nameless struct/union
-#list(APPEND DISABLED_WARNINGS /wd4201)
+list(APPEND DISABLED_WARNINGS /wd4201)

 if("${CMAKE_LIBRARY_TYPE}" STREQUAL "SHARED")
   # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
@@ -59,10 +59,12 @@
 # warning level + language extensions:
 # [https://github.com/g-truc/glm/pull/587#issuecomment-265731442]
 list(APPEND GLOBAL_COMPILER_FLAGS /W4)  # warn almost everything
-list(APPEND GLOBAL_COMPILER_FLAGS /Za)  # disable language extension
+#list(APPEND GLOBAL_COMPILER_FLAGS /Za)  # disable language extension
+                                        # errors in boost + windows kit 10.x
 list(APPEND GLOBAL_COMPILER_FLAGS ${DISABLED_WARNINGS})
 list(APPEND GLOBAL_COMPILER_FLAGS /EHa) # exception-handling for asynchronous (structured) and
                                         # synchronous (C++) exceptions
+list(APPEND GLOBAL_COMPILER_FLAGS /FS)  # force synchronous .PDB writes

 # [https://msdn.microsoft.com/en-us/library/6sehtctf.aspx?f=255&MSPPError=-2147217396]
 # [http://www.cplusplus.com/forum/general/25253/]


FIX: fixed invalid message

FIX: fixed invalid message

--- src/loader/loader-tools.cmake
+++ src/loader/loader-tools.cmake
@@ -17,6 +17,6 @@

 # ... then traverse subdirectories
 foreach(config ${loader_config})
-    message("Copying configuration data ${CMAKE_CURRENT_SOURCE_DIR}/${config} to shared data dir ${SHARED_DATA_OUTPUT_PATH}")
+    message(STATUS "Copying configuration data ${CMAKE_CURRENT_SOURCE_DIR}/${config} to shared data dir ${SHARED_DATA_OUTPUT_PATH}")
     file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/${config} DESTINATION ${SHARED_DATA_OUTPUT_PATH})
 endforeach(config)


Changed tag for tracking

Changed tag for tracking

--- CMakeExternals.cmake
+++ CMakeExternals.cmake
@@ -478,6 +478,7 @@

     add_external_project(tracking SHARED
       GIT_REPOSITORY https://github.com/UniStuttgart-VISUS/mm-tracking
+      GIT_TAG "v2.0"
       BUILD_BYPRODUCTS
         "<INSTALL_DIR>/${TRACKING_LIB}"
         "<INSTALL_DIR>/${TRACKING_IMPORT_LIB}"


Remove "Copyright" from the copyright string.

	* build-aux/cmake/modules/ProjectInfo.cmake: Here.

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -14,7 +14,7 @@
   set(PROJECT_COPYRIGHT_HOLDER "Gostai S.A.S")
   set(PROJECT_COPYRIGHT_YEARS "2006-2008")
   set(PROJECT_COPYRIGHT_STRING
-    "Copyright (C) ${PROJECT_COPYRIGHT_YEARS} ${PROJECT_COPYRIGHT_HOLDER}")
+    "(C) ${PROJECT_COPYRIGHT_YEARS} ${PROJECT_COPYRIGHT_HOLDER}")

   include(Revision)
   revision(PROJECT_DATE PROJECT_ID PROJECT_REVISION)


Update ITK Superbuild version along the ITK 5.2 development branch

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

-set(_DEFAULT_ITK_GIT_TAG "5e598141dbf059c9490b9e438ac424cfac47f172")
+set(_DEFAULT_ITK_GIT_TAG "2b92d3973c18526f4c82965ef3dc286e7a685c6f")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


ENH: Bump ITK to 2018-09-24 master

ENH: Bump ITK to 2018-09-24 master


Work around build tools that append subdirs to the build dir.

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -217,6 +217,17 @@

 endmacro (_import_library_from_extproject)

+# Workaround for some generators setting a different output directory
+function (_get_build_directory_suffix_for_generator SUFFIX)
+
+    if (${CMAKE_GENERATOR} STREQUAL "Xcode")
+
+        set (${SUFFIX} ${CMAKE_BUILD_TYPE} PARENT_SCOPE)
+
+    endif (${CMAKE_GENERATOR} STREQUAL "Xcode")
+
+endfunction (_get_build_directory_suffix_for_generator)
+
 if (NOT GTEST_FOUND OR NOT GMOCK_FOUND)

     include (ExternalProject)
@@ -243,10 +254,17 @@
     set (GMOCK_LIBRARY gmock)
     set (GMOCK_MAIN_LIBRARY gmock_main)

-    set (GMOCK_LIBRARY_PATH ${GMOCK_DEFAULT_BINARY_DIR}/libgmock.a)
-    set (GMOCK_MAIN_LIBRARY_PATH ${GMOCK_DEFAULT_BINARY_DIR}/libgmock_main.a)
-    set (GTEST_LIBRARY_PATH ${GTEST_DEFAULT_BINARY_DIR}/libgtest.a)
-    set (GTEST_MAIN_LIBRARY_PATH ${GTEST_DEFAULT_BINARY_DIR}/libgtest_main.a)
+    set (BUILD_SUFFIX)
+    _get_build_directory_suffix_for_generator (BUILD_SUFFIX)
+
+    set (GMOCK_LIBRARY_PATH
+         ${GMOCK_DEFAULT_BINARY_DIR}/${BUILD_SUFFIX}/libgmock.a)
+    set (GMOCK_MAIN_LIBRARY_PATH
+         ${GMOCK_DEFAULT_BINARY_DIR}/${BUILD_SUFFIX}/libgmock_main.a)
+    set (GTEST_LIBRARY_PATH
+         ${GTEST_DEFAULT_BINARY_DIR}/${BUILD_SUFFIX}/libgtest.a)
+    set (GTEST_MAIN_LIBRARY_PATH
+         ${GTEST_DEFAULT_BINARY_DIR}/${BUILD_SUFFIX}/libgtest_main.a)

     set (GTEST_INCLUDE_DIR ${GTEST_SOURCE_DIR}/include)
     set (GMOCK_INCLUDE_DIR ${GMOCK_SOURCE_DIR}/include)


BUG: Make KWStyleTest output in a uniform and concise format

When invoked without editor-specific formatting (the default on
non-VisualStudio builds), KWStyle produces excessively verbose output,
to the point that test output submitted to CDash gets truncated. Invoking
without the '-v' flag does not solve this issue.

On a Unix system, piping this output of KWStyle to "grep -B1 '^Error'"
would resolve the issue, but there is no cross-platform way to easily
perform this filtering.

Instead, always use GCC-style output for the KWStyle test, and only use
the user-configured output style for the build target. This has the
additional benefit of making the test output uniform across all
configurations.

Change-Id: Ie8c9bb30ea210f4fec0900b7e97c48473e56813c

--- Utilities/KWStyle/KWStyle.cmake
+++ Utilities/KWStyle/KWStyle.cmake
@@ -1,3 +1,4 @@
+
 find_package(KWStyle 1.0.1
   QUIET
   )
@@ -28,7 +29,7 @@
     ${ITK_SOURCE_DIR}/Utilities/KWStyle/ITKOverwrite.txt
     )

-  # Define formatting for error messages
+  # Define formatting for error messages for output of build target
   option(KWSTYLE_USE_VIM_FORMAT
     "Set KWStyle to generate errors with a VIM-compatible format."
     OFF
@@ -71,17 +72,17 @@
     -v
     -D ${KWSTYLE_ITK_FILES_LIST_FILE}
     -o ${KWSTYLE_ITK_OVERWRITE_FILE}
-    ${KWSTYLE_EDITOR_FORMAT}
     )
   add_custom_target(StyleCheckCode
-    COMMAND ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS}
+    COMMAND ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS} ${KWSTYLE_EDITOR_FORMAT}
     COMMENT "Coding Style Checker"
     WORKING_DIRECTORY ${ITK_SOURCE_DIR} # the paths in KWSTYLE_CONFIGURATION_FILE are relative
     )
   if(BUILD_TESTING)
     set(itk-module KWStyle)
+    # for uniformity and brevity, test will always output GCC-style
     itk_add_test(NAME KWStyleCodeTest
-      COMMAND ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS}
+      COMMAND ${KWSTYLE_EXECUTABLE} ${KWSTYLE_ARGUMENTS} -gcc
       WORKING_DIRECTORY ${ITK_SOURCE_DIR}
       )
   endif(BUILD_TESTING)


COMP: Add missing ITKExamples_USE_WRAP_PYTHON conditionals

This is a follow-up to c427b6d353d565a7b2ea573d0feb65fb819b88de,
adding two lines that were inadvertedly removed.

--- Superbuild/Superbuild.cmake
+++ Superbuild/Superbuild.cmake
@@ -48,6 +48,8 @@
   set(_use_python_default OFF)
 endif()
 option(ITKExamples_USE_WRAP_PYTHON "Enable downloads of the ITK Python wrapping to the superbuild" ${_use_python_default})
+if(NOT EXISTS PYTHON_EXECUTABLE AND ITKExamples_USE_WRAP_PYTHON OR ITKExamples_USE_VTK)
+  include(${CMAKE_SOURCE_DIR}/External-Python.cmake)
   list(APPEND ITKExamples_DEPENDENCIES ITKPython)
   set(_python_args "-DPYTHON_EXECUTABLE:FILEPATH=${ITKPYTHON_EXECUTABLE}")
 endif()


Use CMP0025 new policy for Lua compilation

--- SuperBuild/lua.cmake
+++ SuperBuild/lua.cmake
@@ -2,7 +2,7 @@

 if(POLICY CMP0025)
-  cmake_policy(SET CMP0025 OLD)
+  cmake_policy(SET CMP0025 NEW)
 endif()

@@ -47,11 +47,9 @@
   SET( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} /wd4334" )
 endif()

-if( APPLE )
-  if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
-    # suppress Clang warnings about empty loop bodies and deprecated declarations (tmpnam)
-    SET( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wno-empty-body -Wno-deprecated-declarations" )
-  endif()
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang" )
+  # suppress Clang warnings about empty loop bodies and deprecated declarations (tmpnam)
+  SET( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} -Wno-empty-body -Wno-deprecated-declarations" )
 endif()

 # define the lua core source files


Enabling extra warnings.

Enabling extra warnings.

--- cmake/CMakeCompiler.cmake
+++ cmake/CMakeCompiler.cmake
@@ -26,7 +26,7 @@
 			target_link_libraries(${_project_name} PRIVATE "-m64")
 		endif()

-		target_compile_options(${_project_name} PRIVATE -Wall)				# Enable all warnings
+		target_compile_options(${_project_name} PRIVATE -Wall -Wextra)		# Enable all warnings
 		target_compile_options(${_project_name} PRIVATE -Werror)			# Treat warnings as errors
 	endif()
 endmacro()


Try to fix Linux static build.

Try to fix Linux static build.

--- cmake/HalleyProject.cmake
+++ cmake/HalleyProject.cmake
@@ -25,7 +25,7 @@
 	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")

 	if (HALLEY_ENABLE_STATIC_STDLIB)
-		if (CMAKE_CXX_COMPILER_ID EQUAL GNU)
+		if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++")
 		endif()


fix(msvc): configure generates errors with msvc

--- cmake/consort/flags.cmake
+++ cmake/consort/flags.cmake
@@ -80,16 +80,19 @@
 # Useful for manipulating CMake variables that contain command line flags, but
 # do not separate them into a standard CMake List.
 function(co_add_flags var)
-	co_split(_flags " " "${${var}}")
-	list(LENGTH _flags _n)
-	if( _n GREATER 0 )
-		list(REMOVE_ITEM _flags ${ARGN})
+	set(_args ${ARGN})
+	if(_args)
+		co_split(_flags " " "${${var}}")
+		list(LENGTH _flags _n)
+		if( _n GREATER 0 )
+			list(REMOVE_ITEM _flags ${ARGN})
+		endif()
+
+		list(APPEND _flags ${ARGN})
+
+		co_join(_flags " " ${_flags})
+		set( ${var} "${_flags}" PARENT_SCOPE )
 	endif()
-
-	list(APPEND _flags ${ARGN})
-
-	co_join(_flags " " ${_flags})
-	set( ${var} "${_flags}" PARENT_SCOPE )
 endfunction()

 ## Utilities/co_replace_flags


Fixes zlib install path.

Fixes zlib install path.

--- cmake/external/ZLIB.cmake
+++ cmake/external/ZLIB.cmake
@@ -5,5 +5,5 @@
     URL http://www.zlib.net/zlib-1.2.11.tar.gz
     URL_HASH SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
     BUILD_IN_SOURCE 1
-    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/libraries
+    CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/externals
 )


fix nccl compiler error

fix nccl compiler error

--- cmake/external/nccl.cmake
+++ cmake/external/nccl.cmake
@@ -2,7 +2,7 @@

 SET(NCCL_SOURCE_DIR ${THIRD_PARTY_PATH}/nccl)

-INCLUDE_DIRECTORIES(${NCCL_SOURCE_DIR}/src/extern_nccl)
+INCLUDE_DIRECTORIES(${NCCL_SOURCE_DIR}/src/extern_nccl/src)

 if(WITH_DSO)


Provide package-name and minvers for VTK

--- cmake/externals/VTK.cmake
+++ cmake/externals/VTK.cmake
@@ -1,7 +1,7 @@
 function(VTK_project)

-    set(DCMTK-minvers 3.6.1)
-    set(DCMTK-package-name dcmtk-inria)
+    set(VTK-minvers 5.8.0 PARENT_SCOPE)
+    set(VTK-package-name vtk-inria PARENT_SCOPE)

     if (DEFINED VTK_DIR AND NOT EXISTS ${VTK_DIR})
         message(FATAL_ERROR "VTK_DIR variable is defined but corresponds to non-existing directory")


Updated revision tag for new MITK-Data tarball.

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -13,7 +13,7 @@

 if(BUILD_TESTING)

-  set(revision_tag 452cf3a4)
+  set(revision_tag 2f58ecf9)

   ExternalProject_Add(${proj}
     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/MITK-Data_${revision_tag}.tar.gz


changed MITKData to new test data hash

changed MITKData to new test data hash

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

--- CMakeExternals/MITKData.cmake
+++ CMakeExternals/MITKData.cmake
@@ -12,7 +12,7 @@
 set(MITK-Data_DEPENDS ${proj})

 if(BUILD_TESTING)
-  set(revision_tag 8462f93c) # first 8 characters of hash-tag
+  set(revision_tag f0932f45) # first 8 characters of hash-tag
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


minor fix in Diagnostics.cmake;

minor fix in Diagnostics.cmake;

--- Diagnostics/Diagnostics.cmake
+++ Diagnostics/Diagnostics.cmake
@@ -16,9 +16,9 @@
 target_link_libraries(mtf_diag ${MTF_LIBS})
 target_include_directories(mtf_diag PUBLIC ${MTF_INCLUDE_DIRS} ${MTF_EXT_INCLUDE_DIRS})
 if(WIN32)
-	install(TARGETS mtf_diag ARCHIVE DESTINATION ${MTF_LIB_INSTALL_DIR} COMPONENT diag_lib)
+	install(TARGETS mtf_diag ARCHIVE DESTINATION ${MTF_INSTALL_DIR}/lib COMPONENT diag_lib)
 else()
-	install(TARGETS mtf_diag LIBRARY DESTINATION ${MTF_LIB_INSTALL_DIR} COMPONENT diag_lib)
+	install(TARGETS mtf_diag LIBRARY DESTINATION ${MTF_INSTALL_DIR}/lib COMPONENT diag_lib)
 endif()
 add_custom_target(diag_lib DEPENDS mtf_diag)
 if(NOT WIN32)


Fix yarn installation.

Fix yarn installation.

--- build/cmake/versions.cmake
+++ build/cmake/versions.cmake
@@ -108,5 +108,5 @@
 set(TRAFFICSERVER_HASH c8e5f3e81da643ea79cba0494ed37d45)
 set(UNBOUND_VERSION 1.6.4)
 set(UNBOUND_HASH df0a88816ec31ccb8284c9eb132e1166fbf6d9cde71fbc4b8cd08a91ee777fed)
-set(YARN_VERSION 0.28.2)
-set(YARN_HASH d41d8cd98f00b204e9800998ecf8427e)
+set(YARN_VERSION 0.28.1)
+set(YARN_HASH cec620899d1e1e73e5915bd1cc404974)


Stricter flags for find_library in FindMbedTLS.cmake

--- cmake/FindMbedTLS.cmake
+++ cmake/FindMbedTLS.cmake
@@ -65,7 +65,7 @@
 if(MBEDTLS_ROOT_DIR)
     # Disable re-rooting paths in find_path/find_library.
     # This assumes MBEDTLS_ROOT_DIR is an absolute path.
-    set(_EXTRA_FIND_ARGS "NO_CMAKE_FIND_ROOT_PATH")
+    set(_EXTRA_FIND_ARGS "NO_DEFAULT_PATH")
 endif()

 find_path(MBEDTLS_INCLUDE_DIR


Removed netlink route from list of required libraries

netlink route was never required but somehow managed to be listed in the CMake configuration

--- cmake/FindNetLink.cmake
+++ cmake/FindNetLink.cmake
@@ -48,20 +48,12 @@
                 PATHS
                 $(SEARCHPATHS)
                 )
-        FIND_LIBRARY(NLROUTE_LIBRARY
-                NAMES
-                nl-route-3 nl-route
-                PATH_SUFFIXES
-                lib64 lib
-                PATHS
-                $(SEARCHPATHS)
-                )
         #
         # If we don't have all of those libraries, we can't use libnl.
         #
-        IF (NOT NLGENL_LIBRARY AND NOT NLROUTE_LIBRARY)
+        IF (NOT NLGENL_LIBRARY)
             SET(NL_LIBRARY NOTFOUND)
-        ENDIF (NOT NLGENL_LIBRARY AND NOT NLROUTE_LIBRARY)
+        ENDIF (NOT NLGENL_LIBRARY)
         IF (NL_LIBRARY)
             STRING(REGEX REPLACE ".*nl-([^.,;]*).*" "\\1" NLSUFFIX ${NL_LIBRARY})
             IF (NLSUFFIX)
@@ -100,7 +92,7 @@
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NL DEFAULT_MSG NL_LIBRARY NL_INCLUDE_DIR)

 IF (NL_FOUND)
-    SET(NL_LIBRARIES ${NLGENL_LIBRARY} ${NLROUTE_LIBRARY} ${NL_LIBRARY})
+    SET(NL_LIBRARIES ${NLGENL_LIBRARY} ${NL_LIBRARY})
     SET(NL_INCLUDE_DIRS ${NL_INCLUDE_DIR})
 ELSE ()
     SET(NL_LIBRARIES)


Create tbag_modules__apply_boost_libs () cmake method.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -277,6 +277,17 @@
     list (APPEND TBAG_PROJECT_LDFLAGS      ${Boost_LIBRARIES})
 endmacro ()

+macro (tbag_modules__apply_boost_include)
+    list (APPEND TBAG_PROJECT_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
+endmacro ()
+
+macro (tbag_modules__apply_boost_libs)
+    foreach (__lib_cursor ${ARGN})
+        string (TOUPPER "${__lib_cursor}" __lib_upper_name)
+        list (APPEND TBAG_PROJECT_LDFLAGS "${Boost_${__lib_upper_name}_LIBRARY}")
+    endforeach ()
+endmacro ()
+
 macro (tbag_modules__check_gflags)
     if (NOT GFlags_FOUND)
         message (WARNING "Not found Google-gflags.")


CMake: show module path in tooltip of CMakeUI

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -211,11 +211,10 @@
     ivw_dir_to_mod_dep(mod_dep ${the_module})
     first_case_upper(dir_name_cap ${the_module})

+    set(desc "Build ${dir_name_cap} Module\nPath: ${${mod_dep}_path}")
     if(${mod_dep}_description)
         decodeLineBreaks(decodedDesc ${${mod_dep}_description})
-        set(desc "Build ${dir_name_cap} Module\n${decodedDesc}")
-    else()
-        set(desc "Build ${dir_name_cap} Module")
+        set(desc "${desc}\n\n${decodedDesc}")
     endif()

     if(forcemodule)


CMake: Link to ZLIB only if protobuf_WITH_ZLIB enabled

--- cmake/libprotobuf.cmake
+++ cmake/libprotobuf.cmake
@@ -56,7 +56,10 @@

 add_library(libprotobuf ${protobuf_SHARED_OR_STATIC}
   ${libprotobuf_lite_files} ${libprotobuf_files})
-target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT} ${ZLIB_LIBRARIES})
+target_link_libraries(libprotobuf ${CMAKE_THREAD_LIBS_INIT})
+if(protobuf_WITH_ZLIB)
+    target_link_libraries(libprotobuf ${ZLIB_LIBRARIES})
+endif()
 target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
 if(MSVC AND protobuf_BUILD_SHARED_LIBS)
   target_compile_definitions(libprotobuf


another cmake fix (#5630)

another cmake fix (#5630)

--- cmake/modules/VTA.cmake
+++ cmake/modules/VTA.cmake
@@ -102,7 +102,7 @@
     endif()
     # Target lib: vta
     add_library(vta SHARED ${FPGA_RUNTIME_SRCS})
-    target_include_directories(vta PUBLIC vta/include)
+    target_include_directories(vta PUBLIC vta/runtime)
     foreach(__def ${VTA_DEFINITIONS})
       string(SUBSTRING ${__def} 3 -1 __strip_def)
       target_compile_definitions(vta PUBLIC ${__strip_def})


cmake: usage: Added posix to list of arch's with boards

Added posix to the list of arch's with boards. Usage will now show
native_posix as one of the available boards.

Signed-off-by: Sebastian Bøe <edee888afd63e94916688495334700803eba20a0@nordicsemi.no>

--- cmake/usage/usage.cmake
+++ cmake/usage/usage.cmake
@@ -7,6 +7,7 @@
   arm
   nios2
   riscv32
+  posix
   x86
   xtensa
   )


Reset C[XX]_FLAGS for Mingw. Doesn't like -rdynamic.

--- cmake/Toolchain-cross-mingw32-linux.cmake
+++ cmake/Toolchain-cross-mingw32-linux.cmake
@@ -31,3 +31,6 @@
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
+SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")