Update libsodium to 1.0.16

Update libsodium to 1.0.16

--- cmake/projects/libsodium/hunter.cmake
+++ cmake/projects/libsodium/hunter.cmake
@@ -18,6 +18,18 @@
     00a999629f1f8f500cef29818135f8f889f44e41
 )

+
+hunter_add_version(
+    PACKAGE_NAME
+    libsodium
+    VERSION
+    "1.0.16"
+    URL
+    "https://github.com/jedisct1/libsodium/archive/1.0.16.tar.gz"
+    SHA1
+    18a2c5758aaf60c0abbc0e6a21f63df80faccfc6
+)
+
 hunter_configuration_types(libsodium CONFIGURATION_TYPES Release)
 if(MSVC)
     hunter_pick_scheme(DEFAULT url_sha1_libsodium_msbuild)


refs #4871 fix finding of gcov47

refs #4871 fix finding of gcov47

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

--- cmake_modules/TokuSetupCompiler.cmake
+++ cmake_modules/TokuSetupCompiler.cmake
@@ -30,7 +30,7 @@
   if (NOT CMAKE_CXX_COMPILER_ID MATCHES GNU)
     message(FATAL_ERROR "Must use the GNU compiler to compile for test coverage.")
   endif ()
-  find_path(COVERAGE_COMMAND NAMES gcov47 gcov)
+  find_program(COVERAGE_COMMAND NAMES gcov47 gcov)
 endif (USE_GCOV)

 include(CheckCCompilerFlag)


