cmake: change policy CMP0000 to NEW

cmake: change policy CMP0000 to NEW

Change CMake policy CMP0000 from OLD to NEW to resolve #8355.

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

--- cmake/app/boilerplate.cmake
+++ cmake/app/boilerplate.cmake
@@ -27,15 +27,17 @@
   set(MSYS 1)
 endif()

-# CMake version 3.8.2 is the minimum supported version. Version 3.9 is
-# supported but it introduced a warning that we do not wish to
-# show to users. Specifically, it displays a warning when an OLD
-# policy is used, but we need policy CMP0000 set to OLD to avoid
-# copy-pasting cmake_minimum_required across application
-# CMakeLists.txt files.
+# CMake version 3.8.2 is the real minimum supported version.
+#
+# Unfortunately CMake requires the toplevel CMakeLists.txt file to
+# define the required version, not even invoking it from an included
+# file, like boilerplate.cmake, is sufficient. It is however permitted
+# to have multiple invocations of cmake_minimum_required.
+#
+# Under these restraints we use a second 'cmake_minimum_required'
+# invocation in every toplevel CMakeLists.txt.
 cmake_minimum_required(VERSION 3.8.2)

-cmake_policy(SET CMP0000 OLD)
 cmake_policy(SET CMP0002 NEW)

 define_property(GLOBAL PROPERTY ZEPHYR_LIBS


cmake: kconfig: allow build systems to decide defconfig

Allow build system to define an alternative defconfig file.
This allows reusing the existing kconfig.cmake file in other projects,
such as multi image builds.

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

--- cmake/modules/kconfig.cmake
+++ cmake/modules/kconfig.cmake
@@ -59,7 +59,7 @@
   set(KCONFIG_ROOT ${ZEPHYR_BASE}/Kconfig)
 endif()

-set(BOARD_DEFCONFIG ${BOARD_DIR}/${BOARD}_defconfig)
+set_ifndef(BOARD_DEFCONFIG ${BOARD_DIR}/${BOARD}_defconfig)
 set(DOTCONFIG                  ${PROJECT_BINARY_DIR}/.config)
 set(PARSED_KCONFIG_SOURCES_TXT ${PROJECT_BINARY_DIR}/kconfig/sources.txt)


Fix cmake search for vulkan on Windows (#1343)

--- cmake/util/FindVulkan.cmake
+++ cmake/util/FindVulkan.cmake
@@ -28,7 +28,7 @@

    if(__vulkan_sdk)
      set(Vulkan_INCLUDE_DIRS ${__vulkan_sdk}/include)
-     find_library(Vulkan_LIBRARY vulkan ${__vulkan_sdk}/lib)
+     find_library(Vulkan_LIBRARY NAMES vulkan vulkan-1 PATHS ${__vulkan_sdk}/lib)
      if(Vulkan_LIBRARY)
        set(Vulkan_FOUND TRUE)
      endif()


macro for creating thrift library objects

Summary:
Creating thrift_library for a thrift file and using it in project works fine,
however if user library wants to export all of it's thrift defs to it's own
user libraries then it needs to install every single thrift library into device
which is not a suitable solution.

Generating object files and including them into user library seems to be desired
solution.

Changes alllows user libraries to create thrift-library as well as thrift-object
without much code deduplication.

Reviewed By: eduardo-elizondo

Differential Revision: D5943732

fbshipit-source-id: 551ae772c242df2785cf639adc9a920b0200106f

--- ThriftLibrary.cmake
+++ ThriftLibrary.cmake
@@ -1,28 +1,32 @@
+#
 # Requirements:
 # Please provide the following two variables before using these macros:
 #   ${THRIFT1} - path/to/bin/thrift1
 #   ${THRIFT_TEMPLATES} - path/to/include/thrift/templates
 #   ${THRIFTCPP2} - path/to/lib/thriftcpp2
-
-# thrift_library
-# This creates a library that will contain the source files and all the proper
+#
+
+#
+# thrift_object
+# This creates a object that will contain the source files and all the proper
 # dependencies to generate and compile thrift generated files
 #
 # Params:
-#   @file_name - The name of tge thrift file
+#   @file_name - The name of the thrift file
 #   @services  - A list of services that are declared in the thrift file
 #   @language  - The generator to use (cpp or cpp2)
 #   @options   - Extra options to pass to the generator
 #   @output_path - The directory where the thrift file lives
 #
 # Output:
-#  file-language - A library to link to be used for linking
+#  A object file named `${file-name}-${language}-obj` to include into your
+#  project's library
 #
 # Notes:
 # If any of the fields is empty, it is still required to provide an empty string
 #
 # Usage:
-#   thrift_library(
+#   thrift_object(
 #     #file_name
 #     #services
 #     #language
@@ -30,9 +34,10 @@
 #     #output_path
 #     #output_path
 #   )
-#   add_library(somelib ...)
-#   target_link_libraries(somelib file_name-language)
-macro(thrift_library file_name services language options file_path output_path)
+#   add_library(somelib $<TARGET_OBJECTS:${file_name}-${language}-obj> ...)
+#
+
+macro(thrift_object file_name services language options file_path output_path)
 thrift_generate(
   "${file_name}"   #file_name
   "${services}"    #services
@@ -42,12 +47,68 @@
   "${output_path}" #output_path
 )
 bypass_source_check(${${file_name}-${language}-SOURCES})
-add_library("${file_name}-${language}" ${${file_name}-${language}-SOURCES})
-add_dependencies("${file_name}-${language}" "${file_name}-${language}-target")
+add_library(
+  "${file_name}-${language}-obj"
+  OBJECT
+  ${${file_name}-${language}-SOURCES}
+)
+add_dependencies(
+  "${file_name}-${language}-obj"
+  "${file_name}-${language}-target"
+)
+message("Thrift will create the Object file : ${file_name}-${language}-obj")
+endmacro()
+
+# thrift_library
+# Same as thrift object in terms of usage but creates the library instead of
+# object so that you can use to link against your library instead of including
+# all symbols into your library
+#
+# Params:
+#   @file_name - The name of the thrift file
+#   @services  - A list of services that are declared in the thrift file
+#   @language  - The generator to use (cpp or cpp2)
+#   @options   - Extra options to pass to the generator
+#   @output_path - The directory where the thrift file lives
+#
+# Output:
+#  A library file named `${file-name}-${language}` to link against your
+#  project's library
+#
+# Notes:
+# If any of the fields is empty, it is still required to provide an empty string
+#
+# Usage:
+#   thrift_library(
+#     #file_name
+#     #services
+#     #language
+#     #options
+#     #output_path
+#     #output_path
+#   )
+#   add_library(somelib ...)
+#   target_link_libraries(somelibe ${file_name}-${language} ...)
+#
+
+macro(thrift_library file_name services language options file_path output_path)
+thrift_object(
+  "${file_name}"
+  "${services}"
+  "${language}"
+  "${options}"
+  "${file_path}"
+  "${output_path}"
+)
+add_library(
+  "${file_name}-${language}"
+  $<TARGET_OBJECTS:${file_name}-${language}-obj>
+)
 target_link_libraries("${file_name}-${language}" ${THRIFTCPP2})
-message("Thrift will create the Library: ${file_name}-${language}")
-endmacro()
-
+message("Thrift will create the Library file : ${file_name}-${language}")
+endmacro()
+
+#
 # bypass_source_check
 # This tells cmake to ignore if it doesn't see the following sources in
 # the library that will be installed. Thrift files are generated at compile
@@ -55,6 +116,8 @@
 #
 # Params:
 #   @sources - The list of files to ignore in source check
+#
+
 macro(bypass_source_check sources)
 set_source_files_properties(
   ${sources}
@@ -62,6 +125,7 @@
 )
 endmacro()

+#
 # thrift_generate
 # This is used to codegen thrift files using the thrift compiler
 # Params:
@@ -82,6 +146,8 @@
 # When using file_language-SOURCES it should always call:
 #   bypass_source_check(${file_language-SOURCES})
 # This will prevent cmake from complaining about missing source files
+#
+
 macro(thrift_generate file_name services language options file_path output_path)
 set("${file_name}-${language}-HEADERS"
   ${output_path}/gen-${language}/${file_name}_constants.h


COMP: Fix AnisotropicDiffusionLBR example build

Adds the following changes:

 Matt McCormick (12):
       COMP: Use Debian Fastly CDN
       ENH: Use a shallow clone of ITK to save bandwidth and disk space
       COMP: Add missing COMPONENTS to find_package example call
       ENH: Add CircleCI 2.0 configuration
       ENH: Add setup.py
       ENH: Update Python package version to 1.0.0
       ENH: Add appveyor.yml for Windows package builds
       ENH: Initial TravisCI configuration for packaging
       DOC: Update CI badges in the README
       DOC: Document Python package installation
       COMP: Add missing ImageToImageFilter base class #include
       BUG: Add module Doxygen group

Change-Id: Ida76e2e60e91f36b5310defd78b211e79d28f3bf

--- Modules/Remote/AnisotropicDiffusionLBR.remote.cmake
+++ Modules/Remote/AnisotropicDiffusionLBR.remote.cmake
@@ -20,5 +20,5 @@
     http://insight-journal.org/browse/publication/953
   "
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR.git
-  GIT_TAG 5bd898cb781685d26686b153d33ee484107163c8
+  GIT_TAG 50acf46da9fa1480eb502a0bb550c36d518893eb
   )


LCM can be found using lcm CMake configuration file

This allows targets to have transitive dependencies. such as lcm
depending on glib-2.0 and pthread

--- cmake/FindLCM.cmake
+++ cmake/FindLCM.cmake
@@ -7,6 +7,11 @@
 # <package>_INCLUDE_DIRS
 # <package>_LIBRARIES

+find_package(lcm QUIET CONFIG)
+if(lcm_FOUND)
+  set(LCM_LIBRARIES lcm::lcm)
+  return()
+endif()

 macro(pkg_config_find_module varname pkgname header library pathsuffix)


only glob composer_xe_* directories for the MIC_SDK dir

--- cmake/FindMIC.cmake
+++ cmake/FindMIC.cmake
@@ -45,7 +45,7 @@
 set(MIC_FOUND false)
 set(MIC_NATIVE_FOUND false)

-file(GLOB _intel_dirs "/opt/intel/*")
+file(GLOB _intel_dirs "/opt/intel/composer_xe_*")
 list(SORT _intel_dirs)
 list(REVERSE _intel_dirs)
 find_path(MIC_SDK_DIR bin/intel64_mic/icpc PATHS


update find script

update find script

--- cmake/FindMKL.cmake
+++ cmake/FindMKL.cmake
@@ -3,7 +3,7 @@
 #
 # Options:
 #
-#   MKL_STATAIC       :   use static linking
+#   MKL_STATIC       :   use static linking
 #   MKL_MULTI_THREADED:   use multi-threading
 #   MKL_SDL           :   Single Dynamic Library interface
 #
@@ -13,15 +13,37 @@
 #   MKL_INCLUDE_DIR      : where to find mkl.h, etc.
 #   MKL_INCLUDE_DIRS     : set when MKL_INCLUDE_DIR found
 #   MKL_LIBRARIES        : the library to link against.
+#
+# https://software.intel.com/en-us/mkl-linux-developer-guide-selecting-libraries-to-link-with
+#
+# https://software.intel.com/en-us/mkl-linux-developer-guide-dynamically-selecting-the-interface-and-threading-layer
+#

+#if (MKL_INCLUDE_DIRS AND MKL_LIBRARIES AND MKL_INTERFACE_LIBRARY AND
+#    MKL_SEQUENTIAL_LAYER_LIBRARY AND MKL_CORE_LIBRARY)
+#  set (MKL_FIND_QUIETLY TRUE)
+#endif()

-#message("CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}")
+set(MKL_INTEGER64 ON CACHE BOOL "Enable 64 bit integers on MKL")
+set(MKL_MULTI_THREADED ON CACHE BOOL "Enable MKL multithreading")
+set(MKL_SDL OFF CACHE BOOL "Enable MKL's  Single Dynamic Library (SDL)")

+if(DEFINED INTEL_ROOT AND NOT EXISTS INTEL_ROOT)
+    message(WARNING "The path INTEL_ROOT: ${INTEL_ROOT} does not exist")
+endif()
+
+if(NOT DEFINED MKL_ROOT)
+  if(DEFINED $ENV{MKL_ROOT})
+    set(MKL_ROOT $ENV{MKL_ROOT} CACHE STRING "Folder containing MKL")
+  else()
+    set(MKL_ROOT ${INTEL_ROOT}/mkl CACHE STRING "Folder containing MKL")
+  endif()
+  if(NOT EXISTS MKL_ROOT)
+    message(WARNING "The path MKL_ROOT: ${MKL_ROOT} does not exist")
+  endif()
+endif()

 include(FindPackageHandleStandardArgs)
-
-set(INTEL_ROOT "/opt/intel" CACHE PATH "Folder contains intel libs")
-set(MKL_ROOT ${INTEL_ROOT}/mkl CACHE PATH "Folder contains MKL")

 # intel64, ia32 # bad for MacOS
 if(CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -29,144 +51,95 @@
 else()
 set(MPL_ARCH intel64)
     set(MPL_ARCH ia32)
+# else: Intel MIC
 endif()

-#set(MKL_INTEGER64 OFF CACHE BOOL "Enable 64 bit integers on MKL")
-set(MKL_INTEGER64 OFF)
-
-if(variable STREQUAL "32")
+if("x${MPL_ARCH}" STREQUAL "x32")
     SET(ARCH_PREFIX "")
-else(variable STREQUAL "32")
+else()
     if(MKL_INTEGER64)
         SET(ARCH_PREFIX "_ilp64")
     else(MKL_INTEGER64)
         SET(ARCH_PREFIX "_lp64")
     endif(MKL_INTEGER64)
-endif(variable STREQUAL "32")
-
+endif()

 # Find include dir
-find_path(MKL_INCLUDE_DIR mkl.h
-    PATHS ${MKL_ROOT}/include)
+find_path(MKL_INCLUDE_DIR mkl.h PATHS ${MKL_ROOT}/include)

 # Find include directory
 #  There is no include folder under linux
 if(WIN32)
-    find_path(INTEL_INCLUDE_DIR omp.h
-        PATHS ${INTEL_ROOT}/include)
+    find_path(INTEL_INCLUDE_DIR omp.h PATHS ${MKL_ROOT}/include)
     set(MKL_INCLUDE_DIR ${MKL_INCLUDE_DIR} ${INTEL_INCLUDE_DIR})
 endif()

 # Find libraries

 # Handle suffix
-set(_MKL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
-#if(WIN32)
-#    if(MKL_STATAIC)
-#        set(CMAKE_FIND_LIBRARY_SUFFIXES .lib)
-#    else()
-#        set(CMAKE_FIND_LIBRARY_SUFFIXES _dll.lib)
-#    endif()
-#else()
-#    if(MKL_STATAIC)
-#        set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
-#    else()
-#        set(CMAKE_FIND_LIBRARY_SUFFIXES .so)
-#    endif()
-#endif()
+if(MKL_STATIC)
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
+else()
+    set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
+endif()

+if(MKL_SDL) # Using The Single Dynamic Library (SDL)
+    find_library(MKL_LIBRARY mkl_rt PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)

-# MKL is composed by four layers: Interface, Threading, Computational and RTL
+else() # MKL is composed by four layers: Interface, Threading, Computational and RTL

-if(MKL_SDL)
-    find_library(MKL_LIBRARY mkl_rt
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+    ####################### Computational layer #####################
+    find_library(MKL_CORE_LIBRARY mkl_core PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+
+    #find_library(MKL_FFT_LIBRARY mkl_cdft_core PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+    #find_library(MKL_SCALAPACK_LIBRARY mkl_scalapack${ARCH_PREFIX} PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+    #find_library(MKL_BLACS_LIBRARY NAMES mkl_blacs_intelmpi${ARCH_PREFIX} mkl_blacs_openmpi${ARCH_PREFIX} mkl_blacs${ARCH_PREFIX}   PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)

-    set(MKL_MINIMAL_LIBRARY ${MKL_LIBRARY})
-else()
+    #find_library(MPI_LIBRARY mpi_mt PATHS /opt/intel/composer_xe_2013.0.079/mpirt/lib/${MPL_ARCH}/)
+
     ######################### Interface layer #######################
-    if(WIN32)
-        set(MKL_INTERFACE_LIBNAME mkl_intel_c)
-    else()
-        set(MKL_INTERFACE_LIBNAME mkl_intel_lp64) #ilp64
-    endif()
-
-    find_library(MKL_INTERFACE_LIBRARY ${MKL_INTERFACE_LIBNAME}
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+    find_library(MKL_INTERFACE_LIBRARY mkl_intel${ARCH_PREFIX} mkl_intel_c PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)

     ######################## Threading layer ########################
     if(MKL_MULTI_THREADED)
-        message(STATUS "MKL multi-threaded.")
-        set(MKL_THREADING_LIBNAME mkl_intel_thread)
+      message(STATUS "MKL multi-threading enabled.")
+      find_library(MKL_THREADING_LIBRARY mkl_intel_thread PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+
+      #find_library(MKL_THREADING_LIBRARY mkl_pgi_thread
+      #find_library(MKL_THREADING_LIBRARY mkl_gnu_thread
+      #find_library(MKL_THREADING_LIBRARY mkl_tbb_thread
+      #find_library(MKL_THREADING_LIBRARY pthread)
     else()
-        set(MKL_THREADING_LIBNAME mkl_sequential)
+      find_library(MKL_THREADING_LIBRARY mkl_sequential PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
     endif()

-    find_library(MKL_THREADING_LIBRARY ${MKL_THREADING_LIBNAME}
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
+    ############################ RTL layer ##########################
+    find_library(MKL_RTL_LIBRARY iomp5 iomp5md PATHS ${MKL_ROOT}/lib/${MPL_ARCH} ${INTEL_ROOT}/compiler/lib/${MPL_ARCH} ${MKL_ROOT}/../compiler/lib/${MPL_ARCH})

-    ####################### Computational layer #####################
-    find_library(MKL_CORE_LIBRARY mkl_core
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
-    find_library(MKL_FFT_LIBRARY mkl_cdft_core
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
-    find_library(MKL_SCALAPACK_LIBRARY mkl_scalapack_lp64     # _core / _ilp64
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
-    #find_library(MKL_BLACS_LIBRARY mkl_blacs_intelmpi_lp64     # / _ilp64, intelmpi, openmpi
-    find_library(MKL_BLACS_LIBRARY mkl_blacs_lp64     # / _ilp64, intelmpi, openmpi
-        PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
-
-    #find_library(MKL_THREAD_LIBRARY mkl_intel_thread
-    #find_library(MKL_THREAD_LIBRARY mkl_pgi_thread
-    #find_library(MKL_THREAD_LIBRARY mkl_gnu_thread
-    #    PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/)
-    find_library(MKL_THREAD_LIBRARY pthread)
-
-    find_library(MPI_LIBRARY mpi_mt
-        PATHS /opt/intel/composer_xe_2013.0.079/mpirt/lib/${MPL_ARCH}/)
-
-#message(blacs: "${MKL_ROOT}/lib/${MPL_ARCH}")
-#set( MKL_BLACS_LIBRARY ${MKL_ROOT}/lib/${MPL_ARCH}/libmkl_blacs_lp64.a)
-
-    ############################ RTL layer ##########################
-    if(WIN32)
-        set(MKL_RTL_LIBNAME iomp5md)
-    else()
-        set(MKL_RTL_LIBNAME iomp5)
-    endif()
-    find_library(MKL_RTL_LIBRARY ${MKL_RTL_LIBNAME}
-        PATHS ${INTEL_ROOT}/lib/${MPL_ARCH} ${INTEL_MKL_ROOT}/lib )
-
-set(MKL_LIBRARY ${MKL_INTERFACE_LIBRARY}
-		${MKL_THREADING_LIBRARY}
-		${MKL_CORE_LIBRARY}
-		${MKL_FFT_LIBRARY}
-		${MKL_SCALAPACK_LIBRARY}
-		#${MKL_BLACS_LIBRARY}
-		${MKL_RTL_LIBRARY}
-		${MPI_LIBRARY}
-		${MKL_THREAD_LIBRARY}
-		)
-
-set(MKL_MINIMAL_LIBRARY ${MKL_INTERFACE_LIBRARY}
-			${MKL_THREADING_LIBRARY}
-			${MKL_CORE_LIBRARY}
-			${MKL_RTL_LIBRARY}
-			)
+    message("PATHS ${MKL_ROOT}/lib/${MPL_ARCH}/ ${INTEL_ROOT}/compiler/lib/${MPL_ARCH}/")
+
+set(MKL_LIBRARY ${MKL_CORE_LIBRARY} ${MKL_INTERFACE_LIBRARY} ${MKL_THREADING_LIBRARY} ${MKL_RTL_LIBRARY}
+  # ${MKL_FFT_LIBRARY} ${MKL_SCALAPACK_LIBRARY} ${MKL_BLACS_LIBRARY} ${MPI_LIBRARY}
+  )
 endif()

-#?
-#set(CMAKE_FIND_LIBRARY_SUFFIXES ${_MKL_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
+#message("MKL_CORE_LIBRARY: ${MKL_CORE_LIBRARY}")
+#message("MKL_INTERFACE_LIBRARY: ${MKL_INTERFACE_LIBRARY}")
+#message("MKL_THREADING_LIBRARY: ${MKL_THREADING_LIBRARY}")
+#message("MKL_RTL_LIBRARY: ${MKL_RTL_LIBRARY}")

-find_package_handle_standard_args(MKL DEFAULT_MSG
-    MKL_INCLUDE_DIR MKL_LIBRARY MKL_MINIMAL_LIBRARY)
+find_package_handle_standard_args(MKL DEFAULT_MSG MKL_INCLUDE_DIR MKL_LIBRARY)

 if(MKL_FOUND)
     message(STATUS "Found Intel MKL libraries.")
     set(MKL_LIBRARIES ${MKL_LIBRARY})
-    set(MKL_MINIMAL_LIBRARIES ${MKL_LIBRARY})
     mark_as_advanced (MKL_LIBRARY)
-    mark_as_advanced (MKL_MINIMAL_LIBRARY)
-endif()
+  else()
+      message(ERROR "THE MKL libraries were not found. Set INTEL_ROOT to the folder containing intel compilers and libraries, or set MKL_ROOT to the folder containing MKL.")
+  endif()

-#message("MKL_LIBRARIES: ${MKL_LIBRARIES}")
+
+#set(MKL_LIBRARY ${MKL_CORE_LIBRARY} ${MKL_INTERFACE_LIBRARY} ${MKL_THREADING_LIBRARY} ${MKL_RTL_LIBRARY}
+#  # ${MKL_FFT_LIBRARY} ${MKL_SCALAPACK_LIBRARY} ${MKL_BLACS_LIBRARY} ${MPI_LIBRARY}
+
+


DOC: Better warning message for ITK_BUILD_ALL_MODULES.

Remind users to remove depreacated ITK_BUILD_ALL_MODULES
from their CMake Cache.

Change-Id: I8f2ac669bccbaac781ab60bcaa6baf6e082502a0

--- CMake/ITKModuleEnablement.cmake
+++ CMake/ITKModuleEnablement.cmake
@@ -78,7 +78,9 @@

 # To maintain backward compatibility
 if(DEFINED ITK_BUILD_ALL_MODULES)
-  message(WARNING "ITK_BUILD_ALL_MODULES is deprecated, please use ITK_BUILD_DEFAULT_MODULES.")
+  message(WARNING "ITK_BUILD_ALL_MODULES is deprecated, please remove this entry from the CMake "
+                  "cache (edit the CMakeCache.txt file located in the top level of the ITK build "
+                  "tree directly or via the CMake GUI), and use ITK_BUILD_DEFAULT_MODULES instead.")
   set(ITK_BUILD_DEFAULT_MODULES ${ITK_BUILD_ALL_MODULES} CACHE BOOL "Build the default ITK modules." FORCE)
 endif()
 # Provide module selections by groups


Fixed InstallDependencies in 1.8.1 for boost 1.50+

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -180,7 +180,6 @@
       PATTERN "asio" EXCLUDE
       PATTERN "assign" EXCLUDE
       PATTERN "bimap" EXCLUDE
-      PATTERN "chrono" EXCLUDE
       PATTERN "circular_buffer" EXCLUDE
       PATTERN "compatibility" EXCLUDE
       PATTERN "concept_check" EXCLUDE
@@ -189,7 +188,6 @@
       PATTERN "filesystem" EXCLUDE
       PATTERN "flyweight" EXCLUDE
       PATTERN "format" EXCLUDE
-      PATTERN "functional" EXCLUDE
       PATTERN "fusion" EXCLUDE
       PATTERN "geometry" EXCLUDE
       PATTERN "gil" EXCLUDE
@@ -214,18 +212,15 @@
       PATTERN "ptr_container" EXCLUDE
       PATTERN "python" EXCLUDE
       PATTERN "random" EXCLUDE
-      PATTERN "ratio" EXCLUDE
       PATTERN "regex" EXCLUDE
       PATTERN "serialization" EXCLUDE
       PATTERN "signals" EXCLUDE
       PATTERN "signals2" EXCLUDE
       PATTERN "spirit" EXCLUDE
       PATTERN "statechart" EXCLUDE
-      PATTERN "system" EXCLUDE
       PATTERN "test" EXCLUDE
       PATTERN "timer" EXCLUDE
       PATTERN "tr1" EXCLUDE
-      PATTERN "typeof" EXCLUDE
       PATTERN "units" EXCLUDE
       PATTERN "unordered" EXCLUDE
       PATTERN "uuid" EXCLUDE


Adding additional directories to search for the Ogre framework when using a prebuilt SDK with your own projects under OS X

--- CMake/Utils/FindPkgMacros.cmake
+++ CMake/Utils/FindPkgMacros.cmake
@@ -131,6 +131,10 @@
       /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
       ${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
+      ${OGRE_PREFIX_PATH}/lib/Release
+      ${OGRE_PREFIX_PATH}/lib/Debug
+      ${OGRE_PREFIX_BUILD}/lib/Release
+      ${OGRE_PREFIX_BUILD}/lib/Debug
     )
     FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
       SET(fwkpath ${dir}/${fwk}.framework)


Implemented mac staging for DEV-41722 normalizing shared lib staging. also added a bunch of comments.

--- indra/cmake/Copy3rdPartyLibs.cmake
+++ indra/cmake/Copy3rdPartyLibs.cmake
@@ -6,6 +6,9 @@

 include(CMakeCopyIfDifferent)

+###################################################################
+# set up platform specific lists of files that need to be copied
+###################################################################
 if(WINDOWS)
     set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
     set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
@@ -26,6 +29,7 @@
     # Misc shared libs

     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
     set(debug_files
         openjpegd.dll
@@ -36,6 +40,7 @@
         )

     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
     set(release_files
         openjpeg.dll
@@ -127,16 +132,37 @@
 endif (MSVC80)

 elseif(DARWIN)
+    set(SHARED_LIB_STAGING_DIR_DEBUG            "${SHARED_LIB_STAGING_DIR}/Debug")
+    set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO   "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
+    set(SHARED_LIB_STAGING_DIR_RELEASE          "${SHARED_LIB_STAGING_DIR}/Release")
+
     set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/universal-darwin")
     set(vivox_files
-       )
-    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/debug")
+        SLVoice
+        libalut.dylib
+        libopenal.dylib
+        libortp.dylib
+        libvivoxsdk.dylib
+       )
+    # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
+    set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_debug")
     set(debug_files
        )
     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
-    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release")
+    # or ARCH_PREBUILT_DIRS
+    set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib_release")
     set(release_files
+        libapr-1.0.3.7.dylib
+        libapr-1.0.3.8.dylib
+        libapr-1.dylib
+        libaprutil-1.0.3.8.dylib
+        libaprutil-1.0.3.9.dylib
+        libaprutil-1.dylib
+        libexpat.0.5.0.dylib
+        libexpat.dylib
+        libllqtwebkit.dylib
+        libndofdev.dylib
        )

     # fmod is statically linked on darwin
@@ -162,10 +188,12 @@
     set(vivox_files
        )
     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
     set(debug_files
        )
     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
     set(release_files
        )
@@ -194,9 +222,11 @@
     set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
     set(vivox_files "")
     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
     set(debug_files "")
     # *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
+    # or ARCH_PREBUILT_DIRS
     set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
     set(release_files "")

@@ -209,6 +239,10 @@
     set(relwithdebinfo_llkdu_dst "")
 endif(WINDOWS)

+
+################################################################
+# Done building the file lists, now set up the copy commands.
+################################################################

 copy_if_different(
     ${vivox_src_dir}


===GT=== #1831 	libcgroup should only be attempted upon not windows machines.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -462,7 +462,6 @@
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/openssl/0.9.8h-p2)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/pcre/7.6)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/gsoap/2.7.10-p5)
-add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libcgroup/0.37)
 add_subdirectory(${CONDOR_SOURCE_DIR}/src/classad)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/zlib/1.2.3)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/curl/7.19.6-p1 )
@@ -477,6 +476,7 @@
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libxml2/2.7.3)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libvirt/0.6.2)
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libdeltacloud/0.7)
+	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/libcgroup/0.37)

 	# globus is an odd *beast* which requires a bit more config.
 	add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/globus/5.0.1-p1)


Relax version matching rules for python bindings. #6244

Allow python library and interpreter versions to be different, as long
as the interpreter is newer and has the same major version.
Some of our mac build machines have minor version skew, which shouldn't
cause any issues.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -88,7 +88,6 @@
 	# on systems with both python2 and python3.
 	if (DEFINED PYTHONLIBS_VERSION_STRING)
 		set(PythonInterp_FIND_VERSION "${PYTHONLIBS_VERSION_STRING}")
-		set(PythonInterp_FIND_VERSION_EXACT ON)
 	endif()
 	include (FindPythonInterp)
 else()


(CMAKE) Allow warning message from user with -Wno-error=cpp

--- backends/cmake/project.cmake
+++ backends/cmake/project.cmake
@@ -2,7 +2,7 @@
 include(arm-none-eabi-gcc)

 #common compile flags
-set(COMMON_COMPILE_FLAGS "-Os -g -Werror -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
+set(COMMON_COMPILE_FLAGS "-Os -g -Werror -Wno-error=cpp -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
 #set(COMMON_COMPILE_FLAGS "-Os -Werror -Wextra -Warray-bounds -ffunction-sections -fdata-sections")
 #-u _printf_float
 set(COMMON_LINK_FLAGS "-Wl,--gc-sections --specs=nano.specs")


fbcode_builder: fix a minor bug in THRIFT_INCLUDE_DIR argument parsing

Summary:
Fix a minor bug in the argument parsing for `add_fbthrift_cpp_library()`:
only a single value should be supplied for the `THRIFT_INCLUDE_DIR` argument.
This parameter should not accept a list of arguments.

Reviewed By: strager

Differential Revision: D17125810

fbshipit-source-id: 31f354e4d6299d3626a94f3b4b5ff8c58bb0cf7b

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -22,8 +22,8 @@
 #   desired.
 function(add_fbthrift_cpp_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(one_value_args INCLUDE_DIR)
-  set(multi_value_args SERVICES DEPENDS OPTIONS THRIFT_INCLUDE_DIR)
+  set(one_value_args INCLUDE_DIR THRIFT_INCLUDE_DIR)
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
   fb_cmake_parse_args(
     ARG "" "${one_value_args}" "${multi_value_args}" "${ARGN}"
   )


- Fix include directories on export on OSX

--- cmake/Find/FindStandardLibs.cmake
+++ cmake/Find/FindStandardLibs.cmake
@@ -29,7 +29,7 @@
         # On Android, it is also used to read assets and
         #  acquiring device info.
         find_package(SDL2 REQUIRED)
-        if(SDL2_INCLUDE_DIR)
+        if(SDL2_INCLUDE_DIR AND NOT APPLE)
             list ( APPEND CORE_INCLUDE_DIR
                 $<BUILD_INTERFACE:${SDL2_INCLUDE_DIR}>
                 $<INSTALL_INTERFACE:include/SDL2>


Fix a mistake in r217762

Fix a mistake in r217762

Summary:
The extra macro definition needs to go into COMPILER_RT_GTEST_CFLAGS
in order to be used for gtests on MSVC2012.

Test Plan: This is part of the fixes necessary for the ASAN tests to pass with MSVC2012.

Reviewers: timurrrr

Subscribers: llvm-commits

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

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -142,7 +142,7 @@
   # Visual Studio 2012 only supports up to 8 template parameters in
   # std::tr1::tuple by default, but gtest requires 10
   if(MSVC_VERSION EQUAL 1700)
-    add_definitions(-D_VARIADIC_MAX=10)
+    list(APPEND COMPILER_RT_GTEST_CFLAGS -D_VARIADIC_MAX=10)
   endif()
 endif()


[cxxmodules] Also install generated C++ modules

We generate C++ modules, but we currently don't install them where
they belong.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -431,6 +431,12 @@
   if(NOT ARG_NOINSTALL AND NOT CMAKE_ROOTTEST_DICT AND DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
     set_property(GLOBAL APPEND PROPERTY ROOT_DICTIONARY_TARGETS ${dictname})
     set_property(GLOBAL APPEND PROPERTY ROOT_DICTIONARY_FILES ${CMAKE_CURRENT_BINARY_DIR}/${dictionary}.cxx)
+
+    # Install the C++ module if we generated one.
+    if (cpp_module_file)
+      install(FILES ${cpp_module_file}
+                    DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
+    endif()

     if(ARG_STAGE1)
       install(FILES ${rootmap_name}


Fix from Pere attempting to fix the mathtext issue with cmake on windows.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@46989 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -267,7 +267,7 @@
     message("Target ${library} already exists. Renaming target name to ${library}_new")
     set(library ${library}_new)
   endif()
-  if(WIN32 AND NOT ARG_DLLEXPORT)
+  if(WIN32 AND ARG_TYPE STREQUAL SHARED AND NOT ARG_DLLEXPORT)
     #---create a list of all the object files-----------------------------
     if(CMAKE_GENERATOR MATCHES "Visual Studio")
       foreach(src1 ${lib_srcs})


Boost: include like cmake file, use local variable

--- cmake/projects/Boost/hunter.cmake
+++ cmake/projects/Boost/hunter.cmake
@@ -13,7 +13,7 @@
 set(Boost_NO_SYSTEM_PATHS ON)

 # use base url for official boost releases
-set(Boost_base_url "https://downloads.sourceforge.net/project/boost/boost/")
+set(_hunter_boost_base_url "https://downloads.sourceforge.net/project/boost/boost/")

 hunter_add_version(
     PACKAGE_NAME
@@ -21,7 +21,7 @@
     VERSION
     "1.63.0"
     URL
-    "${Boost_base_url}/1.63.0/boost_1_63_0.tar.bz2"
+    "${_hunter_boost_base_url}/1.63.0/boost_1_63_0.tar.bz2"
     SHA1
     9f1dd4fa364a3e3156a77dc17aa562ef06404ff6
 )
@@ -32,7 +32,7 @@
     VERSION
     "1.62.0"
     URL
-    "${Boost_base_url}/1.62.0/boost_1_62_0.tar.bz2"
+    "${_hunter_boost_base_url}/1.62.0/boost_1_62_0.tar.bz2"
     SHA1
     5fd97433c3f859d8cbab1eaed4156d3068ae3648
 )
@@ -44,7 +44,7 @@
     VERSION
     "1.61.0"
     URL
-    "${Boost_base_url}/1.61.0/boost_1_61_0.tar.bz2"
+    "${_hunter_boost_base_url}/1.61.0/boost_1_61_0.tar.bz2"
     SHA1
     f84b1a1ce764108ec3c2b7bd7704cf8dfd3c9d01
 )


Properly set CLucene_FOUND based on the version. Also CLUCENE_MAX_VERSION_SUPPORTED was a very weird field which in addition was wrongly named.

svn path=/trunk/kdesupport/strigi/; revision=812718

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -13,83 +13,83 @@
 INCLUDE(FindLibraryWithDebug)

 if(NOT CLUCENE_MIN_VERSION)
-  set(CLUCENE_MIN_VERSION "0.9.16")
+  set(CLUCENE_MIN_VERSION "0.9.21")
 endif(NOT CLUCENE_MIN_VERSION)
-
-if(NOT CLUCENE_MAX_SUPPORTED_VERSION)
-  set(CLUCENE_MAX_SUPPORTED_VERSION "0.9.17")
-endif(NOT CLUCENE_MAX_SUPPORTED_VERSION)

 IF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)
   INCLUDE(${PROJECT_CMAKE}/CLuceneConfig.cmake)
 ENDIF(EXISTS ${PROJECT_CMAKE}/CLuceneConfig.cmake)

-  SET(TRIAL_LIBRARY_PATHS
-    $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX}
-    ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
-    /usr/local/lib${LIB_SUFFIX}
-    /usr/lib${LIB_SUFFIX}
-    /sw/lib${LIB_SUFFIX}
+SET(TRIAL_LIBRARY_PATHS
+  $ENV{CLUCENE_HOME}/lib${LIB_SUFFIX}
+  ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
+  /usr/local/lib${LIB_SUFFIX}
+  /usr/lib${LIB_SUFFIX}
+  /sw/lib${LIB_SUFFIX}
   )
-  SET(TRIAL_INCLUDE_PATHS
-    $ENV{CLUCENE_HOME}/include
-    ${CMAKE_INSTALL_PREFIX}/include
-    /usr/local/include
-    /usr/include
-    /sw/include
+SET(TRIAL_INCLUDE_PATHS
+  $ENV{CLUCENE_HOME}/include
+  ${CMAKE_INSTALL_PREFIX}/include
+  /usr/local/include
+  /usr/include
+  /sw/include
   )
-  FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
-      WIN32_DEBUG_POSTFIX d
-      NAMES clucene clucene-core
-      PATHS ${TRIAL_LIBRARY_PATHS})
-  IF (CLUCENE_LIBRARY)
-    MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
-  ENDIF (CLUCENE_LIBRARY)
-  FIND_PATH(CLUCENE_INCLUDE_DIR
-      NAMES CLucene.h
-      PATHS ${TRIAL_INCLUDE_PATHS})
+FIND_LIBRARY_WITH_DEBUG(CLUCENE_LIBRARY
+  WIN32_DEBUG_POSTFIX d
+  NAMES clucene clucene-core
+  PATHS ${TRIAL_LIBRARY_PATHS})
+IF (CLUCENE_LIBRARY)
+  MESSAGE(STATUS "Found CLucene library: ${CLUCENE_LIBRARY}")
+ENDIF (CLUCENE_LIBRARY)
+FIND_PATH(CLUCENE_INCLUDE_DIR
+  NAMES CLucene.h
+  PATHS ${TRIAL_INCLUDE_PATHS})

-  IF (CLUCENE_INCLUDE_DIR)
-    MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
-  ENDIF (CLUCENE_INCLUDE_DIR)
-
-  IF(WIN32)
-    SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR})
-  ENDIF(WIN32)
-  set(CLUCENE_GOOD_VERSION TRUE)
-  FIND_PATH(CLUCENE_LIBRARY_DIR
-      NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH)
-  IF (CLUCENE_LIBRARY_DIR)
-    MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
-    FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
-    STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
-    IF (CLMATCH)
-      STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
-	  IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
-	    MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}")
-            set(CLUCENE_GOOD_VERSION FALSE)
-	  ENDIF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
-	  IF (CLUCENE_VERSION STREQUAL "${CLUCENE_MAX_SUPPORTED_VERSION}")
-	    MESSAGE(FATAL_ERROR "CLucene version ${CLUCENE_MAX_SUPPORTED_VERSION} is not supported.")
-            set(CLUCENE_GOOD_VERSION FALSE)
-	  ENDIF (CLUCENE_VERSION STREQUAL "${CLUCENE_MAX_SUPPORTED_VERSION}")
-    ENDIF (CLMATCH)
-  ENDIF (CLUCENE_LIBRARY_DIR)
+IF (CLUCENE_INCLUDE_DIR)
+  MESSAGE(STATUS "Found CLucene include dir: ${CLUCENE_INCLUDE_DIR}")
+ENDIF (CLUCENE_INCLUDE_DIR)
+
+IF(WIN32)
+  SET(TRIAL_LIBRARY_PATHS ${CLUCENE_INCLUDE_DIR})
+ENDIF(WIN32)
+
+SET(CLUCENE_GOOD_VERSION TRUE)
+
+FIND_PATH(CLUCENE_LIBRARY_DIR
+  NAMES CLucene/clucene-config.h PATHS ${TRIAL_LIBRARY_PATHS} ${TRIAL_INCLUDE_PATHS} NO_DEFAULT_PATH)
+IF (CLUCENE_LIBRARY_DIR)
+  MESSAGE(STATUS "Found CLucene library dir: ${CLUCENE_LIBRARY_DIR}")
+  FILE(READ ${CLUCENE_LIBRARY_DIR}/CLucene/clucene-config.h CLCONTENT)
+  STRING(REGEX MATCH "_CL_VERSION +\".*\"" CLMATCH ${CLCONTENT})
+  IF (CLMATCH)
+    STRING(REGEX REPLACE "_CL_VERSION +\"(.*)\"" "\\1" CLUCENE_VERSION ${CLMATCH})
+	IF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
+	  MESSAGE(ERROR " CLucene version ${CLUCENE_VERSION} is less than the required minimum ${CLUCENE_MIN_VERSION}")
+      SET(CLUCENE_GOOD_VERSION FALSE)
+	ENDIF (CLUCENE_VERSION STRLESS "${CLUCENE_MIN_VERSION}")
+	IF (CLUCENE_VERSION STREQUAL "0.9.17")
+	  MESSAGE(ERROR "CLucene version 0.9.17 is not supported.")
+      SET(CLUCENE_GOOD_VERSION FALSE)
+	ENDIF (CLUCENE_VERSION STREQUAL "0.9.17")
+  ENDIF (CLMATCH)
+ENDIF (CLUCENE_LIBRARY_DIR)

 IF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
-  SET(CLucene_FOUND 1)
+  SET(CLucene_FOUND TRUE)
+ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+
+IF(CLucene_FOUND)
   IF(NOT CLucene_FIND_QUIETLY)
     MESSAGE(STATUS "Found CLucene: ${CLUCENE_LIBRARY}")
   ENDIF(NOT CLucene_FIND_QUIETLY)
-ELSE(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
-  SET(CLucene_FOUND 0)
+ELSE(CLucene_FOUND)
   IF(CLucene_FIND_REQUIRED)
     MESSAGE(FATAL_ERROR "Could not find CLucene.")
   ENDIF(CLucene_FIND_REQUIRED)
-ENDIF(CLUCENE_INCLUDE_DIR AND CLUCENE_LIBRARY AND CLUCENE_LIBRARY_DIR AND CLUCENE_GOOD_VERSION)
+ENDIF(CLucene_FOUND)

 MARK_AS_ADVANCED(
   CLUCENE_INCLUDE_DIR
   CLUCENE_LIBRARY_DIR
   CLUCENE_LIBRARY
-)
+  )


find Clucene also in the /usr/lib64 directory

svn path=/trunk/kdesupport/strigi/; revision=900984

--- cmake/FindCLucene.cmake
+++ cmake/FindCLucene.cmake
@@ -26,6 +26,7 @@
   /usr/local/lib${LIB_SUFFIX}
   /opt/local/lib${LIB_SUFFIX}
   /usr/lib${LIB_SUFFIX}
+  /usr/lib64${LIB_SUFFIX}
   /sw/lib${LIB_SUFFIX}
   /usr/pkg/lib${LIB_SUFFIX}
   )


set global hidden visibility flag

set global hidden visibility flag

--- cmake/build_rules.cmake
+++ cmake/build_rules.cmake
@@ -31,6 +31,7 @@

 set_property(GLOBAL PROPERTY rule_launch_compile ccache)
 set_property(GLOBAL PROPERTY rule_launch_link ccache)
+set( CMAKE_CXX_VISIBILITY_PRESET hidden )

 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wshadow -Wfatal-errors -fvisibility=hidden" )


[CMake] We only want to copy the headers for macOS.

<rdar://problem/55916729>

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

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -86,11 +86,13 @@

 # At build time, copy the staged headers into the framework bundle (and do
 # some post-processing in-place).
+if (NOT IOS)
 add_custom_command(TARGET liblldb POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${lldb_header_staging} $<TARGET_FILE_DIR:liblldb>/Headers
   COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
   COMMENT "LLDB.framework: copy framework headers"
 )
+endif()

 # Copy vendor-specific headers from clang (without staging).
 if(NOT IOS)


Made the condition syntax inside string_char_at consistent with string_char_at_set

--- cmake/string/string_char_at.cmake
+++ cmake/string/string_char_at.cmake
@@ -14,7 +14,7 @@
   string_normalize_index("${input}" ${index})
   ans(index)

-  if("${index}" LESS 0 OR ${index} EQUAL "${len}" OR ${index} GREATER ${len})
+  if(${index} LESS 0 OR ${index} EQUAL ${len} OR ${index} GREATER ${len})
     return()
   endif()


Start of new build-time source code plugin mechanism

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -34,6 +34,13 @@
 	IF(NOT ${is_metalib})
 		PROJECT(mrpt-${name})
 	ENDIF(NOT ${is_metalib})
+
+	# Optional build-time plugin mechanism:
+	SET(mrpt-${name}_PLUGIN_FILE "" CACHE FILE "Optional CMake file defining additional sources for mrpt-${name}")
+	MARK_AS_ADVANCED(mrpt-${name}_PLUGIN_FILE)
+	IF (EXISTS "${mrpt-${name}_PLUGIN_FILE}")
+		INCLUDE("${mrpt-${name}_PLUGIN_FILE}")
+	ENDIF()

 	# There is an optional LISTS of extra sources from the caller:
 	#  "${name}_EXTRA_SRCS" and


fptu: cmake: copy DLL's PDB-files for tests under Windows.

--- cmake.fptu/testing.cmake
+++ cmake.fptu/testing.cmake
@@ -218,6 +218,9 @@
           else(dir)
             # Path is configuration-depended or not available, should copy dll
             add_custom_command(TARGET ${target} POST_BUILD
+              COMMAND if exist "$<TARGET_PDB_FILE:${dep}>"
+              ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_PDB_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>")
+            add_custom_command(TARGET ${target} POST_BUILD
               COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<TARGET_FILE:${dep}>" "$<TARGET_FILE_DIR:${target}>"
               COMMENT "${UT_NEED_DLLCRUTCH}: Copy shared library ${dep} for test ${target}")
           endif(dir)


Updated CodeCoverage.cmake to check to see if we have a GCOV and LCOV path set in our environment

--- cmake/CodeCoverage.cmake
+++ cmake/CodeCoverage.cmake
@@ -67,11 +67,39 @@
 #
 #

+IF(DEFINED ENV{GCOV_PATH})
+    SET(GCOV_PATH $ENV{GCOV_PATH})
+ENDIF()
+
+IF(DEFINED ENV{LCOV_PATH})
+    SET(LCOV_PATH $ENV{LCOV_PATH})
+ENDIF()
+
+IF(DEFINED ENV{GENHTML_PATH})
+    SET(GENHTML_PATH $ENV{GENHTML_PATH})
+ENDIF()
+
+IF(DEFINED ENV{GCOVR_PATH})
+    SET(GCOVR_PATH $ENV{GCOVR_PATH})
+ENDIF()
+
+
 # Check prereqs
-FIND_PROGRAM( GCOV_PATH gcov )
-FIND_PROGRAM( LCOV_PATH lcov )
-FIND_PROGRAM( GENHTML_PATH genhtml )
-FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+IF(NOT GCOV_PATH)
+  FIND_PROGRAM( GCOV_PATH gcov )
+ENDIF()
+
+IF(NOT LCOV_PATH)
+  FIND_PROGRAM( LCOV_PATH lcov )
+ENDIF()
+
+IF(NOT GENHTML_PATH)
+  FIND_PROGRAM( GENHTML_PATH genhtml )
+ENDIF()
+
+IF(NOT GCOVR_PATH)
+  FIND_PROGRAM( GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)
+ENDIF()

 IF(NOT GCOV_PATH)
 	MESSAGE(FATAL_ERROR "gcov not found! Aborting...")


build: add gen-gpg-testkey to TOOLS

build: add gen-gpg-testkey to TOOLS

See #1981 .

--- cmake/ElektraCache.cmake
+++ cmake/ElektraCache.cmake
@@ -78,7 +78,7 @@
 endif ()

 if (TOOLS MATCHES "ALL")
-	set (TOOLS_LIST gen race qt-gui)
+	set (TOOLS_LIST gen race qt-gui gen-gpg-testkey)
 	set (TOOLS_FORCE FORCE)
 	list (REMOVE_ITEM TOOLS
 			  ALL)


Add libbiodynamo pcm file to installation directory

--- cmake/Installation.cmake
+++ cmake/Installation.cmake
@@ -50,6 +50,7 @@
 install(FILES cmake/FindROOT.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDATADIR})
 install(FILES cmake/RootUseFile.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDATADIR})
 install(FILES ${CMAKE_BINARY_DIR}/UseBioDynaMo.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDATADIR})
+install(FILES build/libbiodynamo_dict_rdict.pcm DESTINATION ${CMAKE_INSTALL_LIBDIR})
 # CMake files required from external projects
 install(FILES cmake/BioDynaMoConfig.cmake DESTINATION ${CMAKE_INSTALL_CMAKEDIR})


Prevent linking failure, bug 4108

Prevent linking failure, bug 4108

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -808,7 +808,7 @@
     __ocv_parse_test_sources(PERF ${ARGN})

     # opencv_imgcodecs is required for imread/imwrite
-    set(perf_deps ${the_module} opencv_ts opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
+    set(perf_deps opencv_ts ${the_module} opencv_imgcodecs ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
     ocv_check_dependencies(${perf_deps})

     if(OCV_DEPENDENCIES_FOUND)
@@ -829,7 +829,7 @@

       ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch})
       ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}")
-      ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${perf_deps} ${OPENCV_LINKER_LIBS})
+      ocv_target_link_libraries(${the_target} ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
       add_dependencies(opencv_perf_tests ${the_target})

       # Additional target properties
@@ -864,7 +864,7 @@
     __ocv_parse_test_sources(TEST ${ARGN})

     # opencv_imgcodecs is required for imread/imwrite
-    set(test_deps ${the_module} opencv_ts opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
+    set(test_deps opencv_ts ${the_module} opencv_imgcodecs opencv_videoio ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULE_opencv_ts_DEPS})
     ocv_check_dependencies(${test_deps})
     if(OCV_DEPENDENCIES_FOUND)
       set(the_target "opencv_test_${name}")
@@ -884,7 +884,7 @@

       ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch})
       ocv_target_include_modules(${the_target} ${test_deps} "${test_path}")
