[cmake] Refactor out llvm related config from swift_common_standalone_build_config to swift_common_standalone_build_config_llvm.

*NOTE* The diff looks bigger than it actually is. This is just a pure
refactoring.

rdar://26154980

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -11,6 +11,108 @@
 else()
   set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
 endif()
+
+macro(swift_common_standalone_build_config_llvm product is_cross_compiling)
+  option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
+
+  precondition_translate_flag(${product}_PATH_TO_LLVM_SOURCE PATH_TO_LLVM_SOURCE)
+  precondition_translate_flag(${product}_PATH_TO_LLVM_BUILD PATH_TO_LLVM_BUILD)
+
+  set(SWIFT_LLVM_CMAKE_PATHS
+      "${PATH_TO_LLVM_BUILD}/share/llvm/cmake"
+      "${PATH_TO_LLVM_BUILD}/lib/cmake/llvm")
+
+  # Add all LLVM CMake paths to our cmake module path.
+  foreach(path ${SWIFT_LLVM_CMAKE_PATHS})
+    list(APPEND CMAKE_MODULE_PATH ${path})
+  endforeach()
+
+  # If we already have a cached value for LLVM_ENABLE_ASSERTIONS, save the value.
+  if (DEFINED LLVM_ENABLE_ASSERTIONS)
+    set(LLVM_ENABLE_ASSERTIONS_saved "${LLVM_ENABLE_ASSERTIONS}")
+  endif()
+
+  # Then we import LLVMConfig. This is going to override whatever cached value
+  # we have for LLVM_ENABLE_ASSERTIONS.
+  include(LLVMConfig)
+
+  # If we did not have a cached value for LLVM_ENABLE_ASSERTIONS, set
+  # LLVM_ENABLE_ASSERTIONS_saved to be the ENABLE_ASSERTIONS value from LLVM so
+  # we follow LLVMConfig.cmake's value by default if nothing is provided.
+  if (NOT DEFINED LLVM_ENABLE_ASSERTIONS_saved)
+    set(LLVM_ENABLE_ASSERTIONS_saved "${LLVM_ENABLE_ASSERTIONS}")
+  endif()
+
+  # Then set LLVM_ENABLE_ASSERTIONS with a default value of
+  # LLVM_ENABLE_ASSERTIONS_saved.
+  #
+  # The effect of this is that if LLVM_ENABLE_ASSERTION did not have a cached
+  # value, then LLVM_ENABLE_ASSERTIONS_saved is set to LLVM's value, so we get a
+  # default value from LLVM.
+  set(LLVM_ENABLE_ASSERTIONS "${LLVM_ENABLE_ASSERTIONS_saved}"
+    CACHE BOOL "Enable assertions")
+  mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
+
+  precondition(LLVM_TOOLS_BINARY_DIR)
+  precondition_translate_flag(LLVM_BUILD_LIBRARY_DIR LLVM_LIBRARY_DIR)
+  precondition_translate_flag(LLVM_BUILD_MAIN_INCLUDE_DIR LLVM_MAIN_INCLUDE_DIR)
+  precondition_translate_flag(LLVM_BUILD_BINARY_DIR LLVM_BINARY_DIR)
+  precondition_translate_flag(LLVM_BUILD_MAIN_SRC_DIR LLVM_MAIN_SRC_DIR)
+
+  if(${is_cross_compiling})
+    find_program(SWIFT_TABLEGEN_EXE "llvm-tblgen" "${${product}_NATIVE_LLVM_TOOLS_PATH}"
+      NO_DEFAULT_PATH)
+    if ("${SWIFT_TABLEGEN_EXE}" STREQUAL "SWIFT_TABLEGEN_EXE-NOTFOUND")
+      message(FATAL_ERROR "Failed to find tablegen in ${${product}_NATIVE_LLVM_TOOLS_PATH}")
+    endif()
+  else()
+    set(SWIFT_TABLEGEN_EXE llvm-tblgen)
+    set(${product}_NATIVE_LLVM_TOOLS_PATH "${PATH_TO_LLVM_TOOLS_BINARY_DIR}")
+  endif()
+
+  include(AddLLVM)
+  include(AddSwiftTableGen) # This imports TableGen from LLVM.
+  include(HandleLLVMOptions)
+
+  set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
+  string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MAJOR
+    ${PACKAGE_VERSION})
+  string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MINOR
+    ${PACKAGE_VERSION})
+
+  set(SWIFT_LIBCLANG_LIBRARY_VERSION
+    "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" CACHE STRING
+    "Version number that will be placed into the libclang library , in the form XX.YY")
+
+  set(CMAKE_INCLUDE_CURRENT_DIR ON)
+  include_directories("${PATH_TO_LLVM_BUILD}/include"
+                      "${LLVM_MAIN_INCLUDE_DIR}")
+  foreach (INCLUDE_DIR ${LLVM_INCLUDE_DIRS})
+    include_directories(${INCLUDE_DIR})
+  endforeach ()
+
+  # *NOTE* if we want to support separate Clang builds as well as separate LLVM
+  # builds, the clang build directory needs to be added here.
+  link_directories("${LLVM_LIBRARY_DIR}")
+
+  set(LIT_ARGS_DEFAULT "-sv")
+  if(XCODE)
+    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
+  endif()
+  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
+
+  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
+
+  set(LLVM_INCLUDE_TESTS TRUE)
+  set(LLVM_INCLUDE_DOCS TRUE)
+
+  option(LLVM_ENABLE_DOXYGEN "Enable doxygen support" FALSE)
+  if (LLVM_ENABLE_DOXYGEN)
+    find_package(Doxygen REQUIRED)
+  endif()
+endmacro()

 macro(swift_common_standalone_build_config_clang product is_cross_compiling)
   # Clang
@@ -77,106 +179,7 @@
 #   is_cross_compiling
 #     Whether this is cross-compiling host tools.
 macro(swift_common_standalone_build_config product is_cross_compiling)
-  option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
-
-  precondition_translate_flag(${product}_PATH_TO_LLVM_SOURCE PATH_TO_LLVM_SOURCE)
-  precondition_translate_flag(${product}_PATH_TO_LLVM_BUILD PATH_TO_LLVM_BUILD)
-
-  set(SWIFT_LLVM_CMAKE_PATHS
-      "${PATH_TO_LLVM_BUILD}/share/llvm/cmake"
-      "${PATH_TO_LLVM_BUILD}/lib/cmake/llvm")
-
-  # Add all LLVM CMake paths to our cmake module path.
-  foreach(path ${SWIFT_LLVM_CMAKE_PATHS})
-    list(APPEND CMAKE_MODULE_PATH ${path})
-  endforeach()
-
-  # If we already have a cached value for LLVM_ENABLE_ASSERTIONS, save the value.
-  if (DEFINED LLVM_ENABLE_ASSERTIONS)
-    set(LLVM_ENABLE_ASSERTIONS_saved "${LLVM_ENABLE_ASSERTIONS}")
-  endif()
-
-  # Then we import LLVMConfig. This is going to override whatever cached value
-  # we have for LLVM_ENABLE_ASSERTIONS.
-  include(LLVMConfig)
-
-  # If we did not have a cached value for LLVM_ENABLE_ASSERTIONS, set
-  # LLVM_ENABLE_ASSERTIONS_saved to be the ENABLE_ASSERTIONS value from LLVM so
-  # we follow LLVMConfig.cmake's value by default if nothing is provided.
-  if (NOT DEFINED LLVM_ENABLE_ASSERTIONS_saved)
-    set(LLVM_ENABLE_ASSERTIONS_saved "${LLVM_ENABLE_ASSERTIONS}")
-  endif()
-
-  # Then set LLVM_ENABLE_ASSERTIONS with a default value of
-  # LLVM_ENABLE_ASSERTIONS_saved.
-  #
-  # The effect of this is that if LLVM_ENABLE_ASSERTION did not have a cached
-  # value, then LLVM_ENABLE_ASSERTIONS_saved is set to LLVM's value, so we get a
-  # default value from LLVM.
-  set(LLVM_ENABLE_ASSERTIONS "${LLVM_ENABLE_ASSERTIONS_saved}"
-    CACHE BOOL "Enable assertions")
-  mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
-
-  precondition(LLVM_TOOLS_BINARY_DIR)
-  precondition_translate_flag(LLVM_BUILD_LIBRARY_DIR LLVM_LIBRARY_DIR)
-  precondition_translate_flag(LLVM_BUILD_MAIN_INCLUDE_DIR LLVM_MAIN_INCLUDE_DIR)
-  precondition_translate_flag(LLVM_BUILD_BINARY_DIR LLVM_BINARY_DIR)
-  precondition_translate_flag(LLVM_BUILD_MAIN_SRC_DIR LLVM_MAIN_SRC_DIR)
-
-  if(${is_cross_compiling})
-    find_program(SWIFT_TABLEGEN_EXE "llvm-tblgen" "${${product}_NATIVE_LLVM_TOOLS_PATH}"
-      NO_DEFAULT_PATH)
-    if ("${SWIFT_TABLEGEN_EXE}" STREQUAL "SWIFT_TABLEGEN_EXE-NOTFOUND")
-      message(FATAL_ERROR "Failed to find tablegen in ${${product}_NATIVE_LLVM_TOOLS_PATH}")
-    endif()
-  else()
-    set(SWIFT_TABLEGEN_EXE llvm-tblgen)
-    set(${product}_NATIVE_LLVM_TOOLS_PATH "${PATH_TO_LLVM_TOOLS_BINARY_DIR}")
-  endif()
-
-  include(AddLLVM)
-  include(AddSwiftTableGen) # This imports TableGen from LLVM.
-  include(HandleLLVMOptions)
-
-  set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
-  string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MAJOR
-    ${PACKAGE_VERSION})
-  string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" PACKAGE_VERSION_MINOR
-    ${PACKAGE_VERSION})
-
-  set(SWIFT_LIBCLANG_LIBRARY_VERSION
-    "${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}" CACHE STRING
-    "Version number that will be placed into the libclang library , in the form XX.YY")
-
-  set(CMAKE_INCLUDE_CURRENT_DIR ON)
-  include_directories("${PATH_TO_LLVM_BUILD}/include"
-                      "${LLVM_MAIN_INCLUDE_DIR}")
-  foreach (INCLUDE_DIR ${LLVM_INCLUDE_DIRS})
-    include_directories(${INCLUDE_DIR})
-  endforeach ()
-
-  # *NOTE* if we want to support separate Clang builds as well as separate LLVM
-  # builds, the clang build directory needs to be added here.
-  link_directories("${LLVM_LIBRARY_DIR}")
-
-  set(LIT_ARGS_DEFAULT "-sv")
-  if(XCODE)
-    set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
-  endif()
-  set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
-
-  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
-  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
-  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
-
-  set(LLVM_INCLUDE_TESTS TRUE)
-  set(LLVM_INCLUDE_DOCS TRUE)
-
-  option(LLVM_ENABLE_DOXYGEN "Enable doxygen support" FALSE)
-  if (LLVM_ENABLE_DOXYGEN)
-    find_package(Doxygen REQUIRED)
-  endif()
-
+  swift_common_standalone_build_config_llvm(${product} ${is_cross_compiling})
   swift_common_standalone_build_config_clang(${product} ${is_cross_compiling})
   swift_common_standalone_build_config_cmark(${product})
 endmacro()


[Apple Silicon] Don't set native llvm tools path when cross compiling swift

--- cmake/modules/SwiftSharedCMakeConfig.cmake
+++ cmake/modules/SwiftSharedCMakeConfig.cmake
@@ -58,7 +58,7 @@
     fix_imported_targets_for_xcode("${LLVM_EXPORTED_TARGETS}")
   endif()

-  if(NOT CMAKE_CROSSCOMPILING)
+  if(NOT CMAKE_CROSSCOMPILING AND NOT SWIFT_CROSS_COMPILING)
     set(${product}_NATIVE_LLVM_TOOLS_PATH "${LLVM_TOOLS_BINARY_DIR}")
   endif()


[FIX,INTERNAL] Look for subdirectory seqan in FindSeqAn.cmake instead of seqan.h when not used in SeqAn build system as well.

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@13915 e6417c60-b987-48fd-844e-b20f0fcc1017

--- util/cmake/FindSeqAn.cmake
+++ util/cmake/FindSeqAn.cmake
@@ -222,15 +222,15 @@
 endif (MSVC)

 # ----------------------------------------------------------------------------
-# Search for header seqan.h.
+# Search for directory seqan.
 # ----------------------------------------------------------------------------

 option (SEQAN_USE_SEQAN_BUILD_SYSTEM "Whether or not to expect the SeqAn build system with core/extras structure." OFF)

 if (SEQAN_USE_SEQAN_BUILD_SYSTEM)
   # When using the SeqAn build system, we scan all entries in
-  # CMAKE_INCLUDE_PATH for a seqan.h and add all paths to the variable
-  # SEQAN_INCLUDE_DIRS.
+  # CMAKE_INCLUDE_PATH for a subdirectory seqan and add all paths to the
+  # variable SEQAN_INCLUDE_DIRS.
   set (_SEQAN_INCLUDE_DIRS "")
   foreach (_SEQAN_BASEDIR ${CMAKE_INCLUDE_PATH})
     if (EXISTS ${_SEQAN_BASEDIR}/seqan)
