Don't use PATH_PREFIXES in FindLASzip

Don't use PATH_PREFIXES in FindLASzip

PATH_PREFIXES was getting confused by a /usr/local/bin/laszip.

Fixes #820

--- cmake/modules/FindLASzip.cmake
+++ cmake/modules/FindLASzip.cmake
@@ -37,8 +37,7 @@

 FIND_PATH(LASZIP_INCLUDE_DIR
-  laszip.hpp
-  PATH_PREFIXES laszip
+  laszip/laszip.hpp
   PATHS
   /usr/include
   /usr/local/include


Build system: Work around linking issue for traditional static build

One minor bug fix to previous fix for this issue.  On some platforms,
e.g., Mac OS X, CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES can contain not
only the usual short CMake-style library names but also the full path
name for a library. So implement an if(EXISTS...) check for this
possibility if find_library cannot find the library based on the
asumption that the CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES element is a
short CMake-style library name.

--- cmake/modules/pkg-config.cmake
+++ cmake/modules/pkg-config.cmake
@@ -76,8 +76,15 @@
 	find_library(library_pathname ${cmake_cxx_implicit_link_library} HINTS ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES})
 	if(library_pathname)
 	  list(APPEND cxx_compiler_library_pathname_list ${library_pathname})
+	elseif(EXISTS ${cmake_cxx_implicit_link_library})
+	  # Sometimes ${cmake_cxx_implicit_link_library} is the name of an existing file.
+          # In this case assume it is the name of a library.
+	  list(APPEND cxx_compiler_library_pathname_list ${cmake_cxx_implicit_link_library})
 	else(library_pathname)
-	  message(STATUS "WARNING: could not find special C++ library ${cmake_cxx_implicit_link_library} anywhere in CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES = ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}")
+	  message(STATUS "WARNING: could not find special C++ library ${cmake_cxx_implicit_link_library} as an
+   existing full pathname of a library or anywhere in CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES =
+   ${CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES}.
+   So ${cmake_cxx_implicit_link_library} has been ignored in forming cxx_compiler_library_pathname_list")
 	endif(library_pathname)
       endif(cmake_cxx_implicit_link_library)
     endforeach(cmake_cxx_implicit_link_library ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES})


BUG:  Forgot to add new ITK git tag.

BUG:  Forgot to add new ITK git tag.

--- 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}_GIT_TAG 1926df35cf9fddc6a867349a63f4d55dca65bc04) # 7-Nov-2013
+  set(${proj}_GIT_TAG a996132c781ad28cd959d492b777ffbde375af4c) # 19-Nov-2013
   set(ITK_VERSION_ID ITK-4.5)

   ExternalProject_Add(${proj}


removing spaces in empty line

removing spaces in empty line

Signed-off-by: Michael Lackner <3a83a63e09617a92abe7cff25cd96c60be2ff4aa@student.tugraz.at>

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -418,7 +418,7 @@
     set_target_properties(TBB::${COMPONENT} PROPERTIES
       IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
       IMPORTED_LOCATION "${Tbb_${COMPONENT}_LIBRARY}")
-
+
     target_link_directories(TBB::${COMPONENT} INTERFACE "${Tbb_LIBRARY_DIRS}")

     # Release location


Consider TBB successfully found if either the debug or release lib is found

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -187,7 +187,7 @@

 if (TBB_INCLUDE_DIR)
-    if (TBB_LIBRARY)
+    if (TBB_LIBRARY OR TBB_LIBRARY_DEBUG)
         set (TBB_FOUND "YES")
         set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
         set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
@@ -195,7 +195,7 @@
         set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
         mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
         message(STATUS "Found Intel TBB")
-    endif (TBB_LIBRARY)
+    endif (TBB_LIBRARY OR TBB_LIBRARY_DEBUG)
 endif (TBB_INCLUDE_DIR)

 if (NOT TBB_FOUND)


Added fallback to old behavior in FindTBB.cmake

--- cmake/FindTBB.cmake
+++ cmake/FindTBB.cmake
@@ -184,7 +184,11 @@
   ##################################

   if(TBB_INCLUDE_DIRS)
-    file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file)
+    if(EXISTS "${TBB_INCLUDE_DIRS}/tbb/version.h")
+        file(READ "${TBB_INCLUDE_DIRS}/tbb/version.h" _tbb_version_file)
+    else()
+        file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file)
+    endif()
     string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
         TBB_VERSION_MAJOR "${_tbb_version_file}")
     string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"


CONC-456: Introduce INSTALL_PLUGINDIR_CLIENT

If there is a INSTALL_PLUGINDIR_CLIENT it will override whatever value
INSTALL_PLUGINDIR had. This is useful in MariaDB Server builds where this
repository exists as a git submodule in directory libmariadb/.

Normally, when a INSTALL_PLUGINDIR is set (which happens in the server) it
will override whatever values are in the client library. The client
library does define its own layout for INSTALL_LAYOUT=DEB, but it is
near useless, since the values are the same as in the default, apart for
INSTALL_LIBDIR, which points to /usr/lib/<arch>/libmariadb3/plugins, but
is overridden. With this new flag, it will not be overridden, and will
actually be set as we want it to be in new Debian builds.

Why /usr/lib/<arch>/libmariadb3/plugins?
- <arch>, e.g. x86_64-linux-gnu, is needed to allow co-installation of
  32-bit and 64-bit on Debian, and is relevant for libmariadb3 pacakge.
- The "libmariadb" part separates these client library plugins from the
  server plugins, which are now in /usr/lib/*/mysql/plugins, but likely
  in /usr/lib/*/mariadb/plugins in the future, and at that point we don't
  want them to get mixed with the client ones.
- The "3" in in "libmariadb3/plugins" is needed since the libmariadb3 can
  in far future be co-installed with package libmariadb4, since there could
  be on a running system programs built either against libmariadb3 or
  libmariadb4, at least during some transitioning period. When different
  versions of a package are co-installable, both the pacakge name and the
  file paths need to have a version component.
  Note that package libmariadb-dev does not have a version nor versioned
  paths, as for any given point in time when new builds are made, they
  are always made against the latest library version.

In addition, the PLUGINDIR_DEB option is removed since to our knowledge
nothing ever used it and it is thus obsolete.

Is this backwards compatible?
- Since the next release will be 3.1.8 (a minor release) all changes need
  to be fully backwards compatible.
- The version 3.1.8 will be included in all new MariaDB versions 10.2,
  10.3, 10.4 and 10.5. Of these, only 10.5 is under development and allows
  functional changes to be made. This means, that only in MariaD 10.5 there
  can be paths changed. Since this is a new option introduced, and in 10.5
  the option to use CONC_INSTALL_LAYOUT=DEB will be introduced, this code
  path is only active in MariaDB 10.5 and later with MariaDB Connector C
  3.1.8 or later. This has no effect on 10.2, 10.3 and 10.4, and is thus
  safe to apply.

This also fixes CONC-304, which was partially already fixed, but never
applied in server builds due to the same buggy build flag handling.

In addition, some line ending whitespace was removed.

Change tested with full builds of both the client and server and comparing
full deb file listings:

$ diff -u filelist-ad1a0660dfd.log filelist-1f57e8a0f64.log
--- filelist-ad1a0660dfd.log	2020-03-26 22:04:19.821001386 +0200
+++ filelist-1f57e8a0f64.log	2020-03-27 00:02:12.156576964 +0200
@@ -2,13 +2,13 @@
 drwxr-xr-x root/root ./
 drwxr-xr-x root/root ./usr/
 drwxr-xr-x root/root ./usr/lib/
-drwxr-xr-x root/root ./usr/lib/mysql/
-drwxr-xr-x root/root ./usr/lib/mysql/plugin/
--rw-r--r-- root/root ./usr/lib/mysql/plugin/client_ed25519.so
--rw-r--r-- root/root ./usr/lib/mysql/plugin/dialog.so
--rw-r--r-- root/root ./usr/lib/mysql/plugin/mysql_clear_password.so
--rw-r--r-- root/root ./usr/lib/mysql/plugin/sha256_password.so
 drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/
+drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/
+drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/client_ed25519.so
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/dialog.so
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/mysql_clear_password.so
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/sha256_password.so
 -rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb.so.3
 drwxr-xr-x root/root ./usr/share/
 drwxr-xr-x root/root ./usr/share/doc/
@@ -514,7 +514,8 @@
 -rw-r--r-- root/root ./usr/include/mariadb/server/typelib.h
 drwxr-xr-x root/root ./usr/lib/
 drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/
--rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadbclient.a
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb.a
+lrwxrwxrwx root/root ./usr/lib/x86_64-linux-gnu/libmariadbclient.a
 lrwxrwxrwx root/root ./usr/lib/x86_64-linux-gnu/libmariadbclient.so
 lrwxrwxrwx root/root ./usr/lib/x86_64-linux-gnu/libmariadb.so
 -rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmysqlservices.a
@@ -741,9 +742,10 @@
 drwxr-xr-x root/root ./
 drwxr-xr-x root/root ./usr/
 drwxr-xr-x root/root ./usr/lib/
-drwxr-xr-x root/root ./usr/lib/mysql/
-drwxr-xr-x root/root ./usr/lib/mysql/plugin/
--rw-r--r-- root/root ./usr/lib/mysql/plugin/auth_gssapi_client.so
+drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/
+drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/
+drwxr-xr-x root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/
+-rw-r--r-- root/root ./usr/lib/x86_64-linux-gnu/libmariadb3/plugin/auth_gssapi_client.so
 drwxr-xr-x root/root ./usr/share/
 drwxr-xr-x root/root ./usr/share/doc/
 drwxr-xr-x root/root ./usr/share/doc/mariadb-plugin-gssapi-client/

The MariaDB Server part will be fixed in MDEV-22053.

When and in what order can this be rolled out?
- This change only affects server builds once the MDEV-22053 is fixed, so
  this can be merged on the MariaDB Connector C at any time.
- The server MDEV-22053 can be fixed at any time, as it only starts to
  apply to the server once MariaDB Connector C 3.1.8 is released _and_
  the MariaDB Server source code submodule libmariadb is updated, at which
  point the Debian packaging is affected and needs to be updated.

Are there resources to carry out this change?
- Otto made this change and will also fix MDEV-22053.
- Otto will update MariaDB Server 10.5 packaging as soon as MariaDB
  Connector C 3.1.8 is out and updated as submodule in server.

--- cmake/install.cmake
+++ cmake/install.cmake
@@ -14,7 +14,7 @@
 #
 #
 # The following va+riables are used and can be overwritten
-#
+#
 # INSTALL_LAYOUT     installation layout (DEFAULT = standard for tar.gz and zip packages
 #                                         RPM packages
 #
