Reported by jan.klimke

Reported by jan.klimke

"The find script for libcitygml does not define a CITYGML_LIBRARIES varaible which defines linked libraries dependent to the type of build  (debug / release ) so no debugging was possible from external code."

--- CMakeModules/FindCityGML.cmake
+++ CMakeModules/FindCityGML.cmake
@@ -1,6 +1,8 @@
 # Locate libcitygml
 # This module defines
 # CITYGML_LIBRARY
+# CITYGML_LIBRARY_DEBUG
+# CITYGML_LIBRARIES, choses the correct debug or optimized library for linking, add this as Target Link library in your project
 # CITYGML_FOUND, if false, do not try to link to CITYGML
 # CITYGML_INCLUDE_DIR, where to find the headers
 #
@@ -97,7 +99,9 @@
 	IF(NOT CITYGML_LIBRARY_DEBUG)
 		MESSAGE("-- Warning Debug LibCityGML not found, using: ${CITYGML_LIBRARY}")
 		SET(CITYGML_LIBRARY_DEBUG "${CITYGML_LIBRARY}" CACHE FILEPATH "Path to a library." FORCE)
+	ELSE(NOT CITYGML_LIBRARY_DEBUG)
+		#set the conditional linking library if debug is present
+		SET(CITYGML_LIBRARIES optimized ${CITYGML_LIBRARY} debug ${CITYGML_LIBRARY_DEBUG})
 	ENDIF(NOT CITYGML_LIBRARY_DEBUG)
 ENDIF(CITYGML_LIBRARY AND CITYGML_INCLUDE_DIR)

-


cmake: FindGROMACS.cmake GROMACS_DEFINITIONS can be empty

--- CMakeModules/FindGROMACS.cmake
+++ CMakeModules/FindGROMACS.cmake
@@ -60,6 +60,6 @@
 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set GROMACS_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(GROMACS DEFAULT_MSG GROMACS_LIBRARY GROMACS_INCLUDE_DIR GROMACS_VERSION GROMACS_DEFINITIONS)
+find_package_handle_standard_args(GROMACS DEFAULT_MSG GROMACS_LIBRARY GROMACS_INCLUDE_DIR GROMACS_VERSION)

-mark_as_advanced(GROMACS_LIBRARY GROMACS_INCLUDE_DIR GROMACS_VERSION GROMACS_DEFINITIONS)
+mark_as_advanced(GROMACS_LIBRARY GROMACS_INCLUDE_DIR GROMACS_VERSION)


Improved fidl_generator.cmake

Improved fidl_generator.cmake

--- src/commonapi/fidl_generator.cmake
+++ src/commonapi/fidl_generator.cmake
@@ -15,27 +15,14 @@
         add_custom_command(
                 OUTPUT ${FIDL_NAME}
                 DEPENDS ${FIDL}
-                COMMAND touch ${FIDL_NAME}
                 COMMAND ${COMMONAPI_GENERATOR} --dest ${generators_path} -sk ${FIDL}
                 COMMAND ${COMMONAPI_DBUS_GENERATOR} --dest ${generators_path} ${FIDL}
+                COMMAND touch ${FIDL_NAME}
         )
         set(GEN_FIDL_FILES ${GEN_FIDL_FILES} ${FIDL_NAME})
-    endforeach()
-    message(STATUS "GEN_FIDL_FILES is ${GEN_FIDL_FILES}")
-    add_custom_target(${target}_fidl_files_gen
-            DEPENDS ${GEN_FIDL_FILES}
-            COMMAND echo "Generation of CommonAPI files is finished")
-    foreach(FIDL ${fidl_files})
-        message(STATUS "ICC_SOURCE_DIR is ${ICC_SOURCE_DIR}")
-        message(STATUS "Started generate CommonAPIWrappers")
-        message(STATUS "/home/redra/Projects/ICC/src/commonapi/commonapi_tools/commonapi_tools.py")
-        message(STATUS "FIDL is ${FIDL}")
-        get_filename_component(FIDL_NAME_WITH_EXTENTION ${FIDL} NAME)
-        string(REPLACE ".fidl" "" FIDL_NAME ${FIDL_NAME_WITH_EXTENTION})
-        message(STATUS "FIDL_NAME is ${FIDL_NAME}")
         add_custom_command(
                 OUTPUT ${FIDL_NAME}CommonAPIWrappers
-                DEPENDS ${target}_fidl_files_gen
+                DEPENDS ${FIDL_NAME}
                 COMMAND touch ${FIDL_NAME}CommonAPIWrappers
                 COMMAND python3 ${ICC_SOURCE_DIR}/src/commonapi/commonapi_tools/commonapi_tools.py
                 ${FIDL}
@@ -43,13 +30,18 @@
                 --capi_client ${ICC_SOURCE_DIR}/src/commonapi/templates/CommonAPIClient.hpp.jinja2
                 --capi_service ${ICC_SOURCE_DIR}/src/commonapi/templates/CommonAPIService.hpp.jinja2
         )
-        set(GEN_FIDL_COMMONAPI_WRAPPER_FILES ${GEN_FIDL_COMMONAPI_WRAPPER_FILES} ${FIDL_NAME}CommonAPIWrappers)
+        set(GEN_COMMONAPI_WRAPPER_FILES ${GEN_COMMONAPI_WRAPPER_FILES} ${FIDL_NAME}CommonAPIWrappers)
     endforeach()
-    message(STATUS "GEN_FIDL_COMMONAPI_WRAPPER_FILES is ${GEN_FIDL_COMMONAPI_WRAPPER_FILES}")
+    message(STATUS "GEN_FIDL_FILES is ${GEN_FIDL_FILES}")
     add_custom_target(
-            ${target}_fidl_commonapi_wrappers_gen
-            DEPENDS ${GEN_FIDL_COMMONAPI_WRAPPER_FILES}
+            ${target}_fidl_files_gen
+            DEPENDS ${GEN_FIDL_FILES}
+            COMMAND echo "Generation of CommonAPI files is finished")
+    message(STATUS "GEN_COMMONAPI_WRAPPER_FILES is ${GEN_COMMONAPI_WRAPPER_FILES}")
+    add_custom_target(
+            ${target}_commonapi_wrappers_gen
+            DEPENDS ${GEN_COMMONAPI_WRAPPER_FILES}
             COMMAND echo "Generation of CommonAPI wrappers is finished")
-    add_dependencies(${target} ${target}_fidl_files_gen ${target}_fidl_commonapi_wrappers_gen)
+    add_dependencies(${target} ${target}_fidl_files_gen ${target}_commonapi_wrappers_gen)

 endfunction(add_fidl_dependencies)


ENH: Bump TubeTK to v1.3.1 (#3537)

ENH: Bump TubeTK to v1.3.1 (#3537)

TubeTK has been updated to use
  ITK5.3rc4.post2
  and
  MinimalPathExtraction1.2.2

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


Fix #337

Fix #337

Replace hardcoded variables and paths by SetCanonicalDirs

--- SuperBuild/External_NIFTYREG.cmake
+++ SuperBuild/External_NIFTYREG.cmake
@@ -33,11 +33,12 @@
 # Set external name (same as internal for now)
 set(externalProjName ${proj})

+SetCanonicalDirectoryNames(${proj})
+
 if(NOT ( DEFINED "USE_SYSTEM_${externalProjName}" AND "${USE_SYSTEM_${externalProjName}}" ) )
   message(STATUS "${__indent}Adding project ${proj}")

   ### --- Project specific additions here
-  set(${proj}_Install_Dir ${SUPERBUILD_INSTALL_DIR})

   #message(STATUS "HDF5_ROOT in External_SIRF: " ${HDF5_ROOT})
   set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} ${SUPERBUILD_INSTALL_DIR})
@@ -46,21 +47,10 @@
   option(${proj}_USE_CUDA "Enable ${proj} CUDA (if cuda libraries are present)" ${CUDA_FOUND})
   mark_as_advanced(${proj}_USE_CUDA)

-  set(${proj}_SOURCE_DIR "${SOURCE_ROOT_DIR}/${proj}" )
-  set(${proj}_BINARY_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/build" )
-  set(${proj}_DOWNLOAD_DIR "${SUPERBUILD_WORK_DIR}/downloads/${proj}" )
-  set(${proj}_STAMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/stamp" )
-  set(${proj}_TMP_DIR "${SUPERBUILD_WORK_DIR}/builds/${proj}/tmp" )
-
   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
     GIT_REPOSITORY ${${proj}_URL}
     GIT_TAG ${${proj}_TAG}
-    SOURCE_DIR ${${proj}_SOURCE_DIR}
-    BINARY_DIR ${${proj}_BINARY_DIR}
-    DOWNLOAD_DIR ${${proj}_DOWNLOAD_DIR}
-    STAMP_DIR ${${proj}_STAMP_DIR}
-    TMP_DIR ${${proj}_TMP_DIR}
     CMAKE_ARGS
       -DCMAKE_PREFIX_PATH=${SUPERBUILD_INSTALL_DIR}
       -DCMAKE_LIBRARY_PATH=${SUPERBUILD_INSTALL_DIR}/lib
@@ -71,7 +61,6 @@
       -DUSE_OPENMP:BOOL=ON
       -DBUILD_ALL_DEP:BOOL=ON
       -DUSE_CUDA=${${proj}_USE_CUDA}
-    INSTALL_DIR ${${proj}_Install_Dir}
     DEPENDS ${${proj}_DEPENDENCIES})

     set(${proj}_ROOT        ${${proj}_SOURCE_DIR})


PKG: -clean target should not run configure again

--- SuperBuild/Packaging/PMacros.cmake
+++ SuperBuild/Packaging/PMacros.cmake
@@ -112,7 +112,7 @@
     COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/PACKAGE-${pkg}"
     COMMAND ${CMAKE_COMMAND} -E remove_directory "${CMAKE_BINARY_DIR}/PACKAGE-TOOLS"
     COMMAND ${CMAKE_COMMAND} -E remove "${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}${PACKAGE_EXTENSION}"
-    COMMAND ${CMAKE_COMMAND} "${CMAKE_BINARY_DIR}" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
     )

 endmacro(macro_create_targets_for_package)


cmake: Refactor and extend architecture flags

* Reduce code duplication with new helper macros.
* Add support for setting (GCC compatible) compiler flags for AVX-512
systems (Skylake, Cannonlake, Knights Landing).
Refs: gh-102

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

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -178,7 +178,15 @@
 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\", \"skylake\", \"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. \
+Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
+Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
+\"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
+\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"cannonlake\", \"silvermont\", \
+\"goldmont\", \"knl\" (Knights Landing), \"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}\"")
@@ -196,6 +204,57 @@
       message(STATUS "Detected CPU: ${TARGET_ARCHITECTURE}")
    endif(TARGET_ARCHITECTURE STREQUAL "auto")

+   macro(_nehalem)
+      list(APPEND _march_flag_list "nehalem")
+      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")
+   endmacro()
+   macro(_westmere)
+      list(APPEND _march_flag_list "westmere")
+      _nehalem()
+   endmacro()
+   macro(_sandybridge)
+      list(APPEND _march_flag_list "sandybridge")
+      list(APPEND _march_flag_list "corei7-avx")
+      _westmere()
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+   endmacro()
+   macro(_ivybridge)
+      list(APPEND _march_flag_list "ivybridge")
+      list(APPEND _march_flag_list "core-avx-i")
+      _sandybridge()
+      list(APPEND _available_vector_units_list "rdrnd" "f16c")
+   endmacro()
+   macro(_haswell)
+      list(APPEND _march_flag_list "haswell")
+      list(APPEND _march_flag_list "core-avx2")
+      _ivybridge()
+      list(APPEND _available_vector_units_list "avx2" "fma" "bmi" "bmi2")
+   endmacro()
+   macro(_broadwell)
+      list(APPEND _march_flag_list "broadwell")
+      _haswell()
+   endmacro()
+   macro(_skylake)
+      list(APPEND _march_flag_list "skylake")
+      _broadwell()
+   endmacro()
+   macro(_skylake_xeon)
+      _skylake()
+      list(APPEND _available_vector_units_list "avx512f" "avx512cd" "avx512dq" "avx512bw" "avx512vl")
+   endmacro()
+   macro(_cannonlake)
+      list(APPEND _march_flag_list "cannonlake")
+      _skylake_xeon()
+      list(APPEND _available_vector_units_list "avx512ifma" "avx512vbmi")
+   endmacro()
+   macro(_knightslanding)
+      list(APPEND _march_flag_list "knl")
+      _broadwell()
+      list(APPEND _available_vector_units_list "avx512f" "avx512pf" "avx512er" "avx512cd")
+   endmacro()
+
    if(TARGET_ARCHITECTURE STREQUAL "core")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
@@ -214,63 +273,26 @@
       else()
          message(STATUS "SSE4.1: disabled (auto-detected from this computer's CPU flags)")
       endif()