@@ -246,9 +246,9 @@
     set(SEQAN_FOUND        FALSE)
   endif (_SEQAN_INCLUDE_DIRS)
 else (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-  # When NOT using the SeqAn build system then we only look for one seqan.h
-  # and thus only one library.
-  find_path(_SEQAN_BASEDIR "seqan.h" PATHS ${SEQAN_INCLUDE_PATH})
+  # When NOT using the SeqAn build system then we only look for one directory
+  # with subdirectory seqan and thus only one library.
+  find_path(_SEQAN_BASEDIR "seqan" PATHS ${SEQAN_INCLUDE_PATH})
   mark_as_advanced(_SEQAN_BASEDIR)
   if (_SEQAN_BASEDIR)
     set(SEQAN_FOUND        TRUE)


update FindMKL to match the default installation behavior of MKL 11

--- bench/btl/cmake/FindMKL.cmake
+++ bench/btl/cmake/FindMKL.cmake
@@ -20,12 +20,23 @@
   PATHS
   $ENV{MKLLIB}
   /opt/intel/mkl/*/lib/em64t
+  /opt/intel/Compiler/*/*/mkl/lib/em64t
   ${LIB_INSTALL_DIR}
 )

-if(MKL_LIBRARIES)
-set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_lp64 mkl_sequential guide pthread)
-endif(MKL_LIBRARIES)
+find_library(MKL_GUIDE
+  guide
+  PATHS
+  $ENV{MKLLIB}
+  /opt/intel/mkl/*/lib/em64t
+  /opt/intel/Compiler/*/*/mkl/lib/em64t
+  /opt/intel/Compiler/*/*/lib/intel64
+  ${LIB_INSTALL_DIR}
+)
+
+if(MKL_LIBRARIES AND MKL_GUIDE)
+  set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel_lp64 mkl_sequential ${MKL_GUIDE} pthread)
+endif()

 else(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")

@@ -34,12 +45,23 @@
   PATHS
   $ENV{MKLLIB}
   /opt/intel/mkl/*/lib/32
+  /opt/intel/Compiler/*/*/mkl/lib/32
   ${LIB_INSTALL_DIR}
 )

-if(MKL_LIBRARIES)
-set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_sequential guide pthread)
-endif(MKL_LIBRARIES)
+find_library(MKL_GUIDE
+  guide
+  PATHS
+  $ENV{MKLLIB}
+  /opt/intel/mkl/*/lib/32
+  /opt/intel/Compiler/*/*/mkl/lib/32
+  /opt/intel/Compiler/*/*/lib/intel32
+  ${LIB_INSTALL_DIR}
+)
+
+if(MKL_LIBRARIES AND MKL_GUIDE)
+  set(MKL_LIBRARIES ${MKL_LIBRARIES} mkl_intel mkl_sequential ${MKL_GUIDE} pthread)
+endif()

 endif(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")


Update VTK.cmake

Update VTK.cmake

removing "origin/" from GIT_TAG

--- cmake/externals/projects_modules/VTK.cmake
+++ cmake/externals/projects_modules/VTK.cmake
@@ -52,7 +52,7 @@
 if (NOT DEFINED ${ep}_SOURCE_DIR)
     set(location GIT_REPOSITORY "git://vtk.org/VTK.git")
     # Set GIT_TAG to latest commit of origin/release-5.10 known to work
-    set(branch GIT_TAG "origin/release-5.10@{29/01/2014}")
+    set(branch GIT_TAG "release-5.10@{29/01/2014}")
 endif()


cmake: detect sysroot for cross-compile toolchains

Fixes: #49587

Try to detect sysroot for cross-compile toolchain if not specified by
the user with `-DSYSROOT_DIR=<path>`.

First, the C compiler is asked if it knows its sysroot, some C compilers
are able to return the sysroot, as an example:
> $ arm-none-eabi-gcc -print-sysroot
> <path>/bin/../arm-none-eabi
> $

but majority of gcc-based C compilers seems to return empty string:
> $ arm-zephyr-eabi-gcc --print-sysroot
> $

in such cases, the cross-compiler target CMake file will try to discover
the sysroot by searching for libc.a, starting one level up from the
compiler location.

If no sysroot candidate is found, a warning will be printed to the user.
If a single sysroot candidate is found, this candidate will be selected.
If multiply sysroot candidates are found, a warning is printed, and the
first candiate in the list is selected. User may select another
candidate with `-DSYSROOT_DIR=<use-this>`.

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

--- cmake/toolchain/cross-compile/target.cmake
+++ cmake/toolchain/cross-compile/target.cmake
@@ -1,3 +1,64 @@
 # SPDX-License-Identifier: Apache-2.0

-# This file intentionally left blank.
+if(NOT SYSROOT_DIR)
+  # When using cross-compile, the generic toolchain will be identical to the
+  # target toolchain, hence let's ask the compiler if it knows its own sysroot.
+  # Some gcc based compilers do have this information built-in.
+  execute_process(COMMAND ${CMAKE_C_COMPILER} --print-sysroot
+                  RESULT_VARIABLE return_val
+                  OUTPUT_VARIABLE reported_sysroot
+                  OUTPUT_STRIP_TRAILING_WHITESPACE
+  )
+  if(NOT return_val AND NOT "${reported_sysroot}" STREQUAL "")
+    set(SYSROOT_DIR "${reported_sysroot}" CACHE INTERNAL "Sysroot reported by ${CMAKE_C_COMPILER}")
+  else()
+    # Let's try to lookup a sysroot.
+    # Compiler is expected to be located in `bin/` so we go one folder up for search.
+    cmake_path(GET CMAKE_C_COMPILER PARENT_PATH search_path)
+    cmake_path(SET search_path NORMALIZE "${search_path}/..")
+    file(GLOB_RECURSE libc_dirs RELATIVE ${search_path} ${search_path}/**/libc.a )
+
+    # Did we find any candidates ?
+    list(LENGTH libc_dirs libc_dirs_length)
+    if(${libc_dirs_length} GREATER 0)
+      list(TRANSFORM libc_dirs REPLACE "libc.a$" "")
+      list(SORT libc_dirs COMPARE NATURAL)
+      list(GET libc_dirs 0 sysroot)
+      set(sysroot_candidates ${sysroot})
+
+      foreach(dir ${libc_dirs})
+        string(FIND "${dir}" "${sysroot}" index)
+        if(${index} EQUAL -1)
+          set(sysroot ${dir})
+          list(APPEND sysroot_candidates ${sysroot})
+        endif()
+      endforeach()
+
+      # We detect the lib folders, the actual sysroot is up one level.
+      list(TRANSFORM sysroot_candidates REPLACE "/lib[/]?$" "")
+
+      list(LENGTH sysroot_candidates sysroot_candidates_length)
+      if(sysroot_candidates_length GREATER 1)
+        list(TRANSFORM sysroot_candidates PREPEND "${search_path}")
+        string(REPLACE ";" "\n" sysroot_candidates_str "${sysroot_candidates}")
+
+        message(WARNING "Multiple sysroot candidates found: ${sysroot_candidates_str}\n"
+                        "Use `-DSYSROOT_DIR=<sysroot-dir>` to select sysroot.\n"
+        )
+      endif()
+
+      # Use first candidate as sysroot.
+      list(GET sysroot_candidates 0 chosen_sysroot)
+      cmake_path(SET SYSROOT_DIR NORMALIZE "${search_path}/${chosen_sysroot}")
+    endif()
+
+    if(SYSROOT_DIR)
+      set(SYSROOT_DIR "${SYSROOT_DIR}" CACHE INTERNAL "Sysroot discovered")
+      message(STATUS "Found sysroot: ${SYSROOT_DIR}")
+    else()
+      message(WARNING "No sysroot found, build may not work.\n"
+                      "Use `-DSYSROOT_DIR=<sysroot-dir>` to specify sysroot to use.\n"
+      )
+    endif()
+  endif()
+endif()


Updating ITK along release branch

Updating ITK along release branch

Change-Id: Ib1b52949f6c028d99a2d13f7e3aa97e957cfc371

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 2744162f6d74160c8f4b2943af8a21a8e5c11720 )
+set(ITK_TAG_COMMAND GIT_TAG 0c4381bbca1c5595bf397e2d4f2646aaf394a973 )

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


changes to ITK building

changes to ITK building

    - add new option `ITK_MINIMAL_LIBS` (default to `ON`) to build less of ITK
    - allow use of option `ITK_EXTRA_CMAKE_ARGS`

    fixes #210

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -49,6 +49,22 @@

   OPTION(ITK_SHARED_LIBS "ITK uses shared libraries" ON)

+  OPTION(ITK_MINIMAL_LIBS "Only build ITK IO libraries" ON)
+  if (ITK_MINIMAL_LIBS)
+
+    set(ITK_CMAKE_FLAGS
+      -DITK_BUILD_DEFAULT_MODULES:BOOL=OFF
+      -DITKGroup_IO:BOOL=ON
+      -DITKGroup_IO:BOOL=ON
+      -DModule_ITKReview:BOOL=ON # for PETPVC
+      )
+  else()
+
+    set(ITK_CMAKE_FLAGS
+      -DITK_BUILD_DEFAULT_MODULES:BOOL=ON
+      )
+  endif()
+
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     ${${proj}_EP_ARGS_GIT}
@@ -65,6 +81,8 @@
       -DBUILD_TESTING:BOOL=${BUILD_TESTING_${proj}}
       -DBUILD_EXAMPLES:BOOL=OFF
       -DITK_SKIP_PATH_LENGTH_CHECKS:BOOL=${ITK_SKIP_PATH_LENGTH_CHECKS}
+      ${ITK_CMAKE_FLAGS}
+      ${${proj}_EXTRA_CMAKE_ARGS}
     DEPENDS ${${proj}_DEPENDENCIES}
   )


Update Superbuild ITK version

Update Superbuild ITK version

This update includes a fix for a mutex lock in the CreateImageIO
method. Warning fixes CMP policies in KWStyle, and warning fixes for
ImageFusion table issues.

Change-Id: I3ab054488b28681539535d7b18f9a3cce54c0997

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -42,7 +42,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG 83e8dfb83bfcaf14ed896e05b7f85702bee790fe )# ITK 4.11 under development
+set(ITK_TAG_COMMAND GIT_TAG f422b721db385ed47504e19d96eabc4dee25ddc8 )# ITK 4.11 under development

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Update ITK version to past v4.12rc3 tag

Update ITK version to past v4.12rc3 tag

This include significant changes to the visibility properties on OSX.

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -51,7 +51,7 @@
 endif()

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.12rc02) # v4.12 Release Candidate
+set(ITK_TAG_COMMAND GIT_TAG d6c46070becb30882240631fee71a75ef244c2c2) # v4.12 after RC3

 if( ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Update ITK superbuild version to v5.3.rc01

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

-set(_DEFAULT_ITK_GIT_TAG "v5.2.1")
+set(_DEFAULT_ITK_GIT_TAG "v5.3rc01")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


BUG: Do not run ctest_test in itksoftwareguide-dashboard

There are currently no tests. This causes the return value of the script
to be 255, which indicates a fail positive build failures on CircleCI.

Also ensure that the CTest script returns non-zero if any configure
errors occur or if build warnings or errors occur.

--- Docker/itksoftwareguide-dashboard/dashboard.cmake
+++ Docker/itksoftwareguide-dashboard/dashboard.cmake
@@ -63,13 +63,29 @@
   ctest_start(Nightly)
 endif()
 ctest_update()
-ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" SOURCE "${CTEST_SOURCE_DIRECTORY}")
+ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}"
+  SOURCE "${CTEST_SOURCE_DIRECTORY}"
+  RETURN_VALUE configure_return)
 ctest_submit(PARTS Update Notes Configure)

-ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND)
-ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")
-ctest_submit(PARTS Build Test)
+ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}" APPEND
+  RETURN_VALUE build_return
+  NUMBER_ERRORS build_errors
+  NUMBER_WARNINGS build_warnings)
+# We currently do not have any tests.
+#ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}"
+  #RETURN_VALUE test_return)
+#ctest_submit(PARTS Build Test)
+ctest_submit(PARTS Build)

 file(GLOB pdfs "${CTEST_BINARY_DIRECTORY}/ITKSoftwareGuide-build/SoftwareGuide/Latex/*.pdf")
 ctest_upload(FILES ${pdfs})
 ctest_submit(PARTS Upload)
+
+if(NOT ${configure_return} EQUAL 0 OR
+   NOT ${build_return} EQUAL 0 OR
+   NOT ${build_errors} EQUAL 0 OR
+   NOT ${build_warnings} EQUAL 0)
+ message(FATAL_ERROR
+   "Build did not complete without warnings, errors, or failures.")
+endif()


Remove itk dependency on fftw3long.

Remove itk dependency on fftw3long.

ITK only uses fftw3double and fftw3 float.

--- projects/itk.cmake
+++ projects/itk.cmake
@@ -1,4 +1,4 @@
-set(fftw_targets fftw3double fftw3float fftw3long)
+set(fftw_targets fftw3double fftw3float)
 if (WIN32)
   set(fftw_targets fftw)
 endif()


Upgrade OpenCV from version 2.4.13.2 to 2.4.13.5

--- CMakeExternals/OpenCV.cmake
+++ CMakeExternals/OpenCV.cmake
@@ -66,8 +66,8 @@
       )
     endif()

-    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-2.4.13.2.tar.gz)
-    set(opencv_url_md5 80a4a3bee0e98898bbbc68986ca73655)
+    set(opencv_url ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/opencv-2.4.13.5.tar.gz)
+    set(opencv_url_md5 6cbe56ffb9ab1424fc2f5e78f46c82a8)

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}


Fix FindFruit.cmake file

