Problem when changing from macro to function

--- modules/FindCBLAS.cmake
+++ modules/FindCBLAS.cmake
@@ -35,19 +35,19 @@
     if(NOT CBLAS_FOUND AND PKG_CONFIG_FOUND)
         pkg_search_module(ATLAS atlas)
     else()
-      set(BLAS_LIBRARIES ${CBLAS_LIBRARIES} PARENT_SCOPE)
-      set(BLAS_INCLUDE_DIR ${CBLAS_INCLUDE_DIRS} PARENT_SCOPE)
+      set(BLAS_LIBRARIES ${CBLAS_LIBRARIES})
+      set(BLAS_INCLUDE_DIR ${CBLAS_INCLUDE_DIRS})
     endif()

     # include -pthread so MKL can be included on Ubuntu + enthought
     if(use_pthread_flag)
-      set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} PARENT_SCOPE)
-      set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread" PARENT_SCOPE)
+      set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+      set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread")
     endif()
     find_package(BLAS QUIET)
     if(use_pthread_flag)
-      set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} PARENT_SCOPE)
-      set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread" PARENT_SCOPE)
+      set(OLD_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
+      set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -pthread")
     endif()

     # Figures out atlas if necessary
@@ -58,18 +58,17 @@
             HINTS "${atlas_dir}"
         )
         if(BLAS_atlas_cblas_LIBRARY)
-          set(BLAS_FOUND TRUE PARENT_SCOPE)
+          set(BLAS_FOUND TRUE)
             set(BLAS_LIBRARIES
                 "${BLAS_atlas_cblas_LIBRARY}"
                 "${BLAS_atlas_LIBRARY}"
-                PARENT_SCOPE
             )
         endif()
     endif()

     # Try open-blas
-    if(NOT BLAS_LIBRARIES AND NOT BLAS_INCLUDE_DIR)
-        find_package(OpenBLAS)
+    if(NOT BLAS_LIBRARIES OR NOT BLAS_INCLUDE_DIR)
+        find_package(OpenBLAS QUIET)
         if(OpenBLAS_FOUND)
             if(NOT EXISTS "${OpenBLAS_LIBRARIES}")
               string(REPLACE "'" "" OpenBLAS_LIBRARIES ${OpenBLAS_LIBRARIES})
@@ -77,9 +76,18 @@
             if(NOT EXISTS "${OpenBLAS_INCLUDE_DIRS}")
               string(REPLACE "'" "" OpenBLAS_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIRS})
             endif()
-            set(BLAS_LIBRARIES ${OpenBLAS_LIBRARIES} PARENT_SCOPE)
-            set(BLAS_INCLUDE_DIR ${OpenBLAS_INCLUDE_DIRS} PARENT_SCOPE)
+            set(BLAS_LIBRARIES ${OpenBLAS_LIBRARIES})
+            set(BLAS_INCLUDE_DIR ${OpenBLAS_INCLUDE_DIRS})
         endif()
+    endif()
+    if(BLAS_FOUND)
+      set(BLAS_FOUND TRUE PARENT_SCOPE)
+    endif()
+    if(BLAS_LIBRARIES)
+      set(BLAS_LIBRARIES "${BLAS_LIBRARIES}" PARENT_SCOPE)
+    endif()
+    if(BLAS_INCLUDE_DIR)
+      set(BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}" PARENT_SCOPE)
     endif()
 endfunction()


Move the set line to be excluded from the Win32 section

--- modules/FindGLFW3.cmake
+++ modules/FindGLFW3.cmake
@@ -44,13 +44,12 @@
 		/opt/local/lib
 		${GLFW_ROOT_DIR}/lib
 		DOC "The GLFW library")
+		# Fix linker complaining about undefined references
+		SET(GLFW3_LIBRARY ${GLFW3_LIBRARY} Xxf86vm)
 ENDIF(WIN32)

 INCLUDE(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(GLFW3 DEFAULT_MESSAGE GLFW3_LIBRARY GLFW3_INCLUDE_PATH)
-
-# Fix linker complaining about undefined references
-SET(GLFW3_LIBRARY ${GLFW3_LIBRARY} Xxf86vm)

 #SET(GLFW3_FOUND "NO")
 #IF(GLFW3_INCLUDE_PATH AND GLFW3_LIBRARY)


Bump TubeTK to include interactive segment tubes latest changes

Pulls in:
 - Convert TRE fix

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "fcfa8273e036c2e8af79f3c373a32cd5419d437a"
+    GIT_TAG "054b4b3de6be006b1526f71ffcdbf23ca37663ca"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


Add MSVC 2017 to known versions of MSVC

Add MSVC 2017 to known versions of MSVC

--- CMake/mitkFunctionGetMSVCVersion.cmake
+++ CMake/mitkFunctionGetMSVCVersion.cmake
@@ -19,8 +19,11 @@
   elseif(MSVC_VERSION EQUAL 1900)
     set(VISUAL_STUDIO_VERSION_MAJOR "14" PARENT_SCOPE)
     set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2015" PARENT_SCOPE)
+  elseif(MSVC_VERSION EQUAL 1910)
+    set(VISUAL_STUDIO_VERSION_MAJOR "15" PARENT_SCOPE)
+    set(VISUAL_STUDIO_PRODUCT_NAME "Visual Studio 2017" PARENT_SCOPE)
   else()
-    message(WARNING "Unknown Visual Studio version, some functionality might not be available. Please update mitkFunctionGetMSVCVersion.cmake.")
+    message(WARNING "Unknown Visual Studio version. Please update CMake/mitkFunctionGetMSVCVersion.cmake.")
   endif()

   if("${CMAKE_GENERATOR}" MATCHES ".*Win64")


Removed MKL for tensorflow

Removed MKL for tensorflow

--- cmake/ExternalTensorflow.cmake
+++ cmake/ExternalTensorflow.cmake
@@ -54,9 +54,6 @@
         INSTALL_COMMAND
             echo "Installing tensorflow binary" &&
             cp -f ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow/bazel-bin/tensorflow/libtensorflow_framework.so ${FAST_EXTERNAL_INSTALL_DIR}/lib/ &&
-            echo "Installing mkl binaries" &&
-            bash -c "cp $(readlink -f ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow/bazel-out/)/../../../external/mkl/lib/libmklml_intel.so ${FAST_EXTERNAL_INSTALL_DIR}/lib/ -Rf" &&
-            bash -c "cp $(readlink -f ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow/bazel-out/)/../../../external/mkl/lib/libiomp5.so ${FAST_EXTERNAL_INSTALL_DIR}/lib/ -Rf" &&
             echo "Installing tensorflow headers" &&
             cp -rf ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow/tensorflow/ ${FAST_EXTERNAL_INSTALL_DIR}/include/ &&
             echo "Installing tensorflow generated headers" &&


DIRECTORY not available in CMake <=2.8.11. PATH should be used instead

--- cmake/PythonApplyPatches.cmake
+++ cmake/PythonApplyPatches.cmake
@@ -78,7 +78,8 @@
       )
     if(result EQUAL 0)
       message(STATUS "${msg} - done")
-      get_filename_component(_dir ${applied} DIRECTORY)
+      #get_filename_component(_dir ${applied} DIRECTORY)
+      get_filename_component(_dir ${applied} PATH)
       execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${_dir})
       execute_process(COMMAND ${CMAKE_COMMAND} -E touch ${applied})
     else()


[cmake] Append to include directories, do not overwrite them

This fixes what was probably a typo in ROOT_GENERATE_DICTIONARY.

--- cmake/modules/RootMacros.cmake
+++ cmake/modules/RootMacros.cmake
@@ -462,7 +462,7 @@
       # list(APPEND incdirs ${CMAKE_SOURCE_DIR})
       set(excludepaths ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
     elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/inc)
-      set(incdirs ${CMAKE_CURRENT_SOURCE_DIR}/inc)
+      list(APPEND incdirs ${CMAKE_CURRENT_SOURCE_DIR}/inc)
     endif()

     foreach(dep ${ARG_DEPENDENCIES})


remove dnnl_dll_path from post build copy (#6142)

--- cmake/onnxruntime_python.cmake
+++ cmake/onnxruntime_python.cmake
@@ -339,7 +339,7 @@
   add_custom_command(
     TARGET onnxruntime_pybind11_state POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E copy
-        ${DNNL_DLL_PATH} $<TARGET_FILE:onnxruntime_providers_tensorrt>
+        $<TARGET_FILE:onnxruntime_providers_tensorrt>
         $<TARGET_FILE:onnxruntime_providers_shared>
         $<TARGET_FILE_DIR:${test_data_target}>/onnxruntime/capi/
   )


Disabling X11 check for all Apple platforms. Because it may not always be available on the system.

--HG--
branch : v1-8

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -72,7 +72,7 @@
 macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" TRUE "" "")

 # Find X11
-if (UNIX AND NOT OGRE_BUILD_PLATFORM_APPLE_IOS)
+if (UNIX AND NOT APPLE)
   find_package(X11)
   macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org" TRUE "" "")
   macro_log_feature(X11_Xt_FOUND "Xt" "X Toolkit" "http://www.x.org" TRUE "" "")


platform_build_external() now passes the toolset variable to the external build process.

--- scripts/external-package.cmake
+++ scripts/external-package.cmake
@@ -9,7 +9,9 @@
     set(generator_flag "-G")
   endif ()

-  execute_process(COMMAND ${CMAKE_COMMAND} ${generator_flag} ${generator} -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/bin/${key} ../../cmake
+  execute_process(COMMAND ${CMAKE_COMMAND} ${generator_flag} ${generator}
+    -DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/bin/${key} ../../cmake
+    -Dtoolset=${key}
     WORKING_DIRECTORY ${build_path}
     RESULT_VARIABLE output
     )


Dynamically pick the ctest drop site based on site_name

nyx firewalls outgoing connections from compute nodes, so a ssh tunnel is needed to get out. This commit enables that tunnel when SITE_NAME is nyx.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,6 +8,16 @@
 set(CTEST_NIGHTLY_START_TIME "23:00:00 CST")

 set(CTEST_DROP_METHOD "http")
+
+# this convoluted setup seems to be the only way to get the SITE_NAME variable
+set(SITE ${SITE_NAME})
+
+# the automated test on nyx need to be ssh-tunneled out of the compute node
+if (SITE MATCHES "nyx")
+set(CTEST_DROP_SITE "localhost:8080")
+else (SITE MATCHES "nyx")
 set(CTEST_DROP_SITE "cdash.fourpisolutions.com")
+endif(SITE MATCHES "nyx")
+
 set(CTEST_DROP_LOCATION "/submit.php?project=HOOMD")
 set(CTEST_DROP_SITE_CDASH TRUE)


[brief] Updates FindVulkan cmake.

[brief] Updates FindVulkan cmake.

[detailed]
- The paths had changed slightly and needed to be updated.

--- external/glfw/CMake/modules/FindVulkan.cmake
+++ external/glfw/CMake/modules/FindVulkan.cmake
@@ -10,13 +10,20 @@
         "$ENV{VK_SDK_PATH}/Include")
     if (CMAKE_CL_64)
         find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
+            "$ENV{VULKAN_SDK}/Lib"
             "$ENV{VULKAN_SDK}/Bin"
             "$ENV{VK_SDK_PATH}/Bin")
         find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
+            "$ENV{VULKAN_SDK}/Lib"
             "$ENV{VULKAN_SDK}/Bin"
             "$ENV{VK_SDK_PATH}/Bin")
     else()
         find_library(VULKAN_LIBRARY NAMES vulkan-1 HINTS
+            "$ENV{VULKAN_SDK}/Lib32"
+            "$ENV{VULKAN_SDK}/Bin32"
+            "$ENV{VK_SDK_PATH}/Bin32")
+        find_library(VULKAN_STATIC_LIBRARY NAMES vkstatic.1 HINTS
+            "$ENV{VULKAN_SDK}/Lib32"
             "$ENV{VULKAN_SDK}/Bin32"
             "$ENV{VK_SDK_PATH}/Bin32")
     endif()


CMake: [skip ci] add some links

CMake: [skip ci] add some links

--- cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
+++ cMake/FreeCAD_Helpers/CompilerChecksAndSetups.cmake
@@ -1,3 +1,7 @@
+# Some resources
+# https://github.com/dev-cafe/cmake-cookbook
+# https://cmake.org/cmake/help/v3.8/manual/cmake-compile-features.7.html
+
 macro(CompilerChecksAndSetups)
     if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
         set(CMAKE_COMPILER_IS_CLANGXX TRUE)


Python modules can link to OBJECT library

