add custom CUDA_ARCH for modern Gpus

add custom CUDA_ARCH for modern Gpus

Change-Id: I569a4db567f27c1b9e143086930a9f7079c20f78

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -74,13 +74,32 @@
 # Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc.
 # So, don't set these flags here.

+function(specify_cuda_arch cuda_version cuda_arch)
+    if(${cuda_version} VERSION_GREATER "8.0")
+        foreach(capability 60 61 62)
+          if(${cuda_arch} STREQUAL ${capability})
+            list(APPEND __arch_flags " -gencode arch=compute_${cuda_arch},code=sm_${cuda_arch}")
+          endif()
+        endforeach()
+    elseif(${cuda_version} VERSION_GREATER "7.0")
+        foreach(capability 52 53)
+          if(${cuda_arch} STREQUAL ${capability})
+            list(APPEND __arch_flags " -gencode arch=compute_${cuda_arch},code=sm_${cuda_arch}")
+          endif()
+        endforeach()
+    endif()
+endfunction()
+
+# Common cuda architectures
 foreach(capability 30 35 50)
     list(APPEND __arch_flags " -gencode arch=compute_${capability},code=sm_${capability}")
 endforeach()

-if (CUDA_VERSION VERSION_GREATER "7.0")
-    list(APPEND __arch_flags " -gencode arch=compute_52,code=sm_52")
+# Custom cuda architecture
+set(CUDA_ARCH)
+
+if(CUDA_ARCH)
+  specify_cuda_arch(${CUDA_VERSION} ${CUDA_ARCH})
 endif()

-
 set(CUDA_NVCC_FLAGS ${__arch_flags} ${CUDA_NVCC_FLAGS})


Travis: A Lost Hope - Episode VI DLC 1

Travis: A Lost Hope - Episode VI DLC 1

--- cmake/mysql.cmake
+++ cmake/mysql.cmake
@@ -11,6 +11,7 @@
         /usr/local/mysql/include/mysql
         $ENV{ProgramFiles}/MySQL/*/include
         $ENV{SystemDrive}/MySQL/*/include
+        ${LIBRARY_DIR}/external/MySQL/
     )

     if(MYSQL_INCLUDE_DIR)


Avoid -fPIC for MinGW builds

Avoid -fPIC for MinGW builds

Android NDK build uses a MinGW build that warns if -fPIC is specified
because PIC is always turned on anyway.  That causes an error since
we have warnings as errors.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -9,7 +9,10 @@

 function(shaderc_default_c_compile_options TARGET)
   if (NOT "${MSVC}")
-    target_compile_options(${TARGET} PRIVATE -Wall -Werror -fPIC -fvisibility=hidden)
+    target_compile_options(${TARGET} PRIVATE -Wall -Werror -fvisibility=hidden)
+    if (NOT "${MINGW}")
+      target_compile_options(${TARGET} PRIVATE -fPIC)
+    endif()
     if (ENABLE_CODE_COVERAGE)
       # The --coverage option is a synonym for -fprofile-arcs -ftest-coverage
       # when compiling.


- handling the case when working with a PAE kernel.

--- cmake/dtkPack.cmake
+++ cmake/dtkPack.cmake
@@ -28,6 +28,7 @@
   if( "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" )
     # To obtain rpm named such as dtk-...-.fc10.x86_64.rpm
     execute_process( COMMAND uname -r
+                     COMMAND sed "s/\\.PAE//"   # Getting rid of the PAE keyword, not relevant here.
                      COMMAND sed "s/.*\\.\\(\\w*\\.\\w*\\)$/\\1/"
                      OUTPUT_VARIABLE PACKAGE_EXTENSION
                      OUTPUT_STRIP_TRAILING_WHITESPACE)


cmake: kconfig: use absolute files for merge_config_files

The `merge_config_files` list contains files with both relative and
absolute paths.
Each entry is checked and files with a relative path are converted to
absolute path. This creates a `merge_config_files_with_absolute_paths`
identical to the `merge_config_files` but with absolute path on each
entry.

Afterwards it is mixed whether `merge_config_files` or
`merge_config_files_with_absolute_paths` are used creating unnecessary
risk when the list with relative path files are used.

This commit sets the content of `merge_config_files` with updated
absolute paths files, and also updates all places to use this list.

This ensures that after path conversion then only the list with absolute
paths is used.

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

--- cmake/kconfig.cmake
+++ cmake/kconfig.cmake
@@ -204,8 +204,9 @@

   list(APPEND merge_config_files_with_absolute_paths ${path})
 endforeach()
-
-foreach(f ${merge_config_files_with_absolute_paths})
+set(merge_config_files ${merge_config_files_with_absolute_paths})
+
+foreach(f ${merge_config_files})
   if(NOT EXISTS ${f} OR IS_DIRECTORY ${f})
     message(FATAL_ERROR "File not found: ${f}")
   endif()
@@ -214,7 +215,7 @@
 # Calculate a checksum of merge_config_files to determine if we need
 # to re-generate .config
 set(merge_config_files_checksum "")
-foreach(f ${merge_config_files_with_absolute_paths})
+foreach(f ${merge_config_files})
   file(MD5 ${f} checksum)
   set(merge_config_files_checksum "${merge_config_files_checksum}${checksum}")
 endforeach()


Support suppressing target exporting

Support suppressing target exporting

--- cmake/targets.cmake
+++ cmake/targets.cmake
@@ -102,17 +102,19 @@
       runtime)
   endif ()

-  set(exports)
+  if (NOT no_export)
+    set(exports)

-  if ("${library_subdir}" STREQUAL "")
-    set(exports
-      EXPORT vistk_exports)
+    if ("${library_subdir}" STREQUAL "")
+      set(exports
+        EXPORT vistk_exports)
+    endif ()
+
+    export(
+      TARGETS ${name}
+      APPEND
+      FILE    "${vistk_export_file}")
   endif ()
-
-  export(
-    TARGETS ${name}
-    APPEND
-    FILE    "${vistk_export_file}")

   get_target_property(target_type
     ${name} TYPE)


Compile static libraries with -fPIC

Compile static libraries with -fPIC

--- cmake/targets.cmake
+++ cmake/targets.cmake
@@ -119,6 +119,13 @@
     ${name}
     CACHE INTERNAL "Libraries built as part of vistk")

+  get_target_property(target_type
+    ${name} TYPE)
+
+  if (target_type STREQUAL "STATIC_LIBRARY")
+    vistk_compile_pic(${name})
+  endif ()
+
   vistk_install(
     TARGETS       ${name}
     ${exports}


FIX (#3235): do not build Qt-dependent modules if MITK_USE_QT is OFF

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -130,23 +130,25 @@
 ENDMACRO(MITK_CREATE_MODULE_CONF)

 MACRO(_MITK_CREATE_MODULE_CONF)
-  IF(NOT MODULE_PROVIDES AND NOT MODULE_HEADERS_ONLY)
-    SET(MODULE_PROVIDES ${MODULE_NAME})
-  ENDIF(NOT MODULE_PROVIDES AND NOT MODULE_HEADERS_ONLY)
-  SET(MODULE_INCLUDE_DIRS_ABSOLUTE "")
-  FOREACH(dir ${MODULE_INCLUDE_DIRS})
-    GET_FILENAME_COMPONENT(abs_dir ${dir} ABSOLUTE)
-    SET(MODULE_INCLUDE_DIRS_ABSOLUTE ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${abs_dir})
-  ENDFOREACH(dir)
-
-  SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${CMAKE_CURRENT_SOURCE_DIR})
-
-  # Qt generates headers in the binary tree
-  IF(MODULE_QT_MODULE)
-    SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
-  ENDIF(MODULE_QT_MODULE)
-
-  CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleConf.cmake.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake @ONLY)
+  IF(NOT MODULE_QT_MODULE OR MITK_USE_QT)
+    IF(NOT MODULE_PROVIDES AND NOT MODULE_HEADERS_ONLY)
+      SET(MODULE_PROVIDES ${MODULE_NAME})
+    ENDIF(NOT MODULE_PROVIDES AND NOT MODULE_HEADERS_ONLY)
+    SET(MODULE_INCLUDE_DIRS_ABSOLUTE "")
+    FOREACH(dir ${MODULE_INCLUDE_DIRS})
+      GET_FILENAME_COMPONENT(abs_dir ${dir} ABSOLUTE)
+      SET(MODULE_INCLUDE_DIRS_ABSOLUTE ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${abs_dir})
+    ENDFOREACH(dir)
+
+    SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${CMAKE_CURRENT_SOURCE_DIR})
+
+    # Qt generates headers in the binary tree
+    IF(MODULE_QT_MODULE)
+      SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
+    ENDIF(MODULE_QT_MODULE)
+
+    CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleConf.cmake.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake @ONLY)
+  ENDIF(NOT MODULE_QT_MODULE OR MITK_USE_QT)
 ENDMACRO(_MITK_CREATE_MODULE_CONF)

 ##################################################################
@@ -176,94 +178,96 @@
   IF(_MISSING_DEP)
     MESSAGE("Warning: Module ${MODULE_NAME} won't be built, missing dependency: ${_MISSING_DEP}")
      # remove possibly existing config, to avoid strange errors
-     FILE(REMOVE ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake )
-   ELSE(_MISSING_DEP)
-  _MITK_CREATE_MODULE_CONF()
-
-  IF(NOT MODULE_EXPORT_DEFINE)
-    SET(MODULE_EXPORT_DEFINE ${MODULE_NAME}_EXPORT)
-  ENDIF(NOT MODULE_EXPORT_DEFINE)
-  CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleExports.h.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Exports.h @ONLY)
-
-  IF(MITK_GENERATE_MODULE_DOT)
-  MESSAGE("MODULEDOTNAME ${MODULE_NAME}")
-  FOREACH(dep ${MODULE_DEPENDS})
-    MESSAGE("MODULEDOT \"${MODULE_NAME}\" -> \"${dep}\" ; ")
-  ENDFOREACH(dep)
-  ENDIF(MITK_GENERATE_MODULE_DOT)
-
-  SET(DEPENDS "${MODULE_DEPENDS}")
-  SET(DEPENDS_BEFORE "not initialized")
-  SET(PACKAGE_DEPENDS "${MODULE_PACKAGE_DEPENDS}")
-  MITK_USE_MODULE("${MODULE_DEPENDS}")
-
-  # ok, now create the module itself
-  INCLUDE_DIRECTORIES(. ${ALL_INCLUDE_DIRECTORIES})
-  INCLUDE(files.cmake)
-
-  IF(NOT MODULE_QT_MODULE)
-    ORGANIZE_SOURCES(SOURCE ${CPP_FILES}
-                     HEADER	${H_FILES}
-					 TXX ${TXX_FILES}
-					 DOC ${DOX_FILES}
-					 )
-
-
-    IF(MODULE_FORCE_STATIC)
-      SET(_STATIC ${MITK_WIN32_FORCE_STATIC})
-    ENDIF(MODULE_FORCE_STATIC)
-
+    FILE(REMOVE ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake )
+  ELSE(_MISSING_DEP)
+    IF(NOT MODULE_QT_MODULE OR MITK_USE_QT)
+    _MITK_CREATE_MODULE_CONF()
+
+    IF(NOT MODULE_EXPORT_DEFINE)
+      SET(MODULE_EXPORT_DEFINE ${MODULE_NAME}_EXPORT)
+    ENDIF(NOT MODULE_EXPORT_DEFINE)
+    CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleExports.h.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Exports.h @ONLY)
+
+    IF(MITK_GENERATE_MODULE_DOT)
+    MESSAGE("MODULEDOTNAME ${MODULE_NAME}")
+    FOREACH(dep ${MODULE_DEPENDS})
+      MESSAGE("MODULEDOT \"${MODULE_NAME}\" -> \"${dep}\" ; ")
+    ENDFOREACH(dep)
+    ENDIF(MITK_GENERATE_MODULE_DOT)
+
+    SET(DEPENDS "${MODULE_DEPENDS}")
+    SET(DEPENDS_BEFORE "not initialized")
+    SET(PACKAGE_DEPENDS "${MODULE_PACKAGE_DEPENDS}")
+    MITK_USE_MODULE("${MODULE_DEPENDS}")
+
+    # ok, now create the module itself
+    INCLUDE_DIRECTORIES(. ${ALL_INCLUDE_DIRECTORIES})
+    INCLUDE(files.cmake)
+
+    IF(NOT MODULE_QT_MODULE)
+      ORGANIZE_SOURCES(SOURCE ${CPP_FILES}
+		       HEADER	${H_FILES}
+					   TXX ${TXX_FILES}
+					   DOC ${DOX_FILES}
+					   )
+
+
+      IF(MODULE_FORCE_STATIC)
+	SET(_STATIC ${MITK_WIN32_FORCE_STATIC})
+      ENDIF(MODULE_FORCE_STATIC)
+
+      IF(NOT MODULE_HEADERS_ONLY)
+	ADD_LIBRARY(${MODULE_PROVIDES} ${_STATIC} ${CPP_FILES} ${H_FILES} ${CPP_FILES_GENERATED} ${GLOBBED__H_FILES} ${CORRESPONDING__H_FILES} ${TXX_FILES} ${DOX_FILES} ${UI_FILES} ${TOOL_CPPS})
+	IF(ALL_LIBRARIES)
+	  TARGET_LINK_LIBRARIES(${MODULE_PROVIDES} ${ALL_LIBRARIES})
+	ENDIF(ALL_LIBRARIES)
+      ENDIF()
+
+    ELSE(NOT MODULE_QT_MODULE)
+
+      INCLUDE(files.cmake)
+
+    IF(UI_FILES)
+	QT4_WRAP_UI(Q${KITNAME}_GENERATED_UI_CPP ${UI_FILES})
+    ENDIF(UI_FILES)
+
+    IF(MOC_H_FILES)
+	QT4_WRAP_CPP(Q${KITNAME}_GENERATED_MOC_CPP ${MOC_H_FILES})
+    ENDIF(MOC_H_FILES)
+
+    IF(QRC_FILES)
+      QT4_ADD_RESOURCES(Q${KITNAME}_GENERATED_QRC_CPP ${QRC_FILES})
+    ENDIF(QRC_FILES)
+
+    SET(Q${KITNAME}_GENERATED_CPP ${Q${KITNAME}_GENERATED_CPP} ${Q${KITNAME}_GENERATED_UI_CPP} ${Q${KITNAME}_GENERATED_MOC_CPP} ${Q${KITNAME}_GENERATED_QRC_CPP})
+
+    ORGANIZE_SOURCES(SOURCE ${CPP_FILES}
+		     HEADER ${H_FILES}
+				     TXX ${TXX_FILES}
+				     DOC ${DOX_FILES}
+		     UI ${UI_FILES}
+		     QRC ${QRC_FILES}
+				     MOC ${Q${KITNAME}_GENERATED_MOC_CPP}
+				     GEN_QRC ${Q${KITNAME}_GENERATED_QRC_CPP}
+				     GEN_UI ${Q${KITNAME}_GENERATED_UI_CPP})
+
+    # MITK_GENERATE_TOOLS_LIBRARY(Qmitk${LIBPOSTFIX} "NO")
+
     IF(NOT MODULE_HEADERS_ONLY)
