Refine the toolchain even further & improve the speed even more

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -127,6 +127,14 @@
 #   command.
 #

+cmake_minimum_required(VERSION 3.8.0)
+
+# CMake invokes the toolchain file twice during the first build, but only once during subsequent rebuilds.
+if(IOS_TOOLCHAIN_HAS_RUN)
+  return()
+endif(IOS_TOOLCHAIN_HAS_RUN)
+set(IOS_TOOLCHAIN_HAS_RUN true)
+
 ###############################################################################
 #                                  OPTIONS                                    #
 ###############################################################################
@@ -184,16 +192,7 @@
   unset(FORCE_CACHE)
 endif()

-# Problem: CMake runs toolchain files multiple times, but can't read cache variables on some runs.
-# Workaround: On first run (in which cache variables are always accessible), set an intermediary environment variable.
-#
-# NOTE: This pattern is used i many places in this toolchain to speed up checks of all sorts
-if(DEFINED PLATFORM)
-  # Environment variables are always preserved.
-  set(ENV{_PLATFORM} "${PLATFORM}")
-elseif(DEFINED ENV{_PLATFORM})
-  set(PLATFORM "$ENV{_PLATFORM}")
-elseif(NOT DEFINED PLATFORM)
+if(NOT DEFINED PLATFORM)
   message(FATAL_ERROR "PLATFORM argument not set. Bailing configure since I don't know what target you want to build for!")
 endif ()

@@ -205,30 +204,23 @@
       " Supported PLATFORM values: \n * ${_supported_platforms_formatted}")
 endif()

-set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.")
-
 # Check if Apple Silicon is supported
-if(PLATFORM_INT MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$" AND ${CMAKE_VERSION} VERSION_LESS "3.19.5")
+if(PLATFORM MATCHES "^(MAC_ARM64)$|^(MAC_CATALYST_ARM64)$" AND ${CMAKE_VERSION} VERSION_LESS "3.19.5")
   message(FATAL_ERROR "Apple Silicon builds requires a minimum of CMake 3.19.5")
 endif()

 # Specify minimum version of deployment target.
-if(DEFINED DEPLOYMENT_TARGET)
-  # Environment variables are always preserved.
-  set(ENV{_DEPLOYMENT_TARGET} "${DEPLOYMENT_TARGET}")
-elseif(DEFINED ENV{_DEPLOYMENT_TARGET})
-  set(DEPLOYMENT_TARGET "$ENV{_DEPLOYMENT_TARGET}")
-elseif(NOT DEFINED DEPLOYMENT_TARGET)
-  if (PLATFORM_INT STREQUAL "WATCHOS" OR PLATFORM_INT STREQUAL "SIMULATOR_WATCHOS")
+if(NOT DEFINED DEPLOYMENT_TARGET)
+  if (PLATFORM STREQUAL "WATCHOS" OR PLATFORM STREQUAL "SIMULATOR_WATCHOS")
     # Unless specified, SDK version 4.0 is used by default as minimum target version (watchOS).
     set(DEPLOYMENT_TARGET "4.0" CACHE STRING "Minimum SDK version to build for.")
-  elseif(PLATFORM_INT MATCHES "MAC")
+  elseif(PLATFORM MATCHES "MAC")
     # Unless specified, SDK version 10.13 (High sierra) is used by default as minimum target version (macos).
     set(DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum SDK version to build for.")
-  elseif(PLATFORM_INT STREQUAL "MAC_ARM64")
+  elseif(PLATFORM STREQUAL "MAC_ARM64")
     # Unless specified, SDK version 11.0 (Big Sur) is used by default as minimum target version (macos on arm).
     set(DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum SDK version to build for.")
-  elseif(PLATFORM_INT MATCHES "(MAC_CATALYST|MAC_CATALYST_ARM64)")
+  elseif(PLATFORM MATCHES "(MAC_CATALYST|MAC_CATALYST_ARM64)")
     # Unless specified, SDK version 13.0 is used by default as minimum target version (mac catalyst minimum requirement).
     set(DEPLOYMENT_TARGET "13.0" CACHE STRING "Minimum SDK version to build for.")
   else()
@@ -236,18 +228,20 @@
     set(DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum SDK version to build for.")
   endif()
   message(STATUS "[DEFAULTS] Using the default min-version since DEPLOYMENT_TARGET not provided!")
-elseif(DEFINED DEPLOYMENT_TARGET AND PLATFORM_INT STREQUAL "MAC_CATALYST" AND ${DEPLOYMENT_TARGET} VERSION_LESS "13.0")
+elseif(DEFINED DEPLOYMENT_TARGET AND PLATFORM STREQUAL "MAC_CATALYST" AND ${DEPLOYMENT_TARGET} VERSION_LESS "13.0")
   message(FATAL_ERROR "Mac Catalyst builds requires a minimum deployment target of 13.0!")
 endif()

 # Handle the case where we are targeting iOS and a version above 10.3.4 (32-bit support dropped officially)
-if(PLATFORM_INT STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
-  set(PLATFORM_INT "OS64" CACHE STRING "" ${FORCE_CACHE})
+if(PLATFORM STREQUAL "OS" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
+  set(PLATFORM "OS64")
   message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
-elseif(PLATFORM_INT STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
-  set(PLATFORM_INT "SIMULATOR64" CACHE STRING "" ${FORCE_CACHE})
+elseif(PLATFORM STREQUAL "SIMULATOR" AND DEPLOYMENT_TARGET VERSION_GREATER_EQUAL 10.3.4)
+  set(PLATFORM "SIMULATOR64")
   message(STATUS "Targeting minimum SDK version ${DEPLOYMENT_TARGET}. Dropping 32-bit support.")
 endif()
+
+set(PLATFORM_INT "${PLATFORM}" CACHE STRING "Type of platform for which the build targets.")

 # Determine the platform name and architectures for use in xcodebuild commands
 # from the specified PLATFORM_INT name.
@@ -378,11 +372,11 @@
   message(FATAL_ERROR "Invalid PLATFORM: ${PLATFORM_INT}")
 endif()

-if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
+if(MODERN_CMAKE AND PLATFORM_INT MATCHES ".*COMBINED" AND NOT CMAKE_GENERATOR MATCHES "Xcode")
   message(FATAL_ERROR "The COMBINED options only work with Xcode generator, -G Xcode")
 endif()

-if(USED_CMAKE_GENERATOR MATCHES "Xcode" AND PLATFORM_INT MATCHES "MAC_CATALYST_.*")
+if(CMAKE_GENERATOR MATCHES "Xcode" AND PLATFORM_INT MATCHES "MAC_CATALYST_.*")
   set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
   set(CMAKE_XCODE_ATTRIBUTE_SUPPORTED_PLATFORMS "macosx")
   set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-maccatalyst")
@@ -394,17 +388,13 @@
 endif()

 # If user did not specify the SDK root to use, then query xcodebuild for it.
-if(DEFINED CMAKE_OSX_SYSROOT_INT)
-  # Environment variables are always preserved.
-  set(ENV{_CMAKE_OSX_SYSROOT_INT} "${CMAKE_OSX_SYSROOT_INT}")
-elseif(DEFINED ENV{_CMAKE_OSX_SYSROOT_INT})
-  set(CMAKE_OSX_SYSROOT_INT "$ENV{_CMAKE_OSX_SYSROOT_INT}")
-else()
+if(NOT DEFINED CMAKE_OSX_SYSROOT_INT)
   execute_process(COMMAND xcodebuild -version -sdk ${SDK_NAME} Path
       OUTPUT_VARIABLE CMAKE_OSX_SYSROOT_INT
       ERROR_QUIET
       OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()
+
 if (NOT DEFINED CMAKE_OSX_SYSROOT_INT AND NOT DEFINED CMAKE_OSX_SYSROOT)
   message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
   "is pointing to the correct path. Please run:"
@@ -418,7 +408,7 @@
 endif()

 # Set Xcode property for SDKROOT as well if Xcode generator is used
-#if(USED_CMAKE_GENERATOR MATCHES "Xcode")
+#if(CMAKE_GENERATOR MATCHES "Xcode")
 #  set(CMAKE_OSX_SYSROOT "${SDK_NAME}" CACHE INTERNAL "")
 #endif()

@@ -458,12 +448,7 @@
     "Whether or not to use strict compiler checks" ${FORCE_CACHE})

 # Get the SDK version information.
-if(DEFINED SDK_VERSION)
-  # Environment variables are always preserved.
-  set(ENV{_SDK_VERSION} "${SDK_VERSION}")
-elseif(DEFINED ENV{_SDK_VERSION})
-  set(SDK_VERSION "$ENV{_SDK_VERSION}")
-else()
+if(NOT DEFINED SDK_VERSION)
   execute_process(COMMAND xcodebuild -sdk ${CMAKE_OSX_SYSROOT_INT} -version SDKVersion
     OUTPUT_VARIABLE SDK_VERSION
     ERROR_QUIET
@@ -474,7 +459,7 @@
 # from CMAKE_OSX_SYSROOT.  Should be ../../ from SDK specified in
 # CMAKE_OSX_SYSROOT. There does not appear to be a direct way to obtain
 # this information from xcrun or xcodebuild.
-if (NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT USED_CMAKE_GENERATOR MATCHES "Xcode")
+if (NOT DEFINED CMAKE_DEVELOPER_ROOT AND NOT CMAKE_GENERATOR MATCHES "Xcode")
   get_filename_component(PLATFORM_SDK_DIR ${CMAKE_OSX_SYSROOT_INT} PATH)
   get_filename_component(CMAKE_DEVELOPER_ROOT ${PLATFORM_SDK_DIR} PATH)
   if (NOT DEFINED CMAKE_DEVELOPER_ROOT)
@@ -484,40 +469,33 @@
 endif()

 # Find the C & C++ compilers for the specified SDK.
-if(DEFINED CMAKE_C_COMPILER)
-  # Environment variables are always preserved.
-  set(ENV{_CMAKE_C_COMPILER} "${CMAKE_C_COMPILER}")
-elseif(DEFINED ENV{_CMAKE_C_COMPILER})
-  set(CMAKE_C_COMPILER "$ENV{_CMAKE_C_COMPILER}")
-else()
+if(NOT DEFINED CMAKE_C_COMPILER)
   execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang
     OUTPUT_VARIABLE CMAKE_C_COMPILER
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()
-if(DEFINED CMAKE_CXX_COMPILER)
-  # Environment variables are always preserved.
-  set(ENV{_CMAKE_CXX_COMPILER} "${CMAKE_CXX_COMPILER}")
-elseif(DEFINED ENV{_CMAKE_CXX_COMPILER})
-  set(CMAKE_CXX_COMPILER "$ENV{_CMAKE_CXX_COMPILER}")
-else()
+if(NOT DEFINED CMAKE_CXX_COMPILER)
   execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find clang++
     OUTPUT_VARIABLE CMAKE_CXX_COMPILER
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()
 # Find (Apple's) libtool.
-if(DEFINED BUILD_LIBTOOL)
-  # Environment variables are always preserved.
-  set(ENV{_BUILD_LIBTOOL} "${BUILD_LIBTOOL}")
-elseif(DEFINED ENV{_BUILD_LIBTOOL})
-  set(BUILD_LIBTOOL "$ENV{_BUILD_LIBTOOL}")
-else()
+if(NOT DEFINED BUILD_LIBTOOL)
   execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find libtool
     OUTPUT_VARIABLE BUILD_LIBTOOL
     ERROR_QUIET
     OUTPUT_STRIP_TRAILING_WHITESPACE)
 endif()
+# Find the toolchain's provided install_name_tool if none is found on the host
+if(NOT DEFINED CMAKE_INSTALL_NAME_TOOL)
+  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find install_name_tool
+          OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL
+          ERROR_QUIET
+          OUTPUT_STRIP_TRAILING_WHITESPACE)
+endif()
+
 # Configure libtool to be used instead of ar + ranlib to build static libraries.
 # This is required on Xcode 7+, but should also work on previous versions of
 # Xcode.
@@ -525,18 +503,6 @@
   "${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE STRING "" ${FORCE_CACHE})
 set(CMAKE_CXX_CREATE_STATIC_LIBRARY
   "${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE STRING "" ${FORCE_CACHE})
-# Find the toolchain's provided install_name_tool if none is found on the host
-if(DEFINED CMAKE_INSTALL_NAME_TOOL)
-  # Environment variables are always preserved.
-  set(ENV{_CMAKE_INSTALL_NAME_TOOL} "${CMAKE_INSTALL_NAME_TOOL}")
-elseif(DEFINED ENV{_CMAKE_INSTALL_NAME_TOOL})
-  set(CMAKE_INSTALL_NAME_TOOL "$ENV{_CMAKE_INSTALL_NAME_TOOL}")
-else()
-  execute_process(COMMAND xcrun -sdk ${CMAKE_OSX_SYSROOT_INT} -find install_name_tool
-      OUTPUT_VARIABLE CMAKE_INSTALL_NAME_TOOL
-      ERROR_QUIET
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-endif()

 # CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
 if(MODERN_CMAKE)
@@ -681,85 +647,101 @@
   set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO")
 endif()

-if(NOT IOS_TOOLCHAIN_HAS_RUN)
-  #Check if Xcode generator is used, since that will handle these flags automagically
-  if(USED_CMAKE_GENERATOR MATCHES "Xcode")
-    message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
-  else()
-    # Hidden visibility is required for C++ on iOS.
-    set(CMAKE_C_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}")
-    set(CMAKE_CXX_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}")
-    set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}")
-    set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}")
-    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}")
-    set(CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
-    set(CMAKE_CXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS}  -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
-    set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES}")
-
-    # In order to ensure that the updated compiler flags are used in try_compile()
-    # tests, we have to forcibly set them in the CMake cache, not merely set them
-    # in the local scope.
-    set(VARS_TO_FORCE_IN_CACHE
-      CMAKE_C_FLAGS
-      CMAKE_CXX_FLAGS
-      CMAKE_CXX_FLAGS_DEBUG
-      CMAKE_CXX_FLAGS_RELWITHDEBINFO
-      CMAKE_CXX_FLAGS_MINSIZEREL
-      CMAKE_CXX_FLAGS_RELEASE
-      CMAKE_C_LINK_FLAGS
-      CMAKE_CXX_LINK_FLAGS
-      CMAKE_ASM_FLAGS)
-    foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
-      set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" ${FORCE_CACHE})
-    endforeach()
-  endif()
-
-  ## Print status messages to inform of the current state
-  message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}")
-  message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}")
-  message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
-  message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
-  message(STATUS "Using libtool: ${BUILD_LIBTOOL}")
-  message(STATUS "Using install name tool: ${CMAKE_INSTALL_NAME_TOOL}")
-  if(DEFINED APPLE_TARGET_TRIPLE)
-    message(STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}")
-  endif()
-  message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}"
-      " (SDK version: ${SDK_VERSION})")
-  if(MODERN_CMAKE)
-    message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!")
-  endif()
-  if(USED_CMAKE_GENERATOR MATCHES "Xcode")
-    message(STATUS "Using Xcode version: ${XCODE_VERSION}")
-  endif()
-  message(STATUS "CMake version: ${CMAKE_VERSION}")
-  if(DEFINED SDK_NAME_VERSION_FLAGS)
-    message(STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}")
-  endif()
-  message(STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}")
-  if(ENABLE_BITCODE_INT)
-    message(STATUS "Bitcode: Enabled")
-  else()
-    message(STATUS "Bitcode: Disabled")
-  endif()
-
-  if(ENABLE_ARC_INT)
-    message(STATUS "ARC: Enabled")
-  else()
-    message(STATUS "ARC: Disabled")
-  endif()
-
-  if(NOT ENABLE_VISIBILITY_INT)
-    message(STATUS "Hiding symbols (-fvisibility=hidden).")
-  endif()
-
-  # Set global properties
-  set_property(GLOBAL PROPERTY PLATFORM "${PLATFORM}")
-  set_property(GLOBAL PROPERTY APPLE_TARGET_TRIPLE "${APPLE_TARGET_TRIPLE_INT}")
-  set_property(GLOBAL PROPERTY SDK_VERSION "${SDK_VERSION}")
-  set_property(GLOBAL PROPERTY XCODE_VERSION "${XCODE_VERSION}")
-endif()
+#Check if Xcode generator is used, since that will handle these flags automagically
+if(CMAKE_GENERATOR MATCHES "Xcode")
+  message(STATUS "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
+else()
+  # Hidden visibility is required for C++ on iOS.
+  set(CMAKE_C_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_C_FLAGS}")
+  set(CMAKE_CXX_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} ${BITCODE} ${VISIBILITY} -fvisibility-inlines-hidden -fobjc-abi-version=2 ${FOBJC_ARC} ${CMAKE_CXX_FLAGS}")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -O0 -g ${CMAKE_CXX_FLAGS_DEBUG}")
+  set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -DNDEBUG -Os -ffast-math ${CMAKE_CXX_FLAGS_MINSIZEREL}")
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -DNDEBUG -O2 -g -ffast-math ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -DNDEBUG -O3 -ffast-math ${CMAKE_CXX_FLAGS_RELEASE}")
+  set(CMAKE_C_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS} -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
+  set(CMAKE_CXX_LINK_FLAGS "${C_TARGET_FLAGS} ${SDK_NAME_VERSION_FLAGS}  -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")
+  set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -arch ${CMAKE_OSX_ARCHITECTURES}")
+
+  # In order to ensure that the updated compiler flags are used in try_compile()
+  # tests, we have to forcibly set them in the CMake cache, not merely set them
+  # in the local scope.
+  set(VARS_TO_FORCE_IN_CACHE
+    CMAKE_C_FLAGS
+    CMAKE_CXX_FLAGS
+    CMAKE_CXX_FLAGS_DEBUG
+    CMAKE_CXX_FLAGS_RELWITHDEBINFO
+    CMAKE_CXX_FLAGS_MINSIZEREL
+    CMAKE_CXX_FLAGS_RELEASE
+    CMAKE_C_LINK_FLAGS
+    CMAKE_CXX_LINK_FLAGS
+    CMAKE_ASM_FLAGS)
+  foreach(VAR_TO_FORCE ${VARS_TO_FORCE_IN_CACHE})
+    set(${VAR_TO_FORCE} "${${VAR_TO_FORCE}}" CACHE STRING "" ${FORCE_CACHE})
+  endforeach()
+endif()
+
+## Print status messages to inform of the current state
+message(STATUS "Configuring ${SDK_NAME} build for platform: ${PLATFORM_INT}, architecture(s): ${ARCHS}")
+message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT_INT}")
+message(STATUS "Using C compiler: ${CMAKE_C_COMPILER}")
+message(STATUS "Using CXX compiler: ${CMAKE_CXX_COMPILER}")
+message(STATUS "Using libtool: ${BUILD_LIBTOOL}")
+message(STATUS "Using install name tool: ${CMAKE_INSTALL_NAME_TOOL}")
+if(DEFINED APPLE_TARGET_TRIPLE)
+  message(STATUS "Autoconf target triple: ${APPLE_TARGET_TRIPLE}")
+endif()
+message(STATUS "Using minimum deployment version: ${DEPLOYMENT_TARGET}"
+    " (SDK version: ${SDK_VERSION})")
+if(MODERN_CMAKE)
+  message(STATUS "Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain!")
+endif()
+if(CMAKE_GENERATOR MATCHES "Xcode")
+  message(STATUS "Using Xcode version: ${XCODE_VERSION}")
+endif()
+message(STATUS "CMake version: ${CMAKE_VERSION}")
+if(DEFINED SDK_NAME_VERSION_FLAGS)
+  message(STATUS "Using version flags: ${SDK_NAME_VERSION_FLAGS}")
+endif()
+message(STATUS "Using a data_ptr size of: ${CMAKE_CXX_SIZEOF_DATA_PTR}")
+if(ENABLE_BITCODE_INT)
+  message(STATUS "Bitcode: Enabled")
+else()
+  message(STATUS "Bitcode: Disabled")
+endif()
+
+if(ENABLE_ARC_INT)
+  message(STATUS "ARC: Enabled")
+else()
+  message(STATUS "ARC: Disabled")
+endif()
+
+if(NOT ENABLE_VISIBILITY_INT)
+  message(STATUS "Hiding symbols (-fvisibility=hidden).")
+endif()
+
+# Set global properties
+set_property(GLOBAL PROPERTY PLATFORM "${PLATFORM}")
+set_property(GLOBAL PROPERTY APPLE_TARGET_TRIPLE "${APPLE_TARGET_TRIPLE_INT}")
+set_property(GLOBAL PROPERTY SDK_VERSION "${SDK_VERSION}")
+set_property(GLOBAL PROPERTY XCODE_VERSION "${XCODE_VERSION}")
+
+# Export configurable variables for the try_compile() command.
+set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
+    PLATFORM
+    XCODE_VERSION
+    SDK_VERSION
+    DEPLOYMENT_TARGET
+    CMAKE_DEVELOPER_ROOT
+    CMAKE_OSX_SYSROOT_INT
+    ENABLE_BITCODE
+    ENABLE_ARC
+    CMAKE_C_COMPILER
+    CMAKE_CXX_COMPILER
+    BUILD_LIBTOOL
+    CMAKE_INSTALL_NAME_TOOL
+    CMAKE_C_CREATE_STATIC_LIBRARY
+    CMAKE_CXX_CREATE_STATIC_LIBRARY
+    )

 set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
 set(CMAKE_SHARED_LINKER_FLAGS "-rpath @executable_path/Frameworks -rpath @loader_path/Frameworks")