--- scripts/PythonModule.cmake
+++ scripts/PythonModule.cmake
@@ -117,7 +117,7 @@
     cmake_parse_arguments(${ext}
         ""
         "INSTALL;TARGET;LOCATION;EXTENSION;MODULE_TARGET"
-        "SOURCES;LIBRARIES;DEPENDENCIES"
+        "SOURCES;LIBRARIES;DEPENDENCIES;OBJECTS"
         ${ARGN}
     )
     if("${${ext}_SOURCES}" STREQUAL "")
@@ -134,7 +134,7 @@
     python_extension_targetname(module_target
         ${${ext}_TARGET} MODULE_TARGET ${${ext}_MODULE_TARGET})

-    add_library(${module_target} MODULE ${${ext}_SOURCES})
+    add_library(${module_target} MODULE ${${ext}_SOURCES} ${${ext}_OBJECTS})
     target_link_libraries(${module_target} ${PYTHON_LIBRARIES})
     set(output_dir "${location}")
     if(NOT IS_ABSOLUTE "${location}")
@@ -377,7 +377,7 @@
     cmake_parse_arguments(${module}
         "FAKE_INIT;NOINSTALL;INSTALL;CPP"
         "HEADER_DESTINATION;TARGETNAME;LOCATION;OUTPUT_PYTHON_SOURCES"
-        "SOURCES;EXCLUDE;LIBRARIES;GLOB"
+        "SOURCES;EXCLUDE;LIBRARIES;GLOB;OBJECTS"
         ${ARGN}
     )
     # Sets submodule, location, and module from module
@@ -433,6 +433,7 @@
         LOCATION ${extension_location}
         LIBRARIES ${${module}_LIBRARIES}
         SOURCES ${C_SOURCES} ${CPP_SOURCES}
+        OBJECTS ${${module}_OBJECTS}
     )

     # Then copy/install pure python files
@@ -459,6 +460,7 @@
         INSTALL ${do_install}
         LIBRARIES ${${module}_LIBRARIES}
         TARGET ${targetname}
+        OBJECTS ${${module}_OBJECTS}
         SOURCES ${CY_SOURCES}
     )


Apply patch by Fabrice Ménard <menard.fabrice orange fr>, from kde-buildsystem. He says : "As ${PKG_GOBJECT2_INCLUDE_DIRS} might be a list we can't simply append path components to it. For example, on my system pkg-config --cflags gobject-2.0 returns :         '-I/opt/gnome/include/glib-2.0 -I/opt/gnome/lib/glib-2.0/include' "

--- cmake/FindGObject.cmake
+++ cmake/FindGObject.cmake
@@ -25,11 +25,10 @@
    SET(GOBJECT_DEFINITIONS ${PKG_GOBJECT2_CFLAGS})
 ENDIF (NOT WIN32)

-FIND_PATH(GOBJECT_INCLUDE_DIR gobject.h
+FIND_PATH(GOBJECT_INCLUDE_DIR gobject/gobject.h
    PATHS
    ${PKG_GOBJECT2_INCLUDE_DIRS}
-   ${PKG_GOBJECT2_INCLUDE_DIRS}/glib-2.0/gobject/
-   /usr/include/glib-2.0/gobject/
+   /usr/include/glib-2.0/
    #PATH_SUFFIXES gst
    )


build: improve wayland detection

build: improve wayland detection

* add support to check wayland client version
* set minimum required version to 0.95

--- cmake/FindWayland.cmake
+++ cmake/FindWayland.cmake
@@ -8,10 +8,12 @@
 #
 #     WAYLAND_INCLUDE_DIR  - where to find wayland-client.h, etc.
 #     WAYLAND_LIBRARY      - the Wayland client library
+#     WAYLAND_VERSION      - wayland client version if found and pkg-config was used
 #

 #=============================================================================
 # Copyright 2014 Manuel Bachmann <tarnyko@tarnyko.net>
+# Copyright 2015 Bernhard Miklautz <bernhard.miklautz@shacknet.at>
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -26,21 +28,38 @@
 # limitations under the License.
 #=============================================================================

+set(REQUIRED_WAYLAND_CLIENT_VERSION 0.95)
+include(FindPkgConfig)
+
+if(PKG_CONFIG_FOUND)
+  pkg_check_modules(WAYLAND wayland-client)
+endif()
+
 find_path(WAYLAND_INCLUDE_DIR NAMES wayland-client.h
+          PATHS ${WAYLAND_INCLUDE_DIRS}
           DOC "The Wayland include directory"
 )

 find_library(WAYLAND_LIBRARY NAMES wayland-client
+          PATHS ${WAYLAND_LIBRARY_DIRS}
           DOC "The Wayland client library"
 )

 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(WAYLAND DEFAULT_MSG WAYLAND_LIBRARY WAYLAND_INCLUDE_DIR)

-if(WAYLAND_FOUND)
-  set( WAYLAND_LIBRARIES ${WAYLAND_LIBRARY} )
-  set( WAYLAND_INCLUDE_DIRS ${WAYLAND_INCLUDE_DIR} )
+if(WAYLAND_VERSION)
+	if (${WAYLAND_VERSION} VERSION_LESS ${REQUIRED_WAYLAND_CLIENT_VERSION})
+		message(WARNING "Installed wayland version ${WAYLAND_VERSION} is too old - minimum required version ${REQUIRED_WAYLAND_CLIENT_VERSION}")
+		set(WAYLAND_FOUND FALSE)
+	endif()
+else()
+		message(WARNING "Couldn't detect wayland version - no version check is done")
 endif()

-mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY)
+if(WAYLAND_FOUND)
+  set(WAYLAND_LIBRARIES ${WAYLAND_LIBRARY})
+  set(WAYLAND_INCLUDE_DIRS ${WAYLAND_INCLUDE_DIR})
+endif()

+mark_as_advanced(WAYLAND_INCLUDE_DIR WAYLAND_LIBRARY WAYLAND_VERSION)


Update ldflags for the SFML.

Update ldflags for the SFML.

--- cmake/TbagModules.cmake
+++ cmake/TbagModules.cmake
@@ -636,7 +636,7 @@
                     -Wl,-framework,IOKit
                     -Wl,-framework,Carbon)
         else ()
-            # TODO: Linux
+            list (APPEND TBAG_PROJECT_LDFLAGS -lX11 -lXrandr -ludev)
         endif ()
     endif ()


configure command for tinyxml

configure command for tinyxml

--- cmake/get-tinyxml.cmake
+++ cmake/get-tinyxml.cmake
@@ -10,19 +10,29 @@

 set(TINYXML_CMAKE_ARGS
     ${COMMON_CMAKE_ARGS}
-      -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-      -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
-      #-DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH}
-      -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-      -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
+        -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+        -DCMAKE_INSTALL_PREFIX=${DEPENDENCY_INSTALL_DIR}
+        #-DCMAKE_PREFIX_PATH=${DEPENDENCY_INSTALL_DIR} ${CMAKE_PREFIX_PATH}
+        -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
+        -DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
+)
+
+set(TINYXML_CMAKE_CONFIG_ARGS
+    -G ${CMAKE_GENERATOR}
+    -DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER}
+    -DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER}
+    -DCMAKE_INSTALL_PREFIX:PATH=${DEPENDENCY_INSTALL_DIR}
+    -DCMAKE_CXX_FLAGS:STRING=-DTIXML_USE_STL
+    ${DEPENDENCY_EXTRACT_DIR}/src/tinyxml
 )

 ExternalProject_Add(
   tinyxml
-  PREFIX          ${DEPENDENCY_EXTRACT_DIR}
-  DOWNLOAD_DIR    ${DEPENDENCY_DOWNLOAD_DIR}
-  DOWNLOAD_NAME   tinyxml-v${TINYXML_VERSION}.zip
-  URL             https://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.zip/download
-  URL_MD5         2a0aaf609c9e670ec9748cd01ed52dae
-  CMAKE_ARGS      ${TINYXML_CMAKE_ARGS}
+  PREFIX                ${DEPENDENCY_EXTRACT_DIR}
+  DOWNLOAD_DIR          ${DEPENDENCY_DOWNLOAD_DIR}
+  DOWNLOAD_NAME         tinyxml-v${TINYXML_VERSION}.zip
+  URL                   https://sourceforge.net/projects/tinyxml/files/tinyxml/2.6.2/tinyxml_2_6_2.zip/download
+  URL_MD5               2a0aaf609c9e670ec9748cd01ed52dae
+  CONFIGURE_COMMAND     ${CMAKE_COMMAND} ${TINYXML_CMAKE_CONFIG_ARGS}
+  #CMAKE_ARGS           ${TINYXML_CMAKE_ARGS}
 )


MAINT: reinstate generation of `sara_version.cmake` file.

--- cmake/sara_macros.cmake
+++ cmake/sara_macros.cmake
@@ -44,6 +44,9 @@
   configure_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sara_version.cmake.in
     ${CMAKE_BINARY_DIR}/cmake/sara_version.cmake @ONLY)
+  configure_file(
+    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sara_version.cmake.in
+    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sara_version.cmake @ONLY)
   configure_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/src/DO/Sara/Defines.hpp.in
     ${CMAKE_BINARY_DIR}/src/DO/Sara/Defines.hpp @ONLY)


First search SimGrid where hinted by user

--- FindSimGrid.cmake
+++ FindSimGrid.cmake
@@ -16,11 +16,11 @@
 set(SimGrid_PATH ${SimGrid_PATH} CACHE PATH "Path to SimGrid library and include")
 find_path(SimGrid_INCLUDE_DIR
   NAMES simgrid_config.h
-  HINTS /usr/include /usr/local/include ${SimGrid_PATH}/include /opt/simgrid/include
+  HINTS ${SimGrid_PATH}/include /usr/include /usr/local/include /opt/simgrid/include
 )
 find_library(SimGrid_LIBRARY
   NAMES simgrid
-  HINTS /usr/lib /usr/local/lib ${SimGrid_PATH}/lib /opt/simgrid/lib
+  HINTS ${SimGrid_PATH}/lib /usr/lib /usr/local/lib /opt/simgrid/lib
 )
 mark_as_advanced(SimGrid_INCLUDE_DIR)
 mark_as_advanced(SimGrid_LIBRARY)


Speeds up configure stage by filtering out duplicate include files (careful to leave duplicate libraries, because of linker order dependencies).

--- internal/load_required_packages.cmake
+++ internal/load_required_packages.cmake
@@ -12,10 +12,10 @@
   required_includes_out
 )
   # Clear output variables
-  SET(required_package_uris)
-  SET(missing_package_uris)
-  SET(required_libraries)
-  SET(required_includes)
+  SET(required_package_uris "")
+  SET(missing_package_uris "")
+  SET(required_libraries "")
+  SET(required_includes "")

   IF(NOT query_package_uris)
     RETURN()
@@ -28,7 +28,6 @@
     TO_CANONICAL_URI(${uri} cannonical_uri)
     LIST(APPEND uri_stack ${cannonical_uri})
   ENDFOREACH()
-  LIST(REMOVE_DUPLICATES uri_stack)

   # Construct transitive closure
   LIST(LENGTH uri_stack uri_stack_size)
@@ -47,7 +46,9 @@
         FIND_PACKAGE(${target_name} QUIET NO_MODULE)  #don't let a FindFoo.cmake module file overide a specifed location in Foo_DIR
       ENDIF()
     ELSEIF("${uri_scheme}" STREQUAL "SYS")
-      FIND_PACKAGE(${target_name} QUIET) # should find these in the /internal/modules path
+      IF (NOT DEFINED ${target_name}_FOUND)
+        FIND_PACKAGE(${target_name} QUIET) # should find these in the /internal/modules path
+      ENDIF()
     ELSE()
       MESSAGE(FATAL_ERROR "unknown uri scheme: ${uri_scheme}")
     ENDIF()
@@ -57,17 +58,25 @@
       LIST(APPEND missing_package_uris ${uri})
       UNSET(${target_name}_DIR CACHE)
       BREAK() # exit the while loop
-    # Otherwise, add the packages dependencies to the queue
+    # Otherwise, add the package's dependencies to the queue
     ELSE()
       LIST(APPEND required_libraries ${${target_name}_LIBRARIES})
       LIST(APPEND required_includes ${${target_name}_INCLUDE_DIRS})
-      IF(${target_name}_REQUIRED_PACKAGES)
+      # add any packages required by this package if they haven't been processed
+      IF(${target_name}_REQUIRED_PACKAGES)
+        # NOTE: This is tricky... This is non-optimal because a package could be
+        # repeated... However, the simple optimization of removing the redundant
+        # packages may not provide the required link order...
         LIST(APPEND uri_stack ${${target_name}_REQUIRED_PACKAGES})