-      ocv_target_link_libraries(${the_target} ${OPENCV_MODULE_${the_module}_DEPS} ${test_deps} ${OPENCV_LINKER_LIBS})
+      ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS})
       add_dependencies(opencv_tests ${the_target})

       # Additional target properties


fix installation of main module headers

fix installation of main module headers

see: http://code.opencv.org/issues/2897

The order of the 2 conditions is really important, as every MATCHES
operator sets ${CMAKE_MATCH_1}, which is needed inside the condition
block. Ideally, this should be done using a single regex with a
negative forward lookahead, but CMake doesn't seem to support this

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -535,7 +535,7 @@
   if(OPENCV_MODULE_${the_module}_HEADERS AND ";${OPENCV_MODULES_PUBLIC};" MATCHES ";${the_module};")
     foreach(hdr ${OPENCV_MODULE_${the_module}_HEADERS})
       string(REGEX REPLACE "^.*opencv2/" "opencv2/" hdr2 "${hdr}")
-      if(hdr2 MATCHES "^(opencv2/.*)[^/]+.h(..)?$" AND NOT hdr2 MATCHES "opencv2/${the_module}/private.*")
+      if(NOT hdr2 MATCHES "opencv2/${the_module}/private.*" AND hdr2 MATCHES "^(opencv2/?.*)/[^/]+.h(..)?$" )
         install(FILES ${hdr} DESTINATION "${OPENCV_INCLUDE_INSTALL_PATH}/${CMAKE_MATCH_1}" COMPONENT main)
       endif()
     endforeach()


