Minor formatting changes in FindCEGUI, added note about author and upstream

The script will likely be copied around, we want others to give us patches.

--HG--
branch : v0-8

--- cmake/FindCEGUI.cmake
+++ cmake/FindCEGUI.cmake
@@ -1,6 +1,6 @@
 ################################################################################
 # FindCEGUI
-#
+#
 # Locate CEGUI LIBRARIES
 #
 # This module defines
@@ -14,7 +14,7 @@
 #         Modules :
 #    CEGUI_${COMPONENT}_FOUND - ${COMPONENT} is available
 #    CEGUI_${COMPONENT}_INCLUDE_DIRS - additional include directories for ${COMPONENT}
-#    CEGUI_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
+#    CEGUI_${COMPONENT}_LIBRARIES - link these to use ${COMPONENT}
 #    CEGUI_${COMPONENT}_BINARY_REL - location of the component binary (win32 non-static only, release)
 #    CEGUI_${COMPONENT}_BINARY_DBG - location of the component binary (win32 non-static only, debug)
 #
@@ -41,6 +41,14 @@
 #                ExpatParser LibXMLParser RapidXMLParser TinyXMLParser XercesParser)
 #        Script:
 #                LuaScriptModule
+#
+# author: Guillaume Smaha
+#
+# People have asked us to include a FindCEGUI that is high quality that they will
+# be able to copy and use to find CEGUI, so we have finally done that.
+#
+# If you have improvements for this scripts, please consider sending them upstream.
+# See https://bitbucket.org/cegui/cegui
 ################################################################################

@@ -80,13 +88,13 @@
 # Replace the value of a preprocessor entry
 ################################################################################
 macro(replace_preprocessor_entry VARIABLE KEYWORD NEW_VALUE)
-    string(REGEX REPLACE
+    string(REGEX REPLACE
         "(// *)?# *define +${KEYWORD} +[^ \n]*"
         "#define ${KEYWORD} ${NEW_VALUE}"
         ${VARIABLE}_TEMP
         ${${VARIABLE}}
     )
-    set(${VARIABLE} ${${VARIABLE}_TEMP})
+    set(${VARIABLE} ${${VARIABLE}_TEMP})
 endmacro()

 ################################################################################
@@ -98,16 +106,14 @@
     else ()
         set(TMP_REPLACE_STR "// #define ${KEYWORD}")
     endif ()
-    string(REGEX REPLACE
+    string(REGEX REPLACE
         "(// *)?# *define +${KEYWORD} *\n"
         ${TMP_REPLACE_STR}
         ${VARIABLE}_TEMP
         ${${VARIABLE}}
     )
-    set(${VARIABLE} ${${VARIABLE}_TEMP})
+    set(${VARIABLE} ${${VARIABLE}_TEMP})
 endmacro()
-
-

 ################################################################################
 # Begin processing of package
@@ -191,7 +197,7 @@
 # Couple a set of release AND debug libraries (or frameworks)
 ################################################################################
 macro(make_library_set PREFIX)
-
+
     if (${PREFIX}_FWK)
         set(${PREFIX} ${${PREFIX}_FWK})
     elseif (${PREFIX}_REL AND ${PREFIX}_DBG)
@@ -213,7 +219,7 @@
 endmacro(get_debug_names)

 ################################################################################
-# Add the parent dir from DIR to VAR
+# Add the parent dir from DIR to VAR
 ################################################################################
 macro(add_parent_dir VAR DIR)
     get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE)
@@ -249,107 +255,107 @@

 #########################################################
 # Find cegui modules
-#########################################################
+#########################################################
 macro(cegui_find_modules PLUGIN_COMPONENT)

     foreach (comp ${CEGUI_${PLUGIN_COMPONENT}_MODULES})
-
+
         set(LIBNAME ${comp})
         set(HEADER ${CEGUI_${PLUGIN_COMPONENT}_MODULES_${comp}_HEADER})
         set(PKGCONFIG ${CEGUI_${PLUGIN_COMPONENT}_MODULES_${comp}_PKGCONFIG})
         set(CHECKNOPREFIX ${CEGUI_${PLUGIN_COMPONENT}_MODULES_${comp}_CHECKNOPREFIX})
-
+
         if (NOT "${HEADER}" STREQUAL "")
-
+
             findpkg_begin(CEGUI_${comp})
-
+
             if(PKGCONFIG)
                 use_pkgconfig(CEGUI_${comp}_PKGC "CEGUI-${PKGCONFIG}")
                 if(NOT CEGUI_${comp}_PKGC_INCLUDE_DIRS AND CEGUI_LIB_SUFFIX)
                     use_pkgconfig(CEGUI_${comp}_PKGC "CEGUI${CEGUI_LIB_SUFFIX}-${PKGCONFIG}")
                 endif()
             endif()
-
+
             list(LENGTH HEADER len)
             math(EXPR lenmax "${len} - 1")

             foreach(val RANGE ${lenmax})
                 list(GET HEADER ${val} pathHeader)
-
+
                 if(CEGUI_${comp}_INCLUDE_DIR)
                     set(CEGUI_${comp}_INCLUDE_DIR_TMP ${CEGUI_${comp}_INCLUDE_DIR})
                     unset(CEGUI_${comp}_INCLUDE_DIR CACHE)
                 endif()
-
+
                 get_filename_component(head "${pathHeader}" NAME)
                 get_filename_component(dir "${pathHeader}" DIRECTORY)
                 if (NOT "${dir}" STREQUAL "")
                     set(dir "${dir}/")
                 endif ()
-
+
                 find_path(CEGUI_${comp}_INCLUDE_DIR NAMES ${head} HINTS ${CEGUI_INCLUDE_DIRS} ${CEGUI_${comp}_PKGC_INCLUDE_DIRS} PATH_SUFFIXES ${dir} CEGUI/${dir})

                 if(CEGUI_${comp}_INCLUDE_DIR_TMP)
                     set(CEGUI_${comp}_INCLUDE_DIR ${CEGUI_${comp}_INCLUDE_DIR} ${CEGUI_${comp}_INCLUDE_DIR_TMP})
                     unset(CEGUI_${comp}_INCLUDE_DIR_TMP CACHE)
                 endif()
-
+
             endforeach()
             list(REMOVE_DUPLICATES CEGUI_${comp}_INCLUDE_DIR)
-
+
             set(CEGUI_SUBLIB_DIR "cegui-${CEGUI_VERSION_MAJOR}.${CEGUI_VERSION_MINOR}")
-
-
+
+
             set(CEGUI_${comp}_LIBRARY_NAMES "CEGUI${comp}")
             get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
-
+
             set(CEGUI_${comp}_LIBRARY_NAMES_SUFFIX "CEGUI${comp}${CEGUI_LIB_SUFFIX}")
             get_debug_names(CEGUI_${comp}_LIBRARY_NAMES_SUFFIX)
-
+
             find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} ${CEGUI_${comp}_LIBRARY_NAMES_SUFFIX} HINTS ${CEGUI_LIBRARY_DIR_REL} ${CEGUI_LIBRARY_DIR_REL}/${CEGUI_SUBLIB_DIR} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
             find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} ${CEGUI_${comp}_LIBRARY_NAMES_SUFFIX_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} ${CEGUI_LIBRARY_DIR_DBG}/${CEGUI_SUBLIB_DIR} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Debug")
-
+
             if(CHECKNOPREFIX AND (NOT CEGUI_${comp}_LIBRARY_REL OR NOT CEGUI_${comp}_LIBRARY_DBG))
                 set(CEGUI_${comp}_LIBRARY_NAMES "${comp}")
                 get_debug_names(CEGUI_${comp}_LIBRARY_NAMES)
-
+
                 set(CEGUI_${comp}_LIBRARY_NAMES_SUFFIX "${comp}${CEGUI_LIB_SUFFIX}")
                 get_debug_names(CEGUI_${comp}_LIBRARY_NAMES_SUFFIX)