Fix failing mingw32 build when there is space char in project path. (#2736)

--- Source/ThirdParty/SDL/cmake/sdlchecks.cmake
+++ Source/ThirdParty/SDL/cmake/sdlchecks.cmake
@@ -1068,7 +1068,7 @@
       set(HAVE_SDL_JOYSTICK TRUE)
       file(GLOB HIDAPI_SOURCES ${SDL2_SOURCE_DIR}/src/joystick/hidapi/*.c)
       set(SOURCE_FILES ${SOURCE_FILES} ${HIDAPI_SOURCES})
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I${SDL2_SOURCE_DIR}/src/hidapi/hidapi")
+      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBUSB_CFLAGS} -I\"${SDL2_SOURCE_DIR}/src/hidapi/hidapi\"")
       if(NOT HIDAPI_SKIP_LIBUSB)
         set(SOURCE_FILES ${SOURCE_FILES} ${SDL2_SOURCE_DIR}/src/hidapi/libusb/hid.c)
         list(APPEND EXTRA_LIBS ${LIBUSB_LIBS})


chainging default value of ispc debug flag

--- components/ospcommon/cmake/ispc.cmake
+++ components/ospcommon/cmake/ispc.cmake
@@ -110,7 +110,7 @@
   ENDIF()

   #CAUTION: -O0/1 -g with ispc seg faults
-  SET(ISPC_FLAGS_DEBUG -O2 -g CACHE STRING "ISPC Debug flags")
+  SET(ISPC_FLAGS_DEBUG -g CACHE STRING "ISPC Debug flags")
   MARK_AS_ADVANCED(ISPC_FLAGS_DEBUG)
   SET(ISPC_FLAGS_RELEASE -O3 CACHE STRING "ISPC Release flags")
   MARK_AS_ADVANCED(ISPC_FLAGS_RELEASE)


CTest: add Vc version string to build name

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

--- test.cmake
+++ test.cmake
@@ -267,6 +267,13 @@

 # Build the CTEST_BUILD_NAME string
 ################################################################################
+file(STRINGS "${CTEST_SOURCE_DIRECTORY}/include/Vc/version.h"
+   Vc_VERSION_STRING
+   REGEX "#define +Vc_VERSION_STRING "
+   )
+string(REGEX REPLACE "\"$" "" Vc_VERSION_STRING "${Vc_VERSION_STRING}")
+string(REGEX REPLACE "^.*\"" "" Vc_VERSION_STRING "${Vc_VERSION_STRING}")
+
 if(DEFINED target_architecture)
    set(tmp ${target_architecture})
 else()
@@ -286,7 +293,7 @@
 else()
    set(build_type_short "${build_type}")
 endif()
-string(STRIP "${git_branch} ${COMPILER_VERSION} ${CXXFLAGS} ${build_type_short} ${tmp} ${chip} ${os_ident}" CTEST_BUILD_NAME)
+string(STRIP "${Vc_VERSION_STRING} ${git_branch} ${COMPILER_VERSION} ${CXXFLAGS} ${build_type_short} ${tmp} ${chip} ${os_ident}" CTEST_BUILD_NAME)
 if(DEFINED subset)
    set(CTEST_BUILD_NAME "${CTEST_BUILD_NAME} ${subset}")
 endif()


in a mingw environment, check CXX env var for g++

--- test.cmake
+++ test.cmake
@@ -14,8 +14,14 @@
 execute_process(COMMAND uname -m OUTPUT_VARIABLE chip OUTPUT_STRIP_TRAILING_WHITESPACE)
 string(TOLOWER "${chip}" chip)
 if(arch MATCHES "mingw")
-   execute_process(COMMAND cl /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
-   string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+   if("$ENV{CXX}" MATCHES "g\\+\\+")
+      execute_process(COMMAND "$ENV{CXX}" --version OUTPUT_VARIABLE COMPILER_VERSION ERROR_VARIABLE COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REPLACE "\n" ";" COMPILER_VERSION "${COMPILER_VERSION}")
+      list(GET COMPILER_VERSION 0 COMPILER_VERSION)
+   else()
+      execute_process(COMMAND cl /nologo -EP "${CTEST_SOURCE_DIRECTORY}/cmake/msvc_version.c" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE COMPILER_VERSION)
+      string(STRIP "${COMPILER_VERSION}" COMPILER_VERSION)
+   endif()
    execute_process(COMMAND reg query "HKLM\\HARDWARE\\DESCRIPTION\\System\\CentralProcessor" COMMAND grep -c CentralProcessor OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE number_of_processors)
 else()
    set(_cxx "$ENV{CXX}")
@@ -93,7 +99,7 @@
 message("model:      ${dashboard_model}")
 message("********************************")

-if(WIN32)
+if(WIN32 AND compiler STREQUAL "MSVC")
    find_program(JOM jom)
    if(JOM)
       set(CTEST_CMAKE_GENERATOR "NMake Makefiles JOM")


fixed qscintilla cmake code

fixed qscintilla cmake code

--- cmake/FindQScintilla.cmake
+++ cmake/FindQScintilla.cmake
@@ -33,11 +33,11 @@
       /usr/include
     )

-  if(ENABLE_QT5)
+  if(Qt5Widgets_FOUND)
     set(QSCINTILLA_LIBRARY_NAMES qscintilla2-qt5 libqt5scintilla2 libqscintilla2-qt5 qt5scintilla2 libqscintilla2-qt5.dylib)
-  else(ENABLE_QT5)
+  else(Qt5Widgets_FOUND)
     set(QSCINTILLA_LIBRARY_NAMES qscintilla2 libqscintilla2 libqscintilla2.dylib)
-  endif(ENABLE_QT5)
+  endif(Qt5Widgets_FOUND)

   find_library(QSCINTILLA_LIBRARY
     NAMES ${QSCINTILLA_LIBRARY_NAMES}


Fix bug where cmake check on availability of unlink actually checks for mkstemp!

svn path=/trunk/; revision=11972

--- cmake/modules/plplot.cmake
+++ cmake/modules/plplot.cmake
@@ -220,7 +220,7 @@
 check_function_exists(popen HAVE_POPEN)
 check_function_exists(usleep PL_HAVE_USLEEP)
 check_function_exists(mkstemp PL_HAVE_MKSTEMP)
-check_function_exists(mkstemp PL_HAVE_UNLINK)
+check_function_exists(unlink PL_HAVE_UNLINK)
 check_function_exists(_NSGetArgc HAVE_NSGETARGC)

 # Check for FP functions, including underscored version which


cmake: improve doc of qi_create_config_h

--- cmake/qibuild/target.cmake
+++ cmake/qibuild/target.cmake
@@ -296,12 +296,24 @@

 #! Create a configuration file
-
+#
+# Configures a header named ${dest} using the source file from
+# ${source} using ``configure_file``
+# In addition:
+#
+#  - Make sure the path where the header is generated is
+#    added to the include path
+#
+#  - Create the necessary install rules
+#
+# If you need the header to be generated in a subdirectory
+# (recommended), simply use something like::
+#
+#   qi_create_config_h(_out config.h.in foo/config.h)
+#
 # \arg:OUT_PATH Path to the generated file
 # \arg:source The source file
 # \arg:dest The destination
-# This function configure a file (using configure_file), it will generate the install rules
-# and return the path of the generated file in OUT_PATH
 function(qi_create_config_h OUT_PATH source dest)
   configure_file("${source}" "${CMAKE_CURRENT_BINARY_DIR}/include/${dest}" ESCAPE_QUOTES)
   include_directories("${CMAKE_CURRENT_BINARY_DIR}/include/")


remove debug message

remove debug message

--- cmake/qibuild/uselib.cmake
+++ cmake/qibuild/uselib.cmake
@@ -93,8 +93,6 @@
       endif()

       set(_to_add "${_to_add} ${${_U_PKG}_DEFINITIONS}")
-      message(STATUS "_to_add: ${_to_add}")
-
       if(_to_add)
         set_target_properties(${name}
           PROPERTIES


X7: Correct RGB led configuration This removes unused modules and keeps the currently used ones in place.

--- boards/cuav/x7pro/default.cmake
+++ boards/cuav/x7pro/default.cmake
@@ -35,7 +35,6 @@
 		imu/invensense/icm20649
 		imu/invensense/icm20689
 		irlock
-		#lights/blinkm
 		lights/rgbled
 		lights/rgbled_ncp5623c
 		lights/rgbled_pwm


ENH: MGHIO component is only loaded if ITK has been compile with MGHIO support.

--- DTIProcess.cmake
+++ DTIProcess.cmake
@@ -85,6 +85,7 @@
   ITKIOJPEG
   ITKIOLSM
   ITKIOMRC
+  MGHIO
   ITKIOMesh
   ITKIOMeta
   ITKIONIFTI
@@ -106,10 +107,6 @@
     list( APPEND LIST_ITK_IO_USED ${io} )
   endif()
 endforeach()
-
-if( NOT DTIProcess_BUILD_SLICER_EXTENSION )
-  list( APPEND LIST_ITK_IO_USED MGHIO )
-endif()

 find_package(ITK COMPONENTS
    ${LIST_ITK_COMPONENTS} ${LIST_ITK_IO_USED}


only enable warnings with approriate gcc version for rp2040

--- examples/example.cmake
+++ examples/example.cmake
@@ -4,28 +4,29 @@
         -Werror
         -Wfatal-errors
         -Wdouble-promotion
-        #-Wstrict-prototypes
-        -Wstrict-overflow
-        #-Werror-implicit-function-declaration
         -Wfloat-equal
-        #-Wundef
         -Wshadow
         -Wwrite-strings
         -Wsign-compare
         -Wmissing-format-attribute
         -Wunreachable-code
         -Wcast-align
-        -Wcast-function-type
         -Wcast-qual
         -Wnull-dereference
         -Wuninitialized
         -Wunused
         -Wredundant-decls
+        #-Wstrict-prototypes
+        #-Werror-implicit-function-declaration
+        #-Wundef
         )

-# GCC version 9 or prior has a bug with incorrect Wconversion warnings
+# GCC 10
 if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
-  target_compile_options(${PROJECT} PUBLIC
-        -Wconversion
-        )
+  target_compile_options(${PROJECT} PUBLIC -Wconversion)
 endif()
+
+# GCC 8
+if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
+  target_compile_options(${PROJECT} PUBLIC -Wcast-function-type -Wstrict-overflow)
+endif()


Addition now has a method (what a sad state of things).

--- cmake/fp.cmake
+++ cmake/fp.cmake
@@ -7,6 +7,9 @@
 message("      FP_WIDTH=w        Width w in [2,6] of window processing for exponentiation methods.\n")

 message("   ** Available prime field arithmetic methods (default = COMBA;COMBA;MONTY;SLIDE):")
+message("      FP_METHD=BASIC    Schoolbook addition.")
+message("      FP_METHD=INTEG    Integrated modular addition.\n")
+
 message("      FP_METHD=BASIC    Schoolbook multiplication.\n")
 message("      FP_METHD=INTEG    Integrated modular multiplication.")
 message("      FP_METHD=COMBA    Comba multiplication.")
@@ -51,16 +54,17 @@

 # Choose the arithmetic methods.
 if (NOT FP_METHD)
-	set(FP_METHD "COMBA;COMBA;MONTY;SLIDE;MONTY")
+	set(FP_METHD "BASIC;COMBA;COMBA;MONTY;MONTY;SLIDE")
 endif(NOT FP_METHD)
 list(LENGTH FP_METHD FP_LEN)
-if (FP_LEN LESS 5)
+if (FP_LEN LESS 6)
 	message(FATAL_ERROR "Incomplete FP_METHD specification: ${FP_METHD}")
-endif(FP_LEN LESS 5)
+endif(FP_LEN LESS 6)

-list(GET FP_METHD 0 FP_MUL)
-list(GET FP_METHD 1 FP_SQR)
-list(GET FP_METHD 2 FP_RDC)
-list(GET FP_METHD 3 FP_INV)
-list(GET FP_METHD 4 FP_EXP)
+list(GET FP_METHD 0 FP_ADD)
+list(GET FP_METHD 1 FP_MUL)
+list(GET FP_METHD 2 FP_SQR)
+list(GET FP_METHD 3 FP_RDC)
+list(GET FP_METHD 4 FP_INV)
+list(GET FP_METHD 5 FP_EXP)
 set(FP_METHD ${FP_METHD} CACHE STRING "Prime field arithmetic method")


typo fix

typo fix

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -84,7 +84,7 @@
   set(NO_EXPRECISION 1)
 endif ()

-if ((DYNAMIC_ARCH) AND (${TARGET} STREQUAL "GENERIC))
+if ((DYNAMIC_ARCH) AND (${TARGET} STREQUAL "GENERIC"))
   set(NO_EXPRECISION 1)
 endif ()


Trying to add no inline to remove false positives

--- CMake/CodeCoverage.cmake
+++ CMake/CodeCoverage.cmake
@@ -86,11 +86,11 @@
 ENDIF() # CHECK VALID COMPILER

 SET(CMAKE_CXX_FLAGS_COVERAGE
-    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+    "-g -O0 --coverage -fprofile-arcs -ftest-coverage -fno-inline"
     CACHE STRING "Flags used by the C++ compiler during coverage builds."
     FORCE )
 SET(CMAKE_C_FLAGS_COVERAGE
-    "-g -O0 --coverage -fprofile-arcs -ftest-coverage"
+    "-g -O0 --coverage -fprofile-arcs -ftest-coverage -fno-inline"
     CACHE STRING "Flags used by the C compiler during coverage builds."
     FORCE )
 SET(CMAKE_EXE_LINKER_FLAGS_COVERAGE


COMP: propagate compilation option for mapnik 0.7

--- CMake/ImportMapnik.cmake
+++ CMake/ImportMapnik.cmake
@@ -75,7 +75,11 @@
           MESSAGE(STATUS "  Testing if Mapnik2     -- yes")
         ELSE(MAPNIK_SUPPORTS_NEW_INTERFACE)
           MESSAGE(STATUS "  Testing if Mapnik2     -- no")
-          MESSAGE(FATAL_ERROR "Does not support mapnik2 interface: ${OUTPUT}")
+          MESSAGE(STATUS "Does not support mapnik2 interface: ${OUTPUT}")
+          MESSAGE(STATUS "Assuming mapnik 0.7")
+          # This should be dropped when we don't want to support this any more
+          # Estimated date: 02/2013.
+          ADD_DEFINITIONS(-DUSE_OLD_MAPNIK_COMPATIBILITY_MODE)
         ENDIF(MAPNIK_SUPPORTS_NEW_INTERFACE)

         # Add compiler option


CTK Update

CTK Update

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 4d12a3b8)
+    set(revision_tag cbd8b4b4)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -74,10 +74,10 @@

     ExternalProject_Add(${proj}
       LIST_SEPARATOR ${sep}
-#      URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-#      URL /Users/fetzer/proj/ctk/CTK/CTK-XNAT-Upload.tar.gz
-      URL https://www.dropbox.com/s/imutmjs81ox9vsi/CTK-XNAT-Upload.tar.gz
-      URL_MD5 c495e7125451b27e557fb8cc4e3f31f2
+      URL https://www.dropbox.com/s/j9ii4udqfa6jn2k/CTK-CGS-2015.06_dcc02437.tar.gz
+      URL_MD5 1720e40402238619908c55a44d5036ff
+      #GIT_REPOSITORY https://github.com/commontk/CTK.git
+      #GIT_TAG origin/master
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Update VTK tar ball. It is still based on VTK 6.1.0 but has an additional VTK commit included (hash: 74f4888). This commit fixes an unrecognized compiler option for newer mac compilers.

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -76,8 +76,8 @@
      )
   endif()

-  set(VTK_URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/VTK-6.1.0.tar.gz)
-  set(VTK_URL_MD5 25e4dfb3bad778722dcaec80cd5dab7d)
+  set(VTK_URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/VTK-6.1.0+74f4888.tar.gz)
+  set(VTK_URL_MD5 1f19dae22c42c032109bd3cf91c4e8c9)

   ExternalProject_Add(${proj}


ok with that need to use -DOPENSSL_INCLUDE_DIR -DOPENSSL_SSL_LIBRARIES -DOPENSSL_CRYPTO_LIBRARIES

--- cmake/Modules/FindOpenSSL.cmake
+++ cmake/Modules/FindOpenSSL.cmake
@@ -0,0 +1,195 @@
+# - Try to find the OpenSSL encryption library
+# Once done this will define
+#
+#  OPENSSL_ROOT_DIR - Set this variable to the root installation of OpenSSL
+#
+# Read-Only variables:
+#  OPENSSL_FOUND - system has the OpenSSL library
+#  OPENSSL_INCLUDE_DIR - the OpenSSL include directory
+#  OPENSSL_LIBRARIES - The libraries needed to use OpenSSL
+
+#=============================================================================
+# Copyright 2006-2009 Kitware, Inc.
+# Copyright 2006 Alexander Neundorf <neundorf@kde.org>
+# Copyright 2009-2010 Mathieu Malaterre <mathieu.malaterre@gmail.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distributed this file outside of CMake, substitute the full
+#  License text for the above reference.)
+
+# http://www.slproweb.com/products/Win32OpenSSL.html
+
+SET(_OPENSSL_ROOT_HINTS
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;Inno Setup: App Path]"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;Inno Setup: App Path]"
+  "$ENV{OPENSSL_ROOT_DIR}"
+  "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}"
+  )
+
+IF(PLATFORM EQUAL 64)
+  SET(_OPENSSL_ROOT_PATHS
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (64-bit)_is1;InstallLocation]"
+    "C:/OpenSSL-Win64/"
+    "C:/OpenSSL/"
+    "C:/Program Files/OpenSSL-Win64/"
+  )
+ELSE()
+  SET(_OPENSSL_ROOT_PATHS
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
+    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\OpenSSL (32-bit)_is1;InstallLocation]"
+    "C:/OpenSSL/"
+    "C:/Program Files/OpenSSL/"
+  )
+ENDIF()
+
+FIND_PATH(OPENSSL_ROOT_DIR
+  NAMES
+    include/openssl/ssl.h
+  HINTS
+    ${_OPENSSL_ROOT_HINTS}
+  PATHS
+    ${_OPENSSL_ROOT_PATHS}
+)
+MARK_AS_ADVANCED(OPENSSL_ROOT_DIR)
+
+# Re-use the previous path:
+FIND_PATH(OPENSSL_INCLUDE_DIR openssl/ssl.h
+  ${OPENSSL_ROOT_DIR}/include
+)
+
+IF(WIN32 AND NOT CYGWIN)
+  # MINGW should go here too
+  IF(MSVC)
+    # /MD and /MDd are the standard values - if someone wants to use
+    # others, the libnames have to change here too
+    # use also ssl and ssleay32 in debug as fallback for openssl < 0.9.8b
+    # TODO: handle /MT and static lib
+    # In Visual C++ naming convention each of these four kinds of Windows libraries has it's standard suffix:
+    #   * MD for dynamic-release
+    #   * MDd for dynamic-debug
+    #   * MT for static-release
+    #   * MTd for static-debug
+
+    # Implementation details:
+    # We are using the libraries located in the VC subdir instead of the parent directory eventhough :
+    # libeay32MD.lib is identical to ../libeay32.lib, and
+    # ssleay32MD.lib is identical to ../ssleay32.lib
+
+    # In 1.1 version of OpenSSL we have other names of libs: libcrypto32MTd.lib and libssl32MTd.lib
+    if( "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8" )
+        set(_OPENSSL_MSVC_ARCH_SUFFIX "64")
+    else()
+        set(_OPENSSL_MSVC_ARCH_SUFFIX "32")
+    endif()
+
+    FIND_LIBRARY(LIB_EAY_DEBUG
+      NAMES
+        libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}MDd libcrypto libeay32MDd libeay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/VC
+        ${OPENSSL_ROOT_DIR}/debug/lib
+    )
+
+    FIND_LIBRARY(LIB_EAY_RELEASE
+      NAMES
+        libcrypto${_OPENSSL_MSVC_ARCH_SUFFIX}MD libcrypto libeay32MD libeay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/VC
+        ${OPENSSL_ROOT_DIR}/lib
+    )
+
+    FIND_LIBRARY(SSL_EAY_DEBUG
+      NAMES
+        libssl${_OPENSSL_MSVC_ARCH_SUFFIX}MDd libssl ssleay32MDd ssleay32 ssl
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/VC
+        ${OPENSSL_ROOT_DIR}/debug/lib
+    )
+
+    FIND_LIBRARY(SSL_EAY_RELEASE
+      NAMES
+        libssl${_OPENSSL_MSVC_ARCH_SUFFIX}MD libssl ssleay32MD ssleay32 ssl
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/VC
+        ${OPENSSL_ROOT_DIR}/lib
+    )
+
+    if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
+      set( OPENSSL_LIBRARIES
+        optimized ${SSL_EAY_RELEASE} ${LIB_EAY_RELEASE}
+        debug ${SSL_EAY_DEBUG} ${LIB_EAY_DEBUG}
+      )
+    else()
+      set( OPENSSL_LIBRARIES
+        ${SSL_EAY_RELEASE}
+        ${LIB_EAY_RELEASE}
+      )
+    endif()
+
+    MARK_AS_ADVANCED(SSL_EAY_DEBUG SSL_EAY_RELEASE LIB_EAY_DEBUG LIB_EAY_RELEASE)
+  ELSEIF(MINGW)
+
+    # same player, for MingW
+    FIND_LIBRARY(LIB_EAY
+      NAMES
+        libeay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/MinGW
+    )
+
+    FIND_LIBRARY(SSL_EAY NAMES
+      NAMES
+        ssleay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib/MinGW
+    )
+
+    MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+
+    set( OPENSSL_LIBRARIES
+      ${SSL_EAY}
+      ${LIB_EAY}
+    )
+  ELSE(MSVC)
+    # Not sure what to pick for -say- intel, let's use the toplevel ones and hope someone report issues:
+    FIND_LIBRARY(LIB_EAY
+      NAMES
+        libeay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib
+        ${OPENSSL_ROOT_DIR}/lib/VC
+    )
+
+    FIND_LIBRARY(SSL_EAY
+      NAMES
+        ssleay32
+      PATHS
+        ${OPENSSL_ROOT_DIR}/lib
+        ${OPENSSL_ROOT_DIR}/lib/VC
+    )
+    MARK_AS_ADVANCED(SSL_EAY LIB_EAY)
+
+    SET( OPENSSL_LIBRARIES ${SSL_EAY} ${LIB_EAY} )
+  ENDIF(MSVC)
+ELSE(WIN32 AND NOT CYGWIN)
+  FIND_LIBRARY(OPENSSL_SSL_LIBRARIES NAMES ssl ssleay32 ssleay32MD)
+  FIND_LIBRARY(OPENSSL_CRYPTO_LIBRARIES NAMES crypto)
+  MARK_AS_ADVANCED(OPENSSL_CRYPTO_LIBRARIES OPENSSL_SSL_LIBRARIES)
+
+  SET(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARIES})
+
+ENDIF(WIN32 AND NOT CYGWIN)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OpenSSL DEFAULT_MSG
+  OPENSSL_LIBRARIES
+  OPENSSL_INCLUDE_DIR
+)
+
+MARK_AS_ADVANCED(OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES)


Add cmake function to copy directories

Add cmake function to copy directories

It's in data_target.cmake and has a similar interface to add_data.

--- cmake/Modules/data_target.cmake
+++ cmake/Modules/data_target.cmake
@@ -14,3 +14,16 @@
     install(FILES ${filename} DESTINATION share/${PROJECT_NAME})
   endforeach(filename)
 endfunction()
+
+function(add_data_directory target all)
+  add_custom_target(${target} ${all})
+
+  foreach(dirname ${ARGN})
+    add_custom_command(TARGET ${target} COMMAND ${CMAKE_COMMAND}
+                       ARGS -E copy_directory
+                       ${CMAKE_CURRENT_SOURCE_DIR}/${dirname}
+                       ${CMAKE_CURRENT_BINARY_DIR}/${dirname}
+                       MAIN_DEPENDENCY ${dirname})
+    install(DIRECTORY ${dirname} DESTINATION share/${PROJECT_NAME})
+  endforeach()
+endfunction()


cmake/MyPackageDependency.cmake and recursivity

--- cmake/MyPackageDependency.cmake
+++ cmake/MyPackageDependency.cmake
@@ -76,7 +76,7 @@
     # Remember all eventual packageDepend variables we depend upon
     #
     FOREACH (_what INCLUDE_DIRS LIBRARIES C_FLAGS_SHARED LINK_FLAGS)
-      SET (_val ${${_PACKAGEDEPEND}_${_what})
+      SET (_val ${${_PACKAGEDEPEND}_${_what}})
       IF (MYPACKAGE_DEBUG)
         MESSAGE (STATUS "[${PROJECT_NAME}-DEPEND-DEBUG] Setting property MYPACKAGE_DEPENDENCY_${packageDepend}_${_what} to ${_val}")
       ENDIF ()


Port to the shipped version of ParseArguments.

--- cmake/modules/GrantleeUse.cmake
+++ cmake/modules/GrantleeUse.cmake
@@ -6,63 +6,35 @@
 find_package(Qt4 REQUIRED)
 include(${QT_USE_FILE})

+include(CMakeParseArguments)
+
 # Add the Grantlee modules directory to the CMake module path
 set(CMAKE_MODULE_PATH ${Grantlee_PLUGIN_DIR}/cmake ${CMAKE_MODULE_PATH})

-MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
-  SET(DEFAULT_ARGS)
-  FOREACH(arg_name ${arg_names})
-    SET(${prefix}_${arg_name})
-  ENDFOREACH(arg_name)
-  FOREACH(option ${option_names})
-    SET(${prefix}_${option} FALSE)
-  ENDFOREACH(option)
+macro(GRANTLEE_ADD_PLUGIN pluginname)
+  set(options)
+  set(oneValueArgs TAGS FILTERS)
+  set(multiValueArgs)

-  SET(current_arg_name DEFAULT_ARGS)
-  SET(current_arg_list)
-  FOREACH(arg ${ARGN})
-    SET(larg_names ${arg_names})
-    LIST(FIND larg_names "${arg}" is_arg_name)
-    IF (is_arg_name GREATER -1)
-      SET(${prefix}_${current_arg_name} ${current_arg_list})
-      SET(current_arg_name ${arg})
-      SET(current_arg_list)
-    ELSE (is_arg_name GREATER -1)
-      SET(loption_names ${option_names})
-      LIST(FIND loption_names "${arg}" is_option)
-      IF (is_option GREATER -1)
-             SET(${prefix}_${arg} TRUE)
-      ELSE (is_option GREATER -1)
-             SET(current_arg_list ${current_arg_list} ${arg})
-      ENDIF (is_option GREATER -1)
-    ENDIF (is_arg_name GREATER -1)
-  ENDFOREACH(arg)
-  SET(${prefix}_${current_arg_name} ${current_arg_list})
-ENDMACRO(PARSE_ARGUMENTS)
+  cmake_parse_arguments(_PLUGIN "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

-macro(GRANTLEE_ADD_PLUGIN pluginname)
-  parse_arguments(PLUGIN
-      "TAGS;FILTERS"
-      ""
-      ${ARGN}
-  )
-
-  foreach(_filename ${PLUGIN_DEFAULT_ARGS})
+  foreach(_filename ${_PLUGIN_UNPARSED_ARGUMENTS})
     get_source_file_property(_skip ${_filename}.h SKIP_AUTOMOC)
     if (NOT _skip)
       set(_headers ${_headers} ${_filename}.h)
     endif()
     set(_sources ${_sources} ${_filename}.cpp)
-  endforeach(_filename ${PLUGIN_DEFAULT_ARGS})
-  foreach(_filename ${PLUGIN_TAGS})
+  endforeach()
+  foreach(_filename ${_PLUGIN_TAGS})
     set(_headers ${_headers} ${_filename}.h)
     set(_sources ${_sources} ${_filename}.cpp)
-  endforeach(_filename ${PLUGIN_TAGS})
-  foreach(_filename ${PLUGIN_FILTERS})
+  endforeach()
+  foreach(_filename ${_PLUGIN_FILTERS})
     set(_sources ${_sources} ${_filename}.cpp)
-  endforeach(_filename ${PLUGIN_FILTERS})
+  endforeach()

   qt4_wrap_cpp(_plugin_moc_srcs ${_headers})
+
   add_library(${pluginname} MODULE ${_sources} ${_plugin_moc_srcs})

   foreach(file ${_sources})


swig/python.cmake: workaround a CMake 2.8.12 bug

Change-Id: I48502f7c50d8abfdc0c974439b3277db1bf499ab
Reviewed-on: http://gerrit.aldebaran.lan/56130
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/swig/python.cmake
+++ cmake/qibuild/swig/python.cmake
@@ -78,6 +78,12 @@

   swig_add_module(${module_name} python ${interface_file} ${_srcs})

+  # When interface_file looks like "foo/foo.i", cmake 2.8.12 tries
+  # to generate the fooPYTHON_wrap.cxx in build/foo/foo/ but fails
+  # because it does not create the subdirectory
+  get_filename_component(_interface_dir ${interface_file} DIRECTORY)
+  file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_interface_dir})
+
   ##
   # Deal with the newly created target


Give a unique test result file name to roslaunch-checky.py (conditioned on version of ros_comm), #3674

--- core/rosbuild/private.cmake
+++ core/rosbuild/private.cmake
@@ -274,11 +274,25 @@
   rosbuild_invoke_rospack("" rostest path find rostest)

   # Create target for this test.
-  add_custom_target(${targetname}
-                    COMMAND ${rostest_path}/bin/roslaunch-check.py ${file} ${ARGN}
-                    DEPENDS ${file}
-                    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-                    VERBATIM)
+  # First check version on ros_comm to see whether we can give
+  # roslaunch-check.py an output file name (first appears in 1.6.3/1.7.0)
+  # Related to #3674.
+  rosbuild_get_stack_version(ros_comm_version "ros_comm")
+  if(ros_comm_version VERSION_LESS "1.6.3")
+    add_custom_target(${targetname}
+                      COMMAND ${rostest_path}/bin/roslaunch-check.py ${file} ${ARGN}
+                      DEPENDS ${file}
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                      VERBATIM)
+  else()
+    # It's the newer roslaunch-check.py, so we can pass the full path to
+    # the test result file.
+    add_custom_target(${targetname}
+                      COMMAND ${rostest_path}/bin/roslaunch-check.py -o ${rosbuild_test_results_dir}/${PROJECT_NAME}/TEST-${targetname}.xml ${file} ${ARGN}
+                      DEPENDS ${file}
+                      WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                      VERBATIM)
+  endif()

   # Make sure all test programs are built before running this test
   # but not if rosbuild_test_nobuild is set, #3008


Split off 7.10.4

Split off 7.10.4

Signed-off-by: Gavin Halliday <2edfa8aca9fb78974188e5b35be8b52d4e4967ae@lexisnexis.com>

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


Split off candidate-4.0.2 branch

Split off candidate-4.0.2 branch

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

--- version.cmake
+++ version.cmake
@@ -3,10 +3,10 @@
 ###
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 4 )
-set ( HPCC_MINOR 1 )
-set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "closedown" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_MINOR 0 )
+set ( HPCC_POINT 2 )
+set ( HPCC_MATURITY "rc" )
+set ( HPCC_SEQUENCE 0 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Graph Control 5.2.2-1 Gold

Graph Control 5.2.2-1 Gold

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

--- version.cmake
+++ version.cmake
@@ -4,7 +4,7 @@
 set ( HPCC_PROJECT "community" )
 set ( HPCC_MAJOR 5 )
 set ( HPCC_MINOR 2 )
-set ( HPCC_POINT 0 )
+set ( HPCC_POINT 2 )
 set ( HPCC_MATURITY "release" )
 set ( HPCC_SEQUENCE 1 )
 ###


Split off 7.12.110

Split off 7.12.110

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

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


update FindGflags.cmake to work on CentOS 8.x (#1409)

Summary:
Update FindGflags.cmake to work on recent CentOS and RedHat distributions.

On these distributions the CMake package configuration installed by the
gflags-devel RPM is slightly broken, and sets `gflags_INCLUDE_DIR` to a
directory that does not exist.  This happens because `/lib64` is symlinked to
`/usr/lib64`, and CMake ends up searching `/lib64` before `/usr/lib64` by
default when searching for packages.  Therefore it finds `gflags-config.cmake`
via the `/lib64` symlink.  However, `gflags-config.cmake` computes the include
directory relative to where its config file was found, and this relative path
computation only works when using the actual `/usr/lib64` path where it was
installed.  When found via `/lib64` it returns a bogus `//include` path that
does not exist.

This updates `FindGflags.cmake` to verify if the `gflags_INCLUDE_DIR` path
actually exists, and set it to a sane location instead.

This also updates the code to use the `gflags-shared` target that is exported
by the default gflags package configuration if it was only built as a shared
library.

Pull Request resolved: https://github.com/facebook/folly/pull/1409

Reviewed By: yfeldblum

Differential Revision: D23588288

fbshipit-source-id: b68a717953ae0521f568d7bcfd05ca33cd6dc578

--- build/fbcode_builder/CMake/FindGflags.cmake
+++ build/fbcode_builder/CMake/FindGflags.cmake
@@ -41,6 +41,16 @@
   # Re-export the config-specified libs with our local names
   set(LIBGFLAGS_LIBRARY ${gflags_LIBRARIES})
   set(LIBGFLAGS_INCLUDE_DIR ${gflags_INCLUDE_DIR})
+  if(NOT EXISTS "${gflags_INCLUDE_DIR}")
+    # The gflags-devel RPM on recent RedHat-based systems is somewhat broken.
+    # RedHat symlinks /lib64 to /usr/lib64, and this breaks some of the
+    # relative path computation performed in gflags-config.cmake.  The package
+    # config file ends up being found via /lib64, but the relative path
+    # computation it does only works if it was found in /usr/lib64.
+    # If gflags_INCLUDE_DIR does not actually exist, simply default it to
+    # /usr/include on these systems.
+    set(LIBGFLAGS_INCLUDE_DIR "/usr/include")
+  endif()
   set(LIBGFLAGS_FOUND ${gflags_FOUND})
   # cmake module compat
   set(GFLAGS_FOUND ${gflags_FOUND})
@@ -76,6 +86,20 @@
 # Compat with the gflags CONFIG based detection
 if (LIBGFLAGS_FOUND AND NOT TARGET gflags)
   add_library(gflags UNKNOWN IMPORTED)
-  set_target_properties(gflags PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBGFLAGS_INCLUDE_DIR}")
-  set_target_properties(gflags PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C" IMPORTED_LOCATION "${LIBGFLAGS_LIBRARY}")
+  if(TARGET gflags-shared)
+    # If the installed gflags CMake package config defines a gflags-shared
+    # target but not gflags, just make the gflags target that we define
+    # depend on the gflags-shared target.
+    target_link_libraries(gflags INTERFACE gflags-shared)
+    # Export LIBGFLAGS_LIBRARY as the gflags-shared target in this case.
+    set(LIBGFLAGS_LIBRARY gflags-shared)
+  else()
+    set_target_properties(
+      gflags
+      PROPERTIES
+        IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+        IMPORTED_LOCATION "${LIBGFLAGS_LIBRARY}"
+        INTERFACE_INCLUDE_DIRECTORIES "${LIBGFLAGS_INCLUDE_DIR}"
+    )
+  endif()
 endif()


cmake: NO_ -> WITH_

cmake: NO_ -> WITH_

--- config.h.cmake
+++ config.h.cmake
@@ -70,9 +70,9 @@
 #define HOST_CPU "${CMAKE_HOST_SYSTEM_PROCESSOR}"
 #define HOST_OS "${CMAKE_HOST_SYSTEM_NAME}"

-#cmakedefine NO_LZO
-#cmakedefine NO_NFKC
-#cmakedefine NO_ZLIB
+#cmakedefine WITH_LZO
+#cmakedefine WITH_NFKC
+#cmakedefine WITH_ZLIB

 #define PACKAGE "${PROJECT_NAME}"
 #define PACKAGE_NAME "${PROJECT_NAME}"


- change auto detection of the libdir path

--- cmake/modules/DefineInstallationPaths.cmake
+++ cmake/modules/DefineInstallationPaths.cmake
@@ -4,16 +4,19 @@
     SET(APPLICATION_NAME ${PROJECT_NAME})
   ENDIF (NOT APPLICATION_NAME)

-# Suffix for Linux
-	IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
-		SET(LIB_SUFFIX ""
-		CACHE STRING "Suffix of the lib")
-		SET (PKG_ARCH "i386")
-	ELSE (CMAKE_SIZEOF_VOID_P EQUAL 4)
-		SET(LIB_SUFFIX "64"
-		CACHE STRING "Suffix of the lib")
-		SET (PKG_ARCH "x86_64")
-	ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
+# detect lib suffix
+
+
+IF(EXISTS "/usr/lib64")
+	SET(LIB_SUFFIX "64"
+	CACHE STRING "Suffix of the lib")
+	SET (PKG_ARCH "x86_64")
+ELSE(EXISTS "/usr/lib64" )
+SET(LIB_SUFFIX ""
+CACHE STRING "Suffix of the lib")
+SET (PKG_ARCH "i386")
+ENDIF(EXISTS "/usr/lib64" )
+

 #  correct cmake netpath issue with cmake 2.8
   IF("${CMAKE_INSTALL_PREFIX}" STREQUAL "/")


Add `cxx_strict_flags` for clang to match FreeBSD's WARNS flags

Signed-off-by: Enji Cooper <d6bb01297bdcc8d1a5e14be12c1049fd9e385b00@gmail.com>

--- googletest/cmake/internal_utils.cmake
+++ googletest/cmake/internal_utils.cmake
@@ -81,6 +81,7 @@
     set(cxx_base_flags "-Wall -Wshadow -Werror")
     set(cxx_exception_flags "-fexceptions")
     set(cxx_no_exception_flags "-fno-exceptions")
+    set(cxx_strict_flags "-Wno-format-y2k -W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
   elseif (CMAKE_COMPILER_IS_GNUCXX)
     set(cxx_base_flags "-Wall -Wshadow -Werror")
     if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)


Fix auto config of plugin linting tests

Fix auto config of plugin linting tests

--- plugins/candela/plugin.cmake
+++ plugins/candela/plugin.cmake
@@ -1 +1 @@
-add_standard_plugin_tests()
+add_standard_plugin_tests(PACKAGE "girder_candela")


Add comment [skip ci]

Add comment [skip ci]

--- Common.cmake
+++ Common.cmake
@@ -35,6 +35,7 @@

 message(STATUS "[polly] Used toolchain: ${POLLY_TOOLCHAIN_NAME}")

+# support for hunter (github.com/ruslo/hunter)
 set(HUNTER_INSTALL_TAG ${POLLY_TOOLCHAIN_TAG})

 # Add extra 'find' cmake modules


Fix copyscript generator

Fix copyscript generator

[ ] May break build
[ ] Breaks existing applications
[x] Bugfix
[ ] New Feature
[ ] Cleanup
[ ] Optimization
[ ] Documentation

--- copyScript.cmake
+++ copyScript.cmake
@@ -77,8 +77,8 @@
   endif(COPY_TARGET_RELEASE_TYPE MATCHES "RelWithDebInfo")

     file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/copyScript.bat
-        "xcopy /s /y \"${WIN_SOURCE_DIR}\\server\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\"\n"
-        "xcopy /s /y \"${WIN_SOURCE_DIR}\\server\\equalizers\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\\equalizers\"\n"
+        "xcopy /s /y \"${WIN_SOURCE_DIR}\\libs\\server\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\"\n"
+        "xcopy /s /y \"${WIN_SOURCE_DIR}\\libs\\server\\equalizers\\\"*.h \"${COPY_TARGET}\\include\\eq\\server\\equalizers\"\n"

         "\"%ProgramFiles%\\TortoiseSVN\\bin\\SubWCRev.exe\" \"${WIN_SOURCE_DIR}\" > \"${COPY_TARGET}\\include\\eq\\Version.txt\"\n"
         "pause\n"


Make sub project finding more robust

Make sub project finding more robust

--- SubProject.cmake
+++ SubProject.cmake
@@ -80,7 +80,7 @@
       if(NOT ${NAME}_FOUND)
         git_external(${CMAKE_SOURCE_DIR}/${name} ${url} ${tag})
         add_subproject(${name})
-        find_package(${name} REQUIRED) # find subproject "package"
+        find_package(${name} REQUIRED CONFIG) # find subproject "package"
         include_directories(${${NAME}_INCLUDE_DIRS})
         list(APPEND __subprojects "${name} ${url} ${tag}")
       endif()


ENH: Superbuild - Simplify the way boolean option are passed to CTK inner build

The convenient macro ctk_set_superbuild_boolean_arg wasn't required

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -170,16 +170,6 @@
 ENDFOREACH()

 #-----------------------------------------------------------------------------
-# Convenient function allowing to define superbuild arg
-#
-FUNCTION(ctk_set_superbuild_boolean_arg ctk_cmake_var)
-  SET(superbuild_${ctk_cmake_var} OFF)
-  IF(DEFINED ${ctk_cmake_var})
-    SET(superbuild_${ctk_cmake_var} ${${ctk_cmake_var}} PARENT_SCOPE)
-  ENDIF()
-ENDFUNCTION()
-
-#-----------------------------------------------------------------------------
 # Set superbuild boolean args
 #

@@ -197,8 +187,7 @@

 SET(ctk_superbuild_boolean_args)
 FOREACH(ctk_cmake_arg ${ctk_cmake_boolean_args})
-  ctk_set_superbuild_boolean_arg(${ctk_cmake_arg})
-  LIST(APPEND ctk_superbuild_boolean_args -D${ctk_cmake_arg}:BOOL=${superbuild_${ctk_cmake_arg}})
+  LIST(APPEND ctk_superbuild_boolean_args -D${ctk_cmake_arg}:BOOL=${${ctk_cmake_arg}})
 ENDFOREACH()

 # MESSAGE("CMake args:")


STYLE: M-x indent-region

STYLE: M-x indent-region

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -35,15 +35,15 @@
 endif()

 if(OTB_USE_LIBKML)
-    ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB LIBKML)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_INCLUDE_DIR)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_BASE_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_CONVENIENCE_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_DOM_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_ENGINE_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_REGIONATOR_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_XSD_LIBRARY)
-    ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_MINIZIP_LIBRARY)
+  ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB LIBKML)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_BASE_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_CONVENIENCE_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_DOM_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_ENGINE_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_REGIONATOR_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_XSD_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB LIBKML_MINIZIP_LIBRARY)
 endif()

 if(OTB_USE_OPENCV)


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -46,7 +46,7 @@

         SET(DEBUG_MODE ON)

-        # Default compiler settings
+        # Default compiler and linker settings

         IF(WIN32)
             SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")


Updated our common CMake file to support Qt 4.8.1 rather than 4.8.0.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -78,10 +78,10 @@
         #       hard-code qmake's path so that CMake can find Qt from within
         #       Qt Creator...

-        SET(QT_QMAKE_EXECUTABLE /Developer/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake)
-    ENDIF()
-
-    FIND_PACKAGE(Qt4 4.8.0 REQUIRED)
+        SET(QT_QMAKE_EXECUTABLE /Developer/QtSDK/Desktop/Qt/4.8.1/gcc/bin/qmake)
+    ENDIF()
+
+    FIND_PACKAGE(Qt4 4.8.1 REQUIRED)

     # Whether we are building for 32-bit or 64-bit


Updated the RPATH value for Linux.

Updated the RPATH value for Linux.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -271,7 +271,7 @@
     # Set the RPATH information on Linux

     IF(NOT WIN32 AND NOT APPLE)
-        SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/../plugins/${PROJECT_NAME}")
+        SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
     ENDIF()
 ENDMACRO()


add note about using upper-case version of OSPRAY_TASKING_SYSTEM internally

--- cmake/ospray.cmake
+++ cmake/ospray.cmake
@@ -335,6 +335,7 @@
                STRINGS TBB ${CILK_STRING} OpenMP Internal Debug)
   MARK_AS_ADVANCED(OSPRAY_TASKING_SYSTEM)

+  # NOTE(jda) - Make the OSPRAY_TASKING_SYSTEM build option case-insensitive
   STRING(TOUPPER ${OSPRAY_TASKING_SYSTEM} OSPRAY_TASKING_SYSTEM_ID)

   SET(USE_TBB      FALSE)


cmake(python): Fix windows build

cmake(python): Fix windows build

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -133,8 +133,9 @@
   COMMAND ${CMAKE_COMMAND} -E copy $<CONFIG>/setup.py setup.py
   COMMAND ${CMAKE_COMMAND} -E remove_directory dist
   COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_NAME}/.libs
-  #COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:ortools> ${PROJECT_NAME}/.libs
-  COMMAND ${CMAKE_COMMAND} -E copy $<$<NOT:$<PLATFORM_ID:Windows>>:$<TARGET_SONAME_FILE:ortools>> ${PROJECT_NAME}/.libs
+  # Don't need to copy static lib on windows.
+  COMMAND ${CMAKE_COMMAND} -E $<IF:${UNIX},copy,true>
+  $<${UNIX}:$<TARGET_SONAME_FILE:ortools>> ${PROJECT_NAME}/.libs
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywrapknapsack_solver> ${PROJECT_NAME}/algorithms
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywrapgraph> ${PROJECT_NAME}/graph
   COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:pywrapcp> ${PROJECT_NAME}/constraint_solver


fix cmake

fix cmake

--- cmake/python.cmake
+++ cmake/python.cmake
@@ -53,7 +53,7 @@

 # CMake will remove all '-D' prefix (i.e. -DUSE_FOO become USE_FOO)
 #get_target_property(FLAGS ortools::ortools COMPILE_DEFINITIONS)
-set(FLAGS -DUSE_BOP -DUSE_GLOP -DUSE_CBC -DUSE_CLP)
+set(FLAGS -DUSE_BOP -DUSE_GLOP -DUSE_CBC -DUSE_CLP -DMUST_USE_RESULT)
 list(APPEND CMAKE_SWIG_FLAGS ${FLAGS} "-I${PROJECT_SOURCE_DIR}")

 foreach(SUBPROJECT constraint_solver linear_solver sat graph algorithms data)


Propagate BUILD_BFLOAT16 to CFLAGS

Propagate BUILD_BFLOAT16 to CFLAGS

--- cmake/system.cmake
+++ cmake/system.cmake
@@ -468,6 +468,9 @@
 endif()
 if (BUILD_COMPLEX16)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_COMPLEX16")
+endif()
+if (BUILD_BFLOAT16)
+       set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DBUILD_BFLOAT16")
 endif()
 if(NOT MSVC)
 set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${CCOMMON_OPT}")


cmake: Setup archive output to match library output.

--- cmake/target.cmake
+++ cmake/target.cmake
@@ -25,3 +25,8 @@
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${LIB_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${LIB_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${LIB_DIR})
+
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIB_DIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CMAKE_BUILD_TYPE} ${LIB_DIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${LIB_DIR})
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${LIB_DIR})


do auto-cpu detection on MacOS

do auto-cpu detection on MacOS

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -27,10 +27,9 @@
          string(REGEX REPLACE ".*cpu family[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_family "${_cpuinfo}")
          string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}")
       elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-         exec_program("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE _cpuinfo)
-         #string(REGEX REPLACE ".*vendor_id[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _vendor_id "${_cpuinfo}")
-         #string(REGEX REPLACE ".*cpu family[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_family "${_cpuinfo}")
-         #string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}")
+         exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor" OUTPUT_VARIABLE _vendor_id)
+         exec_program("/usr/sbin/sysctl -n machdep.cpu.model"  OUTPUT_VARIABLE _cpu_model)
+         exec_program("/usr/sbin/sysctl -n machdep.cpu.family" OUTPUT_VARIABLE _cpu_family)
       endif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
       if(_vendor_id STREQUAL "GenuineIntel")
          if(_cpu_family EQUAL 6)


support ICC compiler flags to select vector unit

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -186,6 +186,36 @@
          string(REPLACE "." "_" _flag "__${_flag}__")
          add_definitions("-D${_flag}")
       endforeach(_flag)
+   elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC
+      _my_find(_available_vector_units_list "avx"    _found)
+      if(_found)
+         AddCompilerFlag("-xAVX")
+      else(_found)
+         _my_find(_available_vector_units_list "sse4.2" _found)
+         if(_found)
+            AddCompilerFlag("-xSSE4.2")
+         else(_found)
+            _my_find(_available_vector_units_list "sse4.1" _found)
+            if(_found)
+               AddCompilerFlag("-xSSE4.1")
+            else(_found)
+               _my_find(_available_vector_units_list "ssse3"  _found)
+               if(_found)
+                  AddCompilerFlag("-xSSSE3")
+               else(_found)
+                  _my_find(_available_vector_units_list "sse3"   _found)
+                  if(_found)
+                     AddCompilerFlag("-xSSE3")
+                  else(_found)
+                     _my_find(_available_vector_units_list "sse2"   _found)
+                     if(_found)
+                        AddCompilerFlag("-xSSE2")
+                     endif(_found)
+                  endif(_found)
+               endif(_found)
+            endif(_found)
+         endif(_found)
+      endif(_found)
    else(CMAKE_C_COMPILER MATCHES "cl(.exe)?$")
       foreach(_flag ${_march_flag_list})
          AddCompilerFlag("-march=${_flag}" _good)


Do not use 'get_filename_component' if file name is empty

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -449,15 +449,18 @@
       "${HUNTER_DOWNLOAD_TOOLCHAIN}"
       "set(HUNTER_CACHE_SERVERS \"${HUNTER_CACHE_SERVERS}\" CACHE INTERNAL \"\")\n"
   )
-  # Fix Windows slashes
-  get_filename_component(
-      passwords_path "${HUNTER_PASSWORDS_PATH}" ABSOLUTE
-  )
-  file(
-      APPEND
-      "${HUNTER_DOWNLOAD_TOOLCHAIN}"
-      "set(HUNTER_PASSWORDS_PATH \"${passwords_path}\" CACHE INTERNAL \"\")\n"
-  )
+  string(COMPARE NOTEQUAL "${HUNTER_PASSWORDS_PATH}" "" has_passwords)
+  if(has_passwords)
+    # Fix Windows slashes
+    get_filename_component(
+        passwords_path "${HUNTER_PASSWORDS_PATH}" ABSOLUTE
+    )
+    file(
+        APPEND
+        "${HUNTER_DOWNLOAD_TOOLCHAIN}"
+        "set(HUNTER_PASSWORDS_PATH \"${passwords_path}\" CACHE INTERNAL \"\")\n"
+    )
+  endif()
   file(
       APPEND
       "${HUNTER_DOWNLOAD_TOOLCHAIN}"


fix build with debug wx libs in linux

fix build with debug wx libs in linux

--- cmakemodules/script_wxwidgets.cmake
+++ cmakemodules/script_wxwidgets.cmake
@@ -9,7 +9,7 @@
 IF(UNIX)
 	# Linux:
 	IF(CMAKE_BUILD_TYPE MATCHES "Debug")
-		SET(wxWidgets_USE_DEBUG ON)
+		SET(wxWidgets_USE_DEBUG ON CACHE BOOL "Use wxWidgets debug libs" FORCE)
 	ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
 ELSE(UNIX)
 	# Windows configuration of wxWidgets:
@@ -34,7 +34,7 @@
 	IF(UNIX)
 		IF(CMAKE_BUILD_TYPE MATCHES "Debug")
 			IF(NOT wxWidgets_USE_DEBUG)
-				MESSAGE("Warning: The debug libraries for wxWidgets couldn't be found by CMake. Please install them (libwxbase2.8-dev) or build in release.")
+				MESSAGE("Warning: The debug libraries for wxWidgets couldn't be found by CMake. Please install them (libwxgtk2.8-dbg) or build in release.")
 			ENDIF(NOT wxWidgets_USE_DEBUG)
 		ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
 	ENDIF(UNIX)


Added comment on how to build a static library

--- README.cmake
+++ README.cmake
@@ -10,3 +10,5 @@
 BOOST_ROOT Please set BOOST_ROOT to the root
   directory containing Boost or BOOST_INCLUDEDIR to the directory containing
   Boost's headers.
+
+To create a static library set the BUILD_STATIC_LIBRARY variable to on.


fix library name in prf file to use the lib name variable

the lib name might be suffixed

(reviewed as part of r121323)

--- crypto.prf.cmake
+++ crypto.prf.cmake
@@ -16,10 +16,10 @@
 isEmpty(LINKAGE) {
 	INCLUDEPATH += $$QCA_INCDIR/QtCrypto
 	LIBS += -L$$QCA_LIBDIR
-	LINKAGE = -lqca
+	LINKAGE = -l@QCA_LIB_NAME@
 	CONFIG(debug, debug|release) {
-		windows:LINKAGE = -lqcad
-		mac:LINKAGE = -lqca_debug
+		windows:LINKAGE = -l@QCA_LIB_NAME@d
+		mac:LINKAGE = -l@QCA_LIB_NAME@_debug
 	}
 }


Exclude more system DLLs.

Exclude more system DLLs.

	* build-aux/cmake/modules/DynLibDep.cmake: Here.

Signed-off-by: Nicolas Despres <abdeb541ca46f1651c9cc594d44e707056e73d5d@gostai.com>

--- build-aux/cmake/modules/DynLibDep.cmake
+++ build-aux/cmake/modules/DynLibDep.cmake
@@ -19,6 +19,17 @@
     "^ntdll.dll"
     "^USER32.dll"
     "^GDI32.dll"
+    "^ADVAPI32.dll"
+    "^COMCTL32.dll"
+    "^COMDLG32.DLL"
+    "^IMM32.DLL"
+    "^OLE32.dll"
+    "^OLEAUT32.DLL"
+    "^RPCRT4.dll"
+    "^SHELL32.dll"
+    "^SHLWAPI.dll"
+    "^WINMM.DLL"
+    "^WINSPOOL.DRV"
     )

   set(DLDEP_VERBOSE TRUE)


COMP: Fixed "error : Modules/ThirdParty/NIFTI/src/nifti/niftilib/itk_nifti_mangle.h: already exists in working directory" when trying to apply the patch itk_nifti_mangle.patch. Fix basically suggested by Floris, based on https://stackoverflow.com/questions/5807137/how-to-revert-uncommitted-changes-including-files-and-folders/5812972#5812972

--- SuperBuild/ExternalITK.cmake
+++ SuperBuild/ExternalITK.cmake
@@ -25,7 +25,7 @@
   GIT_REPOSITORY ${ITK_REPOSITORY}
   GIT_TAG ${ITK_TAG}
   UPDATE_COMMAND ""
-  PATCH_COMMAND "${GIT_EXECUTABLE}" reset --hard && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/itk_png_mangle_get_uint_31.patch" && "${GIT_EXECUTABLE}" apply "${CMAKE_SOURCE_DIR}/Patches/itk_nifti_mangle.patch"
+  PATCH_COMMAND "${GIT_EXECUTABLE}" reset --hard && "${GIT_EXECUTABLE}" clean --force && "${GIT_EXECUTABLE}" apply --whitespace=fix "${CMAKE_SOURCE_DIR}/Patches/itk_png_mangle_get_uint_31.patch" && "${GIT_EXECUTABLE}" apply "${CMAKE_SOURCE_DIR}/Patches/itk_nifti_mangle.patch"
   SOURCE_DIR ${proj}
   BINARY_DIR ${proj}-build
   CMAKE_ARGS


Copy and build the precompiled header in the binary directory

--- adm/cmake/BuildToolkit.cmake
+++ adm/cmake/BuildToolkit.cmake
@@ -7,8 +7,14 @@

 		# Generate precompiled header translation unit
 		get_filename_component(pch_basename ${PRECOMPILED_HEADER} NAME_WE)
-		set(pch_abs ${CMAKE_CURRENT_SOURCE_DIR}/${PRECOMPILED_HEADER})
 		set(pch_unity ${CMAKE_CURRENT_SOURCE_DIR}/Precompiled.cpp)
+
+		IF(MSVC)
+		    SET(pch_abs ${CMAKE_CURRENT_SOURCE_DIR}/${PRECOMPILED_HEADER})
+		ELSE()
+		    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/Precompiled.h ${CMAKE_CURRENT_BINARY_DIR}/Precompiled.h)
+		    SET(pch_abs ${CMAKE_CURRENT_BINARY_DIR}/${PRECOMPILED_HEADER})
+		ENDIF()

 		IF (PHASE EQUAL 2)
 			# A list of exclusions patterns. For the moment is global to the entire project


boost use script: targets optional, conditionals needed

issue https://github.com/smanders/externpro/issues/257#issuecomment-567203535

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -111,13 +111,15 @@
 set(reqVars ${PRJ}_VERSION ${PRJ}_INCLUDE_DIR ${PRJ}_LIBRARIES)
 if(UNIX)
   if(DEFINED ZLIB_LIBRARIES AND DEFINED BZIP2_LIBRARIES)
-    get_target_property(libs Boost::iostreams INTERFACE_LINK_LIBRARIES)
-    if(libs)
-      list(APPEND libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
-    else()
-      set(libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
+    if(TARGET Boost::iostreams)
+      get_target_property(libs Boost::iostreams INTERFACE_LINK_LIBRARIES)
+      if(libs)
+          list(APPEND libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
+      else()
+        set(libs ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES})
+      endif()
+      set_target_properties(Boost::iostreams PROPERTIES INTERFACE_LINK_LIBRARIES "${libs}")
     endif()
-    set_target_properties(Boost::iostreams PROPERTIES INTERFACE_LINK_LIBRARIES "${libs}")
     set(syslibs $<TARGET_FILE:${ZLIB_LIBRARIES}> $<TARGET_FILE:${BZIP2_LIBRARIES}>)
   endif()
   include(CheckLibraryExists)
@@ -134,7 +136,7 @@
   checkLibraryConcat(rt shm_open syslibs)
   list(APPEND ${PRJ}_LIBRARIES ${syslibs})
   checkLibraryConcat(rt clock_gettime additionalThreadLibs)
-  if(DEFINED additionalThreadLibs)
+  if(DEFINED additionalThreadLibs AND TARGET Boost::thread)
     get_target_property(libs Boost::thread INTERFACE_LINK_LIBRARIES)
     if(libs)
       list(APPEND libs ${additionalThreadLibs})
@@ -145,17 +147,19 @@
   endif()
 else()
   if(DEFINED ZLIB_LIBRARIES AND DEFINED BZIP2_LIBRARIES)
-    set(iodefs
-      BOOST_ZLIB_BINARY=$<TARGET_FILE:${ZLIB_LIBRARIES}>
-      BOOST_BZIP2_BINARY=$<TARGET_FILE:${BZIP2_LIBRARIES}>
-      )
-    get_target_property(defs Boost::iostreams INTERFACE_COMPILE_DEFINITIONS)
-    if(defs)
-      list(APPEND defs ${iodefs})
-    else()
-      set(defs ${iodefs})
+    if(TARGET Boost::iostreams)
+      set(iodefs
+        BOOST_ZLIB_BINARY=$<TARGET_FILE:${ZLIB_LIBRARIES}>
+        BOOST_BZIP2_BINARY=$<TARGET_FILE:${BZIP2_LIBRARIES}>
+        )
+      get_target_property(defs Boost::iostreams INTERFACE_COMPILE_DEFINITIONS)
+      if(defs)
+        list(APPEND defs ${iodefs})
+      else()
+        set(defs ${iodefs})
+      endif()
+      set_target_properties(Boost::iostreams PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${defs}")
     endif()
-    set_target_properties(Boost::iostreams PROPERTIES INTERFACE_COMPILE_DEFINITIONS "${defs}")
     set(${PRJ}_DEFINITIONS
       -DBOOST_ZLIB_BINARY=$<TARGET_FILE:${ZLIB_LIBRARIES}>
       -DBOOST_BZIP2_BINARY=$<TARGET_FILE:${BZIP2_LIBRARIES}>


cmake now finds boost 1.67 libraries

cmake now finds boost 1.67 libraries

issue https://github.com/smanders/externpro/issues/208

--- projects/use/usexp-boost-config.cmake
+++ projects/use/usexp-boost-config.cmake
@@ -61,8 +61,8 @@
   unset(Boost_${UPPERLIB}_LIBRARY_RELEASE CACHE)
 endforeach()
 string(REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.[0-9]+)?" "\\1.\\2" BOOST_VER2 ${BOOST_VER})
-set(Boost_ADDITIONAL_VERSIONS ${BOOST_VER} ${BOOST_VER2})
 if(UNIX)
+  set(Boost_ADDITIONAL_VERSIONS ${BOOST_VER} ${BOOST_VER2})
   if(DEFINED ZLIB_LIBRARIES AND DEFINED BZIP2_LIBRARIES)
     set(syslibs $<TARGET_FILE:${ZLIB_LIBRARIES}> $<TARGET_FILE:${BZIP2_LIBRARIES}>)
   endif()
@@ -92,6 +92,23 @@
     include(${CMAKE_CURRENT_LIST_DIR}/xpfunmac.cmake)
     xpGetCompilerPrefix(Boost_COMPILER GCC_TWO_VER)
     set(Boost_COMPILER "-${Boost_COMPILER}")
+  endif()
+  # TODO: remove the following once CMAKE_CXX_COMPILER_ARCHITECTURE_ID is defined for all supported compilers
+  #   https://gitlab.kitware.com/cmake/cmake/issues/17702
+  # boost versions >= 1.66.0 add an additional modifier to the library name and some compilers don't set the
+  # cmake variable used in FindBoost.cmake that's used to set _boost_ARCHITECTURE_TAG
+  #   https://gitlab.kitware.com/cmake/cmake/issues/17701
+  if(BOOST_VER VERSION_GREATER_EQUAL "1.66.0" AND "x${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "x")
+    execute_process(COMMAND uname --machine
+      OUTPUT_VARIABLE unameMachine
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+      ERROR_VARIABLE unameErr
+      )
+    if(DEFINED unameMachine AND NOT unameErr)
+      if(unameMachine STREQUAL x86_64)
+        set(CMAKE_CXX_COMPILER_ARCHITECTURE_ID x64)
+      endif()
+    endif()
   endif()
   find_package(Boost ${BOOST_VER} REQUIRED COMPONENTS ${Boost_LIBS})
   set(${PRJ}_FOUND ${Boost_FOUND})


TOOLCHAIN_PREFIX shall not end with -

TOOLCHAIN_PREFIX shall not end with -

--- deps/OpenSSL/OpenSSL.cmake
+++ deps/OpenSSL/OpenSSL.cmake
@@ -5,7 +5,7 @@
 set(_cross_arch "")
 set(_cross_comp_prefix_line "")
 if (CMAKE_CROSSCOMPILING)
-    set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}")
+    set(_cross_comp_prefix_line "--cross-compile-prefix=${TOOLCHAIN_PREFIX}-")

     if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64" OR ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "arm64")
         set(_cross_arch "linux-aarch64")


updated findcyclopts

updated findcyclopts

--- src/CMake/FindCYCLOPTS.cmake
+++ src/CMake/FindCYCLOPTS.cmake
@@ -7,7 +7,7 @@

 # if installed in a non-standard location,
 # the include directory must be added to the PATH variable
-FIND_PATH(CYCLOPTS_INCLUDE_DIR cyclopts/Variable.h
+FIND_PATH(CYCLOPTS_INCLUDE_DIR cyclopts/variable.h
   HINTS "${CYCLOPTS_INCLUDE_DIR}"
   HINTS "${CYCLOPTS_ROOT_DIR}"
   HINTS "${CYCLOPTS_ROOT_DIR}/include"


install: install missing module-related files

Fetched from Gentoo and Fedora.

Change-Id: I81914db86ed527f1345962eb72fe7ca9113a5be1

--- CMake/vtkModuleTop.cmake
+++ CMake/vtkModuleTop.cmake
@@ -445,11 +445,15 @@
                 CMake/pythonmodules.h.in
                 CMake/UseVTK.cmake
                 CMake/FindTCL.cmake
+                CMake/TopologicalSort.cmake
                 CMake/vtkTclTkMacros.cmake
                 CMake/vtk-forward.c.in
+                CMake/vtkGroups.cmake
                 CMake/vtkForwardingExecutable.cmake
                 CMake/vtkJavaWrapping.cmake
                 CMake/vtkMakeInstantiator.cmake
+                CMake/vtkMakeInstantiator.cxx.in
+                CMake/vtkMakeInstantiator.h.in
                 CMake/vtkModuleAPI.cmake
                 CMake/vtkModuleHeaders.cmake.in
                 CMake/vtkModuleInfo.cmake.in


COMP: Use fixed CTK for Visual Studio.

COMP: Use fixed CTK for Visual Studio.

--- CMakeExternals/CTK.cmake
+++ CMakeExternals/CTK.cmake
@@ -15,7 +15,7 @@

   if(NOT DEFINED CTK_DIR)

-    set(revision_tag 62a5c581)
+    set(revision_tag 1dd16ae7)
     #IF(${proj}_REVISION_TAG)
     #  SET(revision_tag ${${proj}_REVISION_TAG})
     #ENDIF()
@@ -61,7 +61,7 @@
       BINARY_DIR ${proj}-build
       PREFIX ${proj}-cmake
       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/CTK_${revision_tag}.tar.gz
-      URL_MD5 d18b18137caffdd30ec1fd978596245d
+      URL_MD5 03438db5c9a8324deb45d82c8a27784c
       UPDATE_COMMAND ""
       INSTALL_COMMAND ""
       CMAKE_GENERATOR ${gen}


Use VTK v5.10 in Superbuild

Use VTK v5.10 in Superbuild

--- CMakeExternals/VTK.cmake
+++ CMakeExternals/VTK.cmake
@@ -16,7 +16,7 @@
   MESSAGE(STATUS "Adding external project: ${proj}")
   ExternalProject_Add(${proj}
     GIT_REPOSITORY ${git_protocol}://vtk.org/VTK.git
-    GIT_TAG "origin/master"
+    GIT_TAG "v5.10.0"
     INSTALL_COMMAND ""
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${proj}-build


Check out 1.6 branch of googletest instead of head

--- reactor/cmake_modules/FindGTest.cmake
+++ reactor/cmake_modules/FindGTest.cmake
@@ -21,7 +21,7 @@
 ExternalProject_Add(
     googletest
     PREFIX ${EXTERNAL_ROOT}
-    SVN_REPOSITORY http://googletest.googlecode.com/svn/trunk/
+    SVN_REPOSITORY http://googletest.googlecode.com/svn/tags/release-1.6.0/
     TIMEOUT 10
     # Force separate output paths for debug and release builds to allow easy
     # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands


Explicitly configures PCRE library.

Explicitly configures PCRE library.

--- libs/pcre-config.cmake
+++ libs/pcre-config.cmake
@@ -30,6 +30,11 @@
   # Since this project uses a find_package() directive to include this
   # file, don't recurse back into the CMakeLists file.
   if(NOT ${PROJECT_NAME} STREQUAL pcre)
+    set(PCRE_STATIC ON)
+    set(PCRE_BUILD_PCRE8 ON)
+    set(PCRE_BUILD_PCRE16 ON)
+    set(PCRE_BUILD_PCRECPP OFF)
+    set(PCRE_SUPPORT_UTF ON)
     add_subdirectory(
       ${pcre_DIR}/pcre
       ${CMAKE_CURRENT_BINARY_DIR}/pcre
@@ -45,10 +50,9 @@

   # Export library targets.
   set(pcre_libraries
-    pcre
+    pcre pcre16
     CACHE INTERNAL "PCRE library" FORCE
   )
-    #pcre16

   # Usual "required" et. al. directive logic.
   include(FindPackageHandleStandardArgs)


working with boost more

working with boost more

--- appveyor.cmake
+++ appveyor.cmake
@@ -1 +1 @@
-set(BOOST_ROOT C:\projects\morebin\boost.1.58.0.0\lib\native CACHE PATH "")
+set(BOOST_ROOT "C:\projects\morebin\boost.1.58.0.0\lib\native" CACHE PATH "")


[CMake] [Darwin] [builtins] Apply OS and OS-arch filters to cc_kext builtin libraries.

We don't want to filter out the builtins that are present in libSystem like we do for the normal builtins because kexts can't link libSystem, but we should filter out all the builtins that are generally not supported on the OS and architecture.

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

--- cmake/Modules/CompilerRTDarwinUtils.cmake
+++ cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -272,11 +272,22 @@
     # Don't build cc_kext libraries for simulator platforms
     if(NOT ${os} MATCHES ".*sim$")
       foreach (arch ${DARWIN_BUILTIN_ARCHS})
+        # By not specifying MIN_VERSION this only reads the OS and OS-arch lists.
+        # We don't want to filter out the builtins that are present in libSystem
+        # because kexts can't link libSystem.
+        darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS
+                              OS ${os}
+                              ARCH ${arch})
+
+        darwin_filter_builtin_sources(filtered_sources
+          EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS
+          ${${arch}_SOURCES})
+
         # In addition to the builtins cc_kext includes some profile sources
         darwin_add_builtin_library(clang_rt cc_kext
                                 OS ${os}
                                 ARCH ${arch}
-                                SOURCES ${${arch}_SOURCES} ${PROFILE_SOURCES}
+                                SOURCES ${filtered_sources} ${PROFILE_SOURCES}
                                 CFLAGS -arch ${arch} -mkernel
                                 DEFS KERNEL_USE
                                 PARENT_TARGET builtins)


Fix pkgconfig generation

Fix pkgconfig generation

--- common/CommonAPICodeGenCommonConfig.cmake
+++ common/CommonAPICodeGenCommonConfig.cmake
@@ -91,9 +91,9 @@

 Name: ${interface} Common-API Service
 Description: ${interface} Common-API Service
-Version: 1
+Version:
 Requires: CommonAPI
-Libs: -Wl,--no-as-needed,-l${LIBRARY_NAME}_Backend,-Wl,--as-needed @DEVELOPMENT_LIBRARY_PATH@
+Libs: -Wl,--no-as-needed,-l${LIBRARY_NAME}_Backend,--as-needed @DEVELOPMENT_LIBRARY_PATH@
 Cflags: @DEVELOPMENT_INCLUDE_PATH@ -I\${includedir}/CommonAPIServices
 ")


Build coverage-enabled tests with CATCH_CONFIG_FAST_COMPILE

This improves compile time (159s -> 145s on my machine) and more importantly
makes the object files less unreasonably big (1.2 GB total -> 850 MB) which
should also reduce the amount of ram needed to link the executable, which has
been a problem in the past.

This comes at the cost of making error reporting when unexpected exceptions are
thrown significantly worse, but that doesn't really matter for coverage runs.

--- CMake/CodeCoverage.cmake
+++ CMake/CodeCoverage.cmake
@@ -20,7 +20,7 @@
 find_program(GENHTML_PATH genhtml)
 find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/tests)

-set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 -fprofile-arcs -ftest-coverage"
+set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 -fprofile-arcs -ftest-coverage -DCATCH_CONFIG_FAST_COMPILE"
     CACHE STRING "Flags used by the C++ compiler during coverage builds.")
 mark_as_advanced(CMAKE_CXX_FLAGS_COVERAGE)


ENH: ExternalData: Optionally hash files and create content links

Add option ExternalData_LINK_CONTENT to enable conversion of real data
files referenced by the DATA{} syntax into content links.

--- CMake/ExternalData.cmake
+++ CMake/ExternalData.cmake
@@ -78,6 +78,15 @@
 # members named <prefix><number><suffix>.  Note that the <suffix> of a series
 # does not include a hash-algorithm extension.  Both series configuration
 # variables have default values that work well for common cases.
+#
+# The variable ExternalData_LINK_CONTENT may be set to the name of a supported
+# hash algorithm to enable automatic conversion of real data files referenced
+# by the DATA{} syntax into content links.  For each such <file> a content
+# link named "<file><ext>" is created.  The original file is renamed to the
+# form ".ExternalData_<algo>_<hash>" to stage it for future transmission to
+# one of the locations in the list of URL templates (by means outside the
+# scope of this module).  The data fetch rule created for the content link
+# will use the staged object if it cannot be found using any URL template.

 #=============================================================================
 # Copyright 2010-2011 Kitware, Inc.
@@ -228,6 +237,26 @@
   file(RENAME "${tmp}" "${file}")
 endfunction()

+function(_ExternalData_link_content name var_ext)
+  if("${ExternalData_LINK_CONTENT}" MATCHES "^(MD5)$")
+    set(algo "${ExternalData_LINK_CONTENT}")
+  else()
+    message(FATAL_ERROR
+      "Unknown hash algorithm specified by ExternalData_LINK_CONTENT:\n"
+      "  ${ExternalData_LINK_CONTENT}")
+  endif()
+  _ExternalData_compute_hash(hash "${algo}" "${name}")
+  get_filename_component(dir "${name}" PATH)
+  set(staged "${dir}/.ExternalData_${algo}_${hash}")
+  set(ext ".md5")
+  _ExternalData_atomic_write("${name}${ext}" "${hash}\n")
+  file(RENAME "${name}" "${staged}")
+  set("${var_ext}" "${ext}" PARENT_SCOPE)
+
+  file(RELATIVE_PATH relname "${CMAKE_SOURCE_DIR}" "${name}${ext}")
+  message(STATUS "Linked ${relname} to ExternalData ${algo}/${hash}")
+endfunction()
+
 function(_ExternalData_arg target arg data var_file)
   # Convert to full path.
   if(IS_ABSOLUTE "${data}")
@@ -303,6 +332,9 @@
       set(file "${top_bin}/${relname}")
       if(alg)
         list(APPEND external "${file}|${name}|${alg}")
+      elseif(ExternalData_LINK_CONTENT)
+        _ExternalData_link_content("${name}" alg)
+        list(APPEND external "${file}|${name}|${alg}")
       else()
         list(APPEND internal "${file}|${name}")
       endif()
@@ -379,7 +411,7 @@
   file(RENAME "${tmp}" "${dst}")
 endfunction()

-function(_ExternalData_download_object hash algo var_obj)
+function(_ExternalData_download_object name hash algo var_obj)
   set(obj "${ExternalData_OBJECT_DIR}/${algo}/${hash}")
   if(EXISTS "${obj}")
     message(STATUS "Found object: \"${obj}\"")
@@ -414,9 +446,15 @@
     file(REMOVE "${tmp}")
   endforeach()

+  get_filename_component(dir "${name}" PATH)
+  set(staged "${dir}/.ExternalData_${algo}_${hash}")
+
   if(found)
     file(RENAME "${tmp}" "${obj}")
     message(STATUS "Downloaded object: \"${obj}\"")
+  elseif(EXISTS "${staged}")
+    set(obj "${staged}")
+    message(STATUS "Staged object: \"${obj}\"")
   else()
     message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}")
   endif()
@@ -440,7 +478,7 @@
     message(FATAL_ERROR "Unknown hash algorithm extension \"${ext}\"")
   endif()

-  _ExternalData_download_object("${hash}" "${algo}" obj)
+  _ExternalData_download_object("${name}" "${hash}" "${algo}" obj)

   # Check if file already corresponds to the object.
   set(file_up_to_date 0)


Changes from review

Changes from review

--- conan.cmake
+++ conan.cmake
@@ -350,7 +350,7 @@
     if(ARGUMENTS_CONAN_COMMAND)
        set(CONAN_CMD ${ARGUMENTS_CONAN_COMMAND})
     endif()
-    conan_check()
+    conan_check(REQUIRED)
     set(CONAN_OPTIONS "")
     if(ARGUMENTS_CONANFILE)
       set(CONANFILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE})
@@ -508,7 +508,7 @@
     # Arguments REQUIRED and VERSION are optional
     # Example usage:
     #    conan_check(VERSION 1.0.0 REQUIRED)
-    message(STATUS "Conan: checking conan executable in path")
+    message(STATUS "Conan: checking conan executable")
     set(options REQUIRED)
     set(oneValueArgs VERSION)
     cmake_parse_arguments(CONAN "${options}" "${oneValueArgs}" "" ${ARGN})
@@ -536,18 +536,20 @@

 function(conan_add_remote)
     # Adds a remote
-    # Arguments URL and NAME are required, INDEX is optional
+    # Arguments URL and NAME are required, INDEX and COMMAND is optional
     # Example usage:
     #    conan_add_remote(NAME bincrafters INDEX 1
     #       URL https://api.bintray.com/conan/bincrafters/public-conan)
-    set(oneValueArgs URL NAME INDEX)
+    set(oneValueArgs URL NAME INDEX COMMAND)
     cmake_parse_arguments(CONAN "" "${oneValueArgs}" "" ${ARGN})

     if(DEFINED CONAN_INDEX)
         set(CONAN_INDEX_ARG "-i ${CONAN_INDEX}")
     endif()
-
-    conan_check()
+    if(CONAN_COMMAND)
+       set(CONAN_CMD ${CONAN_COMMAND})
+    endif()
+    conan_check(REQUIRED)
     message(STATUS "Conan: Adding ${CONAN_NAME} remote repository (${CONAN_URL})")
     execute_process(COMMAND ${CONAN_CMD} remote add ${CONAN_NAME} ${CONAN_URL}
       ${CONAN_INDEX_ARG} -f)


Update common.cmake to link CoreFoundation on Apple to allow debug tooling

--- common.cmake
+++ common.cmake
@@ -21,6 +21,11 @@
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
     endif()
 endif()
+
+IF (APPLE)
+    FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation )
+    set(LIBS ${LIBS} ${COREFOUNDATION_LIBRARY})
+ENDIF (APPLE)

 if (${CXX11} MATCHES "ON")
     # Compiler-specific C++11 activation.


CMake: Remove unused wall option when FC=flang

--- cmake/fc.cmake
+++ cmake/fc.cmake
@@ -5,13 +5,8 @@

 if (${F_COMPILER} STREQUAL "FLANG")
   set(CCOMMON_OPT "${CCOMMON_OPT} -DF_INTERFACE_FLANG")
-  if (BINARY64)
-    if (INTERFACE64)
-      set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
-    endif ()
-    set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
-  else ()
-    set(FCOMMON_OPT "${FCOMMON_OPT} -Wall")
+  if (BINARY64 AND INTERFACE64)
+    set(FCOMMON_OPT "${FCOMMON_OPT} -i8")
   endif ()
   if (USE_OPENMP)
     set(FCOMMON_OPT "${FCOMMON_OPT} -fopenmp")


Find file changed to work with more-recent version. Also fixed to look for RenderManager things, rather than copy-paste-error Quatlib things.

--- RenderManager_xbox/cmake/FindosvrRenderManager.cmake
+++ RenderManager_xbox/cmake/FindosvrRenderManager.cmake
@@ -15,7 +15,7 @@
 	"${OSVRRENDERMANAGER_ROOT_DIR}"
 	CACHE
 	PATH
-	"Root directory to search for quatlib")
+	"Root directory to search for RenderManager")

 if("${CMAKE_SIZEOF_VOID_P}" MATCHES "8")
 	set(_libsuffixes lib64 lib)
@@ -43,7 +43,9 @@
 	PATH_SUFFIXES
 	include
 	PATHS
+	"${_progfiles}/osvrRenderManager"
 	"${_progfiles}/Sensics/osvrRenderManager0.6.18"
+	"${_progfiles}/Sensics/osvrRenderManager0.6.25"
 	)

 # Look for the library.
@@ -56,18 +58,20 @@
 	PATH_SUFFIXES
 	${_libsuffixes}
 	PATHS
+	"${_progfiles}/osvrRenderManager"
 	"${_progfiles}/Sensics/osvrRenderManager0.6.18"
+	"${_progfiles}/Sensics/osvrRenderManager0.6.25"
 	)

-# handle the QUIETLY and REQUIRED arguments and set QUATLIB_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set OSVRRENDERMANAGER_FOUND to TRUE if
 # all listed variables are TRUE
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(osvrRenderManager
 	DEFAULT_MSG
-	QUATLIB_LIBRARY
-	QUATLIB_INCLUDE_DIR)
+	OSVRRENDERMANAGER_LIBRARY
+	OSVRRENDERMANAGER_INCLUDE_DIR)

-if(QUATLIB_FOUND)
+if(OSVRRENDERMANAGER_FOUND)
 	set(OSVRRENDERMANAGER_LIBRARIES ${OSVRRENDERMANAGER_LIBRARY})
 	if(NOT WIN32)
 		list(APPEND OSVRRENDERMANAGER_LIBRARIES m)


[cmake] fix finding accelerate on darwin

--- cmake/Modules/FindCBLAS.cmake
+++ cmake/Modules/FindCBLAS.cmake
@@ -30,7 +30,7 @@

 # check Apple CBLAS
 if(NOT CBLAS_LIBRARIES)
-  FIND_AND_CHECK_CBLAS("Accelerate" "Accelerate/Accelerate.h" cblas_sgemm)
+  FIND_AND_CHECK_CBLAS("Accelerate" "Accelerate.h" cblas_sgemm)
 endif(NOT CBLAS_LIBRARIES)

 # OpenBLAS


Improve QHull finder script

Improve QHull finder script

* Make sure QHULL_LIBRARIES and QHULL_INCLUDE_DIRS variables are not
  defined if QHull is not found
* Make QHULL_LIBRARIES and QHULL_INCLUDE_DIRS advanced options
* Some reformatting

--- cmake/Modules/FindQhull.cmake
+++ cmake/Modules/FindQhull.cmake
@@ -6,7 +6,7 @@
 # QHULL_INCLUDE_DIRS - Directories containing the QHULL include files.
 # QHULL_LIBRARIES - Libraries needed to use QHULL.
 # QHULL_DEFINITIONS - Compiler flags for QHULL.
-# If QHULL_USE_STATIC is specified then look for static libraries ONLY else
+# If QHULL_USE_STATIC is specified then look for static libraries ONLY else
 # look for shared ones

 set(QHULL_MAJOR_VERSION 6)
@@ -22,7 +22,7 @@
 find_file(QHULL_HEADER
           NAMES libqhull/libqhull.h qhull.h
           HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}" "${QHULL_INCLUDE_DIR}"
-          PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
+          PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
           PATH_SUFFIXES qhull src/libqhull libqhull include)

 set(QHULL_HEADER "${QHULL_HEADER}" CACHE INTERNAL "QHull header" FORCE )
@@ -41,20 +41,18 @@
   set(QHULL_INCLUDE_DIR "QHULL_INCLUDE_DIR-NOTFOUND")
 endif(QHULL_HEADER)

-set(QHULL_INCLUDE_DIR "${QHULL_INCLUDE_DIR}" CACHE PATH "QHull include dir." FORCE)
-
-find_library(QHULL_LIBRARY
+find_library(QHULL_LIBRARY
              NAMES ${QHULL_RELEASE_NAME}
              HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
-             PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
+             PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
              PATH_SUFFIXES project build bin lib)

 get_filename_component(QHULL_LIBRARY_NAME "${QHULL_LIBRARY}" NAME)

-find_library(QHULL_LIBRARY_DEBUG
+find_library(QHULL_LIBRARY_DEBUG
              NAMES ${QHULL_DEBUG_NAME} ${QHULL_RELEASE_NAME}
              HINTS "${QHULL_ROOT}" "$ENV{QHULL_ROOT}"
-             PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
+             PATHS "$ENV{PROGRAMFILES}/QHull" "$ENV{PROGRAMW6432}/QHull"
              PATH_SUFFIXES project build bin lib debug/lib)

 if(NOT QHULL_LIBRARY_DEBUG)
@@ -63,13 +61,26 @@

 get_filename_component(QHULL_LIBRARY_DEBUG_NAME "${QHULL_LIBRARY_DEBUG}" NAME)

-set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
-set(QHULL_LIBRARIES optimized ${QHULL_LIBRARY} debug ${QHULL_LIBRARY_DEBUG})
+if(QHULL_INCLUDE_DIR AND QHULL_LIBRARY)
+
+  # Include directories
+  set(QHULL_INCLUDE_DIRS ${QHULL_INCLUDE_DIR})
+  unset(QHULL_INCLUDE_DIR)
+  mark_as_advanced(QHULL_INCLUDE_DIRS)
+
+  # Libraries
+  set(QHULL_LIBRARIES optimized ${QHULL_LIBRARY} debug ${QHULL_LIBRARY_DEBUG})
+  unset(QHULL_LIBRARY)
+  unset(QHULL_LIBRARY_DEBUG)
+  mark_as_advanced(QHULL_LIBRARIES)
+
+endif()

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Qhull DEFAULT_MSG QHULL_LIBRARY QHULL_INCLUDE_DIR)
-
-mark_as_advanced(QHULL_LIBRARY QHULL_LIBRARY_DEBUG QHULL_INCLUDE_DIR)
+find_package_handle_standard_args(Qhull
+  FOUND_VAR QHULL_FOUND
+  REQUIRED_VARS QHULL_LIBRARIES QHULL_INCLUDE_DIRS
+)

 if(QHULL_FOUND)
   set(HAVE_QHULL ON)


Fix typo

Fix typo

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

--- cmake/modules/FindBoost.cmake
+++ cmake/modules/FindBoost.cmake
@@ -7,7 +7,7 @@

 if (BOOST_INCLUDE_DIR)
   # Already in cache, be silent
-  set(BOOST_FIND_QUIETLY TRUE)
+  set(Boost_FIND_QUIETLY TRUE)
 endif (BOOST_INCLUDE_DIR)

 FIND_PATH(BOOST_INCLUDE_DIR boost/format.hpp


Added additional names for scalapack and blacs related libs on ubuntu 14.04

--- cmake/modules/FindMUMPS.cmake
+++ cmake/modules/FindMUMPS.cmake
@@ -38,7 +38,7 @@
 # Search for scalapack:
 #

-DEAL_II_FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack
+DEAL_II_FIND_LIBRARY(SCALAPACK_LIBRARY NAMES scalapack scalapack-openmpi
   HINTS ${SCALAPACK_DIR}
   PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib
   )
@@ -51,7 +51,7 @@
 FOREACH(_lib blacs blacsCinit blacsF77init)
   STRING(TOUPPER "${_lib}" _lib_upper)
   DEAL_II_FIND_LIBRARY(${_lib_upper}_LIBRARY
-    NAMES ${_lib} ${_lib}_MPI-LINUX-0 ${_lib}_MPI-DARWIN-0
+    NAMES ${_lib} ${_lib}_MPI-LINUX-0 ${_lib}_MPI-DARWIN-0 ${_lib}-openmpi
     HINTS ${BLACS_DIR} ${SCALAPACK_DIR} ${SCALAPACK_DIR}/../blacs/
     PATH_SUFFIXES lib${LIB_SUFFIX} lib64 lib LIB
   )


added some missing ABIs

added some missing ABIs

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

--- cmake/platforms/Android.cmake
+++ cmake/platforms/Android.cmake
@@ -45,6 +45,18 @@
 elseif( ANDROID_ABI STREQUAL "x86_64" )
  set( CMAKE_SYSTEM_PROCESSOR "x86_64" )
  set( ANDROID_TOOLCHAIN_NAME "x86_64-linux-android" )
+elseif( ANDROID_ABI STREQUAL "armeabi" )
+ set( CMAKE_SYSTEM_PROCESSOR "armv5te" )
+ set( ANDROID_TOOLCHAIN_NAME "arm-linux-androideabi" )
+elseif( ANDROID_ABI STREQUAL "aarch64" )
+ set( CMAKE_SYSTEM_PROCESSOR "aarch64" )
+ set( ANDROID_TOOLCHAIN_NAME "aarch64-linux-android" )
+elseif( ANDROID_ABI STREQUAL "mips" )
+ set( CMAKE_SYSTEM_PROCESSOR "mips" )
+ set( ANDROID_TOOLCHAIN_NAME "mipsel-linux-android" )
+elseif( ANDROID_ABI STREQUAL "mips64" )
+ set( CMAKE_SYSTEM_PROCESSOR "mips64" )
+ set( ANDROID_TOOLCHAIN_NAME "mips64el-linux-android" )
 else()
  message( SEND_ERROR "Unknown ANDROID_ABI = \"${ANDROID_ABI}\"." )
 endif()
@@ -101,4 +113,4 @@
 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
-set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )


Fixed FindBoost to find boost on cygwin.

--- cmake_modules/FindBoost.cmake
+++ cmake_modules/FindBoost.cmake
@@ -93,7 +93,7 @@
 # this module required CMake 2.5 for the Boost_FIND_VERSION stuff
 # CMAKE_MINIMUM_REQUIRED(VERSION "2.6" FATAL_ERROR) #todo

-# MESSAGE(STATUS "Finding Boost libraries.... ")
+#MESSAGE(STATUS "Finding Boost libraries.... ")

 OPTION(Boost_USE_MULTITHREADED "Use the multithreaded versions of the boost libraries" ON)

@@ -113,9 +113,10 @@

 MACRO (_Boost_ADJUST_LIB_VARS basename)
   IF (Boost_INCLUDE_DIR )
-    #MESSAGE(STATUS "Adjusting ${basename} ")
+    MESSAGE(STATUS "Adjusting ${basename} ")

     IF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE)
+      MESSAGE(STATUS "found both release and debug version")
       # if the generator supports configuration types then set
       # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
       IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
@@ -130,6 +131,7 @@

     # if only the release version was found, set the debug variable also to the release version
     IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
+      MESSAGE(STATUS "only release version found")
       SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
       SET(Boost_${basename}_LIBRARY       ${Boost_${basename}_LIBRARY_RELEASE})
       SET(Boost_${basename}_LIBRARIES     ${Boost_${basename}_LIBRARY_RELEASE})
@@ -137,6 +139,7 @@

     # if only the debug version was found, set the release variable also to the debug version
     IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
+      MESSAGE(STATUS "only debug version found")
       SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
       SET(Boost_${basename}_LIBRARY         ${Boost_${basename}_LIBRARY_DEBUG})
       SET(Boost_${basename}_LIBRARIES       ${Boost_${basename}_LIBRARY_DEBUG})
@@ -146,6 +149,7 @@
       SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
       GET_FILENAME_COMPONENT(Boost_LIBRARY_DIRS "${Boost_${basename}_LIBRARY}" PATH)
       SET(Boost_${basename}_FOUND ON CACHE BOOL "Was the boost boost ${basename} library found")
+      MESSAGE(STATUS "Boost component library found ${basename}")
     ENDIF (Boost_${basename}_LIBRARY)

   ENDIF (Boost_INCLUDE_DIR )
@@ -236,13 +240,13 @@
   ENDIF( NOT $ENV{BOOST_LIBRARYDIR} STREQUAL "" )

   IF( BOOST_ROOT )
-    IF (WIN32)
+    IF (WIN32 OR CYGWIN)
       SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT} ${_boost_INCLUDE_SEARCH_DIRS})
       SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_ROOT}/lib ${_boost_LIBRARIES_SEARCH_DIRS})
-    ELSE (WIN32)
+    ELSE (WIN32 OR CYGWIN)
       SET(_boost_INCLUDE_SEARCH_DIRS ${BOOST_ROOT}/include ${_boost_INCLUDE_SEARCH_DIRS})
       SET(_boost_LIBRARIES_SEARCH_DIRS ${BOOST_ROOT}/lib ${_boost_LIBRARIES_SEARCH_DIRS})
-    ENDIF (WIN32)
+    ENDIF (WIN32 OR CYGWIN)
   ENDIF( BOOST_ROOT )

   IF( BOOST_INCLUDEDIR )
@@ -261,6 +265,7 @@
     ENDIF (WIN32)
   ENDIF( BOOST_LIBRARYDIR )

+  MESSAGE(STATUS "Boost_INCLUDE_DIR = ${Boost_INCLUDE_DIR}" )
   #Try first in our own include search paths (e.g. BOOST_ROOT)
   FOREACH(_boost_VER ${_boost_TEST_VERSIONS})
     IF( NOT Boost_INCLUDE_DIR )
@@ -271,6 +276,7 @@
       SET(_boost_PATH_SUFFIX
         boost-${_boost_VER}
       )
+      MESSAGE(STATUS "try _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX}" )

       IF(_boost_PATH_SUFFIX MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
           STRING(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1_\\2_\\3" _boost_PATH_SUFFIX ${_boost_PATH_SUFFIX})
@@ -333,14 +339,20 @@
       MATH(EXPR Boost_SUBMINOR_VERSION "${Boost_VERSION} % 100")

     ENDIF(NOT "${Boost_VERSION}" STREQUAL "0")
+
+    MESSAGE(STATUS "Found one boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " )
   ENDIF(Boost_INCLUDE_DIR)

+  #MESSAGE(STATUS "Boost_FIND_VERSION_MAJOR=${Boost_FIND_VERSION_MAJOR}")
+  #MESSAGE(STATUS "required Boost_VERSION_MAJOR=${Boost_VERSION_MAJOR}")
+  #MESSAGE(STATUS "Boost_FIND_VERSION_MINOR=${Boost_FIND_VERSION_MINOR} ")
+  #MESSAGE(STATUS "required Boost_VERSION_MINOR=${Boost_VERSION_MINOR}")

   #Setting some more suffixes for the library
   SET (Boost_LIB_PREFIX "")
-  IF ( WIN32 )
+  IF ( WIN32 AND NOT CYGWIN)
     SET (Boost_LIB_PREFIX "lib")
-  ENDIF ( WIN32 )
+  ENDIF ( WIN32 AND NOT CYGWIN )
   SET (_boost_COMPILER "-gcc")
   IF (MSVC71)
     SET (_boost_COMPILER "-vc71")
@@ -365,6 +377,7 @@
         # This is for the intel compiler
         SET (_boost_COMPILER "-il")
       ELSE (NOT CMAKE_COMPILER_IS_GNUCC)
+        IF (NOT CYGWIN)
         #find out the version of gcc being used.
         EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
             ARGS --version
@@ -372,7 +385,8 @@
         )
         STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
                _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})
-        SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
+          SET (_boost_COMPILER "-gcc${_boost_COMPILER_VERSION}")
+        ENDIF (NOT CYGWIN)
       ENDIF (NOT CMAKE_COMPILER_IS_GNUCC)
     ENDIF (APPLE)
   ENDIF(UNIX)
@@ -394,6 +408,7 @@
   #  Begin finding boost libraries
   # ------------------------------------------------------------------------
   FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
+    MESSAGE(STATUS "look for component ${COMPONENT}")
     STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT)
     SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" )
     SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" )
@@ -408,7 +423,15 @@
         SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
       ENDIF(WIN32)
     ENDIF( Boost_USE_STATIC_LIBS )
-
+
+#    MESSAGE(STATUS "look for sufixes ${CMAKE_FIND_LIBRARY_SUFFIXES}")
+#    MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}")
+#    MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}")
+#    MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}")
+#    MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}")
+#    MESSAGE(STATUS "NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}")
+#    MESSAGE(STATUS "PATHS ${_boost_LIBRARIES_SEARCH_DIRS}")
+
     FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
         NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
@@ -416,10 +439,16 @@
                ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                ${Boost_LIB_PREFIX}boost_${COMPONENT}
         PATHS  ${_boost_LIBRARIES_SEARCH_DIRS}
-	NO_DEFAULT_PATH
+    	  NO_DEFAULT_PATH
     )
+    MESSAGE(STATUS "found ? ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")

     IF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )
+#      MESSAGE(STATUS "NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}")
+#      MESSAGE(STATUS "NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}")
+#      MESSAGE(STATUS "NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}")
+#      MESSAGE(STATUS "NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}")
+#      MESSAGE(STATUS "NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}")
       FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE
           NAMES  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION}
@@ -427,6 +456,7 @@
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}
                  ${Boost_LIB_PREFIX}boost_${COMPONENT}
       )
+#      MESSAGE(STATUS "found ? ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE}")
     ENDIF( NOT ${Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE} )

     FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG
@@ -461,19 +491,22 @@
     ${Boost_INCLUDE_DIR}
   )

-  # MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
-  # MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")
+  MESSAGE(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
+  MESSAGE(STATUS "Boost_LIBRARIES: ${Boost_LIBRARIES}")

   SET(Boost_FOUND FALSE)
   IF(Boost_INCLUDE_DIR)
     SET( Boost_FOUND TRUE )
     IF( Boost_FIND_VERSION_MAJOR AND Boost_VERSION_MAJOR LESS "${Boost_FIND_VERSION_MAJOR}" )
+      MESSAGE(STATUS "Boost major version less than required")
       SET( Boost_FOUND FALSE )
     ELSE( Boost_FIND_VERSION_MAJOR AND Boost_VERSION_MAJOR LESS "${Boost_FIND_VERSION_MAJOR}" )
       IF( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
+        MESSAGE(STATUS "Boost minor version less than required")
         SET( Boost_FOUND FALSE )
       ELSE( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
         IF( Boost_FIND_VERSION_PATCH AND Boost_VERSION_SUBMINOR LESS "${Boost_FIND_VERSION_PATCH}" )
+          MESSAGE(STATUS "Boost patch version less than required")
           SET( Boost_FOUND FALSE )
         ENDIF( Boost_FIND_VERSION_PATCH AND Boost_VERSION_SUBMINOR LESS "${Boost_FIND_VERSION_PATCH}" )
       ENDIF( Boost_FIND_VERSION_MINOR AND Boost_VERSION_MINOR LESS "${Boost_FIND_VERSION_MINOR}" )
@@ -483,6 +516,7 @@
       STRING(TOUPPER ${COMPONENT} COMPONENT)
       set(_boost_CHECKED_COMPONENT TRUE)
       IF(NOT Boost_${COMPONENT}_FOUND)
+        MESSAGE(STATUS "Boost component not found ${COMPONENT}")
         SET( Boost_FOUND FALSE)
       ENDIF(NOT Boost_${COMPONENT}_FOUND)
     ENDFOREACH(COMPONENT)
@@ -538,7 +572,7 @@
   ELSE (Boost_FOUND)
       IF (Boost_FIND_REQUIRED)
         MESSAGE(STATUS "Boost Version required: ${Boost_FIND_VERSION}. Found: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
-        MESSAGE(FATAL_ERROR "Couldn't find the Boost libraries and/or include irectory, or the version found is too old. Please install the Boost libraries AND development packages. You can set BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to help find Boost.")
+        MESSAGE(FATAL_ERROR "Couldn't find the Boost libraries and/or include directory, or the version found is too old. Please install the Boost libraries AND development packages. You can set BOOST_ROOT, BOOST_INCLUDEDIR and BOOST_LIBRARYDIR to help find Boost.")
       ENDIF(Boost_FIND_REQUIRED)
   ENDIF(Boost_FOUND)


Debugging arpack again

Debugging arpack again

Former-commit-id: 83272de8e273f9a7539953254f51218955f66ff8

--- cmake-modules/Fetch_Arpack-ng.cmake
+++ cmake-modules/Fetch_Arpack-ng.cmake
@@ -41,21 +41,12 @@
     include(${PROJECT_SOURCE_DIR}/cmake-modules/getExpandedTarget.cmake)
     expand_target_libs(blas BLAS_LIBRARIES)
     expand_target_libs(lapack LAPACK_LIBRARIES)
-#    foreach(lib ${BLAS_LIBRARIES})
-#        if(NOT ${lib} MATCHES "pthread")
-#            list(APPEND BLAS_LIBRARIES_WO_PTHREAD ${lib})
-#        endif()
-#    endforeach()
-#    foreach(lib ${LAPACK_LIBRARIES})
-#        if(NOT ${lib} MATCHES "pthread")
-#            list(APPEND LAPACK_LIBRARIES_WO_PTHREAD ${lib})
-#        endif()
-#    endforeach()
-#    list(APPEND BLAS_LIBRARIES_WO_PTHREAD " -lpthread -lm -ldl -Wl,--as-needed")
-#    list(APPEND LAPACK_LIBRARIES_WO_PTHREAD "-Wl,--no-as-needed -lpthread -lm -ldl -Wl,--as-needed")

-    string (REPLACE ";" "$<SEMICOLON>" BLAS_LIBRARIES_GENERATOR     "-Wl,--no-as-needed ${BLAS_LIBRARIES}")
-    string (REPLACE ";" "$<SEMICOLON>" LAPACK_LIBRARIES_GENERATOR   "-Wl,--no-as-needed ${LAPACK_LIBRARIES}")
+    string (REPLACE ";" "$<SEMICOLON>" BLAS_LIBRARIES_GENERATOR     "${BLAS_LIBRARIES}")
+    string (REPLACE ";" "$<SEMICOLON>" LAPACK_LIBRARIES_GENERATOR   "${LAPACK_LIBRARIES}")
+
+    message("BLAS_LIBRARIES_GENERATOR   : ${BLAS_LIBRARIES_GENERATOR}")
+    message("LAPACK_LIBRARIES_GENERATOR : ${LAPACK_LIBRARIES_GENERATOR}")
     ####################################################################
     set(ARPACK_FLAGS "-w -m64 -fPIC")
     include(ExternalProject)


Added xfeatures2d lib

Added xfeatures2d lib

--- cmake/CMakeModules/FindOpenCV.cmake
+++ cmake/CMakeModules/FindOpenCV.cmake
@@ -26,6 +26,7 @@
 # $Id$

 # Find include path:
+message("@@@@@@@@ IN FIND_OPENCV @@@@@@@@")
 find_path(OPENCV_INCLUDE_DIR opencv/cv.hpp PATHS /usr/include /usr/local/include)

 macro(FIND_OPENCV_LIBRARY MYLIBRARY MYLIBRARYNAME)
@@ -44,6 +45,7 @@
 FIND_OPENCV_LIBRARY(OPENCV_CONTRIB_LIBRARY opencv_contrib)
 FIND_OPENCV_LIBRARY(OPENCV_CORE_LIBRARY opencv_core)
 FIND_OPENCV_LIBRARY(OPENCV_FEATURES2D_LIBRARY opencv_features2d)
+FIND_OPENCV_LIBRARY(OPENCV_XFEATURES2D_LIBRARY opencv_xfeatures2d)
 FIND_OPENCV_LIBRARY(OPENCV_FLANN_LIBRARY opencv_flann)
 FIND_OPENCV_LIBRARY(OPENCV_GPU_LIBRARY opencv_gpu)
 FIND_OPENCV_LIBRARY(OPENCV_HIGHGUI_LIBRARY opencv_highgui)
@@ -57,6 +59,7 @@
 message( STATUS "OPENCV_CONTRIB_LIBRARY    = ${OPENCV_CONTRIB_LIBRARY}" )
 message( STATUS "OPENCV_CORE_LIBRARY       = ${OPENCV_CORE_LIBRARY}" )
 message( STATUS "OPENCV_FEATURES2D_LIBRARY = ${OPENCV_FEATURES2D_LIBRARY}" )
+message( STATUS "OPENCV_XFEATURES2D_LIBRARY = ${OPENCV_XFEATURES2D_LIBRARY}" )
 message( STATUS "OPENCV_FLANN_LIBRARY      = ${OPENCV_FLANN_LIBRARY}" )
 message( STATUS "OPENCV_GPU_LIBRARY        = ${OPENCV_GPU_LIBRARY}" )
 message( STATUS "OPENCV_HIGHGUI_LIBRARY    = ${OPENCV_HIGHGUI_LIBRARY}" )
@@ -69,13 +72,13 @@
 # Removed OPENCV_GPU_LIBRARY AND (drb 20140220)

 set(OPENCV_FOUND "NO")
-if(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+if(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
    set(OPENCV_FOUND "YES")
-   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CONTRIB_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_LEGACY_LIBRARY} ${OPENCV_ML_LIBRARY})
+   set(OPENCV_LIBRARIES ${OPENCV_CALIB3D_LIBRARY} ${OPENCV_CONTRIB_LIBRARY} ${OPENCV_CORE_LIBRARY} ${OPENCV_FEATURES2D_LIBRARY} ${OPENCV_XFEATURES2D_LIBRARY} ${OPENCV_FLANN_LIBRARY} ${OPENCV_HIGHGUI_LIBRARY} ${OPENCV_IMGPROC_LIBRARY} ${OPENCV_LEGACY_LIBRARY} ${OPENCV_ML_LIBRARY})
    message( STATUS "OPENCV_LIBRARIES          = ${OPENCV_LIBRARIES}" )
-else(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+else(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
    message( WARNING "Could not find OPENCV" )
-endif(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)
+endif(OPENCV_INCLUDE_DIR AND OPENCV_CALIB3D_LIBRARY AND OPENCV_CONTRIB_LIBRARY AND OPENCV_CORE_LIBRARY AND OPENCV_FEATURES2D_LIBRARY AND OPENCV_XFEATURES2D_LIBRARY AND OPENCV_FLANN_LIBRARY AND OPENCV_HIGHGUI_LIBRARY AND OPENCV_IMGPROC_LIBRARY AND OPENCV_LEGACY_LIBRARY AND OPENCV_ML_LIBRARY)

 set(OPENCV_GPU_FOUND "NO")
 if(OPENCV_FOUND AND OPENCV_GPU_LIBRARY)


Use a separate install prefix (with appended suffix "_incrtcl3") for itcl3
(and eventually the other [incr Tcl] version 3 components) because of name clashes with
[incr Tcl] version 4 components.

svn path=/trunk/; revision=12645

--- cmake/build_projects/itcl3/bp.cmake
+++ cmake/build_projects/itcl3/bp.cmake
@@ -76,16 +76,21 @@
 endif(MSYS_PLATFORM)
 #message(STATUS "modified BP_PATH for ${BP_PACKAGE} = ${BP_PATH}")

+# Eliminate this option which gives bad results for this package.
+string(REGEX REPLACE "-fvisibility=hidden" "" ${BP_PACKAGE}_SET_CFLAGS "${${BP_PACKAGE}_SET_CFLAGS}")
+
 if(BP_HAVE_64_BIT_OS)
   set(ITCL3_ENABLE_64_BIT --enable-64bit)
 endif(BP_HAVE_64_BIT_OS)
+
+set(INCRTCL3_PREFIX ${BP_CMAKE_INSTALL_PREFIX}_incrtcl3)

 ExternalProject_Add(
   build_${BP_PACKAGE}
   DEPENDS ${${BP_PACKAGE}_dependencies_targets}
   URL ${${BP_PACKAGE}_URL}
   URL_HASH ${${BP_PACKAGE}_DOWNLOAD_HASH_TYPE}=${${BP_PACKAGE}_DOWNLOAD_HASH}
-  CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} ${source_PATH}/${BP_CONFIGURE_COMMAND} --mandir=${BP_CMAKE_INSTALL_PREFIX}/share/man ${ITCL3_ENABLE_64_BIT} --with-tcl=${BP_CMAKE_INSTALL_PREFIX}/lib --with-tclinclude=${BP_CMAKE_INSTALL_PREFIX}/include
+  CONFIGURE_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${${BP_PACKAGE}_SET_CFLAGS} ${source_PATH}/configure --prefix=${INCRTCL3_PREFIX} --exec-prefix=${INCRTCL3_PREFIX}   --mandir=${INCRTCL3_PREFIX}/share/man ${ITCL3_ENABLE_64_BIT} --with-tcl=${BP_CMAKE_INSTALL_PREFIX}/lib --with-tclinclude=${BP_CMAKE_INSTALL_PREFIX}/include
   BUILD_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND}
   INSTALL_COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install
   )
@@ -96,11 +101,11 @@
   COMMAND echo "Replace build-tree locations by install-tree locations"
   COMMAND ${SED_EXECUTABLE}
   # Cover two different patterns of uppercasing.
-  -e "s@^\\(itcl_SRC_DIR='\\).*@\\1${BP_CMAKE_INSTALL_PREFIX}/include'@"
-  -e "s@^\\(ITCL_SRC_DIR='\\).*@\\1${BP_CMAKE_INSTALL_PREFIX}/include'@"
+  -e "s@^\\(itcl_SRC_DIR='\\).*@\\1${INCRTCL3_PREFIX}/include'@"
+  -e "s@^\\(ITCL_SRC_DIR='\\).*@\\1${INCRTCL3_PREFIX}/include'@"
   # Cover two different patterns of uppercasing.
-  -e "/itcl_B/s@='\\(-L\\)\\?.*build_itcl3@='\\1${BP_CMAKE_INSTALL_PREFIX}/lib/itcl${ITCL3_LIBVERSION}@"
-  -e "/ITCL_B/s@='\\(-L\\)\\?.*build_itcl3@='\\1${BP_CMAKE_INSTALL_PREFIX}/lib/itcl${ITCL3_LIBVERSION}@"
+  -e "/itcl_B/s@='\\(-L\\)\\?.*build_itcl3@='\\1${INCRTCL3_PREFIX}/lib/itcl${ITCL3_LIBVERSION}@"
+  -e "/ITCL_B/s@='\\(-L\\)\\?.*build_itcl3@='\\1${INCRTCL3_PREFIX}/lib/itcl${ITCL3_LIBVERSION}@"
   # Overwrite original file.
   -i itclConfig.sh
   APPEND
@@ -110,7 +115,7 @@
   OUTPUT
   ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-install
   COMMAND echo "Install-tree fixups"
-  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/itcl${ITCL3_LIBVERSION}/libitcl${ITCL3_LIBVERSION}.so
+  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${INCRTCL3_PREFIX}/lib/itcl${ITCL3_LIBVERSION}/libitcl${ITCL3_LIBVERSION}.so
   APPEND
   )


:arrow_up: use Clang 12 where available

:arrow_up: use Clang 12 where available

--- cmake/ci.cmake
+++ cmake/ci.cmake
@@ -13,12 +13,12 @@
 string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" ASTYLE_TOOL_VERSION "${ASTYLE_TOOL_VERSION}")
 message(STATUS "🔖 Artistic Style ${ASTYLE_TOOL_VERSION} (${ASTYLE_TOOL})")

-find_program(CLANG_TOOL NAMES clang++-HEAD clang++-11 clang++)
+find_program(CLANG_TOOL NAMES clang++-HEAD clang++-12 clang++-11 clang++)
 execute_process(COMMAND ${CLANG_TOOL} --version OUTPUT_VARIABLE CLANG_TOOL_VERSION ERROR_VARIABLE CLANG_TOOL_VERSION)
 string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TOOL_VERSION "${CLANG_TOOL_VERSION}")
 message(STATUS "🔖 Clang ${CLANG_TOOL_VERSION} (${CLANG_TOOL})")

-find_program(CLANG_TIDY_TOOL NAMES clang-tidy-11 clang-tidy)
+find_program(CLANG_TIDY_TOOL NAMES clang-tidy-12 clang-tidy-11 clang-tidy)
 execute_process(COMMAND ${CLANG_TIDY_TOOL} --version OUTPUT_VARIABLE CLANG_TIDY_TOOL_VERSION ERROR_VARIABLE CLANG_TIDY_TOOL_VERSION)
 string(REGEX MATCH "[0-9]+(\\.[0-9]+)+" CLANG_TIDY_TOOL_VERSION "${CLANG_TIDY_TOOL_VERSION}")
 message(STATUS "🔖 Clang-Tidy ${CLANG_TIDY_TOOL_VERSION} (${CLANG_TIDY_TOOL})")


Show the 'bad' Python header path if a mismatch occurs.

--- cmake_modules/py-FindPackageHandleStandardArgs.cmake
+++ cmake_modules/py-FindPackageHandleStandardArgs.cmake
@@ -239,7 +239,7 @@

       if(${_NAME}_FIND_VERSION_EXACT)       # exact version required
         if (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+          set(VERSION_MSG "Found unsuitable version \"${VERSION}\" in \"${PYTHON_INCLUDE_DIR}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
           set(VERSION_OK FALSE)
         else ()
           set(VERSION_MSG "(found suitable exact version \"${VERSION}\")")


[cmake] disable lpsolve when alberta is found

they both define a get_max_level free function, which
clang does not like at all

--- config.h.cmake
+++ config.h.cmake
@@ -23,5 +23,9 @@
 /* Define to the revision of dune-gdt */
 #define DUNE_GDT_VERSION_REVISION ${DUNE_GDT_VERSION_REVISION}

+// alberta and lpsolve both define a clashing get_max_level
+#if HAVE_LPSOLVE && HAVE_ALBERTA
+#undef HAVE_LPSOLVE
+#endif
 /* end dune-gdt */
 // NEVER delete/alter above comment, dune's cmake relies on it