cmake: fix typo

cmake: fix typo

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -804,7 +804,7 @@
     if(DEFINED OPENCV_VS_VERSIONINFO_FILE)
       set(_VS_VERSION_FILE "${OPENCV_VS_VERSIONINFO_FILE}")
     elseif(DEFINED OPENCV_VS_VERSIONINFO_${the_module}_FILE)
-      set(_VS_VERSION_FILE "${OPENCV_VS_VERSIONINFO_${the_module}_FILE")
+      set(_VS_VERSION_FILE "${OPENCV_VS_VERSIONINFO_${the_module}_FILE}")
     elseif(NOT OPENCV_VS_VERSIONINFO_SKIP_GENERATION)
       set(_VS_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/vs_version.rc")
       ocv_generate_vs_version_file("${_VS_VERSION_FILE}"


Remove cmake devs warnings when configuring externals.

--- cmake/externalFunc.cmake
+++ cmake/externalFunc.cmake
@@ -41,6 +41,7 @@
         execute_process(
             COMMAND ${CMAKE_COMMAND} ${FOLDER}
                 ${RADIUM_EXTERNAL_CMAKE_OPTIONS}
+                -Wno-dev
                 ${ARGN}
             WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/external
             RESULT_VARIABLE ret


remove the ObjC related LANGUAGE hack which was needed in cmake 3.1 and older

--- cmake/fips_private.cmake
+++ cmake/fips_private.cmake
@@ -237,15 +237,6 @@
         source_group("${CurGroup}" FILES ${cur_file})

         if (FIPS_OSX)
-            # mark .m as .c file for older cmake versions (bug is fixed in cmake 3.1+)
-            # breaks in CMake 3.20+
-            # see: https://cmake.org/cmake/help/latest/policy/CMP0119.html#policy:CMP0119
-            if (${CMAKE_VERSION} VERSION_LESS "3.1.0")
-                if ("${f_ext}" STREQUAL ".m")
-                    set_source_files_properties(${cur_file} PROPERTIES LANGUAGE C)
-                endif()
-            endif()
-
             # handle plist files special
             if ("${f_ext}" STREQUAL ".plist")
                 set(FIPS_OSX_PLIST_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${cur_file}")


CMake package find fix.

CMake package find fix.

--- cmake/globalmacros.cmake
+++ cmake/globalmacros.cmake
@@ -980,6 +980,9 @@
       # Make string upper case
       #string(TOUPPER ${package} u_package)
       ivw_depend_name(u_package ${package})
+      if(NOT DEFINED ${u_package}_FOUND AND DEFINED ${package}_FOUND)
+        set(u_package ${package})
+      endif()

       #--------------------------------------------------------------------
       # Set includes and append to list


HAVE_PTHREAD defaults to OFF for Mac OS X for the reasons given in the
commentary there.  This decision should be periodically reviewed.

svn path=/trunk/; revision=9309

--- cmake/modules/xwin.cmake
+++ cmake/modules/xwin.cmake
@@ -31,7 +31,17 @@
   if(X11_FOUND)
     set(xwin_COMPILE_FLAGS "${X11_COMPILE_FLAGS}")
     set(xwin_LINK_FLAGS "${X11_LIBRARIES}")
-    option(HAVE_PTHREAD "Use pthreads with the xwin driver" ON)
+    if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      # turn HAVE_PTHREAD OFF by default for Mac OS X since it doesn't
+      # work for Mac OS X 10.4.  Werner says it does work for vanilla
+      # XQuartz X11, but the official Apple version of X(Quartz) for 10.5
+      # doesn't have all the fixes of the vanilla version so he doesn't trust
+      # it.  This his advice for now is to be conservative until we can
+      # get a clear report that official X works for 10.5.
+      option(HAVE_PTHREAD "Use pthreads with the xwin driver" OFF)
+    else(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+      option(HAVE_PTHREAD "Use pthreads with the xwin driver" ON)
+    endif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
     if(HAVE_PTHREAD)
       find_package(Threads)
       if(CMAKE_USE_PTHREADS_INIT)


COMP. deactivating NavigationToolStorageSerializerAndDeserializerTest

* deactivating due to strange behaviour, fails on some but not all nightly clients.
* After the test also failed after an irrelevant commit. It will be deactivated until this is fixed...

--- Modules/IGT/Testing/files.cmake
+++ Modules/IGT/Testing/files.cmake
@@ -28,7 +28,7 @@

    # ------------------ Navigation Tool Management Tests -------------------
    mitkNavigationToolStorageTest.cpp
-   mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
+   #mitkNavigationToolStorageSerializerAndDeserializerTest.cpp
    mitkNavigationToolTest.cpp
    mitkNavigationToolReaderAndWriterTest.cpp #deactivated, see bug #3461
    # -----------------------------------------------------------------------


[Cmake] Update FindPySide2Tools for PySide2 5.14 - issue #4229

Since PySide2 5.14, 'pyside2-rcc' and 'pyside2-uic' have been renamed into plain 'rcc' and 'uic'.
This leads FindPySide2Tools.cmake to no longer find rcc/uic, as reported in bug #4229 (https://www.freecadweb.org/tracker/view.php?id=4229) and prevents compilation.
FindPySide2Tools has been updated accordingly.

--- cMake/FindPySide2Tools.cmake
+++ cMake/FindPySide2Tools.cmake
@@ -20,8 +20,24 @@
     set(PYSIDE_BIN_DIR ${PYTHON_BIN_DIR})
 endif(WIN32 OR ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

-FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
-FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+# Since Qt v5.14, pyside2-uic and pyside2-rcc are directly provided by Qt5Core uic and rcc, with '-g python' option
+# We test Qt5Core version to act accordingly
+
+FIND_PACKAGE(Qt5Core)
+
+IF(Qt5Core_VERSION LESS 5.14)
+  # Legacy (< 5.14)
+  FIND_PROGRAM(PYSIDE2UICBINARY NAMES python2-pyside2-uic pyside2-uic pyside2-uic-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+  FIND_PROGRAM(PYSIDE2RCCBINARY NAMES pyside2-rcc pyside2-rcc-${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} HINTS ${PYSIDE_BIN_DIR})
+  set(UICOPTIONS "")
+  set(RCCOPTIONS "")
+ELSE(Qt5Core_VERSION LESS 5.14)
+  # New (>= 5.14)
+  FIND_PROGRAM(PYSIDE2UICBINARY NAMES uic)
+  set(UICOPTIONS "--generator=python")
+  FIND_PROGRAM(PYSIDE2RCCBINARY NAMES rcc)
+  set(RCCOPTIONS "--generator=python" "--compress-algo=zlib" "--compress=1")
+ENDIF(Qt5Core_VERSION LESS 5.14)

 MACRO(PYSIDE_WRAP_UI outfiles)
   FOREACH(it ${ARGN})
@@ -33,7 +49,7 @@
     #)
     if(WIN32 OR APPLE)
         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-          COMMAND ${PYSIDE2UICBINARY} ${infile} -o ${outfile}
+          COMMAND ${PYSIDE2UICBINARY} ${UICOPTIONS} ${infile} -o ${outfile}
           MAIN_DEPENDENCY ${infile}
         )
     else()
@@ -41,7 +57,7 @@
         # pyside2-uic generates in comments at beginning., which is why
         # we follow the tool command with in-place sed.
         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-          COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}"
+          COMMAND "${PYSIDE2UICBINARY}" ${UICOPTIONS} "${infile}" -o "${outfile}"
           COMMAND sed -i "/^# /d" "${outfile}"
           MAIN_DEPENDENCY "${infile}"
         )
@@ -60,7 +76,7 @@
     #)
     if(WIN32 OR APPLE)
         ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
-          COMMAND ${PYSIDE2RCCBINARY} ${infile} -o ${outfile}
+          COMMAND ${PYSIDE2RCCBINARY} ${RCCOPTIONS} ${infile} -o ${outfile}
           MAIN_DEPENDENCY ${infile}
         )
     else()
@@ -68,7 +84,7 @@
         # pyside-rcc generates in comments at beginning, which is why
         # we follow the tool command with in-place sed.
         ADD_CUSTOM_COMMAND(OUTPUT "${outfile}"
-          COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
+          COMMAND "${PYSIDE2RCCBINARY}" ${RCCOPTIONS} "${infile}" ${PY_ATTRIBUTE} -o "${outfile}"
           COMMAND sed -i "/^# /d" "${outfile}"
           MAIN_DEPENDENCY "${infile}"
         )


Include BASE_DIR and H5_ROOT_DIR directives

--- cmake/Modules/FindHdf5.cmake
+++ cmake/Modules/FindHdf5.cmake
@@ -1,6 +1,7 @@
 # -- Check for the HDF5 library --
 #
-# Uses path overrides: H5INC_PATH and H5LIB_PATH
+# Uses path overrides (via env): H5INC_PATH and H5LIB_PATH
+# Path overrides (via -D...): BASE_DIR and H5_ROOT_DIR
 #
 # Defines:
 #
@@ -25,13 +26,22 @@
 include(FindPackageHandleStandardArgs)

 # Look for includes and libraries
-find_path(HDF5_INCLUDE_DIR  H5Cpp.h PATHS $ENV{H5INC_PATH})
-find_library(HDF5_LIBRARY_BASE  hdf5  PATHS $ENV{H5LIB_PATH})
-find_library(HDF5_LIBRARY_CPP  hdf5_cpp  PATHS $ENV{H5LIB_PATH})
-find_library(HDF5_LIBRARY_HL  hdf5_hl  PATHS $ENV{H5LIB_PATH})
-find_library(HDF5_LIBRARY_HL_CPP  hdf5_hl_cpp  PATHS $ENV{H5LIB_PATH})
+find_path(HDF5_INCLUDE_DIR  H5Cpp.h
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR}
+  PATH_SUFFIXES include
+  PATHS $ENV{H5INC_PATH})
+
+find_library(HDF5_LIBRARY_BASE  hdf5
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR} PATH_SUFFIXES lib PATHS $ENV{H5LIB_PATH})
+find_library(HDF5_LIBRARY_CPP  hdf5_cpp
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR} PATH_SUFFIXES lib PATHS $ENV{H5LIB_PATH})
+find_library(HDF5_LIBRARY_HL  hdf5_hl
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR} PATH_SUFFIXES lib PATHS $ENV{H5LIB_PATH})
+find_library(HDF5_LIBRARY_HL_CPP  hdf5_hl_cpp
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR} PATH_SUFFIXES lib PATHS $ENV{H5LIB_PATH})
 find_library(LIBZ z)