-
+
                 find_library(CEGUI_${comp}_LIBRARY_REL NAMES ${CEGUI_${comp}_LIBRARY_NAMES} ${CEGUI_${comp}_LIBRARY_NAMES_SUFFIX} HINTS ${CEGUI_LIBRARY_DIR_REL} ${CEGUI_LIBRARY_DIR_REL}/${CEGUI_SUBLIB_DIR} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
                 find_library(CEGUI_${comp}_LIBRARY_DBG NAMES ${CEGUI_${comp}_LIBRARY_NAMES_DBG} ${CEGUI_${comp}_LIBRARY_NAMES_SUFFIX_DBG} HINTS ${CEGUI_LIBRARY_DIR_DBG} ${CEGUI_LIBRARY_DIR_DBG}/${CEGUI_SUBLIB_DIR} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Debug")
             endif()
-
+
             make_library_set(CEGUI_${comp}_LIBRARY)
-
+
             if (NOT CEGUI_STATIC)
                 if (WIN32)
                     find_file(CEGUI_${comp}_BINARY_REL NAMES "CEGUI${comp}.dll" "CEGUI${comp}${CEGUI_LIB_SUFFIX}.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
                     find_file(CEGUI_${comp}_BINARY_DBG NAMES "CEGUI${comp}_d.dll" "CEGUI${comp}${CEGUI_LIB_SUFFIX}_d.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} ${CEGUI_${comp}_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" "Debug")
-
+
                      if(CHECKNOPREFIX AND (NOT CEGUI_${comp}_LIBRARY_REL OR NOT CEGUI_${comp}_LIBRARY_DBG))
                          find_file(CEGUI_${comp}_BINARY_REL NAMES "${comp}${CEGUI_LIB_SUFFIX}.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
                          find_file(CEGUI_${comp}_BINARY_DBG NAMES "${comp}${CEGUI_LIB_SUFFIX}_d.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} PATH_SUFFIXES "" "Debug")
                     endif()
                 endif()
-
+
                 get_filename_component(CEGUI_${comp}_BINARY_DIR_REL "${CEGUI_${comp}_BINARY_REL}" PATH)
                 get_filename_component(CEGUI_${comp}_BINARY_DIR_DBG "${CEGUI_${comp}_BINARY_DBG}" PATH)
                 mark_as_advanced(CEGUI_${comp}_BINARY_REL CEGUI_${comp}_BINARY_DBG CEGUI_${comp}_BINARY_DIR_REL CEGUI_${comp}_BINARY_DIR_DBG)
             endif()
-
+
             findpkg_finish(CEGUI_${comp})
-
+
         endif ()
-
+
     endforeach (comp)
-
+
 endmacro(cegui_find_modules)

 #########################################################
 # register a module
-#########################################################
+#########################################################
 macro(cegui_register_module TYPE LIBNAME HEADER PKGCONFIG)
         set(CEGUI_MODULES ${CEGUI_MODULES} ${LIBNAME})
         set(CEGUI_${TYPE}_MODULES ${CEGUI_${TYPE}_MODULES} ${LIBNAME})
@@ -360,9 +366,6 @@
 endmacro()

-
-
-
 #########################################################
 # Main
 #########################################################
@@ -370,12 +373,10 @@

 set(CEGUI_VERSION_MAJOR_DEFAULT "0")

-
-#Register var to check change on base
+# Register var to check change on base
 set(CEGUI_RESET_VARS CEGUI_CONFIG_INCLUDE_DIR CEGUI_INCLUDE_DIR CEGUI_LIBRARY_REL CEGUI_LIBRARY_DBG)
 set(CEGUI_PREFIX_WATCH ${CEGUI_PREFIX_PATH})
 clear_if_changed(CEGUI_PREFIX_WATCH ${CEGUI_RESET_VARS})
-

 findpkg_begin(CEGUI)

@@ -417,7 +418,7 @@
         $ENV{HOME}/CEGUI
     )
     if (APPLE)
-        set(CEGUI_PREFIX_GUESSES
+        set(CEGUI_PREFIX_GUESSES
             ${CMAKE_CURRENT_SOURCE_DIR}/lib/macosx
             ${CEGUI_PREFIX_GUESSES}
         )
@@ -450,7 +451,7 @@
     else()
         file(READ ${CEGUI_INCLUDE_DIR}/Version.h CEGUI_TEMP_VERSION_CONTENT)
     endif()
-
+
     if (NOT "${CEGUI_TEMP_VERSION_CONTENT}" STREQUAL "")
         get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_MAJOR CEGUI_VERSION_MAJOR)
         get_preprocessor_entry(CEGUI_TEMP_VERSION_CONTENT CEGUI_VERSION_MINOR CEGUI_VERSION_MINOR)
@@ -462,7 +463,7 @@
         message(SEND_ERROR "Can't found CEGUI version !")
         set(CEGUI_INCOMPATIBLE FALSE)
     endif()
-
+
 else ()
     set(CEGUI_INCOMPATIBLE FALSE)
 endif ()
@@ -502,26 +503,26 @@
 set(CEGUI_LIBRARY_DIRS ${CEGUI_LIBRARY_DIR_REL} ${CEGUI_LIBRARY_DIR_DBG})

-# find binaries
+# find binaries
 if (NOT CEGUI_STATIC)
         if (WIN32)
                 find_file(CEGUI_BINARY_REL NAMES "CEGUIBase${CEGUI_LIB_SUFFIX}.dll" "CEGUIBase.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} PATH_SUFFIXES "" "Release" "RelWithDebInfo" "MinSizeRel")
                 find_file(CEGUI_BINARY_DBG NAMES "CEGUIBase${CEGUI_LIB_SUFFIX}_d.dll" "CEGUIBase_d.dll" HINTS ${CEGUI_BIN_SEARCH_PATH} PATH_SUFFIXES "" "Debug")
         endif()
-
+
         get_filename_component(CEGUI_BINARY_DIR_REL "${CEGUI_BINARY_REL}" PATH)
         get_filename_component(CEGUI_BINARY_DIR_DBG "${CEGUI_BINARY_DBG}" PATH)
         mark_as_advanced(CEGUI_BINARY_REL CEGUI_BINARY_DBG CEGUI_BINARY_DIR_REL CEGUI_BINARY_DIR_DBG)
 endif()

 if ("${CEGUI_VERSION}" VERSION_GREATER "0.8.0")
-    #Base
+    # Base
     cegui_register_module(BASE CommonDialogs CommonDialogs/Module.h "")
-
-    #WindowsRenderer
+
+    # WindowsRenderer
     cegui_register_module(WINDOWSRENDERER CoreWindowRendererSet WindowRendererSets/Core/Module.h "")
-
-    #Renderer
+
+    # Renderer
     cegui_register_module(RENDERER Direct3D9Renderer RendererModules/Direct3D9/Renderer.h "")
     cegui_register_module(RENDERER Direct3D10Renderer RendererModules/Direct3D10/Renderer.h "")
     cegui_register_module(RENDERER Direct3D11Renderer RendererModules/Direct3D11/Renderer.h "")
@@ -532,8 +533,8 @@
     cegui_register_module(RENDERER OpenGLRenderer RendererModules/OpenGL/GLRenderer.h "OPENGL")
     cegui_register_module(RENDERER OpenGL3Renderer RendererModules/OpenGL/GL3Renderer.h "OPENGL3")
     cegui_register_module(RENDERER OpenGLESRenderer RendererModules/OpenGLES/Renderer.h "")
-
-    #ImageCodec
+
+    # ImageCodec
     cegui_register_module(IMAGECODEC CoronaImageCodec ImageCodecModules/Corona/ImageCodec.h "")
     cegui_register_module(IMAGECODEC DevILImageCodec ImageCodecModules/DevIL/ImageCodec.h "")
     cegui_register_module(IMAGECODEC FreeImageImageCodec ImageCodecModules/FreeImage/ImageCodec.h "")
@@ -541,23 +542,23 @@
     cegui_register_module(IMAGECODEC STBImageCodec ImageCodecModules/STB/ImageCodec.h "")
     cegui_register_module(IMAGECODEC TGAImageCodec ImageCodecModules/TGA/ImageCodec.h "")
     cegui_register_module(IMAGECODEC PVRImageCodec ImageCodecModules/PVR/ImageCodec.h "")
-
-    #Parser
+
+    # Parser
     cegui_register_module(PARSER ExpatParser XMLParserModules/Expat/XMLParser.h "")
     cegui_register_module(PARSER LibXMLParser XMLParserModules/Libxml2/XMLParser.h "")
     cegui_register_module(PARSER RapidXMLParser XMLParserModules/RapidXML/XMLParser.h "")
     cegui_register_module(PARSER TinyXMLParser XMLParserModules/TinyXML/XMLParser.h "")
     cegui_register_module(PARSER XercesParser XMLParserModules/Xerces/XMLParser.h "")
-
-    #Script
+
+    # Script
     cegui_register_module(SCRIPT LuaScriptModule ScriptModules/Lua/ScriptModule.h "LUA")
-
+
 else ()
-
-    #WindowsRenderer
+
+    # WindowsRenderer
     cegui_register_module(WINDOWSRENDERER FalagardWRBase "WindowRendererSets/Falagard/FalModule.h;falagard/CEGUIFalNamedArea.h" "")
-
-    #Renderer
+
+    # Renderer
     cegui_register_module(RENDERER Direct3D9Renderer RendererModules/Direct3D9/CEGUIDirect3D9Renderer.h "")
     cegui_register_module(RENDERER Direct3D10Renderer RendererModules/Direct3D10/CEGUIDirect3D10Renderer.h "")
     cegui_register_module(RENDERER Direct3D11Renderer RendererModules/Direct3D11/CEGUIDirect3D11Renderer.h "")
@@ -566,25 +567,25 @@
     cegui_register_module(RENDERER NullRenderer RendererModules/Null/CEGUINullRenderer.h "NULL")
     cegui_register_module(RENDERER OgreRenderer RendererModules/Ogre/CEGUIOgreRenderer.h "OGRE")
     cegui_register_module(RENDERER OpenGLRenderer RendererModules/OpenGL/CEGUIOpenGLRenderer.h "OPENGL")
-
-    #ImageCodec
+
+    # ImageCodec
     cegui_register_module(IMAGECODEC CoronaImageCodec ImageCodecModules/CoronaImageCodec/CEGUICoronaImageCodec.h "")
     cegui_register_module(IMAGECODEC DevILImageCodec ImageCodecModules/DevILImageCodec/CEGUIDevILImageCodec.h "")
     cegui_register_module(IMAGECODEC FreeImageImageCodec ImageCodecModules/FreeImageImageCodec/CEGUIFreeImageImageCodec.h "")
     cegui_register_module(IMAGECODEC SILLYImageCodec ImageCodecModules/SILLYImageCodec/CEGUISILLYImageCodec.h "")
     cegui_register_module(IMAGECODEC STBImageCodec ImageCodecModules/STBImageCodec/CEGUISTBImageCodec.h "")
     cegui_register_module(IMAGECODEC TGAImageCodec ImageCodecModules/TGAImageCodec/CEGUITGAImageCodec.h "")
-
-    #Parser
+
+    # Parser
     cegui_register_module(PARSER ExpatParser XMLParserModules/ExpatParser/CEGUIExpatParser.h "")
     cegui_register_module(PARSER LibxmlParser XMLParserModules/LibxmlParser/CEGUILibxmlParser.h "")
     cegui_register_module(PARSER RapidXMLParser XMLParserModules/RapidXMLParser/CEGUIRapidXMLParser.h "")
     cegui_register_module(PARSER TinyXMLParser XMLParserModules/TinyXMLParser/CEGUITinyXMLParser.h "")
     cegui_register_module(PARSER XercesParser XMLParserModules/XercesParser/CEGUIXercesParser.h "")
-
-    #Script
+
+    # Script
     cegui_register_module(SCRIPT LuaScriptModule ScriptingModules/LuaScriptModule/CEGUILua.h "")
-
+
     if(WIN32)
         cegui_register_module(SCRIPT tolua++ ScriptingModules/LuaScriptModule/support/tolua++/tolua++.h "")
         set(CEGUI_SCRIPT_MODULES_tolua++_CHECKNOPREFIX TRUE)
@@ -595,7 +596,7 @@
 endif ()

-#Register var to check change on modules
+# Register var to check change on modules
 set(CEGUI_RESET_MODULES_VARS "")
 foreach (comp ${CEGUI_MODULES})
     set(CEGUI_RESET_MODULES_VARS ${CEGUI_RESET_MODULES_VARS}
@@ -607,7 +608,7 @@
 clear_if_changed(CEGUI_PREFIX_WATCH ${CEGUI_RESET_MODULES_VARS})

-#Find modules
+# Find modules
 cegui_find_modules(BASE)
 cegui_find_modules(WINDOWSRENDERER)
 cegui_find_modules(RENDERER)
@@ -616,13 +617,12 @@
 cegui_find_modules(SCRIPT)

-#Find modules
+# Find modules
 if (CEGUI_STATIC)
     set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES_OLD}")
 endif()

-
 #Check change on modules
 clear_if_changed(CEGUI_PREFIX_WATCH)
 clear_if_changed(CEGUI_PREFIX_MODULES_WATCH)


Removed Windows search path

Removed Windows search path

--- cmake/FindCatch.cmake
+++ cmake/FindCatch.cmake
@@ -1,5 +1,4 @@
-find_path(CATCH_INCLUDE_DIRS catch.hpp
-  PATHS "$ENV{ProgramFiles}/Catch")
+find_path(CATCH_INCLUDE_DIRS catch.hpp)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(Catch DEFAULT_MSG CATCH_INCLUDE_DIRS)


Adding cmake option 'USE_MARIADB' to force linking against the LGPL's MariaDb connector.

--- cmake/FindMySql.cmake
+++ cmake/FindMySql.cmake
@@ -6,15 +6,27 @@
 #  MYSQL_FOUND        - True if MySQL found.

 if (NOT DEFINED MSVC)
-	find_path(MYSQL_INCLUDE_DIR
-		NAMES mysql.h
-		PATH_SUFFIXES mysql
-		)
+	if (USE_MARIADB)
+		find_path(MYSQL_INCLUDE_DIR
+			NAMES mysql.h
+			PATH_SUFFIXES mariadb
+			)

-	find_library(MYSQL_LIBRARY
-		NAMES mysqlclient mysqlclient_r
-		PATH_SUFFIXES mysql
-		)
+		find_library(MYSQL_LIBRARY
+			NAMES mariadb
+			PATH_SUFFIXES mariadb
+			)
+	else()
+		find_path(MYSQL_INCLUDE_DIR
+			NAMES mysql.h
+			PATH_SUFFIXES mysql
+			)
+
+		find_library(MYSQL_LIBRARY
+			NAMES mysqlclient mysqlclient_r
+			PATH_SUFFIXES mysql
+			)
+	endif()
 else()
 	find_path(MYSQL_INCLUDE_DIR
 		NAMES mysql.h


cmake: fix PulseAudio version detection

cmake: fix PulseAudio version detection

--- cmake/FindPulse.cmake
+++ cmake/FindPulse.cmake
@@ -12,12 +12,19 @@

 if(PULSE_LIBRARY)
 	execute_process(COMMAND "pactl" "--version" OUTPUT_VARIABLE PULSE_VERSION_OUTPUT)
-
 	STRING(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" PULSE_VERSION "${PULSE_VERSION_OUTPUT}")
 	if(NOT PULSE_VERSION)
 		message(FATAL_ERROR "PulseAudio is not installed")
 	endif()
+	STRING(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" PULSE_VERSION_MAJOR "${PULSE_VERSION}")
+	STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" PULSE_VERSION_MINOR "${PULSE_VERSION}")
+	STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" PULSE_VERSION_PATCH "${PULSE_VERSION}")
+	if(PULSE_VERSION_PATCH EQUAL 0)
+		set(PULSE_VERSION "${PULSE_VERSION_MAJOR}.${PULSE_VERSION_MINOR}")
+	else()
+		set(PULSE_VERSION "${PULSE_VERSION_MAJOR}.${PULSE_VERSION_MINOR}.${PULSE_VERSION_PATCH}")
+	endif()
 endif()

-mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY PULSE_VERSION)
+mark_as_advanced(PULSE_INCLUDE_DIR PULSE_LIBRARY PULSE_VERSION PULSE_VERSION_MAJOR PULSE_VERSION_MINOR PULSE_VERSION_PATCH)


fix typo

fix typo

--- cmake/SuperFind.cmake
+++ cmake/SuperFind.cmake
@@ -29,7 +29,7 @@
     find_package(${PKG_NAME} QUIET)
   endif()

-  if(NOT ${PKG_NAME}_FOUNDx)
+  if(NOT ${PKG_NAME}_FOUND)
     ExternalProject_Add(${PKG_NAME}
       GIT_REPOSITORY ${EP_URL}/${PKG_REPO}
       DOWNLOAD_COMMAND ""


[CMake][libcxx] Use check_c_compiler_flag to check for nodefaultlibs

We're using -nodefaultlibs to avoid the dependency on C++ library
when using check_cxx_compiler_flag, and as such we cannot use
check_cxx_compiler_flag to check the availability of -nodefaultlibs
itself.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,4 +1,5 @@
 include(CheckLibraryExists)
+include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)

 if(WIN32 AND NOT MINGW)
@@ -24,7 +25,7 @@
 # required during compilation (which has the -nodefaultlibs). libc is
 # required for the link to go through. We remove sanitizers from the
 # configuration checks to avoid spurious link errors.
-check_cxx_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
 if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
   if (LIBCXX_HAS_C_LIB)


Build 10.1 compat rpm

Build 10.1 compat rpm

Repack 10.1.x-shared rpm to 10.2.x-compat.rpm
Also remove old references to ourdelta rpms.

--- cmake/cpack_rpm.cmake
+++ cmake/cpack_rpm.cmake
@@ -122,15 +122,13 @@

 SETA(CPACK_RPM_client_PACKAGE_OBSOLETES
   "mysql-client"
-  "MySQL-client"
-  "MySQL-OurDelta-client")
+  "MySQL-client")
 SETA(CPACK_RPM_client_PACKAGE_PROVIDES
   "MySQL-client"
   "mysql-client")

 SETA(CPACK_RPM_devel_PACKAGE_OBSOLETES
-  "MySQL-devel"
-  "MySQL-OurDelta-devel")
+  "MySQL-devel")
 SETA(CPACK_RPM_devel_PACKAGE_PROVIDES
   "MySQL-devel")

@@ -139,8 +137,7 @@
   "MySQL"
   "mysql-server"
   "MySQL-server"
-  "MariaDB-Galera-server"
-  "MySQL-OurDelta-server")
+  "MariaDB-Galera-server")
 SETA(CPACK_RPM_server_PACKAGE_PROVIDES
   "MariaDB"
   "MySQL"
@@ -148,22 +145,20 @@
   "msqlormysql"
   "mysql-server")

-SETA(CPACK_RPM_shared_PACKAGE_OBSOLETES
+SETA(CPACK_RPM_compat_PACKAGE_OBSOLETES
   "mysql-shared"
   "MySQL-shared-standard"
   "MySQL-shared-pro"
   "MySQL-shared-pro-cert"
   "MySQL-shared-pro-gpl"
   "MySQL-shared-pro-gpl-cert"
-  "MySQL-shared"
-  "MySQL-OurDelta-shared")
-SETA(CPACK_RPM_shared_PACKAGE_PROVIDES
+  "MySQL-shared")
+SETA(CPACK_RPM_compat_PACKAGE_PROVIDES
   "MySQL-shared"
   "mysql-shared")

 SETA(CPACK_RPM_test_PACKAGE_OBSOLETES
-  "MySQL-test"
-  "MySQL-OurDelta-test")
+  "MySQL-test")
 SETA(CPACK_RPM_test_PACKAGE_PROVIDES
   "MySQL-test")

@@ -183,6 +178,8 @@
 SET(CPACK_RPM_server_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-postun.sh)
 SET(CPACK_RPM_shared_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
 SET(CPACK_RPM_shared_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
+SET(CPACK_RPM_compat_POST_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)
+SET(CPACK_RPM_compat_POST_UNINSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/shared-post.sh)

 MACRO(ALTERNATIVE_NAME real alt)
   SET(ver "%{version}-%{release}")
@@ -250,18 +247,32 @@

 # If we want to build build MariaDB-shared-compat,
 # extract compat libraries from MariaDB-shared-5.3 rpm
-FILE(GLOB compat_rpm RELATIVE ${CMAKE_SOURCE_DIR}
+FILE(GLOB compat53 RELATIVE ${CMAKE_SOURCE_DIR}
     "${CMAKE_SOURCE_DIR}/../MariaDB-shared-5.3.*.rpm")
-IF (compat_rpm)
-  MESSAGE("Using ${compat_rpm} to build MariaDB-compat")
-  INSTALL(CODE "EXECUTE_PROCESS(
-                 COMMAND rpm2cpio ${CMAKE_SOURCE_DIR}/${compat_rpm}
-                 COMMAND cpio --extract --make-directories */libmysqlclient*.so.* -
-                 WORKING_DIRECTORY \$ENV{DESTDIR})
-                EXECUTE_PROCESS(
-                 COMMAND chmod -R a+rX .
-                 WORKING_DIRECTORY \$ENV{DESTDIR})"
-                 COMPONENT Compat)
+FILE(GLOB compat101 RELATIVE ${CMAKE_SOURCE_DIR}
+    "${CMAKE_SOURCE_DIR}/../MariaDB-shared-10.1.*.rpm")
+IF(compat53 AND compat101)
+  FOREACH(compat_rpm "${compat53}" "${compat101}")
+    MESSAGE("Using ${compat_rpm} to build MariaDB-compat")
+    INSTALL(CODE "EXECUTE_PROCESS(
+                   COMMAND rpm2cpio ${CMAKE_SOURCE_DIR}/${compat_rpm}
+                   COMMAND cpio --extract --make-directories */libmysqlclient*.so* -
+                   WORKING_DIRECTORY \$ENV{DESTDIR})
+                  EXECUTE_PROCESS(
+                   COMMAND chmod -R a+rX .
+                   WORKING_DIRECTORY \$ENV{DESTDIR})"
+                   COMPONENT Compat)
+  ENDFOREACH()
+
+  EXECUTE_PROCESS(
+    COMMAND rpm -q --provides -p "${CMAKE_SOURCE_DIR}/${compat101}"
+    COMMAND grep "=.*10\\.1"
+    ERROR_QUIET
+    OUTPUT_VARIABLE compat_provides)
+
+  STRING(REPLACE "\n" " " compat_provides "${compat_provides}")
+  SETA(CPACK_RPM_compat_PACKAGE_PROVIDES "${compat_provides}")
+
   SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} Compat)

   # RHEL6/CentOS6 install Postfix by default, and it requires
@@ -272,10 +283,7 @@
   IF(RPM MATCHES "(rhel|centos)6")
     SET(CPACK_RPM_common_PACKAGE_REQUIRES "MariaDB-compat")
   ENDIF()
-ENDIF(compat_rpm)
-
-SET(CPACK_RPM_compat_PACKAGE_PROVIDES "mysql-libs = 5.3.5") # exact version doesn't matter as long as it greater than 5.1
-SET(CPACK_RPM_compat_PACKAGE_OBSOLETES "mysql-libs < 5.3.5")
+ENDIF()

 ENDIF(RPM)


fix to ddapp build for pod complicence

fix to ddapp build for pod complicence

--- cmake/dd-macros.cmake
+++ cmake/dd-macros.cmake
@@ -37,3 +37,9 @@
   target_link_libraries(${target} ${${cachevar}_pkgconfig_LIBRARIES})

 endmacro()
+
+macro(setup_pods_pkg_config_path)
+  set(ENV{PKG_CONFIG_PATH} "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig:${PKG_CONFIG_PATH}")
+endmacro()
+
+setup_pods_pkg_config_path()


Fixes #142

Fixes #142

--- ios.toolchain.cmake
+++ ios.toolchain.cmake
@@ -878,7 +878,7 @@

 # Set the find root to the SDK developer roots.
 # Note: CMAKE_FIND_ROOT_PATH is only useful when cross-compiling. Thus, do not set on macOS builds.
-if(NOT PLATFORM_INT STREQUAL "MAC" AND NOT PLATFORM_INT STREQUAL "MAC_ARM64")
+if(NOT PLATFORM_INT MATCHES "^MAC.*$")
   list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_OSX_SYSROOT_INT}" CACHE INTERNAL "")
   set(CMAKE_IGNORE_PATH "/System/Library/Frameworks;/usr/local/lib" CACHE INTERNAL "")
 endif()


changed blas priority

changed blas priority

--- cmake/FindBLAS.cmake
+++ cmake/FindBLAS.cmake
@@ -167,14 +167,14 @@
 if( NOT BLAS_VENDORS )
   # If not specified, we will search through the list of known suppliers
   set( BLAS_VENDORS
+    MKL
     ATLAS
+    OPEN
     ACCELERATE
     ACML
     ESSL
     GOTO
-    OPEN
     SCSL
-    MKL
     SUNPERF
     VECLIB
     GENERIC)


fix glew find script

fix glew find script

--- cmake/FindGLEW.cmake
+++ cmake/FindGLEW.cmake
@@ -14,11 +14,20 @@
     /opt/local/include
     DOC "The directory where GL/glew.h resides")