-        list(REMOVE_DUPLICATES uri_stack)
       ENDIF()
     ENDIF()
     LIST(LENGTH uri_stack uri_stack_size)
   ENDWHILE()
+
+  LIST(REMOVE_DUPLICATES missing_package_uris)
+  LIST(REMOVE_DUPLICATES required_package_uris)
+  LIST(REMOVE_DUPLICATES required_includes)
+  #LIST(REMOVE_DUPLICATES required_libraries) # DONT DO THIS!!! This screws up the link order and will break everything... in a subtle and hard to find way!

   # Copy to output variables (notice PARENT_SCOPE required when using function instead of macro)
   set(${missing_package_uris_out} ${missing_package_uris} PARENT_SCOPE)


Consolidate OSX setup logic

Consolidate OSX setup logic

--- standard/StandardProject.cmake
+++ standard/StandardProject.cmake
@@ -48,6 +48,21 @@
     else()
       # Build Fat binaries on OSX by default
       set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures" FORCE)
+      if(NOT CMAKE_OSX_SYSROOT)
+        # CLANG_VERSION requires a sysroot to obtain, so resort to execute_process() here
+        execute_process(COMMAND clang -v ERROR_VARIABLE _clang_version)
+        if(_clang_version MATCHES "clang-7")
+          set(_developer_sdk_version 10.11)
+        elseif(_clang_version MATCHES "clang-8")
+          set(_developer_sdk_version 10.12)
+        endif()
+        if(_developer_sdk_version)
+          set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_developer_sdk_version}.sdk" CACHE STRING "Mac OS X build environment" FORCE)
+          if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+            set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "Mac OS X deployment target" FORCE)
+          endif()
+        endif()
+      endif()
     endif()
   endif()

@@ -55,23 +70,6 @@
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release." FORCE)
   endif()

-  if(APPLE AND NOT (CMAKE_SYSTEM_PROCESSOR STREQUAL "arm"))
-    if(NOT CMAKE_OSX_SYSROOT)
-      # CLANG_VERSION requires a sysroot to obtain, so resort to execute_process() here
-      execute_process(COMMAND clang -v ERROR_VARIABLE _clang_version)
-      if(_clang_version MATCHES "clang-7")
-        set(_developer_sdk_version 10.11)
-      elseif(_clang_version MATCHES "clang-8")
-        set(_developer_sdk_version 10.12)
-      endif()
-      if(_developer_sdk_version)
-        set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${_developer_sdk_version}.sdk" CACHE STRING "Mac OS X build environment" FORCE)
-        if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
-          set(CMAKE_OSX_DEPLOYMENT_TARGET "10.10" CACHE STRING "Mac OS X deployment target" FORCE)
-        endif()
-      endif()
-    endif()
-  endif()
 endfunction()

 function(standard_project_postinit)


Fix matplotlib tarball MD5 hash

Fix matplotlib tarball MD5 hash

--- matplotlib.cmake
+++ matplotlib.cmake
@@ -18,7 +18,7 @@
 external_source (matplotlib
     1.1.1
     matplotlib-1.1.1.tar.gz
-    80eb9862fa09c7e06eda6e2a9fc4042f
+    8cbeaae8ba9da703d926e74c3e7c8a57
     http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.1.1)

 message ("Installing ${matplotlib_NAME} into FlyEM build area: ${FLYEM_BUILD_DIR} ...")


Fix gen_c macro

Fix gen_c macro

--- macros.cmake
+++ macros.cmake
@@ -47,6 +47,8 @@
 	set(hfile ${CMAKE_CURRENT_BINARY_DIR}/${file}.h)
 	set(cfile ${CMAKE_CURRENT_BINARY_DIR}/${file}.c)

+	get_filename_component(OUTDIR ${hfile} DIRECTORY)
+
 	add_custom_command(
 		OUTPUT
 			${hfile}
@@ -58,7 +60,7 @@
 		DEPENDS
 			${CMAKE_CURRENT_SOURCE_DIR}/${file}
 		WORKING_DIRECTORY
-			${CMAKE_CURRENT_BINARY_DIR}
+			${OUTDIR}
 		COMMENT
 			"Generating ${file}.c, ${file}.h"
 	)


fix Windows registry install path

fix Windows registry install path

--- FindLibSDRplay.cmake
+++ FindLibSDRplay.cmake
@@ -2,7 +2,7 @@
   # pkg_check_modules (LIBSDRPLAY_PKG libsdrplay)

   IF(WIN32)
-	  GET_FILENAME_COMPONENT(SDRPLAY_API_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SDRplay\\API;Install_Dir]" ABSOLUTE)
+	  GET_FILENAME_COMPONENT(SDRPLAY_API_DIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\SDRplay\\Service\\API;Install_Dir]" ABSOLUTE)

      if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
 		MESSAGE( "64 bit compiler detected" )


Update paraview to pull in various fixes

--- versions.cmake
+++ versions.cmake
@@ -64,7 +64,7 @@
   set(_paraview_revision "master")
 else()
   # Test the revision with OpenGL2 rendering before updating, update often!
-  set(_paraview_revision "275743f9a439ca10cd2b3e29206533c85318b45a")
+  set(_paraview_revision "5a4e7b641c8bd886870fa8ecb4749182a50c7365")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


Update to new ITK that has FFTW support built in

--- versions.cmake
+++ versions.cmake
@@ -155,10 +155,10 @@
   endif()
 elseif(APPLE)
   add_revision(itk
-    URL "http://www.tomviz.org/files/itk-4.8.0-macosx10.8.tar.gz"
-    URL_MD5 "904a0e8c7ebe986deddceb4984bf455d")
+    URL "http://www.tomviz.org/files/itk-4.8.2-macosx10.8.tar.gz"
+    URL_MD5 "39e75f16fb430818ade23a0439334cd0")
 elseif(UNIX)
   add_revision(itk
-    URL "http://www.tomviz.org/files/itk-4.8.1-linux-64bit.tar.gz"
-    URL_MD5 "e0ceef7aee666704036c7ecc1f532015")
+    URL "http://www.tomviz.org/files/itk-4.8.2-linux-64bit.tar.gz"
+    URL_MD5 "5830edef507874ab531b6e33eb3e79d7")
 endif()


update model repo hash

update model repo hash

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -2,4 +2,5 @@
 ## SPDX-License-Identifier: Apache-2.0

 set(CTEST_PROJECT_NAME "Embree")
-set(TEST_MODELS_HASH 9f7aa420e2f931c51c8a72a812da0631d04f9ed9)
+set(TEST_MODELS_HASH 3f32d3837ae09de19aeff412096e95ab903b8568)
+#set(TEST_MODELS_HASH 9f7aa420e2f931c51c8a72a812da0631d04f9ed9)


switched CTest upload URL

switched CTest upload URL

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -4,8 +4,8 @@

 set(CTEST_DROP_METHOD "http")

-set(CTEST_DROP_SITE "rubens")
-set(CTEST_DROP_LOCATION "/cdash/submit.php?project=Vigra")
+set(CTEST_DROP_SITE "hci.iwr.uni-heidelberg.de")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=Vigra")
 set(CTEST_DROP_SITE_CDASH TRUE)


refs #5351 fix up ctestcustom

refs #5351 fix up ctestcustom

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -7,8 +7,9 @@
   ft/ft_loader-test-extractor-1
   ft/ft_loader-test-extractor-2
   ft/ft_loader-test-extractor-3
-  ft/helgrind_test_partitioned_counter
   ft/upgrade_test_simple
+  portability/helgrind_test-circular-buffer
+  portability/helgrind_test_partitioned_counter
   portability/try-leak-lost
   portability/try-leak-reachable
   portability/try-leak-uninit
@@ -51,7 +52,8 @@

 if (NOT @RUN_HELGRIND_TESTS@)
   list(APPEND CTEST_CUSTOM_TESTS_IGNORE
-    ft/helgrind_test_partitioned_counter
+    portability/helgrind_test-circular-buffer
+    portability/helgrind_test_partitioned_counter
     ydb/helgrind_helgrind1.tdb
     ydb/helgrind_helgrind2.tdb
     ydb/helgrind_helgrind3.tdb


Trying to fix InstallSymlink.cmake on Windows

--- InstallSymlink.cmake
+++ InstallSymlink.cmake
@@ -5,8 +5,10 @@
     install(CODE
       "get_filename_component(FROM_ABSOLUTE ${CMAKE_INSTALL_PREFIX}/${FROM}
          ABSOLUTE)
-       execute_process(COMMAND mlink \${FROM_ABSOLUTE}
-         ${CMAKE_INSTALL_PREFIX}/${TO})"
+       file(TO_NATIVE_PATH \${FROM_ABSOLUTE} FROM_ABSOLUTE)
+       file(TO_NATIVE_PATH \${CMAKE_INSTALL_PREFIX}/${TO} TO)
+       message(\"mklink /j \${TO} \${FROM_ABSOLUTE}\")
+       execute_process(COMMAND mklink /j \${TO} \${FROM_ABSOLUTE})"
       COMPONENT "${COMPONENT}")
   else()
     install(CODE


Fix overriding of CPACK_DEBIAN_PACKAGE_VERSION

--- CommonCPack.cmake
+++ CommonCPack.cmake
@@ -156,10 +156,12 @@
     # dpkg requires lowercase package names
     string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)

-    set(CPACK_DEBIAN_PACKAGE_VERSION
-      "${CPACK_PACKAGE_VERSION}~${CPACK_PACKAGE_NAME_EXTRA}${LSB_RELEASE}")
+    if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
+      set(CPACK_DEBIAN_PACKAGE_VERSION
+        "${CPACK_PACKAGE_VERSION}~${CPACK_PACKAGE_NAME_EXTRA}${LSB_RELEASE}")
+    endif()
     set(CPACK_PACKAGE_FILE_NAME
-      "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}~${CPACK_PACKAGE_NAME_EXTRA}${LSB_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
+      "${CPACK_PACKAGE_NAME}-${CPACK_DEBIAN_PACKAGE_VERSION}.${CMAKE_SYSTEM_PROCESSOR}")

     if(NOT CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA)
       set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "/sbin/ldconfig")


Clean up doxygen install rules

Clean up doxygen install rules

--- DoxygenRule.cmake
+++ DoxygenRule.cmake
@@ -22,13 +22,10 @@
   COMMENT "Generating API documentation using doxygen" VERBATIM)
 add_dependencies(doxygen doxygen_install)

-make_directory(${CMAKE_BINARY_DIR}/doc/man/man3)
-install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/man/man3 DESTINATION man
-  COMPONENT man PATTERN "*_docs_*" EXCLUDE)
-
 make_directory(${CMAKE_BINARY_DIR}/doc/html)
 install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html
-  DESTINATION share/${CMAKE_PROJECT_NAME}/doc/API COMPONENT doc)
+  DESTINATION share/${CMAKE_PROJECT_NAME}/doc/API
+  COMPONENT doc CONFIGURATIONS Release)

 if(NOT GIT_DOCUMENTATION_REPO)
   include(GithubOrganization)


Fixed for win

Fixed for win

--- FindOpenSSL.cmake
+++ FindOpenSSL.cmake
@@ -21,7 +21,7 @@

 include(FindPackageHandleStandardArgs)
 FOREACH(THELIB ${CONAN_LIBS_OPENSSL})
-    IF(${THELIB} MATCHES "dl")
+    IF(NOT ${THELIB} MATCHES "ssl" AND NOT ${THELIB} MATCHES "crypto")
         find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL})
     ELSE()
         find_library(LIB_${THELIB} NAMES ${THELIB} PATHS ${CONAN_LIB_DIRS_OPENSSL} NO_DEFAULT_PATH)


CMake: Fixed removing of doc/test/example folders in boost-download so that it excludes anything under .git/...

--- src/cmake/boost-download.cmake
+++ src/cmake/boost-download.cmake
@@ -115,7 +115,7 @@
     # Filter away all folder-paths not ending in either "doc", "example" or "test"
     list(FILTER NON_SOURCE_DIRS
         INCLUDE
-        REGEX "^.*(\\/|\\\\)(doc|example|test)$"
+        REGEX "^.*(libs|tools)(\\\/|\\\\)[^\\\/\\\\]*(\\\/|\\\\)(doc|example|test)$"
     )

     foreach(DIR ${NON_SOURCE_DIRS})


COMP: set https git_protocol for itkv4