+   elseif(TARGET_ARCHITECTURE STREQUAL "knl")
+      _knightslanding()
+   elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
+      _cannonlake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake-xeon")
+      _skylake_xeon()
+   elseif(TARGET_ARCHITECTURE STREQUAL "skylake")
+      _skylake()
+   elseif(TARGET_ARCHITECTURE STREQUAL "broadwell")
+      _broadwell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "haswell")
+      _haswell()
+   elseif(TARGET_ARCHITECTURE STREQUAL "ivy-bridge")
+      _ivybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
+      _sandybridge()
+   elseif(TARGET_ARCHITECTURE STREQUAL "westmere")
+      _westmere()
    elseif(TARGET_ARCHITECTURE STREQUAL "nehalem")
-      list(APPEND _march_flag_list "nehalem")
-      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 "westmere")
-      list(APPEND _march_flag_list "westmere")
-      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")
-      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")
-      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 "haswell")
-      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")
-      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 "ivy-bridge")
-      list(APPEND _march_flag_list "core-avx-i")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx" "rdrnd" "f16c")
-   elseif(TARGET_ARCHITECTURE STREQUAL "sandy-bridge")
-      list(APPEND _march_flag_list "sandybridge")
-      list(APPEND _march_flag_list "corei7-avx")
-      list(APPEND _march_flag_list "core2")
-      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "avx")
+      _nehalem()
    elseif(TARGET_ARCHITECTURE STREQUAL "atom")
       list(APPEND _march_flag_list "atom")
       list(APPEND _march_flag_list "core2")
@@ -331,120 +353,70 @@
    if(NOT TARGET_ARCHITECTURE STREQUAL "none")
       set(_disable_vector_unit_list)
       set(_enable_vector_unit_list)
-      _my_find(_available_vector_units_list "sse2" SSE2_FOUND)
-      _my_find(_available_vector_units_list "sse3" SSE3_FOUND)
-      _my_find(_available_vector_units_list "ssse3" SSSE3_FOUND)
-      _my_find(_available_vector_units_list "sse4.1" SSE4_1_FOUND)
-      _my_find(_available_vector_units_list "sse4.2" SSE4_2_FOUND)
-      _my_find(_available_vector_units_list "sse4a" SSE4a_FOUND)
       if(DEFINED Vc_AVX_INTRINSICS_BROKEN AND Vc_AVX_INTRINSICS_BROKEN)
-         UserWarning("AVX disabled per default because of old/broken compiler")
-         set(AVX_FOUND false)
-         set(XOP_FOUND false)
-         set(FMA4_FOUND false)
-         set(FMA_FOUND false)
-         set(AVX2_FOUND false)
-         set(BMI2_FOUND false)
+         UserWarning("AVX disabled per default because of old/broken toolchain")
+         set(_avx_broken true)
+         set(_avx2_broken true)
+         set(_fma4_broken true)
+         set(_xop_broken true)
       else()
-         _my_find(_available_vector_units_list "avx" AVX_FOUND)
-         _my_find(_available_vector_units_list "fma" FMA_FOUND)
+         set(_avx_broken false)
          if(DEFINED Vc_FMA4_INTRINSICS_BROKEN AND Vc_FMA4_INTRINSICS_BROKEN)
-            UserWarning("FMA4 disabled per default because of old/broken compiler")
-            set(FMA4_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
+            UserWarning("FMA4 disabled per default because of old/broken toolchain")
+            set(_fma4_broken true)
+         else()
+            set(_fma4_broken false)
          endif()
          if(DEFINED Vc_XOP_INTRINSICS_BROKEN AND Vc_XOP_INTRINSICS_BROKEN)
-            UserWarning("XOP disabled per default because of old/broken compiler")
-            set(XOP_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "xop" XOP_FOUND)
+            UserWarning("XOP disabled per default because of old/broken toolchain")
+            set(_xop_broken true)
+         else()
+            set(_xop_broken false)
          endif()
          if(DEFINED Vc_AVX2_INTRINSICS_BROKEN AND Vc_AVX2_INTRINSICS_BROKEN)
-            UserWarning("AVX2 disabled per default because of old/broken compiler")
-            set(AVX2_FOUND false)
-         else()
-            _my_find(_available_vector_units_list "avx2" AVX2_FOUND)
-         endif()
-         _my_find(_available_vector_units_list "bmi2" BMI2_FOUND)
+            UserWarning("AVX2 disabled per default because of old/broken toolchain")
+            set(_avx2_broken true)
+         else()
+            set(_avx2_broken false)
+         endif()
       endif()
-      set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
-      set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSSE3  ${SSSE3_FOUND}  CACHE BOOL "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
-      set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
-      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will all floating-point vector sizes relative to SSE." ${_force})
-      set(USE_AVX2   ${AVX2_FOUND}   CACHE BOOL "Use AVX2. This will double all of the vector sizes relative to SSE." ${_force})
-      set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
-      set(USE_FMA    ${FMA_FOUND}    CACHE BOOL "Use FMA." ${_force})
-      set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      set(USE_BMI2   ${BMI2_FOUND}   CACHE BOOL "Use BMI2." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA USE_FMA4 USE_BMI2)
-      if(USE_SSE2)
-         list(APPEND _enable_vector_unit_list "sse2")
-      else(USE_SSE2)
-         list(APPEND _disable_vector_unit_list "sse2")
-      endif(USE_SSE2)
-      if(USE_SSE3)
-         list(APPEND _enable_vector_unit_list "sse3")
-      else(USE_SSE3)
-         list(APPEND _disable_vector_unit_list "sse3")
-      endif(USE_SSE3)
-      if(USE_SSSE3)
-         list(APPEND _enable_vector_unit_list "ssse3")
-      else(USE_SSSE3)
-         list(APPEND _disable_vector_unit_list "ssse3")
-      endif(USE_SSSE3)
-      if(USE_SSE4_1)
-         list(APPEND _enable_vector_unit_list "sse4.1")
-      else(USE_SSE4_1)
-         list(APPEND _disable_vector_unit_list "sse4.1")
-      endif(USE_SSE4_1)
-      if(USE_SSE4_2)
-         list(APPEND _enable_vector_unit_list "sse4.2")
-      else(USE_SSE4_2)
-         list(APPEND _disable_vector_unit_list "sse4.2")
-      endif(USE_SSE4_2)
-      if(USE_SSE4a)
-         list(APPEND _enable_vector_unit_list "sse4a")
-      else(USE_SSE4a)
-         list(APPEND _disable_vector_unit_list "sse4a")
-      endif(USE_SSE4a)
-      if(USE_AVX)
-         list(APPEND _enable_vector_unit_list "avx")
-         # we want SSE intrinsics to result in instructions using the VEX prefix.
-         # Otherwise integer ops (which require the older SSE intrinsics) would
-         # always have a large penalty.
-         list(APPEND _enable_vector_unit_list "sse2avx")
-      else(USE_AVX)
-         list(APPEND _disable_vector_unit_list "avx")
-      endif(USE_AVX)
-      if(USE_XOP)
-         list(APPEND _enable_vector_unit_list "xop")
-      else()
-         list(APPEND _disable_vector_unit_list "xop")
-      endif()
-      if(USE_FMA)
-         list(APPEND _enable_vector_unit_list "fma")
-      else()
-         list(APPEND _disable_vector_unit_list "fma")
-      endif()
-      if(USE_FMA4)
-         list(APPEND _enable_vector_unit_list "fma4")
-      else()
-         list(APPEND _disable_vector_unit_list "fma4")
-      endif()
-      if(USE_AVX2)
-         list(APPEND _enable_vector_unit_list "avx2")
-      else()
-         list(APPEND _disable_vector_unit_list "avx2")
-      endif()
-      if(USE_BMI2)
-         list(APPEND _enable_vector_unit_list "bmi2")
-      else()
-         list(APPEND _disable_vector_unit_list "bmi2")
-      endif()
+
+      macro(_enable_or_disable _name _flag _documentation _broken)
+         if(_broken)
+            set(_found false)
+         else()
+            _my_find(_available_vector_units_list "${_flag}" _found)
+         endif()
+         set(USE_${_name} _found CACHE BOOL "${documentation}" ${_force})
+         mark_as_advanced(USE_${_name})
+         if(USE_${_name})
+            list(APPEND _enable_vector_unit_list "${_flag}")
+         else()
+            list(APPEND _disable_vector_unit_list "${_flag}")
+         endif()
+      endmacro()
+      _enable_or_disable(SSE2 "sse2" "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." false)
+      _enable_or_disable(SSE3 "sse3" "Use SSE3. If SSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSSE3 "ssse3" "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_1 "sse4.1" "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4_2 "sse4.2" "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." false)
+      _enable_or_disable(SSE4a "sse4a" "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." false)
+      _enable_or_disable(AVX "avx" "Use AVX. This will all floating-point vector sizes relative to SSE." _avx_broken)
+      _enable_or_disable(FMA "fma" "Use FMA." _avx_broken)
+      _enable_or_disable(BMI2 "bmi2" "Use BMI2." _avx_broken)
+      _enable_or_disable(AVX2 "xop" "Use AVX2. This will double all of the vector sizes relative to SSE." _avx2_broken)
+      _enable_or_disable(XOP "xop" "Use XOP." _xop_broken)
+      _enable_or_disable(FMA4 "fma4" "Use FMA4." _fma4_broken)
+      _enable_or_disable(AVX512F "avx512f" "Use AVX512F. This will double all floating-point vector sizes relative to AVX2." false)
+      _enable_or_disable(AVX512VL "avx512vl" "Use AVX512VL. This enables 128- and 256-bit vector length instructions with EVEX coding (improved write-masking & more vector registers)." _avx2_broken)
+      _enable_or_disable(AVX512PF "avx512pf" "Use AVX512PF. This enables prefetch instructions for gathers and scatters." false)
+      _enable_or_disable(AVX512ER "avx512er" "Use AVX512ER. This enables exponential and reciprocal instructions." false)
+      _enable_or_disable(AVX512CD "avx512cd" "Use AVX512CD." false)
+      _enable_or_disable(AVX512DQ "avx512dq" "Use AVX512DQ." false)
+      _enable_or_disable(AVX512BW "avx512bw" "Use AVX512BW." false)
+      _enable_or_disable(AVX512IFMA "avx512ifma" "Use AVX512IFMA." false)
+      _enable_or_disable(AVX512VBMI "avx512vbmi" "Use AVX512VBMI." false)
+
       if(MSVC)
          # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
          # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)


support AMD Family 0Fh in auto-detection

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -10,7 +10,7 @@
 endmacro(_my_find)

 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: \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"barcelona\", \"istanbul\", \"magny-cours\".")
+   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: \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\".")
    string(TOLOWER "${TARGET_ARCHITECTURE}" TARGET_ARCHITECTURE)

    set(_march_flag_list)
@@ -59,6 +59,11 @@
       elseif(_vendor_id STREQUAL "AuthenticAMD")
          if(_cpu_family EQUAL 16)
             set(TARGET_ARCHITECTURE "barcelona")
+         elseif(_cpu_family EQUAL 15)
+            set(TARGET_ARCHITECTURE "k8")
+            if(_cpu_model GREATER 64) # I don't know the right number to put here. This is just a guess from the hardware I have access to
+               set(TARGET_ARCHITECTURE "k8-sse3")
+            endif(_cpu_model GREATER 64)
          endif(_cpu_family EQUAL 16)
       endif(_vendor_id STREQUAL "GenuineIntel")
    endif(TARGET_ARCHITECTURE STREQUAL "auto")
@@ -90,6 +95,13 @@
       list(APPEND _march_flag_list "atom")
       list(APPEND _march_flag_list "core2")
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3")
+   elseif(TARGET_ARCHITECTURE STREQUAL "k8")
+      list(APPEND _march_flag_list "k8")
+      list(APPEND _available_vector_units_list "sse" "sse2")
+   elseif(TARGET_ARCHITECTURE STREQUAL "k8-sse3")
+      list(APPEND _march_flag_list "k8-sse3")
+      list(APPEND _march_flag_list "k8")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3")
    elseif(TARGET_ARCHITECTURE STREQUAL "barcelona")
       list(APPEND _march_flag_list "barcelona")
       list(APPEND _march_flag_list "core2")


Updated FindflyCapture2.cmake

Updated FindflyCapture2.cmake

--- cmake_modules/FindFlyCapture2.cmake
+++ cmake_modules/FindFlyCapture2.cmake
@@ -6,21 +6,36 @@
 #  FlyCapture2_INCLUDE_DIRS - The FlyCapture2 include directory.
 #  FlyCapture2_LIBRARIES     - The FlyCapture2 library to link against.

+if(CMAKE_CL_64)
+set(FlyCapture2_LIBDIR $ENV{FlyCapture2_ROOT_DIR}/lib64)
+else()
+set(FlyCapture2_LIBDIR $ENV{FlyCapture2_ROOT_DIR}/lib)
+endif()
+
+if(CMAKE_CL_64)
+set(Triclops_LIBDIR $ENV{Triclops_ROOT_DIR}/lib64)
+else()
+set(Triclops_LIBDIR $ENV{Triclops_ROOT_DIR}/lib)
+endif()
+
 #FlyCapture2 SDK
 find_path(FlyCapture2_INCLUDE_DIR NAMES FlyCapture2.h PATHS $ENV{FlyCapture2_ROOT_DIR}/include)