@@ -29,7 +29,7 @@
 SET(INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE
   STRING "Installation layout. Currently supported options are DEFAULT (tar.gz and zip), RPM and DEB")

-# On Windows we only provide zip and .msi. Latter one uses a different packager.
+# On Windows we only provide zip and .msi. Latter one uses a different packager.
 IF(UNIX)
   IF(INSTALL_LAYOUT MATCHES "RPM")
     SET(libmariadb_prefix "/usr")
@@ -92,15 +92,14 @@
 #
 SET(INSTALL_BINDIR_DEB "bin")
 SET(INSTALL_LIBDIR_DEB "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
-SET(INSTALL_PCDIR_DEB "lib/pkgconfig")
-IF(PLUGINDIR_DEB)
-  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/${PLUGINDIR_DEB}/plugin")
-ELSE()
-  SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/mariadb${CPACK_PACKAGE_VERSION_MAJOR}/plugin")
-ENDIF()
+SET(INSTALL_PCDIR_DEB "lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig")
+SET(INSTALL_PLUGINDIR_DEB "${INSTALL_LIBDIR_DEB}/libmariadb${CPACK_PACKAGE_VERSION_MAJOR}/plugin")
 SET(INSTALL_INCLUDEDIR_DEB "include/mariadb")
 SET(LIBMARIADB_STATIC_DEB "mariadb")

+IF(INSTALL_LAYOUT MATCHES "DEB")
+  SET(INSTALL_PLUGINDIR_CLIENT ${INSTALL_PLUGINDIR_DEB})
+ENDIF()

 #
@@ -116,6 +115,11 @@

 IF(INSTALL_PLUGINDIR)
   SET(INSTALL_PLUGINDIR_${INSTALL_LAYOUT} ${INSTALL_PLUGINDIR})
+ENDIF()
+
+# Extra INSTALL_PLUGINDIR_CLIENT that overrides any INSTALL_PLUGINDIR override
+IF(INSTALL_PLUGINDIR_CLIENT)
+  SET(INSTALL_PLUGINDIR_${INSTALL_LAYOUT} ${INSTALL_PLUGINDIR_CLIENT})
 ENDIF()

 IF(INSTALL_INCLUDEDIR)
@@ -139,7 +143,10 @@
 FOREACH(dir "BIN" "LIB" "PC" "INCLUDE" "DOCS"  "PLUGIN")
   SET(INSTALL_${dir}DIR ${INSTALL_${dir}DIR_${INSTALL_LAYOUT}})
   MARK_AS_ADVANCED(INSTALL_${dir}DIR)
+  MESSAGE(STATUS "MariaDB Connector C: INSTALL_${dir}DIR=${INSTALL_${dir}DIR}")
 ENDFOREACH()

 SET(LIBMARIADB_STATIC_NAME ${LIBMARIADB_STATIC_${INSTALL_LAYOUT}})
 MARK_AS_ADVANCED(LIBMARIADB_STATIC_NAME)
+
+MESSAGE(STATUS "MariaDB Connector C: LIBMARIADB_STATIC_NAME ${LIBMARIADB_STATIC_NAME}")


cmake: Kconfig: Minor refactorings in preparation for solving #5634

Minor refactoring of the build scripts in preparation for the patch
that resolves #5634.

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

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

 set(BOARD_DEFCONFIG ${BOARD_DIR}/${BOARD}_defconfig)
-set(DOTCONFIG       ${PROJECT_BINARY_DIR}/.config)
+set(DOTCONFIG                  ${PROJECT_BINARY_DIR}/.config)

 if(CONF_FILE)
 string(REPLACE " " ";" CONF_FILE_AS_LIST "${CONF_FILE}")
@@ -170,8 +170,11 @@
 endif()

 # Force CMAKE configure when the configuration files changes.
-foreach(merge_config_input ${merge_config_files} ${DOTCONFIG})
-  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${merge_config_input})
+foreach(kconfig_input
+    ${merge_config_files}
+    ${DOTCONFIG}
+    )
+  set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${kconfig_input})
 endforeach()

 add_custom_target(config-sanitycheck DEPENDS ${DOTCONFIG})


disallow invalid values for WITH_SYSTEMD cmake variable.

--- cmake/systemd.cmake
+++ cmake/systemd.cmake
@@ -76,9 +76,11 @@
         UNSET(HAVE_SYSTEMD_SD_NOTIFYF)
         MESSAGE(STATUS "Systemd features not enabled")
         IF(WITH_SYSTEMD STREQUAL "yes")
-          MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=YES however no dependencies installed/found")
+          MESSAGE(FATAL_ERROR "Requested WITH_SYSTEMD=yes however no dependencies installed/found")
         ENDIF()
       ENDIF()
+    ELSEIF(NOT WITH_SYSTEMD STREQUAL "no")
+      MESSAGE(FATAL_ERROR "Invalid value for WITH_SYSTEMD. Must be 'yes', 'no', or 'auto'.")
     ENDIF()
   ENDIF()
 ENDMACRO()


Save the list of created libraries in the cache

--- cmake/targets.cmake
+++ cmake/targets.cmake
@@ -22,6 +22,8 @@
 #     LIBRARY_OUTPUT_DIRECTORY).
 #   vistk_install_headers(subdir [headers ...])
 #     Installs the headers stored in the variable under a subdirectory.
+
+set(vistk_libraries CACHE INTERNAL "Libraries built as part of vistk")

 set(vistk_export_file
   "${vistk_binary_dir}/vistk-config-targets.cmake")
@@ -99,6 +101,11 @@
     APPEND
     FILE    "${vistk_export_file}")