-      ADD_LIBRARY(${MODULE_PROVIDES} ${_STATIC} ${CPP_FILES} ${H_FILES} ${CPP_FILES_GENERATED} ${GLOBBED__H_FILES} ${CORRESPONDING__H_FILES} ${TXX_FILES} ${DOX_FILES} ${UI_FILES} ${TOOL_CPPS})
-      IF(ALL_LIBRARIES)
-        TARGET_LINK_LIBRARIES(${MODULE_PROVIDES} ${ALL_LIBRARIES})
-      ENDIF(ALL_LIBRARIES)
+      ADD_LIBRARY(${MODULE_PROVIDES} ${CPP_FILES} ${CPP_FILES_GENERATED} ${Q${KITNAME}_GENERATED_CPP} ${CORRESPONDING__H_FILES} ${GLOBBED__H_FILES} ${TXX_FILES} ${DOX_FILES} ${UI_FILES} ${QRC_FILES} ${TOOL_GUI_CPPS})
+      TARGET_LINK_LIBRARIES(${MODULE_PROVIDES} ${QT_LIBRARIES} ${ALL_LIBRARIES} QVTK)
     ENDIF()
-
-  ELSE(NOT MODULE_QT_MODULE)
-
-    INCLUDE(files.cmake)
-
-  IF(UI_FILES)
-      QT4_WRAP_UI(Q${KITNAME}_GENERATED_UI_CPP ${UI_FILES})
-  ENDIF(UI_FILES)
-
-  IF(MOC_H_FILES)
-      QT4_WRAP_CPP(Q${KITNAME}_GENERATED_MOC_CPP ${MOC_H_FILES})
-  ENDIF(MOC_H_FILES)
-
-  IF(QRC_FILES)
-    QT4_ADD_RESOURCES(Q${KITNAME}_GENERATED_QRC_CPP ${QRC_FILES})
-  ENDIF(QRC_FILES)
-
-  SET(Q${KITNAME}_GENERATED_CPP ${Q${KITNAME}_GENERATED_CPP} ${Q${KITNAME}_GENERATED_UI_CPP} ${Q${KITNAME}_GENERATED_MOC_CPP} ${Q${KITNAME}_GENERATED_QRC_CPP})
-
-  ORGANIZE_SOURCES(SOURCE ${CPP_FILES}
-                   HEADER ${H_FILES}
-				   TXX ${TXX_FILES}
-				   DOC ${DOX_FILES}
-                   UI ${UI_FILES}
-                   QRC ${QRC_FILES}
-				   MOC ${Q${KITNAME}_GENERATED_MOC_CPP}
-				   GEN_QRC ${Q${KITNAME}_GENERATED_QRC_CPP}
-				   GEN_UI ${Q${KITNAME}_GENERATED_UI_CPP})
-
-  # MITK_GENERATE_TOOLS_LIBRARY(Qmitk${LIBPOSTFIX} "NO")
-
-  IF(NOT MODULE_HEADERS_ONLY)
-    ADD_LIBRARY(${MODULE_PROVIDES} ${CPP_FILES} ${CPP_FILES_GENERATED} ${Q${KITNAME}_GENERATED_CPP} ${CORRESPONDING__H_FILES} ${GLOBBED__H_FILES} ${TXX_FILES} ${DOX_FILES} ${UI_FILES} ${QRC_FILES} ${TOOL_GUI_CPPS})
-    TARGET_LINK_LIBRARIES(${MODULE_PROVIDES} ${QT_LIBRARIES} ${ALL_LIBRARIES} QVTK)
-  ENDIF()
-
-  ENDIF(NOT MODULE_QT_MODULE)
-
-
-  # install only if shared lib (for now)
-  IF(NOT MODULE_FORCE_STATIC OR MINGW)
-    IF(NOT MODULE_HEADERS_ONLY)
-      MITK_INSTALL_TARGETS(${MODULE_PROVIDES})
-    ENDIF()
-  ENDIF(NOT MODULE_FORCE_STATIC OR MINGW)
+
+    ENDIF(NOT MODULE_QT_MODULE)
+
+
+    # install only if shared lib (for now)
+    IF(NOT MODULE_FORCE_STATIC OR MINGW)
+      IF(NOT MODULE_HEADERS_ONLY)
+	MITK_INSTALL_TARGETS(${MODULE_PROVIDES})
+      ENDIF()
+    ENDIF(NOT MODULE_FORCE_STATIC OR MINGW)
+  ENDIF(NOT MODULE_QT_MODULE OR MITK_USE_QT)
 ENDIF(_MISSING_DEP)
 ENDMACRO(MITK_CREATE_MODULE)


added stack.c

added stack.c

git-svn-id: 9e9401559e51101c165cdce4d49b411eb20436ed@3703 3d70eeeb-363e-0410-a505-8a46323a89f2

--- src/gage/sources.cmake
+++ src/gage/sources.cmake
@@ -14,6 +14,7 @@
   sclprint.c
   shape.c
   st.c
+  stack.c
   update.c
   vecGage.c
   vecprint.c


cpu.cmake: use unique flag to test simd disable flags

this avoids the result being cached in a common variable causing
potentially incorrect results in future tests and improves the logging
output

BUG=webp:351

Change-Id: I4b3110beec38f505fc8f835c3ea689a7d81a36bb

--- cmake/cpu.cmake
+++ cmake/cpu.cmake
@@ -101,11 +101,12 @@
             set(COMMON_PATTERNS)
           endif()
           set(CMAKE_REQUIRED_DEFINITIONS ${SIMD_COMPILE_FLAG})
-          check_c_source_compiles("int main(void) {return 0;}" FLAG2
+          check_c_source_compiles("int main(void) {return 0;}"
+            FLAG_${SIMD_COMPILE_FLAG}
             FAIL_REGEX "warning: argument unused during compilation:"
             ${COMMON_PATTERNS}
           )
-          if(NOT FLAG2)
+          if(NOT FLAG_${SIMD_COMPILE_FLAG})
             unset(HAS_COMPILE_FLAG CACHE)
           endif()
         endif()


Remove gcc 4.8 warning for icc -- not necessary

--- cmake/icc.cmake
+++ cmake/icc.cmake
@@ -35,24 +35,6 @@
 SET(OSPRAY_ARCH_AVX2    "-xCORE-AVX2")
 SET(OSPRAY_ARCH_AVX512  "-xMIC-AVX512")

-# check whether GCC (and therefore standard library) version is new enough for
-# C++11 on Linux systems
-IF (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  SET(GCC_VERSION_REQUIRED "4.8.0")
-
-  IF(NOT GCC_VERSION)
-    EXECUTE_PROCESS(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_OUTPUT OUTPUT_STRIP_TRAILING_WHITESPACE)
-    SET(GCC_VERSION ${GCC_OUTPUT} CACHE STRING "GCC Version")
-    MARK_AS_ADVANCED(GCC_VERSION)
-  ENDIF()
-
-  IF (GCC_VERSION VERSION_LESS GCC_VERSION_REQUIRED AND NOT OSPRAY_WARNED_GCC_VERSION)
-        # only warn as another libstdc++ could be in the library path...
-    MESSAGE(WARNING "GCC version 4.8.0 or greater is required for a sufficient version of libstdc++.")
-    SET(OSPRAY_WARNED_GCC_VERSION ON CACHE INTERNAL "Warned about required GCC version.")
-  ENDIF()
-ENDIF()
-
 SET(OSPRAY_COMPILER_SUPPORTS_AVX  TRUE)
 SET(OSPRAY_COMPILER_SUPPORTS_AVX2 TRUE)
 SET(OSPRAY_COMPILER_SUPPORTS_AVX512 TRUE)


Testsuite: Silence a warning

Testsuite: Silence a warning

Silence a warning that occurse when "DEAL_II_PICKUP_TESTS()" is not called
within the test subprojects

--- tests/setup_testsubproject.cmake
+++ tests/setup_testsubproject.cmake
@@ -6,8 +6,13 @@
 #
 # Silence warnings:
 #
-FOREACH(_var MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_POSTFLAGS MPIEXEC_PREFLAGS)
-  SET(${_var} ${${_var}})
+FOREACH(_var
+  DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_PICKUP_REGEX TEST_TIME_LIMIT MPIEXEC
+  MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS
+  )
+  IF(DEFINED ${_var})
+    SET(_bogus "${${_var}}")
+  ENDIF()
 ENDFOREACH()

 #


Update System.cmake

Update System.cmake

Adding FreeBSD system.

Those (like me) using FreeBSD get an error while configuring project. Now here it checks if the system is 'FreeBSD' and sets the SYSTEM variable to 'FreeBSD' if is the case

--- System.cmake
+++ System.cmake
@@ -21,6 +21,9 @@
 if(CMAKE_SYSTEM_NAME MATCHES "Linux")
   set(SYSTEM Linux)
 endif()
+if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+  set(SYSTEM FreeBSD)
+endif()
 if(NOT SYSTEM)
   message(FATAL_ERROR "Unable to determine OS")
 endif()


modified location of CCPi python file

modified location of CCPi python file

--- SuperBuild/External_CCPi-Framework.cmake
+++ SuperBuild/External_CCPi-Framework.cmake
@@ -60,7 +60,7 @@
           -DPYTHON_DEST_DIR:PATH=${PYTHON_DEST}
           -DOPENMP_INCLUDES:PATH=${OPENMP_INCLUDES}
           -DCIL_VERSION:STRING=${${proj}_TAG}
-      INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install && ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/data ${SUPERBUILD_INSTALL_DIR}/share/cil/ && ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/patches/cil-patch.py ${${proj}_SOURCE_DIR}/Wrappers/Python/cil/utilities/dataexample.py ${PYTHON_DEST}/cil/utilities/dataexample.py
+      INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install && ${CMAKE_COMMAND} -E copy_directory ${${proj}_SOURCE_DIR}/Wrappers/Python/data ${SUPERBUILD_INSTALL_DIR}/share/cil/ && ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/patches/cil-patch.py ${${proj}_SOURCE_DIR}/Wrappers/Python/ccpi/utilities/dataexample.py ${PYTHON_DEST}/ccpi/utilities/dataexample.py
       DEPENDS ${${proj}_DEPENDENCIES}
     )


Exclude tests having a LongRunning label in continuous mode

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -114,10 +114,15 @@
   if (NOT TESTING_PARALLEL_LEVEL)
     set(TESTING_PARALLEL_LEVEL 8)
   endif()
+  set(exclude_label)
+  if(SCRIPT_MODE STREQUAL "continuous")
+    set(exclude_label EXCLUDE_LABEL LongRunning)
+  endif()
   ctest_test(BUILD "${build_dir}"
              INCLUDE_LABEL ${label}
              PARALLEL_LEVEL ${TESTING_PARALLEL_LEVEL}
              EXCLUDE ${TEST_TO_EXCLUDE_REGEX}
+             ${exclude_label}
              RETURN_VALUE res
             )
   ctest_submit(PARTS Test)


use fl_USING_CATKIN instead of catkin_FOUND to support optional catkin usage

--- cmake/gtest.cmake
+++ cmake/gtest.cmake
@@ -2,11 +2,11 @@
 include(ExternalProject)
 include(CMakeParseArguments)

-set(gtest_LIBRARY gtest)
-set(gtest_main_LIBRARY gtest_main)
+set(gtest_LIBRARY gtesting)
+set(gtest_main_LIBRARY gtesting_main)
 set(fl_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY})

-if(NOT catkin_FOUND)
+if(NOT fl_USING_CATKIN)
     set(GTEST_FRAMEWORK gtest_framework)

     ExternalProject_Add(
@@ -40,9 +40,7 @@
     add_dependencies(${gtest_main_LIBRARY} ${gtest_LIBRARY})

     include_directories(${gtest_INCLUDE_DIR}/include)
-else(NOT catkin_FOUND)
-
-endif(NOT catkin_FOUND)
+endif(NOT fl_USING_CATKIN)

 function(fl_add_test)
     set(options)
@@ -53,12 +51,12 @@

     set(TEST_NAME "${fl_NAME}_test")

-    if(NOT catkin_FOUND)
+    if(NOT fl_USING_CATKIN)
         add_executable(${TEST_NAME} ${fl_SOURCES})
         target_link_libraries(${TEST_NAME} ${fl_TEST_LIBS} ${fl_LIBS})
         add_test(${TEST_NAME} ${TEST_NAME})
-    else(NOT catkin_FOUND)
+    else(NOT fl_USING_CATKIN)
         catkin_add_gtest(${TEST_NAME} ${fl_SOURCES})
         target_link_libraries(${TEST_NAME} ${fl_TEST_LIBS} ${fl_LIBS})
-    endif(NOT catkin_FOUND)
+    endif(NOT fl_USING_CATKIN)
 endfunction(fl_add_test)


Added to cmake

Added to cmake

--- Modules/DiffusionImaging/Connectomics/files.cmake
+++ Modules/DiffusionImaging/Connectomics/files.cmake
@@ -34,7 +34,6 @@
   Algorithms/mitkConnectomicsBetweennessHistogram.cpp
   Algorithms/mitkConnectomicsHistogramCache.cpp
   Algorithms/mitkConnectomicsSyntheticNetworkGenerator.cpp
-  #Algorithms/itkConnectomicsNetworkToConnectivityMatrixImageFilter.cpp
   Algorithms/mitkConnectomicsSimulatedAnnealingPermutationBase.cpp
   Algorithms/mitkConnectomicsSimulatedAnnealingPermutationModularity.cpp
   Algorithms/mitkConnectomicsSimulatedAnnealingManager.cpp
@@ -42,6 +41,7 @@
   Algorithms/mitkConnectomicsSimulatedAnnealingCostFunctionModularity.cpp
   Algorithms/mitkConnectomicsStatisticsCalculator.cpp
   Algorithms/mitkConnectomicsNetworkConverter.cpp
+  Algorithms/mitkConnectomicsNetworkThresholder.cpp
 )

 set(H_FILES


Add libm to the lib of required libraries when doing system checks

--- configure.cmake
+++ configure.cmake
@@ -283,7 +283,7 @@
   FIND_PACKAGE(Threads)

   SET(CMAKE_REQUIRED_LIBRARIES
-    ${LIBNLS} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT})
+    ${LIBM} ${LIBNLS} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT})

   LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})