-find_library(SZ_LIB sz PATHS $ENV{H5LIB_PATH})
+find_library(SZ_LIB sz
+  HINTS ${H5_ROOT_DIR} ${BASE_DIR} PATH_SUFFIXES lib PATHS $ENV{H5LIB_PATH})

 find_package_handle_standard_args(HDF5  DEFAULT_MSG  HDF5_LIBRARY_BASE  HDF5_LIBRARY_CPP LIBZ HDF5_INCLUDE_DIR)
 find_package_handle_standard_args(LIBSZ  DEFAULT_MSG  SZ_LIB)


Fix compilation issue for MSVC due to min/max macros.

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -97,7 +97,9 @@
 		ADD_DEFINITIONS(-D_UNICODE -DUNICODE)
 		ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)

-	ENDIF(MSVC10)
+	ENDIF(MSVC10)
+
+	ADD_DEFINITIONS(-DNOMINMAX)
 ENDIF(MSVC)


[cmake] add setting for GCC/Clang sanitizers

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -249,6 +249,19 @@
 		"-Wno-missing-braces"
 		"-Wmissing-braces" "-Wno-missing-braces"
 		)
+
+	axl_create_setting (
+		GCC_SANITIZER
+		"-fsanitize=address"
+		STRING
+		"Sanitizer to use in Debug build"
+		" " "-fsanitize=address" "-fsanitize=memory" "-fsanitize=thread"
+		)
+
+	if (NOT "${GCC_SANITIZER}" STREQUAL " ")
+		set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${GCC_SANITIZER}")
+		set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${GCC_SANITIZER}")
+	endif ()
 endmacro ()

 #..............................................................................