+  set(vistk_libraries
+    ${vistk_libraries}
+    ${name}
+    CACHE INTERNAL "Libraries built as part of vistk")
+
   vistk_install(
     TARGETS       ${name}
     ${exports}


0.4.2

--- cmake/version.cmake
+++ cmake/version.cmake
@@ -1 +1 @@
-set(HUNTER_VERSION "0.4.1")
+set(HUNTER_VERSION "0.4.2")


Delete cmake_install.cmake

Delete cmake_install.cmake

--- cmake_install.cmake
+++ cmake_install.cmake
@@ -1,69 +0,0 @@
-# Install script for directory: /home/vroby/Progetti/sdlbasic/sdlbrt
-
-# Set the install prefix
-IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-  SET(CMAKE_INSTALL_PREFIX "/usr/local")
-ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
-STRING(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-IF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-  IF(BUILD_TYPE)
-    STRING(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
-           CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
-  ELSE(BUILD_TYPE)
-    SET(CMAKE_INSTALL_CONFIG_NAME "")
-  ENDIF(BUILD_TYPE)
-  MESSAGE(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-ENDIF(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
-
-# Set the component getting installed.
-IF(NOT CMAKE_INSTALL_COMPONENT)
-  IF(COMPONENT)
-    MESSAGE(STATUS "Install component: \"${COMPONENT}\"")
-    SET(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
-  ELSE(COMPONENT)
-    SET(CMAKE_INSTALL_COMPONENT)
-  ENDIF(COMPONENT)
-ENDIF(NOT CMAKE_INSTALL_COMPONENT)
-
-# Install shared libraries without execute permission?
-IF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-  SET(CMAKE_INSTALL_SO_NO_EXE "1")
-ENDIF(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
-
-IF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-  IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt" AND
-     NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt")
-    FILE(RPATH_CHECK
-         FILE "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt"
-         RPATH "")
-  ENDIF()
-  FILE(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" TYPE EXECUTABLE FILES "/home/vroby/Progetti/sdlbasic/sdlbrt/sdlbrt")
-  IF(EXISTS "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt" AND
-     NOT IS_SYMLINK "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt")
-    IF(CMAKE_INSTALL_DO_STRIP)
-      EXECUTE_PROCESS(COMMAND "/usr/bin/strip" "$ENV{DESTDIR}${CMAKE_INSTALL_PREFIX}/bin/sdlbrt")
-    ENDIF(CMAKE_INSTALL_DO_STRIP)
-  ENDIF()
-ENDIF(NOT CMAKE_INSTALL_COMPONENT OR "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Unspecified")
-
-IF(NOT CMAKE_INSTALL_LOCAL_ONLY)
-  # Include the install script for each subdirectory.
-  INCLUDE("/home/vroby/Progetti/sdlbasic/sdlbrt/BASengine/cmake_install.cmake")
-  INCLUDE("/home/vroby/Progetti/sdlbasic/sdlbrt/SDLengine/cmake_install.cmake")
-  INCLUDE("/home/vroby/Progetti/sdlbasic/sdlbrt/unzip/cmake_install.cmake")
-  INCLUDE("/home/vroby/Progetti/sdlbasic/sdlbrt/sqlite3/cmake_install.cmake")
-
-ENDIF(NOT CMAKE_INSTALL_LOCAL_ONLY)
-
-IF(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest_${CMAKE_INSTALL_COMPONENT}.txt")
-ELSE(CMAKE_INSTALL_COMPONENT)
-  SET(CMAKE_INSTALL_MANIFEST "install_manifest.txt")
-ENDIF(CMAKE_INSTALL_COMPONENT)
-
-FILE(WRITE "/home/vroby/Progetti/sdlbasic/sdlbrt/${CMAKE_INSTALL_MANIFEST}" "")
-FOREACH(file ${CMAKE_INSTALL_MANIFEST_FILES})
-  FILE(APPEND "/home/vroby/Progetti/sdlbasic/sdlbrt/${CMAKE_INSTALL_MANIFEST}" "${file}\n")
-ENDFOREACH(file)


Fix LIEF_VDEX option description

Fix LIEF_VDEX option description

--- cmake/LIEFOptions.cmake
+++ cmake/LIEFOptions.cmake
@@ -34,7 +34,7 @@
                        "LIEF_ELF;LIEF_DEX" OFF)

 # VDEX format depends on the DEX module
-cmake_dependent_option(LIEF_VDEX "Build LIEF with DEX module" ON
+cmake_dependent_option(LIEF_VDEX "Build LIEF with VDEX module" ON
                        "LIEF_DEX" OFF)

 # Sanitizer


EMBREE_TESTING_MODEL_DIR is PATH now (and not FILEPATH)

--- common/cmake/test.cmake
+++ common/cmake/test.cmake
@@ -24,7 +24,7 @@

   CMAKE_HOST_SYSTEM_INFORMATION(RESULT memory QUERY TOTAL_PHYSICAL_MEMORY)

-  SET(EMBREE_TESTING_MODEL_DIR "${PROJECT_SOURCE_DIR}/models" CACHE FILEPATH "Path to the folder containing the Embree models for regression testing.")
+  SET(EMBREE_TESTING_MODEL_DIR "${PROJECT_SOURCE_DIR}/models" CACHE PATH "Path to the folder containing the Embree models for regression testing.")
   SET(EMBREE_TESTING_INTENSIVE OFF CACHE BOOL "Turns intensive testing on.")
   SET(EMBREE_TESTING_MEMCHECK OFF CACHE BOOL "Turns on memory checking for some tests.")
   SET(EMBREE_TESTING_BENCHMARK OFF CACHE BOOL "Turns benchmarking on.")


Remove old base test cmake

Remove old base test cmake

--- test/base_test.cmake
+++ test/base_test.cmake
@@ -1,103 +0,0 @@
-# Base test definition
-# Perform code transformation and compare the output with a reference
-
-# Define input and output file name
-set(ORIGINAL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/original_code.f90)
-set(OUTPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/transformed_code.f90)
-set(REFERENCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/reference.f90)
-
-# Define executable file name
-set(EXECUTABLE_ORIGINAL original_code_${TEST_NAME})
-set(EXECUTABLE_TRANSFORMED transformed_code_${TEST_NAME})
-
-# Define directory for build
-set(XMOD_DIR __xmod__)
-set(OMNI_TMP_DIR __omni_tmp__)
-
-# Directory where OMNI xmod files will be placed
-if (NOT EXISTS ${XMOD_DIR})
-  file(MAKE_DIRECTORY ${XMOD_DIR})
-endif()
-
-# Create intermediate representation in XcodeML Fortran format
-if(${TEST_DEBUG}) # with debug option
-  add_custom_command(
-    OUTPUT  ${OUTPUT_FILE}
-    COMMAND ${CMAKE_COMMAND} -E env CLAW_TRANS_SET_PATH=${CLAW_TRANS_SET_PATH}
-      ${CLAWFC} ${OPTIONAL_FLAGS} --debug-omni --debug -J ${XMOD_DIR}
-      -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    DEPENDS ${ORIGINAL_FILE}
-    COMMENT "Translating CLAW directive with ${CLAWFC}"
-  )
-else() # without debug option
-  add_custom_command(
-    OUTPUT  ${OUTPUT_FILE}
-    COMMAND ${CMAKE_COMMAND} -E env CLAW_TRANS_SET_PATH=${CLAW_TRANS_SET_PATH}
-      ${CLAWFC} ${OPTIONAL_FLAGS} -J ${XMOD_DIR}
-      -o ${OUTPUT_FILE} ${ORIGINAL_FILE}
-    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-    DEPENDS ${ORIGINAL_FILE}
-    COMMENT "Translating CLAW directive with ${CLAWFC}"
-  )
-endif()
-
-if(NOT NO_COMPILE)
-  # Target for the transformation
-  add_custom_target(
-    transform-${TEST_NAME}
-    DEPENDS ${OUTPUT_FILE} ${EXECUTABLE_ORIGINAL} ${EXECUTABLE_TRANSFORMED}
-  )
-  # Build the original code and the transformed code
-  add_executable (${EXECUTABLE_ORIGINAL} EXCLUDE_FROM_ALL ${ORIGINAL_FILE})
-  add_executable (${EXECUTABLE_TRANSFORMED} EXCLUDE_FROM_ALL ${OUTPUT_FILE})
-else()
-  # Target for the transformation
-  add_custom_target(
-    transform-${TEST_NAME}
-    DEPENDS ${OUTPUT_FILE}
-  )
-endif()
-
-# Target to clean the generated file (Output of clawfc)
-add_custom_target(
-  clean-${TEST_NAME}
-  COMMAND rm -f ${OUTPUT_FILE}
-)
-
-# Add target to the global build/clean target
-add_dependencies(${BUILD_TEST_TARGET} transform-${TEST_NAME})
-add_dependencies(${CLEAN_TEST_TARGET} clean-${TEST_NAME})
-add_dependencies(${BUILD_TEST_TARGET}-${TEST_SET} transform-${TEST_NAME})
-add_dependencies(${CLEAN_TEST_TARGET}-${TEST_SET} clean-${TEST_NAME})
-
-# Define additional compilation flags
-set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${CLAW_TEST_FFP_FLAGS}")
-
-if(NOT IGNORE_TEST)
-  # Compare reference transformed code and output of the transformation
-  add_test(
-    NAME ast-transform-${TEST_NAME}
-    COMMAND
-      "${CMAKE_COMMAND}"  --build ${CMAKE_BINARY_DIR}
-      --target transform-${TEST_NAME}
-  )
-  add_test(
-    NAME ast-compare-${TEST_NAME}
-    COMMAND diff --ignore-blank-lines ${OUTPUT_FILE} ${REFERENCE_FILE}
-  )
-  set_tests_properties(ast-compare-${TEST_NAME}
-    PROPERTIES DEPENDS ast-transform-${TEST_NAME})
-
-  # Compare the output of both executable
-  if(OUTPUT_TEST)
-    set (TEST_PARAMETERS "<(./${EXECUTABLE_ORIGINAL}) <(./${EXECUTABLE_TRANSFORMED})")
-    add_test(NAME compare-output-${TEST_NAME} COMMAND bash -c "diff ${TEST_PARAMETERS}")
-  endif()
-endif()
-
-# Add build directory to be removed with clean target
-set_property(
-  DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-  PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${XMOD_DIR} ${OMNI_TMP_DIR}
-)


Add RPI2 definitions for DF

Add RPI2 definitions for DF

--- cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake
+++ cmake/toolchains/Toolchain-arm-linux-gnueabihf-raspbian.cmake
@@ -71,6 +71,10 @@
 	endif()
 endforeach()

+add_definitions(
+	-D __RPI2
+	)
+
 set(LINKER_FLAGS "-Wl,-gc-sections")
 set(CMAKE_EXE_LINKER_FLAGS ${LINKER_FLAGS})
 set(CMAKE_C_FLAGS ${C_FLAGS})


Fix postgresql cmake module

Fix postgresql cmake module

--- cmake/Modules/FindPostgreSQL.cmake
+++ cmake/Modules/FindPostgreSQL.cmake
@@ -75,12 +75,16 @@

 set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
-    "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
+    "9.4" "9.3" "9.2" "9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")

 # Define additional search paths for root directories.
 if ( WIN32 )
   foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
     set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "C:/Program Files/PostgreSQL/${suffix}" )
+  endforeach()
+else()
+  foreach (suffix ${PostgreSQL_KNOWN_VERSIONS} )
+    set(PostgreSQL_ADDITIONAL_SEARCH_PATHS ${PostgreSQL_ADDITIONAL_SEARCH_PATHS} "/usr/include/postgresql/${suffix}" "/usr/local/include/postgresql/${suffix}")
   endforeach()
 endif()
 set( PostgreSQL_ROOT_DIRECTORIES


cmake: Export compile_commands.json as part of build

--- tools/cmake/idf_functions.cmake
+++ tools/cmake/idf_functions.cmake
@@ -28,6 +28,8 @@
   # path to idf.py tool
   set(IDFTOOL ${PYTHON} "${IDF_PATH}/tools/idf.py")

+  # generate compile_commands.json
+  set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
 endmacro()

 # Add all the IDF global compiler & preprocessor options


Small adjustment to allow for spaces in path

--- Utilities.cmake
+++ Utilities.cmake
@@ -644,8 +644,8 @@
 function (GetAndParseVersion)

 if (GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
-    execute_process(COMMAND $ENV{COMSPEC} /C
-      ${GIT_EXECUTABLE} -C ${CMAKE_CURRENT_SOURCE_DIR} describe --long --abbrev=40 HEAD OUTPUT_VARIABLE jemalloc_version)
+    execute_process(COMMAND ${GIT_EXECUTABLE}
+	-C "${CMAKE_CURRENT_SOURCE_DIR}" describe --long --abbrev=40 HEAD OUTPUT_VARIABLE jemalloc_version)

     # Figure out version components
     string (REPLACE "\n" "" jemalloc_version  ${jemalloc_version})


Update paraview

Update paraview

--- 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 "537964f6c58fc7156a6aefd2526ae34f1126fe7b")
+  set(_paraview_revision "64808f36b65b3f6dba1186148f3782dc7d5dee29")
 endif()
 add_revision(paraview
   GIT_REPOSITORY "https://gitlab.kitware.com/paraview/paraview.git"


[cmake] Try to use python3 when available when calling cram

--- .cmake/Modules/Cram.cmake
+++ .cmake/Modules/Cram.cmake
@@ -46,7 +46,15 @@
   endif ()
 endif ()

-execute_process (COMMAND python -m cram -v ${CRAM_OPTS} "${CRAM_PATH}" TIMEOUT 60 RESULT_VARIABLE RES)
+execute_process (COMMAND python3 --version TIMEOUT 1 RESULT_VARIABLE PYTHON3_RES)
+
+if (NOT PYTHON3_RES STREQUAL "0")
+  set (PYTHON "python")
+else ()
+  set (PYTHON "python3")
+endif ()
+
+execute_process (COMMAND ${PYTHON} -m cram -v ${CRAM_OPTS} "${CRAM_PATH}" TIMEOUT 60 RESULT_VARIABLE RES)

 if (NOT RES STREQUAL "0")
   message (FATAL_ERROR "Cram tests failed")


Updated CPack config

Updated CPack config

--- src/CPackConfig.cmake
+++ src/CPackConfig.cmake
@@ -51,7 +51,7 @@
 SET (CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
 SET (CPACK_DEBIAN_PACKAGE_SECTION "video")
 SET (CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
-SET (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.1.3), libgcc1 (>= 4.1.1), libtesseract3 (>= 3.0.3), libopencv-core2.4 (>= 2.4.8), libopencv-objdetect2.4 (>= 2.4.8), libopencv-highgui2.4 (>= 2.4.8), libopencv-imgproc2.4 (>= 2.4.8), libopencv-flann2.4 (>= 2.4.8), libopencv-features2d2.4 (>= 2.4.8), libzmq1, libleptonica, liblog4cplus, libcurl3, beanstalkd")
+SET (CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.1.3), libgcc1 (>= 4.1.1), libtesseract3 (>= 3.0.3), libopencv-core2.4 (>= 2.4.8), libopencv-objdetect2.4 (>= 2.4.8), libopencv-highgui2.4 (>= 2.4.8), libopencv-imgproc2.4 (>= 2.4.8), libopencv-flann2.4 (>= 2.4.8), libopencv-features2d2.4 (>= 2.4.8), libzmq1, liblog4cplus-1.0-4, libcurl3, beanstalkd")

 SET (CPACK_RESOURCE_FILE_LICENSE "${CUR_SOURCE_DIR}/../LICENSE")
 SET (CPACK_PACKAGE_DESCRIPTION "OpenALPR - Open Source Automatic License Plate Recognition")


Improve comment

Improve comment

--- cmake/modules/hunter_load_from_cache.cmake
+++ cmake/modules/hunter_load_from_cache.cmake
@@ -102,8 +102,8 @@
         hunter_internal_error("Bad format: ${dep_entry}")
       endif()

-      # Load cache.sha1 file from cache if package is cached
-      # This function will not install anything, just cache checking
+      # Load cache.sha1 file from cache to home directory if package is cached
+      # This function will not really install anything, just for cache checking
       hunter_cache_run(PACKAGE "${package}" COMPONENT "${component}")

       # Read


SQLITE: fixing sqlite dependencies

SQLITE: fixing sqlite dependencies

- adding pthread to sqlite dependencies to avoid undefined ref
- adding dl to sqlite dependencies for Unix only

Change-Id: Ieda9cbe185c350641bd451a732674477af798ab4
Reviewed-on: http://gerrit.aldebaran.lan:8080/6204
Reviewed-by: clemolgat <4dd22dc632b87bc1e3059bbd5b16980bbafdebf5@aldebaran-robotics.com>
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: ewirbel <000207eeda0ccaab43180a4d03b5e4463d19fe94@aldebaran-robotics.com>

--- cmake/qibuild/modules/sqlite3-config.cmake
+++ cmake/qibuild/modules/sqlite3-config.cmake
@@ -7,4 +7,9 @@
 fpath(SQLITE3 sqlite3.h)
 flib(SQLITE3  sqlite3)

+if(UNIX AND NOT APPLE)
+  qi_set_global(SQLITE3_DEPENDS PTHREAD DL)
+else()
+  qi_set_global(SQLITE3_DEPENDS PTHREAD)
+endif()
 export_lib(SQLITE3)


Add warning to user on Windows host system without MKLINK privilege. [ci skip]

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -167,6 +167,12 @@
             file (REMOVE ${CMAKE_BINARY_DIR}/test-link)
         else ()
             set (URHO3D_MKLINK FALSE)
+            message (WARNING "Could not use MKLINK to setup symbolic links as this Windows user account does not have the privilege to do so. "
+                "When MKLINK is not available then the build system will fallback to use file/directory copy of the library headers from source tree to build tree. "
+                "In order to prevent stale headers being used in the build, this file/directory copy will be redone also as a post-build step for each library targets. "
+                "This may slow down the build unnecessarily or even cause other unforseen issues due to incomplete or stale headers in the build tree. "
+                "Request your Windows Administrator to grant your user account to have privilege to create symlink via MKLINK command. "
+                "You are NOT advised to use the Administrator account directly to generate build tree in all cases.")
         endif ()
         set (URHO3D_MKLINK ${URHO3D_MKLINK} CACHE INTERNAL "MKLINK capability on the Windows host system")
     endif ()


COMP: do not deactivate shared libs built on windows by default

--- CMake/OTBSetStandardCompilerFlags.cmake
+++ CMake/OTBSetStandardCompilerFlags.cmake
@@ -200,7 +200,7 @@
       else()
         set(OTB_LIBRARY_BUILD_TYPE "STATIC")
       endif()
-      set(BUILD_SHARED_LIBS OFF)
+      #set(BUILD_SHARED_LIBS OFF)
     endif()
   endif()
   #-----------------------------------------------------------------------------


Fix CMake quoting

Fix CMake quoting

--- Dependencies/single_source_shader.cmake
+++ Dependencies/single_source_shader.cmake
@@ -7,7 +7,7 @@
 list (GET contents 0 firstLine)

 if (${VULKAN})
-	if (${firstLine} MATCHES "#version 450.*")
+	if ("${firstLine}" MATCHES "#version 450.*")
 		# No conversion required!
 		execute_process(COMMAND ${GLSLANG_EXECUTABLE} -V -o ${target} ${shader_file})
 	else()
@@ -23,7 +23,7 @@
 		FILE(WRITE ${tempFile} "#version 450\n")

 		FOREACH(line ${contents})
-			if (NOT ${line} MATCHES "#version")
+			if (NOT "${line}" MATCHES "#version")
 				FILE(APPEND ${tempFile} "${line}\n")
 			endif()
 		ENDFOREACH(line)
@@ -32,7 +32,7 @@
 		FILE(REMOVE ${tempFile})
 	endif()
 else()
-	if (${firstLine} MATCHES "#version 450.*")
+	if ("${firstLine}" MATCHES "#version 450.*")
 	# Convert on-the-fly to destination

 		message("Warning - this shader is being converted to OGLES by changing the version string to #version 300 es")
@@ -40,7 +40,7 @@
 		FILE(WRITE ${target} "#version 300 es\n")

 		FOREACH(line ${contents})
-			if (NOT ${line} MATCHES "#version")
+			if (NOT "${line}" MATCHES "#version")
 				FILE(APPEND ${target} "${line}\n")
 			endif()
 		ENDFOREACH(line)


Updating Plugin CMake codes to better organize the Visual Studio and Xcode projects.

--- FilterParameterWidgets/SourceList.cmake
+++ FilterParameterWidgets/SourceList.cmake
@@ -64,9 +64,9 @@
 set(RegisterKnownFilterParameterWidgetsFile ${${PLUGIN_NAME}_BINARY_DIR}/FilterParameterWidgets/RegisterKnownFilterParameterWidgets.cpp)

-cmp_IDE_SOURCE_PROPERTIES( "${PLUGIN_NAME}/FilterParameterWidgets" "${${PLUGIN_NAME}_ParameterWidgets_HDRS}" "${${PLUGIN_NAME}_ParameterWidgets_SRCS}" "0")
+cmp_IDE_SOURCE_PROPERTIES( "FilterParameterWidgets" "${${PLUGIN_NAME}_ParameterWidgets_MOC_HDRS}" "${${PLUGIN_NAME}_ParameterWidgets_SRCS}" "0")

-cmp_IDE_GENERATED_PROPERTIES("${PLUGIN_NAME}/FilterParameterWidgets/UI_Files" "${${PLUGIN_NAME}_ParameterWidgets_UIS}" "")
+cmp_IDE_GENERATED_PROPERTIES("FilterParameterWidgets/UI_Files" "${${PLUGIN_NAME}_ParameterWidgets_UIS}" "")

 # --------------------------------------------------------------------
 # and finally this will run moc:


Change external directory from .MITK to .mitk.

--- CMake/mitkFunctionWhitelists.cmake
+++ CMake/mitkFunctionWhitelists.cmake
@@ -16,7 +16,7 @@
 #!
 #! Default values:
 #!  <prefix>_WHITELISTS_INTERNAL_PATH = <prefix>_SOURCE_DIR/CMake/Whitelists
-#!  <prefix>_WHITELISTS_EXTERNAL_PATH = %HOME%/.MITK/Whitelists
+#!  <prefix>_WHITELISTS_EXTERNAL_PATH = %HOME%/.mitk/Whitelists
 #!
 #! List of variables available after the function is called:
 #! - <prefix>_WHITELISTS_INTERNAL_PATH
@@ -29,7 +29,7 @@

 function(mitkFunctionCreateWhitelistPaths)
   set(${ARGV0}_WHITELISTS_INTERNAL_PATH "${${ARGV0}_SOURCE_DIR}/CMake/Whitelists" CACHE PATH "")
-  set(${ARGV0}_WHITELISTS_EXTERNAL_PATH ".MITK/Whitelists")
+  set(${ARGV0}_WHITELISTS_EXTERNAL_PATH ".mitk/Whitelists")

   if(WIN32)
     set(${ARGV0}_WHITELISTS_EXTERNAL_PATH "$ENV{HOMEDRIVE}$ENV{HOMEPATH}/${${ARGV0}_WHITELISTS_EXTERNAL_PATH}")


added opencv and getting dependencies automatically

--- CMake/mitkMacroInstallPython.cmake
+++ CMake/mitkMacroInstallPython.cmake
@@ -1,5 +1,6 @@

-
+get_filename_component(InstallPython_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include("${InstallPython_cmake_dir}/GetPrerequisites.cmake")

 function(MITK_FUNCTION_INSTALL_PYTHON_LIB _target_filename _target_lib _target_conf)

@@ -13,28 +14,42 @@
    endif()
 endfunction()

+function(MITK_FUNCTION_INSTALL_PYTHON_MODULE _lib _conf)
+  #MESSAGE("INSTALL : " ${_lib})
+  get_filename_component(_target_filename ${_lib} NAME)
+
+  MITK_FUNCTION_INSTALL_PYTHON_LIB("${_target_filename}" "${_lib}" "${_conf}")
+
+  # install all dependencies to this python library
+  get_prerequisites(${_lib} prereqs 1 1 bin "${VTK_DIR}/lib")
+
+  foreach(_dep ${prereqs})
+    #MESSAGE("DEPENDENCIE: " ${_dep})
+    get_filename_component(_target_filename "${_dep}" NAME)
+    get_filename_component(_realpath "${_dep}" REALPATH)
+    get_filename_component(_realname "${_realpath}" NAME)
+
+    if(UNIX AND NOT APPLE)
+      # if the realpath is different from the linked dependency
+      # we got a symlink
+      if( NOT("${_dep}" STREQUAL "${_realpath}"))
+        # install symlink
+        install(FILES ${_dep} DESTINATION bin)
+      endif()
+    endif()
+
+    MITK_FUNCTION_INSTALL_PYTHON_LIB("${_realname}" "${_realpath}" "${_conf}")
+  endforeach()
+endfunction()
+
 function(MITK_INSTALL_VTK_PYTHON)
-
   find_package(VTK REQUIRED)

-  # all libs with a python loader module
-  set(_VTK_PYTHON_TARGETS )
-
-  # python wrapping and dependencies
-  set(_VTK_PYTHON_DEPS
-    vtkWrappingPythonCore
-    vtkWrappingTools
-    verdict
-    vtksqlite
-    vtkproj4
-    vtkhdf5
-    vtkhdf5_hl
-    vtklibxml2
-    vtkgl2ps
-    vtkNetCDF_cxx
-    vtkNetCDF
-    vtkexoIIc
-    vtkoggtheora )
+  # all libs with a python loader module and
+  # wrapping related libraries
+  set(_VTK_PYTHON_TARGETS
+      vtkWrappingPythonCore
+      vtkWrappingTools )

   # find all vtk python wrapped targets
   foreach(_lib ${VTK_LIBRARIES})
@@ -42,65 +57,24 @@
     if(${_lib} MATCHES "^vtk.+")
       # use only python wrapped modules
       if(TARGET ${_lib}PythonD)
-        list(APPEND _VTK_PYTHON_TARGETS ${_lib}Python)
-        list(APPEND _VTK_PYTHON_DEPS ${_lib})
+        list(APPEND _VTK_PYTHON_TARGETS ${_lib}PythonD)
       endif()
-    endif()
-  endforeach()
-
-  # install all targets that are python wrapped
-  foreach(_lib ${_VTK_PYTHON_DEPS})
-    get_target_property(_target_lib_debug   ${_lib} IMPORTED_LOCATION_DEBUG)
-    get_target_property(_target_lib_release ${_lib} IMPORTED_LOCATION_RELEASE)
-    get_filename_component(_target_filename_debug   "${_target_lib_debug}" NAME)
-    get_filename_component(_target_filename_release "${_target_lib_release}" NAME)
-
-    if(_target_lib_debug)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_debug} ${_target_lib_debug} "Debug")
-    endif()
-
-    if(_target_lib_release)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_release} ${_target_lib_release} "Release")
     endif()
   endforeach()

   # install the python modules and loaders
   foreach(_target ${_VTK_PYTHON_TARGETS})
-
-    set(_lib ${_target}D)
-
     # get target properties
-    get_target_property(_target_lib_debug   ${_lib} IMPORTED_LOCATION_DEBUG)
-    get_target_property(_target_lib_release ${_lib} IMPORTED_LOCATION_RELEASE)
-    get_filename_component(_target_filename_debug   "${_target_lib_debug}" NAME)
-    get_filename_component(_target_filename_release "${_target_lib_release}" NAME)
-
-    get_filename_component(_filepath_debug   ${_target_lib_debug} PATH)
-    get_filename_component(_filepath_release ${_target_lib_release} PATH)
-
-    #MESSAGE(${_lib})
-    #MESSAGE(${_filepath_debug})
+    get_target_property(_target_lib_debug   "${_target}" IMPORTED_LOCATION_DEBUG)
+    get_target_property(_target_lib_release "${_target}" IMPORTED_LOCATION_RELEASE)

     if(_target_lib_debug)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_debug} ${_target_lib_debug} "Debug")
+      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_target_lib_debug}" "Debug")
     endif()

     if(_target_lib_release)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_release} ${_target_lib_release} "Release")
+      MITK_FUNCTION_INSTALL_PYTHON_MODULE("${_target_lib_release}" "Release")
     endif()
-
-    # if the target is a wrapped module install the python module loader
-    # and make sure the vtk module is installed
-    if(_filepath_debug)
-      set(_python_mod_file ${_target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-      MITK_FUNCTION_INSTALL_PYTHON_LIB( ${_python_mod_file} "${_filepath_debug}/${_python_mod_file}" "Debug")
-    endif()
-
-    if(_filepath_release)
-      set(_python_mod_file ${_target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_python_mod_file} "${_filepath_release}/${_python_mod_file}" "Release")
-    endif()
-
   endforeach()

   # install vtk python
@@ -112,40 +86,22 @@
 endfunction()

 function(MITK_INSTALL_CV_PYTHON)
-
   find_package(OpenCV REQUIRED)

-  foreach(_lib ${OpenCV_LIBS})
-    get_target_property(_target_lib_debug   ${_lib} IMPORTED_LOCATION_DEBUG)
-    get_target_property(_target_lib_release ${_lib} IMPORTED_LOCATION_RELEASE)
-    get_filename_component(_target_filename_debug   "${_target_lib_debug}" NAME)
-    get_filename_component(_target_filename_release "${_target_lib_release}" NAME)
-
-    if(_target_lib_debug)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_debug} ${_target_lib_debug} "Debug")
-    endif()
-
-    if(_target_lib_release)
-      MITK_FUNCTION_INSTALL_PYTHON_LIB(${_target_filename_release} ${_target_lib_release} "Release")
-    endif()
-  endforeach()
+  set(_build_type "Release")

   if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-    MITK_FUNCTION_INSTALL_PYTHON_LIB("cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${OpenCV_DIR}/lib/cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" "Debug" )
-  else()
-    MITK_FUNCTION_INSTALL_PYTHON_LIB("cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${OpenCV_DIR}/lib/cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" "Release" )
+    set(_build_type "Debug")
   endif()

-
+  MITK_FUNCTION_INSTALL_PYTHON_MODULE("${OpenCV_DIR}/lib/cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" "${_build_type}")
 endfunction()

 macro(MITK_INSTALL_PYTHON)
-
   MITK_INSTALL_VTK_PYTHON()

   if(MITK_USE_OpenCV)
     MITK_INSTALL_CV_PYTHON()
   endif()
-
 endmacro(MITK_INSTALL_PYTHON)


Bump ParaView to bring in recent changes

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


Enable building of the TubeTK applications

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -72,7 +72,7 @@
       -DCTK_DIR:PATH=${CTK_DIR}
       # Build only TubeTK lib, not the modules. They will be built by Slicer.
       -DTubeTK_BUILD_ALL_MODULES:BOOL=OFF
-      -DTubeTK_BUILD_APPLICATIONS:BOOL=OFF
+      -DTubeTK_BUILD_APPLICATIONS:BOOL=ON
       -DTubeTK_BUILD_USING_SLICER:BOOL=OFF
       -DTubeTK_BUILD_WITHIN_SLICER:BOOL=ON
       -DTubeTK_USE_LIBSVM:BOOL=OFF


Ad flag to CUDA Gtest flags

Ad flag to CUDA Gtest flags

--- test/BuildGPUTests.cmake
+++ test/BuildGPUTests.cmake
@@ -32,7 +32,7 @@

 # Set host compiler
 set(CCBIN "-ccbin=${CMAKE_CXX_COMPILER}")
-set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CCBIN}")
+set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CCBIN} -Wno-deprecated-gpu-targets")

 include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})