-find_library(FlyCapture2_LIBRARY NAMES FlyCapture2_v100 FlyCapture2 flycapture2 PATHS $ENV{FlyCapture2_ROOT_DIR}/lib64 $ENV{FlyCapture2_ROOT_DIR}/lib)
+find_library(FlyCapture2_LIBRARY NAMES FlyCapture2_v100 FlyCapture2 flycapture2 NO_DEFAULT_PATH PATHS ${FlyCapture2_LIBDIR})

 # Triclops SDK
 find_path(Triclops_INCLUDE_DIR NAMES triclops.h PATHS $ENV{Triclops_ROOT_DIR}/include)
-find_library(Triclops_LIBRARY NAMES triclops triclops_v100 PATHS $ENV{Triclops_ROOT_DIR}/lib64 $ENV{Triclops_ROOT_DIR}/lib)
-find_library(FlyCaptureBridge_LIBRARY NAMES flycapture2bridge flycapture2bridge_v100 PATHS $ENV{Triclops_ROOT_DIR}/lib64 $ENV{Triclops_ROOT_DIR}/lib)
-find_library(pnmutils_LIBRARY NAMES pnmutils pnmutils_v100 PATHS $ENV{Triclops_ROOT_DIR}/lib64 $ENV{Triclops_ROOT_DIR}/lib)
+find_library(Triclops_LIBRARY NAMES triclops triclops_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
+find_library(FlyCaptureBridge_LIBRARY NAMES flycapture2bridge flycapture2bridge_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})
+find_library(pnmutils_LIBRARY NAMES pnmutils pnmutils_v100 NO_DEFAULT_PATH PATHS ${Triclops_LIBDIR})

 IF (FlyCapture2_INCLUDE_DIR AND Triclops_INCLUDE_DIR AND FlyCapture2_LIBRARY AND Triclops_LIBRARY AND FlyCaptureBridge_LIBRARY AND pnmutils_LIBRARY)
    SET(FlyCapture2_FOUND TRUE)
    SET(FlyCapture2_INCLUDE_DIRS ${FlyCapture2_INCLUDE_DIR} ${Triclops_INCLUDE_DIR})
    SET(FlyCapture2_LIBRARIES ${FlyCapture2_LIBRARY} ${Triclops_LIBRARY} ${FlyCaptureBridge_LIBRARY} ${pnmutils_LIBRARY})
 ENDIF (FlyCapture2_INCLUDE_DIR AND Triclops_INCLUDE_DIR AND FlyCapture2_LIBRARY AND Triclops_LIBRARY AND FlyCaptureBridge_LIBRARY AND pnmutils_LIBRARY)
+
+MESSAGE(STATUS "FlyCapture2_INCLUDE_DIRS={FlyCapture2_INCLUDE_DIRS}")
+MESSAGE(STATUS "FlyCapture2_LIBRARIES={FlyCapture2_LIBRARIES}")

 IF (FlyCapture2_FOUND)
    # show which FlyCapture2 was found only if not quiet


CastXML 0.3.1

CastXML 0.3.1

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 3)
-set(CastXML_VERSION_PATCH 0)
+set(CastXML_VERSION_PATCH 1)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


Don't link the simulator with iconv.dll on Windows.

--- indra/cmake/APR.cmake
+++ indra/cmake/APR.cmake
@@ -23,10 +23,8 @@
       debug ${ARCH_PREBUILT_DIRS_DEBUG}/aprutil-1.lib
       optimized ${ARCH_PREBUILT_DIRS_RELEASE}/aprutil-1.lib
       )
-    set(APRICONV_LIBRARIES
-      debug ${ARCH_PREBUILT_DIRS_DEBUG}/iconv.dll
-      optimized ${ARCH_PREBUILT_DIRS_RELEASE}/iconv.dll
-      )
+    # Doesn't need to link with iconv.dll
+    set(APRICONV_LIBRARIES "")
   elseif (DARWIN)
     set(APR_LIBRARIES
       debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.a


Fix up dependencies

Fix up dependencies

--- projects/qt.cmake
+++ projects/qt.cmake
@@ -1,9 +1,9 @@
 set (qt_options)
 set (patch_command)
 if (NOT APPLE AND UNIX)
-  list (APPEND qt_depends freetype fontconfig)
   list (APPEND qt_options
                -qt-libpng
+               -qt-libzlib
                -I <INSTALL_DIR>/include/freetype2
                -I <INSTALL_DIR>/include/fontconfig)
   # Fix Qt build failure with GCC 4.1.


[SUPERBUILD] use CCPPETMR/STIR and some extra build options to save time

--- SuperBuild/External_STIR.cmake
+++ SuperBuild/External_STIR.cmake
@@ -14,7 +14,7 @@
   ### --- Project specific additions here
   set(STIR_Install_Dir ${CMAKE_CURRENT_BINARY_DIR}/INSTALL)

-  set(${proj}_URL https://github.com/UCL/STIR )
+  set(${proj}_URL https://github.com/CCPPETMR/STIR )

   ExternalProject_Add(${proj}
     ${${proj}_EP_ARGS}
@@ -23,9 +23,12 @@
     #BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/${proj}
     CMAKE_ARGS -DGRAPHICS=None
         -DBUILD_EXECUTABLES=OFF
+        -DBUILD_TESTING=OFF
+        -DBUILD_DOCUMENTATION=OFF
         -DCMAKE_POSITION_INDEPENDENT_CODE=ON
         -DBOOST_ROOT=${BOOST_ROOT}
         -DCMAKE_INSTALL_PREFIX=${STIR_Install_Dir}
+        -DGRAPHICS=None
     INSTALL_DIR ${STIR_Install_Dir}
   )


Cleanup remnant reference to now defunct variable.

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -90,7 +90,6 @@
     find_package (Direct3D)
     if (DIRECT3D_FOUND)
         include_directories (${DIRECT3D_INCLUDE_DIR})
-        link_directories (${DIRECT3D_LIBRARY_DIR})
     endif ()
 endif ()


Restore the old dynamic library path rewriting for test programs on mac #6244

The test programs don't have an install directive. They're just written
into src/condor_tests. When a test run is done in the batlab, a symlink
is made so that ../lib points to the necessary lib directory. And since
the tests are run at a different time and in a different location than
the build, the full pathnames for the libraries won't be valid. So we
want to do the library path rewritting at compile time for these
programs, instead of at install time.

--- build/cmake/macros/CondorExeTest.cmake
+++ build/cmake/macros/CondorExeTest.cmake
@@ -37,6 +37,13 @@

 		condor_set_link_libs( ${LOCAL_${_CNDR_TARGET}} "${_LINK_LIBS}" )

+		if ( DARWIN )
+			add_custom_command( TARGET ${LOCAL_${_CNDR_TARGET}}
+				POST_BUILD
+				WORKING_DIRECTORY ${TEST_TARGET_DIR}
+				COMMAND ${CMAKE_SOURCE_DIR}/src/condor_scripts/macosx_rewrite_libs ${LOCAL_${_CNDR_TARGET}} )
+		endif()
+
 		APPEND_VAR( CONDOR_TESTS ${LOCAL_${_CNDR_TARGET}} )

 	endif(BUILD_TESTING)


[cmake] using RPATH on install

[cmake] using RPATH on install

--- buildsystems/cmake/basics/lib-xx.cmake
+++ buildsystems/cmake/basics/lib-xx.cmake
@@ -42,6 +42,13 @@
 set_target_properties(${PROJECT_NAME} PROPERTIES
   POSITION_INDEPENDENT_CODE TRUE ENABLE_EXPORTS TRUE)

+## ALT: modify resulting RPATH
+## BUG: substitution "$ORIGIN" done by "ld" -- therefore you must re-link exe on installation, not simply replace RPATH
+# set_target_properties(foo PROPERTIES
+#   BUILD_WITH_INSTALL_RPATH TRUE
+#   INSTALL_RPATH_USE_LINK_PATH TRUE
+#   INSTALL_RPATH "\$ORIGIN/../lib:${INSTALL_RPATH}")
+
 add_executable(usage usage.cpp)
 target_link_libraries(usage PRIVATE $<TARGET_FILE:${PROJECT_NAME}>)
 set_target_properties(usage PROPERTIES


added message to indicate when the CMAKE_BUILD_TYPE is automatically set

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -1,11 +1,11 @@

 #! TODO remove the need to check this ....
-#if (NOT CHECKED_DEPENDENCIES)
-#    message(FATAL_ERROR "Please include oskar_dependencies.cmake before this script!")
-#endif ()
+if (NOT CHECKED_DEPENDENCIES)
+    message(FATAL_ERROR "Please include oskar_dependencies.cmake before this script!")
+endif ()

 # Automatically set the build type to release or debug if not specified.
-if(NOT CMAKE_BUILD_TYPE)
+if (NOT CMAKE_BUILD_TYPE)
     # Use debug mode if building in dbg or debug directory.
     get_filename_component(dirname ${CMAKE_BINARY_DIR} NAME)
     if (${dirname} MATCHES "dbg" OR ${dirname} MATCHES "debug")
@@ -13,6 +13,7 @@
     else()
         set(CMAKE_BUILD_TYPE release)
     endif()
+    message(STATUS "INFO: Setting CMAKE_BUILD_TYPE to ${CMAKE_BUILD_TYPE}")
 endif()

 set(BUILD_SHARED_LIBS ON)


Not block PDB file in multithreaded build on Windows.

If used cl compiler, but generator is not Visual Studio e.g. Ninja,
enable FS option to prevent blocking PDB file in multithreaded build.

(cherry picked from commit 58c9135626ed85b3436c44b54030f5d9ab485e43)

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -253,6 +253,11 @@
   endif()
 endif()

+if(MSVC12 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio")
+  set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} /FS")
+  set(OPENCV_EXTRA_CXX_FLAGS "${OPENCV_EXTRA_CXX_FLAGS} /FS")
+endif()
+
 # Extra link libs if the user selects building static libs:
 if(NOT BUILD_SHARED_LIBS AND CMAKE_COMPILER_IS_GNUCXX AND NOT ANDROID)
   # Android does not need these settings because they are already set by toolchain file


clang: remove include-fixed inclusion

clang: remove include-fixed inclusion

This directory does not exist in clang/llvm, remove it.

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

--- cmake/compiler/clang/target.cmake
+++ cmake/compiler/clang/target.cmake
@@ -32,7 +32,7 @@
     include(${ZEPHYR_BASE}/cmake/compiler/gcc/target_arm.cmake)
   endif()

-  foreach(file_name include/stddef.h include-fixed/limits.h)
+  foreach(file_name include/stddef.h)
     execute_process(
       COMMAND ${CMAKE_C_COMPILER} --print-file-name=${file_name}
       OUTPUT_VARIABLE _OUTPUT


Check for wx-config-3.0 and wx-config-2.8 in FindwxWidgets.cmake. These executables or used on Cygwin instead of wx-config

--- cmake/modules/FindwxWidgets.cmake
+++ cmake/modules/FindwxWidgets.cmake
@@ -775,6 +775,21 @@
       DOC "Location of wxWidgets library configuration provider binary (wx-config)."
       ONLY_CMAKE_FIND_ROOT_PATH
       )
+    #On Cygwin wx-config is actually called wx-config-3.0 or wx-config-2.8 - rather
+    #frustrating really as this will need updating every release.
+    if(NOT wxWidgets_CONFIG_EXECUTABLE)
+      find_program(wxWidgets_CONFIG_EXECUTABLE wx-config-3.0
+        DOC "Location of wxWidgets library configuration provider binary (wx-config)."
+        ONLY_CMAKE_FIND_ROOT_PATH
+        )
+    endif(NOT wxWidgets_CONFIG_EXECUTABLE)
+    if(NOT wxWidgets_CONFIG_EXECUTABLE)
+      find_program(wxWidgets_CONFIG_EXECUTABLE wx-config-2.8
+        DOC "Location of wxWidgets library configuration provider binary (wx-config)."
+        ONLY_CMAKE_FIND_ROOT_PATH
+        )
+    endif(NOT wxWidgets_CONFIG_EXECUTABLE)
+

     if(wxWidgets_CONFIG_EXECUTABLE)
       set(wxWidgets_FOUND TRUE)


[cmake] Fix typo in docs.

[cmake] Fix typo in docs.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -190,7 +190,7 @@
 endmacro()

 #---------------------------------------------------------------------------------------------------
-#---ROOT_GENERATE_DICTIONARY( result_var )
+#---ROOT_GET_LIBRARY_OUTPUT_DIR( result_var )
 # Returns the path to the .so file or .dll file. In the latter case Windows defines the dll files as
 # executables and puts them in the $ROOTSYS/bin folder.
 function(ROOT_GET_LIBRARY_OUTPUT_DIR result)


Build BZip2 with BUILD_TESTING=OFF

Build BZip2 with BUILD_TESTING=OFF

--- cmake/projects/BZip2/hunter.cmake
+++ cmake/projects/BZip2/hunter.cmake
@@ -5,6 +5,7 @@

 include(hunter_add_version)
 include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)
 include(hunter_report_broken_package)
@@ -42,6 +43,12 @@
     f0ebd4c19c2ff663c2f75406c1a476211bf3d3c1
 )

+hunter_cmake_args(
+    BZip2
+    CMAKE_ARGS
+    BUILD_TESTING=OFF
+)
+
 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(BZip2)
 hunter_download(PACKAGE_NAME BZip2)


[fixed] ordering for linker flag adding

[fixed] ordering for linker flag adding

--- cmake/BOTG.cmake
+++ cmake/BOTG.cmake
@@ -376,6 +376,7 @@
         botgResolveVersion() #macro to resolve the version
         TRIBITS_PACKAGE( ${name} )
     ENDIF()
+    botgProcessTPLS()
 ENDMACRO()
 #-------------------------------------------------------------------------------
 # PUBLIC
@@ -395,9 +396,6 @@
         IF( NOT "${BOTG_INSIDE_PACKAGE_CMAKELISTS}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}" )
             MESSAGE( FATAL_ERROR "[BootsOnTheGround] botEnd has been used without botgPackage!" )
         ENDIF()
-
-        # Miscellaneous wrap-up.
-        botgProcessTPLS()

         #Inside a subpackage
         IF( ${is_superpackage} )
@@ -489,9 +487,10 @@
                   ${${PACKAGE_NAME}_TEST_REQUIRED_DEP_TPLS}
                   ${${PACKAGE_NAME}_TEST_OPTIONAL_DEP_TPLS} )
        IF( TPL_ENABLE_${name} )
-           SET( linker_file "${BOTG_ROOT_DIR}/src/${name}/cmake/LinkerFlags.cmake" )
+           STRING(REPLACE "_" "/" path ${name}) #convert name with _ to path with /
+           SET( linker_file "${BOTG_ROOT_DIR}/src/${path}/cmake/LinkerFlags.cmake" )
            IF( EXISTS "${linker_file}" )
-               MESSAGE( STATUS "[BootsOnTheGround] package=${PACKAGE_NAME} added TPL=${name} LinkerFlags.cmake")
+               MESSAGE( STATUS "[BootsOnTheGround] package=${PACKAGE_NAME} added TPL=${name} file='${linker_file}'")
                INCLUDE( "${linker_file}" )
            ENDIF()
        ENDIF()


update cmake files

update cmake files

--- cmake/MCKL.cmake
+++ cmake/MCKL.cmake
@@ -82,10 +82,10 @@
 function(mckl_add_test exname testname)
     set(src ${exname}_${testname})
     if("${ARGN}" MATCHES "BIN")
-        MCKL_ADD_EXECUTABLE(${src}
+        mckl_add_executable(${src}
             ${PROJECT_BINARY_DIR}/src/${src}.cpp ${ARGN})
     else("${ARGN}" MATCHES "BIN")
-        MCKL_ADD_EXECUTABLE(${src}
+        mckl_add_executable(${src}
             ${PROJECT_SOURCE_DIR}/src/${src}.cpp ${ARGN})
     endif("${ARGN}" MATCHES "BIN")
     add_dependencies(${exname} ${src})


Fix QTROOT for clang64-based Qt

Fix QTROOT for clang64-based Qt

Signed-off-by: Vitaliy Vlasov <e49d0217baed7632d034fb41cd352d74cf7c0ec8@gmail.com>

--- desktop/CMakeModules/QtConfiguration.cmake
+++ desktop/CMakeModules/QtConfiguration.cmake
@@ -51,8 +51,10 @@
 if(NOT EXISTS ${QTROOT}/bin/qt.conf)
   if(EXISTS ${QTROOT}/gcc_64/bin/qt.conf)
     set(QTROOT "${QTROOT}/gcc_64")
+  elseif(EXISTS ${QTROOT}/clang_64/bin/qt.conf)
+    set(QTROOT "${QTROOT}/clang_64")
   else()
-    message(FATAL_ERROR "Could not find qt.conf in ${QTROOT}/bin nor in ${QTROOT}/gcc_64/bin. Is QTROOT correctly defined?")
+    message(FATAL_ERROR "Could not find qt.conf in ${QTROOT}/bin nor in ${QTROOT}/clang_64/bin nor in ${QTROOT}/gcc_64/bin. Is QTROOT correctly defined?")
   endif()
 endif()


update

update

--- modules/HdrHistogram.cmake
+++ modules/HdrHistogram.cmake
@@ -18,8 +18,7 @@

   # Includes
   include_directories("zlib")
-  message(${CMAKE_CURRENT_BINARY_DIR})
-  include_directories("../build/modules/zlib")
+  include_directories("${CMAKE_CURRENT_BINARY_DIR}/zlib")

   # Add module library
   add_library(histogram ${SOURCE_FILES})


add support for AMD zen3

add support for AMD zen3

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -182,7 +182,9 @@
          message(WARNING "Your CPU family ${_cpu_family} (vendor ${_vendor_id} model ${_cpu_model}) is not supported by OptimizeForArchitecture.cmake.")
       endif()
    elseif(_vendor_id STREQUAL "AuthenticAMD")
-      if(_cpu_family EQUAL 23)
+      if(_cpu_family EQUAL 25)
+         set(TARGET_ARCHITECTURE "zen3")
+      elseif(_cpu_family EQUAL 23)
          set(TARGET_ARCHITECTURE "zen")
       elseif(_cpu_family EQUAL 22) # 16h
          set(TARGET_ARCHITECTURE "AMD 16h")
@@ -226,7 +228,7 @@
 \"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kaby-lake\", \"cannonlake\", \"silvermont\", \
 \"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
 \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
-\"AMD 14h\", \"AMD 16h\", \"zen\".")
+\"AMD 14h\", \"AMD 16h\", \"zen\", \"zen3\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -369,8 +371,12 @@
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "zen")
       list(APPEND _march_flag_list "znver1")
-      _skylake()
-      list(APPEND _available_vector_units_list "sse4a")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "avx2" "fma" "f16c" "bmi" "bmi2")
+   elseif(TARGET_ARCHITECTURE STREQUAL "zen3")
+      list(APPEND _march_flag_list "znver3")
+      list(APPEND _march_flag_list "znver2")
+      list(APPEND _march_flag_list "znver1")
+      list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "ssse3" "sse4a" "sse4.1" "sse4.2" "avx" "avx2" "fma" "f16c" "bmi" "bmi2")
    elseif(TARGET_ARCHITECTURE STREQUAL "piledriver")
       list(APPEND _march_flag_list "bdver2")
       list(APPEND _march_flag_list "bdver1")