added back in png support

added back in png support

--- vtkCMakeOptions.cmake
+++ vtkCMakeOptions.cmake
@@ -137,8 +137,6 @@
 #
 # on windows we have it checked in

-OPTION(VTK_USE_PNGLIB "Link the PNG library", OFF)
-
 IF (WIN32)
   FIND_LIBRARY(PNG_LIBRARY libpng "${VTK_SOURCE_DIR}/IO/PNG")
   FIND_PATH(PNG_INCLUDE_PATH png.h "${VTK_SOURCE_DIR}/IO/PNG")


FindR: include subdirectories when searching for libraries on Linux.

--- library/cmake/Modules/FindR.cmake
+++ library/cmake/Modules/FindR.cmake
@@ -51,7 +51,7 @@
 			R
 		PATHS
 			${R_LIBRARY_DIR}
-			${R_HOME_DIR}
+			"${R_HOME_DIR}/*"
 	)
 	unset(R_LIBRARY_DIR)


Fix CMake needed to be ran twice to locate model

--- src/cmake/bvlc_reference_caffenet_resources.cmake
+++ src/cmake/bvlc_reference_caffenet_resources.cmake
@@ -11,18 +11,22 @@
 if(NOT EXISTS ${MODEL_MEAN_PATH})
   message(STATUS "Downloading imagenet_mean.binaryproto ...")
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/caffe/data/ilsvrc12/get_ilsvrc_aux.sh)
-  if(NOT EXISTS ${MODEL_MEAN_PATH})
-    message(FATAL_ERROR "Failed to download imagenet_mean.binaryproto to ${MODEL_MEAN_PATH}")
-  endif()
+endif()
+
+# Validate imagenet_mean is found
+if(NOT EXISTS ${MODEL_MEAN_PATH})
+  message(FATAL_ERROR "Failed to download imagenet_mean.binaryproto to ${MODEL_MEAN_PATH}")
 endif()

 # Download bvlc_reference_caffenet model if required
 if(NOT EXISTS ${MODEL_PATH})
   message(STATUS "Downloading bvlc_reference_caffenet.caffemodel ...")
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/caffe/scripts/download_model_binary.py ${CMAKE_SOURCE_DIR}/caffe/models/bvlc_reference_caffenet)
-  if(NOT EXISTS ${MODEL_PATH})
+endif()
+
+# Validate bvlc_reference_caffenet model is found
+if(NOT EXISTS ${MODEL_PATH})
     message(FATAL_ERROR "Failed to download bvlc_reference_caffenet.caffemodel to ${MODEL_PATH}")
-  endif()
 else()
   add_definitions(-DMODEL_PATH="${MODEL_PATH}")
 endif()


make: Fix .img files becoming too large because of dependency problem

--- etc/service.cmake
+++ etc/service.cmake
@@ -302,7 +302,7 @@
 add_custom_target(
   prepend_bootloader ALL
   COMMAND $ENV{INCLUDEOS_PREFIX}/includeos/bin/vmbuild ${BINARY} $ENV{INCLUDEOS_PREFIX}/includeos/boot/bootloader
-  DEPENDS service
+  DEPENDS pruned_elf_symbols
 )

 # install binary directly to prefix (which should be service root)


Update double-conversion release.

Update double-conversion release.

--- cmake/projects/double-conversion/hunter.cmake
+++ cmake/projects/double-conversion/hunter.cmake
@@ -12,8 +12,9 @@
     VERSION
     "3.0.0"
     URL
-    "https://github.com/hunter-packages/double-conversion/archive/v3.0.0-hunter-release.tar.gz"
-    SHA1 8c28e2f7814922630ebe8cbc048488ff04b4430f
+    "https://github.com/hunter-packages/double-conversion/archive/v3.0.0-p0.tar.gz"
+    SHA1
+    8cef7eff66b8488f996fb091f036eb6dc82f92d5
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)


added compiler options for memory, init, branches and booleans

--- cmake_compiler_settings/cmake/gcc_flags.cmake
+++ cmake_compiler_settings/cmake/gcc_flags.cmake
@@ -8,25 +8,60 @@
 ##################################################################
 # compiler warnings, should be enabled on every project
 # unline on msvc -Wall does not enable all warnings
+
+# generic warnings
 add_compile_options(-Wall -Wextra -pedantic -Wmain -Wunreachable-code -Wunused -Wunknown-pragmas)
-# multiple declaration, shadowing, undef
+
+# multiple declaration, shadowing, eval undefined identifier
 add_compile_options(-Wshadow)
 add_compile_options(-Wundef -Wredundant-decls)
+
 # class/structs and init
-add_compile_options(-Wnon-virtual-dtor -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Winit-self -Wuninitialized)
-# switch
+add_compile_options(-Wnon-virtual-dtor -Wctor-dtor-privacy -Wnon-virtual-dtor -Wreorder -Wuninitialized)
+if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6)
+	add_compile_options(-Werror=init-self -Werror=memset-transposed-args)
+endif()
+
+# switch/branches
 add_compile_options(-Wswitch-default -Wswitch-enum)
+if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6)
+	add_compile_options(-Wduplicated-cond)
+	if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 7)
+		add_compile_options(-Wduplicated-branches)
+	endif()
+endif()
+
 # nullptr and casts warnings (may generate a lot of warnings when interacting with old code or C code)
 add_compile_options(-Wzero-as-null-pointer-constant -Wold-style-cast -Wuseless-cast)
 add_compile_options(-Wnonnull -Wcast-qual -Wcast-align -Wformat=2)
+
 # arithmetic/numeric warnings
 add_compile_options(-Wfloat-equal -Wsign-compare -Wconversion -Wsign-promo)
+
 # logical operations
 add_compile_options(-Wlogical-op)
+
 # possible code structure problem
 add_compile_options(-Wdisabled-optimization)

+# branches

+# operations on booleans
+if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 6)
+	add_compile_options(-Werror=bool-compare)
+	if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 7)
+		add_compile_options(-Werror=bool-operation -Wint-in-bool-context)
+	endif()
+endif()
+
+# inheritance
+add_compile_options(-Wsuggest-final-types -Wsuggest-final-methods -Wsuggest-override)
+
+# memory
+add_compile_options(-Werror=vla -Werror=array-bounds)
+if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 7)
+	add_compile_options(-Walloc-zero -Walloca)
+endif()

 option(EFFCXX "Enable Effective C++ Warnings (very noisy on correct c++11 code)"  OFF)
 if(EFFCXX)


Minor rewording of stuff.

Minor rewording of stuff.

--- catkin.cmake
+++ catkin.cmake
@@ -10,7 +10,7 @@
 find_package(Eigen REQUIRED)

 # Set up the ROS Catkin package settings.
-catkin_package() # TODO: is this correct?
+catkin_package()

 # Import the yaml-cpp libraries.
 include(FindPkgConfig)
@@ -64,10 +64,9 @@
 target_link_libraries(apriltags apriltags_swatbotics)

 install(TARGETS apriltags
-  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
-  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
+  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
 )
+
 install(FILES ${apriltags_swatbotics_LIBRARIES}
   DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
 )


Fix link order in the application [library] tests

--- BdeBuildSystem/BdeTargetUtils.cmake
+++ BdeBuildSystem/BdeTargetUtils.cmake
@@ -489,17 +489,17 @@

         set(lib_target "${uor_name}_lib")

-        # Create an object or interface library that can be reused by both the
-        # executable and its test drivers. An object library must have sources and
+        # Create a static or interface library that can be reused by both the
+        # executable and its test drivers. An static library must have sources and
         # is used if this package contains component files, otherwise an interface
         # library is created.
         if (${uor_name}_SOURCE_FILES)
-            add_library(${lib_target} OBJECT)
+            add_library(${lib_target} STATIC)

             set_target_properties(${lib_target} PROPERTIES LINKER_LANGUAGE CXX)
-            target_sources(${lib_target} PRIVATE ${${uor_name}_SOURCE_FILES})
-            bbs_add_target_include_dirs(${lib_target} PUBLIC ${${uor_name}_INCLUDE_DIRS})
-            target_link_libraries(${lib_target} PUBLIC ${${uor_name}_PCDEPS})
+            target_sources(${lib_target} PRIVATE "${${uor_name}_SOURCE_FILES}")
+            bbs_add_target_include_dirs(${lib_target} PUBLIC "${${uor_name}_INCLUDE_DIRS}")
+            target_link_libraries(${lib_target} PUBLIC "${${uor_name}_PCDEPS}")

             # Copy properties from executable target to corresponding properties
             # of created ${lib_target} target. This will correctly set compiler/linker
@@ -516,8 +516,8 @@
         else()
             add_library(${lib_target} INTERFACE)

-            target_link_libraries(${lib_target} INTERFACE ${${uor_name}_PCDEPS})
-            bbs_add_target_include_dirs(${lib_target} INTERFACE ${${uor_name}_INCLUDE_DIRS})
+            target_link_libraries(${lib_target} INTERFACE "${${uor_name}_PCDEPS}")
+            bbs_add_target_include_dirs(${lib_target} INTERFACE "${${uor_name}_INCLUDE_DIRS}")

             # Copy properties from executable target to corresponding INTERFACE_* properties
             # of created ${lib_target} target. This will correctly set compiler/linker
@@ -545,6 +545,7 @@
                                        TEST_DEPS  ${${uor_name}_PCDEPS}
                                                   ${${uor_name}_TEST_PCDEPS}
                                        LABELS     "all" ${target})
+            bbs_import_target_dependencies(${lib_target} "${${uor_name}_TEST_PCDEPS}")
         endif()
     else()
         # Not a library or an application


Fix for dcmqi update. FindDCMQI.cmake has to be reviewed at a later date.

--- CMake/FindDCMQI.cmake
+++ CMake/FindDCMQI.cmake
@@ -3,7 +3,7 @@
 find_path(DCMQI_INCLUDE_DIR
   NAMES DCMQI/DCMQI
   PATHS ${DCMQI_DIR}/../DCMQI ${MITK_EXTERNAL_PROJECT_PREFIX} ${CMAKE_PREFIX_PATH}
-  PATH_SUFFIXES include include/dcmqi
+  PATH_SUFFIXES include include/dcmqi include/dcmqi/internal
 )

 set(DCMQI_INCLUDE_DIR "${DCMQI_DIR}/include" "${MITK_EXTERNAL_PROJECT_PREFIX}/src/DCMQI/include" "${MITK_EXTERNAL_PROJECT_PREFIX}/src/DCMQI/jsoncpp" ${DCMQI_DIR})


Factor duplicated logic out into a macro.

--- CMake/RealmCore.cmake
+++ CMake/RealmCore.cmake
@@ -62,21 +62,7 @@
     set(REALM_CORE_INCLUDE_DIR ${core_directory}/include PARENT_SCOPE)
 endfunction()