Convert VISIBILITY_PUBLIC to PUBLIC

Convert VISIBILITY_PUBLIC to PUBLIC

--- CMake/AbseilHelpers.cmake
+++ CMake/AbseilHelpers.cmake
@@ -73,7 +73,7 @@
 # COPTS: List of private compile options
 # DEFINES: List of public defines
 # LINKOPTS: List of link options
-# VISIBILITY_PUBLIC: Add this so that this library will be exported under absl:: (see Note).
+# PUBLIC: Add this so that this library will be exported under absl:: (see Note).
 # TESTONLY: When added, this target will only be built if user passes -DBUILD_TESTING=ON to CMake.
 #
 # Note:
@@ -99,14 +99,14 @@
 #     absl_internal_awesome_lib # not "awesome_lib"!
 # )
 #
-# If VISIBILITY_PUBLIC is set, absl_cc_library will also create an alias absl::${NAME}
+# If PUBLIC is set, absl_cc_library will also create an alias absl::${NAME}
 # for public use in addition to absl_internal_${NAME}.
 #
 # absl_cc_library(
 #   NAME
 #     main_lib
 #   ...
-#   VISIBILITY_PUBLIC
+#   PUBLIC
 # )
 #
 # User can then use the library as absl::main_lib (although absl_internal_main_lib is defined too).
