add support for version 12.3 and MacOSX-ARM64

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -245,7 +245,7 @@
 	set (_MathematicaApps "Mathematica" "Wolfram Desktop" "Wolfram Engine" "gridMathematica Server")
 	# Mathematica product versions in order of preference
 	set (_MathematicaVersions
-		"12.2" "12.1" "12.0"
+		"12.3" "12.2" "12.1" "12.0"
 		"11.3" "11.2" "11.1" "11.0"
 		"10.4" "10.3" "10.2" "10.1" "10.0"
 		"9.0" "8.0" "7.0" "6.0" "5.2")
@@ -500,6 +500,8 @@
 			set (${_outSystemIDs} "MacOSX-x86")
 		elseif ("${_systemProcessor}" STREQUAL "x86_64")
 			set (${_outSystemIDs} "MacOSX-x86-64")
+		elseif ("${_systemProcessor}" STREQUAL "arm64")
+			set (${_outSystemIDs} "MacOSX-ARM64")
 		elseif ("${_systemProcessor}" MATCHES "ppc64|powerpc64")
 			set (${_outSystemIDs} "Darwin-PowerPC64")
 		elseif ("${_systemProcessor}" MATCHES "ppc|powerpc")
@@ -648,7 +650,12 @@
 endmacro()

 macro (_get_supported_systemIDs _version _outSystemIDs)
-	if (NOT "${_version}" VERSION_LESS "12.1")
+	if (NOT "${_version}" VERSION_LESS "12.3")
+		set (${_outSystemIDs}
+			"Windows-x86-64"
+			"Linux-x86-64" "Linux-ARM"
+			"MacOSX-x86-64" "MacOSX-ARM64")
+	elseif (NOT "${_version}" VERSION_LESS "12.1")
 		set (${_outSystemIDs}
 			"Windows-x86-64"
 			"Linux-x86-64" "Linux-ARM"
@@ -741,6 +748,19 @@
 			else()
 				list (APPEND ${_outSystemIDs} "MacOSX-x86-64" "MacOSX-x86")
 			endif()
+		elseif ("${_systemID}" MATCHES "MacOSX-ARM64")
+			if (Mathematica_VERSION)
+				# Mathematica 12.3 added support for MacOSX-ARM64
+				if (NOT "${Mathematica_VERSION}" VERSION_LESS "12.3")
+					list (APPEND ${_outSystemIDs} "MacOSX-ARM64")
+				endif()
+				# Mathematica 6 added support for MacOSX-x86-64
+				if (NOT "${Mathematica_VERSION}" VERSION_LESS "6.0")
+					list (APPEND ${_outSystemIDs} "MacOSX-x86-64")
+				endif()
+			else()
+				list (APPEND ${_outSystemIDs} "MacOSX-ARM64" "MacOSX-x86-64")
+			endif()
 		elseif ("${_systemID}" STREQUAL "Darwin-PowerPC64")
 			if (Mathematica_VERSION)
 				if (NOT "${Mathematica_VERSION}" VERSION_LESS "5.2" AND
@@ -801,7 +821,7 @@
 				set (${_outSystemIDs} "")
 			else()
 				# Mathematica versions after 9 have a system ID subdirectory
-				set (${_outSystemIDs} "MacOSX-x86-64")
+				set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64")
 			endif()
 		else()
 			_get_system_IDs(${_outSystemIDs})
@@ -819,8 +839,8 @@
 			if ("${Mathematica_VERSION}" VERSION_LESS "9.0")
 				set (${_outSystemIDs} "")
 			else()
-				# The MacOSX-x86-64 DeveloperKit is a universal binary with architectures i386 and x86_64
-				set (${_outSystemIDs} "MacOSX-x86-64")
+				# Mathematica versions after 9 have a system ID subdirectory
+				set (${_outSystemIDs} "MacOSX-x86-64" "MacOSX-ARM64")
 			endif()
 		else()
 			_get_host_system_IDs(${_outSystemIDs})
@@ -3019,6 +3039,8 @@
 					list (APPEND ${_cmdVar} "/usr/bin/arch" "-i386")
 				elseif("${${_systemIDVar}}" STREQUAL "MacOSX-x86-64")
 					list (APPEND ${_cmdVar} "/usr/bin/arch" "-x86_64")
+				elseif("${${_systemIDVar}}" STREQUAL "MacOSX-ARM64")
+					list (APPEND ${_cmdVar} "/usr/bin/arch" "-arm64")
 				elseif("${${_systemIDVar}}" MATCHES "Darwin|MacOSX")
 					list (APPEND ${_cmdVar} "/usr/bin/arch" "-ppc")
 				elseif("${${_systemIDVar}}" STREQUAL "Darwin-PowerPC64")


Adding support for easybuild modules

Adding support for easybuild modules

Former-commit-id: 73702b18ded6e5c75b47120b54bd39af014fb617

--- cmake-modules/Fetch_Eigen3.cmake
+++ cmake-modules/Fetch_Eigen3.cmake
@@ -24,9 +24,9 @@

 if(EIGEN3_FOUND AND TARGET Eigen3::Eigen)
+    get_target_property(EIGEN3_INCLUDE_DIR Eigen3::Eigen INTERFACE_INCLUDE_DIRECTORIES)
     message(STATUS "EIGEN VERSION ${EIGEN3_VERSION} FOUND IN SYSTEM: ${EIGEN3_INCLUDE_DIR}")
     target_compile_options(Eigen3::Eigen INTERFACE ${EIGEN3_COMPILER_FLAGS})
-    target_include_directories(Eigen3::Eigen INTERFACE ${EIGEN3_INCLUDE_DIR})
     add_library(Eigen3 INTERFACE)
     target_link_libraries(Eigen3 INTERFACE Eigen3::Eigen)


update CMake android toolchain from https://github.com/taka-no-me/android-cmake

--- CMake/toolchain/android.toolchain.cmake
+++ CMake/toolchain/android.toolchain.cmake
@@ -1,10 +1,40 @@
+# Copyright (c) 2010-2011, Ethan Rublee
+# Copyright (c) 2011-2014, Andrey Kamaev
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# 1.  Redistributions of source code must retain the above copyright notice,
+#     this list of conditions and the following disclaimer.
+#
+# 2.  Redistributions in binary form must reproduce the above copyright notice,
+#     this list of conditions and the following disclaimer in the documentation
+#     and/or other materials provided with the distribution.
+#
+# 3.  Neither the name of the copyright holder nor the names of its
+#     contributors may be used to endorse or promote products derived from this
+#     software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+
 # ------------------------------------------------------------------------------
 #  Android CMake toolchain file, for use with the Android NDK r5-r9
 #  Requires cmake 2.6.3 or newer (2.8.5 or newer is recommended).
 #  See home page: https://github.com/taka-no-me/android-cmake
 #
 #  The file is mantained by the OpenCV project. The latest version can be get at
-#  https://github.com/Itseez/opencv/tree/master/platforms/android/android.toolchain.cmake
+#  http://code.opencv.org/projects/opencv/repository/revisions/master/changes/android/android.toolchain.cmake
 #
 #  Usage Linux:
 #   $ export ANDROID_NDK=/absolute/path/to/the/android-ndk
@@ -57,8 +87,7 @@
 #        "armeabi-v6 with VFP" - tuned for ARMv6 processors having VFP.
 #        "x86" - matches to the NDK ABI with the same name.
 #            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
-#        "mips" - matches to the NDK ABI with the same name
-#            (It is not tested on real devices by the authos of this toolchain)
+#        "mips" - matches to the NDK ABI with the same name.
 #            See ${ANDROID_NDK}/docs/CPU-ARCH-ABIS.html for the documentation.
 #
 #    ANDROID_NATIVE_API_LEVEL=android-8 - level of Android API compile for.
@@ -262,6 +291,18 @@
 #   - April 2013
 #     [+] support non-release NDK layouts (from Linaro git and Android git)
 #     [~] automatically detect if explicit link to crtbegin_*.o is needed
+#   - June 2013
+#     [~] fixed stl include path for standalone toolchain made by NDK >= r8c
+#   - July 2013
+#     [+] updated for NDK r9
+#   - November 2013
+#     [+] updated for NDK r9b
+#   - December 2013
+#     [+] updated for NDK r9c
+#   - January 2014
+#     [~] fix copying of shared STL
+#   - April 2014
+#     [+] updated for NDK r9d
 # ------------------------------------------------------------------------------

 cmake_minimum_required( VERSION 2.6.3 )
@@ -288,7 +329,7 @@
 # rpath makes low sence for Android
 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )

-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r9c -r9b -r9 -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if(NOT DEFINED ANDROID_NDK_SEARCH_PATHS)
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
@@ -306,7 +347,7 @@
 set( ANDROID_SUPPORTED_ABIS_x86 "x86" )
 set( ANDROID_SUPPORTED_ABIS_mipsel "mips" )

-set( ANDROID_DEFAULT_NDK_API_LEVEL 9 )
+set( ANDROID_DEFAULT_NDK_API_LEVEL 8 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_x86 9 )
 set( ANDROID_DEFAULT_NDK_API_LEVEL_mips 9 )

@@ -434,7 +475,7 @@

 # detect current host platform
-if( NOT DEFINED ANDROID_NDK_HOST_X64 AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64")
+if( NOT DEFINED ANDROID_NDK_HOST_X64 AND (CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "amd64|x86_64|AMD64" OR CMAKE_HOST_APPLE) )
  set( ANDROID_NDK_HOST_X64 1 CACHE BOOL "Try to use 64-bit compiler toolchain" )
  mark_as_advanced( ANDROID_NDK_HOST_X64 )
 endif()
@@ -454,9 +495,7 @@
  message( FATAL_ERROR "Cross-compilation on your platform is not supported by this cmake toolchain" )
 endif()

-# CMAKE_HOST_SYSTEM_PROCESSOR on MacOS X always says i386 on Intel platform
-# So we do not trust ANDROID_NDK_HOST_X64 on Apple hosts
-if( NOT ANDROID_NDK_HOST_X64 AND NOT CMAKE_HOST_APPLE)
+if( NOT ANDROID_NDK_HOST_X64 )
  set( ANDROID_NDK_HOST_SYSTEM_NAME ${ANDROID_NDK_HOST_SYSTEM_NAME2} )
 endif()

@@ -479,7 +518,7 @@

   if( ANDROID_NDK )
    message( STATUS "Using default path for Android NDK: ${ANDROID_NDK}" )
-   message( STATUS "If you prefer to use a different location, please define a cmake or environment variable: ANDROID_NDK" )
+   message( STATUS "  If you prefer to use a different location, please define a cmake or environment variable: ANDROID_NDK" )
   else()
    #try to find Android standalone toolchain in one of the the default locations
    __INIT_VARIABLE( ANDROID_STANDALONE_TOOLCHAIN PATH ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH )
@@ -526,7 +565,7 @@
     or
       export ANDROID_STANDALONE_TOOLCHAIN=~/my-android-toolchain
     or put the toolchain or NDK in the default path:
-      sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}-XXX where XXX is your NDK version
+      sudo ln -s ~/my-android-ndk ${ANDROID_NDK_SEARCH_PATH}
       sudo ln -s ~/my-android-toolchain ${ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH}" )
 endif()

@@ -604,30 +643,27 @@

 macro( __GLOB_NDK_TOOLCHAINS __availableToolchainsVar __availableToolchainsLst __toolchain_subpath )
  foreach( __toolchain ${${__availableToolchainsLst}} )
-  # Skip renderscript folder. It's not C++ toolchain
-  if (NOT ${__toolchain} STREQUAL "renderscript")
-   if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
-     string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
-   else()
-     set( __gcc_toolchain "${__toolchain}" )
+  if( "${__toolchain}" MATCHES "-clang3[.][0-9]$" AND NOT EXISTS "${ANDROID_NDK_TOOLCHAINS_PATH}/${__toolchain}${__toolchain_subpath}" )
+   string( REGEX REPLACE "-clang3[.][0-9]$" "-4.6" __gcc_toolchain "${__toolchain}" )
+  else()
+   set( __gcc_toolchain "${__toolchain}" )
+  endif()
+  __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" )
+  if( __machine )
+   string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" )
+   if( __machine MATCHES i686 )
+    set( __arch "x86" )
+   elseif( __machine MATCHES arm )
+    set( __arch "arm" )
+   elseif( __machine MATCHES mipsel )
+    set( __arch "mipsel" )
    endif()
-   __DETECT_TOOLCHAIN_MACHINE_NAME( __machine "${ANDROID_NDK_TOOLCHAINS_PATH}/${__gcc_toolchain}${__toolchain_subpath}" )
-   if( __machine )
-    string( REGEX MATCH "[0-9]+[.][0-9]+([.][0-9x]+)?$" __version "${__gcc_toolchain}" )
-    if( __machine MATCHES i686 )
-     set( __arch "x86" )
-    elseif( __machine MATCHES arm )
-     set( __arch "arm" )
-    elseif( __machine MATCHES mipsel )
-     set( __arch "mipsel" )
-    endif()
-    list( APPEND __availableToolchainMachines "${__machine}" )
-    list( APPEND __availableToolchainArchs "${__arch}" )
-    list( APPEND __availableToolchainCompilerVersions "${__version}" )
-    list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
-   endif()
-   unset( __gcc_toolchain )
-  endif()
+   list( APPEND __availableToolchainMachines "${__machine}" )
+   list( APPEND __availableToolchainArchs "${__arch}" )
+   list( APPEND __availableToolchainCompilerVersions "${__version}" )
+   list( APPEND ${__availableToolchainsVar} "${__toolchain}" )
+  endif()
+  unset( __gcc_toolchain )
  endforeach()
 endmacro()

@@ -657,6 +693,7 @@
   endif()
   __LIST_FILTER( __availableToolchainsLst "^[.]" )
   __LIST_FILTER( __availableToolchainsLst "llvm" )
+  __LIST_FILTER( __availableToolchainsLst "renderscript" )
   __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH}" )
   if( NOT __availableToolchains AND NOT ANDROID_NDK_TOOLCHAINS_SUBPATH STREQUAL ANDROID_NDK_TOOLCHAINS_SUBPATH2 )
    __GLOB_NDK_TOOLCHAINS( __availableToolchains __availableToolchainsLst "${ANDROID_NDK_TOOLCHAINS_SUBPATH2}" )