Fix FindFruit.cmake file

- The filename forces the module to be called `Fruit`. (Lower case
  letter as `fruit` makes warning during the configure step.)
- The FRUIT_INSTALLED_DIR is a good concept, but needs to annotated
  as CMake variable, otherwise it uses the string as is.
- The library prefix shall allow `lib64` since this is very common
  prefix in many distro. (Would be also nice to add the debian
  variants of `lib/i386-linux-gnu` or `lib/x86_64-linux-gnu`.)

--- cmake-modules/FindFruit.cmake
+++ cmake-modules/FindFruit.cmake
@@ -2,23 +2,23 @@
 # set(ENV{FRUIT_INSTALLED_DIR} "/path/to/fruit/build")

 find_path(FRUIT_INCLUDE_DIR fruit.h
-    HINTS (
-        FRUIT_INSTALLED_DIR
-        /usr
-        /usr/local
-    )
-    PATH_SUFFIXES include/fruit include fruit
-)
+        HINTS (
+            ${FRUIT_INSTALLED_DIR}
+            /usr
+            /usr/local
+            )
+        PATH_SUFFIXES include/fruit
+        )

 find_library(FRUIT_LIBRARY
-  NAMES fruit
-  HINTS (
-      FRUIT_INSTALLED_DIR
-      /usr
-      /usr/local
-  )
-  PATH_SUFFIXES lib ${FRUIT_INSTALLED_DIR}
-)
+        NAMES fruit
+        HINTS (
+            ${FRUIT_INSTALLED_DIR}
+            /usr
+            /usr/local
+            )
+        PATH_SUFFIXES lib lib64
+        )

 include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(fruit DEFAULT_MSG FRUIT_LIBRARY FRUIT_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Fruit DEFAULT_MSG FRUIT_LIBRARY FRUIT_INCLUDE_DIR)


CI: do not supply PDF anymore in PPA.

CI: do not supply PDF anymore in PPA.

--- cmake/Modules/UploadPPA.cmake
+++ cmake/Modules/UploadPPA.cmake
@@ -95,8 +95,8 @@
          "usr/include/aff3ct-${AFF3CT_VERSION_FULL}/*\n")

     file(WRITE "${DEBIAN_SOURCE_DIR}/debian/${CPACK_DEBIAN_PACKAGE_NAME}-doc.install"
-         "doc/built/html/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\n"
-         "doc/built/latex/AFF3CT.pdf usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/pdf/\n")
+         "doc/built/html/* usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/html\n")
+#        "doc/built/latex/AFF3CT.pdf usr/share/aff3ct-${AFF3CT_VERSION_FULL}/doc/pdf/\n")

     ##############################################################################
     # debian/copyright


[cmake] add comments about SWIG_FLAGS not passed when compiling in C

--- cmake/swig_python_tools.cmake
+++ cmake/swig_python_tools.cmake
@@ -157,6 +157,7 @@
     set_source_files_properties(${swig_file}
       PROPERTIES SWIG_FLAGS "${${COMPONENT}_SWIG_DEFS_${_name}}" CPLUSPLUS ON)
   ELSE(WITH_CXX AND (BUILD_AS_CPP OR NOT ${COMPONENT} MATCHES "numerics"))
+    # C compilation, pass SWIG_FLAGS.
     IF(${COMPONENT} MATCHES "numerics")
       set_source_files_properties(${swig_file}
         PROPERTIES SWIG_FLAGS "${${COMPONENT}_SWIG_DEFS_${_name}}")


Wall removed

Wall removed

--- util/cmake/common.cmake
+++ util/cmake/common.cmake
@@ -12,8 +12,8 @@
 set(LIBRARIES_DEF "")

 # add debug definitions to compiler flags
-set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG -Wall")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp -Wall")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fopenmp")

 # define some colors for funny cmake messages
 option(CMAKE_USE_COLOR "CMAKE_USE_COLOR" ON)


Commit 8797a090dc06cd0c9f4cf132b67e4872af1ff8f1 relocated __DF_RPI
but missed to move it from *-clang.cmake Toolchain

Signed-off-by: Nicolae Rosia <207aa917b021b404c269e8647897b2cc6117052a@gmail.com>

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

-add_definitions(
-	-D __DF_RPI
-	)
-
 # where is the target environment
 set(CMAKE_FIND_ROOT_PATH  get_file_component(${C_COMPILER} PATH))


fix: Output name of RUNTIME library component (DLL) [CMake]

--- CMake/Modules/mirtkAddLibrary.cmake
+++ CMake/Modules/mirtkAddLibrary.cmake
@@ -49,7 +49,6 @@
     endif ()
     list(APPEND headers "${hdr}")
   endforeach ()
-  set(OUTPUT_NAME "${PROJECT_PACKAGE_NAME}${PROJECT_NAME}")
   basis_add_library(${target_name} ${TARGET_SOURCES} ${headers})
   basis_get_target_uid(target_uid ${target_name})
   if (TARGET_NAME_VAR)
@@ -60,11 +59,10 @@
   endif ()
   set_target_properties(
     ${target_uid} PROPERTIES
-      VERSION             "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
-      SOVERSION           "${PROJECT_SOVERSION}"
-      ARCHIVE_OUTPUT_NAME "${OUTPUT_NAME}"
-      LIBRARY_OUTPUT_NAME "${OUTPUT_NAME}"
-      DEFINE_SYMBOL       "MIRTK_${PROJECT_NAME}_EXPORTS"
+      VERSION       "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
+      SOVERSION     "${PROJECT_SOVERSION}"
+      OUTPUT_NAME   "${PROJECT_PACKAGE_NAME}${PROJECT_NAME}"
+      DEFINE_SYMBOL "MIRTK_${PROJECT_NAME}_EXPORTS"
   )
   target_include_directories(${target_uid}
     PUBLIC $<BUILD_INTERFACE:${PROJECT_INCLUDE_DIR}>


ENH: If TubeTK_USE_PYTHON and superbuilding ITK, turn on wrapping

--- CMake/Superbuild/External_ITK.cmake
+++ CMake/Superbuild/External_ITK.cmake
@@ -47,6 +47,13 @@
       -DHDF5_ENABLE_USING_MEMCHECKER:BOOL=ON )
   endif( TubeTK_USE_VALGRIND )

+  set( TubeTK_ITK_OPTIONAL_ARGS )
+  if( TubeTK_USE_PYTHON )
+    list( APPEND TubeTK_ITK_OPTIONAL_ARGS
+      -DITK_WRAP_PYTHON:BOOL=ON
+      -DITK_LEGACY_SILENT:BOOL=ON )
+  endif( TubeTK_USE_PYTHON )
+
   ExternalProject_Add( ${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY ${${proj}_URL}
@@ -81,6 +88,7 @@
       -DKWSYS_USE_MD5:BOOL=ON
       -DModule_ITKReview:BOOL=ON
       ${TubeTK_ITKHDF5_VALGRIND_ARGS}
+      ${TubeTK_ITK_OPTIONAL_ARGS}
     INSTALL_COMMAND "" )

 else( NOT DEFINED ${proj}_DIR AND NOT ${USE_SYSTEM_${proj}} )


restore snappy external

restore snappy external

--- externals/CMakeExternals.cmake
+++ externals/CMakeExternals.cmake
@@ -461,6 +461,30 @@
     add_external_library(quickhull
       LIBRARY ${QUICKHULL_LIB})

+  # snappy
+  elseif (NAME STREQUAL "snappy")
+    if (TARGET snappy)
+      return()
+    endif ()
+
+    if (WIN32)
+      set(SNAPPY_LIB "lib/snappy.lib")
+    else ()
+      set(SNAPPY_LIB "${CMAKE_INSTALL_LIBDIR}/libsnappy.a")
+    endif ()
+
+    add_external_project(snappy STATIC
+      GIT_REPOSITORY https://github.com/google/snappy.git
+      GIT_TAG "1.1.7"
+      BUILD_BYPRODUCTS "<INSTALL_DIR>/${SNAPPY_LIB}"
+      CMAKE_ARGS
+        -DBUILD_SHARED_LIBS=OFF
+        -DSNAPPY_BUILD_TESTS=OFF
+        -DCMAKE_BUILD_TYPE=Release)
+
+    add_external_library(snappy
+      LIBRARY ${SNAPPY_LIB})
+
   # tinyply
   elseif (NAME STREQUAL "tinyply")
     if (TARGET tinyply)


add close_project in order to write <Project>Config.h at the very end

--- Numerics/cmake/SiconosProject.cmake
+++ Numerics/cmake/SiconosProject.cmake
@@ -213,9 +213,9 @@
   ENDIF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/src)

   # NumericsConfig.h/KernelConfig.h generation
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
-    CONFIGURE_FILE(config.h.cmake ${PROJECT_SHORT_NAME}Config.h)
-  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
+#  IF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
+#    CONFIGURE_FILE(config.h.cmake ${PROJECT_SHORT_NAME}Config.h)
+#  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)

   # man files
   IF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/man)
@@ -303,6 +303,16 @@
   ENDIF(WITH_CPACK)

 ENDMACRO(SICONOS_PROJECT)
+
+MACRO(CLOSE_PROJECT)
+  # NumericsConfig.h/KernelConfig.h generation
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
+    CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/${PROJECT_SHORT_NAME}Config.h)
+  ENDIF(EXISTS ${CMAKE_SOURCE_DIR}/config.h.cmake)
+
+  FEATURE_SUMMARY(WHAT ALL)
+
+ENDMACRO(CLOSE_PROJECT)

 MACRO(WRITE_NOTES)
   IF(IS_DIRECTORY ${CMAKE_BINARY_DIR}/Testing)


CMake Config: Optional Deps

CMake Config: Optional Deps

Makes the messages on optional backends in alpaka only a status.
The old behaviour causes noisy cmake traces in downstream projects, since
CMake tries to build a little trace through all calling files.

If we implement the optional dependencies/backends as CMake `COMPONENTS`
in the future we can throw warnings again at those stages if they
were requested and cause `ALPAKA_FOUND` to be set to false.

--- alpakaConfig.cmake
+++ alpakaConfig.cmake
@@ -136,7 +136,7 @@
 IF(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE)
     FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET COMPONENTS fiber context system thread atomic chrono date_time)
     IF(NOT Boost_FIBER_FOUND)
-        MESSAGE(WARNING "Optional alpaka dependency Boost fiber could not be found! Fibers back-end disabled!")
+        MESSAGE(STATUS "Optional alpaka dependency Boost fiber could not be found! Fibers back-end disabled!")
         SET(ALPAKA_ACC_CPU_B_SEQ_T_FIBERS_ENABLE OFF CACHE BOOL "Enable the Fibers CPU back-end" FORCE)
         FIND_PACKAGE(Boost ${_ALPAKA_BOOST_MIN_VER} QUIET)
     ENDIF()
@@ -213,7 +213,7 @@
 IF(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE)
     FIND_PACKAGE(TBB 2.2)
     IF(NOT TBB_FOUND)
-        MESSAGE(WARNING "Optional alpaka dependency TBB could not be found! TBB grid block back-end disabled!")
+        MESSAGE(STATUS "Optional alpaka dependency TBB could not be found! TBB grid block back-end disabled!")
         SET(ALPAKA_ACC_CPU_B_TBB_T_SEQ_ENABLE OFF CACHE BOOL "Enable the TBB grid block back-end" FORCE)
     ELSE()
         LIST(APPEND _ALPAKA_LINK_LIBRARIES_PUBLIC ${TBB_LIBRARIES})
@@ -243,7 +243,7 @@
     ENDIF()

     IF(NOT OPENMP_FOUND)
-        MESSAGE(WARNING "Optional alpaka dependency OpenMP could not be found! OpenMP back-ends disabled!")
+        MESSAGE(STATUS "Optional alpaka dependency OpenMP could not be found! OpenMP back-ends disabled!")
         SET(ALPAKA_ACC_CPU_B_OMP2_T_SEQ_ENABLE OFF CACHE BOOL "Enable the OpenMP 2.0 CPU grid block back-end" FORCE)
         SET(ALPAKA_ACC_CPU_B_SEQ_T_OMP2_ENABLE OFF CACHE BOOL "Enable the OpenMP 2.0 CPU block thread back-end" FORCE)
         SET(ALPAKA_ACC_CPU_BT_OMP4_ENABLE OFF CACHE BOOL "Enable the OpenMP 4.0 CPU block and thread back-end" FORCE)
@@ -276,7 +276,7 @@
     ELSE()
         FIND_PACKAGE(CUDA "${ALPAKA_CUDA_VERSION}")
         IF(NOT CUDA_FOUND)
-            MESSAGE(WARNING "Optional alpaka dependency CUDA could not be found! CUDA back-end disabled!")
+            MESSAGE(STATUS "Optional alpaka dependency CUDA could not be found! CUDA back-end disabled!")
             SET(ALPAKA_ACC_GPU_CUDA_ENABLE OFF CACHE BOOL "Enable the CUDA GPU back-end" FORCE)

         ELSE()


Split off 7.8.8