@@ -115,7 +115,7 @@

 function(absl_cc_library)
   cmake_parse_arguments(ABSL_CC_LIB
-    "DISABLE_INSTALL;VISIBILITY_PUBLIC;TESTONLY"
+    "DISABLE_INSTALL;PUBLIC;TESTONLY"
     "NAME"
     "HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DEPS"
     ${ARGN}
@@ -123,7 +123,6 @@

   if (NOT ABSL_CC_LIB_TESTONLY OR ABSL_RUN_TESTS)
     set(_NAME "absl_internal_${ABSL_CC_LIB_NAME}")
-    string(TOUPPER ${_NAME} _UPPER_NAME)

     # Check if this is a header-only library
     if (ABSL_CC_LIB_SRCS)
@@ -157,7 +156,7 @@
       target_compile_definitions(${_NAME} INTERFACE ${ABSL_CC_LIB_DEFINES})
     endif()

-    if(ABSL_CC_LIB_VISIBILITY_PUBLIC)
+    if(ABSL_CC_LIB_PUBLIC)
       add_library(absl::${ABSL_CC_LIB_NAME} ALIAS ${_NAME})
     endif()
   endif()


TEST: Use the MPIEXEC variable instead of hardcoded command name. Safer on plateforms where mpirun is not in PATH

--- CMake/OTBModuleTest.cmake
+++ CMake/OTBModuleTest.cmake
@@ -216,5 +216,5 @@
      list(APPEND ARGS ${arg})
    endforeach()
    set (test_parameters -np ${TEST_MPI_NBPROCS} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TEST_MPI_COMMAND} ${ARGS})
-   otb_add_test(NAME ${TEST_MPI_NAME} COMMAND "mpirun" ${test_parameters})
-endfunction()
+   otb_add_test(NAME ${TEST_MPI_NAME} COMMAND ${MPIEXEC} ${test_parameters})
+endfunction()


Update GDCM

Update GDCM

--- CMakeExternals/GDCM.cmake
+++ CMakeExternals/GDCM.cmake
@@ -41,8 +41,8 @@

   ExternalProject_Add(${proj}
      LIST_SEPARATOR ${sep}
-     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/gdcm-3.0.4.tar.gz
-     URL_MD5 f12dbded708356d5fa0b5ed37ccdb66e
+     URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/gdcm-3.0.8.tar.gz
+     URL_MD5 29e0e60b04183e3eb9c18ad093156b2c
      CMAKE_GENERATOR ${gen}
      CMAKE_GENERATOR_PLATFORM ${gen_platform}
      CMAKE_ARGS


Fix which corrects that Linux founds needed python package.

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

--- CMakeModules/Python.cmake
+++ CMakeModules/Python.cmake
@@ -4,10 +4,10 @@
 macro (FIND_PYTHON)

   if (UNIX)
-    find_package (PkgConfig)
-    pkg_search_module (python python)
-    if (NOT python_INCLUDE_DIRS AND NOT python_LIBRARIES)
+    find_package(PythonLibs)
+    if (NOT PYTHON_LIBRARIES OR NOT_PYTHON_INCLUDE_PATH)
       message (FATAL_ERROR "Python not found by pkg-config")
+    endif()
   endif()

 endmacro (FIND_PYTHON)
@@ -18,8 +18,8 @@
     include_directories (${REX_DEP_PATH}/Python/include)
     link_directories (${REX_DEP_PATH}/Python/lib)
   else()
-    include_directories(${python_INCLUDE_DIRS})
-    link_directories(${python_LIBRARY_DIRS})
+    include_directories(${PYTHON_INCLUDE_PATH})
+    link_directories(${PYTHON_LIBRARY_DIR})
   endif (MSVC)

 endmacro (INCLUDE_PYTHON)
@@ -40,7 +40,7 @@
 	optimized Python25)
     endif(PYTHON_FORCE_RELEASE_VERSION)
   else()
-    target_link_libraries (${TARGET_NAME} ${python_LIBRARIES})
+    target_link_libraries (${TARGET_NAME} ${PYTHON_LIBRARIES})
   endif (MSVC)


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -365,4 +365,5 @@
 # handle success
 if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
     message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR}.${SFML_VERSION_PATCH} in ${SFML_INCLUDE_DIR}")
-endif()+endif()
+


Gadgetron requires at least Boost 1.65

Gadgetron requires at least Boost 1.65