+if (X64)
+    set(GLEW_BUILD_DIR Release/x64)
+else()
+    set(GLEW_BUILD_DIR Release/Win32)
+endif()
+
+
 find_library(GLEW_LIBRARY
     NAMES GLEW glew glew32 glew32s
     PATHS
     $ENV{GLEWDIR}/lib
     $ENV{GLEW_HOME}/lib
+    $ENV{GLEWDIR}/lib/${GLEW_BUILD_DIR}
+    $ENV{GLEW_HOME}/lib/${GLEW_BUILD_DIR}
     /usr/lib64
     /usr/local/lib64
     /sw/lib64
@@ -36,6 +45,8 @@
         PATHS
         $ENV{GLEWDIR}/bin
         $ENV{GLEW_HOME}/bin
+        $ENV{GLEWDIR}/bin/${GLEW_BUILD_DIR}
+        $ENV{GLEW_HOME}/bin/${GLEW_BUILD_DIR}
         DOC "The GLEW binary")

 endif()


show GCC/ICC compiler version and do not enable C++11 with ICC anymore - Intel really should fix their libstdc++ usage...

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -29,7 +29,8 @@
       set(Vc_COMPILER_IS_GCC false)
       if(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$")
          set(Vc_COMPILER_IS_INTEL true)
-         message(STATUS "Detected Compiler: Intel")
+         exec_program(${CMAKE_C_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE Vc_ICC_VERSION)
+         message(STATUS "Detected Compiler: Intel ${Vc_ICC_VERSION}")
       elseif(CMAKE_CXX_COMPILER MATCHES "/(opencc|openCC)$")
          set(Vc_COMPILER_IS_OPEN64 true)
          message(STATUS "Detected Compiler: Open64")
@@ -41,10 +42,8 @@
          message(STATUS "Detected Compiler: MSVC")
       elseif(CMAKE_COMPILER_IS_GNUCXX)
          set(Vc_COMPILER_IS_GCC true)
-         message(STATUS "Detected Compiler: GCC")
-
-         # check the GCC version
          exec_program(${CMAKE_C_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE Vc_GCC_VERSION)
+         message(STATUS "Detected Compiler: GCC ${Vc_GCC_VERSION}")

          # some distributions patch their GCC to return nothing or only major and minor version on -dumpversion.
          # In that case we must extract the version number from --version.
@@ -258,13 +257,6 @@
          set(CMAKE_C_FLAGS   "${CMAKE_C_FLAGS}   ${ALIAS_FLAGS}")
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ALIAS_FLAGS}")
       endif()
-
-      exec_program(${CMAKE_C_COMPILER} ARGS -dumpversion OUTPUT_VARIABLE _icc_version)
-      macro_ensure_version("12.0.0" "${_icc_version}" ICC_12_0_0)
-      if(ICC_12_0_0)
-         # iomanip from latest libstdc++ makes ICC fail unless C++0x is selected
-         vc_add_compiler_flag(Vc_DEFINITIONS "-std=c++0x")
-      endif()
    elseif(Vc_COMPILER_IS_MSVC)
       if(_add_warning_flags)
          AddCompilerFlag("/wd4800") # Disable warning "forcing value to bool"


Add a cc_binary CMake rule (#1671)

Add a cc_binary CMake rule (#1671)

--- cmake/cc_rules.cmake
+++ cmake/cc_rules.cmake
@@ -89,6 +89,27 @@
   message(FATAL_ERROR "Could not find implementation for ${library_name}")
 endfunction()

+# cc_binary(
+#   target
+#   SOURCES sources...
+#   DEPENDS libraries...
+# )
+#
+# Defines a new executable target with the given target name, sources, and
+# dependencies.
+function(cc_binary name)
+  set(multi DEPENDS SOURCES)
+  cmake_parse_arguments(ccb "" "" "${multi}" ${ARGN})
+
+  maybe_remove_objc_sources(sources ${ccb_SOURCES})
+  add_executable(${name} ${sources})
+  add_objc_flags(${name} ccb)
+  add_test(${name} ${name})
+
+  target_include_directories(${name} PUBLIC ${FIREBASE_SOURCE_DIR})
+  target_link_libraries(${name} ${ccb_DEPENDS})
+endfunction()
+
 # cc_test(
 #   target
 #   SOURCES sources...
@@ -140,12 +161,11 @@

   list(APPEND ccf_DEPENDS Fuzzer)

-  maybe_remove_objc_sources(sources ${ccf_SOURCES})
-  add_executable(${name} ${sources})
-  add_objc_flags(${name} ccf)
-
-  target_include_directories(${name} PUBLIC ${FIREBASE_SOURCE_DIR})
-  target_link_libraries(${name} ${ccf_DEPENDS})
+  cc_binary(
+    ${name}
+    SOURCES ${ccf_SOURCES}
+    DEPENDS ${ccf_DEPENDS}
+  )

   # Copy the dictionary file and corpus directory, if they are defined.
   if(DEFINED ccf_DICTIONARY)


disable -Wshadow for now

disable -Wshadow for now

--- cmake/defaults.cmake
+++ cmake/defaults.cmake
@@ -23,7 +23,8 @@
     # general flags for any compilation with gcc/g++
     set(GCC_FLAGS "-pthread -march=core2")
     set(GCC_FLAGS "${GCC_FLAGS} -Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter")
-    set(GCC_FLAGS "${GCC_FLAGS} -Wpointer-arith -Wcast-align -Wuninitialized -Wwrite-strings -Wshadow")
+    set(GCC_FLAGS "${GCC_FLAGS} -Wpointer-arith -Wcast-align -Wuninitialized -Wwrite-strings")
+    #set(GCC_FLAGS "${GCC_FLAGS} -Wshadow")
     set(GXX_FLAGS "-std=c++11 ${GCC_FLAGS}")
     set(GCC_FLAGS "${GCC_FLAGS} -std=c11 -Wstrict-prototypes -Wmissing-prototypes")


Made the build output less verbose.

Made the build output less verbose.

--- cmake/defaults.cmake
+++ cmake/defaults.cmake
@@ -22,8 +22,7 @@
 # == Variables we'd use.
 SET(CMAKE_COLOR_MAKEFILE ON)
 SET(BUILD_SHARED_LIBRARIES ON)
-SET(CMAKE_VERBOSE_MAKEFILE ON)
-SET(BUILD_SHARED_LIBRARIES ON)
+SET(CMAKE_VERBOSE_MAKEFILE OFF)

 # == Imports we'd use.
 # Include a means of picking up the proper paths on a machine.)


Silence MSVC build alignment warnings

Silence MSVC build alignment warnings

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -304,7 +304,15 @@
     -wd4611 # Suppress 'interaction between '_setjmp' and C++ object destruction is non-portable'
     -wd4805 # Suppress 'unsafe mix of type <type> and type <type> in operation'
     -wd4204 # Suppress 'nonstandard extension used : non-constant aggregate initializer'
-
+
+	# Idelly, we'd like this warning to be enabled, but MSVC 2013 doesn't
+	# support the 'aligned' attribute in the way that clang sources requires (for
+	# any code that uses the LLVM_ALIGNAS marco), so this is must be disabled to
+	# avoid unwanted alignment warnings.
+	# When we switch to requiring a version of MSVC that supports the 'alignas'
+	# specifier (MSVC 2015?) this warning can be re-enabled.
+    -wd4324 # Suppress 'structure was padded due to __declspec(align())'
+
     # Promoted warnings.
     -w14062 # Promote 'enumerator in switch of enum is not handled' to level 1 warning.


[CMake] Fix accidentally swapped input/output parameters of string(REPLACE) for mingw

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -452,7 +452,7 @@
    if (CYGWIN OR MINGW)
       # MinGW and Cygwin are a bit stricter and lack things like
       # 'strdup', 'stricmp', etc in c++11 mode.
-      string(REPLACE "c++" "gnu++" "${LLVM_CXX_STD}" gnu_LLVM_CXX_STD)
+      string(REPLACE "c++" "gnu++" gnu_LLVM_CXX_STD "${LLVM_CXX_STD}")
       append("-std=${gnu_LLVM_CXX_STD}" CMAKE_CXX_FLAGS)
     else()
       append("-std=${LLVM_CXX_STD}" CMAKE_CXX_FLAGS)


Undo partially the changes for dealing with $prefix (CMake)

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -425,6 +425,14 @@

 #---Especial definitions for root-config et al.--------------------------------------------------------------
+if(prefix STREQUAL "$(ROOTSYS)")
+  set(prefix $ROOTSYS)
+  set(bindir $ROOTSYS/bin)
+  set(libdir $ROOTSYS/lib)
+  set(incdir $ROOTSYS/include)
+  set(etcdir $ROOTSYS/etc)
+  set(mandir $ROOTSYS/man/man1)
+endif()
 configure_file(${CMAKE_SOURCE_DIR}/config/root-config.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/root-config @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/memprobe.in ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/memprobe @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/thisroot.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisroot.sh @ONLY)


build: special case Windows ARM target

build: special case Windows ARM target

Windows ARM NT (the modern, non-Windows CE environment) is a pure thumb2
environment.  The frontend does not canonicalise the target like in
clang.  Ensure that we map the triple by hand to the desired target
triple.

--- cmake/modules/SwiftConfigureSDK.cmake
+++ cmake/modules/SwiftConfigureSDK.cmake
@@ -179,8 +179,13 @@
   set(SWIFT_SDK_${prefix}_OBJECT_FORMAT "COFF")

   foreach(arch ${architectures})
-    set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
-        "${arch}-unknown-windows-${environment}")
+    if(arch STREQUAL armv7)
+      set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
+          "thumbv7-unknown-windows-${environment}")
+    else()
+      set(SWIFT_SDK_${prefix}_ARCH_${arch}_TRIPLE
+          "${arch}-unknown-windows-${environment}")
+    endif()
   endforeach()

   # Add this to the list of known SDKs.


Removed unused include.

Removed unused include.

--- cmake/modules/hunter_cmake_args.cmake
+++ cmake/modules/hunter_cmake_args.cmake
@@ -5,7 +5,7 @@
 include(CMakeParseArguments) # cmake_parse_arguments

 include(hunter_fatal_error)
-include(hunter_unsetvar)
+

 # internal variables: _hunter_c_*
 macro(hunter_cmake_args)


Visual Studio 15 2017: Fix vcvarsall location

--- cmake/modules/hunter_setup_msvc.cmake
+++ cmake/modules/hunter_setup_msvc.cmake
@@ -131,6 +131,11 @@
       endif()
     else()
       set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/../../VC")
+      if(NOT HUNTER_MSVC_VERSION VERSION_LESS "15")
+        # Visual Studio 15 2017+
+        # * https://github.com/ruslo/hunter/issues/836#issue-236352343
+        set(_hunter_vcvarsall_path "${_hunter_vcvarsall_path}/Auxiliary/Build")
+      endif()
     endif()

     get_filename_component(


ARROW-7353: [C++] Ignore -Wmissing-braces when building with clang

This warning fails CHECKIN builds with clang (I observed it with Xcode 8.3.3), it's disabled in `-Wall` for gcc precisely due to spurious warnings with `std::array` https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25137

Closes #5995 from wesm/ARROW-7353 and squashes the following commits:

85b3effc5 <Wes McKinney> Ignore -Wmissing-braces in clang

Authored-by: Wes McKinney <3be70eed0275ec2606f002bff3514252e145d204@apache.org>
Signed-off-by: Sutou Kouhei <73218711cdd5d5c30ac66da3cc4d9d9204caf34b@clear-code.com>

--- cpp/cmake_modules/SetupCxxFlags.cmake
+++ cpp/cmake_modules/SetupCxxFlags.cmake
@@ -146,6 +146,7 @@
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wall")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wextra")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wdocumentation")
+    set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-missing-braces")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unused-parameter")
     set(CXX_COMMON_FLAGS "${CXX_COMMON_FLAGS} -Wno-unknown-warning-option")
   elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")


New version: 0.4.13

New version: 0.4.13

--- hawkey/VERSION.cmake
+++ hawkey/VERSION.cmake
@@ -1,3 +1,3 @@
 SET(HAWKEY_MAJOR "0")
 SET(HAWKEY_MINOR "4")
-SET(HAWKEY_PATCH "12")
+SET(HAWKEY_PATCH "13")


#1476 - Fix applied to avoid force inline when using gcc 4.4.1 or above

git-svn-id: f70d4c833b20674991d6651a5f592bbdbe6b47b2@9036 30ced1d1-d8fb-0310-b896-84269ee58dd6

--- CMake/CMakeExternals/OPENIGTLINK.cmake
+++ CMake/CMakeExternals/OPENIGTLINK.cmake
@@ -34,7 +34,7 @@

 IF(NOT DEFINED OpenIGTLink_DIR)

-    SET(revision_tag 64e12e1eb6)
+    SET(revision_tag e368df776c)
     IF(${proj}_REVISION_TAG)
         SET(revision_tag ${${proj}_REVISION_TAG})
     ENDIF()


Bump TubeTK: fixing tortuosity multiple vessels crash

--- CMake/Superbuild/External_TubeTK.cmake
+++ CMake/Superbuild/External_TubeTK.cmake
@@ -45,7 +45,7 @@
     SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
     BINARY_DIR ${${proj}_DIR}
     GIT_REPOSITORY "https://github.com/KitwareMedical/TubeTK.git"
-    GIT_TAG "e38fb74b49fbf9559aecb57e11506c97514e7346"
+    GIT_TAG "4f905cd2348d259d3ec0af3651838eb8e64e9c59"
     CMAKE_CACHE_ARGS
       -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
       -DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags}