@@ -789,8 +771,6 @@
       ${CMAKE_FRAMEWORK_PATH} CACHE STRING "Frameworks search paths" ${FORCE_CACHE})
 endif()

-set(IOS_TOOLCHAIN_HAS_RUN TRUE CACHE BOOL "Has the CMake toolchain run already?")
-
 # By default, search both the specified iOS SDK and the remainder of the host filesystem.
 if(NOT CMAKE_FIND_ROOT_PATH_MODE_PROGRAM)
   set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH CACHE STRING "" ${FORCE_CACHE})


Update FW: RGB orientation fix for OAK-1 (new versions) and OAK-1-Lite

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "4fae48c5d938fb0fb7463116f1eb3a247813dbc6")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "bfc908b0cbaa949254b8ae1c1b68f51d8ba7cb01")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Fix RGB alignment remapping when configured color camera resolution is different from calibration one

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "921b8a6a29fa445ea1c250d76dbe8694b5768584")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "7f7e0e7aa2d705d8e618605800fd3c2447a866dd")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


Call enable_language(CUDA) for better CUDA support

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1341,8 +1341,6 @@
 #---Check for CUDA-----------------------------------------------------------------------

 if(cuda OR tmva-gpu)
-  message(STATUS "Looking for CUDA")
-
   if(CMAKE_CXX_STANDARD EQUAL 11)
     find_package(CUDA 7.5)
   elseif(CMAKE_CXX_STANDARD EQUAL 14)
@@ -1351,6 +1349,7 @@
   else()
     message(FATAL_ERROR "CUDA not supported with C++${CMAKE_CXX_STANDARD}")
   endif()
+  enable_language(CUDA)
 endif()

 #---TMVA and its dependencies------------------------------------------------------------


Removing build warnings

Removing build warnings

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -100,6 +100,7 @@
   else()
     if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
       set(LZMA_CFLAGS "-Wno-format-nonliteral")
+      set(LZMA_LDFLAGS "-Qunused-arguments")
     elseif( CMAKE_CXX_COMPILER_ID STREQUAL Intel)
       set(LZMA_CFLAGS "-wd188 -wd181 -wd1292 -wd10006 -wd10156 -wd2259 -wd981 -wd128 -wd3179")
     endif()
@@ -108,7 +109,8 @@
       URL ${CMAKE_SOURCE_DIR}/core/lzma/src/xz-${lzma_version}.tar.gz
       URL_MD5 3e44c766c3fb4f19e348e646fcd5778a
       INSTALL_DIR ${CMAKE_BINARY_DIR}
-      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --with-pic --disable-shared CFLAGS=${LZMA_CFLAGS}
+      CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix <INSTALL_DIR> --with-pic --disable-shared --quiet
+                        CFLAGS=${LZMA_CFLAGS} LDFLAGS=${LZMA_LDFLAGS}
       BUILD_IN_SOURCE 1)
     set(LZMA_LIBRARIES ${CMAKE_BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}lzma${CMAKE_STATIC_LIBRARY_SUFFIX})
     set(LZMA_INCLUDE_DIR ${CMAKE_BINARY_DIR}/include)


Nagios Monitoring 5.4.0-rc5 Release Candidate 5

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

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


Nagios Monitoring 7.8.32-1 Gold

Nagios Monitoring 7.8.32-1 Gold

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

--- version.cmake
+++ version.cmake
@@ -6,6 +6,6 @@
 set ( HPCC_MAJOR 7 )
 set ( HPCC_MINOR 8 )
 set ( HPCC_POINT 32 )
-set ( HPCC_MATURITY "rc" )
+set ( HPCC_MATURITY "release" )
 set ( HPCC_SEQUENCE 1 )
 ###


CI: update android NDK to 15b

CI: update android NDK to 15b

--- ci-build.cmake
+++ ci-build.cmake
@@ -55,7 +55,7 @@
 if(DEFINED ENV{ANDROID})
     set(CROSS
         -DANDROID_NATIVE_API_LEVEL=21
-        -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r13b
+        -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b
         -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CMake/toolchain/android.toolchain.cmake
         "-DANDROID_ABI=armeabi-v7a with NEON")

@@ -71,13 +71,13 @@
         -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps)
     set(BUILD_DEPS TRUE)

-    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r13b)
+    if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b)
         message(STATUS "Downloading Android NDK")
         file(DOWNLOAD
-            http://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
-            ./android-ndk-r13b-linux-x86_64.zip)
+            http://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip
+            ./android-ndk-r15b-linux-x86_64.zip)
         message(STATUS "Extracting Android NDK")
-        execute_process(COMMAND unzip android-ndk-r13b-linux-x86_64.zip OUTPUT_QUIET)
+        execute_process(COMMAND unzip android-ndk-r15b-linux-x86_64.zip OUTPUT_QUIET)
     endif()
 endif()


Enable build of otb_depends

Enable build of otb_depends

--- CI/prepare_superbuild.cmake
+++ CI/prepare_superbuild.cmake
@@ -117,25 +117,25 @@
     CAPTURE_CMAKE_ERROR _configure_error
     )

-# if ( NOT _configure_rv EQUAL 0 )
-#   ctest_submit()
-#   message( SEND_ERROR "An error occurs during ctest_configure.")
-#   return()
-# endif()
-
-# ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
-#             TARGET "OTB_DEPENDS"
-#             RETURN_VALUE _build_rv
-#             CAPTURE_CMAKE_ERROR _build_error
-#             )
-
-# if ( NOT _build_rv EQUAL 0 )
-#   ctest_submit()
-#   message( SEND_ERROR "An error occurs during ctest_build.")
-#   return()
-# endif()
-
-# ctest_submit()
+if ( NOT _configure_rv EQUAL 0 )
+  ctest_submit()
+  message( SEND_ERROR "An error occurs during ctest_configure.")
+  return()
+endif()
+
+ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}"
+            TARGET "OTB_DEPENDS"
+            RETURN_VALUE _build_rv
+            CAPTURE_CMAKE_ERROR _build_error
+            )
+
+if ( NOT _build_rv EQUAL 0 )
+  ctest_submit()
+  message( SEND_ERROR "An error occurs during ctest_build.")
+  return()
+endif()
+
+ctest_submit()

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


Set install var for python that would otherwise fail on mac

--- python.cmake
+++ python.cmake
@@ -49,7 +49,8 @@
         LDFLAGS=${BUILDEM_LDFLAGS}
         CPPFLAGS=-I${BUILDEM_DIR}/include
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make
-    INSTALL_COMMAND     ${BUILDEM_ENV_STRING} make install
+    INSTALL_COMMAND     ${BUILDEM_ENV_STRING} make
+	PYTHONAPPSDIR=${BUILDEM_BIN_DIR}/${python_NAME} install
     BUILD_IN_SOURCE 1 # Required for Mac
 )


nxphlite config remove external_lgpl

nxphlite config remove external_lgpl

--- cmake/configs/nuttx_nxphlite-v3_default.cmake
+++ cmake/configs/nuttx_nxphlite-v3_default.cmake
@@ -151,7 +151,6 @@
 	lib/mathlib/math/filter
 	lib/rc
 	lib/ecl
-	lib/external_lgpl
 	lib/geo
 	lib/geo_lookup
 	lib/conversion


Fix module load error

Fix module load error

--- GNUModules.cmake
+++ GNUModules.cmake
@@ -113,8 +113,7 @@
   "\n"
   "module-whatis   \"Loads the environment for $package_name\"\n"
   "\n"
-  "proc ModulesHelp { }\n"
-  "{\n"
+  "proc ModulesHelp { } {\n"
   "    global package_name version architecture\n"
   "\n"
   "    puts stderr \"This module prepares your environment to run $package_name $version "


Add on-device python bindings

Add on-device python bindings