-function(clone_and_build_realm_core branch)
-    set(core_prefix_directory "${CMAKE_CURRENT_SOURCE_DIR}${CMAKE_FILES_DIRECTORY}/realm-core")
-    ExternalProject_Add(realm-core
-        GIT_REPOSITORY "git@github.com:realm/realm-core.git"
-        GIT_TAG ${branch}
-        PREFIX ${core_prefix_directory}
-        BUILD_IN_SOURCE 1
-        CONFIGURE_COMMAND ""
-        BUILD_COMMAND ${MAKE_EQUAL_MAKE} sh build.sh build
-        INSTALL_COMMAND ""
-        ${USES_TERMINAL_BUILD}
-        )
-
-    ExternalProject_Get_Property(realm-core SOURCE_DIR)
-    set(core_directory ${SOURCE_DIR})
+macro(define_built_realm_core_target core_directory)
     set(core_library_debug ${core_directory}/src/realm/librealm-dbg${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(core_library_release ${core_directory}/src/realm/librealm${CMAKE_SHARED_LIBRARY_SUFFIX})
     set(core_libraries ${core_library_debug} ${core_library_release})
@@ -95,6 +81,23 @@
     set_property(TARGET realm PROPERTY IMPORTED_LOCATION ${core_library_release})

     set(REALM_CORE_INCLUDE_DIR ${core_directory}/src PARENT_SCOPE)
+endmacro()
+
+function(clone_and_build_realm_core branch)
+    set(core_prefix_directory "${CMAKE_CURRENT_SOURCE_DIR}${CMAKE_FILES_DIRECTORY}/realm-core")
+    ExternalProject_Add(realm-core
+        GIT_REPOSITORY "git@github.com:realm/realm-core.git"
+        GIT_TAG ${branch}
+        PREFIX ${core_prefix_directory}
+        BUILD_IN_SOURCE 1
+        CONFIGURE_COMMAND ""
+        BUILD_COMMAND ${MAKE_EQUAL_MAKE} sh build.sh build
+        INSTALL_COMMAND ""
+        ${USES_TERMINAL_BUILD}
+        )
+
+    ExternalProject_Get_Property(realm-core SOURCE_DIR)
+    define_built_realm_core_target(${SOURCE_DIR})
 endfunction()

 function(build_existing_realm_core core_directory)
@@ -111,22 +114,5 @@
         ${USES_TERMINAL_BUILD}
         )

-    set(core_library_debug ${core_directory}/src/realm/librealm-dbg${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(core_library_release ${core_directory}/src/realm/librealm${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(core_libraries ${core_library_debug} ${core_library_release})
-
-    ExternalProject_Add_Step(realm-core ensure-libraries
-        COMMAND ${CMAKE_COMMAND} -E touch_nocreate ${core_libraries}
-        OUTPUT ${core_libraries}
-        DEPENDEES build
-        )
-
-    add_library(realm SHARED IMPORTED)
-    add_dependencies(realm realm-core)
-
-    set_property(TARGET realm PROPERTY IMPORTED_LOCATION_DEBUG ${core_library_debug})
-    set_property(TARGET realm PROPERTY IMPORTED_LOCATION_RELEASE ${core_library_release})
-    set_property(TARGET realm PROPERTY IMPORTED_LOCATION ${core_library_release})
-
-    set(REALM_CORE_INCLUDE_DIR ${core_directory}/src PARENT_SCOPE)
+    define_built_realm_core_target(${core_directory})
 endfunction()


enable floating point printf support, unless disabled by config value 'gcc.printf-float = false'

--- CMake/toolchain.cmake
+++ CMake/toolchain.cmake
@@ -71,6 +71,9 @@
     "-fno-exceptions -fno-unwind-tables -Wl,--gc-sections -Wl,--sort-common -Wl,--sort-section=alignment"
 )
 set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_MODULE_LINKER_FLAGS_INIT} -Wl,-wrap,main")
+if((NOT DEFINED YOTTA_CFG_GCC_PRINTF_FLOAT) OR (YOTTA_CFG_GCC_PRINTF_FLOAT))
+    set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} -Wl,-u,_printf_float")
+endif()

 # Set the compiler to ARM-GCC
 include(CMakeForceCompiler)


Try build without PARAVIEW_CUSTOM_LIBRARY_SUFFIX

This is causing linking errors on Windows. Let's see what happens if
we build without it.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -25,7 +25,6 @@
     -DPARAVIEW_ENABLE_QT_SUPPORT:BOOL=ON
     -DPARAVIEW_BUILD_SHARED_LIBS:BOOL=ON
     -DPARAVIEW_BUILD_TESTING:BOOL=OFF
-    -DPARAVIEW_CUSTOM_LIBRARY_SUFFIX:STRING=
     -DVTK_PYTHON_FULL_THREADSAFE:BOOL=ON
     -DVTK_NO_PYTHON_THREADS:BOOL=OFF
     -DVTK_PYTHON_VERSION:STRING=3


COMP: fix opencv search path

COMP: fix opencv search path

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -71,6 +71,9 @@
   endif()
 endif()

+if(NOT OPENCV_SEARCH_PATH)
+  get_filename_component(OPENCV_SEARCH_PATH "${opencv_INCLUDE_DIR}" PATH)
+endif()

 # Prefer the static library.
 find_library(


COMP: don't update search path on windows

--- CMake/FindOpenCV.cmake
+++ CMake/FindOpenCV.cmake
@@ -105,7 +105,7 @@
 if(NOT OPENCV_SEARCH_PATH)
   get_filename_component(OPENCV_SEARCH_PATH "${opencv_INCLUDE_DIR}" PATH)
   # include dir is include/opencv4 in v4
-  if(OpenCV_VERSION_MAJOR EQUAL 4)
+  if(UNIX AND OpenCV_VERSION_MAJOR EQUAL 4)
     get_filename_component(OPENCV_SEARCH_PATH "${OPENCV_SEARCH_PATH}" PATH)
   endif()
 endif()


Updated FindOGRE.cmake to properly set OGRE_${COMPONENT}_BINARY variables with paths to the corresponding DLLs

--- CMake/Packages/FindOGRE.cmake
+++ CMake/Packages/FindOGRE.cmake
@@ -333,47 +333,51 @@
 endif()

+#########################################################
+# Find Ogre components
+#########################################################
+
+set(OGRE_COMPONENT_SEARCH_PATH_REL
+  ${OGRE_LIBRARY_DIR_REL}/..
+  ${OGRE_LIBRARY_DIR_REL}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+set(OGRE_COMPONENT_SEARCH_PATH_DBG
+  ${OGRE_LIBRARY_DIR_DBG}/..
+  ${OGRE_LIBRARY_DIR_DBG}/../..
+  ${OGRE_BIN_SEARCH_PATH}
+)
+
+macro(ogre_find_component COMPONENT HEADER)
+  findpkg_begin(OGRE_${COMPONENT})
+  find_path(OGRE_${COMPONENT}_INCLUDE_DIR NAMES ${HEADER} HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES ${COMPONENT} OGRE/${COMPONENT} Components/${COMPONENT}/include)
+  set(OGRE_${COMPONENT}_LIBRARY_NAMES "Ogre${COMPONENT}${OGRE_LIB_SUFFIX}")
+  get_debug_names(OGRE_${COMPONENT}_LIBRARY_NAMES)
+  find_library(OGRE_${COMPONENT}_LIBRARY_REL NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
+  find_library(OGRE_${COMPONENT}_LIBRARY_DBG NAMES ${OGRE_${COMPONENT}_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
+  make_library_set(OGRE_${COMPONENT}_LIBRARY)
+  findpkg_finish(OGRE_${COMPONENT})
+  if (OGRE_${COMPONENT}_FOUND)
+    # find binaries
+    if (NOT OGRE_STATIC)
+	  if (WIN32)
+	    find_file(OGRE_${COMPONENT}_BINARY_REL NAMES "Ogre${COMPONENT}.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_REL} PATH_SUFFIXES "" bin bin/release bin/relwithdebinfo bin/minsizerel release)
+	    find_file(OGRE_${COMPONENT}_BINARY_DBG NAMES "Ogre${COMPONENT}_d.dll" HINTS ${OGRE_COMPONENT_SEARCH_PATH_DBG} PATH_SUFFIXES "" bin bin/debug debug)
+	  endif()
+	  mark_as_advanced(OGRE_${COMPONENT}_BINARY_REL OGRE_${COMPONENT}_BINARY_DBG)
+    endif()
+  endif()
+endmacro()

 # look for Paging component
-findpkg_begin(OGRE_Paging)
-find_path(OGRE_Paging_INCLUDE_DIR NAMES OgrePaging.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES Paging OGRE/Paging Components/Paging/include)
-set(OGRE_Paging_LIBRARY_NAMES "OgrePaging${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_Paging_LIBRARY_NAMES)
-find_library(OGRE_Paging_LIBRARY_REL NAMES ${OGRE_Paging_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_Paging_LIBRARY_DBG NAMES ${OGRE_Paging_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-set(OGRE_Paging_LIBRARY_FWK ${OGRE_LIBRARY_FWK})
-make_library_set(OGRE_Paging_LIBRARY)
-findpkg_finish(OGRE_Paging)
-
+ogre_find_component(Paging OgrePaging.h)
 # look for Terrain component
-findpkg_begin(OGRE_Terrain)
-find_path(OGRE_Terrain_INCLUDE_DIR NAMES OgreTerrain.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES Terrain OGRE/Terrain Components/Terrain/include)
-set(OGRE_Terrain_LIBRARY_NAMES "OgreTerrain${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_Terrain_LIBRARY_NAMES)
-find_library(OGRE_Terrain_LIBRARY_REL NAMES ${OGRE_Terrain_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_Terrain_LIBRARY_DBG NAMES ${OGRE_Terrain_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-make_library_set(OGRE_Terrain_LIBRARY)
-findpkg_finish(OGRE_Terrain)
-
+ogre_find_component(Terrain OgreTerrain.h)
 # look for Property component
-findpkg_begin(OGRE_Property)
-find_path(OGRE_Property_INCLUDE_DIR NAMES OgreProperty.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES Property OGRE/Property Components/Property/include)
-set(OGRE_Property_LIBRARY_NAMES "OgreProperty${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_Property_LIBRARY_NAMES)
-find_library(OGRE_Property_LIBRARY_REL NAMES ${OGRE_Property_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_Property_LIBRARY_DBG NAMES ${OGRE_Property_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-make_library_set(OGRE_Property_LIBRARY)
-findpkg_finish(OGRE_Property)
-
+ogre_find_component(Property OgreProperty.h)
 # look for RTShaderSystem component
-findpkg_begin(OGRE_RTShaderSystem)
-find_path(OGRE_RTShaderSystem_INCLUDE_DIR NAMES OgreRTShaderSystem.h HINTS ${OGRE_INCLUDE_DIRS} ${OGRE_PREFIX_SOURCE} PATH_SUFFIXES RTShaderSystem OGRE/RTShaderSystem Components/RTShaderSystem/include)
-set(OGRE_RTShaderSystem_LIBRARY_NAMES "OgreRTShaderSystem${OGRE_LIB_SUFFIX}")
-get_debug_names(OGRE_RTShaderSystem_LIBRARY_NAMES)
-find_library(OGRE_RTShaderSystem_LIBRARY_REL NAMES ${OGRE_RTShaderSystem_LIBRARY_NAMES} HINTS ${OGRE_LIBRARY_DIR_REL} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel")
-find_library(OGRE_RTShaderSystem_LIBRARY_DBG NAMES ${OGRE_RTShaderSystem_LIBRARY_NAMES_DBG} HINTS ${OGRE_LIBRARY_DIR_DBG} PATH_SUFFIXES "" "debug")
-make_library_set(OGRE_RTShaderSystem_LIBRARY)
-findpkg_finish(OGRE_RTShaderSystem)
+ogre_find_component(RTShaderSystem OgreRTShaderSystem.h)
+

 #########################################################
 # Find Ogre plugins


COMP: Added test data to MITK-DATA repository.

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

 IF(BUILD_TESTING)

-  SET(revision_tag 4fa450c29ebd819419)
+  SET(revision_tag 7c47185a1c916ff20c)
   IF(${proj}_REVISION_TAG)
     SET(revision_tag ${${proj}_REVISION_TAG})
   ENDIF()


changed hash for MITK Data

changed hash for MITK Data

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

 if(BUILD_TESTING)

-  set(revision_tag 3be15a2d)
+  set(revision_tag 81f5a871)
 #                  ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


COMP: update reference image for rendering test

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

 if(BUILD_TESTING)
-  set(revision_tag af8a3ea5)
+ set(revision_tag df83b68b)
 #                 ^^^^^^^^  these are just to check correct length of hash part

   ExternalProject_Add(${proj}


cmake: Fixed ZLIB configure check.

cmake: Fixed ZLIB configure check.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -121,9 +121,9 @@
   set(HAVE_LIBGCRYPT 1)
 endif (GCRYPT_FOUND)

-if (Z_LIBRARY)
+if (ZLIB_LIBRARY)
   set(HAVE_LIBZ 1)
-endif (Z_LIBRARY)
+endif (ZLIB_LIBRARY)

 if (CMAKE_HAVE_THREADS_LIBRARY)
     if (CMAKE_USE_PTHREADS_INIT)


changes gmock

changes gmock

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -515,7 +515,6 @@
 endfunction()

 macro(cmaki2_gtest)
-	cmaki_find_package(google-gtest)
 	cmaki_find_package(google-gmock)
 	cmaki2_test(${ARGV})
 endmacro()


missing CTest

missing CTest

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

--- Numerics/cmake/SiconosProject.cmake
+++ Numerics/cmake/SiconosProject.cmake
@@ -118,6 +118,7 @@

   # Tests+Dashboard configuration
   IF(WITH_TESTING)
+    INCLUDE(CTest)
     ENABLE_TESTING()

     IF(IS_DIRECTORY ${CMAKE_BINARY_DIR}/Testing)


Update some outdated CMake code

Update some outdated CMake code

Former-commit-id: 9fc34184ed56f325fca548bafc725fbfef54376b

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -65,9 +65,8 @@
   halide_generator_output_path(${unique_generator_target} SCRATCH_DIR)

   # Determine the name of the output files
-  # CMake 2.8 doesn't have string(CONCAT), so fake it like so:
-  string(REPLACE ".lib" "${CMAKE_STATIC_LIBRARY_SUFFIX}" FILTER_LIB "${args_GENERATED_FUNCTION}.lib" )
-  string(REPLACE ".h" ".h" FILTER_HDR "${args_GENERATED_FUNCTION}.h" )
+  set(FILTER_LIB "${args_GENERATED_FUNCTION}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+  set(FILTER_HDR "${args_GENERATED_FUNCTION}.h")

   # Check to see if the target includes pnacl
   if ("${args_GENERATOR_ARGS}" MATCHES ".*pnacl.*")


Display optional project only when configuring top-level project

See #418

--- CMake/ctkMacroCheckExternalProjectDependency.cmake
+++ CMake/ctkMacroCheckExternalProjectDependency.cmake
@@ -519,7 +519,9 @@
         if(_include_project)
           list(APPEND ${SUPERBUILD_TOPLEVEL_PROJECT}_DEPENDENCIES ${possible_proj})
         else()
-          superbuild_message(STATUS "${possible_proj}[OPTIONAL]")
+          if(${SUPERBUILD_TOPLEVEL_PROJECT}_SUPERBUILD)
+            superbuild_message(STATUS "${possible_proj}[OPTIONAL]")
+          endif()
         endif()
       endif()
     endforeach()


更新vcpkg的适配

更新vcpkg的适配

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -346,9 +346,7 @@
                 " COMPILER_OPTIONS_TEST_STD_COROUTINE_TS)
             endif()
         else()
-            if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
-                set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
-            endif()
+            set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<NOT:$<STREQUAL:${VCPKG_CRT_LINKAGE},static>>:DLL>" CACHE STRING "")

             # Try add coroutine
             set(CMAKE_REQUIRED_FLAGS "${COMPILER_OPTIONS_BAKCUP_CMAKE_REQUIRED_FLAGS} /await")


* Removed old unused cmake file

* Removed old unused cmake file

--- Modules/FindClanLib-2.0.cmake
+++ Modules/FindClanLib-2.0.cmake
@@ -1,33 +0,0 @@
-FIND_PATH(ClanLib-2.0_INCLUDE_DIR ClanLib
-    PATH_SUFFIXES include/ClanLib-2.0
-    PATHS
-    ~/Library/Frameworks
-    /Library/Frameworks
-    /usr/local/include
-    /usr/include
-    /sw/include
-    /opt/local/include
-    /opt/csw/include
-    /opt/include
-)
-
-#MESSAGE(ClanLib-2.0_INCLUDE_DIR is ${ClanLib-2.0_INCLUDE_DIR})
-
-FIND_LIBRARY(ClanLib-2.0_LIBRARY
-    NAMES clanCore
-    PATH_SUFFIXES lib64 lib
-    PATHS
-    /usr/local
-    /usr
-    /sw
-    /opt/local
-    /opt/csw
-    /opt
-)
-
-#MESSAGE("ClanLib-2.0_LIBRARY is ${ClanLib-2.0_LIBRARY}")
-
-#SET(ClabLib-2.0_FOUND true)
-#SET(ClanLib-2.0_PROCESS_INCLUDES ClanLib-2.0_INCLUDE_DIR)
-#SET(ClanLib-2.0_PROCESS_LIBS ClanLib-2.0_LIBRARY)
-#libfind_process(ClanLib-2.0)


FIX: windows build (WIP)

FIX: windows build (WIP)

--- external/UseGDAL.cmake
+++ external/UseGDAL.cmake
@@ -13,13 +13,6 @@

 ExternalProject_Get_Property(netcdf SOURCE_DIR)

-  #if(NOT EXISTS ${CMAKE_BINARY_DIR}/modules/omegaOsgEarth/${NETCDF_TGZ})
-  #file(DOWNLOAD ftp://ftp.unidata.ucar.edu/pub/netcdf/${NETCDF_TGZ} ${CMAKE_BINARY_DIR}/modules/omegaOsgEarth/${NETCDF_TGZ} SHOW_PROGRESS)
-  #endif()
-
-  #if(NOT EXISTS ${CMAKE_BINARY_DIR}/modules/omegaOsgEarth/${NETCDF})
-  #execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzvf ${NETCDF_TGZ} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/modules/omegaOsgEarth)
-  #endif()
 if(WIN32)
 	# On windows we are lazy. Just download precompiled libs.
 	# This is specific to Visual Studio 2010, Win32.
@@ -30,10 +23,9 @@
 	set(EXTLIB_DIR ${CMAKE_BINARY_DIR}/gdal)

 	if(NOT EXISTS ${EXTLIB_DIR})
-	  message(STATUS "Downloading GDAL library")
-	  file(DOWNLOAD "http://www.gisinternals.com/sdk/Download.aspx?file=release-1600-gdal-1-10-1-mapserver-6-4-0-libs.zip" ${EXTLIB_TGZ} SHOW_PROGRESS)
-	  execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf
-		${EXTLIB_TGZ} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
+		message(STATUS "Downloading GDAL library")
+		file(DOWNLOAD "https://omegalib.googlecode.com/files/gdal.tar.gz" ${EXTLIB_TGZ} SHOW_PROGRESS)
+		execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${EXTLIB_TGZ} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
 	endif(NOT EXISTS ${EXTLIB_DIR})

 	set(GDAL_INCLUDE_DIR ${EXTLIB_DIR}/include CACHE INTERNAL "")


We don't need FindLATEX, it should be provided by CMake.

--- cmake/FindLATEX.cmake
+++ cmake/FindLATEX.cmake
@@ -1,113 +0,0 @@
-# - Find Latex
-# This module finds if Latex is installed and determines where the
-# executables are. This code sets the following variables:
-#
-#  LATEX_COMPILER:       path to the LaTeX compiler
-#  PDFLATEX_COMPILER:    path to the PdfLaTeX compiler
-#  BIBTEX_COMPILER:      path to the BibTeX compiler
-#  MAKEINDEX_COMPILER:   path to the MakeIndex compiler
-#  DVIPS_CONVERTER:      path to the DVIPS converter
-#  PS2PDF_CONVERTER:     path to the PS2PDF converter
-#  LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
-#
-
-IF (WIN32)
-
-  # Try to find the MikTex binary path (look for its package manager).
-
-  FIND_PATH(MIKTEX_BINARY_PATH mpm.exe
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MiK\\MiKTeX\\CurrentVersion\\MiKTeX;Install Root]/miktex/bin"
-    DOC
-    "Path to the MikTex binary directory."
-  )
-  MARK_AS_ADVANCED(MIKTEX_BINARY_PATH)
-
-  # Try to find the GhostScript binary path (look for gswin32).
-
-  GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00
-     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\8.00;GS_DLL]" PATH
-  )
-
-  GET_FILENAME_COMPONENT(GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04
-     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\AFPL Ghostscript\\7.04;GS_DLL]" PATH
-  )
-
-  FIND_PATH(GHOSTSCRIPT_BINARY_PATH gswin32.exe
-    ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_8_00}
-    ${GHOSTSCRIPT_BINARY_PATH_FROM_REGISTERY_7_04}
-    DOC "Path to the GhostScript binary directory."
-  )
-  MARK_AS_ADVANCED(GHOSTSCRIPT_BINARY_PATH)
-
-  FIND_PATH(GHOSTSCRIPT_LIBRARY_PATH ps2pdf13.bat
-    "${GHOSTSCRIPT_BINARY_PATH}/../lib"
-    DOC "Path to the GhostScript library directory."
-  )
-  MARK_AS_ADVANCED(GHOSTSCRIPT_LIBRARY_PATH)
-
-ENDIF (WIN32)
-
-FIND_PROGRAM(LATEX_COMPILER
-  NAMES latex
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-FIND_PROGRAM(PDFLATEX_COMPILER
-  NAMES pdflatex
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-FIND_PROGRAM(BIBTEX_COMPILER
-  NAMES bibtex
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-FIND_PROGRAM(MAKEINDEX_COMPILER
-  NAMES makeindex
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-FIND_PROGRAM(DVIPS_CONVERTER
-  NAMES dvips
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-FIND_PROGRAM(DVIPDF_CONVERTER
-  NAMES dvipdfm dvipdft dvipdf
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-IF (WIN32)
-  FIND_PROGRAM(PS2PDF_CONVERTER
-    NAMES ps2pdf14.bat
-    PATHS ${GHOSTSCRIPT_LIBRARY_PATH}
-  )
-ELSE (WIN32)
-  FIND_PROGRAM(PS2PDF_CONVERTER
-    NAMES ps2pdf14 ps2pdf
-  )
-ENDIF (WIN32)
-
-FIND_PROGRAM(LATEX2HTML_CONVERTER
-  NAMES latex2html
-  PATHS ${MIKTEX_BINARY_PATH}
-        /usr/bin
-)
-
-
-MARK_AS_ADVANCED(
-  LATEX_COMPILER
-  PDFLATEX_COMPILER
-  BIBTEX_COMPILER
-  MAKEINDEX_COMPILER
-  DVIPS_CONVERTER
-  DVIPDF_CONVERTER
-  PS2PDF_CONVERTER
-  LATEX2HTML_CONVERTER
-)


[CMake] Also search for prefixed versions of ld.gold

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -526,7 +526,7 @@
   endif()
 endif()

-find_program(GOLD_EXECUTABLE NAMES ld.gold ld DOC "The gold linker")
+find_program(GOLD_EXECUTABLE NAMES ${LLVM_DEFAULT_TARGET_TRIPLE}-ld.gold ld.gold ${LLVM_DEFAULT_TARGET_TRIPLE}-ld ld DOC "The gold linker")
 set(LLVM_BINUTILS_INCDIR "" CACHE PATH
 	"PATH to binutils/include containing plugin-api.h for gold plugin.")


Ignore -fPIC test on Windows. Suggested by Yonggang Luo.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -81,7 +81,11 @@
 include(CheckAtomic)

 include(CheckCXXCompilerFlag)
-check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
+# On windows all code is position-independent and mingw warns if -fPIC
+# is in the command-line.
+if( NOT WIN32 )
+  check_cxx_compiler_flag("-fPIC" SUPPORTS_FPIC_FLAG)
+endif()

 include(GetTargetTriple)
 get_target_triple(LLVM_HOSTTRIPLE)


Fix anakin build problem in manylinux1 docker image

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -113,7 +113,9 @@
     endif()
     if(WITH_ANAKIN)
         set(ENV{CUDNN_INCLUDE_DIR} ${CUDNN_INCLUDE_DIR})
-        set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY})
+        get_filename_component(CUDNN_LIBRARY_DIR ${CUDNN_LIBRARY} DIRECTORY)
+        set(ENV{CUDNN_LIBRARY} ${CUDNN_LIBRARY_DIR})
+        message(STATUS "Set Anakin CUDNN_LIBRARY_DIR:" ${CUDNN_LIBRARY_DIR})
     endif()
 elseif(WITH_AMD_GPU)
     add_definitions(-DPADDLE_WITH_HIP)


install fix

install fix

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@7819 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/gsInstall.cmake
+++ cmake/gsInstall.cmake
@@ -17,6 +17,7 @@
 set(LIB_INSTALL_DIR     lib     CACHE PATH "Installation directory for libraries")
 set(BIN_INSTALL_DIR     bin     CACHE PATH "Installation directory for executables")
 set(INCLUDE_INSTALL_DIR include CACHE PATH "Installation directory for header files")
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")

 # Set CMake installation directory
 if(WIN32 AND NOT CYGWIN)
@@ -75,9 +76,7 @@
 if(GISMO_BUILD_LIB)

 set_target_properties(gismo PROPERTIES
-  PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/Gismo/gismo.h"
-  #;${CMAKE_CURRENT_BINARY_DIR}/config.h"
-  )
+  PUBLIC_HEADER "${PROJECT_SOURCE_DIR}/src/gismo.h")

 # For gsExport.h
 install(FILES ${PROJECT_BINARY_DIR}/gsCore/gsExport.h
@@ -116,8 +115,13 @@
 #        PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)

 # For gsConfig.h
-install(FILES ${PROJECT_BINARY_DIR}/gsCore/gsConfig.h
-        DESTINATION include/${PROJECT_NAME}/gsCore/)
+install(DIRECTORY ${GISMO_DATA_DIR} DESTINATION gismodata)
+# todo: search environment variable as well
+set(GISMO_DATA_DIR ${CMAKE_INSTALL_PREFIX}/gismodata/)
+configure_file ("${PROJECT_SOURCE_DIR}/src/gsCore/gsConfig.h.in"
+                "${PROJECT_BINARY_DIR}/gsCore/gsConfig_install.h" )
+install(FILES ${PROJECT_BINARY_DIR}/gsCore/gsConfig_install.h
+        DESTINATION include/${PROJECT_NAME}/gsCore/ RENAME gsConfig.h)

 # Install cmake files
 install(FILES


Fix: oups, missed this one relative to bug #5

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@142 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_utils.cmake
+++ cmake/pcl_utils.cmake
@@ -167,7 +167,7 @@
         set(LIB_INSTALL_DIR "lib")
     endif(OS_IS_64BIT)
     set(INCLUDE_INSTALL_DIR
-        "include/${PROJECT_NAME_LOWER}-${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}")
+        "include/${PROJECT_NAME_LOWER}-${PCL_MAJOR_VERSION}.${PCL_MINOR_VERSION}")
     set(BIN_INSTALL_DIR "bin")
     set(PKGCFG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig")
 endmacro(SET_INSTALL_DIRS)


SuperBuild: itk forbid download option to avoid download fftw if not found

--- SuperBuild/CMake/External_itk.cmake
+++ SuperBuild/CMake/External_itk.cmake
@@ -156,6 +156,7 @@
   -DITK_USE_SYSTEM_ZLIB:BOOL=ON
   -DITK_USE_SYSTEM_TIFF:BOOL=ON
   -DITK_USE_SYSTEM_PNG:BOOL=ON
+  -DITK_FORBID_DOWNLOADS:BOOL=ON
   ${ITK_SB_CONFIG}
   DEPENDS ${ITK_DEPENDENCIES}
   CMAKE_COMMAND ${SB_CMAKE_COMMAND}


SuperBuild: move detection of OTB version

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -213,10 +213,3 @@
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${OTB_SB_SRC}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
   DEPENDEES install)
-
-# detect OTB version number
-if (SUPERBUILD_OTB_VERSION)
-  set(_SB_OTB_DIR ${SB_INSTALL_PREFIX}/lib/cmake/OTB-${SUPERBUILD_OTB_VERSION_MAJOR}.${SUPERBUILD_OTB_VERSION_MINOR})
-else()
-  set(_SB_OTB_DIR ${SB_INSTALL_PREFIX})
-endif()


PKG: fix the install of license files

PKG: fix the install of license files

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -227,9 +227,11 @@

 ExternalProject_Add_Step(
   OTB install_copyright
-  COMMAND ${CMAKE_COMMAND}
-  -E copy_directory
-  ${OTB_SB_SRC}/Copyright ${CMAKE_INSTALL_PREFIX}/share/copyright
+  COMMAND ${CMAKE_COMMAND} -E copy
+  ${OTB_SB_SRC}/LICENSE ${CMAKE_INSTALL_PREFIX}/share/copyright/LICENSE
+
+  COMMAND ${CMAKE_COMMAND} -E copy
+  ${OTB_SB_SRC}/NOTICE ${CMAKE_INSTALL_PREFIX}/share/copyright/NOTICE

   COMMAND ${CMAKE_COMMAND}
   -E copy_directory


Update FW

Update FW


feat(python-api): Add warning disable 'register'

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -114,6 +114,8 @@
 	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
 		-Wall
 		-Wno-missing-braces
+		-Wno-register			# -> disable warning: ISO c++1z does not allow 'register' storage class specifier [-wregister] (caused by pybind11/python2.7)
+        -Wno-error=register		# -> disable warning: ISO c++1z does not allow 'register' storage class specifier [-wregister] (caused by pybind11/python2.7)

 		${WARN_AS_ERROR_FLAGS}
 		-std=c++1z


Update libusb to fix get_device_list hang

--- CMake/external_libusb.cmake
+++ CMake/external_libusb.cmake
@@ -5,7 +5,7 @@
     libusb

     GIT_REPOSITORY "https://github.com/libusb/libusb.git"
-    GIT_TAG "v1.0.22"
+    GIT_TAG "2a7372db54094a406a755f0b8548b614ba8c78ec" # "v1.0.22" + Mac get_device_list hang fix

     UPDATE_COMMAND ${CMAKE_COMMAND} -E copy
             ${CMAKE_CURRENT_SOURCE_DIR}/third-party/libusb/CMakeLists.txt


ENH: Updated ExternalProject.cmake - When repository is Git, update step will "reset", "pull" and "re-apply patches"

--- CMake/ExternalProject.cmake
+++ CMake/ExternalProject.cmake
@@ -777,13 +777,21 @@

 function(_ep_add_update_command name)
-  ExternalProject_Get_Property(${name} source_dir)
+  ExternalProject_Get_Property(${name} source_dir tmp_dir)

   get_property(cmd_set TARGET ${name} PROPERTY _EP_UPDATE_COMMAND SET)
   get_property(cmd TARGET ${name} PROPERTY _EP_UPDATE_COMMAND)
   get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
   get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
   get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+
+  # Patch
+  get_property(patch_cmd_set TARGET ${name} PROPERTY _EP_PATCH_COMMAND SET)
+  get_property(patch_cmd TARGET ${name} PROPERTY _EP_PATCH_COMMAND)
+  set(patch_work_dir)
+  if(patch_cmd_set)
+    set(patch_work_dir ${source_dir})
+  endif()

   set(work_dir)
   set(comment)
@@ -816,9 +824,37 @@
       message(FATAL_ERROR "error: could not find git for pull of ${name}")
     endif()
     set(work_dir ${source_dir})
+
+    # The following script will allow to reset, pull and re-apply patches
+    file(WRITE ${tmp_dir}/${name}-gitupdate.cmake "
+execute_process(
+  COMMAND ${Git_EXECUTABLE} reset --hard HEAD
+  WORKING_DIRECTORY ${work_dir}
+  RESULT_VARIABLE error_code
+  )
+execute_process(
+  COMMAND ${Git_EXECUTABLE} pull
+  WORKING_DIRECTORY ${work_dir}
+  RESULT_VARIABLE error_code
+  )
+if(error_code)
+  message(FATAL_ERROR \"Failed to pull - repository: ${git_repository}\")
+endif()
+if(${patch_cmd_set})
+  execute_process(
+    COMMAND ${patch_cmd}
+    WORKING_DIRECTORY ${patch_work_dir}
+    RESULT_VARIABLE error_code
+    )
+  if(error_code)
+    message(FATAL_ERROR \"Failed to apply patch for ${name}\")
+  endif()
+endif()
+")
+
     set(comment "Performing update step (GIT pull) for '${name}'")
     #get_property(git_revision TARGET ${name} PROPERTY _EP_GIT_REVISION)
-    set(cmd ${Git_EXECUTABLE} pull)
+    set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitupdate.cmake)
     set(always 1)
   endif()


Switch to use stable libusb version (#3049)

--- CMake/external_libusb.cmake
+++ CMake/external_libusb.cmake
@@ -5,7 +5,7 @@
     libusb

     GIT_REPOSITORY "https://github.com/libusb/libusb.git"
-    GIT_TAG "master"
+    GIT_TAG "v1.0.22"

     UPDATE_COMMAND ${CMAKE_COMMAND} -E copy
             ${CMAKE_CURRENT_SOURCE_DIR}/third-party/libusb/CMakeLists.txt


Deactivate unused module opencv_ts

Deactivate unused module opencv_ts

 * not compiling under the clang-3.4 ( current in Ubuntu 14.04.1 LTS)

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -17,6 +17,8 @@

     set(additional_cmake_args
       -DBUILD_opencv_java:BOOL=OFF
+      -DBUILD_opencv_ts:BOOL=OFF
+      -DBUILD_PERF_TESTS:BOOL=OFF
     )

     if(MITK_USE_Python)


git.cmake: print BUILD_VERSION always, simplify and fix error message

In an ideal world, good CIs make it very clear what exact git versions
are getting built. However:

- Zephyr is (re-)used in many projects and they cannot all be expected
  to have ideal CI.

- CI with multiple git repos is complex (#34713) which makes the world
  an even less ideal place: much more chance for some git versions to be
  missing.

- Many developers don't realize that Github and other CIs do not test
  pull/12345/head but the moving target pull/12345/merge instead. While
  not resolving pull/12345/merge completely (maybe another day), this
  commit provides at least evidence that pull/12345/head is NOT the
  commit tested.

So the addition of the following line in the logs is a very small price
to pay that can save enormous amounts of time when trying to understand
some obscure build failures.

-- BUILD_VERSION=zephyr-v2.5.0-2957-g6230b5bb66bc

Note this obviously does not provide any git information when
BUILD_VERSION is overriden but it does not hurt either in this case:
knowing BUILD_VERSION was overriden is also useful.

The "BUILD_VERSION is left undefined" message was just wrong in
the (unlikely) case `git describe` printed something while also
failing. Remove it; it's so much simpler to just print $BUILD_VERSION
and give the direct, unfiltered information.

Note this simplification is also a partial revert of 1b80f00f56fb66a
which threw the entire git warnings "baby" with some obscure duplicate
1.13.0 "bathwater" that is not relevant any more and that I guess barely
anyone noticed even at the time.

Signed-off-by: Marc Herbert <77e7c7d746b52c6eb01119b65a031ae1f650246d@intel.com>

--- cmake/git.cmake
+++ cmake/git.cmake
@@ -24,9 +24,9 @@
     RESULT_VARIABLE                  return_code
   )
   if(return_code)
-    message(STATUS "git describe failed: ${stderr};
-   BUILD_VERSION is left undefined")
-  elseif(CMAKE_VERBOSE_MAKEFILE)
-    message(STATUS "git describe stderr: ${stderr}")
+    message(STATUS "git describe failed: ${stderr}")
+  elseif(NOT "${stderr}" STREQUAL "")
+    message(STATUS "git describe warned: ${stderr}")
   endif()
+  message(STATUS "BUILD_VERSION=${BUILD_VERSION}")
 endif()


[cmake] try to circumvent some warnings

[cmake] try to circumvent some warnings

--- config.h.cmake
+++ config.h.cmake
@@ -28,5 +28,41 @@
 #define DS_OVERRIDE ${DS_OVERRIDE}
 #define DS_FINAL  ${DS_FINAL}
 #define HAVE_DUNE_FEM_PARAMETER_REPLACE 0
+
+#ifndef HAVE_DUNE_FEM
+# define HAVE_FUNE_FEM 0
+# endif
+
+#ifndef HAVE_EMPLACE
+# define HAVE_EMPLACE 0
+#endif
+
+#ifndef ENABLE_SUPERLU
+# define ENABLE_SUPERLU 0
+#endif
+
+#ifndef ENABLE_UMFPACK
+# define ENABLE_UMFPACK 0
+#endif
+
+#ifndef ENABLE_BOOST
+# define ENABLE_BOOST 0
+#endif
+
+#ifndef ENABLE_PETSC
+# define ENABLE_PETSC 0
+#endif
+
+#ifndef BOOST_CLANG
+# define BOOST_CLANG 0
+#endif
+
+#ifndef ENABLE_MPI
+# define ENABLE_MPI 0
+#endif
+
+#ifndef HAVE_CONSTEXPR
+# define HAVE_CONSTEXPR 0
+#endif
 /* end dune-stuff */
 // NEVER delete/alter above comment, dune's cmake crap relies on it


-STY: set svn properties correct

-STY: set svn properties correct

--- src/Testing/Dashboard/elxDashboard_LKEB_win7-64_VS2010.cmake
+++ src/Testing/Dashboard/elxDashboard_LKEB_win7-64_VS2010.cmake
@@ -1,64 +1,64 @@
-# Elastix Dashboard Script
-#
-# This script runs a dashboard
-# Usage:
-#   ctest -S <nameofthisscript> -V
-#   OR
-#   ctest -S <nameofthisscript>,Model -V
-#
-# It has 1 optional argument: the build model.
-# The build model should be one of {Experimental, Continuous, Nightly}
-# and defaults to Nightly.
-# NOTE that Model should directly follow the comma: no space allowed!
-#
-# Setup: Windows 7, Visual Studio 10 2010 Win64, Release mode, ITK 3.20.0
-# PC: LKEB, MS personal computer
-
-
-# Client maintainer: m.staring@lumc.nl
-set( CTEST_SITE "LKEB.PCMarius" )
-set( CTEST_BUILD_NAME "Win7-64bit-VS2010" )
-set( CTEST_BUILD_CONFIGURATION Release )
-set( CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
-set( CTEST_DASHBOARD_ROOT "D:/toolkits/elastix/nightly" )
-set( CTEST_BINARY_DIRECTORY ${CTEST_DASHBOARD_ROOT}/bin_VS2010 )
-
-# default: automatically determined
-#set(CTEST_UPDATE_COMMAND /path/to/svn)
-
-# Specify the kind of dashboard to submit
-# default: Nightly
-SET( dashboard_model Nightly )
-IF( ${CTEST_SCRIPT_ARG} MATCHES Experimental )
-  SET( dashboard_model Experimental )
-ELSEIF( ${CTEST_SCRIPT_ARG} MATCHES Continuous )
-  SET( dashboard_model Continuous )
-ENDIF()
-
-#set(dashboard_do_memcheck 1)
-#set(dashboard_do_coverage 1)
-
-# CUDA does not support MSVC 2010 compiler
-# nvcc fatal: nvcc cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported
-SET( dashboard_cache "
-// Which ITK to use:
-ITK_DIR:PATH=D:/toolkits/ITK/3.20.0/binVS2010
-
-// Some elastix settings, defining the configuration:
-ELASTIX_BUILD_TESTING:BOOL=ON
-ELASTIX_ENABLE_PACKAGER:BOOL=ON
-ELASTIX_USE_CUDA:BOOL=OFF
-ELASTIX_USE_MEVISDICOMTIFF:BOOL=OFF
-ELASTIX_IMAGE_DIMENSION:STRING=2;3;4
-ELASTIX_IMAGE_2D_PIXELTYPES:STRING=float
-ELASTIX_IMAGE_3D_PIXELTYPES:STRING=float
-ELASTIX_IMAGE_4D_PIXELTYPES:STRING=short
-
-// Compile all elastix components:
-USE_ALL_COMPONENTS:BOOL=ON
-")
-
-
-# Load the common dashboard script.
-include( ${CTEST_SCRIPT_DIRECTORY}/elxDashboardCommon.cmake )
-
+# Elastix Dashboard Script
+#
+# This script runs a dashboard
+# Usage:
+#   ctest -S <nameofthisscript> -V
+#   OR
+#   ctest -S <nameofthisscript>,Model -V
+#
+# It has 1 optional argument: the build model.
+# The build model should be one of {Experimental, Continuous, Nightly}
+# and defaults to Nightly.
+# NOTE that Model should directly follow the comma: no space allowed!
+#
+# Setup: Windows 7, Visual Studio 10 2010 Win64, Release mode, ITK 3.20.0
+# PC: LKEB, MS personal computer
+
+
+# Client maintainer: m.staring@lumc.nl
+set( CTEST_SITE "LKEB.PCMarius" )
+set( CTEST_BUILD_NAME "Win7-64bit-VS2010" )
+set( CTEST_BUILD_CONFIGURATION Release )
+set( CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
+set( CTEST_DASHBOARD_ROOT "D:/toolkits/elastix/nightly" )
+set( CTEST_BINARY_DIRECTORY ${CTEST_DASHBOARD_ROOT}/bin_VS2010 )
+
+# default: automatically determined
+#set(CTEST_UPDATE_COMMAND /path/to/svn)
+
+# Specify the kind of dashboard to submit
+# default: Nightly
+SET( dashboard_model Nightly )
+IF( ${CTEST_SCRIPT_ARG} MATCHES Experimental )
+  SET( dashboard_model Experimental )
+ELSEIF( ${CTEST_SCRIPT_ARG} MATCHES Continuous )
+  SET( dashboard_model Continuous )
+ENDIF()
+
+#set(dashboard_do_memcheck 1)
+#set(dashboard_do_coverage 1)
+
+# CUDA does not support MSVC 2010 compiler
+# nvcc fatal: nvcc cannot find a supported cl version. Only MSVC 8.0 and MSVC 9.0 are supported
+SET( dashboard_cache "
+// Which ITK to use:
+ITK_DIR:PATH=D:/toolkits/ITK/3.20.0/binVS2010
+
+// Some elastix settings, defining the configuration:
+ELASTIX_BUILD_TESTING:BOOL=ON
+ELASTIX_ENABLE_PACKAGER:BOOL=ON
+ELASTIX_USE_CUDA:BOOL=OFF
+ELASTIX_USE_MEVISDICOMTIFF:BOOL=OFF
+ELASTIX_IMAGE_DIMENSION:STRING=2;3;4
+ELASTIX_IMAGE_2D_PIXELTYPES:STRING=float
+ELASTIX_IMAGE_3D_PIXELTYPES:STRING=float
+ELASTIX_IMAGE_4D_PIXELTYPES:STRING=short
+
+// Compile all elastix components:
+USE_ALL_COMPONENTS:BOOL=ON
+")
+
+
+# Load the common dashboard script.
+include( ${CTEST_SCRIPT_DIRECTORY}/elxDashboardCommon.cmake )
+


Fixed pic flag on gcc x86 toolchain

Fixed pic flag on gcc x86 toolchain

--- gcc-pic-x86.cmake
+++ gcc-pic-x86.cmake
@@ -20,4 +20,5 @@

 include("${CMAKE_CURRENT_LIST_DIR}/compiler/gcc.cmake")
 include("${CMAKE_CURRENT_LIST_DIR}/flags/cxx11.cmake")
+include("${CMAKE_CURRENT_LIST_DIR}/flags/fpic.cmake")
 include("${CMAKE_CURRENT_LIST_DIR}/flags/c_cxx-x86.cmake")


Make creation of WIX wxs files unconditional so that we can use them later to run WIX interactively.  msconfig/xml/win.xsl will now be created when you run cmake, even if CONDOR_PACKAGE_BUILD is off

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -134,24 +134,27 @@
 	set (CPACK_PACKAGE_FILE_NAME "${CONDOR_VER}")
 	set (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CONDOR_VER}")

+	# create the WIX package input file (win.xsl) even if we aren't doing packaging.
+	#
+    set (CONDOR_WIX_LOC ${CONDOR_SOURCE_DIR}/msconfig/WiX)
+
+    # branding and licensing
+    set (CPACK_PACKAGE_ICON ${CONDOR_WIX_LOC}/Bitmaps/dlgbmp.bmp)
+    set (CPACK_RESOURCE_FILE_LICENSE "${CONDOR_SOURCE_DIR}/msconfig/license.rtf")
+
+    set (CPACK_WIX_PRODUCT_GUID "ea9608e1-9a9d-4678-800c-645df677094a")
+    set (CPACK_WIX_UPGRADE_GUID "ef96d7c4-29df-403c-8fab-662386a089a4")
+    set (CPACK_WIX_BITMAP_FOLDER ${CONDOR_WIX_LOC}/Bitmaps)
+    set (CPACK_WIX_WXS_FILES ${CONDOR_WIX_LOC}/xml/CondorCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorPoolCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorExecCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorDomainCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorEmailCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorJavaCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorPermCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorVMCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorHDFSCfgDlg.wxs)
+
+    # the configure file f(n) will replace @CMAKE_XYZ@ with their value
+    configure_file(${CONDOR_WIX_LOC}/xml/win.xsl.in ${CONDOR_BINARY_DIR}/msconfig/WiX/xml/win.xsl @ONLY)
+
 	set (CPACK_GENERATOR "ZIP")
-
+
 	if (CONDOR_PACKAGE_BUILD)

 		set (CPACK_GENERATOR "ZIP;WIX")
-        set (CONDOR_WIX_LOC ${CONDOR_SOURCE_DIR}/msconfig/WiX)
-
-        # branding and licensing
-        set (CPACK_PACKAGE_ICON ${CONDOR_WIX_LOC}/Bitmaps/dlgbmp.bmp)
-        set (CPACK_RESOURCE_FILE_LICENSE "${CONDOR_SOURCE_DIR}/msconfig/license.rtf")
-
-        set (CPACK_WIX_PRODUCT_GUID "ea9608e1-9a9d-4678-800c-645df677094a")
-        set (CPACK_WIX_UPGRADE_GUID "ef96d7c4-29df-403c-8fab-662386a089a4")
-        set (CPACK_WIX_BITMAP_FOLDER ${CONDOR_WIX_LOC}/Bitmaps)
-        set (CPACK_WIX_WXS_FILES ${CONDOR_WIX_LOC}/xml/CondorCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorPoolCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorExecCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorDomainCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorEmailCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorJavaCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorPermCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorVMCfgDlg.wxs;${CONDOR_WIX_LOC}/xml/CondorHDFSCfgDlg.wxs)
-
-        # the configure file f(n) will replace @CMAKE_XYZ@ with their value
-        configure_file(${CONDOR_WIX_LOC}/xml/win.xsl.in ${CONDOR_BINARY_DIR}/msconfig/WiX/xml/win.xsl @ONLY)
         set (CPACK_WIX_XSL ${CONDOR_BINARY_DIR}/msconfig/WiX/xml/win.xsl)

 	endif()


Update ITK along 5.4 development

Update ITK along 5.4 development

Major changes to the itk::Object command observer occurred. In ITK HD5
thread safety was enabled, and InsightSoftwareConsortium/ITK#3624.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -62,8 +62,8 @@
 mark_as_advanced(ITK_GIT_REPOSITORY)
 sitk_legacy_naming(ITK_GIT_REPOSITORY ITK_REPOSITORY)

-# After v5.4rc04, Sept 14
-set(_DEFAULT_ITK_GIT_TAG "2f2b29cbbe3fe91474933e0194db8d581d5b3247")
+# After v5.4rc04, Sept 29
+set(_DEFAULT_ITK_GIT_TAG "e9d82c0832a726c4cfbd8a34063506489c19e9ab")
 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: Update ITK to 4.12.2; BUG: Clone ITK from Github instead of itk.org

Fixes clone failure due to Kitware’s SSL certificate

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -42,7 +42,7 @@

 set(proj ITK)  ## Use ITK convention of calling it ITK
 if(NOT DEFINED ITK_REPOSITORY)
-  set(ITK_REPOSITORY "${git_protocol}://itk.org/ITK.git")
+  set(ITK_REPOSITORY "${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git")
 endif()

 set(ITK_USE_GIT_PROTOCOL 0)
@@ -51,7 +51,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.11.1) # v4.11.1 tag
+set(ITK_TAG_COMMAND GIT_TAG v4.12.2) # v4.12.2 tag

 if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )
@@ -95,4 +95,4 @@

 ExternalProject_Get_Property(ITK install_dir)
-set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.11" )
+set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.12" )


Fix PCL build to use Superbuild and not System Boost

--- Superbuild/Projects/pcl.cmake
+++ Superbuild/Projects/pcl.cmake
@@ -4,11 +4,12 @@
   CMAKE_ARGS
   -DCMAKE_CXX_STANDARD=11
   -DCMAKE_CXX_STANDARD_REQUIRED=true
-  -DBOOST_ROOT:PATH=<INSTALL_DIR>
   -DBoost_NO_BOOST_CMAKE:BOOL=true
   -DBoost_USE_MULTITHREAD=ON
   -DBoost_USE_STATIC_LIBS=OFF
   -DBoost_USE_STATIC=OFF
+  -DBoost_LIBRARY_DIR_DEBUG:PATH=<INSTALL_DIR>/lib
+  -DBoost_LIBRARY_DIR_RELEASE:PATH=<INSTALL_DIR>/lib
   -DPCL_BUILD_WITH_BOOST_DYNAMIC_LINKING_WIN32=true
   -DBOOST_LIBRARYDIR:PATH=<INSTALL_DIR>/lib
   -DBUILD_visualization:BOOL=OFF


COMP: Merge branch 'bug-15479-threaded-logging'

--- Modules/Qmitk/Testing/files.cmake
+++ Modules/Qmitk/Testing/files.cmake
@@ -1,8 +1,8 @@
-# test fails on MacOS, needs to be fixed before permanent activation (bug 15479)
-if (NOT CMAKE_HOST_APPLE)
+# test fails easily on MacOS, rarely on Windows, needs to be fixed before permanent activation (bug 15479)
+if (BUG_15479_FIXED)

   set(MODULE_TESTS
     QmitkThreadedLogTest.cpp
   )

-endif()+endif()


TEST: update dashboad location

TEST: update dashboad location

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -10,6 +10,6 @@
 set(CTEST_NIGHTLY_IDENT_LOCATION "http://www.orfeo-toolbox.org/nightly/libNightlyNumber")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.orfeo-toolbox.org")
-set(CTEST_DROP_LOCATION "/Dashboard/submit.php?project=OTB")
+set(CTEST_DROP_SITE "dash.orfeo-toolbox.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=OTB")
 set(CTEST_DROP_SITE_CDASH TRUE)


[t:4871] don't run helgrind_helgrind{2,3}.tdb under valgrind

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -15,9 +15,9 @@
   ydb/drd_test_4015.tdb
   ydb/drd_test_groupcommit_count.tdb
   ydb/filesize.tdb
-  ydb/helgrind2.tdb
-  ydb/helgrind3.tdb
   ydb/helgrind_helgrind1.tdb
+  ydb/helgrind_helgrind2.tdb
+  ydb/helgrind_helgrind3.tdb
   ydb/helgrind_test_groupcommit_count.tdb
   ydb/hot-optimize-table-tests.tdb
   ydb/insert-dup-prelock.tdb


Add support for find_package modules to specifiy additional preprocessor definitions and compiler flags when used with deskvox_use_package()

--- cmake/modules/DeskvoxUsePackage.cmake
+++ cmake/modules/DeskvoxUsePackage.cmake
@@ -63,4 +63,14 @@
   endif()

   set(__DESKVOX_LINK_LIBRARIES ${__DESKVOX_LINK_LIBRARIES} ${dup_LIBS} PARENT_SCOPE)
+
+  if(${name}_PACKAGE_DEFINITIONS)
+    add_definitions(${${name}_PACKAGE_DEFINITIONS})
+  endif()
+  if(${name}_PACKAGE_C_FLAGS)
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${name}_PACKAGE_C_FLAGS}" PARENT_SCOPE)
+  endif()
+  if(${name}_PACKAGE_CXX_FLAGS)
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${name}_PACKAGE_CXX_FLAGS}" PARENT_SCOPE)
+  endif()
 endfunction()


Spelling fixes in comments.

Spelling fixes in comments.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -308,9 +308,9 @@
     -wd4805 # Suppress 'unsafe mix of type <type> and type <type> in operation'
     -wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer'

-	# Idelly, we'd like this warning to be enabled, but MSVC 2013 doesn't
+	# Ideally, we'd like this warning to be enabled, but MSVC 2013 doesn't
 	# support the 'aligned' attribute in the way that clang sources requires (for
-	# any code that uses the LLVM_ALIGNAS marco), so this is must be disabled to
+	# any code that uses the LLVM_ALIGNAS macro), so this is must be disabled to
 	# avoid unwanted alignment warnings.
 	# When we switch to requiring a version of MSVC that supports the 'alignas'
 	# specifier (MSVC 2015?) this warning can be re-enabled.


[CMake] Error when LTO and lld are enabled on Darwin

lld on Darwin does not currently support LTO.

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

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -96,6 +96,9 @@
 set(LLVM_PLUGIN_EXT ${CMAKE_SHARED_LIBRARY_SUFFIX})

 if(APPLE)
+  if(LLVM_ENABLE_LLD AND LLVM_ENABLE_LTO)
+    message(FATAL_ERROR "lld does not support LTO on Darwin")
+  endif()
   # Darwin-specific linker flags for loadable modules.
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
 endif()


[cmake] Move blocks out of redundant else( MSVC ); NFC

Address post-commit comment on D66256 regarding the `else( MSVC )` block
containing only blocks guarded with `LLVM_COMPILER_IS_GCC_COMPATIBLE`,
which would imply `NOT MSVC`.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -431,71 +431,70 @@
       endif()
     endif()
   endif()
-
-else( MSVC )
-  # Warnings-as-errors handling for GCC-compatible compilers:
-  if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
-    append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
-    append_if(LLVM_ENABLE_WERROR "-Wno-error" CMAKE_REQUIRED_FLAGS)
-  endif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
-
-  # Specific default warnings-as-errors for compilers accepting GCC-compatible warning flags:
-  if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
-    add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
-    add_flag_if_supported("-Werror=unguarded-availability-new" WERROR_UNGUARDED_AVAILABILITY_NEW)
-  endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
-
-  # C++ language standard selection for compilers accepting the GCC-style option:
-  if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
-    check_cxx_compiler_flag("-std=${LLVM_CXX_STD}" CXX_SUPPORTS_CXX_STD)
-    if (CXX_SUPPORTS_CXX_STD)
-     if (CYGWIN OR MINGW)
-        # MinGW and Cygwin are a bit stricter and lack things like
-        # 'strdup', 'stricmp', etc in c++11 mode.
-        string(REPLACE "c++" "gnu++" gnu_LLVM_CXX_STD "${LLVM_CXX_STD}")
-        append("-std=${gnu_LLVM_CXX_STD}" CMAKE_CXX_FLAGS)
-      else()
-        append("-std=${LLVM_CXX_STD}" CMAKE_CXX_FLAGS)
-      endif()
+endif( MSVC )
+
+# Warnings-as-errors handling for GCC-compatible compilers:
+if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
+  append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+  append_if(LLVM_ENABLE_WERROR "-Wno-error" CMAKE_REQUIRED_FLAGS)
+endif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
+
+# Specific default warnings-as-errors for compilers accepting GCC-compatible warning flags:
+if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
+  add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
+  add_flag_if_supported("-Werror=unguarded-availability-new" WERROR_UNGUARDED_AVAILABILITY_NEW)
+endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
+
+# C++ language standard selection for compilers accepting the GCC-style option:
+if ( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
+  check_cxx_compiler_flag("-std=${LLVM_CXX_STD}" CXX_SUPPORTS_CXX_STD)
+  if (CXX_SUPPORTS_CXX_STD)
+   if (CYGWIN OR MINGW)
+      # MinGW and Cygwin are a bit stricter and lack things like
+      # 'strdup', 'stricmp', etc in c++11 mode.
+      string(REPLACE "c++" "gnu++" gnu_LLVM_CXX_STD "${LLVM_CXX_STD}")
+      append("-std=${gnu_LLVM_CXX_STD}" CMAKE_CXX_FLAGS)
     else()
-      message(FATAL_ERROR "The host compiler does not support '-std=${LLVM_CXX_STD}'.")
-    endif()
-  endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
-
-  # Modules enablement for GCC-compatible compilers:
-  if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
-    set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
-    set(module_flags "-fmodules -fmodules-cache-path=${PROJECT_BINARY_DIR}/module.cache")
-    if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-      # On Darwin -fmodules does not imply -fcxx-modules.
-      set(module_flags "${module_flags} -fcxx-modules")
-    endif()
-    if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
-      set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
-    endif()
-    if (LLVM_ENABLE_MODULE_DEBUGGING AND
-        ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
-         (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
-      set(module_flags "${module_flags} -gmodules")
-    endif()
-    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")
-
-    # Check that we can build code with modules enabled, and that repeatedly
-    # including <cassert> still manages to respect NDEBUG properly.
-    CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
-                               #include <cassert>
-                               #define NDEBUG
-                               #include <cassert>
-                               int main() { assert(this code is not compiled); }"
-                               CXX_SUPPORTS_MODULES)
-    set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
-    if (CXX_SUPPORTS_MODULES)
-      append("${module_flags}" CMAKE_CXX_FLAGS)
-    else()
-      message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
-    endif()
-  endif( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
-endif( MSVC )
+      append("-std=${LLVM_CXX_STD}" CMAKE_CXX_FLAGS)
+    endif()
+  else()
+    message(FATAL_ERROR "The host compiler does not support '-std=${LLVM_CXX_STD}'.")
+  endif()
+endif( LLVM_COMPILER_IS_GCC_COMPATIBLE OR CMAKE_CXX_COMPILER_ID MATCHES "XL" )
+
+# Modules enablement for GCC-compatible compilers:
+if ( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )
+  set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+  set(module_flags "-fmodules -fmodules-cache-path=${PROJECT_BINARY_DIR}/module.cache")
+  if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+    # On Darwin -fmodules does not imply -fcxx-modules.
+    set(module_flags "${module_flags} -fcxx-modules")
+  endif()
+  if (LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY)
+    set(module_flags "${module_flags} -Xclang -fmodules-local-submodule-visibility")
+  endif()
+  if (LLVM_ENABLE_MODULE_DEBUGGING AND
+      ((uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG") OR
+       (uppercase_CMAKE_BUILD_TYPE STREQUAL "RELWITHDEBINFO")))
+    set(module_flags "${module_flags} -gmodules")
+  endif()
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${module_flags}")
+
+  # Check that we can build code with modules enabled, and that repeatedly
+  # including <cassert> still manages to respect NDEBUG properly.
+  CHECK_CXX_SOURCE_COMPILES("#undef NDEBUG
+                             #include <cassert>
+                             #define NDEBUG
+                             #include <cassert>
+                             int main() { assert(this code is not compiled); }"
+                             CXX_SUPPORTS_MODULES)
+  set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
+  if (CXX_SUPPORTS_MODULES)
+    append("${module_flags}" CMAKE_CXX_FLAGS)
+  else()
+    message(FATAL_ERROR "LLVM_ENABLE_MODULES is not supported by this compiler")
+  endif()
+endif( LLVM_COMPILER_IS_GCC_COMPATIBLE AND LLVM_ENABLE_MODULES )

 if (MSVC)
   if (NOT CLANG_CL)


Re-disabling C4291 warnings for MSVC because AttributeList.h requires it.  This was accidentally removed in r187279.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -182,6 +182,7 @@
     -wd4503 # Suppress ''identifier' : decorated name length exceeded, name was truncated'
     -wd4624 # Suppress ''derived class' : destructor could not be generated because a base class destructor is inaccessible'
     -wd4800 # Suppress ''type' : forcing value to bool 'true' or 'false' (performance warning)'
+    -wd4291 # Suppress ''declaration' : no matching operator delete found; memory will not be freed if initialization throws an exception'

     # Promoted warnings.
     -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.


cmake: Use -fno-sanitize-recover=all - the old spelling is deprecated

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -462,7 +462,7 @@
       endif()
     elseif (LLVM_USE_SANITIZER STREQUAL "Undefined")
       append_common_sanitizer_flags()
-      append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover"
+      append("-fsanitize=undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     elseif (LLVM_USE_SANITIZER STREQUAL "Thread")
       append_common_sanitizer_flags()
@@ -470,7 +470,7 @@
     elseif (LLVM_USE_SANITIZER STREQUAL "Address;Undefined" OR
             LLVM_USE_SANITIZER STREQUAL "Undefined;Address")
       append_common_sanitizer_flags()
-      append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover"
+      append("-fsanitize=address,undefined -fno-sanitize=vptr,function -fno-sanitize-recover=all"
               CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     else()
       message(WARNING "Unsupported value of LLVM_USE_SANITIZER: ${LLVM_USE_SANITIZER}")


Add the test for libstdc++ versions newer than 4.6 so we don't
accidentally pick that up while using Clang and run into subtle bugs
down the road related to C++11 features not fully implemented in that
version of the standard library.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -22,6 +22,22 @@
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
       message(FATAL_ERROR "Host Clang version must be at least 3.1!")
+    endif()
+
+    # Also test that we aren't using too old of a version of libstdc++ with the
+    # Clang compiler. This is tricky as there is no real way to check the
+    # version of libstdc++ directly. Instead we test for a known bug in
+    # libstdc++4.6 that is fixed in libstdc++4.7.
+    if(NOT LLVM_ENABLE_LIBCXX)
+      set(CMAKE_REQUIRED_FLAGS "-std=c++0x")
+      check_cxx_source_compiles("
+#include <atomic>
+std::atomic<float> x(0.0f);
+int main() { return (float)x; }"
+        LLVM_NO_OLD_LIBSTDCXX)
+      if(NOT LLVM_NO_OLD_LIBSTDCXX)
+        message(FATAL_ERROR "Host Clang must be able to find libstdc++4.7 or newer!")
+      endif()
     endif()
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
     if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.0)


CMake: forward CMAKE_FIND_ROOT_PATH so Dependencies see each other

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -75,6 +75,10 @@
     if(APPLE_IOS)
         set(CROSS ${CROSS}
             -DIOS_PLATFORM=${IOS_PLATFORM})
+    else()
+        # this should help discovering zlib, but on ios it breaks it
+        set(CROSS ${CROSS}
+            -DCMAKE_FIND_ROOT_PATH=${CMAKE_FIND_ROOT_PATH})
     endif()
 endif()


ENH: keep the generated wrap file in current binary directory

--- CMake/UseSWIGLocal.cmake
+++ CMake/UseSWIGLocal.cmake
@@ -122,10 +122,6 @@

   set(swig_generated_file_fullname
     "${CMAKE_CURRENT_BINARY_DIR}")
-  if(swig_source_file_relative_path)
-    set(swig_generated_file_fullname
-      "${swig_generated_file_fullname}/${swig_source_file_relative_path}")
-  endif()
   # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
   if(CMAKE_SWIG_OUTDIR)
     set(swig_outdir ${CMAKE_SWIG_OUTDIR})


ENH: Reorganizing so as to make it possible to specify output path.

--- CMake/vtkExportKit.cmake
+++ CMake/vtkExportKit.cmake
@@ -1,5 +1,5 @@
 #-----------------------------------------------------------------------------
-MACRO(VTK_EXPORT_KIT kit ukit sources)
+MACRO(VTK_EXPORT_KIT2 kit ukit dest_dir sources)
   SET(VTK_EXPORT_KIT ${kit})
   SET(VTK_EXPORT_UKIT ${ukit})
   SET(VTK_EXPORT_KIT_DOLLAR "$")
@@ -25,11 +25,11 @@
     ENDIF(IS_EXCLUDE MATCHES "^1$")
   ENDFOREACH(src)
   CONFIGURE_FILE(${VTK_CMAKE_DIR}/vtkKit.cmake.in
-                 ${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake
+                 ${dest_dir}/InstallOnly/vtk${kit}Kit.cmake
                  @ONLY IMMEDIATE)
   IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
     INSTALL(FILES
-      ${VTK_BINARY_DIR}/Utilities/InstallOnly/vtk${kit}Kit.cmake
+      ${dest_dir}/InstallOnly/vtk${kit}Kit.cmake
       DESTINATION "${VTK_INSTALL_PACKAGE_DIR_CM24}"
       COMPONENT Development)
   ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
@@ -56,6 +56,11 @@
     ENDIF(IS_EXCLUDE MATCHES "^1$")
   ENDFOREACH(src)
   CONFIGURE_FILE(${VTK_CMAKE_DIR}/vtkKit.cmake.in
-                 ${VTK_BINARY_DIR}/Utilities/vtk${kit}Kit.cmake
+                 ${dest_dir}/vtk${kit}Kit.cmake
                  @ONLY IMMEDIATE)
+ENDMACRO(VTK_EXPORT_KIT2)
+
+#-----------------------------------------------------------------------------
+MACRO(VTK_EXPORT_KIT kit ukit sources)
+  VTK_EXPORT_KIT2(${kit} ${ukit} ${VTK_BINARY_DIR}/Utilities "${sources}")
 ENDMACRO(VTK_EXPORT_KIT)


GitExternals: Only fetch origin, not user (Fix #273)

--- GitExternal.cmake
+++ GitExternal.cmake
@@ -106,7 +106,7 @@
       endforeach()

       # fetch latest update
-      execute_process(COMMAND "${GIT_EXECUTABLE}" fetch --all -q
+      execute_process(COMMAND "${GIT_EXECUTABLE}" fetch origin -q
         RESULT_VARIABLE nok ERROR_VARIABLE error
         WORKING_DIRECTORY "${DIR}")
       if(nok)
@@ -199,7 +199,7 @@
             "${CMAKE_CURRENT_BINARY_DIR}/gitupdate${GIT_EXTERNAL_NAME}.cmake")
           file(WRITE "${GIT_EXTERNAL_SCRIPT}" "
 include(${CMAKE_CURRENT_LIST_DIR}/GitExternal.cmake)
-execute_process(COMMAND ${GIT_EXECUTABLE} fetch --all -q
+execute_process(COMMAND ${GIT_EXECUTABLE} fetch origin -q
   WORKING_DIRECTORY ${DIR})
 execute_process(
   COMMAND ${GIT_EXECUTABLE} show-ref --hash=7 refs/remotes/origin/master


add CTEST_FULL_OUTPUT to CTestExt script itself

--- ctest_ext.cmake
+++ ctest_ext.cmake
@@ -334,6 +334,8 @@
 #

 macro(ctest_ext_init)
+    message("CTEST_FULL_OUTPUT")
+
     # Dashboard settings

     site_name(SITE_NAME)


COMP: reactivated unstructured grid mapper

--- Modules/MitkExt/files.cmake
+++ Modules/MitkExt/files.cmake
@@ -158,8 +158,8 @@
   Rendering/mitkSplineMapper2D.cpp
   Rendering/mitkSplineVtkMapper3D.cpp
   Rendering/mitkUnstructuredGridMapper2D.cpp
-  # Rendering/mitkUnstructuredGridVtkMapper3D.cpp
-  # Rendering/vtkUnstructuredGridMapper.cpp
+  Rendering/mitkUnstructuredGridVtkMapper3D.cpp
+  Rendering/vtkUnstructuredGridMapper.cpp
 )

 # Segmentation (or related) tools for interactive segmentation view


Add modules to path

Add modules to path

Former-commit-id: 6c59c1e65f5ce38b0476225378653b3d0ba4ad80

--- cmake-modules/SetupDependenciesFind.cmake
+++ cmake-modules/SetupDependenciesFind.cmake
@@ -1,4 +1,7 @@
 if(DMRG_DOWNLOAD_METHOD MATCHES "find")
+    # Let cmake find our Find<package>.cmake modules
+    list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
+
     if(DMRG_PREFER_CONDA_LIBS)
         list(APPEND CMAKE_PREFIX_PATH
                 $ENV{CONDA_PREFIX}
@@ -39,4 +42,5 @@
             $ENV{BLAS_ROOT}
             $ENV{ARPACKPP_DIR}
             )
+
 endif()


CMake: Update DEAL_II_ADD_TEST macro

CMake: Update DEAL_II_ADD_TEST macro

--- cmake/macros/macro_deal_ii_add_test.cmake
+++ cmake/macros/macro_deal_ii_add_test.cmake
@@ -266,8 +266,7 @@

       ADD_CUSTOM_COMMAND(OUTPUT ${_test_directory}/output
         COMMAND sh ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/run_test.sh
-          run "${_test_full}" "${_test_diff}"
-          "${DIFF_EXECUTABLE}" "${_comparison_file}" ${_run_args}
+          run "${_test_full}" ${_run_args}
         COMMAND ${PERL_EXECUTABLE}
           -pi ${DEAL_II_PATH}/${DEAL_II_SHARE_RELDIR}/scripts/normalize.pl
           ${_test_directory}/output


cmake: Teach cmake that gyb files depend on foo in ``gyb.expand('foo.swift.gyb'...)``

Fixes https://bugs.swift.org/browse/SR-4366.
Fixes rdar://problem/31331437.

--- cmake/modules/SwiftHandleGybSources.cmake
+++ cmake/modules/SwiftHandleGybSources.cmake
@@ -46,6 +46,17 @@

   get_filename_component(dir "${GYB_SINGLE_OUTPUT}" DIRECTORY)
   get_filename_component(basename "${GYB_SINGLE_OUTPUT}" NAME)
+
+  # Handle foo.gyb in pattern ``gyb.expand('foo.gyb'`` as a dependency
+  set(gyb_expand_deps "")
+  file(READ "${GYB_SINGLE_SOURCE}" gyb_file)
+  string(REGEX MATCHALL "\\\$\{[\r\n\t ]*gyb.expand\\\([\r\n\t ]*[\'\"]([^\'\"]*)[\'\"]" gyb_expand_matches "${gyb_file}")
+  foreach(match ${gyb_expand_matches})
+    string(REGEX MATCH "[\'\"]\([^\'\"]*\)[\'\"]" gyb_dep "${match}")
+    list(APPEND gyb_expand_deps "${CMAKE_MATCH_1}")
+  endforeach()
+  list(REMOVE_DUPLICATES gyb_expand_deps)
+
   add_custom_command_target(
       dependency_target
       COMMAND
@@ -59,7 +70,7 @@
       COMMAND
           "${CMAKE_COMMAND}" -E remove "${GYB_SINGLE_OUTPUT}.tmp"
       OUTPUT "${GYB_SINGLE_OUTPUT}"
-      DEPENDS "${gyb_tool_source}" "${GYB_SINGLE_DEPENDS}" "${GYB_SINGLE_SOURCE}"
+      DEPENDS "${gyb_tool_source}" "${GYB_SINGLE_DEPENDS}" "${GYB_SINGLE_SOURCE}" "${gyb_expand_deps}"
       COMMENT "Generating ${basename} from ${GYB_SINGLE_SOURCE} ${GYB_SINGLE_COMMENT}"
       WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
       SOURCES "${GYB_SINGLE_SOURCE}"


BUG: Add missing module dependencies for ITKTestKernel.

This arise from itkTestDriverIncludeBuiltInIOFactories.h.

Change-Id: Ie10f566f3b8352ddcce41969f717c313013ec4e5

--- Modules/Core/TestKernel/itk-module.cmake
+++ Modules/Core/TestKernel/itk-module.cmake
@@ -5,16 +5,19 @@

 itk_module(ITKTestKernel
   DEPENDS
-    ITKIOPNG
-    ITKIOMeta
-    ITKIOTIFF
+    ITKIOBioRad
     ITKIOBMP
-    ITKIOVTK
-    ITKIOJPEG
-    ITKIONRRD
     ITKIOGDCM
     ITKIOGIPL
+    ITKIOJPEG
+    ITKIOLSM
+    ITKIOMeta
     ITKIONIFTI
+    ITKIONRRD
+    ITKIOPNG
+    ITKIOStimulate
+    ITKIOTIFF
+    ITKIOVTK
     ITKKWSys
   DESCRIPTION
     "${DOCUMENTATION}"


boards: nrf52840_mdk: fix pyocd integration

Fix the --target value so flashing works regardless of image address.

Signed-off-by: Martí Bolívar <9d90ac4c7bf6a305f6bfd81a23c7859bc883380e@nordicsemi.no>

--- boards/arm/nrf52840_mdk/board.cmake
+++ boards/arm/nrf52840_mdk/board.cmake
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: Apache-2.0

-board_runner_args(pyocd "--target=nrf52")
+board_runner_args(pyocd "--target=nrf52840")
 include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)


Use a variable ABSL_IDE_FOLDER in three places.

--- CMake/AbseilHelpers.cmake
+++ CMake/AbseilHelpers.cmake
@@ -16,6 +16,11 @@

 include(CMakeParseArguments)

+# The IDE folder for Abseil that will be used if Abseil is included in a CMake
+# project that sets
+#    set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+# For example, Visual Studio supports folders.
+set(ABSL_IDE_FOLDER Abseil)

 #
 # create a library in the absl namespace
@@ -50,7 +55,7 @@
     PRIVATE ${ABSL_LIB_PRIVATE_INCLUDE_DIRS}
   )
   # Add all Abseil targets to a a folder in the IDE for organization.
-  set_property(TARGET ${_NAME} PROPERTY FOLDER Abseil)
+  set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER})

   if(ABSL_LIB_EXPORT_NAME)
     add_library(absl::${ABSL_LIB_EXPORT_NAME} ALIAS ${_NAME})
@@ -95,7 +100,7 @@
     PRIVATE ${ABSL_HO_LIB_PRIVATE_INCLUDE_DIRS}
   )
   # Add all Abseil targets to a a folder in the IDE for organization.
-  set_property(TARGET ${_NAME} PROPERTY FOLDER Abseil)
+  set_property(TARGET ${_NAME} PROPERTY FOLDER ${ABSL_IDE_FOLDER})

   if(ABSL_HO_LIB_EXPORT_NAME)
     add_library(absl::${ABSL_HO_LIB_EXPORT_NAME} ALIAS ${_NAME})
@@ -143,7 +148,7 @@
       PRIVATE ${GMOCK_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS}
     )
     # Add all Abseil targets to a a folder in the IDE for organization.
-    set_property(TARGET ${_NAME}_bin PROPERTY FOLDER Abseil)
+    set_property(TARGET ${_NAME}_bin PROPERTY FOLDER ${ABSL_IDE_FOLDER})

     add_test(${_NAME} ${_NAME}_bin)
   endif(BUILD_TESTING)