pgmlink.cmake: Explicitly specify python directories.

--- pgmlink.cmake
+++ pgmlink.cmake
@@ -17,6 +17,7 @@
 include (boost)
 include (opengm)
 include (dlib)
+include (python)

 if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     # need other branch on macos
@@ -50,6 +51,8 @@
         -DWITH_PYTHON=ON
         -DWITH_TESTS=ON
         -DWITH_CHECKED_STL=OFF
+        -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_PATH}
+        -DPYTHON_LIBRARY=${PYTHON_LIBRARY_FILE}
         ${CMAKE_CPLEX_ROOT_DIR}

     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make


Update OMNI related install path

Update OMNI related install path

--- properties.cmake
+++ properties.cmake
@@ -36,7 +36,7 @@
 # OMNI Compiler variables
 #
 set(OMNI_HOME "${CMAKE_INSTALL_PREFIX}")
-set(OMNI_CLASSPATH "${OMNI_HOME}/share/xcalablemp")
+set(OMNI_CLASSPATH "${OMNI_HOME}/share")
 set(OMNI_DRIVER_DIR "${OMNI_HOME}/libexec")
 set(OMNI_INCLUDE_DIR "${OMNI_HOME}/include")
 set(OMNI_XMOD_GENERIC "${OMNI_HOME}/fincludes")


Don't try to remove rpath entries on Windows.

--- CMake/mitkMacroInstallHelperApp.cmake
+++ CMake/mitkMacroInstallHelperApp.cmake
@@ -59,7 +59,7 @@
       SET(${_target_locations}_qt_plugins_install_dir bin)
       SET(_qt_conf_install_dirs bin)
       INSTALL(PROGRAMS ${_target} DESTINATION bin)
-      IF(UNIX)
+      IF(UNIX AND NOT WIN32)
         # Remove the rpath from helper applications. We assume that all dependencies
         # are installed into the same location as the helper application.
         INSTALL(CODE "FILE(RPATH_REMOVE


Update name of configure options file

Update name of configure options file

--- CI/main_superbuild.cmake
+++ CI/main_superbuild.cmake
@@ -110,7 +110,7 @@
 set ( PROJECT_SOURCE_DIR "${OTB_SOURCE_DIR}" )

 set (CONFIGURE_OPTIONS  "")
-include ( "${CMAKE_CURRENT_LIST_DIR}/configure_option.cmake" )
+include ( "${CMAKE_CURRENT_LIST_DIR}/configure_options.cmake" )
 # SuperBuild case : one more configure option
 set ( CONFIGURE_OPTIONS
   "${CONFIGURE_OPTIONS}-DCMAKE_PREFIX_PATH=${XDK_PATH};")


CMake: do not add sub-dependencies to list of features

--- CMake/Dependencies.cmake
+++ CMake/Dependencies.cmake
@@ -95,7 +95,6 @@
 if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN)
   find_package(X11)
   macro_log_feature(X11_FOUND "X11" "X Window system" "http://www.x.org" TRUE "" "")
-  macro_log_feature(X11_Xt_FOUND "Xt" "X Toolkit" "http://www.x.org" TRUE "" "")
   find_library(XAW_LIBRARY NAMES Xaw Xaw7 PATHS ${OGRE_DEP_SEARCH_PATH} ${DEP_LIB_SEARCH_DIR} ${X11_LIB_SEARCH_PATH})
   macro_log_feature(XAW_LIBRARY "Xaw" "X11 Athena widget set" "http://www.x.org" TRUE "" "")
   mark_as_advanced(XAW_LIBRARY)
@@ -209,15 +208,16 @@

 # Optional Boost libs (Boost_${COMPONENT}_FOUND
 macro_log_feature(Boost_FOUND "boost" "Boost (general)" "http://boost.org" FALSE "" "")
+if(NOT Boost_DATE_TIME_FOUND)
+    set(Boost_THREAD_FOUND FALSE)
+endif()
+if(Boost_VERSION GREATER 104900 AND (NOT Boost_SYSTEM_FOUND OR NOT Boost_CHRONO_FOUND))
+    set(Boost_THREAD_FOUND FALSE)
+endif()
+if(Boost_VERSION GREATER 105300 AND NOT Boost_ATOMIC_FOUND)
+    set(Boost_THREAD_FOUND FALSE)
+endif()
 macro_log_feature(Boost_THREAD_FOUND "boost-thread" "Used for threading support" "http://boost.org" FALSE "" "")
-macro_log_feature(Boost_DATE_TIME_FOUND "boost-date_time" "Used for threading support" "http://boost.org" FALSE "" "")
-if(Boost_VERSION GREATER 104900)
-    macro_log_feature(Boost_SYSTEM_FOUND "boost-system" "Used for threading support" "http://boost.org" FALSE "" "")
-    macro_log_feature(Boost_CHRONO_FOUND "boost-chrono" "Used for threading support" "http://boost.org" FALSE "" "")
-	if(Boost_VERSION GREATER 105300)
-		macro_log_feature(Boost_ATOMIC_FOUND "boost-atomic" "Used for threading support" "http://boost.org" FALSE "" "")
-	endif()
-endif()

 # POCO
 find_package(POCO)


Add boost 1.55

Add boost 1.55

--HG--
branch : v1-9


FIX: do set the library output dir for Windows

--- CMakeLists.windows.cmake
+++ CMakeLists.windows.cmake
@@ -1,3 +1,4 @@
+set(CPP_LIBRARY_DIR "lib")
 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/target/bin)
 set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/target/lib)
 set (CTEST_BINARY_DIRECTORY ${CMAKE_BINARY_DIR}/target/lib)


Fixing some issues with 'source_path' and xcode

--- Resources/CMake/MXA_CMakeMacros.cmake
+++ Resources/CMake/MXA_CMakeMacros.cmake
@@ -6,8 +6,10 @@
               COMPONENT Headers
   )

-  source_group(src\\${NAME} FILES ${HEADERS} ${SOURCES})
-
+    set(source_group_path "Source/MXA/${NAME}")
+    STRING(REPLACE "/" "\\\\" source_group_path ${source_group_path}  )
+    source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})
+
   #-- The following is needed if we ever start to use OS X Frameworks but only
   #--  works on CMake 2.6 and greater
   #set_property(SOURCE ${HEADERS}


Revert requirements

Revert requirements

--- cmake/Qt5Widgets_HunterPlugin_5_5.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_5.cmake
@@ -216,7 +216,7 @@
   )

   # defined: '_glBindBuffer'
-  # _qt_cmake_extra_helpers_add_interface(Qt5::Widgets Qt5::Gui_GLESv2)
+  _qt_cmake_extra_helpers_add_interface(Qt5::Widgets Qt5::Gui_GLESv2)

   # defined: '_hb_buffer_create'
   _qt_cmake_extra_helpers_add_interface_release_debug(
@@ -226,11 +226,11 @@
   )

   # defined: 'CreateTLSIndex'
-  # _qt_cmake_extra_helpers_add_interface_release_debug(
-  #      Qt5::Widgets
-  #     "${_qt_install_prefix}/lib/translator.lib"
-  #     "${_qt_install_prefix}/lib/translatord.lib"
-  # )
+  _qt_cmake_extra_helpers_add_interface_release_debug(
+       Qt5::Widgets
+      "${_qt_install_prefix}/lib/translator.lib"
+      "${_qt_install_prefix}/lib/translatord.lib"
+  )

   # defined: '_pcre16_compile2'
   _qt_cmake_extra_helpers_add_interface_release_debug(
@@ -275,11 +275,11 @@
   )

   # defined: 'pp::Preprocessor::Preprocessor'
-  # _qt_cmake_extra_helpers_add_interface_release_debug(
-  #    Qt5::Widgets
-  #    "${_qt_install_prefix}/lib/preprocessor.lib"
-  #    "${_qt_install_prefix}/lib/preprocessord.lib"
-  #)
+  _qt_cmake_extra_helpers_add_interface_release_debug(
+      Qt5::Widgets
+      "${_qt_install_prefix}/lib/preprocessor.lib"
+      "${_qt_install_prefix}/lib/preprocessord.lib"
+  )
 elseif(MINGW)
   _qt_cmake_extra_helpers_add_source(
       Qt5::Widgets


build: swap include order

build: swap include order

Visual Studio places shared above um.  Follow their ordering.

--- cmake/modules/SwiftWindowsSupport.cmake
+++ cmake/modules/SwiftWindowsSupport.cmake
@@ -37,8 +37,8 @@
   set(paths
         "$ENV{VCToolsInstallDir}/include"
         "$ENV{UniversalCRTSdkDir}/Include/$ENV{UCRTVersion}/ucrt"
-        "$ENV{UniversalCRTSdkDir}/Include/$ENV{UCRTVersion}/um"
-        "$ENV{UniversalCRTSdkDir}/Include/$ENV{UCRTVersion}/shared")
+        "$ENV{UniversalCRTSdkDir}/Include/$ENV{UCRTVersion}/shared"
+        "$ENV{UniversalCRTSdkDir}/Include/$ENV{UCRTVersion}/um")
   set(${var} ${paths} PARENT_SCOPE)
 endfunction()


Call 'hunter_upload_to_custom_server' if not GitHub

--- cmake/modules/hunter_upload_cache.cmake
+++ cmake/modules/hunter_upload_cache.cmake
@@ -8,6 +8,7 @@
 include(hunter_private_data_password)
 include(hunter_test_string_not_empty)
 include(hunter_upload_password)
+include(hunter_upload_to_custom_server)
 include(hunter_user_error)

 function(hunter_upload_cache)
@@ -37,23 +38,41 @@
   string(COMPARE EQUAL "${HUNTER_UPLOAD_USERNAME}" "" empty_username)
   string(COMPARE EQUAL "${HUNTER_UPLOAD_PASSWORD}" "" empty_password)

-  if(empty_repo_owner AND empty_repo AND empty_username AND empty_password)
+  string(COMPARE EQUAL "${HUNTER_UPLOAD_SERVER}" "" empty_server)
+  string(COMPARE EQUAL "${HUNTER_UPLOAD_SUB_SHA1_SUFFIX}" "" empty_sub_sha1_suffix)
+  string(COMPARE EQUAL "${HUNTER_UPLOAD_HTTPHEADER}" "" empty_httpheader)
+
+  if(
+      empty_repo_owner
+      AND empty_repo
+      AND empty_username
+      AND empty_password
+      AND empty_server
+      AND empty_sub_sha1_suffix
+      AND empty_httpheader
+  )
     hunter_user_error(
         "Upload parameters are empty, 'hunter_upload_password' is missing?"
     )
   endif()

-  if(empty_repo_owner)
-    hunter_user_error("Upload: REPO_OWNER is missing")
-  endif()
-  if(empty_repo)
-    hunter_user_error("Upload: REPO is missing")
-  endif()
-  if(empty_username)
-    hunter_user_error("Upload: USERNAME is missing")
-  endif()
-  if(empty_password)
-    hunter_user_error("Upload: PASSWORD is missing")
+  if(empty_server)
+    if(empty_repo_owner)
+      hunter_user_error("Upload: REPO_OWNER is missing")
+    endif()
+    if(empty_repo)
+      hunter_user_error("Upload: REPO is missing")
+    endif()
+    if(empty_username)
+      hunter_user_error("Upload: USERNAME is missing")
+    endif()
+    if(empty_password)
+      hunter_user_error("Upload: PASSWORD is missing")
+    endif()
+  else()
+    hunter_upload_to_custom_server()
+    file(REMOVE_RECURSE "${HUNTER_PACKAGE_BUILD_DIR}")
+    return()
   endif()

   # Run isolated script to aviod cross-compiling issues and


Fix PCH build with Clang

Fix PCH build with Clang

Clang doesn't use include path (-I) when looking for PCH files.  Use full path to header instead.  Tested on Ninja and Make builds using GCC and Clang.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -661,7 +661,7 @@
                 if (FILE MATCHES \\.cpp$)
                     get_property (NO_PCH SOURCE ${FILE} PROPERTY NO_PCH)
                     if (NOT NO_PCH)