@@ -945,7 +982,11 @@
  set( ANDROID_SYSROOT "${ANDROID_STANDALONE_TOOLCHAIN}/sysroot" )

  if( NOT ANDROID_STL STREQUAL "none" )
-  set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
+  set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/include/c++/${ANDROID_COMPILER_VERSION}" )
+  if( NOT EXISTS "${ANDROID_STL_INCLUDE_DIRS}" )
+   # old location ( pre r8c )
+   set( ANDROID_STL_INCLUDE_DIRS "${ANDROID_STANDALONE_TOOLCHAIN}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/include/c++/${ANDROID_COMPILER_VERSION}" )
+  endif()
   if( ARMEABI_V7A AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}/bits" )
    list( APPEND ANDROID_STL_INCLUDE_DIRS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/${CMAKE_SYSTEM_PROCESSOR}" )
   elseif( ARMEABI AND NOT ANDROID_FORCE_ARM_BUILD AND EXISTS "${ANDROID_STL_INCLUDE_DIRS}/${ANDROID_TOOLCHAIN_MACHINE_NAME}/thumb/bits" )
@@ -1100,15 +1141,7 @@
 # case of shared STL linkage
 if( ANDROID_STL MATCHES "shared" AND DEFINED __libstl )
  string( REPLACE "_static.a" "_shared.so" __libstl "${__libstl}" )
- if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" )
-  get_filename_component( __libstlname "${__libstl}" NAME )
-  execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
-  if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
-   message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
-  endif()
-  unset( __fileCopyProcess )
-  unset( __libstlname )
- endif()
+ # TODO: check if .so file exists before the renaming
 endif()

@@ -1472,8 +1505,9 @@
 endif()

 # global includes and link directories
-include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_NDK}/sources/cpufeatures ${ANDROID_STL_INCLUDE_DIRS} )
-link_directories( "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" )
+include_directories( SYSTEM "${ANDROID_SYSROOT}/usr/include" ${ANDROID_STL_INCLUDE_DIRS} )
+get_filename_component(__android_install_path "${CMAKE_INSTALL_PREFIX}/libs/${ANDROID_NDK_ABI_NAME}" ABSOLUTE) # avoid CMP0015 policy warning
+link_directories( "${__android_install_path}" )

 # detect if need link crtbegin_so.o explicitly
 if( NOT DEFINED ANDROID_EXPLICIT_CRT_LINK )
@@ -1525,12 +1559,24 @@
  set( LIBRARY_OUTPUT_PATH "${LIBRARY_OUTPUT_PATH_ROOT}/libs/${ANDROID_NDK_ABI_NAME}" CACHE PATH "path for android libs" )
 endif()

+# copy shaed stl library to build directory
+if( NOT _CMAKE_IN_TRY_COMPILE AND __libstl MATCHES "[.]so$" )
+ get_filename_component( __libstlname "${__libstl}" NAME )
+ execute_process( COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${__libstl}" "${LIBRARY_OUTPUT_PATH}/${__libstlname}" RESULT_VARIABLE __fileCopyProcess )
+ if( NOT __fileCopyProcess EQUAL 0 OR NOT EXISTS "${LIBRARY_OUTPUT_PATH}/${__libstlname}")
+  message( SEND_ERROR "Failed copying of ${__libstl} to the ${LIBRARY_OUTPUT_PATH}/${__libstlname}" )
+ endif()
+ unset( __fileCopyProcess )
+ unset( __libstlname )
+endif()
+
+
 # set these global flags for cmake client scripts to change behavior
 set( ANDROID True )
 set( BUILD_ANDROID True )

 # where is the target environment
-set( CMAKE_FIND_ROOT_PATH "${CMAKE_SOURCE_DIR}" "${OGRE_DEPENDENCIES_DIR}" "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share")
+set( CMAKE_FIND_ROOT_PATH "${ANDROID_TOOLCHAIN_ROOT}/bin" "${ANDROID_TOOLCHAIN_ROOT}/${ANDROID_TOOLCHAIN_MACHINE_NAME}" "${ANDROID_SYSROOT}" "${CMAKE_INSTALL_PREFIX}" "${CMAKE_INSTALL_PREFIX}/share" )

 # only search for libraries and includes in the ndk toolchain
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
@@ -1633,6 +1679,19 @@
 endif()

+# force cmake to produce / instead of \ in build commands for Ninja generator
+if( CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_HOST_WIN32 )
+ # it is a bad hack after all
+ # CMake generates Ninja makefiles with UNIX paths only if it thinks that we are going to build with MinGW
+ set( CMAKE_COMPILER_IS_MINGW TRUE ) # tell CMake that we are MinGW
+ set( CMAKE_CROSSCOMPILING TRUE )    # stop recursion
+ enable_language( C )
+ enable_language( CXX )
+ # unset( CMAKE_COMPILER_IS_MINGW ) # can't unset because CMake does not convert back-slashes in response files without it
+ unset( MINGW )
+endif()
+
+
 # set some obsolete variables for backward compatibility
 set( ANDROID_SET_OBSOLETE_VARIABLES ON CACHE BOOL "Define obsolete Andrid-specific cmake variables" )
 mark_as_advanced( ANDROID_SET_OBSOLETE_VARIABLES )
@@ -1687,7 +1746,7 @@
 #   BUILD_WITH_STANDALONE_TOOLCHAIN : TRUE if standalone toolchain is used
 #   ANDROID_NDK_HOST_SYSTEM_NAME : "windows", "linux-x86" or "darwin-x86" depending on host platform
 #   ANDROID_NDK_ABI_NAME : "armeabi", "armeabi-v7a", "x86" or "mips" depending on ANDROID_ABI
-#   ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e; set only for NDK
+#   ANDROID_NDK_RELEASE : one of r5, r5b, r5c, r6, r6b, r7, r7b, r7c, r8, r8b, r8c, r8d, r8e, r9, r9b, r9c, r9d; set only for NDK
 #   ANDROID_ARCH_NAME : "arm" or "x86" or "mips" depending on ANDROID_ABI
 #   ANDROID_SYSROOT : path to the compiler sysroot
 #   TOOL_OS_SUFFIX : "" or ".exe" depending on host platform
@@ -1717,4 +1776,3 @@
 #   ANDROID_STANDALONE_TOOLCHAIN_SEARCH_PATH
 #   ANDROID_SUPPORTED_ABIS_${ARCH}
 #   ANDROID_SUPPORTED_NDK_VERSIONS
-


fix comment typo

fix comment typo

--- cmake-modules/FindProtobuf.cmake
+++ cmake-modules/FindProtobuf.cmake
@@ -30,7 +30,7 @@
 endif()

 find_library(Protobuf_LIBRARY
-  NAMES protobuf libprotobuf #This is dumb, but nessecary because on mac, the prefix is "lib", but on windows its ""
+  NAMES protobuf libprotobuf #This is dumb, but necessary because on mac, the prefix is "lib", but on windows its ""
   HINTS "${Protobuf_ROOT_DIR}/lib"
         "${Protobuf_ROOT_DIR}/lib/Release"
 )


small fix 2

small fix 2

git-svn-id: 6b1c4fe79111c0bc0cce83313250759594f8984b@9013 e128ff1e-fa79-4151-a8cb-522299a2c450

--- cmake/AddCXXCompileOptions.cmake
+++ cmake/AddCXXCompileOptions.cmake
@@ -160,6 +160,15 @@
       set(CMAKE_CXX_STANDARD_DEFAULT 11)
     endif()

+else() # msvc or others
+      set(CMAKE_CXX98_STANDARD_COMPILE_OPTION  "")
+      set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "")
+      set(CMAKE_CXX11_STANDARD_COMPILE_OPTION  "")
+      set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "")
+      set(CMAKE_CXX14_STANDARD_COMPILE_OPTION  "")
+      set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "")
+      set(CMAKE_CXX17_STANDARD_COMPILE_OPTION  "")
+      set(CMAKE_CXX17_EXTENSION_COMPILE_OPTION "")
 endif()

 endif() # cmake 3.1


Removed duplicate specification of MSP dependency lib

--- cmake/CMakeModules/FindMSP.cmake
+++ cmake/CMakeModules/FindMSP.cmake
@@ -74,7 +74,6 @@
   FIND_MSP_LIBRARY(MSPImagingGeometryService LIBS_OK)
   FIND_MSP_LIBRARY(MSPjson LIBS_OK)
   FIND_MSP_LIBRARY(MSPmens LIBS_OK)
-  FIND_MSP_LIBRARY(MSPTerrainService LIBS_OK)
   FIND_MSP_LIBRARY(MSPMensurationService LIBS_OK)
   FIND_MSP_LIBRARY(MSPMensurationSessionRecordService LIBS_OK)
   FIND_MSP_LIBRARY(MSPwriteRsmNitf LIBS_OK)


cmake: save excluded tools to REMOVED_TOOLS variable

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -307,12 +307,27 @@
 	set (TMP ${TOOLS})
 	message (STATUS "Exclude tool ${name} because ${reason}")
 	list (REMOVE_ITEM TMP
-			  ${name})
+			${name})
 	set (TOOLS
-	     ${TMP}
-	     CACHE STRING
-		   ${TOOLS_DOC}
-	     FORCE)
+	    ${TMP}
+	    CACHE STRING
+		${TOOLS_DOC}
+		FORCE)
+
+	# save removed tools for dependency resolving later on
+	if (REMOVED_TOOLS)
+		set (REMOVED_TOOLS
+			"${REMOVED_TOOLS};${name}"
+			CACHE STRING
+			"${REMOVED_TOOLS_DOC}"
+			FORCE)
+	else ()
+		set (REMOVED_TOOLS
+			"${name}"
+			CACHE STRING
+			"${REMOVED_TOOLS_DOC}"
+			FORCE)
+	endif ()
 endmacro (remove_tool)

 # ~~~