cmake: added 'zlib' as possible name of zlib in FindHDF5

--- cmake/modules/FindHDF5.cmake
+++ cmake/modules/FindHDF5.cmake
@@ -36,7 +36,7 @@
            COMPILE_DEFINITIONS "-I\"${HDF5_INCLUDE_DIR}\" -DH5_SOMETHING=H5_HAVE_FILTER_DEFLATE")

 if(HDF5_USES_ZLIB)
-    FIND_LIBRARY(HDF5_Z_LIBRARY NAMES zlib1 z )
+    FIND_LIBRARY(HDF5_Z_LIBRARY NAMES zlib1 zlib z )
     set(HDF5_ZLIB_OK ${HDF5_Z_LIBRARY})
 else()
     set(HDF5_ZLIB_OK TRUE)


ruby1.9 is a valid ruby binary

ruby1.9 is a valid ruby binary

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -73,8 +73,10 @@
    /usr/lib/ruby/1.8/i586-linux-gnu/ )

 FIND_LIBRARY(RUBY_LIBRARY
-  NAMES ruby ruby1.8
-  PATHS ${RUBY_POSSIBLE_LIB_PATH}
+  NAMES ruby ruby1.9 ruby1.8
+  PATHS
+   ${RUBY_POSSIBLE_LIB_PATH}
+   ${RUBY_RUBY_LIB_PATH}
   )

 MARK_AS_ADVANCED(


Fix FindRuby.cmake to work with cmake 2.4

--- cmake/modules/FindRuby.cmake
+++ cmake/modules/FindRuby.cmake
@@ -57,10 +57,15 @@
 EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
   OUTPUT_VARIABLE RUBY_VENDORARCH_DIR ERROR_QUIET)

-IF(RUBY_VENDORARCH_DIR AND NOT(${RUBY_VENDORARCH_DIR} STREQUAL "nil"))
+IF(RUBY_VENDORARCH_DIR)
+  IF(${RUBY_VENDORARCH_DIR} STREQUAL "nil")
+  ELSE(${RUBY_VENDORARCH_DIR} STREQUAL "nil")
     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['vendorlibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ELSE(RUBY_VENDORARCH_DIR AND NOT(${RUBY_VENDORARCH_DIR} STREQUAL "nil"))
+  ENDIF(${RUBY_VENDORARCH_DIR} STREQUAL "nil")
+ENDIF(RUBY_VENDORARCH_DIR)
+
+IF(NOT RUBY_VENDORLIB_DIR)

     # fall back to site*dir
     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitearchdir']"
@@ -68,7 +73,8 @@

     EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['sitelibdir']"
        OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)
-ENDIF(RUBY_VENDORARCH_DIR AND NOT(${RUBY_VENDORARCH_DIR} STREQUAL "nil"))
+
+ENDIF(NOT RUBY_VENDORLIB_DIR)

 # this is not needed if you use "print" inside the ruby statements
 # remove the new lines from the output by replacing them with empty strings


Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"
(was reverted by mistake)

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -146,6 +146,12 @@
       llvm_ExternalProject_BuildCmd(tblgen_build_cmd ${target}
                                     ${LLVM_NATIVE_BUILD}
                                     CONFIGURATION Release)
+      # Create an artificial dependency between tablegen projects, because they
+      # compile the same dependencies, thus using the same build folders.
+      # FIXME: A proper fix requires sequentially chaining tablegens.
+      if (NOT ${project} STREQUAL LLVM AND TARGET ${project}-tablegen-host)
+        add_dependencies(${project}-tablegen-host LLVM-tablegen-host)
+      endif()
       add_custom_command(OUTPUT ${${project}_TABLEGEN_EXE}
         COMMAND ${tblgen_build_cmd}
         DEPENDS CONFIGURE_LLVM_NATIVE ${target}


For deprecated plfreetype approach for dealing with unicode, make symbol
font files default to same as sans files rather than same as serif files.
This makes plfreetype device drivers agree with how generic font device
drivers treat symbol fonts as an alias of sans fonts.

For devices that still use the plfreetype approach, this will make little
difference because the symbol font is no longer used for a momentary font
change for certain PLplot unicode escape sequences (Hershey, hexadecimal,
and Greek).  Thus, symbol font files (which now by default point to the
equivalent sans font files for plfreetype device drivers) are now only used
when a user specifically asks for them.

svn path=/trunk/; revision=10624

--- cmake/modules/freetype.cmake
+++ cmake/modules/freetype.cmake
@@ -82,12 +82,12 @@
     "PL_FREETYPE_SERIF_BOLD_OBLIQUE:FreeSerifBoldItalic.ttf:timesbi.ttf"
     "PL_FREETYPE_SERIF_ITALIC:FreeSerifItalic.ttf:timesi.ttf"
     "PL_FREETYPE_SERIF_OBLIQUE:FreeSerifItalic.ttf:timesi.ttf"
-    "PL_FREETYPE_SYMBOL:FreeSerif.ttf:times.ttf"
-    "PL_FREETYPE_SYMBOL_BOLD:FreeSerifBold.ttf:timesbd.ttf"
-    "PL_FREETYPE_SYMBOL_BOLD_ITALIC:FreeSerifBoldItalic.ttf:timesbi.ttf"
-    "PL_FREETYPE_SYMBOL_BOLD_OBLIQUE:FreeSerifBoldItalic.ttf:timesbi.ttf"
-    "PL_FREETYPE_SYMBOL_ITALIC:FreeSerifItalic.ttf:timesi.ttf"
-    "PL_FREETYPE_SYMBOL_OBLIQUE:FreeSerifItalic.ttf:timesi.ttf"
+    "PL_FREETYPE_SYMBOL:FreeSans.ttf:arial.ttf"
+    "PL_FREETYPE_SYMBOL_BOLD:FreeSansBold.ttf:arialbd.ttf"
+    "PL_FREETYPE_SYMBOL_BOLD_ITALIC:FreeSansBoldOblique.ttf:arialbi.ttf"
+    "PL_FREETYPE_SYMBOL_BOLD_OBLIQUE:FreeSansBoldOblique.ttf:arialbi.ttf"
+    "PL_FREETYPE_SYMBOL_ITALIC:FreeSansOblique.ttf:ariali.ttf"
+    "PL_FREETYPE_SYMBOL_OBLIQUE:FreeSansOblique.ttf:ariali.ttf"
     )

   foreach(FONT_ENTRY ${PL_FREETYPE_FONT_LIST})


xtools: set toolchain vendor to zephyr

xtools: set toolchain vendor to zephyr

For xtools, we set the vendor to zephyr directly and do not get it from
a variable.

Signed-off-by: Anas Nashif <0d9952ec84ac43c159f6b7e7ed99a9080c00dd6e@intel.com>

--- cmake/toolchain/xtools.cmake
+++ cmake/toolchain/xtools.cmake
@@ -9,9 +9,9 @@
 set(CROSS_COMPILE_TARGET_arm arm-zephyr-eabi)
 if("${ARCH}" STREQUAL "x86")
   if(CONFIG_X86_IAMCU)
-    set(CROSS_COMPILE_TARGET_x86  i586-${TOOLCHAIN_VENDOR}-elfiamcu)
+    set(CROSS_COMPILE_TARGET_x86  i586-zephyr-elfiamcu)
   else()