-                        set_property (SOURCE ${FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -include ${HEADER_FILENAME}")
+                        set_property (SOURCE ${FILE} APPEND_STRING PROPERTY COMPILE_FLAGS " -include ${CMAKE_CURRENT_BINARY_DIR}/${HEADER_FILENAME}")
                     endif ()
                 endif ()
             endforeach ()
@@ -680,14 +680,6 @@
                 set (TRIGGERS ${HEADER_FILENAME}.${CMAKE_BUILD_TYPE}.pch.trigger)
             endif ()
             list (APPEND SOURCE_FILES ${TRIGGERS})
-            # Ninja-build specific
-            if (CMAKE_GENERATOR STREQUAL Ninja)
-                # The precompiled header is always generated in the current binary dir,
-                # but Ninja project is not able to find it without adding the binary dir to the include search path
-                # FIXME: below quick fix may have negatively impacted ccache from perfoming correctly in Ninja
-                #        ccache increases the 'preprocessor error' stat count and fallbacks to perform the actual compilation which slows down the build unnecessarily
-                list (APPEND INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR})
-            endif ()
         endif ()
     endif ()
 endmacro ()


Adding a new file to use for projects needing to include the MXADataModel source code


more small tweaks to compiler check

more small tweaks to compiler check

git-svn-id: cf55bc44fb097054a32fc70455a459c940dbbffc@6949 c9849af7-e679-4ec6-a44e-fc146a885bd3

--- cmake/mex.cmake
+++ cmake/mex.cmake
@@ -170,25 +170,26 @@

 endfunction()

-# calls compilers with -v option and checks the output
-# (on stderr, since that seems to be the way at least gcc and clang work)
+# calls compilers with --version option and checks the output
 # returns TRUE if the strings match or FALSE if they don't.
 #   (note: you can use  if (outvar) to test )
 # this seems to be a more robust and less complex method than trying to call xcrun -find, readlink to follow symlinks, etc.
 function(compare_compilers outvar compiler1 compiler2)

   separate_arguments(c1_args UNIX_COMMAND ${compiler1})
-  list(APPEND c1_args "-v")
-  execute_process(COMMAND ${c1_args} ERROR_VARIABLE c1_ver ERROR_STRIP_TRAILING_WHITESPACE)
+  list(APPEND c1_args "--version")
+  execute_process(COMMAND ${c1_args} OUTPUT_VARIABLE c1_ver OUTPUT_STRIP_TRAILING_WHITESPACE)

   separate_arguments(c2_args UNIX_COMMAND ${compiler2})
-  list(APPEND c2_args "-v")
-  execute_process(COMMAND ${c2_args} ERROR_VARIABLE c2_ver ERROR_STRIP_TRAILING_WHITESPACE)
-
-  if (c1_ver AND c2_ver AND ${c1_ver} STREQUAL ${c2_ver})
+  list(APPEND c2_args "--version")
+  execute_process(COMMAND ${c2_args} OUTPUT_VARIABLE c2_ver OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+  if (c1_ver AND c2_ver AND "${c1_ver}" STREQUAL "${c2_ver}")
     set(${outvar} TRUE PARENT_SCOPE)
   else()
     set(${outvar} FALSE PARENT_SCOPE)
+    message(STATUS "compiler1 version string:\n${c1_ver}")
+    message(STATUS "compiler2 version string:\n${c2_ver}")
   endif()

 endfunction()
@@ -198,12 +199,12 @@

 compare_compilers(compilers_match "${MEX_CC}" "${CMAKE_C_COMPILER}")
 if (NOT compilers_match)
-   message(WARNING "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
+   message(FATAL_ERROR "Your cmake C compiler is: ${CMAKE_C_COMPILER} but your mex options use: ${MEX_CC} .  Consider rerunning 'mex -setup' in  Matlab.")
 endif()

 compare_compilers(compilers_match ${MEX_CXX} ${CMAKE_CXX_COMPILER})
 if (NOT compilers_match)
-   message(WARNING "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
+   message(FATAL_ERROR "Your cmake CXX compiler is: ${CMAKE_CXX_COMPILER} but your mex options end up pointing to: ${MEX_CXX} .  Consider rerunning 'mex -setup' in Matlab.")
 endif()

 # NOTE:  would like to check LD also, but it appears to be difficult with cmake  (there is not explicit linker executable variable, only the make rule), and  even my mex code assumes that LD==LDCXX for simplicity.


Move bot_core_lcmtypes and kinematics-utils back to mainline

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -11,8 +11,8 @@
     )
 endif()

-set(bot_core_lcmtypes_url https://github.com/iamwolf/bot_core_lcmtypes.git)
-set(bot_core_lcmtypes_revision 023387b1dc071155f898cca5730cad9b88ec6925)
+set(bot_core_lcmtypes_url https://github.com/openhumanoids/bot_core_lcmtypes.git)
+set(bot_core_lcmtypes_revision e873dd4c088fddbbcec88d64fa8aa4bb278d361c)
 set(bot_core_lcmtypes_depends ${lcm_proj})

 set(libbot_url https://github.com/openhumanoids/libbot.git)
@@ -165,8 +165,8 @@
 set(pypolyhedron_revision 1f110addf89398f62644830bf69a69930db8c4d0)
 set(pypolyhedron_depends)

-set(kinematics-utils_url https://github.com/iamwolf/kinematics-utils.git)
-set(kinematics-utils_revision 0558a4bd0295e3f2285c06c1b7770767bff85390)
+set(kinematics-utils_url https://github.com/ipab-slmc/kinematics-utils.git)
+set(kinematics-utils_revision 123169c091d0160e80de31ddc31efcefbb413fd6)
 set(kinematics-utils_depends Eigen_pod)

 set(libmultisense_url https://bitbucket.org/crl/libmultisense)


move pcl_drc pod svn revision forward to get pcl compile fix

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -16,7 +16,7 @@
 set(pcl_dep_depends)

 set(pcl_drc_url https://svn.csail.mit.edu/drc/trunk/software/externals/pcl_drc)
-set(pcl_drc_revision 8298)
+set(pcl_drc_revision 8326)
 set(pcl_drc_depends Eigen_pod pcl_dep)

 set(octomap-drc_url https://svn.csail.mit.edu/drc/trunk/software/externals/octomap-drc)


ENH: Change "homepage" and icon for DTIProcess built as a Slicer extension

--- Common.cmake
+++ Common.cmake
@@ -42,11 +42,11 @@

 #-----------------------------------------------------------------------------
 set(EXTENSION_NAME DTIProcess)
-set(EXTENSION_HOMEPAGE "http://www.slicer.org/slicerWiki/index.php/Documentation/4.2/Extensions/DTIProcess")
+set(EXTENSION_HOMEPAGE "http://www.nitrc.org/projects/dtiprocess")
 set(EXTENSION_CATEGORY "Diffusion")
 set(EXTENSION_CONTRIBUTORS "Francois Budin (UNC)")
 set(EXTENSION_DESCRIPTION "This extension provides the tool DTIProcess integrated in Slicer")
-set(EXTENSION_ICONURL "http://www.nitrc.org/project/screenshot.php?group_id=312&screenshot_id=575")
+set(EXTENSION_ICONURL "http://www.nitrc.org/project/screenshot.php?group_id=312&screenshot_id=771")
 set(EXTENSION_SCREENSHOTURLS "http://www.slicer.org/slicerWiki/images/thumb/b/b8/DTIEstim-B0-crop.png/193px-DTIEstim-B0-crop.png http://www.slicer.org/slicerWiki/images/thumb/9/90/FiberTrack-fibers.png/138px-FiberTrack-fibers.png")
 set(EXTENSION_STATUS "Beta")
 set(EXTENSION_DEPENDS "NA") # Specified as a space separated list or 'NA' if any


Fix some issues in installed_test (#5120)

`TEST_TMPDIR` was being set based on an undefined variable `_NAME`,
which I guess we maybe happened to set in every invocation of this
function or something.

`WORKING_DIRECTORY` was being set twice in the invocation of `add_test`
and I think ignoring the argument being passed. It also was being set
to `CMAKE_BINARY_DIR` by default, which is different than the default
specified for `add_test`, which seemed weird, since that behavior
wasn't mentioned anywhere.

I hate CMake.

--- build_tools/cmake/iree_installed_test.cmake
+++ build_tools/cmake/iree_installed_test.cmake
@@ -36,20 +36,39 @@
     ${ARGN}
   )

+
   add_test(
-    NAME ${_RULE_TEST_NAME}
-    WORKING_DIRECTORY ${_RULE_WORKING_DIRECTORY}
+    NAME
+      ${_RULE_TEST_NAME}
     COMMAND
-        ${_RULE_COMMAND}
-    WORKING_DIRECTORY
-        "${CMAKE_BINARY_DIR}"
+      ${_RULE_COMMAND}
   )
-  set_property(TEST ${_RULE_TEST_NAME} PROPERTY LABELS "${_RULE_LABELS}")
-  set_property(TEST ${_RULE_TEST_NAME} PROPERTY ENVIRONMENT "TEST_TMPDIR=${CMAKE_BINARY_DIR}/${_NAME}_test_tmpdir" ${_RULE_ENVIRONMENT})
+  if (DEFINED _RULE_WORKING_DIRECTORY)
+    set_property(
+      TEST
+        ${_RULE_TEST_NAME}
+      PROPERTY WORKING_DIRECTORY
+        "${_RULE_WORKING_DIRECTORY}"
+    )
+  endif()
+  set_property(
+    TEST
+      ${_RULE_TEST_NAME}
+    PROPERTY LABELS
+      "${_RULE_LABELS}"
+  )
+  set_property(
+    TEST
+      ${_RULE_TEST_NAME}
+    PROPERTY ENVIRONMENT
+      "TEST_TMPDIR=${CMAKE_BINARY_DIR}/${_RULE_TEST_NAME}_test_tmpdir"
+      ${_RULE_ENVIRONMENT}
+  )
   iree_add_test_environment_properties(${_RULE_TEST_NAME})

   # Write the to the installed ctest file template.
-  set(_installed_ctest_input_file "${CMAKE_BINARY_DIR}/iree_installed_tests.cmake.in")
+  set(_installed_ctest_input_file
+        "${CMAKE_BINARY_DIR}/iree_installed_tests.cmake.in")
   get_property(_has_tests GLOBAL PROPERTY IREE_HAS_INSTALLED_TESTS)
   if(NOT _has_tests)
     # First time.


BUG: Update External_Cppcheck.cmake

BUG: Update External_Cppcheck.cmake

--- CMake/Superbuild/External_Cppcheck.cmake
+++ CMake/Superbuild/External_Cppcheck.cmake
@@ -59,7 +59,6 @@
     LOG_BUILD 0
     LOG_TEST 0
     LOG_INSTALL 0
-    CMAKE_GENERATOR ${gen}
     CONFIGURE_COMMAND ""
     BUILD_COMMAND HAVE_RULES=no CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_MAKE_PROGRAM}
     INSTALL_COMMAND HAVE_RULES=no PREFIX=${${proj}_DIR} ${CMAKE_MAKE_PROGRAM} install


fixes missing glfw with AF_BUILD_FORGE

fixes missing glfw with AF_BUILD_FORGE

--- CMakeModules/AFconfigure_forge_dep.cmake
+++ CMakeModules/AFconfigure_forge_dep.cmake
@@ -8,34 +8,16 @@
 set(FG_VERSION_MAJOR 1)
 set(FG_VERSION_MINOR 0)
 set(FG_VERSION_PATCH 8)
+set(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
+set(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})

-find_package(Forge
-  ${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}
-  QUIET
-)

-if(TARGET Forge::forge)
-  get_target_property(fg_lib_type Forge::forge TYPE)
-  if(NOT ${fg_lib_type} STREQUAL "STATIC_LIBRARY")
-      install(FILES
-          $<TARGET_FILE:Forge::forge>
-          $<$<PLATFORM_ID:Linux>:$<TARGET_SONAME_FILE:Forge::forge>>
-          $<$<PLATFORM_ID:Darwin>:$<TARGET_SONAME_FILE:Forge::forge>>
-          $<$<PLATFORM_ID:Linux>:$<TARGET_LINKER_FILE:Forge::forge>>
-          $<$<PLATFORM_ID:Darwin>:$<TARGET_LINKER_FILE:Forge::forge>>
-          DESTINATION "${AF_INSTALL_LIB_DIR}"
-          COMPONENT common_backend_dependencies)
-  endif()
-else()
-  set(FG_VERSION "${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}")
-  set(FG_API_VERSION_CURRENT ${FG_VERSION_MAJOR}${FG_VERSION_MINOR})
+if(AF_BUILD_FORGE)
+    af_dep_check_and_populate(${forge_prefix}
+        URI https://github.com/arrayfire/forge.git
+        REF "v${FG_VERSION}"
+    )

-  af_dep_check_and_populate(${forge_prefix}
-    URI https://github.com/arrayfire/forge.git
-    REF "v${FG_VERSION}"
-  )
-
-  if(AF_BUILD_FORGE)
     set(af_FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR})
     set(af_FETCHCONTENT_QUIET ${FETCHCONTENT_QUIET})
     set(af_FETCHCONTENT_FULLY_DISCONNECTED ${FETCHCONTENT_FULLY_DISCONNECTED})
@@ -67,9 +49,9 @@
     set(FETCHCONTENT_QUIET ${af_FETCHCONTENT_QUIET})
     set(FETCHCONTENT_FULLY_DISCONNECTED ${af_FETCHCONTENT_FULLY_DISCONNECTED})
     set(FETCHCONTENT_UPDATES_DISCONNECTED ${af_FETCHCONTENT_UPDATES_DISCONNECTED})
-
     install(FILES
         $<TARGET_FILE:forge>
+        $<TARGET_RUNTIME_DLLS:forge>
         $<$<PLATFORM_ID:Linux>:$<TARGET_SONAME_FILE:forge>>
         $<$<PLATFORM_ID:Darwin>:$<TARGET_SONAME_FILE:forge>>
         $<$<PLATFORM_ID:Linux>:$<TARGET_LINKER_FILE:forge>>
@@ -77,10 +59,28 @@
         DESTINATION "${AF_INSTALL_LIB_DIR}"
         COMPONENT common_backend_dependencies)
     set_property(TARGET forge APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
-  else(AF_BUILD_FORGE)
-    configure_file(
-      ${${forge_prefix}_SOURCE_DIR}/CMakeModules/version.h.in
-      ${${forge_prefix}_BINARY_DIR}/include/fg/version.h
-      )
-  endif(AF_BUILD_FORGE)
-endif()
+else(AF_BUILD_FORGE)
+    find_package(Forge
+	    ${FG_VERSION_MAJOR}.${FG_VERSION_MINOR}.${FG_VERSION_PATCH}
+	    QUIET
+    )
+
+    if(TARGET Forge::forge)
+        get_target_property(fg_lib_type Forge::forge TYPE)
+        if(NOT ${fg_lib_type} STREQUAL "STATIC_LIBRARY")
+            install(FILES
+                    $<TARGET_FILE:Forge::forge>
+                    $<$<PLATFORM_ID:Linux>:$<TARGET_SONAME_FILE:Forge::forge>>
+                    $<$<PLATFORM_ID:Darwin>:$<TARGET_SONAME_FILE:Forge::forge>>
+                    $<$<PLATFORM_ID:Linux>:$<TARGET_LINKER_FILE:Forge::forge>>
+                    $<$<PLATFORM_ID:Darwin>:$<TARGET_LINKER_FILE:Forge::forge>>
+                    DESTINATION "${AF_INSTALL_LIB_DIR}"
+                    COMPONENT common_backend_dependencies)
+        endif()
+    else()
+        configure_file(
+		  ${${forge_prefix}_SOURCE_DIR}/CMakeModules/version.h.in
+		  ${${forge_prefix}_BINARY_DIR}/include/fg/version.h
+		  )
+    endif()
+endif(AF_BUILD_FORGE)


Make embedded opencl-c.h an array of characters

This is a workaround for MSVC having a limit of 65535 characters for
any single string literal.

--- src/core/gen_opencl-c.h.cmake
+++ src/core/gen_opencl-c.h.cmake
@@ -1,11 +1,14 @@
 set(OUTPUT src/core/opencl-c.h.cpp)

-file(WRITE ${OUTPUT} "extern const char OPENCL_C_H_DATA[] = \n\"")
+# Load opencl-c.h
+file(READ ${SOURCE_FILE} OPENCL_C_H)

-file(READ ${SOURCE_FILE} OPENCL_C_H)
-string(REGEX REPLACE "\\\\" "\\\\\\\\" OPENCL_C_H "${OPENCL_C_H}")
-string(REGEX REPLACE "\"" "\\\\\"" OPENCL_C_H "${OPENCL_C_H}")
-string(REGEX REPLACE "\n" "\\\\n\"\n\"" OPENCL_C_H "${OPENCL_C_H}")
-file(APPEND ${OUTPUT} "${OPENCL_C_H}")
+# Replace each character with a C character literal, escaping as necessary
+string(REGEX REPLACE "(.)" "'\\1', " CONTENT "${OPENCL_C_H}")
+string(REGEX REPLACE "\n'" "\\\\n'\n" CONTENT "${CONTENT}")
+string(REGEX REPLACE "\\\\'" "\\\\\\\\'" CONTENT "${CONTENT}")

-file(APPEND ${OUTPUT} "\";")
+# Write character array
+file(WRITE ${OUTPUT} "extern const char OPENCL_C_H_DATA[] = {\n")
+file(APPEND ${OUTPUT} "${CONTENT}")
+file(APPEND ${OUTPUT} "};\n")


Split off 7.10.52

Split off 7.10.52

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

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


Better fallback handling.

Better fallback handling.

--- version.cmake
+++ version.cmake
@@ -1,6 +1,7 @@
 find_package(Git)

 set(GIT_DESCRIBE_EXIT 1)
+set(MBC_VERSION "")

 if (GIT_FOUND)
 	execute_process(
@@ -11,12 +12,12 @@
 	)
 endif()

-if(NOT GIT_DESCRIBE_EXIT EQUAL 0)
-	if (EXISTS ${ROOT}/VERSION)
-		file(STRINGS ${ROOT}/VERSION MBC_VERSION LIMIT_COUNT 1)
-	else()
-		set(MBC_VERSION "(unknown version)")
-	endif()
+if((NOT GIT_DESCRIBE_EXIT EQUAL 0) AND EXISTS ${ROOT}/VERSION)
+	file(STRINGS ${ROOT}/VERSION MBC_VERSION LIMIT_COUNT 1)
+endif()
+
+if(MBC_VERSION STREQUAL "")
+	set(MBC_VERSION "(unknown version)")
 endif()

@@ -43,7 +44,7 @@
 )
 STRING(REGEX REPLACE  # development release (commit hash based)
 	"^([a-f0-9]+)$"
-	"git#\\1"
+	"#git-\\1"
 	MBC_VERSION "${MBC_VERSION}"
 )


Allow for EXTRA_DEPENDS parameter to module tests

This extra parameter allows defining additional modules
as include and link dependencies. Such dependencies are
useful, when test data generation is available through
dedicated modules, which shall not be part of the actual
release/non-testing version of a product

--- CMake/mitkMacroCreateModuleTests.cmake
+++ CMake/mitkMacroCreateModuleTests.cmake
@@ -7,7 +7,7 @@
 #
 macro(MITK_CREATE_MODULE_TESTS)
   MACRO_PARSE_ARGUMENTS(MODULE_TEST
-                        "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE" "" ${ARGN})
+                        "EXTRA_DRIVER_INIT;EXTRA_DRIVER_INCLUDE;EXTRA_DEPENDS" "" ${ARGN})

   if(BUILD_TESTING AND MODULE_IS_ENABLED)
     set(OLD_MOC_H_FILES ${MOC_H_FILES})
@@ -18,6 +18,11 @@
     if(DEFINED MOC_H_FILES)
       QT4_WRAP_CPP(MODULE_TEST_GENERATED_MOC_CPP ${MOC_H_FILES})
     endif(DEFINED MOC_H_FILES)
+
+    if (MODULE_TEST_EXTRA_DEPENDS)
+      MITK_USE_MODULE("${MODULE_TEST_EXTRA_DEPENDS}")
+      include_directories(${ALL_INCLUDE_DIRECTORIES})
+    endif()

     set(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "mitk::LoggingBackend::Register(); ${MODULE_TEST_EXTRA_DRIVER_INIT};")
     set(CMAKE_TESTDRIVER_AFTER_TESTMAIN "mitk::LoggingBackend::Unregister();")


Re-disable localhost_cluster_performance_test

PiperOrigin-RevId: 174487541

--- tensorflow/contrib/cmake/tf_tests.cmake
+++ tensorflow/contrib/cmake/tf_tests.cmake
@@ -179,17 +179,10 @@

   # exclude the ones we don't want
   set(tf_test_src_py_exclude
-    # generally excluded
+    # Not a test.
     "${tensorflow_source_dir}/tensorflow/python/kernel_tests/__init__.py"
-
-    # Python source line inspection tests are flaky on Windows (b/36375074).
-    "${tensorflow_source_dir}/tensorflow/python/debug/cli/analyzer_cli_test.py"
-    "${tensorflow_source_dir}/tensorflow/python/debug/cli/profile_analyzer_cli_test.py"
-    # Windows does not have the curses library and uses readline.
-    "${tensorflow_source_dir}/tensorflow/python/debug/cli/curses_ui_test.py"
-    # TFDBG grpc:// mode is not yet available on Windows.
-    "${tensorflow_source_dir}/tensorflow/python/debug/lib/dist_session_debug_grpc_test.py"
-    "${tensorflow_source_dir}/tensorflow/python/debug/lib/session_debug_grpc_test.py"
+    # Flaky because of port collisions.
+    "${tensorflow_source_dir}/tensorflow/python/training/localhost_cluster_performance_test.py"
     # generally not working
     "${tensorflow_source_dir}/tensorflow/python/profiler/pprof_profiler_test.py"
     # flaky test
@@ -216,7 +209,14 @@
       # TODO: failing tests.
       # Nothing critical in here but should get this list down to []
       # The failing list is grouped by failure source
-
+      # Python source line inspection tests are flaky on Windows (b/36375074).
+      "${tensorflow_source_dir}/tensorflow/python/debug/cli/analyzer_cli_test.py"
+      "${tensorflow_source_dir}/tensorflow/python/debug/cli/profile_analyzer_cli_test.py"
+      # Windows does not have the curses library and uses readline.
+      "${tensorflow_source_dir}/tensorflow/python/debug/cli/curses_ui_test.py"
+      # TFDBG grpc:// mode is not yet available on Windows.
+      "${tensorflow_source_dir}/tensorflow/python/debug/lib/dist_session_debug_grpc_test.py"
+      "${tensorflow_source_dir}/tensorflow/python/debug/lib/session_debug_grpc_test.py"
       # stl on windows handles overflows different
       "${tensorflow_source_dir}/tensorflow/python/kernel_tests/as_string_op_test.py"
       "${tensorflow_source_dir}/tensorflow/python/kernel_tests/string_to_number_op_test.py"


update(build): force using libs-bundled luajit.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>

Co-authored-by: Leonardo Grasso <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@leonardograsso.com>

--- cmake/modules/falcosecurity-libs.cmake
+++ cmake/modules/falcosecurity-libs.cmake
@@ -60,6 +60,7 @@
 set(USE_BUNDLED_TBB ON CACHE BOOL "")
 set(USE_BUNDLED_B64 ON CACHE BOOL "")
 set(USE_BUNDLED_JSONCPP ON CACHE BOOL "")
+set(USE_BUNDLED_LUAJIT ON CACHE BOOL "")

 list(APPEND CMAKE_MODULE_PATH "${FALCOSECURITY_LIBS_SOURCE_DIR}/cmake/modules")


ENH: allow custom installation prefix even for non self-contained installation.

--- cmake/sara_installation_settings.cmake
+++ cmake/sara_installation_settings.cmake
@@ -3,9 +3,7 @@
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

-if (SARA_SELF_CONTAINED_INSTALLATION)
-  set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
-endif ()
+set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})

 # Install the sources.


[Config] Added other versions of Python

[Config] Added other versions of Python

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -606,7 +606,7 @@
   set (Boost_USE_STATIC_RUNTIME OFF)
   set (BOOST_REQUIRED_COMPONENTS_FOR_LIB
     date_time random iostreams serialization filesystem system
-	locale python27 python34 regex)
+	locale python python27 python34 python37 regex)
   set (BOOST_REQUIRED_COMPONENTS_FOR_BIN program_options)
   set (BOOST_REQUIRED_COMPONENTS_FOR_TST unit_test_framework)
   set (BOOST_REQUIRED_COMPONENTS ${BOOST_REQUIRED_COMPONENTS_FOR_LIB}


allow lack of c++11 to be not fatal

allow lack of c++11 to be not fatal

--- common.cmake
+++ common.cmake
@@ -47,7 +47,7 @@
 elseif(${CMAKE_MAKE_PROGRAM} MATCHES "(msdev|devenv|nmake|MSBuild)")
     add_definitions("/W2")
 else ()
-    message(FATAL_ERROR "Your C++ compiler does not support C++11.")
+    message("Your C++ compiler does not support C++11.")
 endif ()


fix LaunchServices database search under OS X

--- CMake/Mathematica/FindMathematica.cmake
+++ CMake/Mathematica/FindMathematica.cmake
@@ -355,7 +355,7 @@
 		foreach (_bundleID IN ITEMS ${ARGN})
 			execute_process(
 				COMMAND "${Mathematica_LSRegister_EXECUTABLE}" "-dump"
-				COMMAND "grep" "--before-context=5" "--after-context=5" " ${_bundleID} "
+				COMMAND "grep" "--before-context=12" "--after-context=12" " ${_bundleID} "
 				COMMAND "grep" "--only-matching" "/.*\\.app"
 				TIMEOUT 10 OUTPUT_VARIABLE _queryResult ERROR_QUIET)
 			string (REPLACE ";" "\\;" _queryResult "${_queryResult}")
@@ -364,6 +364,8 @@
 				# put paths into canonical order
 				list (SORT _appPaths)
 				list (REVERSE _appPaths)
+			else()
+				message (STATUS "No Mathematica apps registered in Mac OS X LaunchServices database.")
 			endif()
 			if (Mathematica_DEBUG)
 				message (STATUS "Mac OS X LaunchServices database registered apps=${_appPaths}")
@@ -1441,6 +1443,7 @@
 		if (Mathematica_DEBUG)
 			message (STATUS "SearchPaths ${_SearchPaths}")
 			message (STATUS "ProgramNames ${_ProgramNames}")
+			message (STATUS "KernelExecutables ${_KernelExecutables}")
 		endif()
 		find_path (Mathematica_HOST_ROOT_DIR
 			NAMES ${_KernelExecutables}


Revert "Still more refactoring"

Revert "Still more refactoring"

This reverts commit 6fdc0e9ba60123bee2e87642043fb0ffdc88b07c [formerly 53e606d492372cacd0f1fc4bcce107f096ede485].

Former-commit-id: 1279dc4d99f75fe4840e63182a599d9c96ce94ec

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -20,24 +20,6 @@
   endif()
 endfunction()

-function(halide_generator_add_exec_generator_target EXEC_TARGET)
-  set(options )
-  set(oneValueArgs GENERATOR_TARGET GENFILES_DIR)
-  set(multiValueArgs OUTPUTS GENERATOR_ARGS)
-  cmake_parse_arguments(args "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
-
-  halide_generator_get_exec_path(${args_GENERATOR_TARGET} EXEC_PATH)
-
-  add_custom_command(
-    OUTPUT "${args_OUTPUTS}"
-    DEPENDS "${GENERATOR_TARGET}"
-    COMMAND "${EXEC_PATH}" ${args_GENERATOR_ARGS}
-    WORKING_DIRECTORY "${GENFILES_DIR}"
-  )
-  set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
-  add_custom_target(${EXEC_TARGET} DEPENDS "${args_DEPENDS}")
-  set_target_properties(${EXEC_TARGET} PROPERTIES FOLDER "generator")
-endfunction()

 # This function adds custom build steps to invoke a Halide generator exectuable
 # and produce a static library containing the generated code.
@@ -97,13 +79,26 @@
   # GENERATOR_ARGS always come last
   list(APPEND GENERATOR_EXEC_ARGS ${args_GENERATOR_ARGS})

-  halide_generator_add_exec_generator_target(
-    "${AOT_LIBRARY_TARGET}.exec_generator"
-    GENERATOR_TARGET ${args_GENERATOR_TARGET}
-    GENFILES_DIR     ${GENFILES_DIR}
-    OUTPUTS          "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
-    EXEC_ARGS        "${GENERATOR_ARGS}"
+  halide_generator_get_exec_path(${args_GENERATOR_TARGET} GENERATOR_EXEC_PATH)
+
+  # Add a custom target to invoke the GENERATOR_TARGET and output the Halide
+  # generated library.
+  add_custom_command(
+    OUTPUT "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}"
+    DEPENDS "${args_GENERATOR_TARGET}"
+    COMMAND "${GENERATOR_EXEC_PATH}" ${GENERATOR_EXEC_ARGS}
+    WORKING_DIRECTORY "${GENFILES_DIR}"
   )
+
+  # Use a custom target to force it to run the generator before the
+  # object file for the runner.
+  set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
+  add_custom_target(${EXEC_GENERATOR_TARGET}
+                    DEPENDS "${GENFILES_DIR}/${FILTER_LIB}" "${GENFILES_DIR}/${FILTER_HDR}")
+
+  # Place the target in a special folder in IDEs
+  set_target_properties(${EXEC_GENERATOR_TARGET} PROPERTIES FOLDER "generator")
+
 endfunction(halide_add_aot_library)

 # Usage:
@@ -111,9 +106,11 @@
 function(halide_add_aot_library_dependency TARGET AOT_LIBRARY_TARGET)
     halide_generator_genfiles_dir(${AOT_LIBRARY_TARGET} GENFILES_DIR)

-    add_dependencies("${TARGET}" "${AOT_LIBRARY_TARGET}.exec_generator")
+    set(FILTER_LIB "${AOT_LIBRARY_TARGET}${CMAKE_STATIC_LIBRARY_SUFFIX}")

-    set(FILTER_LIB "${AOT_LIBRARY_TARGET}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+    set(EXEC_GENERATOR_TARGET "${AOT_LIBRARY_TARGET}.exec_generator")
+    add_dependencies("${TARGET}" "${EXEC_GENERATOR_TARGET}")
+
     target_link_libraries("${TARGET}" PRIVATE "${GENFILES_DIR}/${FILTER_LIB}")
     target_include_directories("${TARGET}" PRIVATE "${GENFILES_DIR}")

@@ -127,6 +124,7 @@
     else()
       target_link_libraries("${TARGET}" PRIVATE dl pthread z)
     endif()
+
 endfunction(halide_add_aot_library_dependency)

 function(halide_add_generator NAME)


Fix STBI_NO_SIMD wrongly being defined on iOS build.

--- CMake/Modules/Urho3D-CMake-common.cmake
+++ CMake/Modules/Urho3D-CMake-common.cmake
@@ -334,8 +334,10 @@
 endif ()

 # Enable/disable SIMD instruction set for STB image (do it here instead of in the STB CMakeLists.txt because the header files are exposed to Urho3D library user)
-if (NEON AND NOT XCODE)
-    add_definitions (-DSTBI_NEON)       # Cannot define it directly for Xcode due to universal binary support, we define it in the setup_target() macro instead for Xcode
+if (NEON)
+    if (NOT XCODE)
+        add_definitions (-DSTBI_NEON)   # Cannot define it directly for Xcode due to universal binary support, we define it in the setup_target() macro instead for Xcode
+    endif ()
 elseif (NOT URHO3D_SSE)
     add_definitions (-DSTBI_NO_SIMD)    # GCC/Clang/MinGW will switch this off automatically except MSVC, but no harm to make it explicit for all
 endif ()
@@ -1007,12 +1009,15 @@
         if (ATTRIBUTE_ALREADY_SET EQUAL -1)
             list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH $<$<CONFIG:Debug>:YES>)
         endif ()
-        if (URHO3D_SSE OR NEON)
-            # When targeting x86 with SSE enabled; or when targeting iOS with NEON enabled as universal binary includes iPhoneSimulator x86 arch too
-            # Clang by default always enable SSE instruction set for both i386 and x86_64 ABIs, so we only need to take care of special compiler flags/defines for NEON
-            list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CFLAGS[sdk=iphoneos*] "-DSTBI_NEON $(OTHER_CFLAGS)")
-            list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*] "-DSTBI_NEON $(OTHER_CPLUSPLUSFLAGS)")
-        else ()
+        if (NEON)
+            if (IOS)
+                set (SDK iphoneos)
+            elseif (TVOS)
+                set (SDK appletvos)
+            endif ()
+            list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CFLAGS[sdk=${SDK}*] "-DSTBI_NEON $(OTHER_CFLAGS)")
+            list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[sdk=${SDK}*] "-DSTBI_NEON $(OTHER_CPLUSPLUSFLAGS)")
+        elseif (NOT URHO3D_SSE)
             # Nullify the Clang default so that it is consistent with GCC
             list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=i386] "-mno-sse $(OTHER_CFLAGS)")
             list (APPEND TARGET_PROPERTIES XCODE_ATTRIBUTE_OTHER_CPLUSPLUSFLAGS[arch=i386] "-mno-sse $(OTHER_CPLUSPLUSFLAGS)")


ctkMacroCompilePythonScript - Added SOURCE_DIR parameter

It's not possible to overwrite the default source dir (CMAKE_CURRENT_SOURCE_DIR)
and specify a custom one.

This is used when the python file are generated in the build directory.

--- CMake/ctkMacroCompilePythonScript.cmake
+++ CMake/ctkMacroCompilePythonScript.cmake
@@ -9,7 +9,7 @@

 MACRO(ctkMacroCompilePythonScript)
   ctkMacroParseArguments(MY
-    "TARGET_NAME;SCRIPTS;RESOURCES;DESTINATION_DIR;INSTALL_DIR"
+    "TARGET_NAME;SCRIPTS;RESOURCES;SOURCE_DIR;DESTINATION_DIR;INSTALL_DIR"
     ""
     ${ARGN}
     )
@@ -27,6 +27,10 @@
     ENDIF()
   ENDFOREACH()

+  IF(NOT DEFINED MY_SOURCE_DIR)
+    SET(MY_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+  ENDIF()
+
   set(copied_files)
   set(copied_python_files)
   FOREACH(file ${MY_SCRIPTS})
@@ -36,7 +40,7 @@
       SET(file "${file}.py")
     ENDIF()

-    SET(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+    SET(src "${MY_SOURCE_DIR}/${file}")
     SET(tgt "${MY_DESTINATION_DIR}/${file}")
     IF(IS_ABSOLUTE ${file})
       SET(src ${file})


add LDFLAGS_OTHER to the postprocessed _LIBRARIES in orogen_pkg_check_modules

--- lib/orogen/templates/config/Base.cmake
+++ lib/orogen/templates/config/Base.cmake
@@ -9,6 +9,7 @@
           endif()
           list(APPEND _${VARNAME}_LIBRARIES ${_${VARNAME}_lib})
         endforeach()
+        list(APPEND _${VARNAME}_LIBRARIES ${${VARNAME}_LDFLAGS_OTHER})
         set(${VARNAME}_LIBRARIES ${_${VARNAME}_LIBRARIES} CACHE INTERNAL "")
     endif()
 endmacro()


set LD_LIB_PATH for tests in exotic env

set LD_LIB_PATH for tests in exotic env

git-svn-id: de9bbed4c30e0eb58fe8e7d66f5c80b71699a07c@3525 bf01a9d7-0df3-0310-8ad4-b1c94d9ae2d5

--- Numerics/cmake/CMakeListsForTests.cmake
+++ Numerics/cmake/CMakeListsForTests.cmake
@@ -26,8 +26,8 @@
 ENDIF()

 # For some environment variables (LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, Path)
-#GET_FILENAME_COMPONENT(SiconosNumerics_PATH "${SiconosNumerics_FOUND}" PATH)
-SET(SiconosNumerics_PATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+GET_FILENAME_COMPONENT(SiconosNumerics_PATH "${SiconosNumerics_FOUND}" PATH)
+#SET(SiconosNumerics_PATH "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")

 FOREACH(_EXE ${_EXE_LIST_${_CURRENT_TEST_DIRECTORY}})
   MESSAGE(STATUS "Adding test suite ${_CURRENT_TEST_DIRECTORY}/${_EXE}")
@@ -126,7 +126,7 @@
     ELSEIF(CROSSCOMPILING_LINUX_TO_WINDOWS OR WINDOWS)
       FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SiconosTestConfig.cmake "  SET_TESTS_PROPERTIES(\${_EXE} PROPERTIES ENVIRONMENT \"Path=@PATH_FOR_PLUGIN@\;@CMAKE_BINARY_DIR@/src\;@SICONOS_LIB_PATH@\")\n")
     ELSE() # unix
-      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SiconosTestConfig.cmake "  SET_TESTS_PROPERTIES(\${_EXE} PROPERTIES ENVIRONMENT \"LD_LIBRARY_PATH=@LD_LIBRARY_PATH@:@SICONOS_LIB_PATH@\")\n")
+      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SiconosTestConfig.cmake "  SET_TESTS_PROPERTIES(\${_EXE} PROPERTIES ENVIRONMENT \"LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:@SICONOS_LIB_PATH@\")\n")
     ENDIF()

     FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/SiconosTestConfig.cmake "ENDMACRO(ADD_CPPUNIT_TEST)\n")
@@ -151,8 +151,8 @@
     ENDIF(TEST_WRAP)

     SET_TESTS_PROPERTIES(${_EXE} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILURE;Exception;failed;ERROR;test unsucceeded")
-    # Note Franck : I try to set DYLD ... useless for the moment
-    set_tests_properties(${_EXE} PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=@LD_LIBRARY_PATH@:@SICONOS_LIB_PATH@")
+
+    set_tests_properties(${_EXE} PROPERTIES ENVIRONMENT LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:@SICONOS_LIB_PATH@)
     if(CROSSCOMPILING_LINUX_TO_WINDOWS)
       set_tests_properties(${_EXE} PROPERTIES ENVIRONMENT "Path=@CMAKE_BINARY_DIR@/src;@SICONOS_LIB_PATH@")
     endif()


Fixed mistakes in last change.

Fixed mistakes in last change.

--- Tests/VisualTests/PostTest.cmake
+++ Tests/VisualTests/PostTest.cmake
@@ -8,9 +8,10 @@

 if (UNIX)
   # escape spaces
-  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
+  string(REPLACE " " "\ " USER_HOME_DIRECTORY "$ENV{HOME}")
 elseif (WIN32)
-  string(REPLACE "\\" "/" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
+  # make sure we've got backslashes
+  string(REPLACE "/" "\\" USER_HOME_DIRECTORY "$ENV{HOMEDRIVE}$ENV{HOMEPATH}")
 # other platforms?
 endif ()

@@ -18,6 +19,6 @@
 if (UNIX)
   exec_program("rm ${USER_HOME_DIRECTORY}/TestResults_*RenderingSubsystem.txt")
 elseif (WIN32)
-  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\TestResults_*RenderingSubsystem.txt\"")
+  exec_program("cmd /c del \"${USER_HOME_DIRECTORY}\\TestResults_*RenderingSubsystem.txt\"")
 # other platforms?
 endif ()


fix link error on solaris x64

fix link error on solaris x64

--- cmake/FindIconv.cmake
+++ cmake/FindIconv.cmake
@@ -14,7 +14,11 @@
   find_path(ICONV_INCLUDE_DIR iconv.h)
 ENDIF()

-IF(APPLE)
+IF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
+  # There is some libiconv.so in  /usr/local that must
+  # be avoided, iconv routines are in libc
+  find_library(ICONV_LIBRARIES NAMES c)
+ELSEIF(APPLE)
   find_library(ICONV_LIBRARIES NAMES iconv libiconv PATHS
                /opt/local/lib/
                /usr/lib/


Make FindLibAV.cmake work under MSYS2

Make FindLibAV.cmake work under MSYS2

--- cmake/FindLibAV.cmake
+++ cmake/FindLibAV.cmake
@@ -22,6 +22,7 @@
 #
 #
 # Copyright (c) 2013 Sergiu Dotenco
+# Changed 2015 by Jan Schlüter: https://bitbucket.org/sergiu/libav-cmake/issue/2
 #
 # Permission is hereby granted, free of charge, to any person obtaining a copy
 # of this software and associated documentation files (the "Software"), to deal
@@ -126,7 +127,7 @@
     OUTPUT_VARIABLE _LIBAV_AVCONV_OUTPUT ERROR_QUIET)

   STRING (REGEX REPLACE
-    ".*avconv(\\s+version)?[ \t]+([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*" "\\2"
+    ".*avconv(\\s+version)?[ \t]+v?([0-9]+(\\.[0-9]+(\\.[0-9]+)?)?).*" "\\2"
     LIBAV_VERSION "${_LIBAV_AVCONV_OUTPUT}")
   STRING (REGEX REPLACE "([0-9]+)\\.([0-9]+)(\\.([0-9]+))?" "\\1"
     LIBAV_VERSION_MAJOR "${LIBAV_VERSION}")


to unix lf

to unix lf

--- cmake/Finddokan.cmake
+++ cmake/Finddokan.cmake
@@ -1,40 +1,40 @@
-    #set(DOKAN_ROOT_PATHS "$ENV{PROGRAMFILES}/Dokan")
-
-    #MESSAGE( STATUS "DOKAN_ROOT_PATH: " ${DOKAN_ROOT_PATHS} )
-
-    set(DOKAN_FOUND TRUE)
-
-    set(DOKAN_ROOT_PATHS    "/cygdrive/c/Program Files/Dokan/Dokan Library-1.0.3"
-            "/c/Program Files/Dokan/Dokan Library-1.0.3"
-            "c:/Program Files/Dokan/Dokan Library-1.0.3")
-
-    find_path(DOKAN_INCLUDE_DIR
-            NAMES
-            dokan/dokan.h
-            PATHS
-            ${DOKAN_ROOT_PATHS}
-            PATH_SUFFIXES
-            include
-            )
-
-
-    if(NOT DOKAN_INCLUDE_DIRS)
-        set(DOKAN_FOUND FALSE)
-    endif(NOT DOKAN_INCLUDE_DIRS)
-
-    SET(CMAKE_FIND_LIBRARY_PREFIXES "")
-    SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
-
-    find_library(DOKAN_LIB_DIR
-            NAMES
-            dokan1
-            PATHS
-            ${DOKAN_ROOT_PATHS}
-            )
-
-    if(NOT DOKAN_LIB_DIRS)
-        set(DOKAN_FOUND FALSE)
-    endif(NOT DOKAN_LIB_DIRS)
-
-    MESSAGE( STATUS "DOKAN_INCLUDE_DIR: " ${DOKAN_INCLUDE_DIR} )
+    #set(DOKAN_ROOT_PATHS "$ENV{PROGRAMFILES}/Dokan")
+
+    #MESSAGE( STATUS "DOKAN_ROOT_PATH: " ${DOKAN_ROOT_PATHS} )
+
+    set(DOKAN_FOUND TRUE)
+
+    set(DOKAN_ROOT_PATHS    "/cygdrive/c/Program Files/Dokan/Dokan Library-1.0.3"
+            "/c/Program Files/Dokan/Dokan Library-1.0.3"
+            "c:/Program Files/Dokan/Dokan Library-1.0.3")
+
+    find_path(DOKAN_INCLUDE_DIR
+            NAMES
+            dokan/dokan.h
+            PATHS
+            ${DOKAN_ROOT_PATHS}
+            PATH_SUFFIXES
+            include
+            )
+
+
+    if(NOT DOKAN_INCLUDE_DIRS)
+        set(DOKAN_FOUND FALSE)
+    endif(NOT DOKAN_INCLUDE_DIRS)
+
+    SET(CMAKE_FIND_LIBRARY_PREFIXES "")
+    SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".dll")
+
+    find_library(DOKAN_LIB_DIR
+            NAMES
+            dokan1
+            PATHS
+            ${DOKAN_ROOT_PATHS}
+            )
+
+    if(NOT DOKAN_LIB_DIRS)
+        set(DOKAN_FOUND FALSE)
+    endif(NOT DOKAN_LIB_DIRS)
+
+    MESSAGE( STATUS "DOKAN_INCLUDE_DIR: " ${DOKAN_INCLUDE_DIR} )
     MESSAGE( STATUS "DOKAN_LIB_DIR: " ${DOKAN_LIB_DIR} )


Add Glslang to the bootstrapper

Add Glslang to the bootstrapper

--- cmake/bootstrap.cmake
+++ cmake/bootstrap.cmake
@@ -105,6 +105,7 @@
 y_package(libjpeg REQUIRES nasm)
 y_package(libpng REQUIRES nasm zlib)
 y_package(catch2)
+y_package(glslang)
 y_package(libogg)
 y_package(nasm)
 y_package(openal)
@@ -121,6 +122,16 @@
     OPTIONS -DCATCH_BUILD_TESTING=OFF -DCATCH_INSTALL_DOCS=OFF -DCATCH_INSTALL_HELPERS=OFF -DPKGCONFIG_INSTALL_DIR=${CMAKE_BINARY_DIR}/.trash)
 endif()

+if("glslang" IN_LIST _y_packages)
+  set(_version "7.8.2853")
+  set(_package "glslang-${_version}")
+  y_download("https://github.com/KhronosGroup/glslang/archive/${_version}.tar.gz" SHA1 "9b6d3734abb351e8218e31c4b08c08805f2c22fc")
+  y_extract("${_version}.tar.gz" DIR ${_package})
+  y_cmake(${_package}
+    CONFIG ${CONFIGS}
+    OPTIONS -DENABLE_AMD_EXTENSIONS=OFF -DENABLE_GLSLANG_BINARIES=OFF -DENABLE_HLSL=OFF -DENABLE_NV_EXTENSIONS=OFF -DENABLE_SPVREMAPPER=OFF -DENABLE_OPT=OFF)
+endif()
+
 if("libogg" IN_LIST _y_packages)
   set(_package "ogg")
   y_git_clone("https://git.xiph.org/ogg.git" DIR ${_package})


r9603/sofa : cmake: reverting AddCompilerDefinitions to its original form.

Former-commit-id: 811adbed02c4305b70f6d4c9eb15dfa8be414394

--- cmake/functions.cmake
+++ cmake/functions.cmake
@@ -426,7 +426,6 @@

 # AddCompilerDefinitions(compiler_definition0 [compiler_definition1 [...]])
 function(AddCompilerDefinitions)
-	add_definitions("-D${ARGV}")
 	set(COMPILER_DEFINES ${COMPILER_DEFINES} ${ARGV} PARENT_SCOPE)
 endfunction()


fix linking for static/header only

fix linking for static/header only

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -121,6 +121,10 @@

   #generate_export_header(${PROJECT_NAME}_static)

+  if(${PROJECT_NAME}_LINKER)
+    target_link_libraries(${PROJECT_NAME}_static "${${PROJECT_NAME}_LINKER}")
+  endif()
+
   if (EIGEN_USE_MKL_ALL)
     # See http://eigen.tuxfamily.org/dox/TopicUsingIntelMKL.html
     find_package(MKL REQUIRED)


change liboperators to static

change liboperators to static

--- cmake/operators.cmake
+++ cmake/operators.cmake
@@ -5,7 +5,7 @@
     ${SRC_DIR}/operators.cpp
 )

-add_library( operators SHARED ${OPERATORS_SRC} ${OPERATORS_HPP} )
+add_library( operators STATIC ${OPERATORS_SRC} ${OPERATORS_HPP} )
 target_link_libraries( operators
 )
 target_include_directories ( operators PUBLIC ${INCLUDE_DIR} )


Fix for GCC 6 compatibility.

Fix for GCC 6 compatibility.

--- cmake/GenerateExportHeader.cmake
+++ cmake/GenerateExportHeader.cmake
@@ -164,12 +164,12 @@
   if(CMAKE_COMPILER_IS_GNUCXX)
     exec_program(${CMAKE_C_COMPILER} ARGS --version
       OUTPUT_VARIABLE _gcc_version_info)
-    string(REGEX MATCH "[345]\\.[0-9]\\.[0-9]"
+    string(REGEX MATCH "[3456]\\.[0-9]\\.[0-9]"
       _gcc_version "${_gcc_version_info}")
     # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
     # patch level, handle this here:
     if(NOT _gcc_version)
-      string(REGEX REPLACE ".*\\(GCC\\).* ([34]\\.[0-9]) .*" "\\1.0"
+      string(REGEX REPLACE ".*\\(GCC\\).* ([3456]\\.[0-9]) .*" "\\1.0"
         _gcc_version "${_gcc_version_info}")
     endif()


Botan: Use Botan 2 if it is available

Botan: Use Botan 2 if it is available

This commit fixes #1576.

--- cmake/Modules/FindLibBotan.cmake
+++ cmake/Modules/FindLibBotan.cmake
@@ -14,7 +14,7 @@

 if (NOT BOTAN_FOUND)
   include (FindPkgConfig)
-  pkg_search_module (BOTAN QUIET botan-1.10 botan-1.9 botan-1.8 botan)
+  pkg_search_module (BOTAN QUIET botan-1.10 botan-1.9 botan-1.8 botan-2 botan)
 endif ()

 if (BOTAN_FOUND)


Supress some msvc analyze warnings.

Supress some msvc analyze warnings.

--- run_ctest.cmake
+++ run_ctest.cmake
@@ -328,7 +328,7 @@
     ctest_update()
     ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})
     if(CC_NAME STREQUAL "msvc")
-        set(CC_ANALYSE_FLAGS "/analyze /wd28251")
+        set(CC_ANALYSE_FLAGS "/analyze /wd28251 /wd28301")
     elseif(CC_NAME STREQUAL "clang")
         set(CC_ANALYSE_FLAGS "--analyze -Wno-unused-command-line-argument")
     endif()


[CMake] Make SourceKit respect link_libraries and library_search_directories

add_sourcekit_default_compiler_flags was invoking
_add_variant_link_flags and getting link flags but not actually using
the link_libraries or library_search_directories. In android builds,
this means that the correct libc++ is not being linked against.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -66,7 +66,9 @@
     ENABLE_LTO "${SWIFT_TOOLS_ENABLE_LTO}"
     LTO_OBJECT_NAME "${target}-${sdk}-${arch}"
     ANALYZE_CODE_COVERAGE "${analyze_code_coverage}"
-    RESULT_VAR_NAME link_flags)
+    RESULT_VAR_NAME link_flags
+    LINK_LIBRARIES_VAR_NAME link_libraries
+    LIBRARY_SEARCH_DIRECTORIES_VAR_NAME library_search_directories)

   # Convert variables to space-separated strings.
   _list_escape_for_shell("${c_compile_flags}" c_compile_flags)