--- cmake/Depthai/DepthaiDeviceSideConfig.cmake
+++ cmake/Depthai/DepthaiDeviceSideConfig.cmake
@@ -2,7 +2,7 @@
 set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "1cf87b1566fe836d48523c7dcbd6fc22d3fde096")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "7b4bdeae4f533516f850f283b69afd86a9af6ff2")

 # "version if applicable"
 set(DEPTHAI_DEVICE_SIDE_VERSION "")


px4fmu-v2 enable ll40ls and frsky_telemetry

 - closes #6686
 - closes #6294

--- cmake/configs/nuttx_px4fmu-v2_default.cmake
+++ cmake/configs/nuttx_px4fmu-v2_default.cmake
@@ -28,7 +28,7 @@
 	#drivers/mb12xx
 	#drivers/srf02
 	drivers/sf0x
-	#drivers/ll40ls
+	drivers/ll40ls
 	drivers/trone
 	drivers/gps
 	drivers/pwm_out_sim
@@ -39,7 +39,7 @@
 	drivers/airspeed
 	drivers/ets_airspeed
 	drivers/meas_airspeed
-	#drivers/frsky_telemetry
+	drivers/frsky_telemetry
 	modules/sensors
 	#drivers/mkblctrl
 	drivers/px4flow


Revert "Use builtin OpenSSL for builtin XRootD, if needed"

This reverts commit 7a3ab5786dd3397836cad96ddf6586b79133a471,
as it fails on Mac OS with either duplicate or missing symbols.
Related issue: https://github.com/xrootd/xrootd/issues/760.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -914,17 +914,6 @@
   set(XROOTD_LIBRARIES ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdUtils${CMAKE_SHARED_LIBRARY_SUFFIX}
                        ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdClient${CMAKE_SHARED_LIBRARY_SUFFIX}
                        ${XROOTD_ROOTDIR}/${_LIBDIR_DEFAULT}/libXrdCl${CMAKE_SHARED_LIBRARY_SUFFIX})
-
-  if(builtin_openssl)
-    set(XROOTD_OPENSSL_OPTS
-      -DOPENSSL_VERSION:STRING=${OPENSSL_VERSION}
-      -DOPENSSL_INCLUDE_DIR:PATH=${OPENSSL_INCLUDE_DIR}
-      -DOPENSSL_INCLUDE_DIRS:PATH=${OPENSSL_INCLUDE_DIR}
-      -DOPENSSL_LIBRARY:PATH=${OPENSSL_LIBRARY}
-      -DOPENSSL_LIBRARIES:PATH=${OPENSSL_LIBRARIES}
-    )
-  endif()
-
   ExternalProject_Add(
     XROOTD
     URL ${XROOTD_SRC_URI}
@@ -939,17 +928,11 @@
                -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
                -DENABLE_PYTHON=OFF
                -DENABLE_CEPH=OFF
-               ${XROOTD_OPENSSL_OPTS}
     INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install
             COMMAND ${CMAKE_COMMAND} -E copy_directory <INSTALL_DIR>/include/xrootd <INSTALL_DIR>/include
     LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1
     BUILD_BYPRODUCTS ${XROOTD_LIBRARIES}
   )
-
-  if(builtin_openssl)
-    add_dependencies(XROOTD OPENSSL)
-  endif()
-
   # We cannot call find_package(XROOTD) becuase the package is not yet built. So, we need to emulate what it defines....
   set(XROOTD_INCLUDE_DIRS ${XROOTD_ROOTDIR}/include/xrootd ${XROOTD_ROOTDIR}/include/xrootd/private)
   set(XROOTD_NOMAIN TRUE)


TEST: jira #1316

TEST: jira #1316

--- Packaging/testing.cmake
+++ Packaging/testing.cmake
@@ -30,3 +30,9 @@
   )

 set_tests_properties ( Tu_selftester PROPERTIES DEPENDS Tu_install_package)
+
+add_test(
+  NAME Tu_uninstall_otb
+  COMMAND ${pkg_extracted_dir}/uninstall_otb${my_ext}
+  WORKING_DIRECTORY ${testing_dir}
+  )


doc: CMAKE_MODULE_PATH needs to be modified

--- FindICU.cmake
+++ FindICU.cmake
@@ -12,7 +12,10 @@
 #
 # Example Usage:
 #
-#   Call find_package() once, here are some examples to pick from
+#   1. Copy this file in the root of your project source directory
+#   2. Then, tell CMake to search this non-standard module in your project directory by adding to your CMakeLists.txt:
+#     set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR})
+#   3. Finally call find_package() once, here are some examples to pick from
 #
 #   Require ICU 4.4 or later
 #     find_package(ICU 4.4 REQUIRED)


try to find out compiler flags

try to find out compiler flags

--- FindICU.cmake
+++ FindICU.cmake
@@ -100,6 +100,12 @@
 set(${ICU_PUBLIC_VAR_NS}_FOUND TRUE)
 set(${ICU_PUBLIC_VAR_NS}_LIBRARIES )
 set(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS )
+set(${ICU_PUBLIC_VAR_NS}_C_FLAGS "")
+set(${ICU_PUBLIC_VAR_NS}_CXX_FLAGS "")
+set(${ICU_PUBLIC_VAR_NS}_CPP_FLAGS "")
+set(${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS "")
+set(${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS "")
+set(${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS "")
 foreach(${ICU_PRIVATE_VAR_NS}_COMPONENT ${${ICU_PRIVATE_VAR_NS}_COMPONENTS})
     string(TOUPPER "${${ICU_PRIVATE_VAR_NS}_COMPONENT}" ${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT)
     set("${ICU_PUBLIC_VAR_NS}_${${ICU_PRIVATE_VAR_NS}_UPPER_COMPONENT}_FOUND" FALSE) # may be done in the icu_declare_component macro
@@ -241,9 +247,20 @@
             list(APPEND ${ICU_PUBLIC_VAR_NS}_LIBRARIES ${${ICU_PRIVATE_VAR_NS}_LIB_${${ICU_PRIVATE_VAR_NS}_COMPONENT}})
         endif(NOT ${ICU_PRIVATE_VAR_NS}_LIB_RELEASE_${${ICU_PRIVATE_VAR_NS}_COMPONENT} AND NOT ${ICU_PRIVATE_VAR_NS}_LIB_DEBUG_${${ICU_PRIVATE_VAR_NS}_COMPONENT})
     endforeach(${ICU_PRIVATE_VAR_NS}_COMPONENT)
-endif(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
-
-if(${ICU_PUBLIC_VAR_NS}_INCLUDE_DIRS)
+
+    # Try to find out compiler flags
+    find_program(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE HINTS ${${ICU_PRIVATE_VAR_NS}_ROOT} icu-config)
+    if(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_C_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cxxflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CXX_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+        execute_process(COMMAND ${${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE} --cppflags-dynamic OUTPUT_VARIABLE ${ICU_PUBLIC_VAR_NS}_CPP_SHARED_FLAGS OUTPUT_STRIP_TRAILING_WHITESPACE)
+    endif(${ICU_PUBLIC_VAR_NS}_CONFIG_EXECUTABLE)
+
+    # Check find_package arguments
     include(FindPackageHandleStandardArgs)
     if(${ICU_PUBLIC_VAR_NS}_FIND_REQUIRED AND NOT ${ICU_PUBLIC_VAR_NS}_FIND_QUIETLY)
         find_package_handle_standard_args(
@@ -279,6 +296,13 @@
 icudebug("LE_FOUND")
 icudebug("LX_FOUND")
 icudebug("DATA_FOUND")
+# Flags
+icudebug("C_FLAGS")
+icudebug("CPP_FLAGS")
+icudebug("CXX_FLAGS")
+icudebug("C_SHARED_FLAGS")
+icudebug("CPP_SHARED_FLAGS")
+icudebug("CXX_SHARED_FLAGS")
 # Linking
 icudebug("INCLUDE_DIRS")
 icudebug("LIBRARIES")


cmake windows: fix a typo

cmake windows: fix a typo

--- config.h.cmake
+++ config.h.cmake
@@ -118,7 +118,7 @@
 #cmakedefine HAVE_MECAB_DICTIONARY_INFO_T

 /* functions */
-#cmakedefine HAVE__STRICMP
+#cmakedefine HAVE__STRNICMP
 #cmakedefine HAVE__STRTOUI64
 #cmakedefine HAVE_BACKTRACE
 #cmakedefine HAVE_CLOCK


Update ITK along 5.2 development branch.

This update includes fixes for the MRCImageIO.

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

-set(_DEFAULT_ITK_GIT_TAG "2b92d3973c18526f4c82965ef3dc286e7a685c6f")
+set(_DEFAULT_ITK_GIT_TAG "facce8fcf63a31215df82b636ba7743ddcc63c4b")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


Update SimpleITK Superbuild version to 4.13.2

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

-set(ITK_GIT_TAG "8862e36ad879b46d6cb3e8682852d78d5673accd" CACHE STRING "Tag in ITK git repo") # along release-4.13
+set(ITK_GIT_TAG "v4.13.2" CACHE
+  STRING "Tag in ITK git repo") # release-4.13
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


ENH: Bump ITK ExternalProject to v5.0rc01

--- Superbuild/External-ITK.cmake
+++ Superbuild/External-ITK.cmake
@@ -2,8 +2,7 @@
 # Get and build itk

 if(NOT ITK_TAG)
-  # 2018-09-27
-  set(ITK_TAG "5e61c289a677a74bffa4c113bf991a18f4b98495")
+  set(ITK_TAG "v5.0rc01")
 endif()

 set(_vtk_args)


Fixed path to copy tensorflow license on install

--- cmake/InstallFAST.cmake
+++ cmake/InstallFAST.cmake
@@ -212,7 +212,7 @@

 if(FAST_MODULE_TensorFlow)
     # Tensorflow license
-	install(FILES ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow/LICENSE
+	install(FILES ${FAST_EXTERNAL_BUILD_DIR}/tensorflow/src/tensorflow_download/LICENSE
         DESTINATION fast/licenses/tensorflow/
     )
 endif()


Updated FindPGSQL to look for Kerberos

Updated FindPGSQL to look for Kerberos

--- lib/FindPGSQL.cmake
+++ lib/FindPGSQL.cmake
@@ -36,22 +36,54 @@
 	SET(GSASL_LIBRARY)
 ENDIF (GSASL_LIBRARY STREQUAL "GSASL_LIBRARY-NOTFOUND")

+FIND_LIBRARY(KRB5_LIBRARY
+	NAMES
+		krb5
+	PATHS
+		/usr/lib
+		/usr/local/lib
+		/usr/lib/x86_64-linux-gnu/mit-krb5/
+		)
+
+IF (KRB5_LIBRARY STREQUAL "KRB5_LIBRARY-NOTFOUND")
+	SET(KRB5_LIBRARY)
+ENDIF (KRB5_LIBRARY STREQUAL "KRB5_LIBRARY-NOTFOUND")
+
+FIND_LIBRARY(GSSAPI_KRB5_LIBRARY
+	NAMES
+		gssapi_krb5
+	PATHS
+		/usr/lib
+		/usr/local/lib
+		/usr/lib/x86_64-linux-gnu/mit-krb5/
+		)
+
+IF (GSSAPI_KRB5_LIBRARY STREQUAL "GSSAPI_KRB5_LIBRARY-NOTFOUND")
+	SET(GSSAPI_KRB5_LIBRARY)
+ENDIF (GSSAPI_KRB5_LIBRARY STREQUAL "GSSAPI_KRB5_LIBRARY-NOTFOUND")
+
 # Copy the results to the output variables.
-IF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND GSASL_LIBRARY)
+IF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND KRB5_LIBRARY AND
+		GSSAPI_KRB5_LIBRARY AND GSASL_LIBRARY)
 	SET(PGSQL_FOUND 1)
 	SET(PGSQL_LIBRARIES ${PGSQL_LIBRARY}
-			com_err crypto ssl ldap krb5 gssapi_krb5 ${GSASL_LIBRARY})
+			com_err crypto ssl ldap
+			${KRB5_LIBRARY} ${GSSAPI_KRB5_LIBRARY} ${GSASL_LIBRARY})
 	SET(PGSQL_INCLUDE_DIRS ${PGSQL_INCLUDE_DIR})
-ELSE (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND GSASL_LIBRARY)
+ELSE (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND KRB5_LIBRARY AND
+		GSSAPI_KRB5_LIBRARY AND GSASL_LIBRARY)
 	SET(PGSQL_FOUND 0)
 	SET(PGSQL_LIBRARIES)
 	SET(PGSQL_INCLUDE_DIRS)
-ENDIF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND GSASL_LIBRARY)
+ENDIF (PGSQL_INCLUDE_DIR AND PGSQL_LIBRARY AND KRB5_LIBRARY AND
+		GSSAPI_KRB5_LIBRARY AND GSASL_LIBRARY)

 # Report the results.
 IF (NOT PGSQL_FOUND)
 	IF (NOT GSASL_LIBRARY)
 		SET(PGSQL_DIR_MESSAGE "PostgreSQL missing required library. PostgreSQL support requires the Gnu SASL library.")
+	ELSEIF (NOT KRB5_LIBRARY OR NOT GSSAPI_KRB5_LIBRARY)
+		SET(PGSQL_DIR_MESSAGE "PostgreSQL missing required library. PostgreSQL support requires the MIT Kerberos library.")
 	ELSE (NOT GSASL_LIBRARY)
 		SET(PGSQL_DIR_MESSAGE "PostgreSQL was not found. Make sure PGSQL_LIBRARY and PGSQL_INCLUDE_DIR are set.")
 	ENDIF (NOT GSASL_LIBRARY)


Changing variable name to better reflect its purpose.  https://tracker.physiomeproject.org/show_bug.cgi?id=2648

--- source/configure/GenerateVersionHeader.cmake
+++ source/configure/GenerateVersionHeader.cmake
@@ -7,7 +7,7 @@
 STRING( REGEX REPLACE "/[^/]+$" "" VERSION_EXE_PATH ${VERSION_EXE_LOCATION} )
 STRING( REGEX MATCH "[^/]+$" INTDIR ${VERSION_EXE_PATH} )
 STRING( TOLOWER ${INTDIR} LOWERCASE_CURRENT_BUILD_TYPE )
-Subversion_GET_REVISION( ${FILE_IN_CMGUI_SVN_REPOSITORY} SVN_REVISION )
+Subversion_GET_REVISION( ${CMGUI_SVN_REPOSITORY_DIR} SVN_REVISION )
 EXECUTE_PROCESS(COMMAND ${VERSION_EXE_LOCATION}
     OUTPUT_VARIABLE DATE_TIME_STRING OUTPUT_STRIP_TRAILING_WHITESPACE)


Upgrade snappy to 1.1.0

Upgrade snappy to 1.1.0

--- snappy.cmake
+++ snappy.cmake
@@ -11,9 +11,9 @@
 include (BuildSupport)

 external_source (snappy
-    1.0.5
-    snappy-1.0.5.tar.gz
-    4c0af044e654f5983f4acbf00d1ac236
+    1.1.0
+    snappy-1.1.0.tar.gz
+    c8f3ef29b5281e78f4946b2d739cea4f
     http://snappy.googlecode.com/files)

 message ("Installing ${snappy_NAME} into build area: ${BUILDEM_DIR} ...")
@@ -54,4 +54,4 @@

 set (snappy_STATIC_LIBRARIES ${BUILDEM_LIB_DIR}/libsnappy.a)

-endif (NOT snappy_NAME)+endif (NOT snappy_NAME)


Propagate CMake variables related to compiler standard  and extension

If the SimpleITK Superbuild was configured with CMake variables such
as:

  -DCMAKE_CXX_STANDARD:STRING=11
  -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=ON
  -DCMAKE_CXX_EXTENSIONS:BOOL=OFF

Then these options were not propagated to the external projects in the
superbuild.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -193,6 +193,9 @@
   CMAKE_C_FLAGS_MINSIZEREL
   CMAKE_C_FLAGS_RELEASE
   CMAKE_C_FLAGS_RELWITHDEBINFO
+  CMAKE_C_STANDARD
+  CMAKE_C_STANDARD_REQUIRED
+  CMAKE_C_EXTENSIONS

   CMAKE_CXX_COMPILER
   CMAKE_CXX_COMPILER_LAUNCHER
@@ -202,6 +205,9 @@
   CMAKE_CXX_FLAGS_MINSIZEREL
   CMAKE_CXX_FLAGS_RELEASE
   CMAKE_CXX_FLAGS_RELWITHDEBINFO
+  CMAKE_CXX_STANDARD
+  CMAKE_CXX_STANDARD_REQUIRED
+  CMAKE_CXX_EXTENSIONS

   CMAKE_LINKER


CHG: replaced -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE by -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS to suppress VC8 warnings which are mainly caused by Qt3

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -45,7 +45,7 @@
 # suppress some warnings in VC8 about using unsafe/deprecated c functions
 MACRO(SUPPRESS_VC8_DEPRECATED_WARNINGS)
 IF(MSVC80)
-  ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
+  ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
 ENDIF(MSVC80)
 ENDMACRO(SUPPRESS_VC8_DEPRECATED_WARNINGS)


CMake prefer Ruby_EXECUTABLE

CMake prefer Ruby_EXECUTABLE

--- CMake/sitkAddTest.cmake
+++ CMake/sitkAddTest.cmake
@@ -124,7 +124,11 @@
     return()
   endif()

-  set(command "${RUBY_EXECUTABLE}")
+  if (DEFINED Ruby_EXECUTABLE)
+    set(command "${Ruby_EXECUTABLE}")
+  else()
+    set(command "${RUBY_EXECUTABLE}")
+  endif()

   # add extra command which may be needed on some systems
   if(CMAKE_OSX_ARCHITECTURES)


New version: 0.3.16

New version: 0.3.16

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "3")
-SET(HAWKEY_PATCH "15")
+SET(HAWKEY_PATCH "16")


Bump to 1.4.0

Bump to 1.4.0

--- VERSION.cmake
+++ VERSION.cmake
@@ -1,3 +1,3 @@
 SET(LIBREPO_MAJOR "1")
-SET(LIBREPO_MINOR "3")
+SET(LIBREPO_MINOR "4")
 SET(LIBREPO_PATCH "0")


add hiredis include dir

add hiredis include dir

--- src/tritonsort/cmake_tools/Findhiredis.cmake
+++ src/tritonsort/cmake_tools/Findhiredis.cmake
@@ -1,3 +1,5 @@
+FIND_PATH(hiredis_INCLUDE_DIR hiredis/hiredis.h)
+
 FIND_LIBRARY(hiredis_LIBRARY hiredis)

 MARK_AS_ADVANCED(hiredis_LIBRARY)
@@ -6,4 +8,6 @@

 FIND_PACKAGE_HANDLE_STANDARD_ARGS(hiredis
   "hiredis library is required: https://github.com/antirez/hiredis/"
-  hiredis_LIBRARY)
+  hiredis_LIBRARY hiredis_INCLUDE_DIR)
+
+INCLUDE_DIRECTORIES(${hiredis_INCLUDE_DIR})


For downstream - fix try_compile logic on Android build. [skip appveyor] [ci only: Android, Emscripten]

--- CMake/Modules/FindUrho3D.cmake
+++ CMake/Modules/FindUrho3D.cmake
@@ -188,13 +188,16 @@
         endif ()
     endif ()
     # Ensure the module has found the library with the right ABI for the chosen compiler and URHO3D_64BIT build option
-    if (URHO3D_LIBRARIES AND NOT IOS AND NOT ANDROID)
+    if (URHO3D_LIBRARIES AND NOT IOS)
         if (NOT URHO3D_64BIT AND NOT MSVC AND NOT MINGW AND NOT ANDROID AND NOT RPI AND NOT EMSCRIPTEN)
             set (COMPILER_32BIT_FLAG -DCOMPILE_DEFINITIONS:STRING=-m32)
         endif ()
-        # BCM_VC_LIBRARIES variable is only populated when targeting RPI and empty otherwise, so it is safe to always append the variable
-        try_compile (COMPILE_RESULT ${CMAKE_BINARY_DIR}/generated/FindUrho3D ${CMAKE_CURRENT_LIST_DIR}/CheckUrho3DLibrary.cpp
-            CMAKE_FLAGS -DLINK_LIBRARIES:STRING=${URHO3D_LIBRARIES}\;${BCM_VC_LIBRARIES} -DINCLUDE_DIRECTORIES:STRING=${URHO3D_INCLUDE_DIRS} ${COMPILER_32BIT_FLAG} ${COMPILER_STATIC_FLAG}
+        if (ANDROID)
+            set (ANDROID_LIBRARIES "log\;android\;GLESv1_CM\;GLESv2")
+        endif ()
+        # xxx_LIBRARIES variable is only populated when targeting respective platform and empty otherwise, so it is safe to always append the variable
+        try_compile (COMPILE_RESULT ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/CheckUrho3DLibrary.cpp
+            CMAKE_FLAGS -DLINK_LIBRARIES:STRING=${URHO3D_LIBRARIES}\;${BCM_VC_LIBRARIES}\;${ANDROID_LIBRARIES} -DINCLUDE_DIRECTORIES:STRING=${URHO3D_INCLUDE_DIRS} ${COMPILER_32BIT_FLAG} ${COMPILER_STATIC_FLAG}
             OUTPUT_VARIABLE TRY_COMPILE_OUT)
     endif ()
     # For shared library type, also initialize the URHO3D_DLL variable for later use


Adds OSCPack on OS X

Adds OSCPack on OS X

--- CMakeModules/FindOSCPack.cmake
+++ CMakeModules/FindOSCPack.cmake
@@ -9,6 +9,8 @@
 	osc/OscTypes.h
 	PATHS
 	${OSCPack_ROOT}
+	PATH_SUFFIXES
+	oscpack
 )

 foreach (mode DEBUG RELEASE)


Change clFFT commit tag to af3.3.0

Change clFFT commit tag to af3.3.0

--- CMakeModules/build_clFFT.cmake
+++ CMakeModules/build_clFFT.cmake
@@ -14,7 +14,7 @@
 ExternalProject_Add(
     clFFT-ext
     GIT_REPOSITORY https://github.com/arrayfire/clFFT.git
-    GIT_TAG arrayfire-release-test
+    GIT_TAG af3.3.0
     PREFIX "${prefix}"
     INSTALL_DIR "${prefix}"
     UPDATE_COMMAND ""


[~] Updated url

[~] Updated url

--- libjoemath.pc.cmake
+++ libjoemath.pc.cmake
@@ -6,6 +6,6 @@
 Name: joemath
 Description: Linear math library
 Version: 0.0.1
-URL: git://lon.eso.me.uk/joemath
+URL: https://github.com/expipiplus1/joemath
 Libs: -L${libdir} -ljoemath
 Cflags: -I${includedir}


update template

update template

--- list_template.cmake
+++ list_template.cmake
@@ -20,7 +20,7 @@

 # create the package config install
 include(CreatePackage)
-create_package("@PROJECT_DESCRIPTION@")
+create_package(DESCRIPTION "@PROJECT_DESCRIPTION@")

 # add target for code coverage
 if(ENABLE_COVERAGE)
@@ -38,7 +38,7 @@
 # Setup testing
 enable_testing()

-add_valgrind_test(ENABLE_MEMCHECK TARGET ${TEST_PROJECT_NAME})
+add_valgrind_profile_test(MEMCHECK ${ENABLE_MEMCHECK} PROFILING ${ENABLE_PROFILING} TARGET ${TEST_PROJECT_NAME})

 if (DOXYGEN)
 	add_custom_target(html WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${DOXYGEN} ${PROJECT_SOURCE_DIR}/Doxyfile)


Comment on dependency rule for input files

--- cmake-modules/femusMacroBuildApplication.cmake
+++ cmake-modules/femusMacroBuildApplication.cmake
@@ -33,6 +33,7 @@
 FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/output/)
 FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/input/)
 FILE(COPY           ${PROJECT_SOURCE_DIR}/input/ DESTINATION ${PROJECT_BINARY_DIR}/input/)
-
+# TODO this file copy does not generate a dependency rule in the makefiles, maybe we should think of how to obtain that,
+# to avoid re-running cmake when new input files are added in the applications

 ENDMACRO(femusMacroBuildApplication)


Ticket #1783: Add dumping of condor_winver.h for TJ to add file version information.

--- build/cmake/CondorPackageConfig.cmake
+++ build/cmake/CondorPackageConfig.cmake
@@ -171,6 +171,10 @@

 	endif()

+    # the following will dump a header used to insert file info into bin's
+    set ( WINVER ${CMAKE_CURRENT_BINARY_DIR}/src/condor_includes/condor_winver.h)
+    file( WRITE ${WINVER} "#define CONDOR_VERSION \"${PACKAGE_VERSION}\"\n")
+    #file( APPEND ${WINVER} "#define CONDOR_BLAH \"${YOUR_VAR}\"\n")

 	option(WIN_EXEC_NODE_ONLY "Minimal Package Win exec node only" OFF)


STYLE: Add DTIProcess_BUILD_SLICER_EXTENSION CLIs before ExternalProject_Add

The external project must be added after the package rules. Otherwise, an exception is printed from the inclusion of the SlicerUseFile.

--- SuperBuild.cmake
+++ SuperBuild.cmake
@@ -157,27 +157,6 @@
   )

-ExternalProject_Add(${proj}
-    DOWNLOAD_COMMAND ""
-    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
-    BINARY_DIR ${proj_build}
-    DEPENDS ${${PRIMARY_PROJECT_NAME}_DEPENDENCIES}
-    CMAKE_GENERATOR ${gen}
-    CMAKE_ARGS
-      ${CMAKE_ARGS}
-  )
-
-## Force rebuilding of the main subproject every time building from super structure
-ExternalProject_Add_Step(${proj} forcebuild
-    COMMAND ${CMAKE_COMMAND} -E remove
-    ${CMAKE_CURRENT_BUILD_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build
-    DEPENDEES configure
-    DEPENDERS build
-    ALWAYS 1
-  )
-
-#-----------------------------------------------------------------------------
-
 if( DTIProcess_BUILD_SLICER_EXTENSION )
   set(EXTENSION_CLIS dtiaverage dtiestim dtiprocess fiberprocess fiberstats polydatamerge polydatatransform)
   set(TESTS dtiaverageTest dtiestimTest dtiprocessTest TestHomemadeRoundFunction)
@@ -205,3 +184,25 @@
   set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
   include(${Slicer_EXTENSION_CPACK})
 endif()
+
+ExternalProject_Add(${proj}
+    DOWNLOAD_COMMAND ""
+    SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+    BINARY_DIR ${proj_build}
+    DEPENDS ${${PRIMARY_PROJECT_NAME}_DEPENDENCIES}
+    CMAKE_GENERATOR ${gen}
+    CMAKE_ARGS
+      ${CMAKE_ARGS}
+  )
+
+## Force rebuilding of the main subproject every time building from super structure
+ExternalProject_Add_Step(${proj} forcebuild
+    COMMAND ${CMAKE_COMMAND} -E remove
+    ${CMAKE_CURRENT_BUILD_DIR}/${proj}-prefix/src/${proj}-stamp/${proj}-build
+    DEPENDEES configure
+    DEPENDERS build
+    ALWAYS 1
+  )
+
+#-----------------------------------------------------------------------------
+


Keep test executables

Keep test executables

--- tests/system_tests/run_system_tests.sh.cmake
+++ tests/system_tests/run_system_tests.sh.cmake
@@ -1109,7 +1109,7 @@
 			else
 				echo "[EXECUTE] FAIL"
 				#fail $SHORTNAME $TARGET execute $cfg $np
-				rm -f $(get_exe_name $SHORTNAME $TARGET)
+				#rm -f $(get_exe_name $SHORTNAME $TARGET)
 				do_test_finish $FAIL_EXECUTE
 				popd > /dev/null
 				return $FAIL_EXECUTE


GAMS_CORE_PATH to cmake path

GAMS_CORE_PATH to cmake path

--- include.cmake
+++ include.cmake
@@ -57,8 +57,9 @@
 add_definitions(-DAPI_VERSION="${VERSION}")

 # GAMS_CORE_PATH is Jenkins build switch
+file(TO_CMAKE_PATH "$ENV{GAMS_CORE_PATH}" GAMS_PATH)
 if(NOT EXISTS ${PWD}/gamsinclude.pri)
-    if("$ENV{GAMS_CORE_PATH}" STREQUAL "")
+    if("${GAMS_PATH}" STREQUAL "")
         if(APPLE)
             set(GAMS_DISTRIB /Library/Frameworks/GAMS.framework/Versions/${GAMS_DISTRIB_MAJOR}/Resources)
             set(GAMSINC
@@ -82,9 +83,9 @@
         endif()
     else()
         set(GAMSINC
-"GAMS_DISTRIB=$ENV{GAMS_CORE_PATH}\n\
-GAMS_DISTRIB_C_API=$ENV{GAMS_CORE_PATH}/apifiles/C/api\n\
-GAMS_DISTRIB_CPP_API=$ENV{GAMS_CORE_PATH}/apifiles/C++/api")
+"GAMS_DISTRIB=${GAMS_PATH}\n\
+GAMS_DISTRIB_C_API=${GAMS_PATH}/apifiles/C/api\n\
+GAMS_DISTRIB_CPP_API=${GAMS_PATH}/apifiles/C++/api")
     endif()

     file(WRITE ${PWD}/gamsinclude.pri ${GAMSINC})


[CMake][Python] The Python installation directory is now the standard one.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -113,8 +113,6 @@
   # Offer the user the choice of overriding the installation directories
   set (INSTALL_LIB_DIR ${LIBDIR} CACHE PATH
 	"Installation directory for libraries")
-  set (INSTALL_PY_LIB_DIR ${LIBDIR}/python${PYTHONLIBS_VERSION}/${PROJECT_NAME}
-	CACHE PATH "Installation directory for Python libraries")
   set (INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables")
   set (INSTALL_LIBEXEC_DIR CACHE PATH
 	"Installation directory for internal executables")
@@ -498,7 +496,11 @@
       PYTHONLIBS_VERSION "${PYTHONLIBS_LIB_FILENAME}")
 	message (STATUS "Found PythonLibs ${PYTHONLIBS_VERSION}")

-    # Update the list of include directories for the project
+	# Set the Python installation directory
+	set (INSTALL_PY_LIB_DIR ${INSTALL_LIB_DIR}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PROJECT_NAME}
+	  CACHE PATH "Installation directory for Python libraries")
+
+	# Update the list of include directories for the project
     include_directories (${PYTHON_INCLUDE_DIRS})

     # Update the list of dependencies for the project
@@ -1420,7 +1422,7 @@
   set (exec_prefix   ${prefix})
   set (bindir        ${exec_prefix}/bin)
   set (libdir        ${exec_prefix}/${LIBDIR})
-  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/${PACKAGE})
+  set (pylibdir	     ${libdir}/python${PYTHONLIBS_VERSION}/site-packages/libpy${PACKAGE})
   set (libexecdir    ${exec_prefix}/libexec)
   set (sbindir       ${exec_prefix}/sbin)
   set (sysconfdir    ${prefix}/etc)


Generate PIC for protobuf sources if BUILD_SHARED_LIBS==1

--- cmake/Modules/LightStepProtobuf.cmake
+++ cmake/Modules/LightStepProtobuf.cmake
@@ -59,3 +59,7 @@
   add_library(lightstep_protobuf OBJECT ${COLLECTOR_PB_CPP_FILE}
                                         ${LIGHTSTEP_CARRIER_PB_CPP_FILE})
 endif()
+
+if (BUILD_SHARED_LIBS)
+  set_property(TARGET lightstep_protobuf PROPERTY POSITION_INDEPENDENT_CODE ON)
+endif()


Squashed '3rdparty/github/cmake-utils/' changes from 251c0b2e..2d312a45

2d312a45 Use u and l instead of msvc specifics

git-subtree-dir: 3rdparty/github/cmake-utils
git-subtree-split: 2d312a45771fbdee3d4d6ae8e9243a449470a103

--- cmake/MyPackageCheckCommonSizes.cmake
+++ cmake/MyPackageCheckCommonSizes.cmake
@@ -59,34 +59,32 @@
         # Without an extension, integer literal is always int,
         # so we have to handle the case of "long" and "long long"
         #
-        IF (("${CMAKE_C_COMPILER_ID} x" MATCHES "MSVC") OR MSVC)
-          IF (_size EQUAL 8)
-            SET (_extension "${_sign}i8")
-          ELSEIF (_size EQUAL 16)
-            SET (_extension "${_sign}i16")
-          ELSEIF (_size EQUAL 32)
-            SET (_extension "${_sign}i32")
-          ELSEIF (_size EQUAL 64)
-            SET (_extension "${_sign}i64")
+        IF (_c STREQUAL "char")
+          SET (_extension "")
+        ELSEIF (_c STREQUAL "short")
+          SET (_extension "")
+        ELSEIF (_c STREQUAL "int")
+          SET (_extension "")
+        ELSEIF (_c STREQUAL "long")
+          IF (_sign STREQUAL "")
+            SET (_extension "L")
+          ELSEIF (_sign STREQUAL "u")
+            SET (_extension "UL")
           ELSE ()
             MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
           ENDIF ()
+        ELSEIF (_c STREQUAL "long long")
+          #
+          # By definition, this C supports "long long", so it must support the "LL" suffix
+          IF (_sign STREQUAL "")
+            SET (_extension "LL")
+          ELSEIF (_sign STREQUAL "u")
+            SET (_extension "ULL")
+          ELSE ()
+            MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
+          ENDIF ()
         ELSE ()
-          IF (_c STREQUAL "char")
-            SET (_extension "")
-          ELSEIF (_c STREQUAL "short")
-            SET (_extension "")
-          ELSEIF (_c STREQUAL "int")
-            SET (_extension "")
-          ELSEIF (_c STREQUAL "long")
-            SET (_extension "L")
-          ELSEIF (_c STREQUAL "long long")
-            #
-            # By definition, this C supports "long long", so it must support the "LL" suffix
-            SET (_extension "LL")
-          ELSE ()
-            MESSAGE(FATAL_ERROR "Unsupported c ${_c}")
-          ENDIF ()
+          MESSAGE(FATAL_ERROR "Unsupported c ${_c}")
         ENDIF ()
         STRING (TOUPPER ${_c} _C)
         STRING (REPLACE " " "_" _C "${_C}")
@@ -97,35 +95,43 @@
             # but an hexadecimal constant is signed or unsigned, depending on value and integer type range
             IF (_size EQUAL 8)
               IF (_sign STREQUAL "")
-                SET (${_MYTYPEMIN} "(-127${_extension} - 1)")
+                SET (${_MYTYPEMIN} "(-127${_extension} - 1${_extension})")
                 SET (${_MYTYPEMAX} "127${_extension}")
-              ELSE ()
-                SET (${_MYTYPEMIN} "0x00U${_extension}")
-                SET (${_MYTYPEMAX} "0xFFU${_extension}")
+              ELSEIF (_sign STREQUAL "u")
+                SET (${_MYTYPEMIN} "0x00${_extension}")
+                SET (${_MYTYPEMAX} "0xFF${_extension}")
+              ELSE ()
+                MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
               ENDIF ()
             ELSEIF (_size EQUAL 16)
               IF (_sign STREQUAL "")
-                SET (${_MYTYPEMIN} "(-32767${_extension} - 1)")
+                SET (${_MYTYPEMIN} "(-32767${_extension} - 1${_extension})")
                 SET (${_MYTYPEMAX} "32767${_extension}")
-              ELSE ()
-                SET (${_MYTYPEMIN} "0x0000U${_extension}")
-                SET (${_MYTYPEMAX} "0xFFFFU${_extension}")
+              ELSEIF (_sign STREQUAL "u")
+                SET (${_MYTYPEMIN} "0x0000${_extension}")
+                SET (${_MYTYPEMAX} "0xFFFF${_extension}")
+              ELSE ()
+                MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
               ENDIF ()
             ELSEIF (_size EQUAL 32)
               IF (_sign STREQUAL "")
-                SET (${_MYTYPEMIN} "(-2147483647${_extension} - 1)")
+                SET (${_MYTYPEMIN} "(-2147483647${_extension} - 1${_extension})")
                 SET (${_MYTYPEMAX} "2147483647${_extension}")
-              ELSE ()
-                SET (${_MYTYPEMIN} "0x00000000U${_extension}")
-                SET (${_MYTYPEMAX} "0xFFFFFFFFU${_extension}")
+              ELSEIF (_sign STREQUAL "u")
+                SET (${_MYTYPEMIN} "0x00000000${_extension}")
+                SET (${_MYTYPEMAX} "0xFFFFFFFF${_extension}")
+              ELSE ()
+                MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
               ENDIF ()
             ELSEIF (_size EQUAL 64)
               IF (_sign STREQUAL "")
-                SET (${_MYTYPEMIN} "(-9223372036854775807${_extension} - 1)")
+                SET (${_MYTYPEMIN} "(-9223372036854775807${_extension} - 1${_extension})")
                 SET (${_MYTYPEMAX} "9223372036854775807${_extension}")
-              ELSE ()
-                SET (${_MYTYPEMIN} "0x0000000000000000U${_extension}")
-                SET (${_MYTYPEMAX} "0xFFFFFFFFFFFFFFFFU${_extension}")
+              ELSEIF (_sign STREQUAL "u")
+                SET (${_MYTYPEMIN} "0x0000000000000000${_extension}")
+                SET (${_MYTYPEMAX} "0xFFFFFFFFFFFFFFFF${_extension}")
+              ELSE ()
+                MESSAGE(FATAL_ERROR "Unsupported size ${_size}")
               ENDIF ()
             ELSE ()
               MESSAGE(FATAL_ERROR "Unsupported size ${_size}")


Fixed linux build.

Fixed linux build.

--- cmake/projects/libsodium/hunter.cmake
+++ cmake/projects/libsodium/hunter.cmake
@@ -17,8 +17,10 @@
     00a999629f1f8f500cef29818135f8f889f44e41
 )