Split off 7.8.8

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
-set ( HPCC_POINT 7 )
+set ( HPCC_POINT 9 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Change hakabana version

Change hakabana version

--- version.cmake
+++ version.cmake
@@ -4,4 +4,4 @@

 set(HAKABANA_VERSION_MAJOR 0)
 set(HAKABANA_VERSION_MINOR 2)
-set(HAKABANA_VERSION_PATCH 0)
+set(HAKABANA_VERSION_PATCH 1)


Bump version number

Bump version number

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(LeapSerial_VERSION 0.1.0)
+set(LeapSerial_VERSION 0.1.1)


[axl] release 6.2.0

[axl] release 6.2.0


Split off 8.4.24

Split off 8.4.24

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 23 )
+set ( HPCC_POINT 25 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Split off 8.4.58

Split off 8.4.58

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 57 )
+set ( HPCC_POINT 59 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Add missing libraries and definitions on win32 platform.

--- salome_adm/cmake_files/FindSalomeBoost.cmake
+++ salome_adm/cmake_files/FindSalomeBoost.cmake
@@ -27,7 +27,7 @@
 SET(Boost_USE_MULTITHREADED      ON)
 SET(Boost_USE_STATIC_RUNTIME     OFF)
 SET(Boost_NO_BOOST_CMAKE         ON)
-SET(SalomeBoost_FIND_COMPONENTS  filesystem regex signals system thread)
+SET(SalomeBoost_FIND_COMPONENTS  filesystem regex signals system thread date_time chrono)

 IF(WIN32)
   # Under windows, one extra sub-directory in the boost installation hierarchy:
@@ -42,7 +42,7 @@

 ## Specific definitions:
 IF(WIN32)
-  SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS)
+  SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK)
 ENDIF()

 SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS)


need RLINK path set to true

need RLINK path set to true

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


SVN_SILENT made messages (.desktop file)

--- vlc/vlc.desktop.cmake
+++ vlc/vlc.desktop.cmake
@@ -38,7 +38,7 @@
 Comment[ca@valencia]=Dorsal del VLC pel Phonon
 Comment[cs]=Podpůrná vrstva VLC
 Comment[da]=Phonon VLC-motor
-Comment[de]=Phonon-Treiber für VLC
+Comment[de]=Phonon-Back-End für VLC
 Comment[es]=Motor VLC para Phonon
 Comment[et]=Phononi VLC taustaprogramm
 Comment[hu]=Phonon VLC-backend


Graph Control 4.0.0-1 Gold

Graph Control 4.0.0-1 Gold

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,8 +5,8 @@
 set ( HPCC_MAJOR 4 )
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 15 )
+set ( HPCC_MATURITY "release" )
+set ( HPCC_SEQUENCE 1 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Split off 8.2.58

Split off 8.2.58

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 57 )
+set ( HPCC_POINT 59 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Bumped autowiring version number

Bumped autowiring version number

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(autowiring_VERSION 0.3.1)
+set(autowiring_VERSION 0.3.2)


fbcode_builder: update ThriftCppLibrary to use fb_cmake_parse_args()

Summary:
Change ThriftCppLibrary to use `fb_cmake_parse_args()`

This code doesn't really care much about handling empty arguments, so we could
use the standard `cmake_parse_arguments()` function here instead of
`fb_cmake_parse_args()`.  However, it is slightly more convenient that
`fb_cmake_parse_args()` automatically errors out on unhandled arguments, so
that we don't have to check for this ourselves.

Reviewed By: wez

Differential Revision: D16738445

fbshipit-source-id: 67b9761f2ceaf7665bd336290bb44af32fec6f4a

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -1,34 +1,13 @@
 # Copyright (c) Facebook, Inc. and its affiliates.
 # NOTE: If you change this file, fbcode/fboss/github/ThriftCppLibrary.cmake also
 # needs to be changed.  TODO: this should be handled via shipit.
+
+include(FBCMakeParseArgs)
+
 function(add_thrift_cpp2_library LIB_NAME THRIFT_FILE)
   # Parse the arguments
-  set(SERVICES)
-  set(DEPENDS)
-  set(GEN_ARGS)
-  set(mode "UNSET")
-  foreach(arg IN LISTS ARGN)
-    if("${arg}" STREQUAL "SERVICES")
-      set(mode "SERVICES")
-    elseif("${arg}" STREQUAL "DEPENDS")
-      set(mode "DEPENDS")
-    elseif("${arg}" STREQUAL "OPTIONS")
-      set(mode "OPTIONS")
-    else()
-      if("${mode}" STREQUAL "SERVICES")
-        list(APPEND SERVICES "${arg}")
-      elseif("${mode}" STREQUAL "DEPENDS")
-        list(APPEND DEPENDS "${arg}")
-      elseif("${mode}" STREQUAL "OPTIONS")
-        list(APPEND GEN_ARGS "${arg}")
-      else()
-        message(
-          FATAL_ERROR
-          "expected SERVICES, DEPENDS, or OPTIONS argument, found ${arg}"
-        )
-      endif()
-    endif()
-  endforeach()
+  set(multi_value_args SERVICES DEPENDS OPTIONS)
+  fb_cmake_parse_args(ARG "" "" "${multi_value_args}" "${ARGN}")

   get_filename_component(base ${THRIFT_FILE} NAME_WE)
   get_filename_component(
@@ -42,11 +21,11 @@
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)

   if (NOT "${include_prefix}" STREQUAL "")
-    list(APPEND GEN_ARGS "include_prefix=${include_prefix}")
+    list(APPEND ARG_OPTIONS "include_prefix=${include_prefix}")
   endif()
   # CMake 3.12 is finally getting a list(JOIN) function, but until then
   # treating the list as a string and replacing the semicolons is good enough.
-  string(REPLACE ";" "," GEN_ARG_STR "${GEN_ARGS}")
+  string(REPLACE ";" "," GEN_ARG_STR "${ARG_OPTIONS}")

   # Compute the list of generated files
   list(APPEND generated_headers
@@ -61,7 +40,7 @@
     ${output_dir}/gen-cpp2/${base}_data.cpp
     ${output_dir}/gen-cpp2/${base}_types.cpp
   )
-  foreach(service IN LISTS SERVICES)
+  foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers
       ${output_dir}/gen-cpp2/${service}.h
       ${output_dir}/gen-cpp2/${service}.tcc
@@ -77,7 +56,7 @@
   endforeach()

   list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
-  foreach(depends IN LISTS DEPENDS)
+  foreach(depends IN LISTS ARG_DEPENDS)
     get_property(thrift_include_directory
       TARGET ${depends}
       PROPERTY THRIFT_INCLUDE_DIRECTORY)
@@ -114,7 +93,7 @@
     MAIN_DEPENDENCY
       ${THRIFT_FILE}
     DEPENDS
-      ${DEPENDS}
+      ${ARG_DEPENDS}
   )

   # Now emit the library rule to compile the sources
@@ -139,7 +118,7 @@
   target_link_libraries(
     ${LIB_NAME}
     PUBLIC
-      ${DEPENDS}
+      ${ARG_DEPENDS}
       FBThrift::thriftcpp2
       Folly::folly
   )


fbcode_builder: use build interface generator expression for thrift include directories

Summary:
Fix an error about source directories being included in the include
path in add_thrift_cpp2_library. I don't know why this was failing for
fb303 and not for other projects, but adding a generation expression
appears to fix the issue.

Reviewed By: strager

Differential Revision: D15725024

fbshipit-source-id: 6c02fed6c6703733cf9e0b130c0f90b70e3ea300

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -105,8 +105,8 @@
   target_include_directories(
     ${LIB_NAME}
     PUBLIC
-      ${CMAKE_SOURCE_DIR}
-      ${CMAKE_BINARY_DIR}
+      $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
+      $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
       ${FOLLY_INCLUDE_DIR}
       ${FBTHRIFT_INCLUDE_DIR}
   )


fbcode_builder: minor style cleanup in ThriftCppLibrary.cmake

Summary:
Add explicit double quotes around arguments that are intended to be exactly a
single parameter.  Also line wrap to 80 characters.

Reviewed By: wez

Differential Revision: D16738443

fbshipit-source-id: b8c9b6d50da72b44e23eaf5effbc384b6cbbc1c0

--- build/fbcode_builder/CMake/ThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/ThriftCppLibrary.cmake
@@ -17,7 +17,11 @@
   )

   # Generate relative paths in #includes
-  file(RELATIVE_PATH include_prefix ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE})
+  file(
+    RELATIVE_PATH include_prefix
+    "${CMAKE_SOURCE_DIR}"
+    "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
+  )
   get_filename_component(include_prefix ${include_prefix} DIRECTORY)

   if (NOT "${include_prefix}" STREQUAL "")
@@ -29,33 +33,33 @@

   # Compute the list of generated files
   list(APPEND generated_headers
-    ${output_dir}/gen-cpp2/${base}_constants.h
-    ${output_dir}/gen-cpp2/${base}_constants.cpp
-    ${output_dir}/gen-cpp2/${base}_types.h
-    ${output_dir}/gen-cpp2/${base}_types.tcc
-    ${output_dir}/gen-cpp2/${base}_types_custom_protocol.h
+    "${output_dir}/gen-cpp2/${base}_constants.h"
+    "${output_dir}/gen-cpp2/${base}_constants.cpp"
+    "${output_dir}/gen-cpp2/${base}_types.h"
+    "${output_dir}/gen-cpp2/${base}_types.tcc"
+    "${output_dir}/gen-cpp2/${base}_types_custom_protocol.h"
   )
   list(APPEND generated_sources
-    ${output_dir}/gen-cpp2/${base}_data.h
-    ${output_dir}/gen-cpp2/${base}_data.cpp
-    ${output_dir}/gen-cpp2/${base}_types.cpp
+    "${output_dir}/gen-cpp2/${base}_data.h"
+    "${output_dir}/gen-cpp2/${base}_data.cpp"
+    "${output_dir}/gen-cpp2/${base}_types.cpp"
   )
   foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers
-      ${output_dir}/gen-cpp2/${service}.h
-      ${output_dir}/gen-cpp2/${service}.tcc
-      ${output_dir}/gen-cpp2/${service}AsyncClient.h
-      ${output_dir}/gen-cpp2/${service}_custom_protocol.h
+      "${output_dir}/gen-cpp2/${service}.h"
+      "${output_dir}/gen-cpp2/${service}.tcc"
+      "${output_dir}/gen-cpp2/${service}AsyncClient.h"
+      "${output_dir}/gen-cpp2/${service}_custom_protocol.h"
     )
     list(APPEND generated_sources
-      ${output_dir}/gen-cpp2/${service}.cpp
-      ${output_dir}/gen-cpp2/${service}AsyncClient.cpp
-      ${output_dir}/gen-cpp2/${service}_processmap_binary.cpp
-      ${output_dir}/gen-cpp2/${service}_processmap_compact.cpp
+      "${output_dir}/gen-cpp2/${service}.cpp"
+      "${output_dir}/gen-cpp2/${service}AsyncClient.cpp"
+      "${output_dir}/gen-cpp2/${service}_processmap_binary.cpp"
+      "${output_dir}/gen-cpp2/${service}_processmap_compact.cpp"
     )
   endforeach()