@@ -77,6 +79,8 @@
       COMPILE_FLAGS " ${c_compile_flags} -fblocks")
   set_property(TARGET "${target}" APPEND_STRING PROPERTY
       LINK_FLAGS " ${link_flags}")
+  set_property(TARGET "${target}" APPEND PROPERTY LINK_LIBRARIES ${link_libraries})
+  swift_target_link_search_directories("${target}" "${library_search_directories}")
 endfunction()

 # Add a new SourceKit library.


Related to bug 880: Accept make as well a gmake when searching the MakeCommand. And don't include \n in match expression

--- cmake/EigenConfigureTesting.cmake
+++ cmake/EigenConfigureTesting.cmake
@@ -24,9 +24,9 @@
 # At this stage, we can also add custom flags to the build tool through the user defined EIGEN_TEST_BUILD_FLAGS variable.
 file(READ  "${CMAKE_CURRENT_BINARY_DIR}/DartConfiguration.tcl" EIGEN_DART_CONFIG_FILE)
 # try to grab the default flags
-string(REGEX MATCH "MakeCommand:.*-- (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
+string(REGEX MATCH "MakeCommand:.*-- (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
 if(NOT CMAKE_MATCH_1)
-string(REGEX MATCH "MakeCommand:.*gmake (.*)DefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
+string(REGEX MATCH "MakeCommand:.*make (.*)\nDefaultCTestConfigurationType" EIGEN_DUMMY ${EIGEN_DART_CONFIG_FILE})
 endif()
 string(REGEX REPLACE "MakeCommand:.*DefaultCTestConfigurationType" "MakeCommand: ${CMAKE_COMMAND} --build . --target buildtests --config \"\${CTEST_CONFIGURATION_TYPE}\" -- ${CMAKE_MATCH_1} ${EIGEN_TEST_BUILD_FLAGS}\nDefaultCTestConfigurationType"
        EIGEN_DART_CONFIG_FILE2 ${EIGEN_DART_CONFIG_FILE})


Fine tune fix for ROOT-8701 for ROOT project itself.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -243,6 +243,10 @@
           list(APPEND fullheaderfiles ${f})
         endif()
       endforeach()
+    elseif(CMAKE_PROJECT_NAME STREQUAL ROOT AND
+           EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${fp}) # only for ROOT project
+      list(APPEND headerfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
+      list(APPEND fullheaderfiles ${CMAKE_CURRENT_SOURCE_DIR}/${fp})
     elseif(IS_ABSOLUTE ${fp})
       list(APPEND headerfiles ${fp})
       list(APPEND fullheaderfiles ${fp})


Stop interpreting source path as a regex (ROOT-8960).

This fixes that regex characters in the source directory path
cause the CMake configuration to fail with cryptic error messages.

This happens because we interpret the source directory as a regex in a
few places in our CMake code.

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -268,8 +268,12 @@
   # Replace the non-standard folder layout of Core.
   if (ARG_STAGE1 AND ARG_MODULE STREQUAL "Core")
     # FIXME: Glob these folders.
-    set(core_folders "base|clib|clingutils|cont|dictgen|doc|foundation|lzma|lz4|macosx|meta|metacling|multiproc|newdelete|pcre|rint|rootcling_stage1|textinput|thread|unix|winnt|zip")
-    string(REGEX REPLACE "${CMAKE_SOURCE_DIR}/core/(${core_folders})/inc/" ""  headerfiles "${headerfiles}")
+    set(core_folders base clib clingutils cont dictgen doc foundation lzma lz4
+                     macosx meta metacling multiproc newdelete pcre rint
+                     rootcling_stage1 textinput thread unix winnt zip)
+    foreach(core_folder ${core_folders})
+     string(REPLACE "${CMAKE_SOURCE_DIR}/core/(${core_folders})/inc/" ""  headerfiles "${headerfiles}")
+    endforeach()
   endif()

   if(CMAKE_PROJECT_NAME STREQUAL ROOT)
@@ -482,7 +486,7 @@
     endif()
   endif(APPLE)

-  set(excluded_headers "RConfig.h RVersion.h RtypesImp.h TVersionCheck.h
+  set(excluded_headers RConfig.h RVersion.h RtypesImp.h TVersionCheck.h
                         Rtypes.h RtypesCore.h TClassEdit.h
                         TIsAProxy.h TVirtualIsAProxy.h
                         DllImport.h TGenericClassInfo.h
@@ -491,7 +495,7 @@
                         RWrap_libcpp_string_view.h
                         ThreadLocalStorage.h
                         TBranchProxyTemplate.h TGLIncludes.h TGLWSIncludes.h
-                        snprintf.h strlcpy.h")
+                        snprintf.h strlcpy.h)

    # Deprecated header files.
   set (excluded_headers "${excluded_headers}")
@@ -507,12 +511,19 @@
     set(found_headers ${library_headers})
   endif()
   foreach(header ${found_headers})
-    #message (STATUS "header: ${header}")
     set(textual_header "")
     if (${header} MATCHES ".*\\.icc$")
       set(textual_header "textual ")
     endif()
-    if (NOT ${excluded_headers} MATCHES ${header})
+    # Check if header is in included header list
+    set(is_excluded NO)
+    foreach(excluded_header ${excluded_headers})
+      if(${header} MATCHES ${excluded_header})
+        set(is_excluded YES)
+        break()
+      endif()
+    endforeach()
+    if(NOT is_excluded)
       set(modulemap_entry "${modulemap_entry}  module \"${header}\" { ${textual_header}header \"${header}\" export * }\n")
     endif()
   endforeach()


undo change in destination of cmake target files

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -418,7 +418,7 @@
 	# 1/3: autogenerated target file:
 	install(
 		EXPORT mrpt-${name}-targets
-		DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrpt/
+		DESTINATION share/mrpt-${name}
 		NAMESPACE mrpt::
 	)
 	# 2/3: config file with manual list of dependencies:
@@ -427,7 +427,7 @@
 		FILES
 			"${CMAKE_BINARY_DIR}/mrpt-${name}-config.cmake"
 			"${CMAKE_BINARY_DIR}/mrpt-${name}-config-version.cmake"
-		DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/mrpt/
+		DESTINATION share/mrpt-${name}
 	)

 	# Install public headers:


Update octomap GH link

Update octomap GH link

--- cmakemodules/script_octomap.cmake
+++ cmakemodules/script_octomap.cmake
@@ -36,8 +36,7 @@
 		include(ExternalProject)
 		# download from GH
 		ExternalProject_Add(EP_octomap
-		  URL               "https://github.com/jlblancoc/octomap/archive/devel.zip"
-		  #URL_MD5           "ea292f0595d7408e36ab7e545ceda013"
+		  URL               "https://github.com/MRPT/octomap/archive/devel.zip" #TO-DO: Switch back to original repo after next stable release.
 		  SOURCE_DIR        "${MRPT_BINARY_DIR}/otherlibs/octomap/"
 		  CMAKE_ARGS
 			-DBUILD_TESTING=OFF


OpenNI2: Better automatic detection from CMake

--- cmakemodules/script_openni2.cmake
+++ cmakemodules/script_openni2.cmake
@@ -17,7 +17,24 @@
 	endif(${CMAKE_VERSION} VERSION_LESS 2.8.2)
 ENDIF (PKG_CONFIG_FOUND)

-OPTION(MRPT_HAS_OPENNI2 "Support for the OpenNI2 library" "${PC_OPENNI_FOUND}")
+# Build the expected names of the environment variables (Windows only) where OpenNI2 can be found:
+IF (CMAKE_MRPT_WORD_SIZE EQUAL 64)
+	SET(ENV_OPNI2_INCLUDE "OPENNI2_INCLUDE64")
+	SET(ENV_OPNI2_LIB     "OPENNI2_LIB64")
+	SET(ENV_OPNI2_REDIST  "OPENNI2_REDIST64")
+ELSE (CMAKE_MRPT_WORD_SIZE EQUAL 64)
+	SET(ENV_OPNI2_INCLUDE "OPENNI2_INCLUDE")
+	SET(ENV_OPNI2_LIB     "OPENNI2_LIB")
+	SET(ENV_OPNI2_REDIST  "OPENNI2_REDIST")
+ENDIF (CMAKE_MRPT_WORD_SIZE EQUAL 64)
+
+# Create option for OpenNI2 and guess its default value:
+SET(DEFAULT_MRPT_HAS_OPENNI2 0)
+IF(PC_OPENNI_FOUND OR NOT "$ENV{${ENV_OPNI2_INCLUDE}}" STREQUAL "")
+	SET(DEFAULT_MRPT_HAS_OPENNI2 1)
+ENDIF(PC_OPENNI_FOUND OR NOT "$ENV{${ENV_OPNI2_INCLUDE}}" STREQUAL "")
+
+OPTION(MRPT_HAS_OPENNI2 "Support for the OpenNI2 library" ${DEFAULT_MRPT_HAS_OPENNI2})

 IF(MRPT_HAS_OPENNI2)
 	#set(OPENNI2_DEFINITIONS ${PC_OPENNI_CFLAGS_OTHER}) #JL: Remove?
@@ -25,14 +42,14 @@
 	#add a hint so that it can find it without the pkg-config
 	find_path(OPENNI2_INCLUDE_DIR OpenNI.h
 			  HINTS ${PC_OPENNI_INCLUDEDIR} ${PC_OPENNI_INCLUDE_DIRS} /usr/include/openni2 /usr/include/ni2
-			  PATHS "$ENV{PROGRAMFILES}/OpenNI2/Include" "$ENV{PROGRAMW6432}/OpenNI2/Include"
+			  PATHS "$ENV{PROGRAMFILES}/OpenNI2/Include" "$ENV{PROGRAMW6432}/OpenNI2/Include" "$ENV{${ENV_OPNI2_INCLUDE}}"
 			  PATH_SUFFIXES openni ni
 			  DOC "Path to the include directory containing OpenNI.h,etc.")
 	#add a hint so that it can find it without the pkg-config
 	find_library(OPENNI2_LIBRARY
 				 NAMES OpenNI2
 				 HINTS ${PC_OPENNI_LIBDIR} ${PC_OPENNI_LIBRARY_DIRS} /usr/lib
-				 PATHS "$ENV{PROGRAMFILES}/OpenNI2/Redist" "$ENV{PROGRAMW6432}/OpenNI2/Redist" "$ENV{PROGRAMW6432}/OpenNI2"
+				 PATHS "$ENV{PROGRAMFILES}/OpenNI2/Redist" "$ENV{PROGRAMW6432}/OpenNI2/Redist" "$ENV{PROGRAMW6432}/OpenNI2" "$ENV{${ENV_OPNI2_LIB}}"
 				 PATH_SUFFIXES lib lib64
 				 DOC "The OpenNI2.lib file path")