-
-hunter_pick_scheme(DEFAULT url_sha1_libsodium_msbuild
-                   WINDOWS url_sha1_libsodium_autogen_autotools)
+if(MSVC)
+    hunter_pick_scheme(DEFAULT url_sha1_libsodium_msbuild)
+else()
+    hunter_pick_scheme(DEFAULT url_sha1_libsodium_autogen_autotools)
+endif()
 hunter_cacheable(libsodium)
 hunter_download(PACKAGE_NAME libsodium)


Fix packaging error

Fix packaging error

--- build/rpm/flexisip.spec.cmake
+++ build/rpm/flexisip.spec.cmake
@@ -226,6 +226,7 @@
 %{_includedir}/flexisip/*.h
 %{_includedir}/flexisip/*.hh
 %{_includedir}/flexisip/auth/*.hh
+%{_includedir}/flexisip/sofia-wrapper/*.hh
 %{_includedir}/flexisip/utils/*.hh
 %{_includedir}/flexisip/expressionparser-impl.cc
 %{_localstatedir}//*


COMP: Facilitate integration of TubeTK explicitly referencing source dir.

This commit allows TubeTK to be added as a subdirectory of an existing
project.

--- CMake/Superbuild/ExternalProjectsConfig.cmake
+++ CMake/Superbuild/ExternalProjectsConfig.cmake
@@ -61,7 +61,7 @@
 ###########################################################

 # ITKTubeTK: Source already available in TubeTK project
-set( ITKTubeTK_URL ${CMAKE_SOURCE_DIR}/ITKModules/ITKTubeTK )
+set( ITKTubeTK_URL ${TubeTK_SOURCE_DIR}/ITKModules/ITKTubeTK )
 set( ITKTubeTK_HASH_OR_TAG "")

 # MinimalPathExtraction


fixing repo

fixing repo

--- plugins/vtkSpaceCraftInfoFilter/Findcdf.cmake
+++ plugins/vtkSpaceCraftInfoFilter/Findcdf.cmake
@@ -1,29 +0,0 @@
-# Try to find CDF library files
-
-# Once done this will define
-#  LIBCDF_FOUND - System has LibCDF
-#  LIBCDF_INCLUDE_DIRS - The Libcdf include directories
-#  LIBCDF_LIBRARIES - The libraries needed to use LibCDF
-#  LIBCDF_DEFINITIONS - Compiler switches required for using LibCDF
-
-find_package(PkgConfig)
-pkg_check_modules(PC_LIBCDF QUIET libcdf)
-set(LIBCDF_DEFINITIONS ${PC_LIBCDF_CFLAGS_OTHER})
-
-find_path(LIBCDF_INCLUDE_DIR libcdf/xpath.h
-          HINTS ${PC_LIBCDF_INCLUDEDIR} ${PC_LIBCDF_INCLUDE_DIRS}
-          PATH_SUFFIXES libcdf )
-
-find_library(LIBCDF_LIBRARY NAMES cdf libcdf
-             HINTS ${PC_LIBCDF_LIBDIR} ${PC_LIBCDF_LIBRARY_DIRS} )
-
-set(LIBCDF_LIBRARIES ${LIBCDF_LIBRARY} )
-set(LIBCDF_INCLUDE_DIRS ${LIBCDF_INCLUDE_DIR} )
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set LIBCDF_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(Libcdf  DEFAULT_MSG
-                                  LIBCDF_LIBRARY LIBCDF_INCLUDE_DIR)
-
-mark_as_advanced(LIBCDF_INCLUDE_DIR LIBCDF_LIBRARY )


[CMake] Use DOXYGEN_FOUND instead of Ooxygen_FOUND

--- cmake/DARTFindDependencies.cmake
+++ cmake/DARTFindDependencies.cmake
@@ -298,4 +298,4 @@

 # Doxygen
 find_package(Doxygen QUIET)
-dart_check_optional_package(Doxygen "generating API documentation" "doxygen")
+dart_check_optional_package(DOXYGEN "generating API documentation" "doxygen")


- Revert small change

- Revert small change

--- cmake/Modules/BuildLibrary.cmake
+++ cmake/Modules/BuildLibrary.cmake
@@ -165,11 +165,7 @@
             )
     endif()

-    if(NOT DEFINED "${TARGET}_REGISTERED")
-        register_library( ${TARGET} "${HEADER_DIR}" )
-        set ( "${TARGET}_REGISTERED" TRUE CACHE BOOL "" )
-        mark_as_advanced( "${TARGET}_REGISTERED" )
-    endif()
+    register_library( ${TARGET} "${HEADER_DIR}" )
 endmacro()

 macro(COFFEE_ADD_FRAMEWORK


Only use git for capnp EP on windows

Only use git for capnp EP on windows

--- cmake/Modules/FindCapnp_EP.cmake
+++ cmake/Modules/FindCapnp_EP.cmake
@@ -59,16 +59,17 @@
       set(CXXFLAGS_DEF "${CMAKE_CXX_FLAGS} -fPIC")
     endif()

-    # we cherry-pick fdbf035619 to fix installation on windowsa
-    #   https://github.com/capnproto/capnproto/commit/fdbf035619ab2f9e25173bb7361e7e19a52e0fa1
-    ExternalProject_Add(ep_capnp
-      PREFIX "externals"
-      #URL "https://github.com/capnproto/capnproto/archive/v0.6.1.tar.gz"
-      #URL_HASH SHA1=2aec1f83cc4851ae58e1419c87f11f8aa63a9392
-      GIT_REPOSITORY "https://github.com/capnproto/capnproto.git"
-      GIT_TAG "v0.6.1"
-      CONFIGURE_COMMAND
-        ${CMAKE_COMMAND}
+    if (WIN32)
+      # we cherry-pick fdbf035619 to fix installation on windowsa
+      #   https://github.com/capnproto/capnproto/commit/fdbf035619ab2f9e25173bb7361e7e19a52e0fa1
+      ExternalProject_Add(ep_capnp
+        PREFIX "externals"
+        #URL "https://github.com/capnproto/capnproto/archive/v0.6.1.tar.gz"
+        #URL_HASH SHA1=2aec1f83cc4851ae58e1419c87f11f8aa63a9392
+        GIT_REPOSITORY "https://github.com/capnproto/capnproto.git"
+        GIT_TAG "v0.6.1"
+        CONFIGURE_COMMAND
+          ${CMAKE_COMMAND}
           ${ARCH_SPEC}
           -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX}
           -DCMAKE_BUILD_TYPE=Release
@@ -76,15 +77,37 @@
           "-DCMAKE_C_FLAGS=${CFLAGS_DEF}"
           "-DCMAKE_CXX_FLAGS=${CXXFLAGS_DEF}"
           ${TILEDB_EP_BASE}/src/ep_capnp/c++
-      PATCH_COMMAND
-        ${GIT_EXECUTABLE} cherry-pick fdbf035619
-      UPDATE_COMMAND ""
-      LOG_DOWNLOAD TRUE
-      LOG_CONFIGURE TRUE
-      LOG_BUILD TRUE
-      LOG_INSTALL TRUE
-      LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE}
-    )
+        PATCH_COMMAND
+          ${GIT_EXECUTABLE} cherry-pick fdbf035619
+        UPDATE_COMMAND ""
+        LOG_DOWNLOAD TRUE
+        LOG_CONFIGURE TRUE
+        LOG_BUILD TRUE
+        LOG_INSTALL TRUE
+        LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE}
+      )
+    else()
+      ExternalProject_Add(ep_capnp
+        PREFIX "externals"
+        URL "https://github.com/capnproto/capnproto/archive/v0.6.1.tar.gz"
+        URL_HASH SHA1=2aec1f83cc4851ae58e1419c87f11f8aa63a9392
+        CONFIGURE_COMMAND
+          ${CMAKE_COMMAND}
+          ${ARCH_SPEC}
+          -DCMAKE_INSTALL_PREFIX=${TILEDB_EP_INSTALL_PREFIX}
+          -DCMAKE_BUILD_TYPE=Release
+          -DBUILD_TESTING=OFF
+          "-DCMAKE_C_FLAGS=${CFLAGS_DEF}"
+          "-DCMAKE_CXX_FLAGS=${CXXFLAGS_DEF}"
+          ${TILEDB_EP_BASE}/src/ep_capnp/c++
+        UPDATE_COMMAND ""
+        LOG_DOWNLOAD TRUE
+        LOG_CONFIGURE TRUE
+        LOG_BUILD TRUE
+        LOG_INSTALL TRUE
+        LOG_OUTPUT_ON_FAILURE ${TILEDB_LOG_OUTPUT_ON_FAILURE}
+      )
+    endif()

     list(APPEND TILEDB_EXTERNAL_PROJECTS ep_capnp)
     list(APPEND FORWARD_EP_CMAKE_ARGS


avoid quoted variable

avoid quoted variable

for #732

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -174,7 +174,7 @@
 		if (DEFINED ${VARIABLE})
 			# both stored and given by user: do consistency check
 			#message (STATUS "consistency check, plugin ${PLUGIN_NAME} got ${VARIABLE} reset to ${VAR}")
-			if (NOT "${VARIABLE}" STREQUAL "${VAR}")
+			if (NOT ${VARIABLE} STREQUAL "${VAR}")
 				message (FATAL_ERROR "Internally inconsistency, plugin ${PLUGIN_NAME} got different values for variable ${VARIABLE}: '${${VARIABLE}}' != '${VAR}'")
 			endif ()
 		else ()


Remove obsolete stuff

Remove obsolete stuff

--- cmake/modules/FindAutomoc4.cmake
+++ cmake/modules/FindAutomoc4.cmake
@@ -39,24 +39,16 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

-# check if we are inside KDESupport
-if("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-   # when building this project as part of kdesupport
-   set(AUTOMOC4_CONFIG_FILE "${KDESupport_SOURCE_DIR}/automoc/Automoc4Config.cmake")
-else("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
-   # when building this project outside kdesupport
+# CMAKE_[SYSTEM_]PREFIX_PATH exists starting with cmake 2.6.0
+file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _env_CMAKE_PREFIX_PATH)
+file(TO_CMAKE_PATH "$ENV{CMAKE_LIBRARY_PATH}" _env_CMAKE_LIBRARY_PATH)

-   # CMAKE_[SYSTEM_]PREFIX_PATH exists starting with cmake 2.6.0
-   file(TO_CMAKE_PATH "$ENV{CMAKE_PREFIX_PATH}" _env_CMAKE_PREFIX_PATH)
-   file(TO_CMAKE_PATH "$ENV{CMAKE_LIBRARY_PATH}" _env_CMAKE_LIBRARY_PATH)
-
-   find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake
-             PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4
-             PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${CMAKE_SYSTEM_PREFIX_PATH}
-                   ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH}
-                   ${CMAKE_INSTALL_PREFIX}
-             NO_DEFAULT_PATH )
-endif("${KDESupport_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
+find_file(AUTOMOC4_CONFIG_FILE NAMES Automoc4Config.cmake
+          PATH_SUFFIXES automoc4 lib/automoc4 lib64/automoc4
+          PATHS ${_env_CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH} ${CMAKE_SYSTEM_PREFIX_PATH}
+                ${_env_CMAKE_LIBRARY_PATH} ${CMAKE_LIBRARY_PATH} ${CMAKE_SYSTEM_LIBRARY_PATH}
+                ${CMAKE_INSTALL_PREFIX}
+          NO_DEFAULT_PATH )

 if(AUTOMOC4_CONFIG_FILE)
@@ -72,10 +64,10 @@
    endif (NOT Automoc4_FIND_QUIETLY)
 else (AUTOMOC4_FOUND)
    if (Automoc4_FIND_REQUIRED)
-      message(FATAL_ERROR "Did not find automoc4 (part of kdesupport).")
+      message(FATAL_ERROR "Did not find automoc4.")
    else (Automoc4_FIND_REQUIRED)
       if (NOT Automoc4_FIND_QUIETLY)
-         message(STATUS "Did not find automoc4 (part of kdesupport).")
+         message(STATUS "Did not find automoc4.")
       endif (NOT Automoc4_FIND_QUIETLY)
    endif (Automoc4_FIND_REQUIRED)
 endif (AUTOMOC4_FOUND)


OpenBSD support.

OpenBSD support.

x86_64 is spelled "amd64" on this platform. Return "amd64", for
consistency with Swift and other projects.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -22,6 +22,8 @@
     set("${result_var_name}" "armv7" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "armv7-a")
     set("${result_var_name}" "armv7" PARENT_SCOPE)
+  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "amd64")
+    set("${result_var_name}" "amd64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "IA64")


added target indent

added target indent

--- cmake/setup_custom_targets.cmake
+++ cmake/setup_custom_targets.cmake
@@ -108,12 +108,8 @@
     )
 ENDIF()

-#
-# Provide an "info" target to print a help message:
-#
-IF(CMAKE_GENERATOR MATCHES "Ninja")
-  SET(_make_command "ninja")
-ELSE()
-  SET(_make_command "make")
-ENDIF()

+ADD_CUSTOM_TARGET(indent
+  WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+  COMMAND ./scripts/indent
+  )


Updating SWIG to a patched version

Updating SWIG to a patched version

The superbuild swig has been repackages with the additional commit for
SWIG upstream: 843aa7cd65985319a64d4f1297778f93f96a5008 to address
compilation issue on OSX Maverics.

Change-Id: Ia155dcb35f940148e3759818d06055056374865a

--- SuperBuild/External_Swig.cmake
+++ SuperBuild/External_Swig.cmake
@@ -12,9 +12,9 @@

 if(NOT SWIG_DIR)

-  set(SWIG_TARGET_VERSION 2.0.12)
-  set(SWIG_DOWNLOAD_SOURCE_HASH "c3fb0b2d710cc82ed0154b91e43085a4")
-  set(SWIG_DOWNLOAD_WIN_HASH "3cc7dd131a87972f70fca1490b9e6e6b")
+  set(SWIG_TARGET_VERSION 2.0.12-1)
+  set(SWIG_DOWNLOAD_SOURCE_HASH "44af22bffb53d1795b0f5cb3bff5eb1a")
+  set(SWIG_DOWNLOAD_WIN_HASH "439bc49355dc76490b3fe0dffac2774d")

   if(WIN32)


fixed warning

fixed warning

--- resources/Installer/Packaging.cmake
+++ resources/Installer/Packaging.cmake
@@ -10,7 +10,7 @@
 # with this library; see the file LICENSE. If not, you can obtain one at
 # http://mozilla.org/MPL/2.0/.
 #
-cmake_minimum_required(VERSION 2.8.11)
+cmake_minimum_required(VERSION 3.1.0)

 # Packaging
 set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP ON)


Add the wxpng device to the test process.

svn path=/trunk/; revision=9185

--- plplot_test/plplot-test.sh.cmake
+++ plplot_test/plplot-test.sh.cmake
@@ -233,6 +233,7 @@
 PLD_versaterm=@PLD_versaterm@
 PLD_vlt=@PLD_vlt@
 #interactive PLD_wingcc=@PLD_wingcc@
+PLD_wxpng=@PLD_wxpng@
 #interactive PLD_wxwidgets=@PLD_wxwidgets@
 #interactive PLD_xcairo=@PLD_xcairo@
 PLD_xfig=@PLD_xfig@


Use the -static switch on MinGW to prevent dependency on an external libpthread.dll on some MinGW distributions.

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -230,8 +230,8 @@
             endif ()
         endif ()
         if (WIN32)
-            set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static-libgcc")
-            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc")
+            set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -static-libgcc")
+            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libstdc++ -static-libgcc")
             # Additional compiler flags for Windows ports of GCC
             set (CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
             set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")


Fix deploying multiple samples in iOS (virtual) devices.

Each (samples) iOS app now has its unique bundle ID based on the derived product name.

--- Source/CMake/Modules/Urho3D-CMake-magic.cmake
+++ Source/CMake/Modules/Urho3D-CMake-magic.cmake
@@ -142,7 +142,7 @@
     endif ()
     set (CMAKE_XCODE_EFFECTIVE_PLATFORMS -iphoneos -iphonesimulator)
     if (NOT MACOSX_BUNDLE_GUI_IDENTIFIER)
-        set (MACOSX_BUNDLE_GUI_IDENTIFIER com.googlecode.urho3d)
+        set (MACOSX_BUNDLE_GUI_IDENTIFIER com.github.urho3d.\${PRODUCT_NAME:rfc1034identifier})
     endif ()
     set (CMAKE_OSX_SYSROOT iphoneos)    # Set to "Latest iOS"
 elseif (XCODE)


Fix linking against boost

Fix linking against boost

Building against recent enough boost requires to explicitly link against
boost_system. (Observed with boost 1.50)

Add the missing library to cmake rules.

--- cmake/ConfigurePackages.cmake
+++ cmake/ConfigurePackages.cmake
@@ -41,7 +41,7 @@
 set(Boost_DETAILED_FAILURE_MSG FALSE)
 set(Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1")

-find_package(Boost 1.39.0 COMPONENTS thread regex)
+find_package(Boost 1.39.0 COMPONENTS system thread regex)

 if (Boost_FOUND)
    include_directories(${Boost_INCLUDE_DIRS})


fix find

fix find

--- cmake/modules/FindCheck.cmake
+++ cmake/modules/FindCheck.cmake
@@ -21,13 +21,13 @@
 IF(NOT CHECK_FOUND)
   SET(CHECK_DIR_MESSAGE
     "check C unit testing library was not found. Install check and check-devel.")
-  IF(NOT CHECK_FIND_QUIETLY)
+  IF(NOT Check_FIND_QUIETLY)
     MESSAGE(STATUS "${CHECK_DIR_MESSAGE}")
-  ELSE(NOT CHECK_FIND_QUIETLY)
-    IF(CHECK_FIND_REQUIRED)
+  ELSE(NOT Check_FIND_QUIETLY)
+    IF(Check_FIND_REQUIRED)
       MESSAGE(FATAL_ERROR "${CHECK_DIR_MESSAGE}")
-    ENDIF(CHECK_FIND_REQUIRED)
-  ENDIF(NOT CHECK_FIND_QUIETLY)
+    ENDIF(Check_FIND_REQUIRED)
+  ENDIF(NOT Check_FIND_QUIETLY)
 ELSE(NOT CHECK_FOUND)
   MESSAGE(STATUS "check C unit testing library: ${CHECK_LIBRARIES}")
 ENDIF(NOT CHECK_FOUND)


Box2D find blubb

Box2D find blubb

--- cmake_modules/FindBox2D.cmake
+++ cmake_modules/FindBox2D.cmake
@@ -1,30 +1,63 @@
-# source: http://breathe.git.sourceforge.net
-#
-# Locate Box2D library
-# This module defines
-# BOX2D_LIBRARY, the name of the library to link against
-# BOX2D_FOUND, if false, do not try to link to Box2D
-# BOX2D_INCLUDE_DIR, where to find Box2D headers
-#
-# Created by Sven-Hendrik Haase. Based on the FindZLIB.cmake module.
+# Locate Box2D
+# This module defines XXX_FOUND, XXX_INCLUDE_DIRS and XXX_LIBRARIES standard variables

-IF(BOX2D_INCLUDE_DIR)
-  # Already in cache, be silent
-  SET(BOX2D_FIND_QUIETLY TRUE)
-ENDIF(BOX2D_INCLUDE_DIR)
+FIND_PATH(BOX2D_INCLUDE_DIR Box2D.h
+	HINTS
+	$ENV{BOX2D_DIR}
+	$ENV{BOX2D_PATH}
+	${ADDITIONAL_SEARCH_PATHS}
+	PATH_SUFFIXES include Include
+	PATHS
+		~/Library/Frameworks
+		/Library/Frameworks
+		/usr/local
+		/usr
+		/sw # Fink
+		/opt/local # DarwinPorts
+		/opt/csw # Blastwave
+		/opt
+)

-FIND_PATH(BOX2D_INCLUDE_DIR Box2D/Box2D.h)
+FIND_LIBRARY(BOX2D_LIBRARY
+	NAMES box2d
+	HINTS
+	$ENV{BOX2D_DIR}
+	$ENV{BOX2D_PATH}
+	${ADDITIONAL_SEARCH_PATHS}
+	PATH_SUFFIXES lib64 lib lib/release Library
+	PATHS
+		~/Library/Frameworks
+		/Library/Frameworks
+		/usr/local
+		/usr
+		/sw
+		/opt/local
+		/opt/csw
+		/opt
+)

-SET(BOX2D_NAMES box2d Box2d BOX2D Box2D)
-FIND_LIBRARY(BOX2D_LIBRARY NAMES ${BOX2D_NAMES})
-MARK_AS_ADVANCED(BOX2D_LIBRARY BOX2D_INCLUDE_DIR)
+FIND_LIBRARY(BOX2D_LIBRARY_DEBUG
+	NAMES box2dd box2d_d
+	HINTS
+	$ENV{BOX2D_DIR}
+	$ENV{BOX2D_PATH}
+	${ADDITIONAL_SEARCH_PATHS}
+	PATH_SUFFIXES lib64 lib lib/debug Library
+	PATHS
+		~/Library/Frameworks
+		/Library/Frameworks
+		/usr/local
+		/usr
+		/sw
+		/opt/local
+		/opt/csw
+		/opt
+)

-# Per-recommendation
-SET(BOX2D_INCLUDE_DIRS "${BOX2D_INCLUDE_DIR}")
-SET(BOX2D_LIBRARIES    "${BOX2D_LIBRARY}")

-# handle the QUIETLY and REQUIRED arguments and set BOX2D_FOUND to TRUE if
+# handle the QUIETLY and REQUIRED arguments and set CURL_FOUND to TRUE if
 # all listed variables are TRUE
-
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Box2D DEFAULT_MSG BOX2D_LIBRARY BOX2D_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(BOX2D DEFAULT_MSG BOX2D_LIBRARY BOX2D_INCLUDE_DIR)
+INCLUDE(FindPackageTargetLibraries)
+FIND_PACKAGE_SET_STD_INCLUDE_AND_LIBS(BOX2D)


temp fix to get 11 in the patch version

temp fix to get 11 in the patch version

--- CMakeModules/parse_OSG_version.cmake
+++ CMakeModules/parse_OSG_version.cmake
@@ -11,13 +11,13 @@

 	string(REGEX MATCH "#define[\t ]+OPENSCENEGRAPH_MAJOR_VERSION[\t ]+([0-9]+)" version_major ${text})
 	string(REGEX MATCH "#define[\t ]+OPENSCENEGRAPH_MINOR_VERSION[\t ]+([0-9]+)" version_minor ${text})
-	string(REGEX MATCH "#define[\t ]+OPENSCENEGRAPH_PATCH_VERSION[\t ]+([0-9]+)" version_patch ${text})
+	string(REGEX MATCH "#define[\t ]+OPENSCENEGRAPH_PATCH_VERSION[\t ]+([0-9][0-9]+)" version_patch ${text})
 	string(REGEX MATCH "#define[\t ]+OPENSCENEGRAPH_SOVERSION[\t ]+([0-9][0-9])" version_so ${text})

 	string(REGEX REPLACE ".*([0-9]+).*" "\\1" version_major ${version_major})
 	string(REGEX REPLACE ".*([0-9]+).*" "\\1" version_minor ${version_minor})
-	string(REGEX REPLACE ".*([0-9]+).*" "\\1" version_patch ${version_patch})
+	string(REGEX REPLACE ".*([0-9][0-9]+).*" "\\1" version_patch ${version_patch})
 	string(REGEX REPLACE ".*([0-9][0-9]).*" "\\1" version_so ${version_so})

 	set(OSG_VERSION_MAJOR ${version_major})


Travis-CI: trying to understand why the tests don't pass on OS X while they do locally.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -94,6 +94,13 @@
     SET(QT_VERSION_MAJOR ${Qt5Widgets_VERSION_MAJOR})
     SET(QT_VERSION_MINOR ${Qt5Widgets_VERSION_MINOR})
     SET(QT_VERSION_PATCH ${Qt5Widgets_VERSION_PATCH})
+
+    # Retrieve the real path of the Qt library directory
+    # Note: on Travis CI, QT_LIBRARY_DIR points to a symbolic path. That
+    #       symbolic path is used by some libraries while others use the real
+    #       path instead. So, we need to know about both...
+
+    GET_FILENAME_COMPONENT(REAL_QT_LIBRARY_DIR ${QT_LIBRARY_DIR} REALPATH)

     # Some general build settings
     # Note: we need to use C++11, so that we can define strings as static const.
@@ -941,10 +948,19 @@
     # Retrieve the file's full-path Qt libraries as a list

     SET(QT_LIBRARY_DIR_FOR_GREP "\t${QT_LIBRARY_DIR}/")
+    SET(REAL_QT_LIBRARY_DIR_FOR_GREP "\t${REAL_QT_LIBRARY_DIR}/")

     EXECUTE_PROCESS(COMMAND otool -L ${FILENAME}
-                    COMMAND grep --colour=never ${QT_LIBRARY_DIR_FOR_GREP}
+                    COMMAND grep --colour=never -e "${QT_LIBRARY_DIR_FOR_GREP}"
+                                                -e "${REAL_QT_LIBRARY_DIR_FOR_GREP}"
                     OUTPUT_VARIABLE RAW_QT_LIBRARIES)
+MESSAGE("---------")
+MESSAGE(">>> otool -L ${FILENAME}")
+EXECUTE_PROCESS(COMMAND otool -L ${FILENAME}
+                OUTPUT_VARIABLE OTOOL_L_FILENAME)
+MESSAGE(">>> OTOOL_L_FILENAME:\n${OTOOL_L_FILENAME}")
+MESSAGE(">>> RAW_QT_LIBRARIES: ${RAW_QT_LIBRARIES}")
+MESSAGE("---------")

     STRING(REPLACE "\n" ";" RAW_QT_LIBRARIES "${RAW_QT_LIBRARIES}")

@@ -954,6 +970,7 @@

     FOREACH(RAW_QT_LIBRARY ${RAW_QT_LIBRARIES})
         STRING(REPLACE ${QT_LIBRARY_DIR_FOR_GREP} "" RAW_QT_LIBRARY "${RAW_QT_LIBRARY}")
+        STRING(REPLACE ${REAL_QT_LIBRARY_DIR_FOR_GREP} "" RAW_QT_LIBRARY "${RAW_QT_LIBRARY}")
         STRING(REGEX REPLACE "\\.framework.*$" "" QT_LIBRARY "${RAW_QT_LIBRARY}")

         LIST(APPEND ${QT_LIBRARIES} ${QT_LIBRARY})
@@ -980,11 +997,7 @@

     # Make sure that the Qt file refers to our embedded version of its Qt
     # dependencies
-    # Note: on Travis CI, QT_LIBRARY_DIR points to a symbolic path. That
-    #       symbolic path is used by some libraries, but not all. Some libraries
-    #       use the real path instead. So, we need to handle both cases...
-
-    GET_FILENAME_COMPONENT(REAL_QT_LIBRARY_DIR ${QT_LIBRARY_DIR} REALPATH)
+
 ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD
                    COMMAND echo "=========")
 ADD_CUSTOM_COMMAND(TARGET ${PROJECT_TARGET} POST_BUILD


Typos

Typos

git-svn-id: fbbf69ba8011aca0e74e1c67904b11cccbdbe66b@28609 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_cached_variables.cmake
+++ deal.II/cmake/setup_cached_variables.cmake
@@ -33,6 +33,7 @@
 #     CMAKE_BUILD_TYPE
 #     BUILD_SHARED_LIBS
 #     CMAKE_INSTALL_RPATH_USE_LINK_PATH
+#     CMAKE_C_FLAGS
 #     CMAKE_CXX_FLAGS                   *)
 #     CMAKE_SHARED_LINKER_FLAGS         *)
 #     DEAL_II_CXX_FLAGS_DEBUG
@@ -106,7 +107,7 @@
 ###########################################################################

 OPTION(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS
-  "configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
+  "Configure sensible default CFLAGS and CXXFLAGS depending on platform, compiler and build target."
   ON
   )
 MARK_AS_ADVANCED(DEAL_II_SETUP_DEFAULT_COMPILER_FLAGS)


Some minor cleaning up [ci skip].

Some minor cleaning up [ci skip].

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

         # Deploy the Qt plugin

-        INSTALL(FILES ${PLUGIN_DEST_DIRNAME}/${PLUGIN_FILENAME}
+        INSTALL(FILES build/${PLUGIN_DEST_DIRNAME}/${PLUGIN_FILENAME}
                 DESTINATION ${PLUGIN_DEST_DIRNAME})
     ENDFOREACH()
 ENDMACRO()


Some work towards upgrading to Qt 5.6.1 LTS + Qt WebKit (#1015).

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

     IF(   "${LIBRARY_NAME}" STREQUAL "Qt5WebKit"
        OR "${LIBRARY_NAME}" STREQUAL "Qt5WebKitWidgets")
-        SET(REAL_QT_LIBRARY_DIR ${QT_WEBKIT_BINARIES_DIR})
+        SET(REAL_QT_BINARY_DIR ${QT_WEBKIT_BINARIES_DIR})
     ELSE()
         SET(REAL_QT_BINARY_DIR ${QT_BINARY_DIR})
     ENDIF()


Cosmetic update to plugin.cmake.

Cosmetic update to plugin.cmake.

--- cmake/plugin.cmake
+++ cmake/plugin.cmake
@@ -118,7 +118,7 @@

 MESSAGE("")
 MESSAGE("********* WARNING **********")
-MESSAGE("Call to PACKAGE_PLUGIN (in [OpenCOR]/cmake/plugin.cmake) for the ${PROJECT_NAME} plugin: please note that the plugin is not currently being deployed in the right location. Also, there is currently no 'proper' support for the internationalisation of the plugin.")
+MESSAGE("Call to PACKAGE_PLUGIN (in [OpenCOR]/cmake/plugin.cmake) for the ${PLUGIN_NAME} plugin: please note that the plugin is not currently being deployed in the right location. Also, there is currently no 'proper' support for the internationalisation of the plugin.")
 MESSAGE("****************************")
 MESSAGE("")
 ENDMACRO()


Make r10c toolchain compile flags more Android-ish
automerge: fed851d

* commit 'fed851df8a7114d4d9a1f5bab635d0507d553080':
  Make r10c toolchain compile flags more Android-ish

--- framework/delibs/cmake/toolchain-android-r10c.cmake
+++ framework/delibs/cmake/toolchain-android-r10c.cmake
@@ -31,7 +31,8 @@
 	set(DE_ANDROID_API 9)
 endif ()

-set(COMMON_C_FLAGS		"-fpic -DANDROID -D__ANDROID__ -D__STDC_INT64__")
+set(COMMON_C_FLAGS		"-mandroid -D__STDC_INT64__")
+set(COMMON_CXX_FLAGS	"${COMMON_C_FLAGS} -frtti -fexceptions")
 set(COMMON_LINKER_FLAGS	"")
 set(ARM_C_FLAGS			"-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ ")

@@ -140,6 +141,6 @@

 # \note Without CACHE STRING FORCE cmake ignores these.
 set(CMAKE_C_FLAGS				"--sysroot=${ANDROID_SYSROOT} ${COMMON_C_FLAGS} ${TARGET_C_FLAGS}" CACHE STRING "" FORCE)
-set(CMAKE_CXX_FLAGS				"--sysroot=${ANDROID_SYSROOT} ${COMMON_C_FLAGS} ${TARGET_C_FLAGS} -I${ANDROID_NDK_PATH}/sources/cxx-stl/gnu-libstdc++/4.9/include -I${ANDROID_NDK_PATH}/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ANDROID_ABI}/include" CACHE STRING "" FORCE)
+set(CMAKE_CXX_FLAGS				"--sysroot=${ANDROID_SYSROOT} ${COMMON_CXX_FLAGS} ${TARGET_C_FLAGS} -I${ANDROID_NDK_PATH}/sources/cxx-stl/gnu-libstdc++/4.9/include -I${ANDROID_NDK_PATH}/sources/cxx-stl/gnu-libstdc++/4.9/libs/${ANDROID_ABI}/include" CACHE STRING "" FORCE)
 set(CMAKE_SHARED_LINKER_FLAGS	"-nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined ${COMMON_LINKER_FLAGS} ${TARGET_LINKER_FLAGS}" CACHE STRING "" FORCE)
 set(CMAKE_EXE_LINKER_FLAGS		"${COMMON_LINKER_FLAGS} ${TARGET_LINKER_FLAGS}" CACHE STRING "" FORCE)


Added boost bzip2 and zlib for Win32

Added boost bzip2 and zlib for Win32

--- cmake/BALLConfigBoost.cmake
+++ cmake/BALLConfigBoost.cmake
@@ -11,6 +11,14 @@
 	thread
 )

+
+# Required libraries and definitions on Windows OS
+IF(WIN32)
+	LIST(APPEND BALL_BOOST_COMPONENTS bzip2 zlib)
+	ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
+	ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
+ENDIF()
+
 # Additional Boost versions that should be included by CMake
 # CMake 2.8.12, which is minimum for configuring BALL, already knowns versions 1.33 up to 1.56
 SET(Boost_ADDITIONAL_VERSIONS "1.60" "1.59" "1.58" "1.57")
@@ -20,9 +28,3 @@

 # Invoke CMake FindBoost module
 FIND_PACKAGE(Boost 1.55 REQUIRED COMPONENTS ${BALL_BOOST_COMPONENTS})
-
-# Required definitions on Windows machines
-IF(WIN32)
-	ADD_DEFINITIONS(-DBOOST_ALL_NO_LIB)
-	ADD_DEFINITIONS(-DBOOST_ALL_DYN_LINK)
-ENDIF()


Fix retrieval of git hash in cmake

Fix retrieval of git hash in cmake

--- cmake/DawnDefinitions.cmake
+++ cmake/DawnDefinitions.cmake
@@ -36,9 +36,9 @@

 # Git version string
 dawn_get_git_head_revision(git_refspec git_hash)
-if(NOT DEFINED SDAWN_GIT_HASH OR NOT "${SDAWN_GIT_HASH}" STREQUAL "${git_hash}")
-  string(SUBSTRING ${git_hash} 0 7 git_hash_short)
-  set(SDAWN_GIT_HASH "${git_hash_short}" CACHE INTERNAL "git hash (short) of current head" FORCE)
+string(SUBSTRING "${git_hash}" 0 7 git_hash_short)
+if(NOT DEFINED DAWN_GIT_HASH OR NOT "${DAWN_GIT_HASH}" STREQUAL "${git_hash_short}")
+  set(DAWN_GIT_HASH "${git_hash_short}" CACHE INTERNAL "git hash (short) of current head" FORCE)
 endif()

 # Assemble full version string


Add BCrypt as Boost dependency on Windows

This appears to be needed for recent Boost releases.

--- cmake/FindBoostTarget.cmake
+++ cmake/FindBoostTarget.cmake
@@ -83,6 +83,8 @@
         set_property(TARGET boost PROPERTY INTERFACE_LINK_LIBRARIES ${_subLibs})
         if(UNIX)
             set_property(TARGET boost APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-lpthread")
+        elseif(WIN32)
+            set_property(TARGET boost APPEND PROPERTY INTERFACE_LINK_LIBRARIES "bcrypt")
         endif()
     endif()
 endif()


Add sql plugin to static libs

Add sql plugin to static libs

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -1,6 +1,6 @@
 # --- Qt5 ---
 find_package( Qt5 REQUIRED COMPONENTS
-  Core Gui Widgets PrintSupport OpenGL )
+  Core Gui Widgets PrintSupport OpenGL Sql )
 if( NOT APPLE )
   find_package( Qt5DBus REQUIRED )
 endif()
@@ -28,6 +28,7 @@
     "${_qt5Widgets_install_prefix}/plugins/imageformats/qwbmp.lib"
     "${_qt5Widgets_install_prefix}/plugins/imageformats/qwebp.lib"
     "${_qt5Widgets_install_prefix}/lib/Qt5Svg.lib"
+    "${_qt5Widgets_install_prefix}/plugins/sqldrivers/qsqlodbc.lib"
     )
 elseif( APPLE )
 elseif( UNIX )


Move cmake config files too on non-windows hosts.

--- cmake/OpenCVGenConfig.cmake
+++ cmake/OpenCVGenConfig.cmake
@@ -154,13 +154,19 @@
   endif()
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" @ONLY)
   configure_file("${OpenCV_SOURCE_DIR}/cmake/templates/OpenCVConfig-version.cmake.in" "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" @ONLY)
-  if(BUILD_SHARED_LIBS)
-    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" COMPONENT dev)
-    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
-  else()
-    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" COMPONENT dev)
-    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
-  endif()
-  install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT dev)
-  install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/" COMPONENT dev)
+  if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
+    if(BUILD_SHARED_LIBS)
+      install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" COMPONENT dev)
+      install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
+    else()
+      install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" COMPONENT dev)
+      install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}staticlib" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
+    endif()
+    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT dev)
+    install(FILES "${OpenCV_SOURCE_DIR}/cmake/OpenCVConfig.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/" COMPONENT dev)
+  else ()
+    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig.cmake" DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib/cmake/opencv-${OPENCV_VERSION}" COMPONENT dev)
+    install(EXPORT OpenCVModules DESTINATION "${OpenCV_INSTALL_BINARIES_PREFIX}lib/cmake/opencv-${OPENCV_VERSION}" FILE OpenCVModules${modules_file_suffix}.cmake COMPONENT dev)
+    install(FILES "${CMAKE_BINARY_DIR}/win-install/OpenCVConfig-version.cmake" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/cmake/opencv-${OPENCV_VERSION}" COMPONENT dev)
+  endif ()
 endif()


[CMake] llvm_codesign workaround for Xcode double-signing errors

Summary:
When using Xcode to build LLVM with code signing, the post-build rule is executed even if the actual build-step was skipped. This causes double-signing errors. We can currently only avoid it by passing the `--force` flag.

Plus some polishing for my previous patch D54443.

Reviewers: beanz, kubamracek

Reviewed By: kubamracek

Subscribers: #lldb, mgorny, llvm-commits

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -584,7 +584,7 @@

   if(ARG_SHARED OR ARG_MODULE)
     llvm_externalize_debuginfo(${name})
-    llvm_codesign(TARGET ${name})
+    llvm_codesign(${name})
   endif()
 endfunction()

@@ -796,7 +796,7 @@
     target_link_libraries(${name} PRIVATE ${LLVM_PTHREAD_LIB})
   endif()

-  llvm_codesign(TARGET ${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
+  llvm_codesign(${name} ENTITLEMENTS ${ARG_ENTITLEMENTS})
 endmacro(add_llvm_executable name)

 function(export_executable_symbols target)
@@ -1635,13 +1635,9 @@
   endif()
 endfunction()

-# Usage: llvm_codesign(TARGET name [ENTITLEMENTS file])
-#
-# Code-sign the given TARGET with the global LLVM_CODESIGNING_IDENTITY or skip
-# if undefined. Customize capabilities by passing a file path to ENTITLEMENTS.
-#
-function(llvm_codesign)
-  cmake_parse_arguments(ARG "" "TARGET;ENTITLEMENTS" "" ${ARGN})
+# Usage: llvm_codesign(name [ENTITLEMENTS file])
+function(llvm_codesign name)
+  cmake_parse_arguments(ARG "" "ENTITLEMENTS" "" ${ARGN})

   if(NOT LLVM_CODESIGNING_IDENTITY)
     return()
@@ -1659,15 +1655,20 @@
       )
     endif()
     if(DEFINED ARG_ENTITLEMENTS)
-      set(PASS_ENTITLEMENTS --entitlements ${ARG_ENTITLEMENTS})
+      set(pass_entitlements --entitlements ${ARG_ENTITLEMENTS})
+    endif()
+    if(CMAKE_GENERATOR STREQUAL "Xcode")
+      # Avoid double-signing error: Since output overwrites input, Xcode runs
+      # the post-build rule even if the actual build-step was skipped.
+      set(pass_force --force)
     endif()

     add_custom_command(
-      TARGET ${ARG_TARGET} POST_BUILD
+      TARGET ${name} POST_BUILD
       COMMAND ${CMAKE_COMMAND} -E
               env CODESIGN_ALLOCATE=${CMAKE_CODESIGN_ALLOCATE}
               ${CMAKE_CODESIGN} -s ${LLVM_CODESIGNING_IDENTITY}
-              ${PASS_ENTITLEMENTS} $<TARGET_FILE:${ARG_TARGET}>
+              ${pass_entitlements} ${pass_force} $<TARGET_FILE:${name}>
     )
   endif()
 endfunction()


with the new swagger increasing in size, and the advent of iresearch increasing by 20 MB. (#4323)

--- cmake/packages/bundle.cmake
+++ cmake/packages/bundle.cmake
@@ -35,8 +35,8 @@

 # we wrap HDIUTIL to inject our own parameter:
 find_program(HDIUTIL_EXECUTABLE hdiutil)
-# for now 280MB seems to be enough:
-set(CMAKE_DMG_SIZE 280)
+# for now 300MB seems to be enough:
+set(CMAKE_DMG_SIZE 300)
 configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/hdiutilwrapper.sh.in"
   "${CMAKE_CURRENT_BINARY_DIR}/hdiutilwrapper.sh"
   @ONLY)


cmake/general: make BUILD_TESTS option explicit

This allows to get rid of stupid code like this

  if(DEFINED BUILD_TESTS AND NOT ${BUILD_TESTS})
    ...
  endif()

amd just use:

  if(NOT BUILD_TESTS)
    ...
  endif()

Change-Id: Ib2f6d2c31fbeb304087b320e8c860a460de86c14
Reviewed-on: http://gerrit.aldebaran.lan:8080/1959
Reviewed-by: llec <42f1a1c02cacc0f5b0188f0127ea77bedfdcf21a@aldebaran-robotics.com>
Tested-by: llec <42f1a1c02cacc0f5b0188f0127ea77bedfdcf21a@aldebaran-robotics.com>
Reviewed-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>
Tested-by: dmerejkowsky <1e4b13000fa8777df4cefd2fd8215187e3deb062@aldebaran-robotics.com>

--- cmake/qibuild/general.cmake
+++ cmake/qibuild/general.cmake
@@ -111,3 +111,8 @@
 qi_debug("CMAKE_INCLUDE_PATH    = ${CMAKE_INCLUDE_PATH}")
 qi_debug("CMAKE_SYSTEM_LIBRARY_PATH = ${CMAKE_SYSTEM_LIBRARY_PATH}")

+
+# Small option to deactivate targets created by qi_add_test et al.
+option(BUILD_TESTS
+  "If OFF, no test will be built, and `qibuild test` won't run any test"
+  ON)


Fix the logic to suppress all warnings for iOS CI build. [ci skip]

--- Source/CMake/Modules/Urho3D-CMake-common.cmake
+++ Source/CMake/Modules/Urho3D-CMake-common.cmake
@@ -216,7 +216,7 @@
         endif ()
     elseif (IOS)
         # When performing CI build, suppress all the warnings for iOS build because 3rd party libraries produce too many of them and yet we don't want to touch the 3rd party library's source codes unnecessarily
-        if ($ENV{CI})
+        if ("$ENV{CI}" STREQUAL true)
             set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w")
             set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w")
         endif ()


BUG: switched back to elastix git

BUG: switched back to elastix git

--- SuperBuild/ExternalElastix.cmake
+++ SuperBuild/ExternalElastix.cmake
@@ -19,15 +19,12 @@

 set( proj Elastix )

-set( ELASTIX_REPOSITORY https://svn.bigr.nl/elastix/trunkpublic/ )
-set( ELASTIX_REVISION 5374 )
+set( ELASTIX_GIT_REPOSITORY http://github.com/kaspermarstal/elastix )
+set( ELASTIX_GIT_TAG 25c9dec600979a997faa373d7cd5259f65fac220 )

 ExternalProject_Add( ${proj}
-  SVN_REPOSITORY ${ELASTIX_REPOSITORY}
-  SVN_REVISION -r ${ELASTIX_REVISION}
-  SVN_USERNAME elastixguest
-  SVN_PASSWORD elastixguest
-  SVN_TRUST_CERT 1
+  GIT_REPOSITORY ${ELASTIX_GIT_REPOSITORY}
+  GIT_TAG ${ELASTIX_GIT_TAG}
   UPDATE_COMMAND ""
   SOURCE_DIR ${proj}
   BINARY_DIR ${proj}-build


Removing GL dependency

Removing GL dependency

--- cmake/CMakelinuxx8664gcc.cmake
+++ cmake/CMakelinuxx8664gcc.cmake
@@ -85,7 +85,8 @@
                 OUTPUT_STRIP_TRAILING_WHITESPACE)

-set(SYSLIBS "-ldl -lcrypt -L/usr/X11R6/lib -lX11 -lGL -lGLU ${LIBNOVER}")
+#set(SYSLIBS "-ldl -lcrypt -L/usr/X11R6/lib -lX11 -lGL -lGLU ${LIBNOVER}")
+set(SYSLIBS "-ldl -lcrypt -L/usr/X11R6/lib -lX11 ${LIBNOVER}")

 if(${CMAKE_Fortran_COMPILER} MATCHES "g95")


Link with shlwapi library on Microsoft Windows

--- cmake/hnc_windows-config.cmake
+++ cmake/hnc_windows-config.cmake
@@ -27,6 +27,8 @@

 	add_definitions("-D${HNC_WINDOWS_MACRO}")

+	link_libraries(shlwapi)
+
 	message(STATUS "Platform is Windows :(")

 else()


[CMake] Fix building without python on Windows

Summary: find_python_libs_windows might set LLDB_DISABLE_PYTHON to ON.
Unfortunately we do not re-check this variable before using variables filled in
by find_python_libs_windows, leading to a failed configuration.

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

--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -267,10 +267,15 @@
   message(STATUS "LLDB Found PythonIncludeDirs: ${PYTHON_INCLUDE_DIR}")
 endfunction(find_python_libs_windows)

+# Call find_python_libs_windows ahead of the rest of the python configuration.
+# It's possible that it won't find a python installation and will then set
+# LLDB_DISABLE_PYTHON to ON.
+if (NOT LLDB_DISABLE_PYTHON AND "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
+  find_python_libs_windows()
+endif()
+
 if (NOT LLDB_DISABLE_PYTHON)
   if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
-    find_python_libs_windows()
-
     if (NOT LLDB_RELOCATABLE_PYTHON)
       file(TO_CMAKE_PATH "${PYTHON_HOME}" LLDB_PYTHON_HOME)
       add_definitions( -DLLDB_PYTHON_HOME="${LLDB_PYTHON_HOME}" )


Improved FindTufao.cmake

Improved FindTufao.cmake

--- pkg/FindTufao.cmake
+++ pkg/FindTufao.cmake
@@ -8,13 +8,22 @@
     NAMES tufao
 )

+# list of subdirectories where Tufão used to be installed
+set(tufao_paths "tufao-0")
+
 foreach(path ${CMAKE_SYSTEM_PREFIX_PATH})
-    set(tufao_search_path ${tufao_search_path} "${path}/include/tufao-0")
+    foreach(subpath ${tufao_paths})
+        set(tufao_search_path ${tufao_search_path} "${path}/include/${subpath}")
+    endforeach()
 endforeach()

-foreach(path ${CMAKE_SYSTEM_INCLUDE_PATH})
-    set(tufao_search_path ${tufao_search_path} "${path}/tufao-0")
+foreach(path ${CMAKE_SYSTEM_INCLUDE_PATH} ${CMAKE_SYSTEM_FRAMEWORK_PATH})
+    foreach(subpath ${tufao_paths})
+        set(tufao_search_path ${tufao_search_path} "${path}/${subpath}")
+    endforeach()
 endforeach()
+
+unset(tufao_paths)

 find_path(TUFAO_INCLUDE_DIR
     NAMES Tufao/tufao_global.h


feat(python-api): Prevent pybind11 error

- Prevent "no matching function for call to 'operator delete'"

--- Builds/CMake/CompileOptions.cmake
+++ Builds/CMake/CompileOptions.cmake
@@ -121,9 +121,18 @@
 		-std=c++1z
 	)
 endif ()
+
 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
 	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
 		-Wno-int-in-bool-context
+	)
+endif ()
+
+# Prevent "no matching function for call to 'operator delete'" error
+# https://github.com/pybind/pybind11/issues/1604
+if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+	set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+		-fsized-deallocation
 	)
 endif ()


CMake: Fix environmental variables poisoning build config of native packaging tool build.

--- CMake/Modules/UrhoPackaging.cmake
+++ CMake/Modules/UrhoPackaging.cmake
@@ -45,7 +45,7 @@
         ExternalProject_Add (Urho3D-Native
             SOURCE_DIR ${Urho3D_SOURCE_DIR}
             CMAKE_COMMAND ${ALTERNATE_COMMAND}
-            CMAKE_ARGS -DURHO3D_PACKAGING_TOOL=ON -DMINI_URHO=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/native PackageTool
+            CMAKE_ARGS -DURHO3D_ENABLE_ALL=OFF -DURHO3D_FEATURES=PACKAGING_TOOL -DMINI_URHO=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/native PackageTool
         )
         set (PACKAGE_TOOL ${CMAKE_BINARY_DIR}/native/bin/PackageTool)
     elseif (TARGET PackageTool)