@@ -515,6 +521,8 @@
          set(OFA_map_penryn "-xSSSE3")
          set(OFA_map_merom "-xSSSE3")
          set(OFA_map_core2 "-xSSE3")
+         set(OFA_map_zen3 "-xAVX2")
+         set(OFA_map_zen "-xAVX2")
          set(_ok FALSE)
          foreach(arch ${_march_flag_list})
             if(DEFINED OFA_map_${arch})


add TARGET_ARCHITECTURE=none where no flags will be added

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -97,7 +97,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: \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\".")
+   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\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\".")
    set(_force)
    if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
       message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -183,162 +183,166 @@
       list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
    elseif(TARGET_ARCHITECTURE STREQUAL "generic")
       list(APPEND _march_flag_list "generic")
+   elseif(TARGET_ARCHITECTURE STREQUAL "none")
+      # add this clause to remove it from the else clause
    else(TARGET_ARCHITECTURE STREQUAL "core")
       message(FATAL_ERROR "Unknown target architecture: \"${TARGET_ARCHITECTURE}\". Please set TARGET_ARCHITECTURE to a supported value.")
    endif(TARGET_ARCHITECTURE STREQUAL "core")

-   set(_disable_vector_unit_list)
-   set(_enable_vector_unit_list)
-   _my_find(_available_vector_units_list "sse2" SSE2_FOUND)
-   _my_find(_available_vector_units_list "sse3" SSE3_FOUND)
-   _my_find(_available_vector_units_list "ssse3" SSSE3_FOUND)
-   _my_find(_available_vector_units_list "sse4.1" SSE4_1_FOUND)
-   _my_find(_available_vector_units_list "sse4.2" SSE4_2_FOUND)
-   _my_find(_available_vector_units_list "sse4a" SSE4a_FOUND)
-   if(DEFINED Vc_AVX_INTRINSICS_BROKEN AND Vc_AVX_INTRINSICS_BROKEN)
-      UserWarning("AVX disabled per default because of old/broken compiler")
-      set(AVX_FOUND false)
-      set(XOP_FOUND false)
-      set(FMA4_FOUND false)
-   else()
-      _my_find(_available_vector_units_list "avx" AVX_FOUND)
-      _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
-      if(DEFINED Vc_XOP_INTRINSICS_BROKEN AND Vc_XOP_INTRINSICS_BROKEN)
-         UserWarning("XOP disabled per default because of old/broken compiler")
+   if(NOT TARGET_ARCHITECTURE STREQUAL "none")
+      set(_disable_vector_unit_list)
+      set(_enable_vector_unit_list)
+      _my_find(_available_vector_units_list "sse2" SSE2_FOUND)
+      _my_find(_available_vector_units_list "sse3" SSE3_FOUND)
+      _my_find(_available_vector_units_list "ssse3" SSSE3_FOUND)
+      _my_find(_available_vector_units_list "sse4.1" SSE4_1_FOUND)
+      _my_find(_available_vector_units_list "sse4.2" SSE4_2_FOUND)
+      _my_find(_available_vector_units_list "sse4a" SSE4a_FOUND)
+      if(DEFINED Vc_AVX_INTRINSICS_BROKEN AND Vc_AVX_INTRINSICS_BROKEN)
+         UserWarning("AVX disabled per default because of old/broken compiler")
+         set(AVX_FOUND false)
          set(XOP_FOUND false)
+         set(FMA4_FOUND false)
       else()