-    set(CROSS_COMPILE_TARGET_x86 i586-${TOOLCHAIN_VENDOR}-elf)
+    set(CROSS_COMPILE_TARGET_x86 i586-zephyr-elf)
   endif()
 endif()
 set(CROSS_COMPILE_TARGET_nios2 nios2-zephyr-elf)


Bump the default NDK API level to 12 matching Urho3D Android manifest. [ci package]

--- Source/CMake/Toolchains/android.toolchain.cmake
+++ Source/CMake/Toolchains/android.toolchain.cmake
@@ -350,10 +350,10 @@
 set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
 set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )

-# Urho3D: default to API 9
-set( ANDROID_DEFAULT_NDK_API_LEVEL 9 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
-set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )
+# Urho3D: default to API 12
+set( ANDROID_DEFAULT_NDK_API_LEVEL 12 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 12 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 12 )

 macro( __LIST_FILTER listvar regex )


Do not install inc/config.h but inc/oce-config.h

--- adm/cmake/OccBuildKit.cmake
+++ adm/cmake/OccBuildKit.cmake
@@ -81,7 +81,7 @@
 		LIST(APPEND INSTALL_HEADERS ${OpenCASCADE_SOURCE_DIR}/inc/${POSSIBLE_INSTALL_HEADER})
 	ENDIF(EXISTS ${OpenCASCADE_SOURCE_DIR}/inc/${POSSIBLE_INSTALL_HEADER})
 ENDFOREACH(POSSIBLE_INSTALL_HEADER ${POSSIBLE_INSTALL_HEADERS})
-LIST(APPEND INSTALL_HEADERS ${OpenCASCADE_BINARY_DIR}/inc/config.h)
+LIST(APPEND INSTALL_HEADERS ${OpenCASCADE_BINARY_DIR}/inc/oce-config.h)

 INSTALL(FILES ${INSTALL_HEADERS}
 	DESTINATION ${OpenCASCADE_INSTALL_INCLUDE_DIR} COMPONENT Development


cmake: Check for _GNU_SOURCE and add it if available.

This is needed for strsignal().

--- cmake/Modules/DefineCompilerFlags.cmake
+++ cmake/Modules/DefineCompilerFlags.cmake
@@ -29,6 +29,11 @@
         if (WITH_FORTIFY_SOURCE)
             set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2")
         endif (WITH_FORTIFY_SOURCE)
+
+        check_c_compiler_flag("-D_GNU_SOURCE" WITH_GNU_SOURCE)
+        if (WITH_GNU_SOURCE)
+            set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE")
+        endif (WITH_GNU_SOURCE)
     endif (${CMAKE_C_COMPILER_ID} MATCHES GNU)

     #


Fixing ExportTar plugin

Fixing ExportTar plugin

Change-Id: I13542a42cbb4bdad6817321fa9c998f587bf7f1f

--- cmake/plugins/ExportTar/ExportTar.cmake
+++ cmake/plugins/ExportTar/ExportTar.cmake
@@ -93,7 +93,7 @@
 # collect everything for tar building
 FUNCTION(INTERNAL_BUILD_RELEASE_TAR)
 	#Is there something to copy?
-	IF(NOT ${TARGETS_TO_COPY} STREQUAL "" AND NOT ${FILES_TO_COPY} STREQUAL "" AND NOT ${DIRECTORIES_TO_COPY} STREQUAL "")
+	IF(NOT "${TARGETS_TO_COPY}" STREQUAL "" AND NOT "${FILES_TO_COPY}" STREQUAL "" AND NOT "${DIRECTORIES_TO_COPY}" STREQUAL "")
 		MESSAGE(STATUS "Adding Tarfile export target")
 		# the top level target for building the tar
 		add_custom_target(ExportTar COMMENT "Exporting marked Files into a tar" )


MAINT: activate OpenMP by default.

MAINT: activate OpenMP by default.

--- cmake/sara_configure_cxx_compiler.cmake
+++ cmake/sara_configure_cxx_compiler.cmake
@@ -97,3 +97,9 @@
         "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage")
   endif ()
 endif ()
+
+# Activate OpenMP by default.
+find_package(OpenMP QUIET)
+if (OPENMP_FOUND)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+endif ()


cmake: Bump min version to 0.10.2

cmake: Bump min version to 0.10.2

We want to use the riscv64 toolchain across the board for RISC-V.  That
requires a min of the 0.10.2 SDK, so bump the version before we make
that change.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- cmake/toolchain/zephyr/host-tools.cmake
+++ cmake/toolchain/zephyr/host-tools.cmake
@@ -17,7 +17,7 @@
   return()
 endif()

-set(REQUIRED_SDK_VER 0.10.1)
+set(REQUIRED_SDK_VER 0.10.2)
 set(TOOLCHAIN_VENDOR zephyr)
 set(TOOLCHAIN_ARCH x86_64)


BUG: review name wrong

BUG: review name wrong

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -112,11 +112,11 @@
       -DITK_FUTURE_LEGACY_REMOVE:=BOOL=ON
       -DITKV3_COMPATIBILITY:BOOL=ON
       -DITK_BUILD_DEFAULT_MODULES:BOOL=ON
-      -DITK_USE_REVIEW:BOOL=ON
       #-DITK_INSTALL_NO_DEVELOPMENT:BOOL=ON
       -DKWSYS_USE_MD5:BOOL=ON # Required by SlicerExecutionModel
       -DITK_WRAPPING:BOOL=OFF #${BUILD_SHARED_LIBS} ## HACK:  QUICK CHANGE
       -DModule_MGHIO:BOOL=ON
+      -DModule_ITKReview:BOOL=ON
       ${${proj}_DCMTK_ARGS}
       ${${proj}_WRAP_ARGS}
       ${${proj}_FFTWF_ARGS}


ENH: Update ITK for FixedParameter setting

ITK now preserves the fixed parameters (i.e. the center of rotation
for MatrixOffsetBase) objects during the inversion process.  This is important
so that the parameters of Inv(Inv(T)) ~= the parameters of T.  It is also
important if you desire to optimize the the inverse transform from the moving
image to the fixed image.

--- SuperBuild/External_ITKv4.cmake
+++ SuperBuild/External_ITKv4.cmake
@@ -150,7 +150,7 @@
   ### --- End Project specific additions
   set(${proj}_REPOSITORY ${git_protocol}://itk.org/ITK.git)
   set(${proj}_REPOSITORY "https://github.com/InsightSoftwareConsortium/ITK.git")
-  set(${proj}_GIT_TAG 5d193c91ff8fc5e85fd0b36e6eabb14f503dfb9e)
+  set(${proj}_GIT_TAG 943cc52f742287939de8eafb47c6d59a5eb97ca8)
   set(ITK_VERSION_ID ITK-4.7)

   ExternalProject_Add(${proj}


ENH: Bump TubeTK to TubeTK 0.9.0 rc1

ENH: Bump TubeTK to TubeTK 0.9.0 rc1

--- Modules/Remote/TubeTK.remote.cmake
+++ Modules/Remote/TubeTK.remote.cmake
@@ -48,5 +48,5 @@
   "http://www.tubetk.org"
   MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKTubeTK.git
-  GIT_TAG 9841c28c8287f04269ceecf3560f7659d77f9643
+  GIT_TAG 61f1156bd9b4af7e34b064f676620584d85bef3a
   )


fbcode_builder: update FBPythonBinary.cmake to work on Windows

Summary:
On Windows we have to explicitly invoke `make_fbpy_archive.py` with python.
Therefore use CMake's built-in `FindPythonInterp` module to find the python
executable and use that when invoking `make_fbpy_archive.py`

This is slightly complicated by the effort required to find python with older
versions of CMake.  We ideally still want to support versions of CMake back to
at least 3.8, which means we need to still support finding Python with the
older `FindPythonInterp.cmake` module

Reviewed By: wez

Differential Revision: D17128606

fbshipit-source-id: 3f4beff76848b8a362ebdf21198e7a8bf1b0537f

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -23,18 +23,45 @@
 # library paths.
 #

+# If the caller has not already found Python, do so now.
+# If we fail to find python now we won't fail immediately, but
+# add_fb_python_executable() or add_fb_python_library() will fatal out if they
+# are used.
+if(NOT Python3_EXECUTABLE)
+  # CMake 3.12+ ships with a FindPython3.cmake module.  Try using it first.
+  # We find with QUIET here, since otherwise this generates some noisy warnings
+  # on versions of CMake before 3.12
+  find_package(Python3 COMPONENTS Interpreter QUIET)
+  if(Python3_Interpreter_FOUND)
+    message(STATUS "Found Python 3: ${Python3_EXECUTABLE}")
+  else()
+    # Try with the FindPythonInterp.cmake module available in older CMake
+    # versions.  Check to see if the caller has already searched for this
+    # themselves first.
+    if(NOT PYTHONINTERP_FOUND)
+      set(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1)
+      find_package(PythonInterp)
+    endif()
+    if(PYTHONINTERP_FOUND)
+      if("${PYTHON_VERSION_MAJOR}" GREATER_EQUAL 3)
+        set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE}")
+      else()
+        string(
+          CONCAT FBPY_FIND_PYTHON_ERR
+          "found Python ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}, "
+          "but need Python 3"
+        )
+      endif()
+    endif()
+  endif()
+endif()
+
 # Find our helper program.
 # We typically install this in the same directory as this .cmake file.
 find_program(
-  MAKE_PYTHON_ARCHIVE "make_fbpy_archive.py"
+  FB_MAKE_PYTHON_ARCHIVE "make_fbpy_archive.py"
   PATHS ${CMAKE_MODULE_PATH}
 )
-if (NOT MAKE_PYTHON_ARCHIVE)
-  message(
-    FATAL_ERROR "unable to find make_fbpy_archive.py helper program (it "
-    "should be located in the same directory as FBPythonRules.cmake)"
-  )
-endif()

 # An option to control the default installation location for
 # install_fb_python_library().  This is relative to ${CMAKE_INSTALL_PREFIX}
@@ -52,7 +79,10 @@
 # which module should be started as the __main__ module when the executable is
 # run.  If left unspecified, a __main__.py script must be present in the
 # manifest.
+#
 function(add_fb_python_executable EXE_NAME)
+  fb_py_check_available()
+
   # Parse the arguments
   set(one_value_args BASE_DIR NAMESPACE MAIN_MODULE TYPE)
   set(multi_value_args SOURCES DEPENDS)
@@ -107,19 +137,20 @@
   endif()

   if(DEFINED ARG_MAIN_MODULE)
-    set(main_argument "--main" "${ARG_MAIN_MODULE}")
+    list(APPEND make_py_args "--main" "${ARG_MAIN_MODULE}")
   endif()

   add_custom_command(
     OUTPUT "${output_file}"
     ${extra_cmd_params}
     COMMAND
-      "${MAKE_PYTHON_ARCHIVE}" -o "${EXE_NAME}" ${main_argument}
+      "${Python3_EXECUTABLE}" "${FB_MAKE_PYTHON_ARCHIVE}"
+      -o "${EXE_NAME}"
       ${make_py_args}
     DEPENDS
       ${source_files}
       "${EXE_NAME}.main_lib.py_sources_built"
-      "${MAKE_PYTHON_ARCHIVE}"
+      "${FB_MAKE_PYTHON_ARCHIVE}"
   )

   # Add an "ALL" target that depends on force ${EXE_NAME},
@@ -184,6 +215,8 @@
 #   will then be read at build-time in order to build executables.
 #
 function(add_fb_python_library LIB_NAME)
+  fb_py_check_available()
+
   # Parse the arguments
   # We use fb_cmake_parse_args() rather than cmake_parse_arguments() since
   # cmake_parse_arguments() does not handle empty arguments, and it is common
@@ -332,13 +365,13 @@
       "${build_install_dir}/${LIB_NAME}.manifest"
     COMMAND "${CMAKE_COMMAND}" -E remove_directory "${build_install_dir}"
     COMMAND
-      "${MAKE_PYTHON_ARCHIVE}" --type lib-install
+      "${Python3_EXECUTABLE}" "${FB_MAKE_PYTHON_ARCHIVE}" --type lib-install
       --install-dir "${LIB_NAME}"
       -o "${build_install_dir}/${LIB_NAME}" "${manifest_path}"
     DEPENDS
       "${abs_sources}"
       "${manifest_path}"
-      "${MAKE_PYTHON_ARCHIVE}"
+      "${FB_MAKE_PYTHON_ARCHIVE}"
   )
   add_custom_target(
     "${LIB_NAME}.py_lib_install"
@@ -435,3 +468,22 @@
     get_filename_component("${BASE_DIR_VAR}" "${${BASE_DIR_VAR}}" ABSOLUTE)
   endif()
 endmacro()
+
+function(fb_py_check_available)
+  # Make sure that Python 3 and our make_fbpy_archive.py helper script are
+  # available.
+  if(NOT Python3_EXECUTABLE)
+    if(FBPY_FIND_PYTHON_ERR)
+      message(FATAL_ERROR "Unable to find Python 3: ${FBPY_FIND_PYTHON_ERR}")
+    else()
+      message(FATAL_ERROR "Unable to find Python 3")
+    endif()
+  endif()
+
+  if (NOT FB_MAKE_PYTHON_ARCHIVE)
+    message(
+      FATAL_ERROR "unable to find make_fbpy_archive.py helper program (it "
+      "should be located in the same directory as FBPythonRules.cmake)"
+    )
+  endif()
+endfunction()


Replaced config files with variables in test specific customization.

--- CommonCPPCTest.cmake
+++ CommonCPPCTest.cmake
@@ -5,16 +5,16 @@
 # Input:
 # * TEST_LIBRARIES link each test executables against these libraries
 # * EXCLUDE_FROM_TESTS a relative paths to test files to exclude; optional
-# * From CMake 2.8.8 on, a custom include path and library linking can be
-#   provided for each test. This customization will go in a separate .cmake
-#   file whose base name matches the .cpp file basename. The variables to set
-#   in that file are ${NAME}_INCLUDE_DIRECTORIES and ${NAME}_LINK_LIBRARIES
-#   (verbatim names, the value of NAME will be set by the code including the
-#    .cmake file). As a fallback a defaults.cmake file can be also provided
+# * For each test ${NAME}_INCLUDE_DIRECTORIES and ${NAME}_LINK_LIBRARIES can
+#   be set to configure target specific includes and link libraries, where
+#   NAME is the test filename without the .cpp extension. Per test include
+#   directories are only supported for for CMake 2.8.8

 if(NOT WIN32) # tests want to be with DLLs on Windows - no rpath
   set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
 endif()
+
+include_directories(${CMAKE_CURRENT_LIST_DIR}/cpp ${CMAKE_CURRENT_SOURCE_DIR})

 file(GLOB_RECURSE TEST_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp)
 foreach(FILE ${EXCLUDE_FROM_TESTS})
@@ -32,32 +32,15 @@
   add_executable(${NAME} ${FILE})
   set_target_properties(${NAME} PROPERTIES FOLDER "Tests")

-  if(CMAKE_VERSION VERSION_GREATER 2.8.7)
-    # If per target INCLUDE_DIRECTORIES are supported this code will load
-    # a per test config file to fine tune its compilation.
-    # This can be to create per-tests mock-ups if needed.
-    if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.cmake)
-      include(${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.cmake)
-    elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/defaults.cmake)
-      include(${CMAKE_CURRENT_SOURCE_DIR}/defaults.cmake)
-    endif()
+  # Per target INCLUDE_DIRECTORIES if supported
+  if(CMAKE_VERSION VERSION_GREATER 2.8.7 AND ${NAME}_INCLUDE_DIRECTORIES)
+    set_target_properties(${NAME} PROPERTIES
+      INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIRECTORIES}")
+  endif()