COMP: set https git_protocol for itkv4

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -127,7 +127,7 @@
     )
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
-  set(${proj}_REPOSITORY "${git_protocol}://github.com/InsightSoftwareConsortium/ITK.git")
+  set(${proj}_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
   set(${proj}_GIT_TAG b23ee20eee5e68cc405e90cb036a5d3c80996abb) # 4-Dec-2013
   set(ITK_VERSION_ID ITK-4.6)


bugfix when ispc not installed

bugfix when ispc not installed

--- common/cmake/ispc.cmake
+++ common/cmake/ispc.cmake
@@ -20,7 +20,9 @@
 ENDMACRO ()

 execute_process(COMMAND which ispc OUTPUT_VARIABLE ISPC_EXECUTABLE)
-execute_process(COMMAND dirname ${ISPC_EXECUTABLE} OUTPUT_VARIABLE ISPC_DIR_TEMP)
+IF (EXISTS ${ISPC_EXECUTABLE})
+  execute_process(COMMAND dirname ${ISPC_EXECUTABLE} OUTPUT_VARIABLE ISPC_DIR_TEMP)
+ENDIF()
 STRING(REGEX REPLACE "\n" "" ISPC_DIR "${ISPC_DIR_TEMP}")

 MACRO (ispc_compile targets)


Fix ITK TAGS_DEPENDS bug

Fix ITK TAGS_DEPENDS bug

When building the documentation, cmake was not downloading the
InsightDoxygen.tag file from itk.org because of a typo and
a cmake syntax error.

Change-Id: Idfbed2204c2eafc80ded1d60139b89a69d8d620a

--- Utilities/Doxygen/Doxygen.cmake
+++ Utilities/Doxygen/Doxygen.cmake
@@ -46,16 +46,15 @@
     )

   if (USE_ITK_DOXYGEN_TAGS)
-    set(TAGS_DEPENDS "DEPENDS \"${PROJECT_BINARY_DIR}/Documentation/Doxygen/InsightDoxygen.tag\"")
+    set(TAGS_DEPENDS DEPENDS ${PROJECT_BINARY_DIR}/Documentation/Doxygen/InsightDoxygen.tag)
   endif ()
-

   add_custom_target(Documentation ALL
     COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
     MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
     DEPENDS "${PROJECT_BINARY_DIR}/Documentation/Doxygen/Examples.dox"
     DEPENDS "${PROJECT_BINARY_DIR}/Documentation/Doxygen/FilterCoverage.dox"
-    ${TAG_DEPENDS}
+    ${TAGS_DEPENDS}
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Utilities/Doxygen
     )


Remove debugging message

Remove debugging message

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -1068,7 +1068,6 @@
 endfunction()

 if("${ExternalData_ACTION}" STREQUAL "fetch")
-  message( "fetch ext: ${exts}")
   foreach(v ExternalData_OBJECT_STORES file name exts)
     if(NOT DEFINED "${v}")
       message(FATAL_ERROR "No \"-D${v}=\" value provided!")


Remove CMake debug message.

Remove CMake debug message.

--- CMakeExternals/ITK.cmake
+++ CMakeExternals/ITK.cmake
@@ -56,7 +56,6 @@
   endif()

   if(MITK_USE_OpenCV)
-    message("OpenCV_DIR: ${OpenCV_DIR}")
     list(APPEND additional_cmake_args
          -DModule_ITKVideoBridgeOpenCV:BOOL=ON
          -DOpenCV_DIR:PATH=${OpenCV_DIR}


Added missing quotes around linker flags.

--- copasi/CMakeConsoleApp.cmake
+++ copasi/CMakeConsoleApp.cmake
@@ -9,10 +9,10 @@
 # for apple we set the Accelerate framework

 set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${CLAPACK_LIBRARIES})
-set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${CLAPACK_LINKER_FLAGS})
+set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CLAPACK_LINKER_FLAGS}")

 if(ENABLE_COPASI_SEDML)
-set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${LIBSEDML_LIBRARY})
+  set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${LIBSEDML_LIBRARY})
 endif()

 set(SE_EXTERNAL_LIBS ${SE_EXTERNAL_LIBS} ${LIBSBML_LIBRARY})


it's all in the curly braces... apparently.

--- src/CMake/Findcycluscore.cmake
+++ src/CMake/Findcycluscore.cmake
@@ -2,9 +2,11 @@
 #  CYCLUS_CORE_INCLUDE_DIR - the Cyclus include directory
 #  CYCLUS_CORE_LIBRARIES - The libraries needed to use the Cyclus Core Library

-IF(NOT DEFINED ${CYCLUS_ROOT_DIR})
+IF(NOT DEFINED CYCLUS_ROOT_DIR)
   SET(CYCLUS_ROOT_DIR "$ENV{CYCLUS_ROOT_DIR}")
-ENDIF(NOT DEFINED ${CYCLUS_ROOT_DIR})
+ENDIF(NOT DEFINED CYCLUS_ROOT_DIR)
+
+MESSAGE(STATUS "CYCLUS_ROOT_DIR hint is : ${CYCLUS_ROOT_DIR}")

 # Look for the header files
 FIND_PATH(CYCLUS_CORE_INCLUDE_DIR suffix.h


Fixed bug that was causing unnecessary call to non-existing command when no msg/srv files were found.

--- core/rospy/cmake/rospy.cmake
+++ core/rospy/cmake/rospy.cmake
@@ -5,6 +5,8 @@
   rosbuild_get_msgs(_msglist)
   set(_inlist "")
   set(_autogen "")
+  set(genmsg_py_exe ${rospy_PACKAGE_PATH}/scripts/genmsg_py)
+
   foreach(_msg ${_msglist})
     # Construct the path to the .msg file
     set(_input ${PROJECT_SOURCE_DIR}/msg/${_msg})
@@ -13,7 +15,6 @@

     rosbuild_gendeps(${PROJECT_NAME} ${_msg})

-    set(genmsg_py_exe ${rospy_PACKAGE_PATH}/scripts/genmsg_py)

     set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/msg/_${_msg})
     string(REPLACE ".msg" ".py" _output_py ${_output_py})
@@ -25,19 +26,21 @@
     list(APPEND _autogen ${_output_py})
   endforeach(_msg)

-  # Set up to create the __init__.py file that will import the .py
-  # files created by the above loop.  It can't run until those files are
-  # generated, so it depends on them.
-  set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/msg/__init__.py)
-  add_custom_command(OUTPUT ${_output_py}
-                     COMMAND ${genmsg_py_exe} --initpy ${_inlist}
-                     DEPENDS ${_autogen})
+  if(_autogen)
+    # Set up to create the __init__.py file that will import the .py
+    # files created by the above loop.  It can't run until those files are
+    # generated, so it depends on them.
+    set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/msg/__init__.py)
+    add_custom_command(OUTPUT ${_output_py}
+                       COMMAND ${genmsg_py_exe} --initpy ${_inlist}
+                       DEPENDS ${_autogen})

-  # A target that depends on generation of the __init__.py
-  add_custom_target(ROSBUILD_genmsg_py DEPENDS ${_output_py})
-  # Add our target to the top-level genmsg target, which will be fired if
-  # the user calls genmsg()
-  add_dependencies(rospack_genmsg ROSBUILD_genmsg_py)
+    # A target that depends on generation of the __init__.py
+    add_custom_target(ROSBUILD_genmsg_py DEPENDS ${_output_py})
+    # Add our target to the top-level genmsg target, which will be fired if
+    # the user calls genmsg()
+    add_dependencies(rospack_genmsg ROSBUILD_genmsg_py)
+  endif(_autogen)
 endmacro(genmsg_py)

 # Call the macro we just defined.
@@ -48,6 +51,8 @@
   rosbuild_get_srvs(_srvlist)
   set(_inlist "")
   set(_autogen "")
+  set(gensrv_py_exe ${rospy_PACKAGE_PATH}/scripts/gensrv_py)
+
   foreach(_srv ${_srvlist})
     # Construct the path to the .srv file
     set(_input ${PROJECT_SOURCE_DIR}/srv/${_srv})
@@ -56,7 +61,6 @@

     rosbuild_gendeps(${PROJECT_NAME} ${_srv})

-    set(gensrv_py_exe ${rospy_PACKAGE_PATH}/scripts/gensrv_py)

     set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/srv/_${_srv})
     string(REPLACE ".srv" ".py" _output_py ${_output_py})
@@ -68,19 +72,21 @@
     list(APPEND _autogen ${_output_py})
   endforeach(_srv)

-  # Set up to create the __init__.py file that will import the .py
-  # files created by the above loop.  It can't run until those files are
-  # generated, so it depends on them.
-  set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/srv/__init__.py)
-  add_custom_command(OUTPUT ${_output_py}
-                     COMMAND ${gensrv_py_exe} --initpy ${_inlist}
-                     DEPENDS ${_autogen})
-
-  # A target that depends on generation of the __init__.py
-  add_custom_target(ROSBUILD_gensrv_py DEPENDS ${_output_py})
-  # Add our target to the top-level gensrv target, which will be fired if
-  # the user calls gensrv()
-  add_dependencies(rospack_gensrv ROSBUILD_gensrv_py)
+  if(_autogen)
+    # Set up to create the __init__.py file that will import the .py
+    # files created by the above loop.  It can't run until those files are
+    # generated, so it depends on them.
+    set(_output_py ${PROJECT_SOURCE_DIR}/src/${PROJECT_NAME}/srv/__init__.py)
+    add_custom_command(OUTPUT ${_output_py}
+                       COMMAND ${gensrv_py_exe} --initpy ${_inlist}
+                       DEPENDS ${_autogen})
+
+    # A target that depends on generation of the __init__.py
+    add_custom_target(ROSBUILD_gensrv_py DEPENDS ${_output_py})
+    # Add our target to the top-level gensrv target, which will be fired if
+    # the user calls gensrv()
+    add_dependencies(rospack_gensrv ROSBUILD_gensrv_py)
+  endif(_autogen)
 endmacro(gensrv_py)

 # Call the macro we just defined.


[Config] Fixed the CMake target dependency issue regarding dev helpers (-config, .pc, .m4).

--- config/devhelpers.cmake
+++ config/devhelpers.cmake
@@ -17,8 +17,11 @@
 # Convert the developer script utilities (basically, just replace
 # the @<variable>@ variables)
 configure_file (${CFG_SCRIPT}.in ${CFG_SCRIPT} @ONLY)
+add_custom_target (${CFG_SCRIPT} DEPENDS ${CFG_SCRIPT}.in)
 configure_file (${PKGCFG_SCRIPT}.in ${PKGCFG_SCRIPT} @ONLY)
+add_custom_target (${PKGCFG_SCRIPT} DEPENDS ${PKGCFG_SCRIPT}.in)
 configure_file (${M4_MACROFILE}.in ${M4_MACROFILE} @ONLY)
+add_custom_target (${M4_MACROFILE} DEPENDS ${M4_MACROFILE}.in)

 #
 add_custom_target (devhelpers ALL DEPENDS)


G-API: Bump ADE to version 0.1.2

G-API: Bump ADE to version 0.1.2

--- modules/gapi/cmake/DownloadADE.cmake
+++ modules/gapi/cmake/DownloadADE.cmake
@@ -1,7 +1,7 @@
 set(ade_src_dir "${OpenCV_BINARY_DIR}/3rdparty/ade")