-         _my_find(_available_vector_units_list "xop" XOP_FOUND)
-      endif()
-   endif()
-   set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
-   set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
-   set(USE_SSSE3  ${SSSE3_FOUND}  CACHE BOOL "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." ${_force})
-   set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
-   set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
-   set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
-   set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
-   set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
-   set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-   mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_XOP USE_FMA4)
-   if(USE_SSE2)
-      list(APPEND _enable_vector_unit_list "sse2")
-   else(USE_SSE2)
-      list(APPEND _disable_vector_unit_list "sse2")
-   endif(USE_SSE2)
-   if(USE_SSE3)
-      list(APPEND _enable_vector_unit_list "sse3")
-   else(USE_SSE3)
-      list(APPEND _disable_vector_unit_list "sse3")
-   endif(USE_SSE3)
-   if(USE_SSSE3)
-      list(APPEND _enable_vector_unit_list "ssse3")
-   else(USE_SSSE3)
-      list(APPEND _disable_vector_unit_list "ssse3")
-   endif(USE_SSSE3)
-   if(USE_SSE4_1)
-      list(APPEND _enable_vector_unit_list "sse4.1")
-   else(USE_SSE4_1)
-      list(APPEND _disable_vector_unit_list "sse4.1")
-   endif(USE_SSE4_1)
-   if(USE_SSE4_2)
-      list(APPEND _enable_vector_unit_list "sse4.2")
-   else(USE_SSE4_2)
-      list(APPEND _disable_vector_unit_list "sse4.2")
-   endif(USE_SSE4_2)
-   if(USE_SSE4a)
-      list(APPEND _enable_vector_unit_list "sse4a")
-   else(USE_SSE4a)
-      list(APPEND _disable_vector_unit_list "sse4a")
-   endif(USE_SSE4a)
-   if(USE_AVX)
-      list(APPEND _enable_vector_unit_list "avx")
-      # we want SSE intrinsics to result in instructions using the VEX prefix.
-      # Otherwise integer ops (which require the older SSE intrinsics) would
-      # always have a large penalty.
-      list(APPEND _enable_vector_unit_list "sse2avx")
-   else(USE_AVX)
-      list(APPEND _disable_vector_unit_list "avx")
-   endif(USE_AVX)
-   if(USE_XOP)
-      list(APPEND _enable_vector_unit_list "xop")
-   else()
-      list(APPEND _disable_vector_unit_list "xop")
-   endif()
-   if(USE_FMA4)
-      list(APPEND _enable_vector_unit_list "fma4")
-   else()
-      list(APPEND _disable_vector_unit_list "fma4")
-   endif()
-   if(MSVC)
-      # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
-      # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)
-      _my_find(_enable_vector_unit_list "avx" _avx)
-      set(_avx_flag FALSE)
-      if(_avx)
-         AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _avx_flag)
-      endif()
-      if(NOT _avx_flag)
-         _my_find(_enable_vector_unit_list "sse2" _found)
+         _my_find(_available_vector_units_list "avx" AVX_FOUND)
+         _my_find(_available_vector_units_list "fma4" FMA4_FOUND)
+         if(DEFINED Vc_XOP_INTRINSICS_BROKEN AND Vc_XOP_INTRINSICS_BROKEN)
+            UserWarning("XOP disabled per default because of old/broken compiler")
+            set(XOP_FOUND false)
+         else()
+            _my_find(_available_vector_units_list "xop" XOP_FOUND)
+         endif()
+      endif()
+      set(USE_SSE2   ${SSE2_FOUND}   CACHE BOOL "Use SSE2. If SSE2 instructions are not enabled the SSE implementation will be disabled." ${_force})
+      set(USE_SSE3   ${SSE3_FOUND}   CACHE BOOL "Use SSE3. If SSE3 instructions are not enabled they will be emulated." ${_force})
+      set(USE_SSSE3  ${SSSE3_FOUND}  CACHE BOOL "Use SSSE3. If SSSE3 instructions are not enabled they will be emulated." ${_force})
+      set(USE_SSE4_1 ${SSE4_1_FOUND} CACHE BOOL "Use SSE4.1. If SSE4.1 instructions are not enabled they will be emulated." ${_force})
+      set(USE_SSE4_2 ${SSE4_2_FOUND} CACHE BOOL "Use SSE4.2. If SSE4.2 instructions are not enabled they will be emulated." ${_force})
+      set(USE_SSE4a  ${SSE4a_FOUND}  CACHE BOOL "Use SSE4a. If SSE4a instructions are not enabled they will be emulated." ${_force})
+      set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
+      set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
+      set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
+      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_XOP USE_FMA4)
+      if(USE_SSE2)
+         list(APPEND _enable_vector_unit_list "sse2")
+      else(USE_SSE2)
+         list(APPEND _disable_vector_unit_list "sse2")
+      endif(USE_SSE2)
+      if(USE_SSE3)
+         list(APPEND _enable_vector_unit_list "sse3")
+      else(USE_SSE3)
+         list(APPEND _disable_vector_unit_list "sse3")
+      endif(USE_SSE3)
+      if(USE_SSSE3)
+         list(APPEND _enable_vector_unit_list "ssse3")
+      else(USE_SSSE3)
+         list(APPEND _disable_vector_unit_list "ssse3")
+      endif(USE_SSSE3)
+      if(USE_SSE4_1)
+         list(APPEND _enable_vector_unit_list "sse4.1")
+      else(USE_SSE4_1)
+         list(APPEND _disable_vector_unit_list "sse4.1")
+      endif(USE_SSE4_1)
+      if(USE_SSE4_2)
+         list(APPEND _enable_vector_unit_list "sse4.2")
+      else(USE_SSE4_2)
+         list(APPEND _disable_vector_unit_list "sse4.2")
+      endif(USE_SSE4_2)
+      if(USE_SSE4a)
+         list(APPEND _enable_vector_unit_list "sse4a")
+      else(USE_SSE4a)
+         list(APPEND _disable_vector_unit_list "sse4a")
+      endif(USE_SSE4a)
+      if(USE_AVX)
+         list(APPEND _enable_vector_unit_list "avx")
+         # we want SSE intrinsics to result in instructions using the VEX prefix.
+         # Otherwise integer ops (which require the older SSE intrinsics) would
+         # always have a large penalty.
+         list(APPEND _enable_vector_unit_list "sse2avx")
+      else(USE_AVX)
+         list(APPEND _disable_vector_unit_list "avx")
+      endif(USE_AVX)
+      if(USE_XOP)
+         list(APPEND _enable_vector_unit_list "xop")
+      else()
+         list(APPEND _disable_vector_unit_list "xop")
+      endif()
+      if(USE_FMA4)
+         list(APPEND _enable_vector_unit_list "fma4")
+      else()
+         list(APPEND _disable_vector_unit_list "fma4")
+      endif()
+      if(MSVC)
+         # MSVC on 32 bit can select /arch:SSE2 (since 2010 also /arch:AVX)
+         # MSVC on 64 bit cannot select anything (should have changed with MSVC 2010)
+         _my_find(_enable_vector_unit_list "avx" _avx)
+         set(_avx_flag FALSE)
+         if(_avx)
+            AddCompilerFlag("/arch:AVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS CXX_RESULT _avx_flag)
+         endif()
+         if(NOT _avx_flag)
+            _my_find(_enable_vector_unit_list "sse2" _found)
+            if(_found)
+               AddCompilerFlag("/arch:SSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+            endif()
+         endif()
+         foreach(_flag ${_enable_vector_unit_list})
+            string(TOUPPER "${_flag}" _flag)
+            string(REPLACE "." "_" _flag "__${_flag}__")
+            add_definitions("-D${_flag}")
+         endforeach(_flag)
+      elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
+         _my_find(_available_vector_units_list "avx"    _found)
          if(_found)
-            AddCompilerFlag("/arch:SSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-         endif()
-      endif()
-      foreach(_flag ${_enable_vector_unit_list})
-         string(TOUPPER "${_flag}" _flag)
-         string(REPLACE "." "_" _flag "__${_flag}__")
-         add_definitions("-D${_flag}")
-      endforeach(_flag)
-   elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
-      _my_find(_available_vector_units_list "avx"    _found)
-      if(_found)
-         AddCompilerFlag("-xAVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-      else(_found)
-         _my_find(_available_vector_units_list "sse4.2" _found)
-         if(_found)
-            AddCompilerFlag("-xSSE4.2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+            AddCompilerFlag("-xAVX" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
          else(_found)
-            _my_find(_available_vector_units_list "sse4.1" _found)
+            _my_find(_available_vector_units_list "sse4.2" _found)
             if(_found)
-               AddCompilerFlag("-xSSE4.1" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+               AddCompilerFlag("-xSSE4.2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
             else(_found)
-               _my_find(_available_vector_units_list "ssse3"  _found)
+               _my_find(_available_vector_units_list "sse4.1" _found)
                if(_found)
-                  AddCompilerFlag("-xSSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                  AddCompilerFlag("-xSSE4.1" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
                else(_found)
-                  _my_find(_available_vector_units_list "sse3"   _found)
+                  _my_find(_available_vector_units_list "ssse3"  _found)
                   if(_found)
-                     # If the target host is an AMD machine then we still want to use -xSSE2 because the binary would refuse to run at all otherwise
-                     _my_find(_march_flag_list "barcelona" _found)
-                     if(NOT _found)
-                        _my_find(_march_flag_list "k8-sse3" _found)
-                     endif(NOT _found)
+                     AddCompilerFlag("-xSSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                  else(_found)
+                     _my_find(_available_vector_units_list "sse3"   _found)
                      if(_found)
-                        AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                        # If the target host is an AMD machine then we still want to use -xSSE2 because the binary would refuse to run at all otherwise
+                        _my_find(_march_flag_list "barcelona" _found)
+                        if(NOT _found)
+                           _my_find(_march_flag_list "k8-sse3" _found)
+                        endif(NOT _found)
+                        if(_found)
+                           AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                        else(_found)
+                           AddCompilerFlag("-xSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                        endif(_found)
                      else(_found)
-                        AddCompilerFlag("-xSSE3" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-                     endif(_found)
-                  else(_found)
-                     _my_find(_available_vector_units_list "sse2"   _found)
-                     if(_found)
-                        AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                        _my_find(_available_vector_units_list "sse2"   _found)
+                        if(_found)
+                           AddCompilerFlag("-xSSE2" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+                        endif(_found)
                      endif(_found)
                   endif(_found)
                endif(_found)
             endif(_found)
          endif(_found)
-      endif(_found)
-   else() # not MSVC and not ICC => GCC, Clang, Open64
-      foreach(_flag ${_march_flag_list})
-         AddCompilerFlag("-march=${_flag}" CXX_RESULT _good CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-         if(_good)
-            break()
-         endif(_good)
-      endforeach(_flag)
-      foreach(_flag ${_enable_vector_unit_list})
-         AddCompilerFlag("-m${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-      endforeach(_flag)
-      foreach(_flag ${_disable_vector_unit_list})
-         AddCompilerFlag("-mno-${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
-      endforeach(_flag)
+      else() # not MSVC and not ICC => GCC, Clang, Open64
+         foreach(_flag ${_march_flag_list})
+            AddCompilerFlag("-march=${_flag}" CXX_RESULT _good CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+            if(_good)
+               break()
+            endif(_good)
+         endforeach(_flag)
+         foreach(_flag ${_enable_vector_unit_list})
+            AddCompilerFlag("-m${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+         endforeach(_flag)
+         foreach(_flag ${_disable_vector_unit_list})
+            AddCompilerFlag("-mno-${_flag}" CXX_FLAGS Vc_ARCHITECTURE_FLAGS)
+         endforeach(_flag)
+      endif()
    endif()
 endmacro(OptimizeForArchitecture)


fix for cmake 2.6.2

fix for cmake 2.6.2

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -155,16 +155,17 @@
    else(USE_SSE2)
       list(APPEND _disable_vector_unit_list "sse2" "sse3" "ssse3" "sse4.1" "sse4.2" "sse4a")
    endif(USE_SSE2)
-   foreach(_flag IN LISTS _march_flag_list)
+   foreach(_flag ${_march_flag_list})
+      message(STATUS "${_flag}")
       AddCompilerFlag("-march=${_flag}" _good)
       if(_good)
          break()
       endif(_good)
    endforeach(_flag)
-   foreach(_flag IN LISTS _enable_vector_unit_list)
+   foreach(_flag ${_enable_vector_unit_list})
       AddCompilerFlag("-m${_flag}")
    endforeach(_flag)
-   foreach(_flag IN LISTS _disable_vector_unit_list)
+   foreach(_flag ${_disable_vector_unit_list})
       AddCompilerFlag("-mno-${_flag}")
    endforeach(_flag)
 endmacro(OptimizeForArchitecture)


Fixed compilation on MacOS

Fixed compilation on MacOS

--- cmake/dev/check_configuration.cmake
+++ cmake/dev/check_configuration.cmake
@@ -1,7 +1,9 @@
 macro(check_stdcxx)
     # Check C++11
     include(CheckCXXCompilerFlag)
-    if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG)
+    if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANG OR
+        (APPLE AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+        )
         check_cxx_compiler_flag(--std=c++11 SUPPORTS_CXX11)
         if(SUPPORTS_CXX11)
             add_compile_options(--std=c++11)
@@ -17,9 +19,12 @@
                 set(HAVE_CXX0X 0)
             endif()
         endif()
-    else()
+    elseif(MSVC OR MSVC_IDE)
         set(HAVE_CXX11 1)
         set(HAVE_CXX0X 1)
+    else()
+        set(HAVE_CXX11 0)
+        set(HAVE_CXX0X 0)
     endif()
 endmacro()


fix cpplinq name to lowercase.

fix cpplinq name to lowercase.

--- cmake/projects/cpplinq/hunter.cmake
+++ cmake/projects/cpplinq/hunter.cmake
@@ -9,11 +9,11 @@
 include(hunter_pick_scheme)

 hunter_add_version(
-    PACKAGE_NAME CPPLINQ
+    PACKAGE_NAME cpplinq
     VERSION "20150908"
     URL "https://github.com/daminetreg/cpplinq/archive/cpplinq-20150908.tar.gz"
     SHA1 8b8ef7069e2992b069dd023d275bab2cbef54292
 )

 hunter_pick_scheme(DEFAULT url_sha1_cmake)
-hunter_download(PACKAGE_NAME CPPLINQ)
+hunter_download(PACKAGE_NAME cpplinq)


cmake: remove xtensa workaround in Zephyr toolchain code.

Remove xtensa specific workaround as this code is now present in Zephyr
SDK cmake code.

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

--- cmake/toolchain/zephyr/target.cmake
+++ cmake/toolchain/zephyr/target.cmake
@@ -1,9 +1,3 @@
 # SPDX-License-Identifier: Apache-2.0

 include(${ZEPHYR_SDK_INSTALL_DIR}/cmake/zephyr/target.cmake)
-
-# Workaround, FIXME: Waiting for new SDK.
-if("${ARCH}" STREQUAL "xtensa")
-  set(SYSROOT_DIR ${TOOLCHAIN_HOME}/xtensa/${SOC_TOOLCHAIN_NAME}/${SYSROOT_TARGET})
-  set(CROSS_COMPILE ${TOOLCHAIN_HOME}/xtensa/${SOC_TOOLCHAIN_NAME}/${CROSS_COMPILE_TARGET}/bin/${CROSS_COMPILE_TARGET}-)
-endif()


boards: qemu_x86: Remove QEMU options which break eth_e1000 driver

"-machine type=pc-0.14" appears to be the option which leads to
broken PCI emulation in QEMU, where PCI enumeration reports one
IRQ number (11), while actually IRQ 10 is emulated by QEMU.

"-vga none" and "-display none" appear to be just subordinate of
"-machine type=pc-0.14" and are required to get qemu_x86 into
bootable state.

Fixes: #11706

Signed-off-by: Paul Sokolovsky <35cb557f011771c94f127d6fef99f804b62203f5@linaro.org>

--- boards/x86/qemu_x86/board.cmake
+++ boards/x86/qemu_x86/board.cmake
@@ -11,10 +11,7 @@
   -device isa-debug-exit,iobase=0xf4,iosize=0x04
   ${REBOOT_FLAG}
   -nographic
-  -vga none
-  -display none
   -no-acpi
-  -machine type=pc-0.14
   )

 # TODO: Support debug


Fix packageconfig to add local CMake dir for find scripts

--- PackageConfig.cmake
+++ PackageConfig.cmake
@@ -38,6 +38,10 @@
   "@PACKAGE_INIT@\n"
   "\n"
   "set(${CMAKE_PROJECT_NAME}_PREFIX_DIR \${PACKAGE_PREFIX_DIR})\n"
+  "if(CMAKE_VERSION VERSION_LESS 2.8.3) # WAR bug\n"
+  "  get_filename_component(CMAKE_CURRENT_LIST_DIR \${CMAKE_CURRENT_LIST_FILE} PATH)\n"
+  "endif()\n"
+  "list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})\n"
 # reset before using them
   "set(_output_type)\n"
   "set(_out)\n"


Do not override CMake variables from target

In case of externally set variables for CMAKE_CXX_EXECUTABLE etc., they
are overridden again if the capnp_tool target has been found. This
change prevents this by checking if the variables are already set and
sets them from target only if they are empty.

Fixes #950.

Acked-by: Sven Fischer <dd860110a62b19214c4ee03aec0abffecb4e86b8@leiderfischer.de>

--- c++/cmake/CapnProtoMacros.cmake
+++ c++/cmake/CapnProtoMacros.cmake
@@ -30,9 +30,15 @@
   set(tool_depends ${EMPTY_STRING})
   #Use cmake targets available
   if(TARGET capnp_tool)
-    set(CAPNP_EXECUTABLE capnp_tool)
-    GET_TARGET_PROPERTY(CAPNPC_CXX_EXECUTABLE capnpc_cpp CAPNPC_CXX_EXECUTABLE)
-    GET_TARGET_PROPERTY(CAPNP_INCLUDE_DIRECTORY capnp_tool CAPNP_INCLUDE_DIRECTORY)
+    if(NOT CAPNP_EXECUTABLE)
+      set(CAPNP_EXECUTABLE $<TARGET_FILE:capnp_tool>)
+    endif()
+    if(NOT CAPNPC_CXX_EXECUTABLE)
+      get_target_property(CAPNPC_CXX_EXECUTABLE capnpc_cpp CAPNPC_CXX_EXECUTABLE)
+    endif()
+    if(NOT CAPNP_INCLUDE_DIRECTORY)
+      get_target_property(CAPNP_INCLUDE_DIRECTORY capnp_tool CAPNP_INCLUDE_DIRECTORY)
+    endif()
     list(APPEND tool_depends capnp_tool capnpc_cpp)
   endif()
   if(NOT CAPNP_EXECUTABLE)


correcting find openblas cblas.h

correcting find openblas cblas.h

Former-commit-id: 9ae95f20a1110486383c7e1eb485acefa9836e5d

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -74,7 +74,6 @@
     set(BLAS_LIBRARIES     ${BLAS_openblas_LIBRARY})
     set(LAPACK_LIBRARIES   ${BLAS_openblas_LIBRARY})
     set(LAPACK_INCLUDE_DIRS ${BLAS_INCLUDE_DIRS})
-    add_definitions(-DOpenBLAS_AVAILABLE)

 else()
     message(STATUS "OpenBLAS will be installed into ${INSTALL_DIRECTORY}/OpenBLAS on first build.")


- Attempt fixing HTML output

- Attempt fixing HTML output

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -202,8 +202,10 @@
             "${BUNDLE_LIBS}"
             "${ICON_ASSET}" )
     elseif(EMSCRIPTEN)
+        if(COFFEE_GENERATE_HTML)
+            set ( CMAKE_EXECUTABLE_SUFFIX ".html" )
+        endif()
         add_executable(${TARGET} ${SOURCES_MOD})
-        set ( CMAKE_EXECUTABLE_SUFFIX ".html" )
         if(COFFEE_GENERATE_WASM)
             target_compile_options( ${TARGET} PRIVATE
                 -s WASM=1


[CMake] Remove bash-ism in SanitizerLintCheck

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

--- cmake/Modules/SanitizerUtils.cmake
+++ cmake/Modules/SanitizerUtils.cmake
@@ -86,7 +86,7 @@
 # Add target to check code style for sanitizer runtimes.
 if(UNIX)
   add_custom_target(SanitizerLintCheck
-    COMMAND LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
+    COMMAND env LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
       PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}
       COMPILER_RT=${COMPILER_RT_SOURCE_DIR}
       ${SANITIZER_LINT_SCRIPT}


cmake: linker: lld: add missing -no-pie flag

See also
https://github.com/zephyrproject-rtos/zephyr/pull/38903

This is required when building tests for native_posix on ubuntu 22.04 using
clang-14 from the normal deb repository.

Signed-off-by: Christian Taedcke <5dfb12f5b8690cb9c18e955016e7e3173b81d0d8@lemonbeat.com>

--- cmake/linker/lld/target_base.cmake
+++ cmake/linker/lld/target_base.cmake
@@ -11,6 +11,7 @@
   # TOOLCHAIN_LD_FLAGS comes from compiler/clang/target.cmake
   # LINKERFLAGPREFIX comes from linker/lld/target.cmake
   zephyr_ld_options(
+    -no-pie
     ${TOOLCHAIN_LD_FLAGS}
   )


build: normalise the path before use (NFC)

Normalise the path before using it for the inclusion, otherwise Windows
paths can break.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -72,6 +72,7 @@

 # We append the directory in which LLVMConfig.cmake lives. We expect LLVM's
 # CMake modules to be in that directory as well.
+file(TO_CMAKE_PATH ${LLVM_DIR} LLVM_DIR)
 list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
 list(APPEND CMAKE_MODULE_PATH "${SWIFT_CMAKE_DIR}")
 include(AddLLVM)


Added an guard on one of the GNU compiler flags for CUDA, as this was preventing compilation of debug mode on OS X

--- cmake/oskar_compiler_options.cmake
+++ cmake/oskar_compiler_options.cmake
@@ -99,13 +99,15 @@
             list(APPEND CUDA_NVCC_FLAGS_DEBUG --compiler-options;-Wno-long-long;)
             # Disable warning about missing initializers (for CUDA Thrust).
             list(APPEND CUDA_NVCC_FLAGS_DEBUG --compiler-options;-Wno-missing-field-initializers;)
-            # Disable warning about "variable '__f' set but not used".
-            list(APPEND CUDA_NVCC_FLAGS_DEBUG --compiler-options;-Wno-unused-but-set-variable;)
             # Disable warning about "unsigned int* __get_precalculated_matrix(int) defined but not used".
             list(APPEND CUDA_NVCC_FLAGS_DEBUG --compiler-options;-Wno-unused-function;)
             # Ignore warnings from CUDA headers by specifying them as system headers.
             set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -isystem ${CUDA_INCLUDE_DIRS}")
             set(CMAKE_C_FLAGS_DEBUG   "${CMAKE_C_FLAGS_DEBUG} -isystem ${CUDA_INCLUDE_DIRS}")
+            if (NOT APPLE)
+                # Disable warning about "variable '__f' set but not used".
+                list(APPEND CUDA_NVCC_FLAGS_DEBUG --compiler-options;-Wno-unused-but-set-variable;)
+            endif ()
         endif()

         # PTX compiler options


opencv 3.0.0-p9

opencv 3.0.0-p9

fixes for native cmake android toolchain (>= 3.7.1)

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -45,6 +45,17 @@
     SHA1
     ab503105ce7e5415fc77cf44de0b276008be624f
     )
+
+hunter_add_version(
+    PACKAGE_NAME
+    OpenCV
+    VERSION
+    "3.0.0-p9"
+    URL
+    "https://github.com/hunter-packages/opencv/archive/v3.0.0-p9.tar.gz"
+    SHA1
+    b41a71206d0963dcdf934ecf8f0d7ff299c4b57c
+)

 hunter_add_version(
     PACKAGE_NAME


- Attempt again to fix Emscripten unit tests

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -414,7 +414,7 @@
     elseif(EMSCRIPTEN)
         add_test (
             NAME ${TITLE}
-            WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${TARGET}.bundle
+            WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.bundle
             COMMAND nodejs $<TARGET_FILE:${TARGET}>
             )
     else()


[CMAKE] Create a windows installer

[CMAKE] Create a windows installer

Summary:
This diff adds NSIS to the windows package generators, and configure it
to create a windows graphical installer/uninstaller.

The generated installer is very similar to the one from autotools, the
main difference is that this installer asks for licence agreement.

The installed files differ from autotools, which installs a lot of files
in a custom subtree, including documentation on how to build the
software and a lot of things which are unexpected output from a
graphical installer. This one only installs the files from the package,
identical to what is distributed as part of a release.

Depends on D4284.

Test Plan:
  mkdir buildcmake && cd buildcmake
  cmake -GNinja .. -DBUILD_BITCOIN_SEEDER=OFF \
    -DCMAKE_TOOLCHAIN_FILE=../cmake/platforms/Win64.cmake
  ninja package
Check a `bitcoin-abc-<version>-x86_64-w64-mingw32.exe` installer is
created.
Run the installer, check all the steps are correct.
After installation run `Bitcoin ABC` and `Bitcoin ABC (testnet)` from
the start menu folder.
Uninstall the software using then windows settings panel and check all
the files are deleted.

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, deadalnix, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D4274

--- cmake/modules/PackageOptions.cmake
+++ cmake/modules/PackageOptions.cmake
@@ -12,7 +12,7 @@

 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 	set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/pixmaps/nsis-header.bmp")
-	set(CPACK_GENERATOR "ZIP")
+	set(CPACK_GENERATOR "NSIS;ZIP")
 else()
 	set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share/pixmaps/bitcoin-abc128.png")
 	set(CPACK_GENERATOR "TGZ")
@@ -21,3 +21,39 @@
 # CPack source package options
 set(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}")
 set(CPACK_SOURCE_GENERATOR "TGZ")
+
+# CPack NSIS installer options
+Include(InstallationHelper)
+set(CPACK_NSIS_EXECUTABLES_DIRECTORY "${CMAKE_INSTALL_BINDIR}")
+set(_nsis_bitcoin_qt "bitcoin-qt.exe")
+
+set(CPACK_NSIS_URL_INFO_ABOUT "${BITCOINABC_HOMEPAGE_URL}")
+set(CPACK_NSIS_CONTACT "info@bitcoinabc.org")
+
+set(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/share/pixmaps/bitcoin-abc.ico")
+set(CPACK_NSIS_MUI_UNIICON "${CPACK_NSIS_MUI_ICON}")
+set(CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP "${CMAKE_SOURCE_DIR}/share/pixmaps/nsis-wizard.bmp")
+set(CPACK_NSIS_MUI_UNWELCOMEFINISHPAGE_BITMAP "${CPACK_NSIS_MUI_WELCOMEFINISHPAGE_BITMAP}")
+set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${_nsis_bitcoin_qt}")
+set(CPACK_NSIS_INSTALLED_ICON_NAME "${CMAKE_INSTALL_BINDIR}/${_nsis_bitcoin_qt}")
+
+set(CPACK_NSIS_COMPRESSOR "/SOLID lzma")
+set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
+set(CPACK_NSIS_DISPLAY_NAME "${PACKAGE_NAME}")
+
+macro(add_start_menu_link LINK_NAME EXE PARAMETERS ICON_EXE ICON_INDEX)
+	list(APPEND CPACK_NSIS_CREATE_ICONS_EXTRA
+		"CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${LINK_NAME}.lnk' '$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${EXE}' '${PARAMETERS}' '$INSTDIR\\\\${CMAKE_INSTALL_BINDIR}\\\\${ICON_EXE}' '${ICON_INDEX}'"
+	)
+	list(APPEND CPACK_NSIS_DELETE_ICONS_EXTRA
+		"Delete '$SMPROGRAMS\\\\$START_MENU\\\\${LINK_NAME}.lnk'"
+	)
+endmacro()
+
+set(CPACK_NSIS_MENU_LINKS "${CMAKE_INSTALL_BINDIR}/${_nsis_bitcoin_qt}" "Bitcoin ABC")
+add_start_menu_link("${PACKAGE_NAME} (testnet)"
+	"${_nsis_bitcoin_qt}"
+	"-testnet"
+	"${_nsis_bitcoin_qt}"
+	1
+)


Updated versions for the 5.9.0 release.

Updated versions for the 5.9.0 release.

svn path=/trunk/; revision=8231

--- cmake/modules/plplot_version.cmake
+++ cmake/modules/plplot_version.cmake
@@ -4,11 +4,11 @@

 # Version data that need review and possible modification for each release.

-set(VERSION 5.8.0)
+set(VERSION 5.9.0)

 # CPack version numbers for release tarball name.
 set(CPACK_PACKAGE_VERSION_MAJOR 5)
-set(CPACK_PACKAGE_VERSION_MINOR 8)
+set(CPACK_PACKAGE_VERSION_MINOR 9)
 set(CPACK_PACKAGE_VERSION_PATCH 0)

 # PLplot library version information.
@@ -34,7 +34,7 @@
 set(csironn_VERSION ${csironn_SOVERSION}.0.1)

 set(plplot_SOVERSION 9)
-set(plplot_VERSION ${plplot_SOVERSION}.4.0)
+set(plplot_VERSION ${plplot_SOVERSION}.5.0)

 set(plplotcxx_SOVERSION 9)
 set(plplotcxx_VERSION ${plplotcxx_SOVERSION}.3.0)


OpenCV is cacheable

OpenCV is cacheable

--- cmake/projects/OpenCV/hunter.cmake
+++ cmake/projects/OpenCV/hunter.cmake
@@ -10,6 +10,7 @@
 # Load used modules
 include(hunter_add_package)
 include(hunter_add_version)
+include(hunter_cacheable)
 include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)
@@ -113,4 +114,5 @@
 #     * libexample_A.a
 #     * libexample_Ad.a

+hunter_cacheable(OpenCV)
 hunter_download(PACKAGE_NAME OpenCV)


Fix #10: CMake 3.4.0: <FLAGS> no longer includes <INCLUDES>

--- cmake-d/CMakeDInformation.cmake
+++ cmake-d/CMakeDInformation.cmake
@@ -220,6 +220,7 @@
 # <OBJECT>
 # <LINK_LIBRARIES>
 # <FLAGS>
+# <INCLUDES> (cmake 3.4.0 or later)
 # <LINK_FLAGS>

 # D compiler information
@@ -261,8 +262,13 @@

 # compile a D file into an object file
 if(NOT CMAKE_D_COMPILE_OBJECT)
-  set(CMAKE_D_COMPILE_OBJECT
-   "<CMAKE_D_COMPILER> <FLAGS> ${CMAKE_D_DASH_O}<OBJECT> -c <SOURCE>")
+  if(CMAKE_VERSION VERSION_LESS 3.4.0)
+    set(CMAKE_D_COMPILE_OBJECT
+     "<CMAKE_D_COMPILER> <FLAGS> ${CMAKE_D_DASH_O}<OBJECT> -c <SOURCE>")
+  else()
+    set(CMAKE_D_COMPILE_OBJECT
+     "<CMAKE_D_COMPILER> <FLAGS> <INCLUDES> ${CMAKE_D_DASH_O}<OBJECT> -c <SOURCE>")
+  endif()
 endif()

 if(NOT CMAKE_D_LINK_EXECUTABLE)


cmake: fix pkgconfig boost deps

cmake: fix pkgconfig boost deps

Libraries from pkgconfig pc file Libs variable are
directly injected into the g++ command.

Different versions of boost distros and cmake may
set different incompatible values to the components
libraries variables Boost_XXX_LIBRARY.

Pkgconfig expects them to contain final target library.

This patch:
- disables boost cmake cache to force cmake/FindBoost

The difference was observed between:
- Fedora 31, cmake 3.14.5, boost 1.69.0-9-fc31
- Arch Linux 5.4.2-arch1-1, cmake 3.16.1-1, boost 1.71.0-4

cmake-boost may return to Boost_{component}_LIBRARY:
- /usr/lib64/libboost_filesystem.so (f31)
- Boost::filesystem (arch)

Signed-off-by: Ivan Prisyazhnyy <a15f8b81a160b4eebe5c84e9e3b65c87b9b2f18e@scylladb.com>
Message-Id: <20191217171253.211569-1-a15f8b81a160b4eebe5c84e9e3b65c87b9b2f18e@scylladb.com>

--- cmake/SeastarDependencies.cmake
+++ cmake/SeastarDependencies.cmake
@@ -27,6 +27,12 @@
 #
 # The "real" FIND_PACKAGE invocation for Boost is inside SEASTAR_FIND_DEPENDENCIES.
 #
+
+# Be consistent in results from FindBoost.cmake.
+# This is required because cmake-boost may return to Boost_{component}_LIBRARY:
+# - /usr/lib64/libboost_filesystem.so
+# - Boost::filesystem
+set (Boost_NO_BOOST_CMAKE ON)

 # This is the minimum version of Boost we need the CMake-bundled `FindBoost.cmake` to know about.
 find_package (Boost 1.64 MODULE QUIET COMPONENTS filesystem)


Nudge feta hacks back into to working condition.

--- cmake/ThrustCompilerHacks.cmake
+++ cmake/ThrustCompilerHacks.cmake
@@ -79,6 +79,8 @@
   set(CMAKE_CUDA17_STANDARD__HAS_FULL_SUPPORT TRUE)
   set_property(GLOBAL PROPERTY CMAKE_CUDA17_KNOWN_FEATURES)

+  include(Internal/FeatureTesting)
+  include(Compiler/CMakeCommonCompilerMacros)
   cmake_record_cuda_compile_features()

   set(CMAKE_CUDA_COMPILE_FEATURES


fix file name in copy command

fix file name in copy command

--- cmake/External_uriparser.cmake
+++ cmake/External_uriparser.cmake
@@ -4,7 +4,7 @@
   URL_MD5 c5cf6b3941d887deb7defc2a86c40f1d
   BINARY_DIR ${CMAKE_BINARY_DIR}/URIPARSER/build
   DOWNLOAD_DIR ${DOWNLOAD_LOCATION}
-  PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/UriParser_cmake_lists_txt ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER/
+  PATCH_COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/cmake/UriParser_cmake_lists_txt ${CMAKE_BINARY_DIR}/URIPARSER/src/URIPARSER/CMakeLists.txt
   CMAKE_CACHE_ARGS
   -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}/URIPARSER
   -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}


Updated cmake module for python testing to search for libs instead of requiring a manual addition of them in the event the system requires them.

git-svn-id: 39e099a8ed5324aded674b764a67f7a08796d9a7@2745 662fdd30-d327-0410-a531-f549c87e1e9e

--- cmake/TestForPythonEmbed.cmake
+++ cmake/TestForPythonEmbed.cmake
@@ -4,6 +4,11 @@
 #  PYTHON_EMBEDABLE - True if embedable

 find_package(PythonLibs)
+# Some systems require these libs to be explicitly be added for the test
+find_library(DL dl)
+find_library(MATH m)
+find_library(PTHREAD pthread)
+find_library(UTIL util)

 if(PYTHONLIBS_FOUND)
 	MESSAGE(STATUS "Checking if Python is Embedable")
@@ -11,7 +16,7 @@
 	# If on Slackware, uncomment the next line to fix a missing library issue
 	# As of 11/22/2009 this is needed for Slackware 13
 	# SET(PYTHON_LIBRARIES ${PYTHON_LIBRARIES} -ldl -lm -lpthread -lutil)
-	SET(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES})
+	SET(CMAKE_REQUIRED_LIBRARIES ${PYTHON_LIBRARIES} ${DL} ${MATH} ${PTHREAD} ${UTIL})
 	CHECK_C_SOURCE_COMPILES(
 "#include <Python.h>
 int main(int argc, char *argv[]) {


remove find_package(kdewin)

remove find_package(kdewin)

svn path=/trunk/KDE/kdepim/; revision=916607

--- cmake/modules/FindAssuan.cmake
+++ cmake/modules/FindAssuan.cmake
@@ -75,12 +75,6 @@

   else()

-    # is this needed, of just unreflected cut'n'paste?
-    # this isn't a KDE library, after all!
-    if( NOT KDEWIN_FOUND )
-      find_package( KDEWIN REQUIRED )
-    endif()
-
     set( ASSUAN_FOUND         false )
     set( ASSUAN_VANILLA_FOUND false )
     #set( ASSUAN_GLIB_FOUND    false )


fix finding of vlc and vlccore on msvc

fix finding of vlc and vlccore on msvc

--- cmake/modules/FindLIBVLC.cmake
+++ cmake/modules/FindLIBVLC.cmake
@@ -27,28 +27,25 @@
   "/usr/local/include/vlc"
   #mingw
   c:/msys/local/include
-  NO_DEFAULT_PATH
   )
 FIND_PATH(LIBVLC_INCLUDE_DIR PATHS "${CMAKE_INCLUDE_PATH}/vlc" NAMES vlc.h)

 #Put here path to custom location
 #example: /home/user/vlc/lib etc..
-FIND_LIBRARY(LIBVLC_LIBRARY NAMES vlc PATHS
+FIND_LIBRARY(LIBVLC_LIBRARY NAMES vlc libvlc PATHS
   "$ENV{LIBVLC_LIBRARY_PATH}"
   "$ENV{LIB_DIR}/lib"
   #mingw
   c:/msys/local/lib
-  NO_DEFAULT_PATH
   )
-FIND_LIBRARY(LIBVLC_LIBRARY NAMES vlc)
-FIND_LIBRARY(LIBVLCCORE_LIBRARY NAMES vlccore PATHS
+FIND_LIBRARY(LIBVLC_LIBRARY NAMES vlc libvlc)
+FIND_LIBRARY(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore PATHS
   "$ENV{LIBVLC_LIBRARY_PATH}"
   "$ENV{LIB_DIR}/lib"
   #mingw
   c:/msys/local/lib
-  NO_DEFAULT_PATH
   )
-FIND_LIBRARY(LIBVLCCORE_LIBRARY NAMES vlccore)
+FIND_LIBRARY(LIBVLCCORE_LIBRARY NAMES vlccore libvlccore)

 IF (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)
    SET(LIBVLC_FOUND TRUE)


Fix path to 1010-install-msilib.patch

Fix path to 1010-install-msilib.patch

Must've been a copy-paste error.

--- cmake/modules/FindPython.cmake
+++ cmake/modules/FindPython.cmake
@@ -107,7 +107,7 @@
 				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/0960-mingw-w64-XP3-compat-GetProcAddress-GetFinalPathNameByHandleW.patch
 				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch
 				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/0980-mingw-readline-features-skip.patch
-				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/1010-install-msilib.patch.patch
+				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/1010-install-msilib.patch
 				COMMAND ${GIT_EXECUTABLE} apply --directory=${PATCH_TARGET} ${PATCH_SOURCE}/mingw-w64-python3/1500-mingw-w64-dont-look-in-DLLs-folder-for-python-dll.patch
 			)
 			ExternalProject_Add(Python


[backport#17205] ci: Enable address sanitizer (ASan) stack-use-after-return checking

Summary:
8d22ab0e503ccaa464cbecd94d1059dbc5a61f4a ci: Enable address sanitizer (ASan) stack-use-after-return checking (practicalswift)

Pull request description:

  Enable address sanitizer (ASan) stack-use-after-return checking (`detect_stack_use_after_return=1`).

  Example:

  ```
  #include <iostream>
  #include <string>

  const std::string& get_string(int i) {
      return std::to_string(i);
  }

  int main() {
      std::cout << get_string(41) << "\n";
  }
  ```

  Without address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ./stack-use-after-return

  $
  ```

  With address sanitizer (ASan) stack-use-after-return checking:

  ```
  $ ASAN_OPTIONS="detect_stack_use_after_return=1" ./stack-use-after-return
  =================================================================
  ==10400==ERROR: AddressSanitizer: stack-use-after-return on address 0x7f7fa0400030 at pc 0x00000049d2cc bp 0x7ffcbd617070 sp 0x7ffcbd616820
  READ of size 2 at 0x7f7abbecd030 thread T0
      #0 0x439781 in fwrite
      #1 0x7f7ac0504cb3 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x113cb3)
      #2 0x4f9b5f in main stack-use-after-return.cpp:9:15
      #3 0x7f7abf440b96 in __libc_start_main
      #4 0x41bbc9 in _start
  …
  $
  ```

---

Backport of Core [[https://github.com/bitcoin/bitcoin/pull/17205 | PR17205]]

Test Plan:
  cmake -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DENABLE_SANITIZERS=address
  ninja all check check-functional

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D8756

--- cmake/modules/Sanitizers.cmake
+++ cmake/modules/Sanitizers.cmake
@@ -41,6 +41,7 @@
 	set(SAN_SUPP_DIR "${CMAKE_SOURCE_DIR}/test/sanitizer_suppressions")
 	if("address" IN_LIST ARGN)
 		add_test_environment(ASAN_OPTIONS "malloc_context_size=0:$ENV{ASAN_OPTIONS}")
+		add_test_environment(ASAN_OPTIONS "detect_stack_use_after_return=1:$ENV{ASAN_OPTIONS}")
 		add_test_environment(LSAN_OPTIONS "suppressions=${SAN_SUPP_DIR}/lsan:$ENV{LSAN_OPTIONS}")
 	endif()
 	if("thread" IN_LIST ARGN)


cmake: fix <keys> argument in import_kconfig()

The signature of import_kconfig() take two mandatory arguments and one
optional:
> import_kconfig(<prefix> <kconfig_fragment> [<keys>])

but has been implemented in such a way that it loops all arguments after
the two mandatory args and sets the same list on those.

Fix this error by only setting the created variables on the third and
optional argument if it exists.

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

--- cmake/modules/extensions.cmake
+++ cmake/modules/extensions.cmake
@@ -1461,9 +1461,13 @@
     list(APPEND keys "${CONF_VARIABLE_NAME}")
   endforeach()

-  foreach(outvar ${ARGN})
-    set(${outvar} "${keys}" PARENT_SCOPE)
-  endforeach()
+  if(ARGC GREATER 2)
+    if(ARGC GREATER 3)
+    # Two mandatory arguments and one optional, anything after that is an error.
+      message(FATAL_ERROR "Unexpected argument after '<keys>': import_kconfig(... ${ARGV3})")
+    endif()
+    set(${ARGV2} "${keys}" PARENT_SCOPE)
+  endif()
 endfunction()

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


Endless bugs

Endless bugs

Former-commit-id: b20258887885066a4b88d2010159701a14c4f3d5

--- cmake_modules/Fetch_HDF5.cmake
+++ cmake_modules/Fetch_HDF5.cmake
@@ -101,24 +101,24 @@
 endif()

 set_target_properties(hdf5::hdf5 PROPERTIES
-        IMPORTED_LOCATION ${HDF5_LIBRARIES}
+        IMPORTED_LOCATION "${HDF5_LIBRARIES}"
         INTERFACE_LINK_LIBRARIES "${HDF5_LDFLAGS};${HDF5_LINKER_FLAGS}"
-        INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR})
+        INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}")

 set_target_properties(hdf5::hdf5_hl PROPERTIES
-        IMPORTED_LOCATION ${HDF5_HL_LIBRARIES}
+        IMPORTED_LOCATION "${HDF5_HL_LIBRARIES}"
         INTERFACE_LINK_LIBRARIES hdf5::hdf5
-        INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR})
+        INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}")

 set_target_properties(hdf5::hdf5_cpp PROPERTIES
-        IMPORTED_LOCATION ${HDF5_CXX_LIBRARIES}
+        IMPORTED_LOCATION "${HDF5_CXX_LIBRARIES}"
         INTERFACE_LINK_LIBRARIES "hdf5::hdf5;hdf5::hdf5_hl"
-        INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR})
+        INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}")

 set_target_properties(hdf5::hdf5_hl_cpp PROPERTIES
-        IMPORTED_LOCATION ${HDF5_HL_CXX_LIBRARIES}
+        IMPORTED_LOCATION "${HDF5_HL_CXX_LIBRARIES}"
         INTERFACE_LINK_LIBRARIES "hdf5::hdf5;hdf5::hdf5_hl;hdf5::hdf5_cpp"
-        INCLUDE_DIRECTORIES ${HDF5_INCLUDE_DIR})
+        INCLUDE_DIRECTORIES "${HDF5_INCLUDE_DIR}")

 target_link_libraries(${PROJECT_NAME} PRIVATE hdf5::hdf5)


Fix libhs amalgamation issues with UTF-8 characters

--- cmake/AmalgamateSourceFiles.cmake
+++ cmake/AmalgamateSourceFiles.cmake
@@ -26,7 +26,7 @@
 file(REMOVE "${DEST}")

 get_filename_component(src_dir "${SRC}" DIRECTORY)
-file(STRINGS "${SRC}" lines)
+file(STRINGS "${SRC}" lines ENCODING "UTF-8")

 foreach(line IN LISTS lines)
     if(line MATCHES "#include \"([a-zA-Z0-9_\\-]+\\.[a-zA-Z]+)\"")


cmake: add /usr/local/lib on Apple platform

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -384,3 +384,7 @@
     set(HAVE_FP16 1)
   endif()
 endif()
+
+if(APPLE AND NOT CMAKE_CROSSCOMPILING AND NOT DEFINED ENV{LDFLAGS} AND EXISTS "/usr/local/lib")
+  link_directories("/usr/local/lib")
+endif()


cmake: disable warning C4127 for MSVS < 2015

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -341,8 +341,13 @@
   string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
   string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS_DEBUG}")

-  if(NOT ENABLE_NOISY_WARNINGS AND MSVC_VERSION EQUAL 1400)
-    ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267)
+  if(NOT ENABLE_NOISY_WARNINGS)
+    if(MSVC_VERSION EQUAL 1400)
+      ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267)
+    endif()
+    if(MSVC_VERSION LESS 1900) # MSVS2015
+      ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127) # warning C4127: conditional expression is constant
+    endif()
   endif()

   # allow extern "C" functions throw exceptions


works better if you spell it right

works better if you spell it right

--- cmake/modules/FindLibCrypto.cmake
+++ cmake/modules/FindLibCrypto.cmake
@@ -84,6 +84,6 @@
         set_target_properties(LibCrypto::Crypto PROPERTIES
             IMPORTED_LINK_INTERFACE_LANGUAGES "C"
             IMPORTED_LOCATION "${LibCrypto_LIBRARY}")
-        add_depdendencies(LibCrypto::Crypto pthread)
+        add_dependencies(LibCrypto::Crypto pthread)
     endif()
 endif()


[modules] Do not put deprecated headers in the modules.

This avoids generating warnings which in turn cause roottest failures.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -446,6 +446,10 @@
                         TException.h ThreadLocalStorage.h ROOT/TThreadExecutor.hxx
                         TBranchProxyTemplate.h TGLIncludes.h TGLWSIncludes.h
                         snprintf.h strlcpy.h")
+
+   # Deprecated header files.
+  set (excluded_headers "${excluded_headers} TSelectorCint.h")
+
   set(modulemap_entry "module \"${library}\" {")
   # For modules GCocoa and GQuartz we need objc context.
   if (${library} MATCHES "(libGCocoa|libGQuartz)\..*")


Disable deprecation warning on gcc

Disable deprecation warning on gcc

--- cmake/EnableCompilerWarnings.cmake
+++ cmake/EnableCompilerWarnings.cmake
@@ -197,6 +197,7 @@
         else()
             list(APPEND CMAKE_COMPILER_WARNINGS
                 -Wno-missing-field-initializers
+                -Wno-deprecated-declarations
             )
         endif()


Updated cmake conan integration and fixed compiler propagation on non-fresh CMake configuration

--- cmake/SetupDependenciesConan.cmake
+++ cmake/SetupDependenciesConan.cmake
@@ -52,9 +52,9 @@
     # Download cmake-conan integrator
     if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan/conan.cmake")
         message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
-        file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/release/0.17/conan.cmake"
+        file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
                 "${CMAKE_BINARY_DIR}/conan/conan.cmake"
-                EXPECTED_HASH MD5=52a255a933397fdce3d0937f9c737e98
+                EXPECTED_HASH MD5=81d5eab13a49f43527e35a90bfac6960
                 TLS_VERIFY ON)
     endif()
     include(${CMAKE_BINARY_DIR}/conan/conan.cmake)
@@ -80,6 +80,8 @@
             ENV libunwind:LDFLAGS=-fcommon
             ENV libunwind:CXXFLAGS=-fcommon
             ENV libunwind:CFLAGS=-fcommon
+            ENV CC=${CMAKE_C_COMPILER} # Fixes issue with CMake not detecting the right compiler when not building from scratch
+            ENV CXX=${CMAKE_CXX_COMPILER} # Fixes issue with CMake not detecting the right compiler when not building from scratch
             ${DMRG_CONAN_OPTIONS}
             PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
     )


Fixed build order

Fixed build order

Former-commit-id: cb4a4f3871a4af43747ff16b2a6d3c6bdb479752

--- cmake_modules/Fetch_Arpackpp.cmake
+++ cmake_modules/Fetch_Arpackpp.cmake
@@ -11,16 +11,22 @@
         NAMES ardsnsym.h
         PATHS /usr/include/arpack++ /usr/include /usr/local/
         )
+message(STATUS "Arpack++ library found in system: ${ARPACKPP_LIBRARIES}")
+message(STATUS "Arpack++ include found in system: ${ARPACKPP_INCLUDE_DIR}")
+message(WARNING
+"Due to a bug, older versions of Arpack++ require -fpermissive flag to compile. \
+Therefore, local installations of Arpack++ will be ignored in favor of the most resent version.")

-if(ARPACKPP_LIBRARIES AND ARPACKPP_INCLUDE_DIR)
-    message(STATUS "Arpack++ library found in system: ${ARPACKPP_LIBRARIES}")
-    message(STATUS "Arpack++ include found in system: ${ARPACKPP_INCLUDE_DIR}")
-    message(WARNING "Due to a bug, older versions of Arpack++ require -fpermissive flag to compile. This is now enabled for compatibility.")
+
+
+
+if (false)
+#if(ARPACKPP_LIBRARIES AND ARPACKPP_INCLUDE_DIR)
+
     add_library(arpackpp UNKNOWN IMPORTED)
     set_target_properties(arpackpp PROPERTIES
             IMPORTED_LOCATION "${ARPACKPP_LIBRARIES}"
-            INCLUDE_DIRECTORIES "${ARPACKPP_INCLUDE_DIR}"
-            COMPILE_FLAGS -fpermissive)
+            INCLUDE_DIRECTORIES "${ARPACKPP_INCLUDE_DIR}")
     target_link_libraries(${PROJECT_NAME} PRIVATE arpackpp)

 else()


Add a necessary include path for building with mesa.

Reported by Lv Meng.

Signed-off-by: Zhigang Gong <e04a7b9b70b1e4c6318cf117dcd1a9056e14b97a@intel.com>

--- CMake/FindEGL.cmake
+++ CMake/FindEGL.cmake
@@ -45,6 +45,7 @@
                          ${MESA_SOURCE_PREFIX}/include
                          ${MESA_SOURCE_PREFIX}/src/mapi
                          ${MESA_SOURCE_PREFIX}/src/mesa/drivers/dri/i965/
+                         ${MESA_SOURCE_PREFIX}/src/mesa/drivers/dri/intel/
                          ${MESA_SOURCE_PREFIX}/src/mesa/drivers/dri/common/)
 SET(MESA_SOURCE_FOUND 1 CACHE STRING "Set to 1 if mesa source code is found, 0 otherwise")
 ELSE(MESA_SOURCE_PREFIX)


vigra: Uncomment test step.

vigra: Uncomment test step.

--- vigra.cmake
+++ vigra.cmake
@@ -78,7 +78,7 @@
         -DCMAKE_CXX_FLAGS=-pthread
         -DCMAKE_CXX_LINK_FLAGS=-pthread
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
-    #TEST_COMMAND        ${FLYEM_ENV_STRING} make check
+    TEST_COMMAND        ${FLYEM_ENV_STRING} make check
     INSTALL_COMMAND     ${FLYEM_ENV_STRING} make install
 )


Fix Macros.c: target link libraries for tests

o) The ".lib" extension must not be written
o) gmock_main and gtest_main are needed as well.

--- Macros.cmake
+++ Macros.cmake
@@ -1,5 +1,5 @@
 macro(CreateTestProj name fileName)
     add_executable(${name} ${fileName})
-    target_link_libraries(${name} gmock.lib gtest.lib XLib)
+    target_link_libraries(${name} gmock gmock_main gtest gtest_main XLib)
     add_test(NAME ${name} COMMAND ${name})
 endmacro(CreateTestProj)


BUG: change order of QWT find libraries to aviod to link with qwt-qt4

--- CMake/FindQwt.cmake
+++ CMake/FindQwt.cmake
@@ -104,7 +104,7 @@

 find_library ( QWT_LIBRARY
-  NAMES qwt qwt${QWT_MAJOR_VERSION} qwt-qt5
+  NAMES qwt-qt5 qwt6-qt5 qwt qwt6
   HINTS ${QT_LIBRARY_DIR}
 )


Bump version for testing

Bump version for testing

--- CMake/version.cmake
+++ CMake/version.cmake
@@ -1,3 +1,3 @@
 set (VV_VERSION_MAJOR 3)
 set (VV_VERSION_MINOR 0)
-set (VV_VERSION_PATCH 10)
+set (VV_VERSION_PATCH 11)


Update for Qt 5.2.1

Update for Qt 5.2.1

--- CMakeModules/install/windows.cmake
+++ CMakeModules/install/windows.cmake
@@ -188,7 +188,6 @@
 	${QT_DLL_DIR}/Qt5PrintSupport.dll
 	${QT_DLL_DIR}/Qt5Quick.dll
 	${QT_DLL_DIR}/Qt5Qml.dll
-	${QT_DLL_DIR}/Qt5V8.dll
 	${QT_DLL_DIR}/Qt5Sensors.dll
 	${QT_DLL_DIR}/Qt5CLucene.dll
     DESTINATION bin
@@ -217,7 +216,6 @@
 	${QT_DLL_DIR}/Qt5PrintSupportd.dll
 	${QT_DLL_DIR}/Qt5Quickd.dll
 	${QT_DLL_DIR}/Qt5Qmld.dll
-	${QT_DLL_DIR}/Qt5V8d.dll
 	${QT_DLL_DIR}/Qt5Sensorsd.dll
 	${QT_DLL_DIR}/Qt5CLucened.dll
     DESTINATION bin


- bump FOTS snapshot to April 9th: 12 test cases added, all of them passing.

--- test/fots/ImportFOTS.cmake
+++ test/fots/ImportFOTS.cmake
@@ -19,7 +19,7 @@

 # Change this to publish updated FOTS archives
-SET (FOTS_ARCHIVE "FOTS_290313.tgz")
+SET (FOTS_ARCHIVE "FOTS_090413.tgz")

 # Change this to modify which elements in FOTS driver results are output
 # as CDATA


update triplet with v140 tooset

update triplet with v140 tooset

--- contrib/cmake/vcpkg_extra_triplets/x86-windows-mega.cmake
+++ contrib/cmake/vcpkg_extra_triplets/x86-windows-mega.cmake
@@ -1,6 +1,6 @@

 set(VCPKG_VISUAL_STUDIO_PATH "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional")
-set(VCPKG_PLATFORM_TOOLSET v140)
+set(VCPKG_PLATFORM_TOOLSET v141)

 set(VCPKG_TARGET_ARCHITECTURE x86)