-    # Test includes
-    # Clearing all includes first
-    set_target_properties(${NAME} PROPERTIES INCLUDE_DIRECTORIES "")
-    if (${NAME}_INCLUDE_DIRECTORIES)
-      set_target_properties(${NAME} PROPERTIES
-        INCLUDE_DIRECTORIES "${${NAME}_INCLUDE_DIRECTORIES}")
-    else()
-      # Default includes
-      set(${NAME}_INCLUDE_DIRECTORIES
-        ${CMAKE_CURRENT_LIST_DIR}/cpp ${CMAKE_CURRENT_SOURCE_DIR})
-    endif()
-
-    # Test link libraries
-    if (${NAME}_LINK_LIBRARIES)
-      target_link_libraries(${NAME} ${${NAME}_LINK_LIBRARIES})
-    endif()
+  # Test link libraries
+  if (${NAME}_LINK_LIBRARIES)
+    target_link_libraries(${NAME} ${${NAME}_LINK_LIBRARIES})
   endif()
   target_link_libraries(${NAME} ${TEST_LIBRARIES})


Fix CMake 3> 3.2 with MSVC

Fix CMake 3> 3.2 with MSVC

--- CommonCompiler.cmake
+++ CommonCompiler.cmake
@@ -190,7 +190,7 @@
     target_compile_features(${Name} ${__visibility} ${COMMON_CXX11_FEATURES})
   endif()
   if(NOT __interface)
-    if(CMAKE_VERSION VERSION_LESS 3.3)
+    if(CMAKE_VERSION VERSION_LESS 3.3 OR MSVC)
       target_compile_options(${Name} PRIVATE
         "$<$<CONFIG:Debug>:${COMMON_CXX_FLAGS_DEBUG}>"
         "$<$<CONFIG:RelWithDebInfo>:${COMMON_CXX_FLAGS_RELWITHDEBINFO}>"


Update testing functions with properties and generator expressions

Prefer the use of CMake properties to set environment variables of
command line options.

Prefer the use of CMake Generator expressions to obtain the path to
target libraries and executable.

Change-Id: I4bdd44de12fad2b5cf29130198ee62759dde32f7

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -59,10 +59,12 @@

   sitk_add_test(NAME Python.${name}
     COMMAND "${ITK_TEST_DRIVER}"
-    --add-before-env SITK_NOSHOW "YES"
-    ${command}
-    ${ARGN}
-    )
+    ${command}
+    ${ARGN}
+    )
+  set_property(TEST Python.${name}
+      PROPERTY ENVIRONMENT SITK_NOSHOW=YES
+      )
   if (NOT SITK_PYTHON_USE_VIRTUALENV)
     set_property(TEST Python.${name}
       PROPERTY ENVIRONMENT PYTHONPATH=${SimpleITK_BINARY_DIR}/Wrapping
@@ -116,10 +118,12 @@

   sitk_add_test(NAME Ruby.${name}
     COMMAND "${ITK_TEST_DRIVER}"
-    --add-before-env RUBYLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIGURATION>"
-    --add-before-env RUBYLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
-    ${command}
-    ${ARGN}
+    ${command}
+    ${ARGN}
+    )
+
+  set_property(TEST Ruby.${name}
+    PROPERTY ENVIRONMENT RUBYLIB=$<TARGET_FILE_DIR:simpleitk_RUBY>
     )
 endfunction()

@@ -162,12 +166,11 @@
   get_filename_component( _java_class ${java_file} NAME_WE )
   set( _java_file_class "${_java_class}.class" )

+  set( _JAVA_LIBRARY_PATH  "$<TARGET_FILE_DIR:SimpleITKJava_JAVA>")
   if(WIN32)
-    set( _JAVA_LIBRARY_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/$<CONFIGURATION>" )
     set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}$<SEMICOLON>${CMAKE_CURRENT_BINARY_DIR}" )

   else(WIN32)
-    set( _JAVA_LIBRARY_PATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" )
     set( _JAVA_CLASSPATH "${SimpleITK_BINARY_DIR}/Wrapping/Java/${JAR_FILE}:${CMAKE_CURRENT_BINARY_DIR}" )
   endif(WIN32)


Remove debug msg

Remove debug msg

--- External/FindGLFW.cmake
+++ External/FindGLFW.cmake
@@ -10,8 +10,6 @@

 INCLUDE(ExternalProject)
 INCLUDE(FindPackageHandleStandardArgs)
-
-MESSAGE(STATUS "Looking for GLFW")

 SET(GLFW_CMAKE_ARGS
   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>


Revert openblas include paths

Revert openblas include paths

Former-commit-id: 3de76276ed1f346c10cb6c96ad56089424e71e4f

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -37,7 +37,7 @@
     endif()

     if(OpenBLAS_FOUND AND OpenBLAS_LIBRARY AND OpenBLAS_INCLUDE_DIRS)
-        set(OpenBLAS_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIRS} ${OpenBLAS_INCLUDE_DIRS}/openblas)
+        set(OpenBLAS_INCLUDE_DIRS ${OpenBLAS_INCLUDE_DIRS})
         set(OpenBLAS_FOUND TRUE)
         set(BLAS_FOUND TRUE)
     endif()
@@ -176,7 +176,7 @@
     set(OpenBLAS_LIBRARY           ${INSTALL_DIR}/lib/libopenblas${CUSTOM_SUFFIX})
     set(OpenBLAS_LIBRARY_STATIC    ${INSTALL_DIR}/lib/libopenblas${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(OpenBLAS_LIBRARY_SHARED    ${INSTALL_DIR}/lib/libopenblas${CMAKE_SHARED_LIBRARY_SUFFIX})
-    set(OpenBLAS_INCLUDE_DIRS      ${INSTALL_DIR}/include ${INSTALL_DIR}/include/openblas)
+    set(OpenBLAS_INCLUDE_DIRS      ${INSTALL_DIR}/include)
     add_definitions(-DOpenBLAS_AVAILABLE)
 endif()


Fix issue #1495

Fix issue #1495

--- cmake/CommonModularInterface.cmake
+++ cmake/CommonModularInterface.cmake
@@ -43,12 +43,13 @@
 IF(DEFINED TARGET_SWIGFLAGS)
 	SET_SOURCE_FILES_PROPERTIES(modshogun.i PROPERTIES SWIG_FLAGS ${TARGET_SWIGFLAGS})
 ENDIF()
+SET(SWIG_MODULE_${MODULAR_NAME}_modular_EXTRA_DEPS ${modular_files})
 SWIG_ADD_MODULE(${MODULAR_NAME}_modular ${MODULAR_NAME} modshogun.i sg_print_functions.cpp)
-set_target_properties(${PREPEND_TARGET}${MODULAR_NAME}_modular PROPERTIES
+set_target_properties(${SWIG_MODULE_${MODULAR_NAME}_modular_REAL_NAME} PROPERTIES
 						COMPILE_DEFINITIONS "${DEFINES}")
 SWIG_LINK_LIBRARIES(${MODULAR_NAME}_modular shogun ${MODULAR_LIBARIES})
-SET_TARGET_PROPERTIES(${PREPEND_TARGET}${MODULAR_NAME}_modular PROPERTIES OUTPUT_NAME ${PREPEND_TARGET}modshogun)
-ADD_DEPENDENCIES(${PREPEND_TARGET}${MODULAR_NAME}_modular ${MODULAR_NAME}_modular_src)
+SET_TARGET_PROPERTIES(${SWIG_MODULE_${MODULAR_NAME}_modular_REAL_NAME} PROPERTIES OUTPUT_NAME ${PREPEND_TARGET}modshogun)
+ADD_DEPENDENCIES(${SWIG_MODULE_${MODULAR_NAME}_modular_REAL_NAME} ${MODULAR_NAME}_modular_src)

 #ADD_CUSTOM_COMMAND(TARGETS ${PREPEND_TARGET}${MODULAR_NAME}_modular
 #				   POST_BUILD
@@ -72,7 +73,7 @@
     	DEPENDS   modshogun
 	)
 	ADD_CUSTOM_TARGET(${MODULAR_NAME}_doxy2swig DEPENDS modshogun_doxygen.i)
-	ADD_DEPENDENCIES(${PREPEND_TARGET}${MODULAR_NAME}_modular ${MODULAR_NAME}_doxy2swig)
+	ADD_DEPENDENCIES(${SWIG_MODULE_${MODULAR_NAME}_modular_REAL_NAME} ${MODULAR_NAME}_doxy2swig)
 ELSE()
 	#TODO add scrubing
 ENDIF()


Update: rely on find_package_handle_standard_args for message printing
NM: renice a bit

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

--- cmake/Modules/Findlibusb-1.0.cmake
+++ cmake/Modules/Findlibusb-1.0.cmake
@@ -11,6 +11,9 @@
 #  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
 #
 #  (Changes for libusb) Copyright (c) 2008 Kyle Machulis <kyle@nonpolynomial.com>
+#
+#  Point Cloud Library (PCL) - www.pointclouds.org
+#  Copyright (c) 2012, Willow Garage, Inc. (use of FindPackageHandleStandardArgs)
 #
 # Redistribution and use is allowed according to the terms of the New BSD license.
 #
@@ -42,57 +45,26 @@
 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #

-
 if (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
   # in cache already
   set(LIBUSB_FOUND TRUE)
+  set(LIBUSB_1_FOUND TRUE)
 else (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)
   find_path(LIBUSB_1_INCLUDE_DIR
-    NAMES
-	libusb-1.0/libusb.h
-    PATHS
-      /usr/include
-      /usr/local/include
-      /opt/local/include
-      /sw/include
-	PATH_SUFFIXES
-	  libusb-1.0
-  )
+            NAMES libusb-1.0/libusb.h
+	    PATHS /usr/include /usr/local/include /opt/local/include /sw/include
+	    PATH_SUFFIXES libusb-1.0)

   find_library(LIBUSB_1_LIBRARY
-    NAMES
-      usb-1.0
-    PATHS
-      /usr/lib
-      /usr/local/lib
-      /opt/local/lib
-      /sw/lib
-  )
+               NAMES usb-1.0
+	       PATHS /usr/lib /usr/local/lib /opt/local/lib /sw/lib)

-  set(LIBUSB_1_INCLUDE_DIRS
-    ${LIBUSB_1_INCLUDE_DIR}
-  )
-  set(LIBUSB_1_LIBRARIES
-    ${LIBUSB_1_LIBRARY}
-)
+  set(LIBUSB_1_INCLUDE_DIRS ${LIBUSB_1_INCLUDE_DIR})
+  set(LIBUSB_1_LIBRARIES ${LIBUSB_1_LIBRARY})

-  if (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
-     set(LIBUSB_1_FOUND TRUE)
-  endif (LIBUSB_1_INCLUDE_DIRS AND LIBUSB_1_LIBRARIES)
-
-  if (LIBUSB_1_FOUND)
-    if (NOT libusb_1_FIND_QUIETLY)
-      message(STATUS "Found libusb-1.0:")
-	  message(STATUS " - Includes: ${LIBUSB_1_INCLUDE_DIRS}")
-	  message(STATUS " - Libraries: ${LIBUSB_1_LIBRARIES}")
-    endif (NOT libusb_1_FIND_QUIETLY)
-  else (LIBUSB_1_FOUND)
-    if (libusb_1_FIND_REQUIRED)
-      message(FATAL_ERROR "Could not find libusb")
-    endif (libusb_1_FIND_REQUIRED)
-  endif (LIBUSB_1_FOUND)
+  include(FindPackageHandleStandardArgs)
+  find_package_handle_standard_args(LIBUSB_1 DEFAULT_MSG LIBUSB_1_LIBRARY LIBUSB_1_INCLUDE_DIR)

   # show the LIBUSB_1_INCLUDE_DIRS and LIBUSB_1_LIBRARIES variables only in the advanced view
   mark_as_advanced(LIBUSB_1_INCLUDE_DIRS LIBUSB_1_LIBRARIES)
-
-endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)+endif (LIBUSB_1_LIBRARIES AND LIBUSB_1_INCLUDE_DIRS)


Ensure that the order of output is respected in tests.

--- cmake/modules/RootTestDriver.cmake
+++ cmake/modules/RootTestDriver.cmake
@@ -189,21 +189,36 @@

 #---Execute post-command-----------------------------------------------------------------------------
 if(POST)
-  execute_process(COMMAND ${_post} ${_cwd} RESULT_VARIABLE _rc)
+  execute_process(COMMAND ${_post} ${_cwd} OUTPUT_VARIABLE _outvar ERROR_VARIABLE _outvar RESULT_VARIABLE _rc)
+  if(_outvar)
+    message("-- BEGIN POST OUTPUT --")
+    message("${_outvar}")
+    message("-- END POST OUTPUT --")
+  endif()
   if(_rc)
     message(FATAL_ERROR "post-command error code : ${_rc}")
   endif()
 endif()

 if(OUTREF)
-  execute_process(COMMAND ${diff_cmd} ${OUT} ${OUTREF} RESULT_VARIABLE _rc)
+  execute_process(COMMAND ${diff_cmd} ${OUT} ${OUTREF} OUTPUT_VARIABLE _outvar ERROR_VARIABLE _outvar RESULT_VARIABLE _rc)
+  if(_outvar)
+    message("-- BEGIN OUTDIFF OUTPUT --")
+    message("${_outvar}")
+    message("-- END OUTDIFF OUTPUT --")
+  endif()
   if(_rc)
     message(FATAL_ERROR "compare 'stdout' error: ${_rc}")
   endif()
 endif()

 if(ERRREF)
-  execute_process(COMMAND ${diff_cmd} ${ERR} ${ERRREF} RESULT_VARIABLE _rc)
+  execute_process(COMMAND ${diff_cmd} ${ERR} ${ERRREF} OUTPUT_VARIABLE _outvar ERROR_VARIABLE _outvar RESULT_VARIABLE _rc)
+  if(_outvar)
+    message("-- BEGIN ERRDIFF OUTPUT --")
+    message("${_outvar}")
+    message("-- END ERRDIFF OUTPUT --")
+  endif()
   if(_rc)
     message(FATAL_ERROR "compare 'stderr' error: ${_rc}")
   endif()


synch FindSuiteSparse.cmake

synch FindSuiteSparse.cmake

--- cmakemodules/FindSuiteSparse.cmake
+++ cmakemodules/FindSuiteSparse.cmake
@@ -157,25 +157,54 @@
 		endif()

 		## try to find filepath lib name (looking for very important lib file)
-		find_library(SuiteSparse_${suitesparseCompUC}_LIBRARY
-			NAMES 			${suitesparseComp} ${suitesparseCompLC} ${suitesparseCompUC}
+		find_library(SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE
+			NAMES 			lib${suitesparseComp} 	lib${suitesparseCompLC} lib${suitesparseCompUC}
+							${suitesparseComp} 		${suitesparseCompLC} 	${suitesparseCompUC}
 			PATHS 			/opt/local/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
 							/usr/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
 							/usr/local/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
 							${SuiteSparse_DIR}/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
 							${${suitesparseCompUC}_DIR}/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
 							${${suitesparseCompUC}_DIR}
-			PATH_SUFFIXES	Release Debug
+			PATH_SUFFIXES	Release
 		)
-		## check if found
-		if(NOT SuiteSparse_${suitesparseCompUC}_LIBRARY)
-			message(WARNING "   Failed to find ${suitesparseComp} :\nSuiteSparse_${suitesparseCompUC}_LIBRARY not found.\nCheck you write correctly the component name (case sensitive),\nor set the SuiteSparse_${suitesparseCompUC}_DIR to look inside")
-		else()
-			list(APPEND SuiteSparse_LIBRARIES	${SuiteSparse_${suitesparseCompUC}_LIBRARY})
+		find_library(SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG
+			NAMES 			${suitesparseComp}d		${suitesparseCompLC}d 		${suitesparseCompUC}d
+							lib${suitesparseComp}d 	lib${suitesparseCompLC}d 	lib${suitesparseCompUC}d
+			PATHS 			/opt/local/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
+							/usr/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
+							/usr/local/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
+							${SuiteSparse_DIR}/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
+							${${suitesparseCompUC}_DIR}/lib${SuiteSparse_SEARCH_LIB_POSTFIX}
+							${${suitesparseCompUC}_DIR}
+			PATH_SUFFIXES	Debug
+		)
+
+		## check and auto complete release with debug if release missing and vice versa
+		if(SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE)
+			if(NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG)
+				set(SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG ${SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE} CACHE PATH "Path to a library." FORCE)
+			endif()
+		endif()
+		if(SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG)
+			if(NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE)
+				set(SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE ${SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG} CACHE PATH "Path to a library." FORCE)
+			endif()
+		endif()
+
+		## check and append the and SuiteSparse_LIBRARIES list, and warn if not found (release and debug) otherwise
+		if(NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE AND NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG)
+			message(WARNING "   Failed to find ${suitesparseComp} :
+			Check you write correctly the component name (case sensitive),
+			or set the SuiteSparse_${suitesparseCompUC}_DIR to look inside,
+			or set directly SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG and SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE
+			")
+		else()
+			list(APPEND SuiteSparse_LIBRARIES	optimized "${SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE}" debug "${SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG}")
 		endif()

 		## here we allow to find at least the include OR the lib dir and just warn if one of both missing
-		if(NOT SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR AND NOT SuiteSparse_${suitesparseCompUC}_LIBRARY)
+		if(NOT SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR AND NOT SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE)
 			set(SuiteSparse_${suitesparseCompUC}_FOUND OFF)
 		else()
 			set(SuiteSparse_${suitesparseCompUC}_FOUND ON)
@@ -186,7 +215,8 @@
 			set(SuiteSparse_${suitesparseCompUC}_DIR "$ENV{SuiteSparse_${suitesparseCompUC}_DIR}" CACHE PATH "${suitesparseComp} root directory")
 		else()
 			mark_as_advanced(SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR)
-			mark_as_advanced(SuiteSparse_${suitesparseCompUC}_LIBRARY)
+			mark_as_advanced(SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE)
+			mark_as_advanced(SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG)
 			if(DEFINED SuiteSparse_${suitesparseCompUC}_DIR)
 				mark_as_advanced(SuiteSparse_${suitesparseCompUC}_DIR)
 			endif()
@@ -195,7 +225,8 @@
 		if(SuiteSparse_VERBOSE)
 			message(STATUS "   SuiteSparse_${suitesparseCompUC}_FOUND = ${SuiteSparse_${suitesparseCompUC}_FOUND} : ")
 			message(STATUS "      * SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR = ${SuiteSparse_${suitesparseCompUC}_INCLUDE_DIR}")
-			message(STATUS "      * SuiteSparse_${suitesparseCompUC}_LIBRARY = ${SuiteSparse_${suitesparseCompUC}_LIBRARY}")
+			message(STATUS "      * SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG = ${SuiteSparse_${suitesparseCompUC}_LIBRARY_DEBUG}")
+			message(STATUS "      * SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE = ${SuiteSparse_${suitesparseCompUC}_LIBRARY_RELEASE}")
 		endif()

 		list(APPEND SuiteSparse_FOUND_LIST SuiteSparse_${suitesparseCompUC}_FOUND)
@@ -224,7 +255,7 @@

 ## Default behavior if user don't use the COMPONENTS flag in find_package(SuiteSparse ...) command
 if(NOT SuiteSparse_FIND_COMPONENTS)
-	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL)  ## suitesparse and metis are not searched by default (special case)
+	list(APPEND SuiteSparse_FIND_COMPONENTS AMD CAMD CCOLAMD COLAMD CHOLMOD SPQR LDL BTF KLU)  ## suitesparse and metis are not searched by default (special case)
 endif()

 SuiteSparse_FIND_COMPONENTS()


Dependencies: build SDL2 on Windows for convenience

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -151,6 +151,24 @@
         ${CMAKE_BINARY_DIR}/freetype-2.6.5
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/freetype-2.6.5/objs)
     execute_process(COMMAND cmake --build ${CMAKE_BINARY_DIR}/freetype-2.6.5/objs --target install)
+
+    if(MSVC) # other platforms dont need this
+        message(STATUS "Building SDL2")
+        file(DOWNLOAD
+            https://libsdl.org/release/SDL2-2.0.5.tar.gz
+            ${OGRE_BINARY_DIR}/SDL2-2.0.5.tar.gz)
+        execute_process(COMMAND cmake -E tar xf SDL2-2.0.5.tar.gz WORKING_DIRECTORY ${OGRE_BINARY_DIR})
+        execute_process(COMMAND cmake -E make_directory ${OGRE_BINARY_DIR}/SDL2-build)
+        execute_process(COMMAND cmake
+            -DCMAKE_INSTALL_PREFIX=${OGREDEPS_PATH}
+            -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
+            -DSDL_STATIC=FALSE
+            -G ${CMAKE_GENERATOR}
+            ${CROSS}
+            ${OGRE_BINARY_DIR}/SDL2-2.0.5
+            WORKING_DIRECTORY ${OGRE_BINARY_DIR}/SDL2-build)
+        execute_process(COMMAND cmake --build ${OGRE_BINARY_DIR}/SDL2-build --target install)
+    endif()
 endif()

 #######################################################################


New version: 0.3.6

New version: 0.3.6

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "5")
+SET(HAWKEY_PATCH "6")


Fix bug when creating static library archives from halide generated
code in the CMake build under Linux.

Previously the ``q`` flag was being used with ``ar`` which
just appends the object file to the archive without checking if it
was already present. This would lead to multiple versions of an object
file ending up in the archive. Then if an application linked against
this archive it would pick the first object file (i.e. the stale one)
rather than the latest version of the object file.

Now we use the ``r`` flag instead which is inserts object files into
the archive with **replacement**.

Former-commit-id: 2ef04e6ff7cb9635a614f602ecedb3bb51a0b7d3

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -115,7 +115,7 @@
         DEPENDS "${args_GENERATOR_TARGET}"
         COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
         # Create an archive using ar (or similar)
-        COMMAND "${CMAKE_AR}" q "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
+        COMMAND "${CMAKE_AR}" r "${FILTER_LIB}" "${SCRATCH_DIR}/${args_GENERATED_FUNCTION}.o"
         WORKING_DIRECTORY "${SCRATCH_DIR}"
         )
     else()


drop use of -D w.r.t. to definitions

drop use of -D w.r.t. to definitions

--- rmw/cmake/configure_rmw_library.cmake
+++ rmw/cmake/configure_rmw_library.cmake
@@ -27,7 +27,11 @@
 #
 # But it doesn't seem to set the compiler flags correctly on clang and
 # also doesn't work very well when the headers and library are in
-# different projects like this
+# different projects like this.
+#
+# Effectively, using this macro results in the RMW_BUILDING_DLL definition
+# being set on Windows, and the -fvisibility* flags being passed to gcc and
+# clang.
 #
 # @public
 #
@@ -45,6 +49,6 @@
     # Causes the visibility macros to use dllexport rather than dllimport
     # which is appropriate when building the dll but not consuming it.
     target_compile_definitions(${library_target}
-      PRIVATE "-DRMW_BUILDING_DLL")
+      PRIVATE "RMW_BUILDING_DLL")
   endif()
 endmacro()