-set(ade_filename "v0.1.1f.zip")
-set(ade_subdir "ade-0.1.1f")
-set(ade_md5 "b624b995ec9c439cbc2e9e6ee940d3a2")
+set(ade_filename "v0.1.2.zip")
+set(ade_subdir "ade-0.1.2")
+set(ade_md5 "561c1e28ccf27ad0557a18e251c22226")
 ocv_download(FILENAME ${ade_filename}
              HASH ${ade_md5}
              URL


COMP: Proper dependencies for Documentation target

now depends on all SimpleITK libraries

--- Utilities/Doxygen/Doxygen.cmake
+++ Utilities/Doxygen/Doxygen.cmake
@@ -17,6 +17,7 @@
   add_custom_target(Documentation ALL
     COMMAND ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
     MAIN_DEPENDENCY ${PROJECT_BINARY_DIR}/Utilities/Doxygen/doxygen.config
+    DEPENDS SimpleITKCommon SimpleITKBasicFilters SimpleITKIO
     WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Utilities/Doxygen
     )


py/mkrules.cmake: Add MICROPY_QSTRDEFS_PORT to qstr build process.

This allows a port to specify a custom qstrdefsport.h file, the same as the
QSTR_DEFS variable in a Makefile.

Signed-off-by: Damien George <99e6b749acbfbe2a596df99e91d24d6e1fdbee00@micropython.org>

--- py/mkrules.cmake
+++ py/mkrules.cmake
@@ -95,8 +95,10 @@

 add_custom_command(
     OUTPUT ${MICROPY_QSTRDEFS_PREPROCESSED}
-    COMMAND cat ${MICROPY_QSTRDEFS_PY} ${MICROPY_QSTRDEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTRDEFS_PREPROCESSED}
-    DEPENDS ${MICROPY_QSTRDEFS_COLLECTED}
+    COMMAND cat ${MICROPY_QSTRDEFS_PY} ${MICROPY_QSTRDEFS_PORT} ${MICROPY_QSTRDEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTRDEFS_PREPROCESSED}
+    DEPENDS ${MICROPY_QSTRDEFS_PY}
+        ${MICROPY_QSTRDEFS_PORT}
+        ${MICROPY_QSTRDEFS_COLLECTED}
     VERBATIM
     COMMAND_EXPAND_LISTS
 )


py/mkrules.cmake: Rename QSTR_DEFS variables to QSTRDEFS.

And also MICROPY_PY_QSTRDEFS to MICROPY_QSTRDEFS_PY.  These variables are
all related.

Signed-off-by: Damien George <99e6b749acbfbe2a596df99e91d24d6e1fdbee00@micropython.org>

--- py/mkrules.cmake
+++ py/mkrules.cmake
@@ -1,14 +1,14 @@
 # CMake fragment for MicroPython rules

-set(MICROPY_PY_QSTRDEFS "${MICROPY_PY_DIR}/qstrdefs.h")
 set(MICROPY_GENHDR_DIR "${CMAKE_BINARY_DIR}/genhdr")
 set(MICROPY_MPVERSION "${MICROPY_GENHDR_DIR}/mpversion.h")
 set(MICROPY_MODULEDEFS "${MICROPY_GENHDR_DIR}/moduledefs.h")
-set(MICROPY_QSTR_DEFS_LAST "${MICROPY_GENHDR_DIR}/qstr.i.last")
-set(MICROPY_QSTR_DEFS_SPLIT "${MICROPY_GENHDR_DIR}/qstr.split")
-set(MICROPY_QSTR_DEFS_COLLECTED "${MICROPY_GENHDR_DIR}/qstrdefs.collected.h")
-set(MICROPY_QSTR_DEFS_PREPROCESSED "${MICROPY_GENHDR_DIR}/qstrdefs.preprocessed.h")
-set(MICROPY_QSTR_DEFS_GENERATED "${MICROPY_GENHDR_DIR}/qstrdefs.generated.h")
+set(MICROPY_QSTRDEFS_PY "${MICROPY_PY_DIR}/qstrdefs.h")
+set(MICROPY_QSTRDEFS_LAST "${MICROPY_GENHDR_DIR}/qstr.i.last")
+set(MICROPY_QSTRDEFS_SPLIT "${MICROPY_GENHDR_DIR}/qstr.split")
+set(MICROPY_QSTRDEFS_COLLECTED "${MICROPY_GENHDR_DIR}/qstrdefs.collected.h")
+set(MICROPY_QSTRDEFS_PREPROCESSED "${MICROPY_GENHDR_DIR}/qstrdefs.preprocessed.h")
+set(MICROPY_QSTRDEFS_GENERATED "${MICROPY_GENHDR_DIR}/qstrdefs.generated.h")

 # Provide defaults for preprocessor flags if not already defined
 if(NOT MICROPY_CPP_FLAGS)
@@ -33,7 +33,7 @@

 target_sources(${MICROPY_TARGET} PRIVATE
     ${MICROPY_MPVERSION}
-    ${MICROPY_QSTR_DEFS_GENERATED}
+    ${MICROPY_QSTRDEFS_GENERATED}
 )

 # Command to force the build of another command
@@ -68,7 +68,7 @@
 # It only needs to be passed the list of MICROPY_SOURCE_QSTR files that have changed since
 # it was last run, but it looks like it's not possible to specify that with cmake.
 add_custom_command(
-    OUTPUT ${MICROPY_QSTR_DEFS_LAST}
+    OUTPUT ${MICROPY_QSTRDEFS_LAST}
     COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py pp ${CMAKE_C_COMPILER} -E output ${MICROPY_GENHDR_DIR}/qstr.i.last cflags ${MICROPY_CPP_FLAGS} -DNO_QSTR sources ${MICROPY_SOURCE_QSTR}
     DEPENDS ${MICROPY_MODULEDEFS}
         ${MICROPY_SOURCE_QSTR}
@@ -77,34 +77,34 @@
 )

 add_custom_command(
-    OUTPUT ${MICROPY_QSTR_DEFS_SPLIT}
+    OUTPUT ${MICROPY_QSTRDEFS_SPLIT}
     COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py split qstr ${MICROPY_GENHDR_DIR}/qstr.i.last ${MICROPY_GENHDR_DIR}/qstr _
-    COMMAND touch ${MICROPY_QSTR_DEFS_SPLIT}
-    DEPENDS ${MICROPY_QSTR_DEFS_LAST}
+    COMMAND touch ${MICROPY_QSTRDEFS_SPLIT}
+    DEPENDS ${MICROPY_QSTRDEFS_LAST}
     VERBATIM
     COMMAND_EXPAND_LISTS
 )

 add_custom_command(
-    OUTPUT ${MICROPY_QSTR_DEFS_COLLECTED}
-    COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat qstr _ ${MICROPY_GENHDR_DIR}/qstr ${MICROPY_QSTR_DEFS_COLLECTED}
-    DEPENDS ${MICROPY_QSTR_DEFS_SPLIT}
+    OUTPUT ${MICROPY_QSTRDEFS_COLLECTED}
+    COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdefs.py cat qstr _ ${MICROPY_GENHDR_DIR}/qstr ${MICROPY_QSTRDEFS_COLLECTED}
+    DEPENDS ${MICROPY_QSTRDEFS_SPLIT}
     VERBATIM
     COMMAND_EXPAND_LISTS
 )

 add_custom_command(
-    OUTPUT ${MICROPY_QSTR_DEFS_PREPROCESSED}
-    COMMAND cat ${MICROPY_PY_QSTRDEFS} ${MICROPY_QSTR_DEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTR_DEFS_PREPROCESSED}
-    DEPENDS ${MICROPY_QSTR_DEFS_COLLECTED}
+    OUTPUT ${MICROPY_QSTRDEFS_PREPROCESSED}
+    COMMAND cat ${MICROPY_QSTRDEFS_PY} ${MICROPY_QSTRDEFS_COLLECTED} | sed "s/^Q(.*)/\"&\"/" | ${CMAKE_C_COMPILER} -E ${MICROPY_CPP_FLAGS} - | sed "s/^\\\"\\(Q(.*)\\)\\\"/\\1/" > ${MICROPY_QSTRDEFS_PREPROCESSED}
+    DEPENDS ${MICROPY_QSTRDEFS_COLLECTED}
     VERBATIM
     COMMAND_EXPAND_LISTS
 )

 add_custom_command(
-    OUTPUT ${MICROPY_QSTR_DEFS_GENERATED}
-    COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdata.py ${MICROPY_QSTR_DEFS_PREPROCESSED} > ${MICROPY_QSTR_DEFS_GENERATED}
-    DEPENDS ${MICROPY_QSTR_DEFS_PREPROCESSED}
+    OUTPUT ${MICROPY_QSTRDEFS_GENERATED}
+    COMMAND ${Python3_EXECUTABLE} ${MICROPY_PY_DIR}/makeqstrdata.py ${MICROPY_QSTRDEFS_PREPROCESSED} > ${MICROPY_QSTRDEFS_GENERATED}
+    DEPENDS ${MICROPY_QSTRDEFS_PREPROCESSED}
     VERBATIM
     COMMAND_EXPAND_LISTS
 )
@@ -127,7 +127,7 @@
         OUTPUT ${MICROPY_FROZEN_CONTENT}
         COMMAND ${Python3_EXECUTABLE} ${MICROPY_DIR}/tools/makemanifest.py -o ${MICROPY_FROZEN_CONTENT} -v "MPY_DIR=${MICROPY_DIR}" -v "PORT_DIR=${MICROPY_PORT_DIR}" -b "${CMAKE_BINARY_DIR}" -f${MICROPY_CROSS_FLAGS} ${MICROPY_FROZEN_MANIFEST}
         DEPENDS MICROPY_FORCE_BUILD
-            ${MICROPY_QSTR_DEFS_GENERATED}
+            ${MICROPY_QSTRDEFS_GENERATED}
         VERBATIM
     )
 endif()


ENH (#3463): added overlay-related classes to files.cmake

--- CoreUI/Qmitk/files.cmake
+++ CoreUI/Qmitk/files.cmake
@@ -14,6 +14,8 @@
 QmitkMemoryUsageIndicatorView.cpp
 QmitkNodeDescriptor.cpp
 QmitkNodeDescriptorManager.cpp
+QmitkOverlay.cpp
+QmitkOverlayController.cpp
 QmitkRenderWindowMenu.cpp
 QmitkPropertiesTableEditor.cpp
 QmitkPropertiesTableModel.cpp
@@ -24,6 +26,7 @@
 QmitkRenderWindow.cpp
 QmitkSliderLevelWindowWidget.cpp
 QmitkStdMultiWidget.cpp
+QmitkTextOverlay.cpp
 )

 SET(MOC_H_FILES
@@ -37,6 +40,8 @@
 QmitkMemoryUsageIndicatorView.h
 QmitkNodeDescriptor.h
 QmitkNodeDescriptorManager.h
+QmitkOverlay.h
+QmitkOverlayController.h
 QmitkRenderWindowMenu.h
 QmitkPropertiesTableEditor.h
 QmitkPropertyDelegate.h
@@ -44,6 +49,7 @@
 QmitkRenderWindow.h
 QmitkSliderLevelWindowWidget.h
 QmitkStdMultiWidget.h
+QmitkTextOverlay.h
 )
 SET(UI_FILES
 QmitkLevelWindowPresetDefinition.ui


CMake: update llvm-config search pattern

Ubuntu doesn't seem to use X.Y since 6.0, only llvm-config-X.
Macports and BSD still use their previous patterns, AFAICT.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -36,11 +36,12 @@
 else()
   # search for any version
   find_program(LLVM_CONFIG
-    NAMES "llvm-config"
-      "llvm-config-mp-9.0" "llvm-config-9.0" "llvm-config90"
-      "llvm-config-mp-8.0" "llvm-config-8.0" "llvm-config80"
-      "llvm-config-mp-7.0" "llvm-config-7.0" "llvm-config70"
+    NAMES
+      "llvm-config-mp-9.0" "llvm-config-9" "llvm-config90"
+      "llvm-config-mp-8.0" "llvm-config-8" "llvm-config80"
+      "llvm-config-mp-7.0" "llvm-config-7" "llvm-config70"
       "llvm-config-mp-6.0" "llvm-config-6.0" "llvm-config60"
+      "llvm-config"
     DOC "llvm-config executable")
 endif()


add CHANGLOG

add CHANGLOG

--- cmake/Sign.cmake
+++ cmake/Sign.cmake
@@ -20,6 +20,7 @@
     COMMAND rclone copy ${SIGNATURE_EXE} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
     COMMAND rclone copy ${SIGNATURE_SIG} ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
     COMMAND rclone copy ${CMAKE_BINARY_DIR}/VERSION ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
+    COMMAND rclone copy ${CMAKE_CURRENT_SOURCE_DIR}/CHANGELOG ${REPO_UPLOAD_CLOUD}:${VERSION_SHORT}
   )
 else()
   add_custom_target(siggen echo no ~/server.key found)


Added cmake paths so the Qt modules will be found.

--- cmake/deps.cmake
+++ cmake/deps.cmake
@@ -1,4 +1,13 @@
 # Qt 5
+if (NOT WIN32)
+  # Added some paths to help find the modules on some systems.
+  set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}
+    "/usr/local/opt"
+    "/usr/local/opt/qt5"
+    "/usr/local/Qt-5.3.1"
+    "/usr/local/Qt-5.3.2")
+endif()
+
 set(CMAKE_AUTOMOC ON) # Moc when necessary.

 # As moc files are generated in the binary dir, tell CMake to always


Add NDK release detection into CMake toolchain

--- android/android.toolchain.cmake
+++ android/android.toolchain.cmake
@@ -191,6 +191,8 @@
 #     [+] added CCache support (via NDK_CCACHE environment or cmake variable)
 #     [+] added gold linker support for NDK r8b
 #     [~] fixed mips linker flags for NDK r8b