--- version_config.cmake
+++ version_config.cmake
@@ -22,7 +22,7 @@
 #=========================================================================

 ## BOOST
-  # Gadgetron needs 1.65
+  # Gadgetron needs at least 1.65

 if (APPLE) # really should be checking for CLang
     # Boost 1.65 contains a bug for recent Clang https://github.com/CCPPETMR/SIRF-SuperBuild/issues/170


shifted ISMRMRD tag to 1.4.2.1

shifted ISMRMRD tag to 1.4.2.1

--- version_config.cmake
+++ version_config.cmake
@@ -113,7 +113,7 @@
   set(DEFAULT_ISMRMRD_TAG program_options_fix)
 else()
   set(DEFAULT_ISMRMRD_URL https://github.com/ismrmrd/ismrmrd )
-  set(DEFAULT_ISMRMRD_TAG v1.4.2)
+  set(DEFAULT_ISMRMRD_TAG v1.4.2.1)
 endif()

 ## Gadgetron


Remove CTEST_PROJECT_NAME from list of required variables.

CTEST_PROJECT_NAME is used by the VS generators to determine the name
of the .sln file. This variable is usually set in CTestConfig.cmake and
if set there, will overwrite the variable in the driver script anyway.

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -20,7 +20,6 @@
   CTEST_TEST_TIMEOUT
   CTEST_BUILD_FLAGS
   TEST_TO_EXCLUDE_REGEX
-  CTEST_PROJECT_NAME
   CTEST_SOURCE_DIRECTORY
   CTEST_BINARY_DIRECTORY
   CTEST_BUILD_NAME


ENH: VTK_TCL_HOME is the path where pkgIndex.tcl can be found when it is post-fixed with one of the configuration types (Debug, Release, etc.), *if any*.

--- vtkGenerateVTKConfig.cmake
+++ vtkGenerateVTKConfig.cmake
@@ -200,7 +200,7 @@
 IF(VTK_WRAP_TCL)
   SET(VTK_WRAP_TCL_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTcl${VTK_EXE_EXT})
   SET(VTK_WRAP_TCL_INIT_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapTclInit${VTK_EXE_EXT})
-  SET(VTK_TCL_HOME_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR}/tcl)
+  SET(VTK_TCL_HOME_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_TCL_DIR})
 ENDIF(VTK_WRAP_TCL)
 IF(VTK_WRAP_PYTHON)
   SET(VTK_WRAP_PYTHON_EXE_CONFIG ${DOLLAR}{VTK_INSTALL_PREFIX}${VTK_INSTALL_BIN_DIR}/vtkWrapPython${VTK_EXE_EXT})


SuperBuild: OpenCV: use SB_CMAKE_COMMAND for rpath support

--- SuperBuild/CMake/External_opencv.cmake
+++ SuperBuild/CMake/External_opencv.cmake
@@ -72,7 +72,8 @@
       -DWITH_CUDA:BOOL=OFF
       -DWITH_OPENCL:BOOL=OFF
       ${OPENCV_SB_CONFIG}
-    DEPENDS ${OPENCV_DEPENDENCIES}
+      DEPENDS ${OPENCV_DEPENDENCIES}
+      CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )

   FIX_RPATH_FOR_AUTOCONF_BUILD(OPENCV "libopencv_*.dylib")


include directories before invoking rosidl_target_interfaces as the directories added in that macro may contain older version of the same files making them take precedence in the include path (#261)

--- rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
+++ rosidl_generator_py/cmake/rosidl_generator_py_generate_interfaces.cmake
@@ -230,8 +230,6 @@
     ${PythonExtra_LIBRARIES}
     ${PROJECT_NAME}__${_typesupport_impl}
   )
-  rosidl_target_interfaces(${_target_name}
-    ${PROJECT_NAME} rosidl_typesupport_c)

   target_include_directories(${_target_name}
     PUBLIC
@@ -239,6 +237,9 @@
     ${CMAKE_CURRENT_BINARY_DIR}/rosidl_generator_py
     ${PythonExtra_INCLUDE_DIRS}
   )
+
+  rosidl_target_interfaces(${_target_name}
+    ${PROJECT_NAME} rosidl_typesupport_c)

   ament_target_dependencies(${_target_name}
     "rosidl_generator_c"


DOC: fix bug in documentation of FindMuParserX

--- CMake/FindMuParserX.cmake
+++ CMake/FindMuParserX.cmake
@@ -1,7 +1,7 @@
 # Find MuParserX
 #
 #   MUPARSERX_FOUND        - True if MuParser found.
-#   MUPARSERX_INCLUDE_DIRS - where to find tinyxml.h, etc.
+#   MUPARSERX_INCLUDE_DIRS - where to find mpParser.h, etc.
 #   MUPARSERX_LIBRARIES    - List of libraries when using MuParser.
 #


BUG: Allow Python tests in module test/CMakeLists.txt

With ITK 5, the preferred location for Python tests is in the module
wrapping/test/CMakeLists.txt file. However, allow backwards-compatible
test specification in test/CMakeLists.txt for remote modules that have
not yet been updated.

To address:

  CMake Error at CMake/ITKModuleTest.cmake:224 (message):
    `itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF
  Call Stack (most recent call first):
    Modules/Remote/FixedPointInverseDisplacementField/test/CMakeLists.txt:17 (itk_python_expression_add_test)

--- CMake/ITKModuleTest.cmake
+++ CMake/ITKModuleTest.cmake
@@ -164,7 +164,11 @@
 function(itk_python_add_test)
   # No-op if wrapping is not available
   if(NOT ITK_WRAP_PYTHON)
-    message(FATAL_ERROR "`itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF")
+    if(DEFINED ITK_SOURCE_DIR)
+      message(FATAL_ERROR "`itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF")
+    else()
+      return()
+    endif()
   endif()

   set(options )
@@ -221,7 +225,11 @@
 function(itk_python_expression_add_test)
   # No-op if wrapping is not available
   if(NOT ITK_WRAP_PYTHON)
-    message(FATAL_ERROR "`itk_python_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF")
+    if(DEFINED ITK_SOURCE_DIR)
+      message(FATAL_ERROR "`itk_python_expression_add_test` should never be called if `ITK_WRAP_PYTHON` if OFF")
+    else()
+      return()
+    endif()
   endif()

   set(options )


BUG: cmake variable CROSS_COMPILING -> CMAKE_CROSSCOMPILING

--- CMake/PackageHelper.cmake
+++ CMake/PackageHelper.cmake
@@ -123,7 +123,7 @@
   # install(CODE "message(\"CMake/PackageHelper.cmake:install_common(${outdir})\n${vars}\n\")")

   ##################### install environment source ##########################
-  if(WIN32 OR CROSS_COMPILING)
+  if(WIN32 OR CMAKE_CROSSCOMPILING)
     set(ENV_SOURCE_FILES
       "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.cmd"
       "${PACKAGE_SUPPORT_FILES_DIR}/otbenv.profile"


cpack: con't include python 3 cruft

cpack: con't include python 3 cruft

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -13,6 +13,7 @@
     "/build/"
     ".pyc$"
     ".pyo$"
+    "__pycache__"
     ".so$"
     ".dylib$"
     ".DS_Store"


cmake: Exclude obj directory.

cmake: Exclude obj directory.

--- CPackConfig.cmake
+++ CPackConfig.cmake
@@ -19,7 +19,7 @@

 ### source generator
 set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;tags;cscope.*")
+set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;/obj/;tags;cscope.*")
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")

 if (WIN32)


cdash: Update dashboard URL

cdash: Update dashboard URL

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -8,7 +8,6 @@
 set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "www.cdash.org")
-#set(CTEST_DROP_LOCATION "/CDash/submit.php?project=MatViz")
-set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE "cdash.openchemistry.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=MatViz")
 set(CTEST_DROP_SITE_CDASH TRUE)


fix library export when SKIP_INSTALL is passed

--- rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake
+++ rosidl_typesupport_introspection_cpp/cmake/rosidl_typesupport_introspection_cpp_generate_interfaces.cmake
@@ -113,6 +113,5 @@
     LIBRARY DESTINATION lib
     RUNTIME DESTINATION bin
   )
+  ament_export_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix})
 endif()
-
-ament_export_libraries(${rosidl_generate_interfaces_TARGET}${_target_suffix})


BUG: Update ExternalData resource.

BUG: Update ExternalData resource.

The Azure grant that provided this resource has expired.

Midas3 now only allows SSL (https) connections.

Change-Id: Id05a5b77359e17ecb35dd7aef4ac3ea6c8a9e7f9

--- CMake/ITKExternalData.cmake
+++ CMake/ITKExternalData.cmake
@@ -31,11 +31,8 @@
 mark_as_advanced(ExternalData_URL_TEMPLATES)
 if(NOT ITK_FORBID_DOWNLOADS)
   list(APPEND ExternalData_URL_TEMPLATES
-    # Data published on Azure
-    "http://itkexternaldata.blob.core.windows.net/%(algo:lower)/%(hash)"
-
     # Data published on MIDAS
-    "http://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
+    "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"

     # Data published by developers using git-gerrit-push.
     "http://www.itk.org/files/ExternalData/%(algo)/%(hash)"


Mark find(Houdini) as REQUIRED

Mark find(Houdini) as REQUIRED

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -154,7 +154,8 @@
 find_package(Houdini
   ${_FIND_HOUDINI_ADDITIONAL_OPTIONS}
   PATHS ${_HOUDINI_ROOT_SEARCH_DIR}
-  PATH_SUFFIXES ${_HOUDINI_CMAKE_PATH_SUFFIXES})
+  PATH_SUFFIXES ${_HOUDINI_CMAKE_PATH_SUFFIXES}
+  REQUIRED)

 # Note that passing MINIMUM_HOUDINI_VERSION into find_package(Houdini) doesn't work
 if(NOT Houdini_FOUND)


Add a CMake ABI warning if using Houdini > 18.5

Signed-off-by: Dan Bailey <39b6ae1dd30d9ab3cd77a2d084b277520f14c203@ilm.com>

--- cmake/OpenVDBHoudiniSetup.cmake
+++ cmake/OpenVDBHoudiniSetup.cmake
@@ -336,6 +336,8 @@
 elseif(Houdini_VERSION_MAJOR_MINOR VERSION_EQUAL 18.5)
   set(OPENVDB_HOUDINI_ABI 7)
 else()
+  message(WARNING "Unknown version of Houdini, assuming OpenVDB ABI=8, "
+    "but if this not correct, the CMake flag -DOPENVDB_HOUDINI_ABI=<N> can override this value.")
   set(OPENVDB_HOUDINI_ABI 8)
 endif()


Removing -Wno-long-double and adding -single_module to the compilation options (macosx)