git was pulling to a different repo

git was pulling to a different repo

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -63,7 +63,7 @@
   set_property(GLOBAL PROPERTY Label ${subproject_name})

   setup_repo(${subproject_name} "https://github.com/SCOREC/EnGPar.git")
-  setup_repo(engpar "https://github.com/SCOREC/EnGPar.git")
+  setup_repo(EnGPar "https://github.com/SCOREC/EnGPar.git")

   if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/${subproject_name}")
     file(MAKE_DIRECTORY ${CTEST_BINARY_DIRECTORY}/${subproject_name})


Merging master into master-sim

Merging master into master-sim

--- cdash/nightly.cmake
+++ cdash/nightly.cmake
@@ -314,5 +314,5 @@
   endforeach()
 endforeach()
 try_merge(master "" develop "${CONFIGURE_OPTIONS}" ${ALLOWED_WARNINGS})
+try_merge(develop "-sim" master "${CONFIGURE_OPTIONS-sim}" ${ALLOWED_WARNINGS-sim})
 try_merge(master "-sim" develop-sim "${CONFIGURE_OPTIONS-sim}" ${ALLOWED_WARNINGS-sim})
-try_merge(master "-sim" master "${CONFIGURE_OPTIONS-sim}" ${ALLOWED_WARNINGS-sim})


Reflect stream library renaming

Reflect stream library renaming

--- FindDisplayCluster.cmake
+++ FindDisplayCluster.cmake
@@ -64,7 +64,7 @@
   endif()
 endif()

-find_library(DISPLAYCLUSTER_LIBRARY DisplayCluster
+find_library(DISPLAYCLUSTER_LIBRARY dcstream
   HINTS ${CMAKE_SOURCE_DIR}/../../.. $ENV{DISPLAYCLUSTER_ROOT} ${DISPLAYCLUSTER_ROOT}
   PATH_SUFFIXES lib lib64
   PATHS /usr /usr/local /opt /opt/local)


Adjust mac install rule for python 3

Adjust mac install rule for python 3

--- projects/apple/tomviz.bundle.cmake
+++ projects/apple/tomviz.bundle.cmake
@@ -31,7 +31,7 @@
     # install all python modules/packages for numpy and pyfftw.
     file(INSTALL DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/tomviz.app/Contents/Python/\"
          USE_SOURCE_PERMISSIONS TYPE DIRECTORY FILES
-         \"${install_location}/lib/python3.6/site-packages/\")
+         \"${install_location}/lib/python3.6/\")

     if(${itk_ENABLED})
         execute_process(


Fixed crash on ci due to missing arpack targets

Former-commit-id: 0e92ea39b5b93f84dc7b7ff941a978339efa8b70

--- cmake-modules/FindLapacke.cmake
+++ cmake-modules/FindLapacke.cmake
@@ -190,8 +190,8 @@
     include(cmake-modules/PrintTargetInfo.cmake)
     print_target_info(lapacke::lapacke)
     get_target_property(LAPACKE_INCLUDE_DIR lapacke::lapacke INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
-    message("LAPACKE_INCLUDE_DIRR ${LAPACKE_INCLUDE_DIRR}")
-    set(Lapacke_TARGET      lapack::lapacke)
+    message("LAPACKE_INCLUDE_DIR ${LAPACKE_INCLUDE_DIR}")
+    set(Lapacke_TARGET      lapacke::lapacke)
     set(Lapacke_FOUND       TRUE)
 else()
     set(Lapacke_FOUND       FALSE)


Fix curl find_package: locate shared version first. (#1434)

- Only use find_package from CMake when FORCE_BUILD_DEPS is false
- Remove stray 'CONFIG' passed to this find_package. This was left from
  the curl/cmake iteration, and breaks this initial find_package, which
  causes FindCurlEP to fallback to the second find block, preferring the
  static libcurl (causing a number of link complications later)
- Also remove 'QUIET' setting from find_package call for better feedback
  about search process.

--- cmake/Modules/FindCurl_EP.cmake
+++ cmake/Modules/FindCurl_EP.cmake
@@ -41,9 +41,9 @@
 # can use with find_package.

 # First try the CMake-provided find script.
-find_package(CURL
-  HINTS "${CURL_PATHS}"
-  QUIET ${TILEDB_DEPS_NO_DEFAULT_PATH} CONFIG)
+if (NOT TILEDB_FORCE_ALL_DEPS)
+  find_package(CURL ${TILEDB_DEPS_NO_DEFAULT_PATH})
+endif()

 # Next try finding the superbuild external project
 if (NOT CURL_FOUND)