-  list(APPEND thrift_include_options -I ${CMAKE_SOURCE_DIR})
+  list(APPEND thrift_include_options -I "${CMAKE_SOURCE_DIR}")
   foreach(depends IN LISTS ARG_DEPENDS)
     get_property(thrift_include_directory
       TARGET ${depends}
@@ -64,14 +68,17 @@
     if (thrift_include_directory STREQUAL "")
       message(STATUS "No thrift dependency found for ${depends}")
     else()
-      list(APPEND thrift_include_options -I
-        ${thrift_include_directory})
+      list(
+        APPEND thrift_include_options
+        -I "${thrift_include_directory}"
+      )
     endif()
   endforeach()

   file(
     GLOB_RECURSE THRIFT_TEMPLATE_FILES
-    FOLLOW_SYMLINKS ${FBTHRIFT_TEMPLATES_DIR}/*.mustache)
+    FOLLOW_SYMLINKS "${FBTHRIFT_TEMPLATES_DIR}/*.mustache"
+  )

   # Emit the rule to run the thrift compiler
   add_custom_command(
@@ -79,25 +86,26 @@
       ${generated_headers}
       ${generated_sources}
     COMMAND
-      ${CMAKE_COMMAND} -E make_directory ${output_dir}
+      "${CMAKE_COMMAND}" -E make_directory "${output_dir}"
     COMMAND
-      ${FBTHRIFT_COMPILER}
+      "${FBTHRIFT_COMPILER}"
       --strict
-      --templates ${FBTHRIFT_TEMPLATES_DIR}
+      --templates "${FBTHRIFT_TEMPLATES_DIR}"
       --gen "mstch_cpp2:${GEN_ARG_STR}"
       ${thrift_include_options}
-      -o ${output_dir}
-      ${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}
+      -o "${output_dir}"
+      "${CMAKE_CURRENT_SOURCE_DIR}/${THRIFT_FILE}"
     WORKING_DIRECTORY
-      ${CMAKE_BINARY_DIR}
+      "${CMAKE_BINARY_DIR}"
     MAIN_DEPENDENCY
-      ${THRIFT_FILE}
+      "${THRIFT_FILE}"
     DEPENDS
       ${ARG_DEPENDS}
   )

   # Now emit the library rule to compile the sources
-  add_library(${LIB_NAME} STATIC
+  add_library(
+    "${LIB_NAME}" STATIC
     ${generated_sources}
   )

@@ -107,7 +115,7 @@
   )

   target_include_directories(
-    ${LIB_NAME}
+    "${LIB_NAME}"
     PRIVATE
       ${CMAKE_SOURCE_DIR}
       ${CMAKE_BINARY_DIR}
@@ -116,7 +124,7 @@
       ${FBTHRIFT_INCLUDE_DIR}
   )
   target_link_libraries(
-    ${LIB_NAME}
+    "${LIB_NAME}"
     PUBLIC
       ${ARG_DEPENDS}
       FBThrift::thriftcpp2
@@ -124,13 +132,13 @@
   )

   set_target_properties(
-    ${LIB_NAME}
+    "${LIB_NAME}"
     PROPERTIES
       EXPORT_PROPERTIES "THRIFT_INCLUDE_DIRECTORY"
-      THRIFT_INCLUDE_DIRECTORY ${CMAKE_SOURCE_DIR}
+      THRIFT_INCLUDE_DIRECTORY "${CMAKE_SOURCE_DIR}"
   )

   get_property(thrift_include_directory
-    TARGET ${LIB_NAME}
+    TARGET "${LIB_NAME}"
     PROPERTY THRIFT_INCLUDE_DIRECTORY)
 endfunction()


Change Cache Telnet success message

Change Cache Telnet success message

Change the CMake status message that prints out the success of the Telnet
connection to not just print out the return code, but print out  "Telnet
Connection Established" if the script returns sucessfully.

OSEHRA-Id: http://issues.osehra.org/browse/OAT-146
Change-Id: If41479861ceb1a7af954a9ba096a7e7f98c6f5aa

--- CMake/UseCache.cmake
+++ CMake/UseCache.cmake
@@ -77,10 +77,11 @@

 if(WIN32)
   configure_file(${VISTA_SOURCE_DIR}/Testing/CacheVerifyTelnet.scp.in ${VISTA_BINARY_DIR}/CacheVerifyTelnet.scp)
-  message(STATUS "Testing if Cache Telnet service is enable:")
+  message(STATUS "Is Cache Telnet service enabled:")
   execute_process(COMMAND "@CTERM_EXECUTABLE@" "/console=cn_iptcp:127.0.0.1[23]" "${VISTA_BINARY_DIR}/CacheVerifyTelnet.scp" "${VISTA_BINARY_DIR}/CacheVerifyTelnet.log" TIMEOUT 5 RESULT_VARIABLE rcode)
-  message(STATUS "Testing if Cache Telnet service is enable: ${rcode}")
-  if ( (rcode EQUAL 0) OR "${rcode}" MATCHES "timeout" )
+  if(rcode EQUAL 1)
+    message(STATUS "Is Cache Telnet service enabled: Connection established")
+  else ( (rcode EQUAL 0) OR "${rcode}" MATCHES "timeout" )
     message(FATAL_ERROR "Error connecting to Cache ${VISTA_CACHE_INSTANCE} namespace ${VISTA_CACHE_NAMESPACE} via telnet, please enable the telnet setting via"
       " Cache Managements Portal->System->Security Management->Service to switch on %Service_telnet by checking enabled checkbox and save."
       " Also verify that telnet port is set to 23 via Configuration->Device Settings->Telnet Settings ")


small cmake fix: dont add main.cpp in olxcommon; it is added explicitely in CmakeLists.txt

--- CMakeOlxCommon.cmake
+++ CMakeOlxCommon.cmake
@@ -129,7 +129,7 @@
 ENDIF(NOT WIN32 AND NOT MINGW_CROSS_COMPILE)

-file(GLOB_RECURSE ALL_SRCS ${OLXROOTDIR}/src/*.c*)
+file(GLOB_RECURSE ALL_SRCS ${OLXROOTDIR}/src/*/*.c*)

 IF(APPLE)
 	file(GLOB_RECURSE MAC_SRCS ${OLXROOTDIR}/src/*.m*)


deactivate some thirdparty for OpenCV

deactivate some thirdparty for OpenCV

--- CMake/External_OpenCV.cmake
+++ CMake/External_OpenCV.cmake
@@ -27,7 +27,11 @@
       -DBUILD_DOCS:BOOL=OFF
       -DBUILD_EXAMPLES:BOOL=OFF
       -DBUILD_JASPER:BOOL=OFF
+      -DWITH_JASPER:BOOL=OFF
       -DBUILD_JPEG:BOOL=OFF
+      -DWITH_JPEG:BOOL=OFF
+      -DWITH_FFMPEG:BOOL=OFF
+      -DWITH_VFW:BOOL=OFF
       -DBUILD_OPENEXR:BOOL=OFF
       -DBUILD_PACKAGE:BOOL=ON
       -DBUILD_PERF_TESTS:BOOL=OFF


Build: Require exact version if PYTHON_VERSION is specified (#2764)

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/pythonutils.cmake
+++ src/cmake/pythonutils.cmake
@@ -20,10 +20,12 @@

     # Attempt to find the desired version, but fall back to other
     # additional versions.
+    unset (_req)
     if (USE_PYTHON)
         set (_req REQUIRED)
-    else ()
-        unset (_req)
+        if (PYTHON_VERSION)
+            list (APPEND _req EXACT)
+        endif ()
     endif ()
     checked_find_package (Python ${PYTHON_VERSION}
                           ${_req}


Added another license filename variant.

Added another license filename variant.

--- scripts/try-copy-license.cmake
+++ scripts/try-copy-license.cmake
@@ -42,7 +42,7 @@
 endif()

 # Try standard names
-foreach(x "LICENSE" "LICENSE.txt" "COPYING" "COPYING.txt" "license" "license.txt" "copying" "copying.txt")
+foreach(x "LICENSE" "LICENSE.txt" "License.txt" "COPYING" "COPYING.txt" "license" "license.txt" "copying" "copying.txt")
   if(EXISTS "${srcdir}/${x}")
     file(COPY "${srcdir}/${x}" DESTINATION "${dstdir}")
     return()


[cmake] add an interactive target for docker (make docker-interactive : open a shell inside the container)

--- cmake/Docker.cmake
+++ cmake/Docker.cmake
@@ -162,6 +162,11 @@
     COMMENT "Docker ctest : ${DOCKER_IMAGE}"
     COMMAND ${DOCKER_COMMAND} run -h ${DOCKER_HOSTNAME} --rm=true ${DOCKER_VFLAGS} --volumes-from=${DOCKER_WORKDIR_VOLUME} --volumes-from=${DOCKER_REPOSITORY}-${DOCKER_IMAGE}-usr-local --workdir=${DOCKER_WORKDIR} -t ${DOCKER_REPOSITORY}/${DOCKER_IMAGE} ctest -DCTEST_SOURCE_DIRECTORY=${CMAKE_SOURCE_DIR} -DCTEST_BINARY_DIRECTORY=${DOCKER_WORKDIR} -S ${DOCKER_CTEST_DRIVER} -DSITE=${DOCKER_HOSTNAME} ${DOCKER_CMAKE_FLAGS_WITHOUT_DOCKER})

+  add_custom_target(
+    ${DOCKER_IMAGE_AS_DIR}-interactive
+    COMMENT "Docker interactive : ${DOCKER_IMAGE}"
+    COMMAND ${DOCKER_COMMAND} run -h ${DOCKER_HOSTNAME} --rm=true ${DOCKER_VFLAGS} --volumes-from=${DOCKER_WORKDIR_VOLUME} --volumes-from=${DOCKER_REPOSITORY}-${DOCKER_IMAGE}-usr-local --workdir=${DOCKER_WORKDIR} -i -t ${DOCKER_REPOSITORY}/${DOCKER_IMAGE} /bin/bash)
+
   if(NOT TARGET docker-clean)
     add_custom_target(
       docker-clean
@@ -215,6 +220,13 @@
     add_custom_target(
       docker-ctest
       COMMENT "Docker ctest"
+      )
+  endif()
+
+  if(NOT TARGET docker-interactive)
+    add_custom_target(
+      docker-interactive
+      COMMENT "Docker interactive"
       )
   endif()

@@ -226,5 +238,6 @@
   add_dependencies(docker-make-install ${DOCKER_IMAGE_AS_DIR}-make-install)
   add_dependencies(docker-make-clean ${DOCKER_IMAGE_AS_DIR}-make-clean)
   add_dependencies(docker-ctest ${DOCKER_IMAGE_AS_DIR}-ctest)
+  add_dependencies(docker-interactive ${DOCKER_IMAGE_AS_DIR}-interactive)

 endmacro()


Mark additional variables as advanced.

Mark additional variables as advanced.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -38,6 +38,8 @@

 function(HIDE_DISTRACTING_VARIABLES)
   mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
+  mark_as_advanced(CMAKE_CODEBLOCKS_EXECUTABLE)
+  mark_as_advanced(QT_QMAKE_EXECUTABLE)
   if(APPLE)
     mark_as_advanced(CMAKE_OSX_ARCHITECTURES)
     mark_as_advanced(CMAKE_OSX_DEPLOYMENT_TARGET)


Working towards the deployment of the CellML binaries on Mac OS X.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -271,7 +271,7 @@
         )
     ENDFOREACH()

-    # External dependencies
+    # Make sure that we link to our external dependencies

     FOREACH(EXTERNAL_DEPENDENCY ${EXTERNAL_DEPENDENCIES})
         TARGET_LINK_LIBRARIES(${PROJECT_NAME}
@@ -349,6 +349,16 @@
             ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
                                COMMAND install_name_tool -change ${QT_LIBRARY_DIR}/${QT_DEPENDENCY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_DEPENDENCY}
                                                                  @executable_path/../Frameworks/${QT_DEPENDENCY}.framework/Versions/${QT_VERSION_MAJOR}/${QT_DEPENDENCY}
+                                                                 ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${PLUGIN_FILENAME})
+        ENDFOREACH()
+
+        # Make sure that the plugin refers to our embedded version the external
+        # dependencies on which it depends
+
+        FOREACH(EXTERNAL_DEPENDENCY ${EXTERNAL_DEPENDENCIES})
+            ADD_CUSTOM_COMMAND(TARGET ${PROJECT_NAME} POST_BUILD
+                               COMMAND install_name_tool -change ${EXTERNAL_DEPENDENCY}
+                                                                 @executable_path/../Frameworks/${EXTERNAL_DEPENDENCY}
                                                                  ${MAC_OS_X_PROJECT_BINARY_DIR}/Contents/PlugIns/${MAIN_PROJECT_NAME}/${PLUGIN_FILENAME})
         ENDFOREACH()
     ENDIF()


fix CMake issue when constructing KNC libraries to link

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -234,7 +234,7 @@
       IF (${lib_length} GREATER 5)
         STRING(SUBSTRING ${lib} 0 6 lib_begin)
       ENDIF ()
-      IF (${lib_length} GREATER 5 AND ${lib_begin} STREQUAL "ospray")
+      IF (${lib_length} GREATER 5 AND ":${lib_begin}" STREQUAL ":ospray")
         LIST(APPEND LINK_LIBS ${lib}${OSPRAY_LIB_SUFFIX})
       ELSE ()
         LIST(APPEND LINK_LIBS ${lib})


cmake(python): Fixup Fetch_python_deps

cmake(python): Fixup Fetch_python_deps

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -46,7 +46,7 @@
         OUTPUT_STRIP_TRAILING_WHITESPACE
         )
     else()
-      message(FATAL "Can't find python module \"${MODULE_NAME}\", please install it using your system package manager.")
+      message(FATAL_ERROR "Can't find python module \"${MODULE_NAME}\", please install it using your system package manager.")
     endif()
   endif()
 endfunction()


[cmake] Support host architectures other than x64

Allow building for other architectures when cross-compiling for Windows.

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

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

--- cmake/platforms/WinMsvc.cmake
+++ cmake/platforms/WinMsvc.cmake
@@ -4,10 +4,14 @@
 # Usage:
 # cmake -G Ninja
 #    -DCMAKE_TOOLCHAIN_FILE=/path/to/this/file
+#    -DHOST_ARCH=[aarch64|arm64|armv7|arm|i686|x86|x86_64|x64]
 #    -DLLVM_NATIVE_TOOLCHAIN=/path/to/llvm/installation
 #    -DMSVC_BASE=/path/to/MSVC/system/libraries/and/includes
 #    -DWINSDK_BASE=/path/to/windows-sdk
 #    -DWINSDK_VER=windows sdk version folder name
+#
+# HOST_ARCH:
+#    The architecture to build for.
 #
 # LLVM_NATIVE_TOOLCHAIN:
 #   *Absolute path* to a folder containing the toolchain which will be used to
@@ -106,15 +110,34 @@
   endif()
 endfunction()

-# FIXME: We should support target architectures other than x64
 set(CMAKE_SYSTEM_NAME Windows)
 set(CMAKE_SYSTEM_VERSION 10.0)
 set(CMAKE_SYSTEM_PROCESSOR AMD64)

+init_user_prop(HOST_ARCH)
 init_user_prop(LLVM_NATIVE_TOOLCHAIN)
 init_user_prop(MSVC_BASE)
 init_user_prop(WINSDK_BASE)
 init_user_prop(WINSDK_VER)
+
+if(NOT HOST_ARCH)
+  set(HOST_ARCH x86_64)
+endif()
+if(HOST_ARCH STREQUAL "aarch64" OR HOST_ARCH STREQUAL "arm64")
+  set(TRIPLE_ARCH "aarch64")
+  set(WINSDK_ARCH "arm64")
+elseif(HOST_ARCH STREQUAL "armv7" OR HOST_ARCH STREQUAL "arm")
+  set(TRIPLE_ARCH "armv7")
+  set(WINSDK_ARCH "arm")
+elseif(HOST_ARCH STREQUAL "i686" OR HOST_ARCH STREQUAL "x86")
+  set(TRIPLE_ARCH "i686")
+  set(WINSDK_ARCH "x86")
+elseif(HOST_ARCH STREQUAL "x86_64" OR HOST_ARCH STREQUAL "x64")
+  set(TRIPLE_ARCH "x86_64")
+  set(WINSDK_ARCH "x64")
+else()
+  message(SEND_ERROR "Unknown host architecture ${HOST_ARCH}. Must be aarch64 (or arm64), armv7 (or arm), i686 (or x86), or x86_64 (or x64).")
+endif()

 set(MSVC_INCLUDE "${MSVC_BASE}/include")
 set(MSVC_LIB "${MSVC_BASE}/lib")
@@ -164,6 +187,7 @@

 set(COMPILE_FLAGS
     -D_CRT_SECURE_NO_WARNINGS
+    --target=${TRIPLE_ARCH}-windows-msvc
     -fms-compatibility-version=19.11
     -imsvc "${MSVC_INCLUDE}"
     -imsvc "${WINSDK_INCLUDE}/ucrt"
@@ -189,10 +213,9 @@
     # Prevent CMake from attempting to invoke mt.exe. It only recognizes the slashed form and not the dashed form.
     /manifest:no

-    # FIXME: We should support target architectures other than x64.
-    -libpath:"${MSVC_LIB}/x64"
-    -libpath:"${WINSDK_LIB}/ucrt/x64"
-    -libpath:"${WINSDK_LIB}/um/x64")
+    -libpath:"${MSVC_LIB}/${WINSDK_ARCH}"
+    -libpath:"${WINSDK_LIB}/ucrt/${WINSDK_ARCH}"
+    -libpath:"${WINSDK_LIB}/um/${WINSDK_ARCH}")

 string(REPLACE ";" " " LINK_FLAGS "${LINK_FLAGS}")


Ensure non-MinGW Clang builds link with libc++.

--- cmake/toolchain_options.cmake
+++ cmake/toolchain_options.cmake
@@ -39,6 +39,7 @@
   else()
     add_compile_options(-Wno-error=unused-command-line-argument)
     set(CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
+    set(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++ ${CMAKE_EXE_LINKER_FLAGS}")
   endif()
 endif()


 - приведение ADD_CUSTOM_COMMAND к единому виду

git-svn-id: 41bd7e47c31e4d43f97241d7529f6785d233c6d8@12545 23f926e6-80f1-49ca-85a0-60d4a27bb3ac

--- rdo/packages/cmake/trunk/split-bison.cmake
+++ rdo/packages/cmake/trunk/split-bison.cmake
@@ -42,8 +42,8 @@
 			OUTPUT ${OUTPUT_FILE}
 			COMMAND set CYGWIN=nodosfilewarning
 			COMMAND set BISON_PKGDATADIR=${BISON_FLEX_DIRECTORY}/share/bison
-			COMMAND ${PROJECT_SOURCE_DIR}/scripts/python/split-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2}
-			COMMAND ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v\ ${BISON_DEFINE}
+			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/split-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2}
+			COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/python/run-bison.py ARGS ${${INPUT_FILE}_INPUT} -y1 ${BISON_${FILE_TYPE}_INPUT_1} -y2 ${BISON_${FILE_TYPE}_INPUT_2} -o1 ${CPP_OUTPUT_FILE_1} -o2 ${CPP_OUTPUT_FILE_2} -n1 ${Y_1} -n2 ${Y_2} -bison ${BISON_EXECUTABLE}\ -g\ -v\ ${BISON_DEFINE}
 			DEPENDS ${${INPUT_FILE}_INPUT}
 			COMMENT "[BISON][rdo${INPUT_FILE}] Building parser with bison ${BISON_VERSION}"
 			WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}


dts: scan application dir for files included by dts

In addition to zephyr/include and zephyr/dts also scan
the dts directory within the application source directory
for files included by the DTS.

Allows to have application specific DTS includes. This
is especially useful for out of tree drivers.

Signed-off-by: Bobby Noelte <4304a16864518bd9924f01aa0b619ec7e5e8aaf3@gmail.com>

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -13,6 +13,7 @@
 set_ifndef(DTS_SOURCE ${BOARD_DIR}/${BOARD}.dts)
 set_ifndef(DTS_COMMON_OVERLAYS ${ZEPHYR_BASE}/dts/common/common.dts)
 set_ifndef(DTS_APP_BINDINGS ${APPLICATION_SOURCE_DIR}/dts/bindings)
+set_ifndef(DTS_APP_INCLUDE ${APPLICATION_SOURCE_DIR}/dts)

 set(dts_files
   ${DTS_SOURCE}
@@ -87,6 +88,7 @@
     COMMAND ${CMAKE_C_COMPILER}
     -x assembler-with-cpp
     -nostdinc
+    -isystem ${DTS_APP_INCLUDE}
     -isystem ${ZEPHYR_BASE}/include
     -isystem ${ZEPHYR_BASE}/dts/${ARCH}
     -isystem ${ZEPHYR_BASE}/dts


I'm pretty sure 'CXX_FLAGS' is a typo for 'CMAKE_CXX_FLAGS', and this is the reason why -fno-implicit-templates is removed from the entire build when sourcing this file, rather than just limited to yassl sources.

--- cmake/ssl.cmake
+++ cmake/ssl.cmake
@@ -29,14 +29,14 @@
   CHANGE_SSL_SETTINGS("bundled")
   #Remove -fno-implicit-templates
   #(yassl sources cannot  be compiled with  it)
-  SET(SAVE_CXX_FLAGS ${CXX_FLAGS})
+  SET(SAVE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
   IF(CMAKE_CXX_FLAGS)
   STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
     ${CMAKE_CXX_FLAGS})
   ENDIF()
   ADD_SUBDIRECTORY(extra/yassl)
   ADD_SUBDIRECTORY(extra/yassl/taocrypt)
-  SET(CXX_FLAGS ${SAVE_CXX_FLAGS})
+  SET(CMAKE_CXX_FLAGS ${SAVE_CXX_FLAGS})
   GET_TARGET_PROPERTY(src yassl SOURCES)
   FOREACH(file ${src})
     SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})


Community Edition 3.8.0 Release Candidate 2

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,5 +6,5 @@
 set ( HPCC_MINOR 8 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_SEQUENCE 2 )
 ###


Split off 8.2.66

Split off 8.2.66

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 65 )
+set ( HPCC_POINT 67 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


All: Set default git info to unknown

All: Set default git info to unknown

--- version.cmake
+++ version.cmake
@@ -32,6 +32,16 @@
 	endif()
 endif()

+if(NOT GIT_COMMIT)
+	set(GIT_COMMIT "(unknown)")
+endif()
+if(NOT GIT_COMMIT_SHORT)
+	set(GIT_COMMIT_SHORT "(unknown)")
+endif()
+if(NOT GIT_BRANCH)
+	set(GIT_BRANCH "(unknown)")
+endif()
+
 if(CONFIG_FILE AND OUT_FILE)
 	configure_file("${CONFIG_FILE}" "${OUT_FILE}")
 endif()


Split off 8.0.78

Split off 8.0.78

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 0 )
-set ( HPCC_POINT 77 )
+set ( HPCC_POINT 79 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


added: config workaround for clang 3.4+ and boost < 1.56 (upd)

--- share/hugh/cmake/CMakeAddons_SetupVariables.cmake
+++ share/hugh/cmake/CMakeAddons_SetupVariables.cmake
@@ -55,9 +55,9 @@

 # [https://stackoverflow.com/questions/22476267]
 # [https://svn.boost.org/trac/boost/ticket/9610]
-#cma_print_variable(Boost_VERSION)
-#cma_print_variable(CMAKE_CXX_COMPILER_ID)
-#cma_print_variable(CMAKE_CXX_COMPILER_VERSION)
+cma_print_variable(Boost_VERSION)
+cma_print_variable(CMAKE_CXX_COMPILER_ID)
+cma_print_variable(CMAKE_CXX_COMPILER_VERSION)
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.3)
   find_package(Boost ${BOOST_MINIMUM_VERSION} QUIET)


COMP: Used ImageViewer that fixes cmake warnings

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -34,7 +34,7 @@

 # TubeTK Image Viewer snapshot 2015-01-09
 set( ImageViewer_URL ${github_protocol}://github.com/KitwareMedical/ImageViewer.git )
-set( ImageViewer_HASH_OR_TAG ff54833ac9b7e2a0a1726d692df6466a7a1b88c3 )
+set( ImageViewer_HASH_OR_TAG c61ca8dac393ff58019fdeef561c5aac95406dee )

 # Insight Segmentation and Registration Toolkit
 set( ITK_URL ${github_protocol}://github.com/Slicer/ITK.git )


Remove OTB_DATA_ROOT variable, it is handled by CMakeList

--- CI/configure_option.cmake
+++ CI/configure_option.cmake
@@ -59,8 +59,7 @@
 OTB_WRAP_PYTHON3:BOOL=ON")

 set (otb_data_option
-"OTB_DATA_ROOT:PATH=${OTB_DATA_ROOT}
-OTB_DATA_USE_LARGEINPUT:BOOL=OFF
+"OTB_DATA_USE_LARGEINPUT:BOOL=OFF
 OTB_DATA_LARGEINPUT_ROOT:PATH=${OTB_LARGEINPUT_ROOT}")

 set (cmake_configure_option


Split off 8.2.52

Split off 8.2.52

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 51 )
+set ( HPCC_POINT 53 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Graph Control 3.10.0 Release Candidate 2

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -6,5 +6,5 @@
 set ( HPCC_MINOR 10 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "candidate" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_SEQUENCE 2 )
 ###


Reverted last commit

Reverted last commit

--- cmake/CMakeModules/FindOpenCV.cmake
+++ cmake/CMakeModules/FindOpenCV.cmake
@@ -41,7 +41,7 @@
 FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
 FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
 FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
-#FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
+FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
 FIND_OPENCV_LIBRARY(OPENCV_IMGPROC_LIBRARY opencv_imgproc)
 FIND_OPENCV_LIBRARY(OPENCV_ML_LIBRARY opencv_ml)
 FIND_OPENCV_LIBRARY(OPENCV_OBJDETECT_LIBRARY opencv_objdetect)
@@ -60,7 +60,7 @@
                      ${OPENCV_FEATURES2D_LIBRARY}
                      ${OPENCV_XFEATURES2D_LIBRARY}
                      ${OPENCV_FLANN_LIBRARY}
-#                     ${OPENCV_HIGHGUI_LIBRARY}
+                     ${OPENCV_HIGHGUI_LIBRARY}
                      ${OPENCV_IMGPROC_LIBRARY}
                      ${OPENCV_ML_LIBRARY}
                      ${OPENCV_PHOTO_LIBRARY}
@@ -72,7 +72,7 @@
      OPENCV_FEATURES2D_LIBRARY AND
      OPENCV_XFEATURES2D_LIBRARY AND
      OPENCV_FLANN_LIBRARY AND
-#     OPENCV_HIGHGUI_LIBRARY AND
+     OPENCV_HIGHGUI_LIBRARY AND
      OPENCV_IMGPROC_LIBRARY AND
      OPENCV_ML_LIBRARY AND
      OPENCV_OBJDETECT_LIBRARY AND


Fix MinGW detection on x86

Fix MinGW detection on x86

MinGW-w64 always uses "w64" as vendor key which the previously
used check for "64" anywhere in the target triplet matched. This
would lead to MinGW-w64 setups always being treated as x64.

Since we are actually interested in finding the "64" in the
triplet's operating system key, this fix makes sure to look for
"mingw64" and thus avoids the false match.

Fixes issue #3835. Credits to Lode Leroy for the original patch.

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -147,7 +147,7 @@
   execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
                   OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
                   OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
+  if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "mingw64")
     set(MINGW64 1)
     set(OpenCV_ARCH x64)
   else()


cmake: Add new Intel CPU model numbers

cmake: Add new Intel CPU model numbers

A new Intel ORM was released, containing four new CPU model numbers.
This also introduces Skylake. At this point there's no support for
AVX-512 in Vc anyway, but this seems to be a little harder to determine
just from the model number alone.

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -91,7 +91,8 @@
          # taken from the Intel ORM
          # http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html
          # CPUID Signature Values of Of Recent Intel Microarchitectures
-         # 3D          | Broadwell microarchitecture
+         # 4E 5E       | Skylake microarchitecture
+         # 3D 47 56    | Broadwell microarchitecture
          # 3C 45 46 3F | Haswell microarchitecture
          # 3A 3E       | Ivy Bridge microarchitecture
          # 2A 2D       | Sandy Bridge microarchitecture
@@ -99,7 +100,9 @@
          # 1A 1E 1F 2E | Intel microarchitecture Nehalem
          # 17 1D       | Enhanced Intel Core microarchitecture
          # 0F          | Intel Core microarchitecture
-         if(_cpu_model EQUAL 0x3D)
+         if(_cpu_model EQUAL 0x4E OR _cpu_model EQUAL 0x5E)
+            set(TARGET_ARCHITECTURE "skylake")
+         elseif(_cpu_model EQUAL 0x3D OR _cpu_model EQUAL 0x47 OR _cpu_model EQUAL 0x56)
             set(TARGET_ARCHITECTURE "broadwell")
          elseif(_cpu_model EQUAL 0x3C OR _cpu_model EQUAL 0x45 OR _cpu_model EQUAL 0x46 OR _cpu_model EQUAL 0x3F)
             set(TARGET_ARCHITECTURE "haswell")
@@ -158,7 +161,7 @@
 endmacro()

 macro(OptimizeForArchitecture)
-   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"broadwell\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
+   set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"haswell\", \"broadwell\", \"skylake\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \"AMD 14h\", \"AMD 16h\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -204,6 +207,20 @@
       list(APPEND _march_flag_list "corei7")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2")
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
+      list(APPEND _march_flag_list "skylake")
+      list(APPEND _march_flag_list "broadwell")
+      list(APPEND _march_flag_list "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      list(APPEND _march_flag_list "ivybridge")
+      list(APPEND _march_flag_list "core-avx-i")
+      list(APPEND _march_flag_list "sandybridge")
+      list(APPEND _march_flag_list "corei7-avx")
+      list(APPEND _march_flag_list "westmere")
+      list(APPEND _march_flag_list "nehalem")
+      list(APPEND _march_flag_list "core2")
+      # FIXME: How can we determine the supported AVX-512 instructions? AFAIK there will be different Skylake CPUs, some not supporting AVX-512 at all
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "avx2" "rdrnd" "f16c" "fma" "bmi" "bmi2")
    elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
       list(APPEND _march_flag_list "broadwell")
       list(APPEND _march_flag_list "haswell")


Fix ROOT-7851 - Problem when option 'gnuinstall' is set on a existing build area

--- cmake/modules/RootInstallDirs.cmake
+++ cmake/modules/RootInstallDirs.cmake
@@ -78,7 +78,7 @@
   if(gnuinstall)
     set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "root for the data (share)")
   else()
-    set(CMAKE_INSTALL_DATAROOTDIR "" CACHE PATH "root for the data ()")
+    set(CMAKE_INSTALL_DATAROOTDIR "." CACHE PATH "root for the data ()")
   endif()
 endif()


CMake 3.7.1+ for Android

CMake 3.7.1+ for Android

--- cmake/modules/hunter_finalize.cmake
+++ cmake/modules/hunter_finalize.cmake
@@ -135,9 +135,9 @@

   hunter_apply_copy_rules()

-  if(ANDROID AND CMAKE_VERSION VERSION_LESS "3.7")
+  if(ANDROID AND CMAKE_VERSION VERSION_LESS "3.7.1")
     hunter_user_error(
-        "CMake version 3.7+ required for Android platforms, see"
+        "CMake version 3.7.1+ required for Android platforms, see"
         " https://docs.hunter.sh/en/latest/quick-start/cmake.html"
     )
   endif()


[cmake] remove DRAWEXE from mechanics_LINK_LIBRARIES

--- cmake/siconos_find_common_dep.cmake
+++ cmake/siconos_find_common_dep.cmake
@@ -94,6 +94,7 @@
     COMPILE_WITH(OCE 0.15 REQUIRED ONLY mechanics)
     SET(HAVE_OCC TRUE)
     LIST(REMOVE_ITEM SICONOS_LINK_LIBRARIES DRAWEXE)
+    LIST(REMOVE_ITEM mechanics_LINK_LIBRARIES DRAWEXE)
   endif()
 ENDIF()


specify output lib dir

specify output lib dir

--- CMake/external_libcurl.cmake
+++ CMake/external_libcurl.cmake
@@ -23,6 +23,7 @@
                     -DCMAKE_C_FLAGS_RELWITHDEBINFO=${CMAKE_C_FLAGS_RELWITHDEBINFO}
                     -DCMAKE_CXX_STANDARD_LIBRARIES=${CMAKE_CXX_STANDARD_LIBRARIES}
                     -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/libcurl/libcurl_install
+                    -DCMAKE_INSTALL_LIBDIR=lib
                     -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
                     -DANDROID_ABI=${ANDROID_ABI}
                     -DANDROID_STL=${ANDROID_STL} ${CURL_FLAGS}


QtWebEngineCore.framework/Helpers containing the required QtWebEngineProcess.app

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -34,7 +34,7 @@
   endif()
 endif()

-# related to bug-19679
+# related to MITK:T19679
 if(MACOSX_BUNDLE_NAMES)
   foreach(bundle_name ${MACOSX_BUNDLE_NAMES})
     get_property(_qmake_location TARGET ${Qt5Core_QMAKE_EXECUTABLE}
@@ -49,6 +49,13 @@
     install(FILES "${_qmake_path}/../plugins/iconengines/libqsvgicon.dylib"
             DESTINATION "${bundle_name}.app/Contents/MacOS/iconengines"
             CONFIGURATIONS Release)
+    # related to MITK:T19679-InstallQtWebEnginProcess
+    if(MITK_USE_QT_WEBENGINE)
+        get_filename_component(ABS_DIR_HELPERS "${_qmake_path}/../lib/QtWebEngineCore.framework/Helpers" REALPATH)
+        install(DIRECTORY ${ABS_DIR_HELPERS}
+                DESTINATION "${bundle_name}.app/Contents/Frameworks/QtWebEngineCore.framework/"
+                CONFIGURATIONS Release)
+    endif()
   endforeach()
 endif()


towards supporting LTO with clang

towards supporting LTO with clang

--- cmake/utils.cmake
+++ cmake/utils.cmake
@@ -6,7 +6,7 @@
 #CHECK_CXX_COMPILER_FLAG(-fsanitize=leak COMPILER_SUPPORTS_SANITIZE_LEAK)
 #CHECK_CXX_COMPILER_FLAG(-fsanitize=thread COMPILER_SUPPORTS_SANITIZE_THREAD)

-set(TEST_PROGRAM "int main() { return 0; }")
+set(TEST_PROGRAM "int main(int, char* []) { return 0; }")

 macro(to_parent)
         set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)
@@ -106,24 +106,35 @@
         CHECK_CXX_SOURCE_COMPILES("${TEST_PROGRAM}" COMPILER_SUPPORTS_NO_FAT_LTO_OBJECTS)

         if(COMPILER_SUPPORTS_LTO)
-                find_program(CMAKE_GCC_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-                find_program(CMAKE_GCC_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
-                find_program(CMAKE_GCC_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
+                get_filename_component(CMAKE_LTO_DIR ${CMAKE_CXX_COMPILER} DIRECTORY)
+                if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
+                        find_program(CMAKE_LTO_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ar ${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${CMAKE_LTO_DIR})
+                        find_program(CMAKE_LTO_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-nm HINTS ${CMAKE_LTO_DIR})
+                        find_program(CMAKE_LTO_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}gcc-ranlib HINTS ${CMAKE_LTO_DIR})
+                elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang)
+                        find_program(CMAKE_LTO_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}llvm-ar ${_CMAKE_TOOLCHAIN_SUFFIX} HINTS ${CMAKE_LTO_DIR})
+                        find_program(CMAKE_LTO_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}llvm-nm HINTS ${CMAKE_LTO_DIR})
+                        find_program(CMAKE_LTO_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}llvm-ranlib HINTS ${CMAKE_LTO_DIR})
+                endif()

-                if(CMAKE_GCC_AR AND CMAKE_GCC_NM AND CMAKE_GCC_RANLIB)
+                message("++ CMAKE_AR: ${CMAKE_LTO_AR}")
+                message("++ CMAKE_NM: ${CMAKE_LTO_NM}")
+                message("++ CMAKE_RANLIB: ${CMAKE_LTO_RANLIB}")
+
+                if(CMAKE_LTO_AR AND CMAKE_LTO_NM AND CMAKE_LTO_RANLIB)
                         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto")
                         if(COMPILER_SUPPORTS_NO_FAT_LTO_OBJECTS)
                                 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-fat-lto-objects")
                         endif()
-                        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
+                        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto=4")

-                        set(CMAKE_AR "${CMAKE_GCC_AR}" PARENT_SCOPE)
-                        set(CMAKE_NM "${CMAKE_GCC_NM}" PARENT_SCOPE)
-                        set(CMAKE_RANLIB "${CMAKE_GCC_RANLIB}" PARENT_SCOPE)
+                        set(CMAKE_AR "${CMAKE_LTO_AR}" PARENT_SCOPE)
+                        set(CMAKE_NM "${CMAKE_LTO_NM}" PARENT_SCOPE)
+                        set(CMAKE_RANLIB "${CMAKE_LTO_RANLIB}" PARENT_SCOPE)

                         to_parent()
                 else()
-                        message(WARNING "++ Compiler indicates LTO support, but binutils wrappers could not be found. Disabling LTO." )
+                        message(WARNING "++ Compiler has LTO support, but binutils wrappers could not be found. Disabling LTO." )
                 endif()
         endif()
 endfunction()


Nagios Monitoring 5.0.0-rc1 Release Candidate 1

Signed-off-by: Richard Chapman <5900d56196fe29dba8e3ae556d57eae28e9f0195@hpccsystems.com>

--- version.cmake
+++ version.cmake
@@ -1,9 +1,9 @@
 ###
 ## Version Information
 ###
-set ( HPCC_NM_MAJOR 4 )
-set ( HPCC_NM_MINOR 3 )
+set ( HPCC_NM_MAJOR 5 )
+set ( HPCC_NM_MINOR 0 )
 set ( HPCC_NM_POINT 0 )
-set ( HPCC_NM_MATURITY "trunk" )
+set ( HPCC_NM_MATURITY "rc" )
 set ( HPCC_NM_SEQUENCE 1 )
 ###


bump to version 0.3.1

bump to version 0.3.1

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(LeapSerial_VERSION 0.3.0)
+set(LeapSerial_VERSION 0.3.1)


bump to v0.1.5

bump to v0.1.5

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(LeapIPC_VERSION 0.1.4)
+set(LeapIPC_VERSION 0.1.5)


updates to test.cmake

updates to test.cmake

--- scripts/test.cmake
+++ scripts/test.cmake
@@ -43,7 +43,6 @@
       WORKING_DIRECTORY ${TEST_MODELS_DIRECTORY}
   )
 ENDMACRO()
-

 # increase default output sizes for test outputs
 IF (NOT DEFINED CTEST_CUSTOM_MAXIMUM_PASSED_TEST_OUTPUT_SIZE)


We're up to Boost 1.42 now.  Just updating the list.

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -125,7 +125,7 @@
 		# Statically linking boost to a dynamic Ogre build doesn't work on Linux 64bit
 		set(Boost_USE_STATIC_LIBS ${OGRE_STATIC})
 	endif ()
-	set(Boost_ADDITIONAL_VERSIONS "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40")
+	set(Boost_ADDITIONAL_VERSIONS "1.37.0" "1.37" "1.38.0" "1.38" "1.39.0" "1.39" "1.40.0" "1.40" "1.41" "1.42")
 	# Components that need linking (NB does not include header-only components like bind)
 	set(OGRE_BOOST_COMPONENTS thread date_time)
 	find_package(Boost COMPONENTS ${OGRE_BOOST_COMPONENTS} QUIET)


WIP: move cmake warning at the end of the import process of libkml

--- CMake/ImportLibKML.cmake
+++ CMake/ImportLibKML.cmake
@@ -5,14 +5,14 @@
   option(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." ON)
 else()
   option(OTB_USE_EXTERNAL_LIBKML "Use external LibKML library." OFF)
-
-  #Known issue in OTB which does not compile with external ITK and internal libkml
-  #Bugs 896: http://bugs.orfeo-toolbox.org/view.php?id=896
-  if (USE_EXTERNAL_ITK)
-    message(WARNING "There is a known issue which does not allow to use internal libKML with external ITK in OTB. You might consider using an external LibKML.")
-  endif()
-
   set(LIBKML_LIBRARIES otbkml)
   message(STATUS "Using LibKML internal version")
 endif()
+
+#Known issue in OTB which does not compile with external ITK and internal libkml
+#Bugs 896: http://bugs.orfeo-toolbox.org/view.php?id=896
+if (USE_EXTERNAL_ITK)
+  message(WARNING "There is a known issue which does not allow to use internal libKML with external ITK in OTB. You might consider using an external LibKML.")
+endif()
+
 mark_as_advanced(OTB_USE_EXTERNAL_LIBKML)


Find qtcore, opengl, and windows libs

Find qtcore, opengl, and windows libs

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -2,6 +2,10 @@
 find_package( Qt5Widgets )
 if( NOT Qt5Widgets_FOUND )
   message( FATAL_ERROR "Could not find Qt5Widgets.  Build cannot continue." )
+endif()
+find_package( Qt5Core )
+if( NOT Qt5Core_FOUND )
+  message( FATAL_ERROR "Could not find Qt5Core.  Build cannot continue." )
 endif()

 # --- Boost ---
@@ -15,3 +19,21 @@
 if( NOT OpenCV_FOUND )
   message( FATAL_ERROR "Could not find OpenCV.  Build cannot continue." )
 endif()
+
+# --- OpenGL ---
+find_package( OpenGL )
+if( NOT OPENGL_FOUND )
+  message( FATAL_ERROR "Could not find OpenGL.  Build cannot continue." )
+endif()
+
+# --- Windows ---
+if( MSVC )
+  set( WINDOWS_LIBRARIES
+    winmm
+    UxTheme
+    ws2_32
+    imm32
+    Dwmapi
+    )
+endif()
+


Don't copy qt4 anymore, if build_apps is diasabled, but the qmake variable still defined

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@1093 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/OpenMeshPackage.cmake
+++ cmake/OpenMeshPackage.cmake
@@ -87,8 +87,8 @@
   # TODO: fillme
   # set (CPACK_NSIS_CONTACT "")

-  # Copy all shared Qt files to build binary dir
-  if ( NOT Q_WS_MAC)
+  # Copy all shared Qt files to build binary dir if we build openmesh with the apps
+  if ( NOT Q_WS_MAC AND BUILD_APPS)
       if (DEFINED QT_QMAKE_EXECUTABLE)
           SET (QTLIBLIST QtCore QtGui)


Updated astyle to look for .hpp files instead of .h files.

--- cmake/Programs/astyle.cmake
+++ cmake/Programs/astyle.cmake
@@ -14,7 +14,7 @@
   "${astyle_EXECUTABLE}"
   --options=${CMAKE_CURRENT_SOURCE_DIR}/resources/astyle
   ${CMAKE_CURRENT_SOURCE_DIR}/src/CGUL/*.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/CGUL/*.h
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/CGUL/*.hpp
   ${CMAKE_CURRENT_SOURCE_DIR}/src/CGUL/*.mm
   ${__LINEENDINGS}
   VERBATIM


Use Qt 5.10.1 instead of 5.11.1 for builds with MSVC

See this Qt bug:
https://bugreports.qt.io/browse/QTBUG-66652

--- cmake/configs/default.cmake
+++ cmake/configs/default.cmake
@@ -112,7 +112,11 @@
 elseif(IOS OR ANDROID)
   hunter_default_version(Qt VERSION 5.9.1-p0)
 else()
-  hunter_default_version(Qt VERSION 5.11.1)
+  if(MSVC)
+    hunter_default_version(Qt VERSION 5.10.1)
+  else()
+    hunter_default_version(Qt VERSION 5.11.1)
+  endif()
 endif()

 hunter_default_version(QtAndroidCMake VERSION 1.0.9)


Add option to generate code coverage even if test runner exits with an error code

--- cmake/kl/CodeCoverage.cmake
+++ cmake/kl/CodeCoverage.cmake
@@ -33,6 +33,20 @@
 #       )
 #   endif()

+macro(ignore_errors_call _out)
+    if(WIN32)
+        find_program(TRUE_EXECUTABLE true)
+        mark_as_advanced(TRUE_EXECUTABLE)
+        if(TRUE_EXECUTABLE)
+            set(${_out} || ${TRUE_EXECUTABLE})
+        else()
+            set(${_out} || cd)
+        endif()
+    else()
+        set(${_out} || true)
+    endif()
+endmacro()
+
 function(add_coverage_target_lcov _target)
     find_program(LCOV_EXECUTABLE lcov)
     mark_as_advanced(LCOV_EXECUTABLE)
@@ -46,7 +60,7 @@
         message(FATAL_ERROR "genhtml not found!")
     endif()

-    set(options BRANCHES)
+    set(options BRANCHES IGNORE_COMMAND_ERRORS)
     set(one_value_args COMMAND OUTPUT_NAME)
     set(multi_value_args FILTERS ARGS)
     cmake_parse_arguments(arg "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
@@ -68,8 +82,12 @@
         set(arg_FILTERS '*')
     endif()

+    if(arg_IGNORE_COMMAND_ERRORS)
+        ignore_errors_call(ignore_errors)
+    endif()
+
     list(APPEND cmd COMMAND ${LCOV_EXECUTABLE} -q --zerocounters --directory .)
-    list(APPEND cmd COMMAND ${arg_COMMAND} ${arg_ARGS})
+    list(APPEND cmd COMMAND ${arg_COMMAND} ${arg_ARGS} ${ignore_errors})
     list(APPEND cmd COMMAND
         ${LCOV_EXECUTABLE}
         -q
@@ -114,7 +132,7 @@
         message(FATAL_ERROR "gcovr not found!")
     endif()

-    set(options XML LLVM)
+    set(options XML LLVM IGNORE_COMMAND_ERRORS)
     set(one_value_args COMMAND OUTPUT_NAME)
     set(multi_value_args FILTERS EXCLUDE ARGS)
     cmake_parse_arguments(arg "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
@@ -155,10 +173,14 @@
     endif()

     if(arg_LLVM)
- 	    set(gcov_executable "--gcov-executable=\"llvm-cov\" gcov")
- 	endif()
-
-    list(APPEND cmd COMMAND ${arg_COMMAND} ${arg_ARGS})
+        set(gcov_executable "--gcov-executable=\"llvm-cov\" gcov")
+    endif()
+
+    if(arg_IGNORE_COMMAND_ERRORS)
+        ignore_errors_call(ignore_errors)
+    endif()
+
+    list(APPEND cmd COMMAND ${arg_COMMAND} ${arg_ARGS} ${ignore_errors})
     list(APPEND cmd COMMAND
         ${GCOVR_EXECUTABLE}
         --delete ${output_mode}
@@ -187,7 +209,7 @@
         message(FATAL_ERROR "OpenCppCoverage not found!")
     endif()

-    set(options COBERTURA)
+    set(options COBERTURA IGNORE_RUNNER_ERRORS)
     set(one_value_args RUNNER OUTPUT_NAME)
     set(multi_value_args FILTERS EXCLUDE)
     cmake_parse_arguments(arg "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
@@ -225,8 +247,21 @@
         set(export_type "--export_type=html:${output_name}")
     endif()

+    if(arg_IGNORE_RUNNER_ERRORS)
+        ignore_errors_call(ignore_errors)
+        if(MSVC_IDE)
+            # MSBuild parses process stdout and stderr and looks for 'error:' which is common when tests fail
+            set(ignore_errors ">NUL;2>NUL;${ignore_errors}")
+        endif()
+    endif()
+
     add_custom_target(${_target}
-        COMMAND ${OPEN_CPP_COVERAGE_EXECUTABLE} ${sources} ${excluded} ${export_type} -- $<TARGET_FILE:${arg_RUNNER}>
+        COMMAND ${OPEN_CPP_COVERAGE_EXECUTABLE}
+            ${sources}
+            ${excluded}
+            ${export_type}
+            -- $<TARGET_FILE:${arg_RUNNER}>
+            ${ignore_errors}
         WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
     )
 endfunction()


[CMake] Use add_llvm_tool_symlink's OUTPUT_DIR option

This is updating to take r288632 into account.

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

--- cmake/modules/AddLLDB.cmake
+++ cmake/modules/AddLLDB.cmake
@@ -116,7 +116,8 @@
             BUILD_WITH_INSTALL_RPATH On
             INSTALL_RPATH "@loader_path/../../../../${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")

-      add_llvm_tool_symlink(${name} $<TARGET_FILE:${name}> ARG_ALWAYS_GENERATE)
+      add_llvm_tool_symlink(${name} ${name} ARG_ALWAYS_GENERATE
+                            OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
     else()
       set_target_properties(${name} PROPERTIES
             BUILD_WITH_INSTALL_RPATH On


Make AGG find_package module completely depend on pkg_config rather
than searching both the pkg-config location and system locations for
the AGG library.  In particular, if the link flags variable returned
by pkg_check_pkgconfig is CMake logically false, then gracefully exit
with AGG_FOUND OFF.

svn path=/trunk/; revision=12058

--- cmake/modules/FindAGG.cmake
+++ cmake/modules/FindAGG.cmake
@@ -17,48 +17,46 @@
   #message(STATUS "_AGGCflags = ${_AGGCflags}")
 endif(PKG_CONFIG_EXECUTABLE)

-FIND_PATH(AGG_INCLUDE_DIR agg2/agg_pixfmt_gray.h
-  ${_AGGIncDir}
-  /usr/local/include
-  /usr/include
-  )
+if(_AGGLinkFlags)
+  find_path(AGG_INCLUDE_DIR agg2/agg_pixfmt_gray.h
+    ${_AGGIncDir}
+    )

-# Prefer _pic variant of library name for shared libraries case, and
-# plain name for static libraries case.
-if(BUILD_SHARED_LIBS)
-  set(AGGLIB_NAMES = "agg_pic;agg")
-  set(AGGFONTLIB_NAMES = "aggfontfreetype_pic;aggfontfreetype")
-else(BUILD_SHARED_LIBS)
-  set(AGGLIB_NAMES = "agg;agg_pic")
-  set(AGGFONTLIB_NAMES = "aggfontfreetype;aggfontfreetype_pic;")
-endif(BUILD_SHARED_LIBS)
-FIND_LIBRARY(AGG_LIBRARY NAMES ${AGGLIB_NAMES}
-  PATHS
-  ${_AGGLinkDir}
-  /usr/local/lib
-  /usr/lib
-  )
-FIND_LIBRARY(AGGFONT_LIBRARY NAMES ${AGGFONTLIB_NAMES}
-  PATHS
-  ${_AGGLinkDir}
-  /usr/local/lib
-  /usr/lib
-  )
+  # Prefer _pic variant of library name for shared libraries case, and
+  # plain name for static libraries case.
+  if(BUILD_SHARED_LIBS)
+    set(AGGLIB_NAMES = "agg_pic;agg")
+    set(AGGFONTLIB_NAMES = "aggfontfreetype_pic;aggfontfreetype")
+  else(BUILD_SHARED_LIBS)
+    set(AGGLIB_NAMES = "agg;agg_pic")
+    set(AGGFONTLIB_NAMES = "aggfontfreetype;aggfontfreetype_pic;")
+  endif(BUILD_SHARED_LIBS)
+  find_library(AGG_LIBRARY NAMES ${AGGLIB_NAMES}
+    PATHS
+    ${_AGGLinkDir}
+    )
+  find_library(AGGFONT_LIBRARY NAMES ${AGGFONTLIB_NAMES}
+    PATHS
+    ${_AGGLinkDir}
+    /usr/local/lib
+    /usr/lib
+    )

-MARK_AS_ADVANCED(AGG_INCLUDE_DIR AGG_LIBRARY AGGFONT_LIBRARY)
+  mark_as_advanced(AGG_INCLUDE_DIR AGG_LIBRARY AGGFONT_LIBRARY)

-# Set uncached variable AGG_LIBRARIES (needed by user and also
-# by FIND_PACKAGE_HANDLE_STANDARD_ARGS)
-if(AGG_LIBRARY AND AGGFONT_LIBRARY)
-  set(AGG_LIBRARIES ${AGG_LIBRARY} ${AGGFONT_LIBRARY})
-elseif(AGG_LIBRARY)
+  # Set uncached variable AGG_LIBRARIES (needed by user and also
+  # by FIND_PACKAGE_HANDLE_STANDARD_ARGS)
+  if(AGG_LIBRARY AND AGGFONT_LIBRARY)
+    set(AGG_LIBRARIES ${AGG_LIBRARY} ${AGGFONT_LIBRARY})
+  elseif(AGG_LIBRARY)
     set(AGG_LIBRARIES ${AGG_LIBRARY})
-endif(AGG_LIBRARY AND AGGFONT_LIBRARY)
+  endif(AGG_LIBRARY AND AGGFONT_LIBRARY)
+endif(_AGGLinkFlags)

 # Standard 2.6.x method of handling QUIETLY and REQUIRED arguments and set
 # AGG_FOUND to TRUE if all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(AGG DEFAULT_MSG AGG_LIBRARIES AGG_INCLUDE_DIR)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(AGG DEFAULT_MSG AGG_LIBRARIES AGG_INCLUDE_DIR)

 if(AGG_FOUND)
   # Set additional uncached variables that users of this module should use.


Revert "update re2c to 1.2" due to build error in some environment like
Mac or openSUSE tumbleweed

This reverts commit f8e43c07682f2e8a13294d89aa1d28186dbd8620.

--- cmake/modules/GetRE2C.cmake
+++ cmake/modules/GetRE2C.cmake
@@ -11,16 +11,16 @@
     download_project(
             PROJ                re2c
             GIT_REPOSITORY      https://github.com/skvadrik/re2c.git
-            GIT_TAG             1.2
+            GIT_TAG             1.1.1
             GIT_PROGRESS        1
     )

     set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

-    if(NOT EXISTS "${re2c_SOURCE_DIR}/configure")
-        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR})
+    if(NOT EXISTS "${re2c_SOURCE_DIR}/re2c/configure")
+        execute_process(COMMAND ./autogen.sh WORKING_DIRECTORY ${re2c_SOURCE_DIR}/re2c)
     endif()

-    execute_process(COMMAND ${re2c_SOURCE_DIR}/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
+    execute_process(COMMAND ${re2c_SOURCE_DIR}/re2c/configure WORKING_DIRECTORY ${re2c_BINARY_DIR})
     execute_process(COMMAND make WORKING_DIRECTORY ${re2c_BINARY_DIR})
 endmacro()


define _GNU_SOURCE when build re2c

define _GNU_SOURCE when build re2c

--- cmake/modules/GetRE2C.cmake
+++ cmake/modules/GetRE2C.cmake
@@ -29,7 +29,7 @@
     set(RE2C_BIN "${re2c_BINARY_DIR}/re2c")

     if(BUILD_RE2C_WITH_CMAKE)
-        execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" ${RE2C_SRC} WORKING_DIRECTORY ${re2c_BINARY_DIR})
+        execute_process(COMMAND ${CMAKE_COMMAND} -DCMAKE_CXX_FLAGS=-D_GNU_SOURCE -G "${CMAKE_GENERATOR}" ${RE2C_SRC} WORKING_DIRECTORY ${re2c_BINARY_DIR})
         execute_process(COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${re2c_BINARY_DIR})
     else()
         if(NOT EXISTS "${RE2C_SRC}/configure")


[ioninja] release 3.4.0

[ioninja] release 3.4.0

[axl] release 5.3.6
[jancy] release 1.5.3

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     1)
 set (VERSION_MINOR     5)
-set (VERSION_REVISION  2)
+set (VERSION_REVISION  3)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")