--- cmake/modules/ALICEMacros.cmake
+++ cmake/modules/ALICEMacros.cmake
@@ -162,7 +162,7 @@

   Set(CLIBDEFS "-DCERNLIB_LXIA64 -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")

-  Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m64 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
+  Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m64 -pipe -Wall -W -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
   Set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O -g -m64 -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")

   If(CMAKE_Fortran_COMPILER MATCHES g95)
@@ -295,13 +295,13 @@

   Set(CLIBDEFS "-DCERNLIB_LINUX -DCERNLIB_BLDLIB -DCERNLIB_CZ -DCERNLIB_PPC")

-  Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m32 -pipe -Wall -W -Wno-long-double -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
+  Set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g -m32 -pipe -Wall -W -pipe -fbounds-check -fsigned-char -fno-common -fmessage-length=0 -Woverloaded-virtual -Weffc++ -Wconversion -Wshadow -fno-default-inline -fno-inline -I/usr/X11R6/include -I${FINK_ROOT}/include")
   Set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -O -g -m32 -Wall -W -fno-common -pipe -I${FINK_ROOT}/include")

   If(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95 -single_module")
   Else(CMAKE_Fortran_COMPILER MATCHES g95)
-    Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
+    Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS}  -single_module -DFORTRAN_GFORTRAN")
     Execute_process(
       COMMAND gfortran -m32 -print-file-name=libgfortran.dylib
       OUTPUT_VARIABLE FLIB


Build system: Fix potential inconsistencies in itcl and itk variables

With the old CMake logic it was possible in a certain corner case
(found by one of Arjen's tests when an iwidgets package was not
installed on Cytwin) for HAVE_ITCL, HAVE_ITCLDECLS_H to be set
inconsistently with ENABLE_itcl and HAVE_ITK inconsistently with
ENABLE_itk.  The result was a build error with missing symbols which I
verified also on Linux. This fix makes such inconsistencies
impossible, and therefore should make it possible to build PLplot when
iwidgets is not found.

Tested by Alan W. Irwin <airwin@users.sourceforge.net> on Linux
by temporarily looking for iwidgetsxx rather than iwidgets to
emulate a missing iwidgets.  The result was bad

make plplottcltk
ldd -r bindings/tcl/libplplottcltk_Main.so

results before the fix, and good results afterwards.

--- cmake/modules/tcl-related.cmake
+++ cmake/modules/tcl-related.cmake
@@ -145,10 +145,6 @@
     endif(NOT truncated_version STREQUAL library_version)
   endif(library_version)

-  # Initially mark various quantities as unfound in case that turns out to be true.
-  set(HAVE_ITCL OFF)
-  set(HAVE_ITK OFF)
-
   if(ENABLE_itcl)
     if(USE_INCRTCL_VERSION_4)
       set(SUGGESTED_ITCL_VERSION 4)
@@ -238,8 +234,6 @@
 	  message(STATUS "ITCL_LIBRARY = ${ITCL_LIBRARY}")
 	  get_filename_component(ITCL_LIBRARY_PATH ${ITCL_LIBRARY} PATH)
 	  list(APPEND TCL_TK_ITCL_ITK_RPATH ${ITCL_LIBRARY_PATH})
-          set(HAVE_ITCL ON)
-          find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS "${ITCL_INCLUDE_PATH}")
         else(ITCL_LIBRARY)
           message(STATUS "Looking for itcl library - not found")
           message(STATUS "WARNING: Disabling Itcl interface code")
@@ -471,7 +465,6 @@
         if(ITK_LIBRARY)
           message(STATUS "Looking for itk library - found")
 	  message(STATUS "ITK_LIBRARY = ${ITK_LIBRARY}")
-	  set(HAVE_ITK ON)

 	  # Test version consistency between iwidgets, itk, and itcl.
 	  if(NOT IWIDGETS_VERSIONS_LIST)
@@ -617,3 +610,14 @@
   set(PLPLOT_ITK_VERSION 0.0.0)
   set(PLPLOT_IWIDGETS_VERSION 0.0.0)
 endif(NOT ENABLE_itk)
+
+if(ENABLE_itcl)
+  set(HAVE_ITCL ON)
+  find_path(HAVE_ITCLDECLS_H itclDecls.h HINTS "${ITCL_INCLUDE_PATH}")
+endif(ENABLE_itcl)
+
+if(ENABLE_itk)
+  set(HAVE_ITK ON)
+endif(ENABLE_itk)
+
+


Remove debug message

Remove debug message

--- bindings/python/cmake/Findleeloo.cmake
+++ bindings/python/cmake/Findleeloo.cmake
@@ -9,4 +9,3 @@

 find_path(LIBLEELOO_INCLUDE_DIRS leeloo/list_intervals.h HINTS /usr/include /usr/local/include)
 find_library(LIBLEELOO_LIBRARIES leeloo)
-message(${LIBLEELOO_LIBRARIES})


CMake: expand tab

CMake: expand tab

--- cmake/cpp.cmake
+++ cmake/cpp.cmake
@@ -130,11 +130,11 @@
   Coin::CbcSolver Coin::OsiCbc Coin::ClpSolver Coin::OsiClp
   Threads::Threads)
 if(WIN32)
-	target_link_libraries(${PROJECT_NAME} PUBLIC psapi.lib ws2_32.lib)
+  target_link_libraries(${PROJECT_NAME} PUBLIC psapi.lib ws2_32.lib)
 target_compile_definitions(${PROJECT_NAME} PUBLIC __WIN32__)
 endif()
 target_compile_definitions(${PROJECT_NAME}
-	PUBLIC	USE_BOP USE_GLOP USE_CBC USE_CLP)
+  PUBLIC USE_BOP USE_GLOP USE_CBC USE_CLP)
 target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_11)
 add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})


fix inc to include

fix inc to include

--- cmake/dsn.cmake
+++ cmake/dsn.cmake
@@ -284,7 +284,7 @@

 function(dsn_setup_install)
 	if(DSN_BUILD_RUNTIME)
-		install(DIRECTORY inc/ DESTINATION include)
+		install(DIRECTORY include/ DESTINATION include)
 		install(DIRECTORY cmake/ DESTINATION bin)
 		install(DIRECTORY bin/dsn.templates DESTINATION bin)
 		install(FILES "bin/dsn.generate_code.php" DESTINATION bin)
@@ -300,7 +300,7 @@
 	if(DSN_BUILD_RUNTIME AND MSVC_IDE)
 		file(GLOB_RECURSE
 			PROJ_SRC
-			"${CMAKE_SOURCE_DIR}/inc/*.h"
+			"${CMAKE_SOURCE_DIR}/include/*.h"
 			)
 		add_custom_target("dsn.include" SOURCES ${PROJ_SRC})
 	endif()


undo change for ETW header file generation flags to mc.exe (maybe older versions of MC.EXE might be in the path, then it does not work.)

--- cmake/etw.cmake
+++ cmake/etw.cmake
@@ -48,7 +48,7 @@
    OUTPUT "${CMAKE_BINARY_DIR}/utUtil/probes_ubitrack_etw.h"
            "${CMAKE_BINARY_DIR}/utUtil/probes_ubitrack_etw.rc"
            "${CMAKE_BINARY_DIR}/utUtil/probes_ubitrack_etwTemp.bin"
-   COMMAND ${CMAKE_MC_COMPILER} -u ${CMAKE_BINARY_DIR}/utUtil/ubitrack_etw_providers.man -z probes_ubitrack_etw
+   COMMAND ${CMAKE_MC_COMPILER} -um ${CMAKE_BINARY_DIR}/utUtil/ubitrack_etw_providers.man -z probes_ubitrack_etw
    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/utUtil"
    COMMENT "Exectuing: mc.exe -um ${CMAKE_BINARY_DIR}/utUtil/ubitrack_etw_providers.man -z probes_ubitrack_etw"
    DEPENDS ${CMAKE_BINARY_DIR}/utUtil/ubitrack_etw_providers.man


Test removing cmake evaluation from exclusion list

--- tensorflow/contrib/cmake/tf_tests.cmake
+++ tensorflow/contrib/cmake/tf_tests.cmake
@@ -162,7 +162,6 @@
       "${tensorflow_source_dir}/tensorflow/python/kernel_tests/py_func_test.py"
       # training tests
       "${tensorflow_source_dir}/tensorflow/python/training/basic_session_run_hooks_test.py"  # Needs tf.contrib fix.
-      "${tensorflow_source_dir}/tensorflow/python/training/evaluation_test.py"  # Needs tf.contrib fix.
       "${tensorflow_source_dir}/tensorflow/python/training/localhost_cluster_performance_test.py"  # Needs portpicker.
       "${tensorflow_source_dir}/tensorflow/python/training/monitored_session_test.py"  # Needs tf.contrib fix.
       "${tensorflow_source_dir}/tensorflow/python/training/saver_large_variable_test.py"  # Overflow error.


COMP: Remove warning when BatchMake not found because recompiled

--- CMake/FindExternalTools.cmake
+++ CMake/FindExternalTools.cmake
@@ -250,7 +250,7 @@
 # BatchMake for DTI-Reg (after ITK)
 set(BatchMake_DEPEND "")
 if(COMPILE_EXTERNAL_DTIReg) # BatchMake only needed for DTIReg
-  find_package(BatchMake) # Not required because will be recompiled if not found
+  find_package(BatchMake QUIET) # Not required because will be recompiled if not found # No warning displaid
   if(BatchMake_FOUND)
     include(${BatchMake_USE_FILE})
   else(BatchMake_FOUND)


Fix recvmmsg detection in CMake

Fix recvmmsg detection in CMake

Summary: `recvmmsg` is only available on Linux if `_GNU_SOURCE` is defined:  https://man7.org/linux/man-pages/man2/recvmmsg.2.html. As a result the current CMake test for this symbol doesn't find anything, at least on Ubuntu Focal. Fix this by adding `_GNU_SOURCE` to `CMAKE_REQUIRED_DEFINITIONS`.

Reviewed By: Orvid

Differential Revision: D37766052

fbshipit-source-id: 752df2311c6395148b4b96cb01f6115d46457174

--- CMake/FollyConfigChecks.cmake
+++ CMake/FollyConfigChecks.cmake
@@ -85,6 +85,7 @@

 check_symbol_exists(pthread_atfork pthread.h FOLLY_HAVE_PTHREAD_ATFORK)

+list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
 check_symbol_exists(accept4 sys/socket.h FOLLY_HAVE_ACCEPT4)
 check_symbol_exists(getrandom sys/random.h FOLLY_HAVE_GETRANDOM)
 check_symbol_exists(preadv sys/uio.h FOLLY_HAVE_PREADV)


fix some portability problems

fix some portability problems

--- CMakeModules/BaseConfig.cmake
+++ CMakeModules/BaseConfig.cmake
@@ -16,12 +16,17 @@

     # set(CMAKE_BUILD_TYPE distribution)
     # set(CMAKE_C_FLAGS_DISTRIBUTION "-Wall -Wextra -O2")