+#   - modified September 2012
+#     [+] added NDK release name detection (see ANDROID_NDK_RELEASE)
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -426,6 +428,7 @@
  endif()
  set( ANDROID_NDK "${ANDROID_NDK}" CACHE INTERNAL "Path of the Android NDK" FORCE )
  set( BUILD_WITH_ANDROID_NDK True )
+ file( STRINGS "${ANDROID_NDK}/RELEASE.TXT" ANDROID_NDK_RELEASE LIMIT_COUNT 1 REGEX r[0-9]+[a-z]? )
 elseif( ANDROID_STANDALONE_TOOLCHAIN )
  get_filename_component( ANDROID_STANDALONE_TOOLCHAIN "${ANDROID_STANDALONE_TOOLCHAIN}" ABSOLUTE )
  # try to detect change
@@ -939,8 +942,9 @@
  set( ANDROID_LINKER_FLAGS "-Wl,--no-undefined ${ANDROID_LINKER_FLAGS}" )
 endif()

-if (ANDROID_NDK MATCHES "-r[56].?$")
- # libGLESv2.so in NDK's prior to r7 refers to exteranal symbols. So this flag option is required for all projects using OpenGL from native.
+if (ANDROID_NDK_RELEASE STRLESS "r7")
+ # libGLESv2.so in NDK's prior to r7 refers to missing exteranal symbols.
+ # So this flag option is required for all projects using OpenGL from native.
  __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES ON )
 else()
  __INIT_VARIABLE( ANDROID_SO_UNDEFINED VALUES OFF )
@@ -994,7 +998,7 @@
 set( ANDROID_LINKER_FLAGS "${ANDROID_LINKER_FLAGS}" CACHE INTERNAL "Extra Android linker flags" )
 set( CMAKE_CXX_FLAGS           "${ANDROID_CXX_FLAGS} ${CMAKE_CXX_FLAGS}" )
 set( CMAKE_C_FLAGS             "${ANDROID_CXX_FLAGS} ${CMAKE_C_FLAGS}" )
-if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK MATCHES "-r8$" )
+if( MIPS AND BUILD_WITH_ANDROID_NDK AND ANDROID_NDK_RELEASE STREQUAL "r8" )
  set( CMAKE_SHARED_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS}" )
  set( CMAKE_MODULE_LINKER_FLAGS "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.xsc ${ANDROID_LINKER_FLAGS} ${CMAKE_MODULE_LINKER_FLAGS}" )
  set( CMAKE_EXE_LINKER_FLAGS    "-Wl,-T,${ANDROID_NDK}/toolchains/${ANDROID_TOOLCHAIN_NAME}/mipself.x ${ANDROID_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}" )
@@ -1144,6 +1148,7 @@
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
 #   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
+#   ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b; set only for NDK
 #   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   ANDROID_SYSTEM_INCLUDE_DIRS


[BUILD] moved platform to top and exit with warning if unknown platform is detected

--- util/cmake/SeqAnCtdSetup.cmake
+++ util/cmake/SeqAnCtdSetup.cmake
@@ -53,6 +53,18 @@
   return ()
 endif ()

+# Create the payload binary ZIP file.
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+  set (SEQAN_PLATFORM "lnx")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+  set (SEQAN_PLATFORM "win")
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+  set (SEQAN_PLATFORM "mac")
+else ()
+  message (STATUS "Unsupported platform ${CMAKE_SYSTEM_NAME}, disabling CTD support.")
+  return()
+endif ()
+
 # ============================================================================
 # Variable Setup
 # ============================================================================
@@ -122,7 +134,7 @@
   list (APPEND TMP_PAYLOAD_FILES "${PAYLOAD_TMP_BIN_PATH}/${_BINARY}")
   add_custom_command (OUTPUT ${PAYLOAD_TMP_BIN_PATH}/${_BINARY}
                       COMMAND ${CMAKE_COMMAND} -E copy "${_BINARY_PATH}" "${PAYLOAD_TMP_BIN_PATH}/${_BINARY}"
-                      DEPENDS ${_TARGET}
+                      DEPENDS ${_TARGET}
                               ${PAYLOAD_TMP_BIN_PATH})
 endforeach ()

@@ -130,17 +142,6 @@
 add_custom_command (OUTPUT "${PAYLOAD_TMP_PATH}/binaries.ini"
                     COMMAND ${CMAKE_COMMAND} -E touch ${PAYLOAD_TMP_PATH}/binaries.ini
                     DEPENDS ${PAYLOAD_TMP_PATH})
-
-# Create the payload binary ZIP file.
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
-  set (SEQAN_PLATFORM "lnx")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
-  set (SEQAN_PLATFORM "win")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-  set (SEQAN_PLATFORM "mac")
-else ()
-  message (FATAL_ERROR "Unknown platform name ${SEQAN_PLATFORM}")
-endif ()

 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
   set (SEQAN_SYSTEM_WORDSIZE "64")
@@ -239,4 +240,3 @@
                            ${ICON_FILES}
                            ${WORKFLOW_PLUGIN_DIR}/plugin.properties
                            ${_ZIP_PATH}/${_ZIP_NAME})
-


[new] allow configuration of MPI np and machine options

--- testing/run_tests.sh.cmake
+++ testing/run_tests.sh.cmake
@@ -37,7 +37,9 @@
 FAILED_TESTS=""

 PHYSISC=${CMAKE_BINARY_DIR}/translator/physisc
-MPIRUN="MPIRUN_UNSET"
+MPIRUN=mpirun
+MPI_NP="1" # use only 1 process by default; can be controlled by the -np option
+MPI_MACHINEFILE=""

 function print_error()
 {
@@ -304,11 +306,25 @@
     return 0
 }

+function do_mpirun()
+{
+    local np=$1
+    shift
+    local mfile=$1
+    shift
+    local mfile_option="-machinefile $mfile"
+    if [ "x$mfile" = "x" ]; then
+	mfile_option=""
+    fi
+    echo "[EXECUTE] Run mpi as \"$MPIRUN -np $np $mfile_option $*\"" >&2
+    $MPIRUN -np $np $mfile_option $*
+}
+
 function execute()
 {
     local target=$2
     local exename=$(basename $1 .c).$target.exe
-    echo "[EXECUTE] Executing $exename"
+    echo  "[EXECUTE] Executing $exename"
     case $target in
 	ref)
 	    ./$exename > $exename.out
@@ -317,10 +333,10 @@
 	    ./$exename > $exename.out
 	    ;;
 	mpi)
-	    $MPIRUN ./$exename > $exename.out
+	    do_mpirun $3 "$MPI_MACHINEFILE" ./$exename > $exename.out
 	    ;;
 	mpi-cuda)
-	    $MPIRUN ./$exename > $exename.out
+	    do_mpirun $3 "$MPI_MACHINEFILE" ./$exename > $exename.out
 	    ;;
 	*)
 	    exit_error "Unsupported target: $2"
@@ -359,7 +375,11 @@
     echo -e "\t--execute"
     echo -e "\t\tTest only execution and its dependent tasks."
     echo -e "\t-m, --mpirun"
-    echo -e "\t\tThe mpirun command for testing MPI-based runs. Include necessary options like -np within a quoted string."
+    echo -e "\t\tThe mpirun command for testing MPI-based runs."
+    echo -e "\t--np"
+    echo -e "\t\tThe number of MPI processes."
+    echo -e "\t--machinefile"
+    echo -e "\t\tThe MPI machinefile."
 }

 {
@@ -372,7 +392,7 @@
     set +e
     TESTS=$(for t in $TESTS; do echo $t | grep -v 'test_.*\.manual\.'; done)
     set -e
-    TEMP=$(getopt -o ht:s:m: --long help,targets:,source:,translate,compile,execute,mpirun -- "$@")
+    TEMP=$(getopt -o ht:s:m: --long help,targets:,source:,translate,compile,execute,mpirun,machinefile:,np: -- "$@")
     if [ $? != 0 ]; then
 	print_error "Invalid options: $@"
 	print_usage
@@ -413,6 +433,15 @@
 		;;
 	    -m|--mpi-run)
 		MPIRUN=$2
+		shift 2
+		;;
+	    --np)
+		MPI_NP=$2
+		shift 2
+		;;
+	    --machinefile)
+		MPI_MACHINEFILE=$2
+		echo $MPI_MACHINEFILE
 		shift 2
 		;;
 	    -h|--help)
@@ -469,15 +498,21 @@
 		    continue
 		fi
 		if [ "$STAGE" = "COMPILE" ]; then continue; fi
-		if execute $SHORTNAME $TARGET; then
-		    echo "[EXECUTE] SUCCESS"
-		    NUM_SUCCESS_EXECUTE=$(($NUM_SUCCESS_EXECUTE + 1))
-		else
-		    echo "[EXECUTE] FAIL"
-		    NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
-		    fail $SHORTNAME $TARGET execute $CONFIG
-		    continue
+		np_target=1
+		if [ "$TARGET" = "mpi" -o "$TARGET" = "mpi-cuda" ]; then
+		    np_target=$MPI_NP
 		fi
+		for np in $np_target; do
+		    if execute $SHORTNAME $TARGET $np; then
+			echo "[EXECUTE] SUCCESS"
+			NUM_SUCCESS_EXECUTE=$(($NUM_SUCCESS_EXECUTE + 1))
+		    else
+			echo "[EXECUTE] FAIL"
+			NUM_FAIL_EXECUTE=$(($NUM_FAIL_EXECUTE + 1))
+			fail $SHORTNAME $TARGET execute $CONFIG
+			continue
+		    fi
+		done
 	    done
 	done
     done


ClangTidy: Set CMAKE_MODULE_PATH before calling find_package

--- ClangTidy.cmake
+++ ClangTidy.cmake
@@ -9,11 +9,15 @@

 set (CLANG_TIDY_EXIT_STATUS_WRAPPER_LOCATION
      "${CMAKE_CURRENT_LIST_DIR}/util/ClangTidyExitStatusWrapper.cmake")
+set (_CLANG_TIDY_LIST_DIR "${CMAKE_CURRENT_LIST_DIR}")

 macro (clang_tidy_validate CONTINUE)

     if (NOT DEFINED CLANG_TIDY_FOUND)

+        set (CMAKE_MODULE_PATH
+             ${CMAKE_MODULE_PATH} # NOLINT:correctness/quotes
+             "${_CLANG_TIDY_LIST_DIR}")
         find_package (CLANGTIDY ${ARGN})

     endif ()


build/cmake/DefineOptions.cmake: Fixed the logic of BUILD_SHARED_LIBS

--- build/cmake/DefineOptions.cmake
+++ build/cmake/DefineOptions.cmake
@@ -132,7 +132,12 @@
 # Common library options
 # https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html
 # Default on Windows is static, shared mode library support needs work...
-CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" OFF "WIN32" ON)
+if(WIN32)
+    set(DEFAULT_BUILD_SHARED_LIBS ON)
+else()
+    set(DEFAULT_BUILD_SHARED_LIBS OFF)
+endif()
+option(BUILD_SHARED_LIBS "Build shared libraries" ${DEFAULT_BUILD_SHARED_LIBS})

 if (WITH_SHARED_LIB)
     message(WARNING "WITH_SHARED_LIB is deprecated; use -DBUILD_SHARED_LIBS=ON instead")


[CDRIVER-2396] Set default values for mongoc-config.h. Simplify if checking and setting default values for mongoc-config.h

--- build/cmake/FindResSearch.cmake
+++ build/cmake/FindResSearch.cmake
@@ -1,14 +1,15 @@
 include(CheckSymbolExists)

+set (MONGOC_HAVE_DNSAPI 0)
+set (MONGOC_HAVE_RES_NSEARCH 0)
+set (MONGOC_HAVE_RES_NDESTROY 0)
+set (MONGOC_HAVE_RES_NCLOSE 0)
+set (MONGOC_HAVE_RES_SEARCH 0)
+
 if (ENABLE_SRV STREQUAL ON OR ENABLE_SRV STREQUAL AUTO)
-include(CheckSymbolExists)
    if (WIN32)
       set (RESOLV_LIBS Dnsapi)
       set (MONGOC_HAVE_DNSAPI 1)
-      set (MONGOC_HAVE_RES_NSEARCH 0)
-      set (MONGOC_HAVE_RES_NDESTROY 0)
-      set (MONGOC_HAVE_RES_NCLOSE 0)
-      set (MONGOC_HAVE_RES_SEARCH 0)
    else ()
       set (MONGOC_HAVE_DNSAPI 0)
       # Thread-safe DNS query function for _mongoc_client_get_srv.