cmake patch depend on previous patch target (#7075)

--- cmake/nuttx/px4_impl_nuttx.cmake
+++ cmake/nuttx/px4_impl_nuttx.cmake
@@ -267,9 +267,9 @@
 	set(nuttx_export_dir ${nuttx_build_src}/nuttx/nuttx-export)

 	# nuttx cmake dependency files
-	set(nuttx_copy_stamp ${PX4_BINARY_DIR}/${CONFIG}_nuttx_copy.stamp)
-	set(nuttx_configure_stamp ${PX4_BINARY_DIR}/${CONFIG}_nuttx_configure.stamp)
-	set(nuttx_export_stamp ${PX4_BINARY_DIR}/${CONFIG}_nuttx_export.stamp)
+	set(nuttx_copy_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_copy.stamp)
+	set(nuttx_configure_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_configure.stamp)
+	set(nuttx_export_stamp ${PX4_BINARY_DIR}/${CONFIG}/nuttx_export.stamp)

 	# copy
 	file(GLOB_RECURSE nuttx_all_files ${PX4_SOURCE_DIR}/NuttX/*)
@@ -283,23 +283,23 @@
 		WORKING_DIRECTORY ${PX4_BINARY_DIR})
 	add_custom_target(nuttx_copy_${CONFIG} DEPENDS ${DEPENDS} ${nuttx_copy_stamp})

-	unset(last_patch_stamp)
+	unset(last_patch)
 	add_custom_target(nuttx_patch_${CONFIG})
 	foreach(patch ${px4_nuttx_patches})
 		get_filename_component(patch_file_name ${patch} NAME)
 		string(REPLACE "/" "_" patch_name "${CONFIG}-nuttx_patch_${patch_file_name}")
-		set(patch_stamp ${PX4_BINARY_DIR}/${patch_name}.stamp)
+		set(patch_stamp ${nuttx_build_src}/${patch_name}.stamp)

 		add_custom_command(OUTPUT ${patch_stamp}
 			COMMAND ${PATCH} --verbose -d ${nuttx_build_src} -s -p1 -N < ${patch}
 			COMMAND cmake -E touch ${patch_stamp}
-			DEPENDS ${nuttx_copy_stamp} ${patch} ${last_patch_stamp}
+			DEPENDS nuttx_copy_${CONFIG} ${patch} ${last_patch}
 			COMMENT "${CONFIG}: nuttx-patches/${patch_file_name} applied"
 			${nuttx_patches_uses_terminal})

 		add_custom_target(${patch_name} DEPENDS ${patch_stamp})
-		add_dependencies(nuttx_patch_${CONFIG} ${patch_name})
-		set(last_patch_stamp ${patch_stamp})
+		add_dependencies(nuttx_patch_${CONFIG} ${patch_name} nuttx_copy_${CONFIG})
+		set(last_patch ${patch_name})
 	endforeach()

 	# Read defconfig to see if CONFIG_ARMV7M_STACKCHECK is yes
@@ -319,7 +319,7 @@
 		COMMAND ${CP} -rp ${PX4_SOURCE_DIR}/nuttx-configs/${CONFIG} ${nuttx_build_src}/nuttx/configs
 		COMMAND cd ${nuttx_build_src}/nuttx/tools && sh configure.sh ${CONFIG}/${config_nuttx_config}
 		COMMAND cmake -E touch ${nuttx_configure_stamp}
-		DEPENDS nuttx_patch_${CONFIG} ${nuttx-configs} ${nuttx_copy_stamp}
+		DEPENDS nuttx_patch_${CONFIG} ${nuttx-configs}
 		WORKING_DIRECTORY ${PX4_BINARY_DIR}
 		COMMENT "Configuring NuttX for ${CONFIG} with ${config_nuttx_config}")
 	add_custom_target(nuttx_configure_${CONFIG} DEPENDS ${nuttx_configure_stamp} nuttx_patch_${CONFIG})
@@ -351,8 +351,8 @@
 		COMMAND ${RM} -rf ${nuttx_export_dir}
 		COMMAND ${MAKE} ${nuttx_build_options} --no-print-directory -C ${nuttx_build_src}/nuttx -r CONFIG_ARCH_BOARD=${CONFIG} export ${nuttx_build_output}
 		COMMAND cmake -E touch ${nuttx_export_stamp}
-		DEPENDS ${nuttx_copy_stamp} ${nuttx_configure_stamp} nuttx_patch_${CONFIG}
-		WORKING_DIRECTORY ${PX4_BINARY_DIR}
+		DEPENDS nuttx_configure_${CONFIG}
+		WORKING_DIRECTORY ${PX4_BINARY_DIR}/${CONFIG}
 		COMMENT "Building NuttX for ${CONFIG} with ${config_nuttx_config}"
 		${nuttx_build_uses_terminal})


added license to EasyFind.cmake

added license to EasyFind.cmake

--- cmake_modules/FindEasyFind.cmake
+++ cmake_modules/FindEasyFind.cmake
@@ -1,4 +1,21 @@
 # easyFind version 1.1 - 17.10.2014 - # 010
+
+# clockUtils
+# Copyright (2015) Michael Baer, Daniel Bonrath, All rights reserved.
+#
+# This file is part of clockUtils; clockUtils is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

 # Find $LIBNAME includes and library
 #


Revert "generic is not a valid arch for GCC. tried to fix this"

This reverts commit be1c3195843dc956e80651830eb6686c0d618231.

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

 macro(AutodetectHostArchitecture)
-	set(TARGET_ARCHITECTURE "native")
+	set(TARGET_ARCHITECTURE "generic")
 	set(ARCH_FLAGS)
 	set(_vendor_id)
 	set(_cpu_family)
@@ -104,8 +104,8 @@
 elseif(_cpu_model EQUAL 14)
 	set(TARGET_ARCHITECTURE "core")
 elseif(_cpu_model LESS 14)
-	message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the native CPU settings with SSE2.")
-	set(TARGET_ARCHITECTURE "native")
+	message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the generic CPU settings with SSE2.")
+	set(TARGET_ARCHITECTURE "generic")
 else()
 	message(WARNING "Your CPU (family ${_cpu_family}, model ${_cpu_model}) is not known. Auto-detection of optimization flags failed and will use the 65nm Core 2 CPU settings.")
 	set(TARGET_ARCHITECTURE "merom")
@@ -139,7 +139,7 @@
 endmacro()

 macro(OptimizeForArchitecture)
-	set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"native\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\".")
+	set(TARGET_ARCHITECTURE "auto" CACHE STRING "CPU architecture to optimize for. Using an incorrect setting here can result in crashes of the resulting binary because of invalid instructions used.\nSetting the value to \"auto\" will try to optimize for the architecture where cmake is called.\nOther supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\".")
 set(_force)
 	if(NOT _last_target_arch STREQUAL "${TARGET_ARCHITECTURE}")
 	message(STATUS "target changed from \"${_last_target_arch}\" to \"${TARGET_ARCHITECTURE}\"")
@@ -237,8 +237,8 @@
 	list(APPEND _march_flag_list "barcelona")
 	list(APPEND _march_flag_list "core2")
 	list(APPEND _available_vector_units_list "sse" "sse2" "sse3" "sse4a")
-	elseif(TARGET_ARCHITECTURE STREQUAL "native")
-	list(APPEND _march_flag_list "native")
+	elseif(TARGET_ARCHITECTURE STREQUAL "generic")
+	list(APPEND _march_flag_list "generic")
 	elseif(TARGET_ARCHITECTURE STREQUAL "none")
 # add this clause to remove it from the else clause
 	else(TARGET_ARCHITECTURE STREQUAL "core")


more tweaks to the toolchain file

more tweaks to the toolchain file

--- cmake/Toolchains/cygwin-mingw.cmake
+++ cmake/Toolchains/cygwin-mingw.cmake
@@ -1,4 +1,8 @@
-set(CMAKE_SYSTEM_NAME CygwinMingw)
-set(CMAKE_C_COMPILER /usr/bin/i686-pc-mingw32-gcc.exe)
-set(CMAKE_CXX_COMPILER /usr/bin/i686-pc-mingw32-g++.exe)
+set(CMAKE_SYSTEM_NAME Windows)

+set(CMAKE_C_COMPILER i686-pc-mingw32-gcc)
+set(CMAKE_CXX_COMPILER i686-pc-mingw32-g++)
+set(CMAKE_RC_COMPILER i686-pc-mingw32-windres)
+
+set(CMAKE_FIND_ROOT_PATH /usr/i686-pc-mingw32)
+


Fix mistake in cmake variable check.

Fix mistake in cmake variable check.

This was discovered because this code path is used in the compilation tests.

--- cmake/modules/FindQtGstreamer.cmake
+++ cmake/modules/FindQtGstreamer.cmake
@@ -33,7 +33,7 @@
     get_filename_component(_QTGSTREAMER_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
     find_file(_QTGSTREAMER_TARGETS_FILE QtGstreamerTargets.cmake PATHS ${_QTGSTREAMER_CONFIG_DIR} NO_DEFAULT_PATH)

-    if(_QTGSTREAMER_TARGETS_FILE-NOTFOUND)
+    if(NOT _QTGSTREAMER_TARGETS_FILE)
         # Targets file not found. Do a typical search for QtGstreamer.
         # Normally, this path is never executed. It is just provided as a fallback in case something goes wrong.
         find_library(QTGSTREAMER_LIBRARY QtGstreamer


Workaround for Visual Studio glitches

Workaround for Visual Studio glitches

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -327,20 +327,13 @@
         h_build_result
     )

-    if(${h_build_result} EQUAL 0)
-      # Sanity check. Sometimes MSVC just skip build without any reason...
-      hunter_check_already_installed(
-          VARIANTS ${HUNTER_DOWNLOAD_SCHEME_VARIANTS}
-          RESULT already_installed
-      )
-      if(NOT already_installed)
-         hunter_unlock()
-         hunter_fatal_error(
-             "External project reported that build successfull"
-             "but there are no stamps."
-             WIKI "https://github.com/ruslo/hunter/wiki/Error-%28External-project-reported-that-build-successfull%29"
-         )
-      endif()
+    # Sanity check. Sometimes MSVC just skip build without any reason...
+    hunter_check_already_installed(
+        VARIANTS ${HUNTER_DOWNLOAD_SCHEME_VARIANTS}
+        RESULT already_installed
+    )
+
+    if(${h_build_result} EQUAL 0 AND already_installed)
       hunter_status_print("Build step successful (dir: ${h_work_dir})")
       if(NOT HUNTER_STATUS_DEBUG)
         # clean-up
@@ -354,13 +347,26 @@
       string(COMPARE EQUAL "${counter}" "xxxx" stop_condition)
       if(stop_condition)
         hunter_unlock()
-        hunter_internal_error("build step failed (dir: ${h_work_dir}")
+        if(NOT already_installed)
+           hunter_fatal_error(
+               "External project reported that build successfull"
+               "but there are no stamps."
+               WIKI "https://github.com/ruslo/hunter/wiki/Error-%28External-project-reported-that-build-successfull%29"
+           )
+        else()
+          hunter_internal_error("build step failed (dir: ${h_work_dir}")
+        endif()
       else()
-        string(TIMESTAMP time_now)
-        hunter_status_print(
-            "[${time_now}] Build failed, retry after 10 sec ..."
-        )
-        execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 10)
+        if(NOT ${h_build_result} EQUAL 0)
+          string(TIMESTAMP time_now)
+          hunter_status_print(
+              "[${time_now}] Build failed, retry after 10 sec ..."
+          )
+          execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 10)
+        else()
+          # Update project file to trigger regenerate (timestamps?)
+          file(APPEND "${h_work_dir}/CMakeLists.txt" " ")
+        endif()
       endif()
     endif()
   endwhile()


Delete print_target_properties.cmake

Delete print_target_properties.cmake

--- cmake/print_target_properties.cmake
+++ cmake/print_target_properties.cmake
@@ -1,27 +0,0 @@
-# Get all propreties that cmake supports
-execute_process(COMMAND cmake --help-property-list OUTPUT_VARIABLE CMAKE_PROPERTY_LIST)
-
-# Convert command output into a CMake list
-STRING(REGEX REPLACE ";" "\\\\;" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
-STRING(REGEX REPLACE "\n" ";" CMAKE_PROPERTY_LIST "${CMAKE_PROPERTY_LIST}")
-
-function(print_properties)
-    message ("CMAKE_PROPERTY_LIST = ${CMAKE_PROPERTY_LIST}")
-endfunction(print_properties)
-
-function(print_target_properties tgt)
-    if(NOT TARGET ${tgt})
-      message("There is no target named '${tgt}'")
-      return()
-    endif()
-
-    foreach (prop ${CMAKE_PROPERTY_LIST})
-        string(REPLACE "<CONFIG>" "${CMAKE_BUILD_TYPE}" prop ${prop})
-        # message ("Checking ${prop}")
-        get_property(propval TARGET ${tgt} PROPERTY ${prop} SET)
-        if (propval)
-            get_target_property(propval ${tgt} ${prop})
-            message ("${tgt} ${prop} = ${propval}")
-        endif()
-    endforeach(prop)
-endfunction(print_target_properties)


ffmpeg: update Windows binaries

ffmpeg: update Windows binaries

Versions:
- ffmpeg 3.2.1 (was 3.1.3)
- openh264 1.6.0 (was 1.5.0)
- libvpx 1.6.0 (was 1.5.0)

--- 3rdparty/ffmpeg/ffmpeg.cmake
+++ 3rdparty/ffmpeg/ffmpeg.cmake
@@ -1,9 +1,9 @@
-# Binary branch name: ffmpeg/master_20160908
-# Binaries were created for OpenCV: 11a65475d8d460a01c8818c5a2d0544ec49d7d68
-set(FFMPEG_BINARIES_COMMIT "03835134465888981e066434dc95009e8328d4ea")
-set(FFMPEG_FILE_HASH_BIN32 "32ba7790b0ac7a6dc66be91603637a7d")
-set(FFMPEG_FILE_HASH_BIN64 "068ecaa459a5571e7909cff90999a420")
-set(FFMPEG_FILE_HASH_CMAKE "f99941d10c1e87bf16b9055e8fc91ab2")
+# Binary branch name: ffmpeg/master_20161202
+# Binaries were created for OpenCV: 594c136d1fcbb5816c57516e50f9cbeffbd90835
+set(FFMPEG_BINARIES_COMMIT "2a19d0006415955c79431116e4634f04d5eb5a74")
+set(FFMPEG_FILE_HASH_BIN32 "f081abd9d6ca7e425d340ce586f9c090")
+set(FFMPEG_FILE_HASH_BIN64 "a423363a6eb76d362ca6c406c96c8db6")
+set(FFMPEG_FILE_HASH_CMAKE "5346ae1854fc7aa569a722e85af480ec")

 set(FFMPEG_DOWNLOAD_URL ${OPENCV_FFMPEG_URL};$ENV{OPENCV_FFMPEG_URL};https://raw.githubusercontent.com/opencv/opencv_3rdparty/${FFMPEG_BINARIES_COMMIT}/ffmpeg/)


fptu-cmake: add '-flto-thin' for CLANG >= 3.9

--- cmake.fptu/compiler.cmake
+++ cmake.fptu/compiler.cmake
@@ -527,10 +527,15 @@
   endif()

   if(CMAKE_COMPILER_IS_CLANG AND LTO_ENABLED)
-    add_compile_flags("C;CXX" "-flto")
-    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} -flto -fverbose-asm -fwhole-program")
-    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} -flto -fverbose-asm")
-    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} -flto -fverbose-asm")
+    if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.9)
+      set(CLANG_LTO_FLAG "-flto")
+    else()
+      set(CLANG_LTO_FLAG "-flto=thin")
+    endif()
+    add_compile_flags("C;CXX" ${CLANG_LTO_FLAG})
+    set(EXE_LINKER_FLAGS "${EXE_LINKER_FLAGS} ${CLANG_LTO_FLAG} -fverbose-asm -fwhole-program")
+    set(SHARED_LINKER_FLAGS "${SHARED_LINKER_FLAGS} ${CLANG_LTO_FLAG} -fverbose-asm")
+    set(MODULE_LINKER_FLAGS "${MODULE_LINKER_FLAGS} ${CLANG_LTO_FLAG} -fverbose-asm")
   endif()

   # LY: push C/CXX flags into the cache


Honor existing flags

Honor existing flags

Former-commit-id: f4271bbbaae5dd649331fd33a18375a2d14da38b

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -70,10 +70,10 @@

 message(STATUS "Using ${MARCH} ${MTUNE}")
-set(CMAKE_CXX_FLAGS  "${MARCH} ${MTUNE}")
-set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -fno-strict-aliasing -Wall -Wextra -Wpedantic")
-set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fno-strict-aliasing -Wall -Wextra -Wpedantic -fstack-protector -D_FORTIFY_SOURCE=2 -fno-omit-frame-pointer") #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -O2")
+set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} ${MARCH} ${MTUNE}")
+set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -g -fno-strict-aliasing -Wall -Wextra -Wpedantic")
+set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-strict-aliasing -Wall -Wextra -Wpedantic -fstack-protector -D_FORTIFY_SOURCE=2 -fno-omit-frame-pointer") #-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC
+#set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "")

 set(CMAKE_CXX_STANDARD 17)
 set(CMAKE_CXX_STANDARD_REQUIRED ON)


Save compiler commands

Save compiler commands

Former-commit-id: f37b59cd270121b315046f018d608f33a37fe0bf

--- cmake/CompilerFlags.cmake
+++ cmake/CompilerFlags.cmake
@@ -63,6 +63,12 @@
 # hurt performance more, like -mno-avx, removing -DNDEBUG, or lowering -O3 to -O2.
 ######################################################################################

+#######################################
+### Write compile commands to file  ###
+#######################################
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+
 message(STATUS "Using ${MARCH} ${MTUNE}")
 set(CMAKE_CXX_FLAGS  "${MARCH} ${MTUNE}")
 set(CMAKE_CXX_FLAGS_RELEASE "-g -O3 -fno-strict-aliasing -Wall -Wextra -Wpedantic")


move configuring of cmake back into install process - it will conflict with the release process otherwise

--- cmake/InstallMacros.cmake
+++ cmake/InstallMacros.cmake
@@ -74,8 +74,9 @@
   if (MSVC)
     set(CRLFSTYLE "CRLF")
   endif ()
-  configure_file(${PROJECT_SOURCE_DIR}/${input} "${PROJECT_BINARY_DIR}/${output}" NEWLINE_STYLE ${CRLFSTYLE})
+
   install(
+    CODE "configure_file(${PROJECT_SOURCE_DIR}/${input} \"${PROJECT_BINARY_DIR}/${output}\" NEWLINE_STYLE ${CRLFSTYLE})"
     FILES "${PROJECT_BINARY_DIR}/${output}"
     DESTINATION "${where}"
     )


FIX: explicitly specify glog install path

--- cmake/external/glog.cmake
+++ cmake/external/glog.cmake
@@ -38,12 +38,14 @@
     CMAKE_ARGS      -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
     CMAKE_ARGS      -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
     CMAKE_ARGS      -DCMAKE_INSTALL_PREFIX=${GLOG_INSTALL_DIR}
+    CMAKE_ARGS      -DCMAKE_INSTALL_LIBDIR=${GLOG_INSTALL_DIR}/lib
     CMAKE_ARGS      -DCMAKE_POSITION_INDEPENDENT_CODE=ON
     CMAKE_ARGS      -DWITH_GFLAGS=ON
     CMAKE_ARGS      -Dgflags_DIR=${GFLAGS_INSTALL_DIR}/lib/cmake/gflags
     CMAKE_ARGS      -DBUILD_TESTING=OFF
     CMAKE_ARGS      -DCMAKE_BUILD_TYPE=Release
     CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${GLOG_INSTALL_DIR}
+                     -DCMAKE_INSTALL_LIBDIR:PATH=${GLOG_INSTALL_DIR}/lib
                      -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
                      -DCMAKE_BUILD_TYPE:STRING=Release
 )


update grpc version

update grpc version

--- cmake/external/grpc.cmake
+++ cmake/external/grpc.cmake
@@ -24,16 +24,16 @@
 SET(GRPC_INCLUDE_DIR "${GRPC_INSTALL_DIR}/include/" CACHE PATH "grpc include directory." FORCE)
 SET(GRPC_CPP_PLUGIN "${GRPC_INSTALL_DIR}/bin/grpc_cpp_plugin" CACHE FILEPATH "GRPC_CPP_PLUGIN" FORCE)
 IF(APPLE)
-  SET(BUILD_CMD make -n HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin | sed "s/-Werror//g" | sh)
+  SET(BUILD_CMD make -n HAS_SYSTEM_PROTOBUF=false -s -j static grpc_cpp_plugin | sed "s/-Werror//g" | sh)
 ELSE()
-  SET(BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j8 static grpc_cpp_plugin)
+  SET(BUILD_CMD make HAS_SYSTEM_PROTOBUF=false -s -j static grpc_cpp_plugin)
 ENDIF()

 ExternalProject_Add(
     extern_grpc
     DEPENDS protobuf zlib
     GIT_REPOSITORY "https://github.com/grpc/grpc.git"
-    GIT_TAG "v1.8.x"
+    GIT_TAG "v1.11.x"
     PREFIX          ${GRPC_SOURCES_DIR}
     UPDATE_COMMAND  ""
     CONFIGURE_COMMAND ""


update lite compile cmake (#41512)

update lite compile cmake (#41512)

--- cmake/external/lite.cmake
+++ cmake/external/lite.cmake
@@ -86,7 +86,7 @@
       GIT_REPOSITORY      "${GIT_URL}/PaddlePaddle/Paddle-Lite.git"
       GIT_TAG             ${LITE_GIT_TAG}
       PREFIX              ${LITE_PREFIX_DIR}
-      PATCH_COMMAND       mkdir -p ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code && touch ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code/__generated_code__.cc && sed -i "/aarch64-linux-gnu-gcc/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake && sed -i "/aarch64-linux-gnu-g++/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/cross_compiling/armlinux.cmake
+      PATCH_COMMAND       mkdir -p ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code && touch ${LITE_PREFIX_DIR}/src/extern_lite-build/lite/gen_code/__generated_code__.cc && sed -i "/aarch64-linux-gnu-gcc/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/os/armlinux.cmake && sed -i "/aarch64-linux-gnu-g++/d" ${LITE_PREFIX_DIR}/src/extern_lite/cmake/os/armlinux.cmake
       UPDATE_COMMAND      ""
       BUILD_COMMAND       ${LITE_BUILD_COMMAND}
       INSTALL_COMMAND     ""


cmake : fix comment

cmake : fix comment

--- cmake/qibuild/tests.cmake
+++ cmake/qibuild/tests.cmake
@@ -48,7 +48,6 @@
 # \group:DEPENDS Dependencies to pass to use_lib
 # \group:ARGUMENTS Arguments to pass to add_test (to your test program)
 function(qi_create_gtest name)
-  # Using upstream GtestConfig.cmake is a good idea here:
   # create tests_results folder if it does not exist
   file(MAKE_DIRECTORY "${_TESTS_RESULTS_FOLDER}")
   cmake_parse_arguments(ARG "NO_ADD_TEST" "TIMEOUT" "SRC;DEPENDS;ARGUMENTS" ${ARGN})


[Bugfix][Build] Fix building with LLVM-10 on macOS (#5859)

--- cmake/util/FindLLVM.cmake
+++ cmake/util/FindLLVM.cmake
@@ -34,7 +34,16 @@
   set(LLVM_CONFIG ${use_llvm})
   if(LLVM_CONFIG STREQUAL "ON")
     find_package(LLVM REQUIRED CONFIG)
-    llvm_map_components_to_libnames(LLVM_LIBS all)
+    llvm_map_components_to_libnames(LLVM_LIBS "all")
+    if (NOT LLVM_LIBS)
+      message(STATUS "Not found - LLVM_LIBS")
+      message(STATUS "Fall back to using llvm-config")
+      set(LLVM_CONFIG "llvm-config")
+    else()
+      set(LLVM_CONFIG "ON")
+    endif()
+  endif()
+  if(LLVM_CONFIG STREQUAL "ON")
     list (FIND LLVM_LIBS "LLVM" _llvm_dynlib_index)
     if (${_llvm_dynlib_index} GREATER -1)
       set(LLVM_LIBS LLVM)


ENH: Update BridgeNumPy to most recent version (2017.02.24)

Matt McCormick (7):
      BUG: Skip NumPy tests when numpy package is not available
      Merge pull request #13 from thewtex/TestsWithoutNumPy
      ENH: Add support for Fortran contiguous in GetImageFromArray
      STYLE: Remove unnecessary obj variable
      BUG: Avoid shapeseq memory leak
      DOC: Improve axes descriptions
      Merge pull request #14 from thewtex/FortranOrder

Change-Id: I5bf4ce66dad0fd4a4c373e0a2e7980b655775a54

--- Modules/Remote/BridgeNumPy.remote.cmake
+++ Modules/Remote/BridgeNumPy.remote.cmake
@@ -21,5 +21,5 @@
   See http://insight-journal.org/browse/publication/85
       https://hdl.handle.net/1926/188"
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKBridgeNumPy.git
-  GIT_TAG 249e7be2d012c66b605498b1ce2b4b46498e0680
+  GIT_TAG 4ad1dd6b4388071f1437dd9b652421c91f8302b8
   )


BUG: Use consistent ITK_USE_CLANG_FORMAT variable name

Across ITKClangFormatSetup.cmake and ITKModuleClangFormat.cmake.

--- CMake/ITKClangFormatSetup.cmake
+++ CMake/ITKClangFormatSetup.cmake
@@ -8,10 +8,10 @@
 # The ITK style guidelines are represented by clang-format version 8.0.0
 # rules defined in ${ITK_SOURCE_DIR}/.clang-format
 #
-option(ITK_USE_CLANGFORMAT "Enable the use of clang-format enforce ITK coding style." ${BUILD_TESTING})
-mark_as_advanced(ITK_USE_CLANGFORMAT)
+option(ITK_USE_CLANG_FORMAT "Enable the use of clang-format enforce ITK coding style." ${BUILD_TESTING})
+mark_as_advanced(ITK_USE_CLANG_FORMAT)

-if ( ITK_USE_CLANGFORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}" )
+if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}" )
   # Download pre-built binaries (about 2M ) of clang-format extracted from
   # http://releases.llvm.org/download.html and cached on data.kitware.com
   #
@@ -55,7 +55,7 @@
 if(CLANGFORMAT_EXECUTABLE)
   mark_as_advanced(CLANGFORMAT_EXECUTABLE)
 endif()
-if ( ITK_USE_CLANGFORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}")
+if ( ITK_USE_CLANG_FORMAT AND NOT EXISTS "${CLANGFORMAT_EXECUTABLE}")
   message(FATAL_ERROR "Missing suitable clang-format executable, set CLANGFORMAT_EXECUTABLE variable to version 8.0")
   unset(CLANGFORMAT_EXECUTABLE)
 endif()


Determine OGRE_DEP_DIR relative to OIS in case someone uses one of the alternate auto locations

--- CMake/InstallDependencies.cmake
+++ CMake/InstallDependencies.cmake
@@ -14,11 +14,9 @@
   return()
 endif()

-if (OGRE_DEPENDENCIES_DIR)
-	set(OGRE_DEP_DIR ${OGRE_DEPENDENCIES_DIR})
-else()
-	set(OGRE_DEP_DIR "${OGRE_SOURCE_DIR}/Dependencies")
-endif()
+# TODO - most of this file assumes a common dependencies root folder
+# This is not robust, we should instead source dependencies from their individual locations
+get_filename_component(OGRE_DEP_DIR ${OIS_INCLUDE_DIR}/../../ ABSOLUTE)

 option(OGRE_INSTALL_DEPENDENCIES "Install dependency libs needed for samples" TRUE)
 option(OGRE_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)


Update clBLAS build tag

Update clBLAS build tag

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


print stackrace when using UBSAN

print stackrace when using UBSAN

--- build_settings.cmake
+++ build_settings.cmake
@@ -146,6 +146,12 @@
         set(VESPA_SANITIZER_ENV "TSAN_OPTIONS=suppressions=${VESPA_SANITIZER_SUPPRESSIONS_FILE} history_size=7 detect_deadlocks=1 second_deadlock_stack=1")
     endif()
 endif()
+# Dump stack when finding issues in unit tests using undefined sanitizer
+if(VESPA_USE_SANITIZER)
+    if(VESPA_USE_SANITIZER STREQUAL "undefined")
+        set(VESPA_SANITIZER_ENV "UBSAN_OPTIONS=print_stacktrace=1")
+    endif()
+endif()

 if(VESPA_LLVM_VERSION)
 else()


Fixed typo in message string.

Fixed typo in message string.

--- CMake/ctkMacroBuildApp.cmake
+++ CMake/ctkMacroBuildApp.cmake
@@ -47,7 +47,7 @@
   if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${expected_mainfile} AND
       NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${expected_mainfile}.in AND
       NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/${expected_mainfile})
-    MESSAGE(FATAL_ERROR "Application directory: ${MY_NAME} should contains"
+    MESSAGE(FATAL_ERROR "Application directory: ${MY_NAME} should contain"
                         " a file named ${expected_mainfile} or ${expected_mainfile}.in")
   endif()


build BUGFIX vasprintf detection on BSD

build BUGFIX vasprintf detection on BSD

--- CMakeModules/UseCompat.cmake
+++ CMakeModules/UseCompat.cmake
@@ -7,6 +7,7 @@
     # compatibility checks
     set(CMAKE_REQUIRED_DEFINITIONS -D_POSIX_C_SOURCE=200809L)
     list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
+    list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__BSD_VISIBLE=1)
     check_symbol_exists(vdprintf "stdio.h;stdarg.h" HAVE_VDPRINTF)
     check_symbol_exists(asprintf "stdio.h" HAVE_ASPRINTF)
     check_symbol_exists(vasprintf "stdio.h" HAVE_VASPRINTF)


[cpack] added mantainer of the packages

[cpack] added mantainer of the packages

--- CMakeModules/installer.cmake
+++ CMakeModules/installer.cmake
@@ -1,5 +1,6 @@
 include(InstallRequiredSystemLibraries)

+set(CPACK_PACKAGE_CONTACT "someone@eos.org"
 set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_BINARY_DIR}/packages)
 set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   24)
+SET(KWSYS_DATE_STAMP_DAY   25)


mark master branch with anticipated next release number 7.1.0

--- CMake/vtkVersion.cmake
+++ CMake/vtkVersion.cmake
@@ -1,4 +1,4 @@
 # VTK version number components.
 set(VTK_MAJOR_VERSION 7)
-set(VTK_MINOR_VERSION 0)
+set(VTK_MINOR_VERSION 1)
 set(VTK_BUILD_VERSION 0)


Disable kits for now due to CMake requirement

Not all of our builds have CMake 3.12, disable kits until we have it
upgraded on all build hosts.

Signed-off-by: Marcus D. Hanwell <cf7042e2e8eee958b5bcde1ae2cbefef82efc184@kitware.com>

--- projects/paraview.cmake
+++ projects/paraview.cmake
@@ -34,7 +34,8 @@
     -DPARAVIEW_ENABLE_COMMANDLINE_TOOLS:BOOL=OFF
     -DPARAVIEW_ENABLE_WEB:BOOL=ON
     -DPARAVIEW_USE_QTHELP:BOOL=OFF
-    -DPARAVIEW_ENABLE_KITS:BOOL=ON
+    # Disable for now as kits requires CMake 3.12
+    #    -DPARAVIEW_ENABLE_KITS:BOOL=ON
     -DPARAVIEW_PLUGIN_ENABLE_AcceleratedAlgorithms:BOOL=FALSE
     -DPARAVIEW_PLUGIN_ENABLE_AnalyzeNIfTIReaderWriter:BOOL=FALSE
     -DPARAVIEW_PLUGIN_ENABLE_ArrowGlyph:BOOL=FALSE


COMP (#2816): disable QmitkVtkHistogram widget until VTK installer problem is solved

--- Modules/QmitkExt/files.cmake
+++ Modules/QmitkExt/files.cmake
@@ -86,7 +86,7 @@

  QmitkHistogram.cpp
  QmitkHistogramWidget.cpp
- QmitkVtkHistogramWidget.cpp
+ #QmitkVtkHistogramWidget.cpp

  QmitkPlotWidget.cpp
  QmitkPlotDialog.cpp
@@ -156,7 +156,7 @@
  QmitkPointListView.h
  QmitkPointListWidget.h
  QmitkHistogramWidget.h
- QmitkVtkHistogramWidget.h
+ #QmitkVtkHistogramWidget.h
  QmitkVideoBackground.h
 )


test /Zc:__cplusplus

test /Zc:__cplusplus

--- project/cmake/CompilerOption.cmake
+++ project/cmake/CompilerOption.cmake
@@ -155,6 +155,10 @@
     endif()
 elseif(MSVC)
     add_definitions(/MP /W4 /wd"4100" /wd"4125" /EHsc)
+    # 设置 __cplusplus 宏为标准值, @see https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/
+    if (MSVC_VERSION GREATER_EQUAL 1910)
+        add_definitions(/Zc:__cplusplus)
+    endif()
     if (MSVC_VERSION GREATER_EQUAL 1910)
         add_definitions(/std:c++17)
         message(STATUS "MSVC ${MSVC_VERSION} found. using /std:c++17")


Detect system arquitecture for find_library()

--- cmake/FindSDL2.cmake
+++ cmake/FindSDL2.cmake
@@ -78,17 +78,21 @@
 )

 FIND_PATH(SDL2_INCLUDE_DIR SDL.h
-	HINTS
-	$ENV{SDL2DIR}
+	HINTS $ENV{SDL2DIR}
 	PATH_SUFFIXES include/SDL2 include
 	PATHS ${SDL2_SEARCH_PATHS}
 )

+IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+	SET(VC_LIB_PATH_SUFFIX lib/x64)
+ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
+	SET(VC_LIB_PATH_SUFFIX lib/x86)
+ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
+
 FIND_LIBRARY(SDL2_LIBRARY_TEMP
 	NAMES SDL2
-	HINTS
-	$ENV{SDL2DIR}
-	PATH_SUFFIXES lib64 lib lib/x64 lib/x86
+	HINTS $ENV{SDL2DIR}
+	PATH_SUFFIXES lib64 lib ${VC_LIB_PATH_SUFFIX}
 	PATHS ${SDL2_SEARCH_PATHS}
 )

@@ -100,9 +104,8 @@
 		# necessarily need it.
 		FIND_LIBRARY(SDL2MAIN_LIBRARY
 			NAMES SDL2main
-			HINTS
-			$ENV{SDL2DIR}
-			PATH_SUFFIXES lib64 lib lib/x64 lib/x86
+			HINTS $ENV{SDL2DIR}
+			PATH_SUFFIXES lib64 lib ${VC_LIB_PATH_SUFFIX}
 			PATHS ${SDL2_SEARCH_PATHS}
 		)
 	ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")


add version again to FindWebP

add version again to FindWebP

--- cmake/FindWebP.cmake
+++ cmake/FindWebP.cmake
@@ -44,6 +44,7 @@
 if(NOT WebP_LIBRARY)
     find_package(PkgConfig QUIET)
     pkg_check_modules(PC_WebP QUIET libwebp)
+    set(WebP_VERSION ${PC_WebP_VERSION})
     find_path(WebP_INCLUDE_DIR NAMES decode.h HINTS ${PC_WebP_INCLUDEDIR} ${PC_WebP_INCLUDE_DIR} PATH_SUFFIXES webp)
     find_library(WebP_LIBRARY_RELEASE NAMES ${WebP_NAMES} webp HINTS ${PC_WebP_LIBDIR} ${PC_WebP_LIBRARY_DIRS})
     find_library(WebP_LIBRARY_DEBUG NAMES ${WebP_NAMES} webpd HINTS ${PC_WebP_LIBDIR} ${PC_WebP_LIBRARY_DIRS})
@@ -53,11 +54,20 @@
   file(TO_CMAKE_PATH "${WebP_LIBRARY}" WebP_LIBRARY)
 endif()

+if ("${WebP_FIND_VERSION}" VERSION_GREATER "${WebP_VERSION}")
+    if (WebP_VERSION)
+        message(FATAL_ERROR "Required version (" ${WebP_FIND_VERSION} ") is higher than found version (" ${PC_WebP_VERSION} ")")
+    else ()
+        message(WARNING "Cannot determine WebP version without pkg-config")
+    endif ()
+endif ()
+
 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(WebP
   REQUIRED_VARS
     WebP_LIBRARY
     WebP_INCLUDE_DIR
+    WebP_VERSION
 )
 mark_as_advanced(WebP_INCLUDE_DIR WebP_LIBRARY)


some fixes for FindWebP

some fixes for FindWebP

--- cmake/FindWebP.cmake
+++ cmake/FindWebP.cmake
@@ -64,10 +64,11 @@

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(WebP
+  FOUND_VAR WebP_FOUND
   REQUIRED_VARS
     WebP_LIBRARY
     WebP_INCLUDE_DIR
-    WebP_VERSION
+  VERSION_VAR WebP_VERSION
 )
 mark_as_advanced(WebP_INCLUDE_DIR WebP_LIBRARY)


Remove debugging messages

Remove debugging messages

--- cmake/AddModule.cmake
+++ cmake/AddModule.cmake
@@ -29,9 +29,6 @@
       message(STATUS "${MODULE_NAME} cxx includes: ${${MODULE_NAME}_CXX_INCLUDES}")

       # Linker flags
-      message(STATUS "HERE: ${OpenMP_CXX_FLAGS}")
-      message(STATUS "HERE: ${MPI_CXX_LINK_FLAGS}")
-      message(STATUS "HERE: ${MPI_CXX_LIBRARIES}")
       list(APPEND ${MODULE_NAME}_CXX_LINK_FLAGS "${MODULE_CXX_LINK_FLAGS}")
       list(APPEND ${MODULE_NAME}_CXX_LINK_FLAGS "${OpenMP_CXX_FLAGS}")
       list(APPEND ${MODULE_NAME}_CXX_LINK_FLAGS "${MPI_CXX_LINK_FLAGS}")


[cmake.duneutils] merged CUSTOM_FLAGS into CMAKE_CXX_FLAGS_DEBUG

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -200,15 +200,11 @@
 )

-SET( CUSTOM_FLAGS
-	"-Wall -Wextra -Wlogical-op -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Winline -fno-strict-aliasing" CACHE STRING
-	"CUSTOM FLAGS")
-
 SET( CMAKE_CXX_FLAGS_RELEASE
 	"-DDNDEBUG -funroll-loops -m64 -mfpmath=sse -falign-loops -mtune=native -march=native -O3 -pipe -fomit-frame-pointer " )

 SET( CMAKE_CXX_FLAGS_DEBUG
-	"-O0 -DDNDEBUG -g3 -ggdb" )
+	"-O0 -DDNDEBUG -g3 -ggdb -Wall -Wextra -Wlogical-op -Wc++0x-compat -Wparentheses -pedantic -Wredundant-decls -Wshadow -Winline -fno-strict-aliasing" )

 FIND_PACKAGE( PkgConfig )
 FIND_PACKAGE(Boost 1.48.0 REQUIRED)


Update FindCEGUI

Update FindCEGUI


Sync FindIPOPT.cmake with YCM

Sync FindIPOPT.cmake with YCM

Sync with https://github.com/robotology/ycm/pull/325

--- cmake/FindIPOPT.cmake
+++ cmake/FindIPOPT.cmake
@@ -82,16 +82,14 @@
       set(IPOPT_DIR /usr            CACHE PATH "Path to IPOPT build directory")
     endif()

-    find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
+    find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp PATH_SUFFIXES coin PATHS ${IPOPT_DIR}/include/coin)

     find_library(IPOPT_LIBRARIES ipopt ${IPOPT_DIR}/lib
-                                     ${IPOPT_DIR}/lib/coin
-                                     NO_DEFAULT_PATH)
+                                     ${IPOPT_DIR}/lib/coin)

     if(IPOPT_LIBRARIES)
       find_file(IPOPT_DEP_FILE ipopt_addlibs_cpp.txt ${IPOPT_DIR}/share/doc/coin/Ipopt
-                                                     ${IPOPT_DIR}/share/coin/doc/Ipopt
-                                                     NO_DEFAULT_PATH)
+                                                     ${IPOPT_DIR}/share/coin/doc/Ipopt)
       mark_as_advanced(IPOPT_DEP_FILE)

       if(IPOPT_DEP_FILE)
@@ -107,8 +105,7 @@
         foreach(LIB ${IPOPT_DEP})
           find_library(IPOPT_SEARCH_FOR_${LIB} ${LIB} ${IPOPT_DIR}/lib
                                                       ${IPOPT_DIR}/lib/coin
-                                                      ${IPOPT_DIR}/lib/coin/ThirdParty
-                                                      NO_DEFAULT_PATH)
+                                                      ${IPOPT_DIR}/lib/coin/ThirdParty)
           if(IPOPT_SEARCH_FOR_${LIB})
             # handle non-system libraries (e.g. coinblas)
             set(IPOPT_LIBRARIES ${IPOPT_LIBRARIES} ${IPOPT_SEARCH_FOR_${LIB}})
@@ -131,14 +128,12 @@

   set(IPOPT_DIR $ENV{IPOPT_DIR} CACHE PATH "Path to IPOPT build directory")

-  find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp coin/IpIpoptApplication.hpp PATHS ${IPOPT_DIR}/include/coin)
+  find_path(IPOPT_INCLUDE_DIRS NAMES IpIpoptApplication.hpp PATH_SUFFIXES coin PATHS ${IPOPT_DIR}/include/coin)

   find_library(IPOPT_IPOPT_LIBRARY_RELEASE libipopt ${IPOPT_DIR}/lib
-                                                    ${IPOPT_DIR}/lib/coin
-                                                    NO_DEFAULT_PATH)
+                                                    ${IPOPT_DIR}/lib/coin)
   find_library(IPOPT_IPOPT_LIBRARY_DEBUG   libipoptD ${IPOPT_DIR}/lib
-                                                     ${IPOPT_DIR}/lib/coin
-                                                     NO_DEFAULT_PATH)
+                                                     ${IPOPT_DIR}/lib/coin)

   select_library_configurations(IPOPT_IPOPT)
   set(IPOPT_LIBRARIES ${IPOPT_IPOPT_LIBRARY})


Trying to fix issue with FindJSDoc.

Trying to fix issue with FindJSDoc.

--- cmake/FindJSDoc.cmake
+++ cmake/FindJSDoc.cmake
@@ -34,4 +34,4 @@

 endif()

-find_package_handle_standard_args(JSDoc DEFAULT_MSG JSDoc_PATH JSDoc_EXECUTABLE JSDoc_TEMPLATEPATH)
+find_package_handle_standard_args(JSDoc DEFAULT_MSG JSDoc_EXECUTABLE)


[tsan] Build TSan dylibs for iOS-style simulators

Update the compiler-rt cmake to build TSan dylibs for iOS-style simulators when the
corresponding COMPILER_RT_ENABLE_FOO_OS setting is enabled.

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

Part of rdar://problem/24048382

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -401,6 +401,7 @@
           list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform}sim)
           list(APPEND BUILTIN_SUPPORTED_OS ${platform}sim)
           list(APPEND PROFILE_SUPPORTED_OS ${platform}sim)
+          list(APPEND TSAN_SUPPORTED_OS ${platform}sim)
         endif()
         foreach(arch ${DARWIN_${platform}sim_ARCHS})
           list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})


enable Hexagon target from cmake

enable Hexagon target from cmake

The patch adds a missing case for the Hexagon target in cmake/config-ix.cmake.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -324,6 +324,8 @@
   set(LLVM_NATIVE_ARCH XCore)
 elseif (LLVM_NATIVE_ARCH MATCHES "msp430")
   set(LLVM_NATIVE_ARCH MSP430)
+elseif (LLVM_NATIVE_ARCH MATCHES "hexagon")
+  set(LLVM_NATIVE_ARCH Hexagon)
 else ()
   message(FATAL_ERROR "Unknown architecture ${LLVM_NATIVE_ARCH}")
 endif ()


disable spurious warning for (Apple)Clang

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -12,6 +12,8 @@
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Woverloaded-virtual")
 if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wmisleading-indentation")
+else()
+        set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wno-missing-braces")
 endif()
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wreorder")
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor")


forcing .html as file extension

forcing .html as file extension

--- cmake/variables.cmake
+++ cmake/variables.cmake
@@ -45,4 +45,5 @@

 if(EMSCRIPTEN)
     set(APP_EXECUTABLE_NAME "${APP_EXECUTABLE_NAME}.html")
+    set(CMAKE_EXECUTABLE_SUFFIX "")
 endif()


conan: fixed missing experimental from libcxx

--- cmake/os.cmake
+++ cmake/os.cmake
@@ -138,6 +138,7 @@
   add_library(libcxx STATIC IMPORTED)
   add_library(cxxabi STATIC IMPORTED)
   add_library(libunwind STATIC IMPORTED)
+  add_library(libcxx_experimental STATIC IMPORTED)

   set_target_properties(libcxx PROPERTIES LINKER_LANGUAGE CXX)
   set_target_properties(libcxx PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/lib/libc++.a)
@@ -145,6 +146,8 @@
   set_target_properties(cxxabi PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/lib/libc++abi.a)
   set_target_properties(libunwind PROPERTIES LINKER_LANGUAGE CXX)
   set_target_properties(libunwind PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/lib/libunwind.a)
+  set_target_properties(libcxx_experimental PROPERTIES LINKER_LANGUAGE CXX)
+  set_target_properties(libcxx_experimental PROPERTIES IMPORTED_LOCATION ${INCLUDEOS_PREFIX}/${ARCH}/lib/libc++experimental.a)

   add_library(libc STATIC IMPORTED)
   set_target_properties(libc PROPERTIES LINKER_LANGUAGE C)
@@ -212,6 +215,7 @@
       libpthread
       libc
       libgcc
+      libcxx_experimental
     )
   endif()


Do not increment the version number if HEAD is alredy tagged.

	* build-aux/cmake/modules/ProjectInfo.cmake: Do that.

--- build-aux/cmake/modules/ProjectInfo.cmake
+++ build-aux/cmake/modules/ProjectInfo.cmake
@@ -185,9 +185,11 @@
     if(PROJECT_VERSION_MAJOR GREATER ${major})
       set(minor 0)
     elseif(PROJECT_VERSION_MAJOR EQUAL ${major})
-      if(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
-	math(EXPR minor "${minor} + 1")
-      endif(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+      if(NOT n EQUAL 0)
+	if(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+	  math(EXPR minor "${minor} + 1")
+	endif(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+      endif(NOT n EQUAL 0)
     else(PROJECT_VERSION_MAJOR GREATER ${major})
       message(SEND_ERROR
 	"project_set_info: required project major version cannot be less than current major version.")
@@ -196,21 +198,27 @@
     set(PROJECT_VERSION_MINOR ${minor} PARENT_SCOPE)
     # Patch
     if(patch GREATER 0)
-      math(EXPR patch "${patch} + 1")
+      if(NOT n EQUAL 0)
+	math(EXPR patch "${patch} + 1")
+      endif(NOT n EQUAL 0)
     endif(patch GREATER 0)
     set(PROJECT_VERSION_PATCH ${patch} PARENT_SCOPE)
     # Vendor version
     if(vendor)
-      if(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
-	math(EXPR vendor_ver "${vendor_ver} + 1")
-      endif(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+      if(NOT n EQUAL 0)
+	if(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+	  math(EXPR vendor_ver "${vendor_ver} + 1")
+	endif(NOT RELEASE_CANDIDATE OR rc EQUAL 0)
+      endif(NOT n EQUAL 0)
     elseif(vendor)
       set(vendor_ver -1)
     endif(vendor)
     set(PROJECT_VENDOR_VERSION ${vendor_ver} PARENT_SCOPE)
     # Release candidate
     if(RELEASE_CANDIDATE)
-      math(EXPR rc "${rc} + 1")
+      if(NOT n EQUAL 0)
+	math(EXPR rc "${rc} + 1")
+      endif(NOT n EQUAL 0)
     endif(RELEASE_CANDIDATE)
     set(PROJECT_VERSION_RC ${rc} PARENT_SCOPE)
     # Additional commit


Stricter check for BALL_STD_STRING_HAS_CONST_ITERATOR_FUNCTIONS

In C++11 std::string::insert(it, 1, 'a') should return an iterator.
Unfortunately, this is not the case for MSVC 2010-2013 and GCC 4.8.2.

GCC also does not implement a version of insert that accepts a
const_iterator. MSVC however does so. Here, we run into the problem that
our wrapper expects that an iterator is returned.

In order to fix the chaos that ensues, we tighten the test to also check
for the appropriate return value.

--- cmake/BALLConfigStdStringFeatures.cmake
+++ cmake/BALLConfigStdStringFeatures.cmake
@@ -15,7 +15,7 @@
 	{
 		std::string s;
 		std::string::const_iterator c_it = s.cbegin();
-		s.insert(c_it, 1, 'a');
+		std::string::iterator result = s.insert(c_it, 1, 'a');

 		return 0;
 	}" BALL_HAS_STD_STRING_CONST_ITERATOR_FUNCTIONS


Fallback to CMAKE_CXX_COMPILER_VERSION if VS version unknown

--- cmake/EigenDetermineVSServicePack.cmake
+++ cmake/EigenDetermineVSServicePack.cmake
@@ -26,6 +26,8 @@
                         set(_sp "vc110sp2")
                     elseif(${_cl_version} VERSION_EQUAL "17.00.60610.1")
                         set(_sp "vc110sp3")
+                    else()
+                        set(_sp ${CMAKE_CXX_COMPILER_VERSION})
                     endif()
                 endif()


[CMake] Cleanup uses of USES_TERMINAL

[CMake] Cleanup uses of USES_TERMINAL

Now that we are on CMake 3.4.3 we no longer need a version check around this.

This is the libcxx side of r272211.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@272212 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -93,14 +93,6 @@
   endif()
   set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")

-  # Make sure we can use the console pool for recent cmake and ninja > 1.5
-  # Needed for add_lit_testsuite
-  if(CMAKE_VERSION VERSION_LESS 3.1.20141117)
-    set(cmake_3_2_USES_TERMINAL)
-  else()
-    set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
-  endif()
-
   # Required doc configuration
   if (LLVM_ENABLE_SPHINX)
     message(STATUS "Sphinx enabled.")


CELIX-414: Adds usage of PRIVATE to target_link_libraries for add_deploy CMake commands

--- cmake/cmake_celix/DeployPackaging.cmake
+++ cmake/cmake_celix/DeployPackaging.cmake
@@ -102,7 +102,7 @@
         include_directories(${CELIX_INCLUDE_DIRS})
         add_executable(${CONTAINER_TARGET} ${LAUNCHER_SRC})
         set_target_properties(${CONTAINER_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CONTAINER_LOC})
-        target_link_libraries(${CONTAINER_TARGET} ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
+        target_link_libraries(${CONTAINER_TARGET} PRIVATE ${CELIX_FRAMEWORK_LIBRARY} ${CELIX_UTILS_LIBRARY})
         set(LAUNCHER "$<TARGET_FILE:${CONTAINER_TARGET}>")
     endif ()


ORC-813: [C++] Upgrade ZSTD to v1.5.0

ORC-813: [C++] Upgrade ZSTD to v1.5.0

This closes #715

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -15,7 +15,7 @@
 set(ZLIB_VERSION "1.2.11")
 set(GTEST_VERSION "1.8.0")
 set(PROTOBUF_VERSION "3.5.1")
-set(ZSTD_VERSION "1.4.5")
+set(ZSTD_VERSION "1.5.0")

 option(ORC_PREFER_STATIC_PROTOBUF "Prefer static protobuf library, if available" ON)
 option(ORC_PREFER_STATIC_SNAPPY   "Prefer static snappy library, if available"   ON)


PARQUET-959: Set CMAKE_INSTALL_LIBDIR in Arrow thirdparty build to avoid failures on multiarch systems

Arrow libraries are now installed in `lib64` on multiarch systems, which breaks the thirdparty build

Author: Wes McKinney <wes.mckinney@twosigma.com>

Closes #303 from wesm/PARQUET-959 and squashes the following commits:

168afa3 [Wes McKinney] Set CMAKE_INSTALL_LIBDIR in Arrow thirdparty build to avoid failures on systems with multiarch

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -365,12 +365,14 @@
   set(ARROW_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/arrow_ep/src/arrow_ep-install")
   set(ARROW_HOME "${ARROW_PREFIX}")
   set(ARROW_INCLUDE_DIR "${ARROW_PREFIX}/include")
-  set(ARROW_SHARED_LIB "${ARROW_PREFIX}/lib/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX}")
-  set(ARROW_STATIC_LIB "${ARROW_PREFIX}/lib/libarrow.a")
+  set(ARROW_LIB_DIR "${ARROW_PREFIX}/lib")
+  set(ARROW_SHARED_LIB "${ARROW_LIB_DIR}/libarrow${CMAKE_SHARED_LIBRARY_SUFFIX}")
+  set(ARROW_STATIC_LIB "${ARROW_LIB_DIR}/libarrow.a")
   set(ARROW_CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
     -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
     -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
     -DCMAKE_INSTALL_PREFIX=${ARROW_PREFIX}
+    -DCMAKE_INSTALL_LIBDIR=${ARROW_LIB_DIR}
     -DARROW_JEMALLOC=OFF
     -DARROW_IPC=OFF
     -DARROW_BUILD_TESTS=OFF)


i#1795 revive CDash server: update nightly.cmake comment about CDash setup

- add xref to cmake nightly binaries download

Review-URL: https://codereview.appspot.com/270760043

--- suite/nightly.cmake
+++ suite/nightly.cmake
@@ -47,6 +47,8 @@
 #    You will need this patch, which is too new to be in a released CTest version:
 #      https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1b700612
 #    For more information, see https://cmake.org/Bug/view.php?id=15774
+#    Recent (after Oct 8 2015) nightly build binaries with the patch can be
+#    downloaded from https://cmake.org/download/.
 # 5) Set up a cron job to run:
 #    cd $nightly/run; /path/to/patched/ctest -V -S ../nightly.cmake > ctest.log 2>&1
 #


fix: Build with VTK 7

fix: Build with VTK 7

--- BasisProject.cmake
+++ BasisProject.cmake
@@ -58,7 +58,7 @@
   DEPENDS
     MIRTK{Common,Numerics,Image,PointSet}
     Eigen3
-    "VTK-6{
+    "VTK-7|6{
       vtkCommonCore,
       vtkCommonDataModel,
       vtkFiltersCore,


make package cacheable

make package cacheable

--- cmake/projects/mpark_variant/hunter.cmake
+++ cmake/projects/mpark_variant/hunter.cmake
@@ -4,6 +4,7 @@

 # Load used modules
 include(hunter_add_version)
+include(hunter_cacheable)
 include(hunter_download)
 include(hunter_pick_scheme)

@@ -24,8 +25,5 @@
 # Pick a download scheme
 hunter_pick_scheme(DEFAULT url_sha1_cmake) # use scheme for cmake projects

-# Download package.
-# Two versions of library will be build by default:
-#     * libexample_A.a
-#     * libexample_Ad.a
+hunter_cacheable(mpark_variant)
 hunter_download(PACKAGE_NAME mpark_variant)


use native paths for clang under Windows

--- CMake/cotire.cmake
+++ CMake/cotire.cmake
@@ -1693,6 +1693,9 @@
 				endif()
 			endif()
 		elseif (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
+			file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
+			file (TO_NATIVE_PATH "${_hostFile}" _hostFileNative)
 			# Clang-cl.exe options used
 			# /Yc creates a precompiled header file
 			# /Fp specifies precompiled header binary file name
@@ -1705,10 +1708,10 @@
 			if (_flags)
 				# append to list
 				list (APPEND _flags "${_sourceFileType${_language}}"
-						"/Yc${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}" /Zs "${_hostFile}")
+						"/Yc${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}" /Zs "${_hostFileNative}")
 			else()
 				# return as a flag string
-				set (_flags "/Yc\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+				set (_flags "/Yc\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
 			endif()
 		endif()
 	elseif (_compilerID MATCHES "Intel")
@@ -1842,26 +1845,28 @@
 				set (_flags "-include \"${_prefixFile}\"")
 			endif()
 		elseif (WIN32)
+			file (TO_NATIVE_PATH "${_prefixFile}" _prefixFileNative)
 			# Clang-cl.exe options used
 			# /Yu uses a precompiled header file during build
 			# /Fp specifies precompiled header binary file name
 			# /FI forces inclusion of file
 			if (_pchFile)
+				file (TO_NATIVE_PATH "${_pchFile}" _pchFileNative)
 				if (_flags)
 					# append to list
-					list (APPEND _flags "/Yu${_prefixFile}" "/Fp${_pchFile}" "/FI${_prefixFile}")
+					list (APPEND _flags "/Yu${_prefixFileNative}" "/Fp${_pchFileNative}" "/FI${_prefixFileNative}")
 				else()
 					# return as a flag string
-					set (_flags "/Yu\"${_prefixFile}\" /Fp\"${_pchFile}\" /FI\"${_prefixFile}\"")
+					set (_flags "/Yu\"${_prefixFileNative}\" /Fp\"${_pchFileNative}\" /FI\"${_prefixFileNative}\"")
 				endif()
 			else()
 				# no precompiled header, force inclusion of prefix header
 				if (_flags)
 					# append to list
-					list (APPEND _flags "/FI${_prefixFile}")
+					list (APPEND _flags "/FI${_prefixFileNative}")
 				else()
 					# return as a flag string
-					set (_flags "/FI\"${_prefixFile}\"")
+					set (_flags "/FI\"${_prefixFileNative}\"")
 				endif()
 			endif()
 		endif()


Resolve symbolic links when passing files to the resource compiler.

--- CMake/usFunctionEmbedResources.cmake
+++ CMake/usFunctionEmbedResources.cmake
@@ -66,6 +66,7 @@
     if(NOT EXISTS ${res_file})
       message(SEND_ERROR "Resource does not exists: ${res_file}")
     endif()
+    get_filename_component(res_file "${res_file}" REALPATH)
     file(TO_NATIVE_PATH "${res_file}" res_file)
     list(APPEND absolute_res_files ${res_file})
   endforeach()


ENH: Remove MIDAS CMake module

ENH: Remove MIDAS CMake module

The ExternalData module replaces it.

--- CMake/MIDAS.cmake
+++ CMake/MIDAS.cmake
@@ -1,165 +0,0 @@
-# - Configure a project for downloading test data from a MIDAS server
-# Include this module in the top CMakeLists.txt file of a project to
-# enable downloading test data from MIDAS. Requires CTest module.
-#   project(MyProject)
-#   ...
-#   include(CTest)
-#   include(MIDAS)
-#
-# To use this module, set the following variable in your script:
-#   MIDAS_REST_URL - URL of the MIDAS server's REST API
-# Other optional variables:
-#   MIDAS_DATA_DIR         - Where to place downloaded files
-#                          - Defaults to PROJECT_BINARY_DIR/MIDAS_Data
-#   MIDAS_KEY_DIR          - Where the key files are located
-#                          - Defaults to PROJECT_SOURCE_DIR/MIDAS_Keys
-#   MIDAS_DOWNLOAD_TIMEOUT - Timeout for download stage (default 0)
-#
-# Then call the following macro:
-#  midas_add_test(<testName> <program> [args...])
-#   testName: Name of the test
-#   program: The executable to be run after the download is complete
-#   args: Optional args to the program.  If an arg is of the form
-#         MIDAS{foo.ext.md5}, the actual file foo.ext will be
-#         substituted for it at test time once the file is downloaded,
-#         assuming the keyfile foo.ext.md5 exists in MIDAS_KEY_DIR.
-#         If an arg is of the form MIDAS_FETCH_ONLY{foo.ext.md5},
-#         it will be downloaded prior to running the test, but it will
-#         not be passed as an argument to the test.
-#
-# EXAMPLE:
-#  midas_add_test(someTest php MIDAS{test.php.md5})
-#   is analogous to
-#  add_test(someTest php test.php)
-#   if the file test.php had already existed on disk.
-#
-# NOTES:
-# * The MIDAS*{} substitution methods can also be passed a relative path
-#   from the MIDAS_KEY_DIR to the key file, so that you can place key files
-#   in subdirectories under MIDAS_KEY_DIR. Ex: MIDAS{test1/input/foo.png.md5}
-#
-#=============================================================================
-# Copyright 2010 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-
-function(midas_add_test)
-  # Determine the test name.
-  list(GET ARGN 0 firstArg)
-  if(firstArg STREQUAL "NAME")
-    list(GET ARGN 1 testName)
-  else(firstArg STREQUAL "NAME")
-    list(GET ARGN 0 testName)
-  endif(firstArg STREQUAL "NAME")
-
-  if(NOT DEFINED MIDAS_REST_URL)
-    message(FATAL_ERROR "You must set MIDAS_REST_URL to the URL of the MIDAS REST API.")
-  endif(NOT DEFINED MIDAS_REST_URL)
-
-  if(NOT DEFINED MIDAS_KEY_DIR)
-    set(MIDAS_KEY_DIR "${PROJECT_SOURCE_DIR}/MIDAS_Keys")
-  endif(NOT DEFINED MIDAS_KEY_DIR)
-
-  if(NOT DEFINED MIDAS_DATA_DIR)
-    set(MIDAS_DATA_DIR "${PROJECT_BINARY_DIR}/MIDAS_Data")
-  endif(NOT DEFINED MIDAS_DATA_DIR)
-  file(MAKE_DIRECTORY "${MIDAS_DATA_DIR}/MIDAS_FetchScripts")
-  file(MAKE_DIRECTORY "${MIDAS_DATA_DIR}/MIDAS_Hashes")
-
-  if(NOT DEFINED MIDAS_DOWNLOAD_TIMEOUT)
-    set(MIDAS_DOWNLOAD_TIMEOUT_STR "")
-  else(NOT DEFINED MIDAS_DOWNLOAD_TIMEOUT)
-    set(MIDAS_DOWNLOAD_TIMEOUT_STR "TIMEOUT ${MIDAS_DOWNLOAD_TIMEOUT}")
-  endif(NOT DEFINED MIDAS_DOWNLOAD_TIMEOUT)
-
-  set(downloadScripts "")
-
-  # Substitute the downloaded file argument(s)
-  foreach(arg ${ARGN})
-    if(arg MATCHES "MIDAS[a-zA-Z_]*{[^}]*}")
-      string(REGEX MATCH "MIDAS[a-zA-Z_]*{([^}]*)}" toReplace "${arg}")
-      string(REGEX MATCH "^MIDAS[a-zA-Z_]*" keyword "${toReplace}")
-      string(REGEX REPLACE "MIDAS[a-zA-Z_]*{([^}]*)}" "\\1" keyFile "${toReplace}")
-      # Split up the checksum extension from the real filename
-      string(REGEX MATCH "\\.[^\\.]*$" hash_alg "${keyFile}")
-      string(REGEX REPLACE "\\.[^\\.]*$" "" base_file "${keyFile}")
-      string(REPLACE "." "" hash_alg "${hash_alg}")
-      string(TOUPPER "${hash_alg}" hash_alg)
-      get_filename_component(base_filepath "${base_file}" PATH)
-      get_filename_component(base_filename "${base_file}" NAME)
-      get_filename_component(base_fileext  "${base_file}" EXT)
-
-      # Resolve file location
-      if(NOT EXISTS "${MIDAS_KEY_DIR}/${keyFile}")
-        message(FATAL_ERROR "MIDAS key file ${MIDAS_KEY_DIR}/${keyFile} does not exist.")
-      endif(NOT EXISTS "${MIDAS_KEY_DIR}/${keyFile}")
-
-      # Obtain the checksum
-      file(READ "${MIDAS_KEY_DIR}/${keyFile}" checksum)
-
-      # Write the test script file for downloading
-      file(WRITE "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake"
-  "message(STATUS \"Data is here: ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg}\")
-if(NOT EXISTS \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
-  file(DOWNLOAD ${MIDAS_REST_URL}/midas.bitstream.by.hash?hash=${checksum}&algorithm=${hash_alg} \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" ${MIDAS_DOWNLOAD_TIMEOUT_STR} STATUS status)
-  list(GET status 0 exitCode)
-  list(GET status 1 errMsg)
-  if(NOT exitCode EQUAL 0)
-    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\")
-    message(FATAL_ERROR \"Error downloading ${checksum}: \${errMsg}\")
-  endif(NOT exitCode EQUAL 0)
-
-  execute_process(COMMAND \"${CMAKE_COMMAND}\" -E md5sum \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" OUTPUT_VARIABLE output)
-  string(SUBSTRING \${output} 0 32 computedChecksum)
-
-  if(NOT computedChecksum STREQUAL ${checksum})
-    file(READ \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" serverResponse)
-    file(REMOVE \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\")
-    message(FATAL_ERROR \"Error: Computed checksum (\${computedChecksum}) did not match expected (${checksum}). Server response: \${serverResponse}\")
-  else(NOT computedChecksum STREQUAL ${checksum})
-    file(RENAME \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${testName}_${checksum}\" \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
-  endif(NOT computedChecksum STREQUAL ${checksum})
-endif(NOT EXISTS \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\")
-
-# Add a symbolic link so we can use the human-readable filename in the command line
-file(MAKE_DIRECTORY \"${MIDAS_DATA_DIR}/${base_filepath}\")
-file(REMOVE \"${MIDAS_DATA_DIR}/${base_file}\")
-
-if(WIN32)
-  # windows does not support symlinks, so we must duplicate the file for now
-  configure_file(\"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" COPYONLY)
-  file(RENAME \"${MIDAS_DATA_DIR}/${testName}_${base_file}\" \"${MIDAS_DATA_DIR}/${base_file}\")
-else(WIN32)
-  execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink \"${MIDAS_DATA_DIR}/MIDAS_Hashes/${checksum}\" \"${MIDAS_DATA_DIR}/${base_file}\")
-endif(WIN32)
-")
-
-      list(APPEND downloadScripts "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/fetch_${checksum}_${base_filename}.cmake")
-      if(NOT keyword STREQUAL "MIDAS_FETCH_ONLY")
-        string(REGEX REPLACE ${toReplace} "${MIDAS_DATA_DIR}/${base_file}" newArg "${arg}")
-        list(APPEND testArgs ${newArg})
-      endif(NOT keyword STREQUAL "MIDAS_FETCH_ONLY")
-    else(arg MATCHES "MIDAS[a-zA-Z_]*{[^}]*}")
-      list(APPEND testArgs ${arg})
-    endif(arg MATCHES "MIDAS[a-zA-Z_]*{[^}]*}")
-  endforeach(arg)
-
-  file(WRITE "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake"
-       "#This is an auto generated file -- do not edit\n\n")
-  list(REMOVE_DUPLICATES downloadScripts)
-  foreach(downloadScript ${downloadScripts})
-    file(APPEND "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake" "include(\"${downloadScript}\")\n")
-  endforeach(downloadScript)
-
-  add_test(${testName}_fetchData "${CMAKE_COMMAND}" -P "${MIDAS_DATA_DIR}/MIDAS_FetchScripts/${testName}_fetchData.cmake")
-  set_tests_properties(${testName}_fetchData PROPERTIES FAIL_REGULAR_EXPRESSION "(Error downloading)|(Error: Computed checksum)")
-  # Finally, create the test
-  add_test(${testArgs})
-  set_tests_properties(${testName} PROPERTIES DEPENDS ${testName}_fetchData)
-endfunction(midas_add_test)


Fix curl darwinssl directive on mac

Fix curl darwinssl directive on mac

--- deps/CURL/CURL.cmake
+++ deps/CURL/CURL.cmake
@@ -30,7 +30,7 @@

     ${_curl_platform_flags}

-    -DCMAKE_USE_DARWINSSL:BOOL=ON
+    -DCMAKE_USE_SECTRANSP:BOOL=ON
     -DCMAKE_USE_OPENSSL:BOOL=OFF

     -DCURL_CA_PATH:STRING=none


Artifactory.cmake: Some fixes and tweaks

--- Artifactory.cmake
+++ Artifactory.cmake
@@ -1,4 +1,4 @@
-# Artifactory.cmake: CMake Integration with the Artifactory artifact server.
+# Artifactory.cmake: CMake integration with the Artifactory artifact server.
 #
 # Copyright 2016 Raumfeld
 #
@@ -12,6 +12,8 @@
 include("support/cmake/DefaultValue")
 include("support/cmake/EnsureAllArgumentsParsed")
 include("support/cmake/RequireArguments")
+
+include("CMakeParseArguments")

 set(ARTIFACTORY_FETCH OFF CACHE BOOL "Whether to try to use prebuilt artifacts from Artifactory")
 set(ARTIFACTORY_SUBMIT OFF CACHE BOOL "Whether to try to submit built artifact to Artifactory")
@@ -233,7 +235,9 @@
         _artifactory_parse_properties(props_string "${ARTIFACT_PROPERTIES}")
         set(extra_args --props=${props_string})
     else()
-        set(extra_args)
+        # We can't set this to an empty string as that expands to "", which is
+        # interpreted as an invalid extra argument by `art`.
+        set(extra_args --props=)
     endif()

     _artifactory_calculate_path_and_filename(


Fix submitting the build notes so that it works from travis, doesn't throw an error on buildbot, and only submits once.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -14,7 +14,7 @@
 set(CTEST_DROP_LOCATION "/submit.php?project=geojs")
 set(CTEST_DROP_SITE_CDASH TRUE)

-if(NOT EXISTS "${CTEST_BINARY_DIRECTORY}/build_notes.json")
+if(DEFINED CTEST_BINARY_DIRECTORY AND NOT EXISTS "${CTEST_BINARY_DIRECTORY}/build_notes.json")
   file(WRITE "${CTEST_BINARY_DIRECTORY}/build_notes.json" "")
 endif()
 set(CTEST_NOTES_FILES "${CTEST_BINARY_DIRECTORY}/build_notes.json")


CTest: Updated CTestConfig.cmake to new CDash on jwein2.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,7 +1,7 @@
 set(CTEST_PROJECT_NAME "ViennaGrid")
-set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")
+set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=ViennaGrid")
+set(CTEST_DROP_SITE "jwein2.iue.tuwien.ac.at:50000")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=ViennaGrid")
 set(CTEST_DROP_SITE_CDASH TRUE)


make the regex more general: error from linking a static lib looks slightly different

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -9,5 +9,5 @@
 set(CTEST_CUSTOM_ERROR_EXCEPTION ${CTEST_CUSTOM_ERROR_EXCEPTION}
    "^make\\[[1-9]\\]: "
    "^collect2: ld returned . exit status"
-   "error: .*\.o: No such file or directory" # This is just a followup error message: linking fails after compilation failed
+   "\.o: No such file or directory" # This is just a followup error message: linking fails after compilation failed
    "^make: \\*\\*\\* \\[all\\] Error ")


Hot fix: add checking of test case source code

--- cpp/cmake/check.cmake
+++ cpp/cmake/check.cmake
@@ -1,6 +1,6 @@
 file(GLOB_RECURSE ALL_SOURCE_FILES
     RELATIVE ${CMAKE_SOURCE_DIR}
-    src/*.cc include/*.h)
+    src/*.cc include/*.h test/*.cc)

 find_package(PythonInterp)
 if(NOT PYTHONINTERP_FOUND)


Also turn unit tests on

Also turn unit tests on

--- Tools/CMake/modules/module_testing.cmake
+++ Tools/CMake/modules/module_testing.cmake
@@ -20,7 +20,7 @@
 # IN THE SOFTWARE.
 # -----------------------------------------------------------------------------

-option(TORQUE_TESTING "Enable unit test module" OFF)
+option(TORQUE_TESTING "Enable unit test module" ON)
 mark_as_advanced(TORQUE_TESTING)

 if(TORQUE_TESTING)
@@ -35,4 +35,4 @@
     # Add include paths
     addInclude( "${libDir}/gtest/fused-src/" )

-endif()+endif()


add some rough notes on compiling for windows with msys2

--- DevIL/README.cmake
+++ DevIL/README.cmake
@@ -4,6 +4,7 @@

 For Linux/Unix/OSX/mingw, using makefiles:

+    $ cd devil/DevIL
     $ mkdir build
     $ cd build
     $ cmake ..
@@ -35,3 +36,12 @@
     - instructions for Msys2 on windows
     - steps for setting up libs for visual studio

+
+
+Building with msys2 and mingw32/mingw64:
+
+  $ cmake -G "MSYS Makefiles" ..
+
+To set install prefix (windows default seems to be C:/program files/....):
+  $ cmake -G "MSYS Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local ..
+


Revert CTestConfig.cmake to publish results to RTK dashboard

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,15 +1,7 @@
-# set(CTEST_PROJECT_NAME "RTK")
-# set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")
-
-# set(CTEST_DROP_METHOD "http")
-# set(CTEST_DROP_SITE "my.cdash.org")
-# set(CTEST_DROP_LOCATION "/submit.php?project=RTK")
-# set(CTEST_DROP_SITE_CDASH TRUE)
-
-set(CTEST_PROJECT_NAME "ITK")
+set(CTEST_PROJECT_NAME "RTK")
 set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
+set(CTEST_DROP_SITE "my.cdash.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=RTK")
 set(CTEST_DROP_SITE_CDASH TRUE)


[test] Removed staged CTestConfig.cmake.

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -1,13 +0,0 @@
-## This file should be placed in the root directory of your project.
-## Then modify the CMakeLists.txt file in the root directory of your
-## project to incorporate the testing dashboard.
-## # The following are required to uses Dart and the Cdash dashboard
-##   ENABLE_TESTING()
-##   INCLUDE(CTest)
-set(CTEST_PROJECT_NAME "Wintermute")
-set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC")
-
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "open.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=MyProject")
-set(CTEST_DROP_SITE_CDASH TRUE)


run more tests now that the drd_mid_* and drd_large_* tests are quicker
refs #4871
closes #5157

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

--- CTestCustom.cmake
+++ CTestCustom.cmake
@@ -86,14 +86,8 @@
     ydb/drd_mid_${test}
     ydb/drd_large_${test}
     )
-  if(NOT test MATCHES "test_stress(1|3).tdb")
-    list(APPEND CTEST_CUSTOM_TESTS_IGNORE
-      ydb/drd_large_${test}
-      )
-  endif()
   if(NOT @RUN_LONG_TESTS@)
     list(APPEND CTEST_CUSTOM_TESTS_IGNORE
-      ydb/drd_mid_${test}
       ydb/drd_large_${test}
       )
   endif()


Set pv_python_executable for windows pygment build

Apparently, we haven't been building any python dependencies on
Windows with "python setup.py build". We need this variable to
do so. So set it in the python.cmake in the win32 directory.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- projects/win32/python.cmake
+++ projects/win32/python.cmake
@@ -7,6 +7,8 @@
       "-Dinstall_dir:PATH=<INSTALL_DIR>"
       -P "${CMAKE_CURRENT_LIST_DIR}/python.install.cmake")

+set (pv_python_executable "${install_location}/bin/python.exe" CACHE INTERNAL "" FORCE)
+
 add_extra_cmake_args(
   -DPYTHON_EXECUTABLE:FILEPATH=<INSTALL_DIR>/bin/python.exe
   -DPYTHON_INCLUDE_DIR:PATH=<INSTALL_DIR>/bin/Include


Fixing package name on OS X

Fixing package name on OS X

--- Resources/CPack/PackageProject.cmake
+++ Resources/CPack/PackageProject.cmake
@@ -61,7 +61,7 @@
 set(UPLOAD_FILE_NAME "")

 IF (APPLE)
-    set(CPACK_PACKAGE_FILE_NAME "TomoEngine-${TomoEngine_VERSION_SHORT}-OSX")
+    set(CPACK_PACKAGE_FILE_NAME "TomoGui-${TomoEngine_VERSION_SHORT}-OSX")
     # This ASSUMES we are creating a tar.gz package. If you change that below to
     # anything else then you need to update this.
     set (UPLOAD_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}.tar.gz)


Fix typoes causing system GTest sources not to be found.

We were searching using variables that were never defined because
of a typo.

--- FindGoogleMock.cmake
+++ FindGoogleMock.cmake
@@ -163,7 +163,7 @@

 # Situation 3. Google Mock was not shipped in source form, but Google
 # Test was, and it is acceptable to use Google Mock in library form.
-if (NOT GTEST_FOUND OR NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)
+if (NOT GTEST_FOUND AND NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)

     # Find the the Google Test include directory
     # by searching the system-wide include directory
@@ -174,9 +174,9 @@
     if (GTEST_INCLUDE_DIR)

         set (GTEST_INCLUDE_BASE "include/")
-        _find_prefix_from_base (${GMOCK_INCLUDE_BASE}
-                                ${GMOCK_INCLUDE_DIR}
-                                GMOCK_INCLUDE_PREFIX)
+        _find_prefix_from_base (${GTEST_INCLUDE_BASE}
+                                ${GTEST_INCLUDE_DIR}
+                                GTEST_INCLUDE_PREFIX)

         find_path (GTEST_SRC_DIR
                    CMakeLists.txt
@@ -196,6 +196,7 @@
             if (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY)

                 set (GTEST_FOUND TRUE)
+                set (GMOCK_FOUND TRUE)

             endif (GMOCK_LIBRARY AND GMOCK_MAIN_LIBRARY)

@@ -203,7 +204,7 @@

     endif (GTEST_INCLUDE_DIR)

-endif (NOT GTEST_FOUND OR NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)
+endif (NOT GTEST_FOUND AND NOT GMOCK_FOUND AND NOT GMOCK_PREFER_SOURCE_BUILD)

 # Situation 4. Neither was shipped in source form.
 # Set up an external project, download it and build it there.


make the testsuite works on windows with nmake

--- test/testsuite.cmake
+++ test/testsuite.cmake
@@ -82,11 +82,7 @@
 endif(NOT EIGEN_SITE)

 if(NOT EIGEN_CMAKE_DIR)
-  if(WIN32)
-    SET(EIGEN_CMAKE_DIR "C:/Program Files/CMake/bin/")
-  else(WIN32)
-    SET(EIGEN_CMAKE_DIR "")
-  endif(WIN32)
+  SET(EIGEN_CMAKE_DIR "")
 endif(NOT EIGEN_CMAKE_DIR)

 if(NOT EIGEN_BUILD_STRING)
@@ -163,6 +159,8 @@
 # this is the initial cache to use for the binary tree, be careful to escape
 # any quotes inside of this string if you use it
 if(WIN32)
+  #message(SEND_ERROR "win32")
+  set(CTEST_CMAKE_COMMAND "${CTEST_CMAKE_COMMAND} -G \"NMake Makefiles\" -DCMAKE_MAKE_PROGRAM=nmake")
   SET (CTEST_INITIAL_CACHE "
     MAKECOMMAND:STRING=nmake -i
     CMAKE_MAKE_PROGRAM:FILEPATH=nmake


Better handling of the weird case when includes are needed but the library isn't.

--- CMake/FindArmadillo.cmake
+++ CMake/FindArmadillo.cmake
@@ -37,7 +37,6 @@

 if(ARMADILLO_INCLUDE_DIR)
-
   # ------------------------------------------------------------------------
   #  Extract version information from <armadillo>
   # ------------------------------------------------------------------------
@@ -244,6 +243,12 @@
         endif()
       endif()

+      if(NOT HDF5_FOUND)
+        # We tried but didn't find it.
+        message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+            "cannot be found on the system.  Consider disabling HDF5 support.")
+      endif()
+
       set(SUPPORT_INCLUDE_DIRS "${SUPPORT_INCLUDE_DIRS}" "${HDF5_INCLUDE_DIRS}")
       set(SUPPORT_LIBRARIES "${SUPPORT_LIBRARIES}" "${HDF5_LIBRARIES}")
     endif (NOT "${ARMA_USE_HDF5}" STREQUAL "")
@@ -251,7 +256,6 @@
   else("${ARMA_USE_WRAPPER}" STREQUAL "")
     # Some older versions still require linking against HDF5 since they did not
     # wrap libhdf5.  This was true for versions older than 4.300.
-
     if(NOT "${ARMA_USE_HDF5}" STREQUAL "" AND
        "${ARMADILLO_VERSION_STRING}" VERSION_LESS "4.300.0")
       message(STATUS "Armadillo HDF5 support is enabled and manual linking is "
@@ -277,10 +281,45 @@
             link_directories("${HDF5_LIBRARY_DIRS}")
           endif()
         endif()
-
-        set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
-        set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
-      endif()
+      endif()
+
+      if(NOT HDF5_FOUND)
+        # We tried but didn't find it.
+        message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+            "cannot be found on the system.  Consider disabling HDF5 support.")
+      endif()
+
+      set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
+      set(SUPPORT_LIBRARIES "${HDF5_LIBRARIES}")
+    endif()
+
+    # Versions between 4.300 and 4.500 did successfully wrap HDF5, but didn't have good support for setting the include directory correctly.
+    if(NOT "${ARMA_USE_HDF5}" STREQUAL "" AND
+       "${ARMADILLO_VERSION_STRING}" VERSION_GREATER "4.299.0" AND
+       "${ARMADILLO_VERSION_STRING}" VERSION_LESS "4.450.0")
+      message(STATUS "Armadillo HDF5 support is enabled and include "
+                     "directories must be found.")
+      find_package(HDF5)
+
+      if(NOT HDF5_FOUND)
+        # On Debian systems, the HDF5 package has been split into multiple
+        # packages so that it is co-installable.  But this may mean that the
+        # include files are hidden somewhere very odd that the FindHDF5.cmake
+        # script will not find.  Thus, we'll also quickly check pkgconfig to see
+        # if there is information on what to use there.
+        find_package(PkgConfig)
+        if (PKG_CONFIG_FOUND)
+          pkg_check_modules(HDF5 hdf5)
+        endif()
+      endif()
+
+      if(NOT HDF5_FOUND)
+        # We tried but didn't find it.
+        message(FATAL_ERROR "Armadillo HDF5 support is enabled, but HDF5 "
+            "cannot be found on the system.  Consider disabling HDF5 support.")
+      endif()
+
+      set(SUPPORT_INCLUDE_DIRS "${HDF5_INCLUDE_DIRS}")
     endif()

   endif("${ARMA_USE_WRAPPER}" STREQUAL "")


COMP: Added RPATH info to installed Poco libs

--- CMakeExternals/Poco.cmake
+++ CMakeExternals/Poco.cmake
@@ -30,6 +30,7 @@
         ${ep_common_args}
         -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
         -DCMAKE_INSTALL_NAME_DIR:STRING=<INSTALL_DIR>/lib
+        -DCMAKE_INSTALL_RPATH:STRING=<INSTALL_DIR>/lib
       DEPENDS ${proj_DEPENDENCIES}
      )


Fixed OpenAL package for linux.

Fixed OpenAL package for linux.

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@756 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/OpenAL.cmake
+++ CMakeModules/OpenAL.cmake
@@ -4,12 +4,12 @@
 macro (FIND_OPENAL)
 	if (NOT MSVC)
 		find_package (PkgConfig)
-		pkg_search_module (OPENAL OPENAL)
-		if (NOT OPENAL_INCLUDE_DIRS AND NOT OPENAL_LIBRARIES)
+		pkg_search_module (openal openal)
+		if (NOT openal_INCLUDE_DIRS AND NOT openal_LIBRARIES)
 			message (FATAL_ERROR "OpenAL not found by pkg-config")
-		endif (NOT OPENAL_INCLUDE_DIRS AND NOT OPENAL_LIBRARIES)
-		separate_arguments (OPENAL_INCLUDE_DIRS)
-		separate_arguments (OPENAL_LIBRARIES)
+		endif (NOT openal_INCLUDE_DIRS AND NOT openal_LIBRARIES)
+		separate_arguments (openal_INCLUDE_DIRS)
+		separate_arguments (openal_LIBRARIES)
 	endif (NOT MSVC)
 endmacro (FIND_OPENAL)

@@ -20,8 +20,8 @@

 	else (MSVC)
-		include_directories (${OPENAL_INCLUDE_DIRS})
-		link_directories (${OPENAL_LIBDIR})
+		include_directories (${openal_INCLUDE_DIRS})
+		link_directories (${openal_LIBDIR})
 	endif (MSVC)
 endmacro (INCLUDE_OPENAL)

@@ -31,6 +31,6 @@
 			debug OpenAL32
 			optimized OpenAL32)
 	else (MSVC)
-		target_link_libraries (${TARGET_NAME} ${OPENAL_LIBRARIES})
+		target_link_libraries (${TARGET_NAME} ${openal_LIBRARIES})
 	endif (MSVC)
 endmacro (LINK_OPENAL)


Merging latest changes from trunk/ to branches/rigid-bodies

git-svn-id: 5cda8128732f5b679951344c24659131be7d2dfc@3329 fa922fa7-2fde-0310-acd8-f43f465a7996

--- CMake_build_options.cmake
+++ CMake_build_options.cmake
@@ -95,6 +95,12 @@
     else (CUDA_VERSION VERSION_GREATER 2.99)
         list(APPEND CUDA_NVCC_FLAGS -arch "sm_${CUDA_ARCH}")
     endif (CUDA_VERSION VERSION_GREATER 2.99)
+
+    if (CUDA_VERSION VERSION_EQUAL 3.1)
+        message(STATUS "Enabling reg usage workaround for CUDA 3.1")
+        list(APPEND CUDA_NVCC_FLAGS "-Xptxas;-abi=no")
+    endif (CUDA_VERSION VERSION_EQUAL 3.1)
+
     endif (ENABLE_OCELOT)

 endif (ENABLE_CUDA)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   21)
+SET(KWSYS_DATE_STAMP_DAY   22)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   02)
+SET(KWSYS_DATE_STAMP_DAY   03)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   29)
+SET(KWSYS_DATE_STAMP_DAY   30)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   11)
+SET(KWSYS_DATE_STAMP_DAY   12)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   14)
+SET(KWSYS_DATE_STAMP_DAY   15)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   07)
+SET(KWSYS_DATE_STAMP_DAY   08)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   18)
+SET(KWSYS_DATE_STAMP_DAY   19)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   10)
+SET(KWSYS_DATE_STAMP_DAY   11)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   27)
+SET(KWSYS_DATE_STAMP_DAY   28)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 08)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   29)
+SET(KWSYS_DATE_STAMP_DAY   30)