-    if(APPLE)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32 -D_BSD_SOURCE")
-    endif(APPLE)
     if (UNIX)
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -D_BSD_SOURCE")
+        if(APPLE)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32 -D_BSD_SOURCE")
+        endif(APPLE)
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
     endif(UNIX)
+
+    if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
+        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG -g3")
+    ENDIF(${CMAKE_BUILD_TYPE} STREQUAL Debug)
+
 endif(CMAKE_COMPILER_IS_GNUCC)

 IF(NOT CMAKE_BUILD_TYPE)
@@ -30,7 +35,3 @@
       # "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
       # FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
-
-if (${CMAKE_BUILD_TYPE} STREQUAL Debug)
-  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG -g3")
-ENDIF(${CMAKE_BUILD_TYPE} STREQUAL Debug)


Bump hardcoded version

Bump hardcoded version

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -7,7 +7,7 @@
 #   tomviz_version
 #   tomviz_version_long

-set (hardcoded_tomviz_version "0.5.1")
+set (hardcoded_tomviz_version "0.6.0")

 function(_set_version_vars versiontext)
   string(REGEX MATCH "([0-9]+)\\.([0-9]+)\\.([0-9]+)[-]*(.*)" version_matches "${versiontext}")


Added support for Clang build hardening (including Apple)

--- cmake/OpenCVCompilerDefenses.cmake
+++ cmake/OpenCVCompilerDefenses.cmake
@@ -5,7 +5,7 @@
 # - https://wiki.debian.org/Hardening
 # - https://wiki.gentoo.org/wiki/Hardened/Toolchain
 # - https://docs.microsoft.com/en-us/cpp/build/reference/sdl-enable-additional-security-checks
-
+# - https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/BufferOverflows.html

 set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "")

@@ -43,6 +43,12 @@
   set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} /guard:cf /dynamicbase" )
   if(NOT X86_64)
     set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} /safeseh")
+  endif()
+elseif(CV_CLANG)
+  ocv_add_defense_compiler_flag("-fstack-protector-strong")
+  ocv_add_defense_compiler_flag_release("-D_FORTIFY_SOURCE=2")
+  if (NOT APPLE)
+    set(OPENCV_LINKER_DEFENSES_FLAGS_COMMON "${OPENCV_LINKER_DEFENSES_FLAGS_COMMON} -z noexecstack -z relro -z now" )
   endif()
 elseif(CV_GCC)
   if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9")


Print the command that was used to run a test in a clear way.

--- cmake/modules/RootTestDriver.cmake
+++ cmake/modules/RootTestDriver.cmake
@@ -118,9 +118,14 @@

     execute_process(COMMAND ${_cmd} ${_chkout} ${_chkerr} WORKING_DIRECTORY ${CWD} RESULT_VARIABLE _rc)

-    message("-- BEGIN TEST OUTPUT --")
+    string(REGEX REPLACE "([.]*)[;][-][e][;]([^;]+)([.]*)" "\\1;-e '\\2\\3'" res "${_cmd}")
+    string(REPLACE ";" " " res "${res}")
+    message("\n-- TEST COMMAND -- ")
+    message("\ncd ${CWD}")
+    message("\n${res}")
+    message("\n-- BEGIN TEST OUTPUT --")
     message("${_outvar}")
-    message("-- END TEST OUTPUT --")
+    message("\n-- END TEST OUTPUT --")

     file(WRITE ${OUT} "${_outvar}")

@@ -134,7 +139,7 @@
       set(_outvar, "")
       string(REPLACE "^" ";" _outcnvcmd "${CNVCMD}^${OUT}")
       execute_process(COMMAND ${_outcnvcmd} ${_chkout} ${_chkerr} RESULT_VARIABLE _rc)
-      file(WRITE ${OUT} ${_outvar})
+      file(WRITE ${OUT} "${_outvar}")

       if(DEFINED RC AND (NOT _rc EQUAL RC))
         message(FATAL_ERROR "error code: ${_rc}")


stage: better deprecated/internal message (could be disable)

use ${U_TARGET}_I_KNOW_IT_IS_DEPRECATED

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -361,14 +361,21 @@

 function(_qi_internal_append_deprecated OUT_RESULT target)
   cmake_parse_arguments(ARG "INTERNAL" "" "DEPRECATED" ${ARGN})
+  string(TOUPPER ${target} _U_target)
   set(_result)
-  set(_result "${_result}\nmessage(STATUS \"\")\n")
   if (ARG_INTERNAL)
-    set(_result "${_result}\nmessage(STATUS \"## INTERNAL: ${CMAKE_CURRENT_LIST_FILE}: ${target} is internal\")\n")
+    set(_result "${_result}\nif(NOT ${_U_target}_I_KNOW_IT_IS_INTERNAL)\n")
+    set(_result "${_result}\n  message(STATUS \"\")\n")
+    set(_result "${_result}\n  message(STATUS \"## INTERNAL: \${CMAKE_CURRENT_SOURCE_DIR}: ${target} is internal\")\n")
+    set(_result "${_result}\n  message(STATUS \"\")\n")
+    set(_result "${_result}\nendif()")
   else()
-    set(_result "${_result}\nmessage(STATUS \"## DEPRECATED: ${CMAKE_CURRENT_LIST_FILE}: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
-  endif()
-  set(_result "${_result}\nmessage(STATUS \"\")\n")
+    set(_result "${_result}\nif(NOT ${_U_target}_I_KNOW_IT_IS_DEPRECATED)\n")
+    set(_result "${_result}\n  message(STATUS \"\")\n")
+    set(_result "${_result}\n  message(STATUS \"## DEPRECATED: \${CMAKE_CURRENT_SOURCE_DIR}: ${target} is deprecated: ${ARG_DEPRECATED}\")\n")
+    set(_result "${_result}\n  message(STATUS \"\")\n")
+    set(_result "${_result}\nendif()")
+  endif()
   set("${OUT_RESULT}" "${${OUT_RESULT}}${_result}" PARENT_SCOPE)
 endfunction()


fixed fl_TEST_LIBS under catkin use

fixed fl_TEST_LIBS under catkin use

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

-set(gtest_LIBRARY gtesting)
-set(gtest_main_LIBRARY gtesting_main)
-set(fl_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY})
+if(NOT fl_USING_CATKIN)
+    set(gtest_LIBRARY gtesting)
+    set(gtest_main_LIBRARY gtesting_main)
+    set(fl_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY})

-if(NOT fl_USING_CATKIN)
     set(GTEST_FRAMEWORK gtest_framework)

     ExternalProject_Add(
@@ -40,6 +40,10 @@
     add_dependencies(${gtest_main_LIBRARY} ${gtest_LIBRARY})

     include_directories(${gtest_INCLUDE_DIR}/include)
+else(NOT fl_USING_CATKIN)
+    set(gtest_LIBRARY gtest)
+    set(gtest_main_LIBRARY gtest_main)
+    set(fl_TEST_LIBS ${gtest_LIBRARY} ${gtest_main_LIBRARY})
 endif(NOT fl_USING_CATKIN)

 function(fl_add_test)


Fix CMake macro special variable usage (#216)

The argument-related variables in a macro body are not real variables,
but special substitutions. They cannot be directly referred to by name,
only expanded.

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -59,11 +59,13 @@
 # variable. When gflags is a subproject of another project (GFLAGS_IS_SUBPROJECT),
 # the variable is not added to the CMake cache. Otherwise it is cached.
 macro (gflags_define type varname docstring default)
-  if (ARGC GREATER 5)
+  # note that ARGC must be expanded here, as it is not a "real" variable
+  # (see the CMake documentation for the macro command)
+  if ("${ARGC}" GREATER 5)
     message (FATAL_ERROR "gflags_variable: Too many macro arguments")
   endif ()
   if (NOT DEFINED GFLAGS_${varname})
-    if (GFLAGS_IS_SUBPROJECT AND ARGC EQUAL 5)
+    if (GFLAGS_IS_SUBPROJECT AND "${ARGC}" EQUAL 5)
       set (GFLAGS_${varname} "${ARGV4}")
     else ()
       set (GFLAGS_${varname} "${default}")
@@ -83,7 +85,9 @@
 macro (gflags_property varname property value)
   gflags_is_cached (_cached ${varname})
   if (_cached)
-    if (property STREQUAL ADVANCED)
+    # note that property must be expanded here, as it is not a "real" variable
+    # (see the CMake documentation for the macro command)
+    if ("${property}" STREQUAL "ADVANCED")
       if (${value})
         mark_as_advanced (FORCE ${varname})
       else ()


Handling of driver files not existing in standard STM firmware

--- cmake/FindFATFS.cmake
+++ cmake/FindFATFS.cmake
@@ -25,8 +25,6 @@
         LIST(APPEND FATFS_DRIVER_SOURCES usbh_diskio.c)
     endif()
 endif()
-MESSAGE(STATUS "debug1 : " ${STORAGE_DRIVER})
-MESSAGE(STATUS "debug2 : " ${FATFS_DRIVER_SOURCES})

 SET(FATFS_OPTION_SOURCES syscall.c unicode.c)
 #if(CODE_PAGE EQUAL CP932)
@@ -63,10 +61,17 @@
     CMAKE_FIND_ROOT_PATH_BOTH
 )

+IF(${FATFS_DRIVER_INCLUDE_DIR} STREQUAL FATFS_DRIVER_INCLUDE_DIR-NOTFOUND)
+    MESSAGE("Driver header files not located in STM firemware, please manually include the appropriate X_diskio.h directory")
+    SET(FATFS_INCLUDE_DIRS
+    ${FATFS_COMMON_INCLUDE_DIR}
+        )
+ELSE()
 SET(FATFS_INCLUDE_DIRS
     ${FATFS_COMMON_INCLUDE_DIR}
     ${FATFS_DRIVER_INCLUDE_DIR}
 )
+ENDIF()

 FOREACH(SRC ${FATFS_COMMON_SOURCES})
     SET(SRC_FILE SRC_FILE-NOTFOUND)
@@ -83,7 +88,12 @@
         HINTS ${STM32Cube_DIR}/Middlewares/Third_Party/FatFs/src/drivers/
         CMAKE_FIND_ROOT_PATH_BOTH
     )
+STRING(FIND ${SRC_FILE} "NOTFOUND" SRC_FILE_NOTFOUND)
+IF(NOT ${SRC_FILE_NOTFOUND} EQUAL -1)
+    MESSAGE("Driver source files not located in STM firemware, please manually source the appropriate X_diskio.c files")
+ELSE()
     LIST(APPEND FATFS_SOURCES ${SRC_FILE})
+ENDIF()
 ENDFOREACH()

 FOREACH(SRC ${FATFS_OPTION_SOURCES})