@@ -16,30 +17,17 @@
       check_symbol_exists (res_nsearch resolv.h MONGOC_HAVE_RES_NSEARCH)
       if (MONGOC_HAVE_RES_NSEARCH)
          set (RESOLV_LIBS resolv)
-         set (MONGOC_HAVE_RES_SEARCH 0)

          # We have res_nsearch. Call res_ndestroy (BSD/Mac) or res_nclose (Linux)?
          check_symbol_exists (res_ndestroy resolv.h MONGOC_HAVE_RES_NDESTROY)
-         if (MONGOC_HAVE_RES_NDESTROY)
-            set (MONGOC_HAVE_RES_NCLOSE 0)
-         else ()
-            set (MONGOC_HAVE_RES_NDESTROY 0)
+         if (NOT MONGOC_HAVE_RES_NDESTROY)
             check_symbol_exists (res_nclose resolv.h MONGOC_HAVE_RES_NCLOSE)
-            if (NOT MONGOC_HAVE_RES_NCLOSE)
-               set (MONGOC_HAVE_RES_NCLOSE 0)
-            endif ()
          endif ()
       else ()
-         set (MONGOC_HAVE_RES_NSEARCH 0)
-         set (MONGOC_HAVE_RES_NDESTROY 0)
-         set (MONGOC_HAVE_RES_NCLOSE 0)
-
          # Thread-unsafe function.
          check_symbol_exists (res_search resolv.h MONGOC_HAVE_RES_SEARCH)
          if (MONGOC_HAVE_RES_SEARCH)
             set (RESOLV_LIBS resolv)
-         else ()
-            set (MONGOC_HAVE_RES_SEARCH 0)
          endif()
       endif ()
    endif ()


Adapt to GNU install dir locations

Adapt to GNU install dir locations

The ParaView build just installs to lib64 now, we will need to look at
the package but this should hopefully get things building again on
Linux.

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

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -2,26 +2,16 @@
 include(CPack)

 # install all ParaView's shared libraries.
-install(DIRECTORY "${install_location}/lib/paraview"
+install(DIRECTORY "${install_location}/lib64"
   DESTINATION "lib"
   USE_SOURCE_PERMISSIONS
   COMPONENT superbuild)

-install(DIRECTORY "${install_location}/lib/python3.6"
-  DESTINATION "lib"
-  USE_SOURCE_PERMISSIONS
-  COMPONENT superbuild)
 install(DIRECTORY "${install_location}/include/python3.6m"
   DESTINATION "include"
   USE_SOURCE_PERMISSIONS
   COMPONENT superbuild
   PATTERN "pyconfig.h")
-
-# install tomviz's python modules
-install(DIRECTORY "${install_location}/lib/tomviz"
-  DESTINATION "lib"
-  USE_SOURCE_PERMISSIONS
-  COMPONENT superbuild)

 install(DIRECTORY "${install_location}/share/tomviz"
   DESTINATION "share"


Clean up FindLibV4L2.cmake:

Clean up FindLibV4L2.cmake:

 * Explain what each defined variable means
 * Actually make use of FIND_PACKAGE_HANDLE_STANDARD_ARGUMENTS and
   consequently get rid of a lot of duplicate code.
 * Use MARK_AS_ADVANCED for the include and library variables.

CCMAIL: kde-buildsystem@kde.org

svn path=/trunk/KDE/kdenetwork/kopete/; revision=1083071

--- cmake/modules/FindLibV4L2.cmake
+++ cmake/modules/FindLibV4L2.cmake
@@ -1,32 +1,26 @@
-# cmake macro to test LibV4L2
-
+# cmake macro to find LibV4L2
+#
 # Copyright (c) 2009, Jaroslav Reznik <jreznik@redhat.com>
 #
-# LIBV4L2_FOUND
-# LIBV4L2_INCLUDE_DIR
-# LIBV4L2_LIBRARY
+# Once done this will define:
+#
+#  LIBV4L2_FOUND - System has LibV4L2
+#  LIBV4L2_INCLUDE_DIR - The LibV4L2 include directory
+#  LIBV4L2_LIBRARY - The libraries needed to use LibV4L2
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-INCLUDE (FindPackageHandleStandardArgs)

 IF (LIBV4L2_INCLUDE_DIR AND LIBV4L2_LIBRARY)
     # Already in cache, be silent
     SET (LIBV4L2_FIND_QUIETLY TRUE)
 ENDIF (LIBV4L2_INCLUDE_DIR AND LIBV4L2_LIBRARY)

-IF (NOT LIBV4L2_FOUND)
-  FIND_PATH (LIBV4L2_INCLUDE_DIR libv4l2.h)
-  FIND_LIBRARY (LIBV4L2_LIBRARY NAMES v4l2)
+FIND_PATH (LIBV4L2_INCLUDE_DIR libv4l2.h)

-  IF (LIBV4L2_INCLUDE_DIR AND LIBV4L2_LIBRARY)
-    SET (LIBV4L2_FOUND TRUE)
-  ENDIF( LIBV4L2_INCLUDE_DIR AND LIBV4L2_LIBRARY )
-ENDIF ( NOT LIBV4L2_FOUND)
+FIND_LIBRARY (LIBV4L2_LIBRARY v4l2)

-IF( LIBV4L2_FOUND )
-  IF( NOT LIBV4L2_FIND_QUIETLY )
-    MESSAGE( STATUS "Found LIBV4L2: ${LIBV4L2_LIBRARY}")
-  ENDIF( NOT LIBV4L2_FIND_QUIETLY )
-ENDIF( LIBV4L2_FOUND )
+INCLUDE (FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (LibV4L2 DEFAULT_MSG LIBV4L2_INCLUDE_DIR LIBV4L2_LIBRARY)
+
+MARK_AS_ADVANCED(LIBV4L2_INCLUDE_DIR LIBV4L2_LIBRARY)


Updating GitExternal used by Buildyard

Updating GitExternal used by Buildyard

--- cmake/modules/GitExternal.cmake
+++ cmake/modules/GitExternal.cmake
@@ -1,5 +1,14 @@
 # configures an external git repository
-# Usage: git_external(<directory> <giturl> <gittag> [RESET <files>])
+# Usage:
+#  * Automatically reads, parses and updates a .gitexternals file if it only
+#    contains lines in the form "# <directory> <giturl> <gittag>".
+#    This function parses the file for this pattern and then calls
+#    git_external on each found entry. Additionally it provides an
+#    update target to bump the tag to the master revision by
+#    recreating .gitexternals.
+#  * Provides function
+#    git_external(<directory> <giturl> <gittag> [RESET <files>])
+#  git_external_manage(<file>)

 find_package(Git)
 if(NOT GIT_EXECUTABLE)
@@ -10,9 +19,11 @@

 function(GIT_EXTERNAL DIR REPO TAG)
   cmake_parse_arguments(GIT_EXTERNAL "" "" "RESET" ${ARGN})
+  get_filename_component(DIR "${DIR}" ABSOLUTE)
   get_filename_component(GIT_EXTERNAL_DIR "${DIR}/.." ABSOLUTE)

   if(NOT EXISTS "${DIR}")
+    message(STATUS "git clone ${REPO} ${DIR}")
     execute_process(
       COMMAND "${GIT_EXECUTABLE}" clone "${REPO}" "${DIR}"
       RESULT_VARIABLE nok ERROR_VARIABLE error
@@ -34,11 +45,11 @@
         WORKING_DIRECTORY "${DIR}")
     endforeach()

-    execute_process(COMMAND "${GIT_EXECUTABLE}" pull
+    execute_process(COMMAND "${GIT_EXECUTABLE}" fetch --all -q
       RESULT_VARIABLE nok ERROR_VARIABLE error
       WORKING_DIRECTORY "${DIR}")
     if(nok)
-      message(WARNING "Update of ${DIR} failed: ${error}\n")
+      message(STATUS "Update of ${DIR} failed:\n   ${error}")
     endif()

     execute_process(
@@ -47,7 +58,88 @@
       WORKING_DIRECTORY "${DIR}"
       )
     if(nok)
-      message(FATAL_ERROR "${DIR} git checkout ${TAG} failed: ${error}\n")
+      message(STATUS "${DIR} git checkout ${TAG} failed: ${error}\n")
     endif()
   endif()
 endfunction()
+
+set(GIT_EXTERNALS ${GIT_EXTERNALS_FILE})
+if(NOT GIT_EXTERNALS)
+  set(GIT_EXTERNALS "${CMAKE_CURRENT_SOURCE_DIR}/.gitexternals")
+endif()
+
+if(EXISTS ${GIT_EXTERNALS})
+  file(READ ${GIT_EXTERNALS} GIT_EXTERNAL_FILE)
+  string(REGEX REPLACE "\n" ";" GIT_EXTERNAL_FILE "${GIT_EXTERNAL_FILE}")
+  foreach(LINE ${GIT_EXTERNAL_FILE})
+    if(NOT LINE MATCHES "^#.*$")
+      message(FATAL_ERROR "${GIT_EXTERNALS} contains non-comment line: ${LINE}")
+    endif()
+    string(REGEX REPLACE "^#[ ]*(.+[ ]+.+[ ]+.+)$" "\\1" DATA ${LINE})
+    if(NOT LINE STREQUAL DATA)
+      string(REGEX REPLACE "[ ]+" ";" DATA "${DATA}")
+      list(LENGTH DATA DATA_LENGTH)
+      if(DATA_LENGTH EQUAL 3)
+        list(GET DATA 0 DIR)
+        list(GET DATA 1 REPO)
+        list(GET DATA 2 TAG)
+
+        # Create a unique, flat name
+        string(REPLACE "/" "_" GIT_EXTERNAL_NAME ${DIR})
+
+        if(NOT TARGET update_git_external_${GIT_EXTERNAL_NAME}) # not done
+          # pull in identified external
+          git_external(${DIR} ${REPO} ${TAG})
+
+          # Create update script and target to bump external spec
+          if(NOT TARGET update)
+            add_custom_target(update)
+          endif()
+          if(NOT TARGET update_git_external)
+            add_custom_target(update_git_external)
+            add_dependencies(update update_git_external)
+          endif()
+
+          # Create a unique, flat name
+          file(RELATIVE_PATH GIT_EXTERNALS_BASE ${CMAKE_SOURCE_DIR}
+            ${GIT_EXTERNALS})
+          string(REPLACE "/" "_" GIT_EXTERNAL_TARGET ${GIT_EXTERNALS_BASE})
+
+          set(GIT_EXTERNAL_TARGET update_git_external_${GIT_EXTERNAL_TARGET})
+          if(NOT TARGET ${GIT_EXTERNAL_TARGET})
+            set(GIT_EXTERNAL_SCRIPT
+              "${CMAKE_CURRENT_BINARY_DIR}/${GIT_EXTERNAL_TARGET}.cmake")
+            file(WRITE "${GIT_EXTERNAL_SCRIPT}"
+              "file(WRITE ${GIT_EXTERNALS} \"# -*- mode: cmake -*-\n\")\n")
+            add_custom_target(${GIT_EXTERNAL_TARGET}
+              COMMAND ${CMAKE_COMMAND} -P ${GIT_EXTERNAL_SCRIPT}
+              COMMENT "Recreate ${GIT_EXTERNALS_BASE}"
+              WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+          endif()
+
+          set(GIT_EXTERNAL_SCRIPT
+            "${CMAKE_CURRENT_BINARY_DIR}/gitupdate${GIT_EXTERNAL_NAME}.cmake")
+          file(WRITE "${GIT_EXTERNAL_SCRIPT}" "
+execute_process(COMMAND ${GIT_EXECUTABLE} fetch --all -q
+  WORKING_DIRECTORY ${DIR})
+execute_process(
+  COMMAND ${GIT_EXECUTABLE} show-ref --hash=7 refs/remotes/origin/master
+  OUTPUT_VARIABLE newref WORKING_DIRECTORY ${DIR})
+if(newref)
+  file(APPEND ${GIT_EXTERNALS} \"# ${DIR} ${REPO} \${newref}\")
+else()
+  file(APPEND ${GIT_EXTERNALS} \"# ${DIR} ${REPO} ${TAG}\n\")
+endif()")
+          add_custom_target(update_git_external_${GIT_EXTERNAL_NAME}
+            COMMAND ${CMAKE_COMMAND} -P ${GIT_EXTERNAL_SCRIPT}
+            COMMENT "Update ${REPO} in ${GIT_EXTERNALS_BASE}"
+            DEPENDS ${GIT_EXTERNAL_TARGET}
+            WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}")
+          add_dependencies(update_git_external
+            update_git_external_${GIT_EXTERNAL_NAME})
+        endif()
+      endif()
+    endif()
+  endforeach()
+  include(${GIT_EXTERNALS})
+endif()


cmake: Improve documentation of tpqt4's functions/macros

--- cmake/modules/TpQt4Macros.cmake
+++ cmake/modules/TpQt4Macros.cmake
@@ -29,36 +29,44 @@
 #          or examples. Please remember the list of the header files passed to this function MUST be added to the
 #          target's sources.
 #
-# function TPQT4_CLIENT_GENERATOR(spec group pretty_include namespace main_iface)
-#          This function takes care of invoking qt4-client-gen.py with the correct arguments. Please refer to
-#          qt4-client-gen.py's documentation for more information on using this tool.
-#
-# function TPQT4_FUTURE_CLIENT_GENERATOR(spec namespace main_iface)
+# function TPQT4_CLIENT_GENERATOR(spec group pretty_include namespace [arguments])
+#          This function takes care of invoking qt4-client-gen.py with the correct arguments, which generates
+#          headers out of specs. spec is the name of the spec headers will be generated from, group represents
+#          the spec's group, pretty_include is the name of the capitalized header (for example ClientGenerator),
+#          namespace is the C++ namespace the generated header will belong to. This function also accepts
+#          as an optional last argument a list of additional command line arguments which will be passed to
+#          qt4-client-gen.py upon execution.
+#
+# function TPQT4_FUTURE_CLIENT_GENERATOR(spec namespace [arguments])
 #          Same as tpqt4_client_generator, but for future interfaces
 #
 # function TPQT4_GENERATE_MANAGER_FILE(MANAGER_FILE OUTPUT_FILENAME DEPEND_FILENAME)
-#          This function takes care of invoking manager-file.py with the correct arguments. Please refer to
-#          manager-file.py's documentation for more information on using this tool.
+#          This function takes care of invoking manager-file.py with the correct arguments. The first argument is the
+#          path to the manager-file.py file which should be used, the second is the output filename of the manager,
+#          and the third is the path to the file which depends on the generated manager file.
 #
 # function TPQT4_XINCLUDATOR (INPUT_FILE OUTPUT_FILE [additional_arguments ...] [DEPENDS dependencies ...])
-#          This function takes care of invoking xincludator.py with the correct arguments. Please refer to
-#          xincludator.py's documentation for more information on using this tool. This function also accepts
+#          This function takes care of invoking xincludator.py with the correct arguments. The first argument is
+#          the input spec, the second one is the filename the generated file will be saved to. This function also accepts
 #          as an optional last argument a list of files which has to be present before xincludator is launched.
 #          After issuing DEPENDS in the last argument you can pass a list of files the command will depend on.
 #
 # function TPQT4_CONSTANTS_GEN (SPEC_XML OUTPUT_FILE [additional_arguments ...] [DEPENDS dependencies ...])
-#          This function takes care of invoking qt4-constants-gen.py with the correct arguments. Please refer to
-#          qt4-constants-gen.py's documentation for more information on using this tool. This function also accepts
+#          This function takes care of invoking qt4-constants-gen.py with the correct arguments. The first argument
+#          is the spec file, the second one is the filename the generated file will be saved to. This function also accepts
 #          as an optional last argument a list of additional command line arguments which will be passed to
 #          qt4-constants-gen.py upon execution.
 #          After issuing DEPENDS in the last argument you can pass a list of files the command will depend on.
 #
 # function TPQT4_TYPES_GEN (spec_xml outfile_decl outfile_impl namespace
 #                           realinclude prettyinclude [additional_arguments ...] [DEPENDS dependencies ...])
-#          This function takes care of invoking qt4-types-gen.py with the correct arguments. Please refer to
-#          qt4-types-gen.py's documentation for more information on using this tool. This function also accepts
-#          as an optional last argument a list of additional command line arguments which will be passed to
-#          qt4-constants-gen.py upon execution.
+#          This function takes care of invoking qt4-types-gen.py with the correct arguments. spec_xml
+#          is the spec file, outfile_decl is the filename the header of the generated file will be saved to,
+#          outfile_impl is the filename the implementation of the generated file will be saved to, namespace
+#          is the C++ namespace the generated header will belong to, realinclude is the real include file
+#          you want to use, prettyinclude is the name of the capitalized header (for example ClientGenerator).
+#          This function also accepts as an optional last argument a list of additional command line arguments
+#          which will be passed to qt4-constants-gen.py upon execution.
 #          After issuing DEPENDS in the last argument you can pass a list of files the command will depend on.
 #
 # macro TPQT4_ADD_GENERIC_UNIT_TEST (fancyName name [libraries ...])


Include the X headers and libraries in the Tk headers and libraries.
This change appears to be necessary for the Mac OS X platform.

Improve Tcl/Tk-related messages and option handling.

svn path=/trunk/; revision=7139

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -68,6 +68,8 @@
     )
   endif(TCL_FOUND)
   if(TCL_FOUND AND TCL_TCLSH)
+    message(STATUS "TCL_INCLUDE_PATH = ${TCL_INCLUDE_PATH}")
+    message(STATUS "TCL_LIBRARY = ${TCL_LIBRARY}")
     if(ENABLE_itcl)
       message(STATUS "Looking for itcl.h")
       find_path(ITCL_INCLUDE_PATH itcl.h ${TCL_INCLUDE_PATH})
@@ -95,6 +97,10 @@
         set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
       endif(ITCL_INCLUDE_PATH)
     endif(ENABLE_itcl)
+    if(ENABLE_itcl)
+      message(STATUS "ITCL_INCLUDE_PATH = ${ITCL_INCLUDE_PATH}")
+      message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
+    endif(ENABLE_itcl)
     # ------------------------------------------------------------------------
     # figure out how to build tclIndex
     # ------------------------------------------------------------------------
@@ -104,6 +110,26 @@
     else(ENABLE_itcl)
       set(MKTCLINDEX_ARGS "-tcl")
     endif(ENABLE_itcl)
+    if(ENABLE_tk AND NOT X11_FOUND)
+      message(STATUS "WARNING: X11 not found, disabling Tk interface code")
+      set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
+    endif(ENABLE_tk AND NOT X11_FOUND)
+    if(ENABLE_tk)
+      set(TK_INCLUDE_PATH ${TK_INCLUDE_PATH} ${X11_INCLUDE_DIR})
+      set(
+      TK_LIBRARY
+      ${TK_LIBRARY}
+      -L${X11_LIBRARY_DIR}
+      ${X11_LIBRARIES}
+      )
+      message(STATUS "TK_INCLUDE_PATH = ${TK_INCLUDE_PATH}")
+      message(STATUS "TK_LIBRARY = ${TK_LIBRARY}")
+    else(ENABLE_tk)
+      message(STATUS
+      "WARNING: Because Tk is disabled must disable incr Tk as well"
+      )
+      set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
+    endif(ENABLE_tk)
     if(ENABLE_itk)
       message(STATUS "Looking for itk.h")
       find_path(ITK_INCLUDE_PATH itk.h ${TK_INCLUDE_PATH})
@@ -129,8 +155,12 @@
         set(ENABLE_itk OFF CACHE BOOL "Enable incr Tk interface code" FORCE)
       endif(ITK_INCLUDE_PATH)
     endif(ENABLE_itk)
+    if(ENABLE_itk)
+      message(STATUS "ITK_INCLUDE_PATH = ${ITK_INCLUDE_PATH}")
+      message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
+    endif(ENABLE_itk)
   else(TCL_FOUND AND TCL_TCLSH)
-    message(STATUS "Disabling everything that is Tcl/Tk related")
+    message(STATUS "WARNING: Disabling everything that is Tcl/Tk related")
     set(ENABLE_tcl OFF CACHE BOOL "Enable Tcl bindings" FORCE)
     set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)
     set(ENABLE_tk OFF CACHE BOOL "Enable Tk interface code" FORCE)
@@ -138,7 +168,7 @@
   endif(TCL_FOUND AND TCL_TCLSH)
 else(ENABLE_tcl)
   message(STATUS
-  "ENABLE_tcl is off so disabling everything else that "
+  "ENABLE_tcl is OFF so disabling everything else that "
   "is Tcl/Tk related"
   )
   set(ENABLE_itcl OFF CACHE BOOL "Enable incr Tcl interface code" FORCE)


Update FindASSIMPM.cmake

Update FindASSIMPM.cmake

Fixed copy/paste error of DEBUG vs RELEASE flags.

--- cmake_modules/FindASSIMPM.cmake
+++ cmake_modules/FindASSIMPM.cmake
@@ -34,7 +34,7 @@
 		${ASSIMP_ROOT}/lib
 	)
 	set(ASSIMP_LIBRARIES
-		debug ${ASSIMP_LIBRARIES_RELEASE}
+		debug ${ASSIMP_LIBRARIES_DEBUG}
 		optimized ${ASSIMP_LIBRARIES_RELEASE}
 		)
 endif()
@@ -64,7 +64,7 @@
     )

 	set(ASSIMP_LIBRARIES
-		debug ${ASSIMP_LIBRARIES_RELEASE}
+		debug ${ASSIMP_LIBRARIES_DEBUG}
 		optimized ${ASSIMP_LIBRARIES_RELEASE}
 		)
 endif(ASSIMP_INCLUDE_DIR AND ASSIMP_LIBRARIES)


Additional optional parameter for DECLARE_ZORBA_MODULE macro to pass targets the declared module depends on. Approved: Chris Hillery, Till Westmann, David Graf

--- cmake_modules/ZorbaModule.cmake
+++ cmake_modules/ZorbaModule.cmake
@@ -118,6 +118,9 @@
 #              information; see below
 #       TEST_ONLY - (optional) Module is for testcases only and should not
 #              be installed
+#       LIBRARY_DEPENDS - (optional) List of targets that the external
+#              function library will depend on (only works if the module
+#              contains C++ external functions)
 #
 # CONFIG_FILES - any files specific here will be copied to
 # CMAKE_CURRENT_BINARY_DIR using CONFIGURE_FILE(). They may contain
@@ -136,7 +139,7 @@
 # file enough to deduce the URI and version?
 MACRO (DECLARE_ZORBA_MODULE)
   # Parse and validate arguments
-  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES"
+  PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES;LIBRARY_DEPENDS"
     "URI;FILE;VERSION" "TEST_ONLY" ${ARGN})
   IF (NOT MODULE_FILE)
     MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()")
@@ -268,6 +271,9 @@
     # the module *URI*'s final component.
     SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
     ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
+    IF (MODULE_LIBRARY_DEPENDS)
+      ADD_DEPENDENCIES(${module_lib_target} ${MODULE_LIBRARY_DEPENDS})
+    ENDIF()
     GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
     IF (MODULE_VERSION)
       # If there's a version, insert it into the module library name


Get the location of pnmpi-patch directly.

BG/P CMake is not figuring out that pnmpi-patch is a target correcty.  Now get the location and add the target dependency directly here, rather than relying on the fairly recent automatic behavior of add_custom_command.

--- cmakemodules/PnMPIModules.cmake
+++ cmakemodules/PnMPIModules.cmake
@@ -40,14 +40,18 @@

   # Patch the library in place once it's built so that it can be installed normally,
   # like any other library.  Also keeps build dir libraries consistent with installed libs.
-  get_target_property(lib ${targetname} LOCATION)
+  get_target_property(lib   ${targetname} LOCATION)
+  get_target_property(patch pnmpi-patch   LOCATION)
   set(tmplib ${targetname}-unpatched.so)

   add_custom_command(TARGET ${targetname} POST_BUILD
-    COMMAND mv ${lib} ${tmplib}
-    COMMAND pnmpi-patch ${tmplib} ${lib}
-    COMMAND rm -f ${tmplib}
+    COMMAND mv       ARGS ${lib} ${tmplib}
+    COMMAND ${patch} ARGS ${tmplib} ${lib}
+    COMMAND rm       ARGS -f ${tmplib}
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Patching ${targetname}"
     VERBATIM)
+
+  # Make sure that PnMPI lib and patch tool are built before this module.
+  add_dependencies(${targetname} pnmpi-patch pnmpi)
 endfunction()


[INTERNAL] use -lomp instead of -liomp5 for consistency

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -350,7 +350,7 @@
     set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_OPENMP=1")
     set (SEQAN_CXX_FLAGS        "${SEQAN_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
     if (COMPILER_IS_CLANG)
-        set (SEQAN_LIBRARIES     ${SEQAN_LIBRARIES}          iomp5)
+        set (SEQAN_LIBRARIES     ${SEQAN_LIBRARIES}          omp)
     endif()
   endif ()
 endif ()