ICC binaries refuse to run on AMD with SSE3. So we better build with -xSSE2

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -205,7 +205,16 @@
                else(_found)
                   _my_find(_available_vector_units_list "sse3"   _found)
                   if(_found)
-                     AddCompilerFlag("-xSSE3")
+                     # If the target host is an AMD machine then we still want to use -xSSE2 because the binary would refuse to run at all otherwise
+                     _my_find(_march_flag_list "barcelona" _found)
+                     if(NOT _found)
+                        _my_find(_march_flag_list "k8-sse3" _found)
+                     endif(NOT _found)
+                     if(_found)
+                        AddCompilerFlag("-xSSE2")
+                     else(_found)
+                        AddCompilerFlag("-xSSE3")
+                     endif(_found)
                   else(_found)
                      _my_find(_available_vector_units_list "sse2"   _found)
                      if(_found)


Added fix for lldb debugging

Added fix for lldb debugging

--- cmake_modules/CMakeRunTargets.cmake
+++ cmake_modules/CMakeRunTargets.cmake
@@ -168,11 +168,20 @@
   COMMENT "Running: ${APP_NAME}")
   option(RUN_IN_DEBUGGER 0) # For next run
 else()
-add_custom_target("${APP_NAME}_run"
-  COMMAND "${ALLOSYSTEM_DEBUGGER}" "-ex" "run" "${EXECUTABLE_OUTPUT_PATH}/${APP_NAME}"
-  DEPENDS "${APP_NAME}"
-  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
-  SOURCES ${ALLOSYSTEM_APP_SRC}
-  COMMENT "Running: ${APP_NAME}")
+  if(${ALLOSYSTEM_DEBUGGER} EQUALS "lldb")
+  add_custom_target("${APP_NAME}_run"
+	COMMAND "${ALLOSYSTEM_DEBUGGER}" "-ex" "${EXECUTABLE_OUTPUT_PATH}/${APP_NAME}"
+	DEPENDS "${APP_NAME}"
+	WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+	SOURCES ${ALLOSYSTEM_APP_SRC}
+	COMMENT "Running: ${APP_NAME}")
+else()
+  add_custom_target("${APP_NAME}_run"
+	COMMAND "${ALLOSYSTEM_DEBUGGER}" "-ex" "run" "${EXECUTABLE_OUTPUT_PATH}/${APP_NAME}"
+	DEPENDS "${APP_NAME}"
+	WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+	SOURCES ${ALLOSYSTEM_APP_SRC}
+	COMMENT "Running: ${APP_NAME}")
+endif()

 endif(NOT RUN_IN_DEBUGGER)


kjs/ConfigureChecks.cmake - set HAVE_SYS_PARAM_H properly this way, the installed kjs/global.h will be correct with reality. even though I don't think such a thing should be installed at all.

--- src/kjs/ConfigureChecks.cmake
+++ src/kjs/ConfigureChecks.cmake
@@ -19,6 +19,7 @@
 check_include_files("unistd.h"      HAVE_UNISTD_H)
 check_include_files("stdint.h"      HAVE_STDINT_H)
 check_include_files("sys/time.h"    HAVE_SYS_TIME_H)
+check_include_files("sys/param.h"   HAVE_SYS_PARAM_H)
 check_include_files("errno.h"       HAVE_ERRNO_H)
 check_include_files("strings.h"     HAVE_STRINGS_H)
 check_include_files("crtdbg.h"      HAVE_CRTDBG_H)


Install XCB GLX integration to the correct destination

--- CMake/mitkInstallRules.cmake
+++ CMake/mitkInstallRules.cmake
@@ -40,9 +40,10 @@
   elseif(APPLE)
     MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqcocoa.dylib")
   elseif(UNIX)
-    MITK_INSTALL(FILES
-      "${_qmake_path}/../plugins/platforms/libqxcb.so"
-      "${_qmake_path}/../plugins/xcbglintegrations/libqxcb-glx-integration.so")
+    MITK_INSTALL(FILES "${_qmake_path}/../plugins/platforms/libqxcb.so")
+
+    set(_install_DESTINATION "plugins/xcbglintegrations")
+    MITK_INSTALL(FILES "${_qmake_path}/../plugins/xcbglintegrations/libqxcb-glx-integration.so")
   endif()

   # Install platform-specific Qt styles


Enable special handling of blueberry_osgi also on windows

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -83,7 +83,7 @@
       endif()
     endmacro(gp_resolved_file_type_override)

-    if(NOT APPLE AND (UNIX OR MINGW))
+    if(NOT APPLE)
       macro(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
         if(\${item} MATCHES \"blueberry_osgi\")
           get_filename_component(_item_name \${item} NAME)


bug#58766: Server binary was compiled without fast-mutexes

Re-enable fast mutexes on Linux for release builds.

--- cmake/build_configurations/mysql_release.cmake
+++ cmake/build_configurations/mysql_release.cmake
@@ -117,8 +117,8 @@

   OPTION(WITH_PIC "" ON) # Why?

-  # Ensure aio is available on Linux (required by InnoDB)
   IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+    # Ensure aio is available on Linux (required by InnoDB)
     CHECK_INCLUDE_FILES(libaio.h HAVE_LIBAIO_H)
     CHECK_LIBRARY_EXISTS(aio io_queue_init "" HAVE_LIBAIO)
     IF(NOT HAVE_LIBAIO_H OR NOT HAVE_LIBAIO)
@@ -130,6 +130,9 @@
         SuSE:                       zypper install libaio-devel
        ")
     ENDIF()
+
+    # Enable fast mutexes on Linux
+    OPTION(WITH_FAST_MUTEXES "" ON)
   ENDIF()

 ENDIF()


update valgrind test args

update valgrind test args

--- ValgrindTest.cmake
+++ ValgrindTest.cmake
@@ -11,7 +11,7 @@
 		MESSAGE( "Valgrind command not found!")
 		add_test(${_targetname} ${_testrunner} ${ARGN})
 	else ()
-		add_test(${_targetname} ${VALGRIND_COMMAND} --leak-check=full --error-exitcode=5 ${ARGV2} --quiet ${_testrunner} ${ARGN})
+		add_test(${_targetname} ${VALGRIND_COMMAND} --leak-check=full --error-exitcode=5 ${ARGV2} --quiet ${_testrunner} ${ARG3})
 	endif()

 endfunction()
@@ -22,7 +22,7 @@
 		MESSAGE( "Valgrind command not found!")
 		add_test(${_targetname} ${_testrunner} ${ARGN})
 	else ()
-		add_test(${_targetname} ${VALGRIND_COMMAND} --tool=callgrind --error-exitcode=5 ${ARGV2} --quiet ${_testrunner} ${ARGN})
+		add_test(${_targetname} ${VALGRIND_COMMAND} --tool=callgrind --error-exitcode=5 ${ARGV2} --quiet ${_testrunner} ${ARG3})
 	endif()

 endfunction()
@@ -33,7 +33,7 @@
   if (NOT ${_cond} OR NOT VALGRIND_COMMAND)
     add_test(${_targetname} ${_testrunner} ${ARGN})
   else ()
-    add_test(${_targetname} ${VALGRIND_COMMAND} --leak-check=full --error-exitcode=5 ${ARGV3} --quiet ${_testrunner} ${ARGN})
+    add_test(${_targetname} ${VALGRIND_COMMAND} --leak-check=full --error-exitcode=5 ${ARGV3} --quiet ${_testrunner} ${ARG4})
   endif()

 endfunction()
@@ -44,7 +44,7 @@
   if (NOT ${_cond} OR NOT VALGRIND_COMMAND)
     add_test(${_targetname} ${_testrunner} ${ARGN})
   else ()
-    add_test(${_targetname} ${VALGRIND_COMMAND} --tool=calgrind --error-exitcode=5 ${ARGV3} --quiet ${_testrunner} ${ARGN})
+    add_test(${_targetname} ${VALGRIND_COMMAND} --tool=calgrind --error-exitcode=5 ${ARGV3} --quiet ${_testrunner} ${ARG4})
   endif()

 endfunction()


Android: fatal error if ANDROID_NDK_xxx environment variable not found

--- os/android.cmake
+++ os/android.cmake
@@ -16,9 +16,13 @@

 set(_env_ndk "$ENV{ANDROID_NDK_${ANDROID_NDK_VERSION}}")
 string(COMPARE EQUAL "${_env_ndk}" "" _is_empty)
-if(NOT _is_empty)
-  set(ANDROID_NDK "${_env_ndk}")
+if(_is_empty)
+  polly_fatal_error(
+      "Environment variable 'ANDROID_NDK_${ANDROID_NDK_VERSION}' not set"
+  )
 endif()
+
+set(ANDROID_NDK "${_env_ndk}")

 string(COMPARE EQUAL "${CMAKE_SYSTEM_VERSION}" "" _is_empty)
 if(_is_empty)


Testsuite: Bugfix: Fix a typo that prevented all tests under ./deal.II/tests from being set up

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@31743 0785d39b-7218-0410-832d-ea1e28bc413d

--- deal.II/cmake/setup_testsuite.cmake
+++ deal.II/cmake/setup_testsuite.cmake
@@ -114,7 +114,7 @@
 #

 FOREACH(_category ${_categories})
-  IF(EXISTS ${CMAKE_SOURCE_DIR}/${_category}/CMakeLists.txt)
+  IF(EXISTS ${CMAKE_SOURCE_DIR}/tests/${_category}/CMakeLists.txt)
     SET(_category_dir ${CMAKE_SOURCE_DIR}/tests/${_category})
   ELSEIF(EXISTS ${TEST_DIR}/${_category}/CMakeLists.txt)
     SET(_category_dir ${TEST_DIR}/${_category})


ImportedProjectUtils: Ensure that CMAKE variables get forwarded

Some CMAKE_ namespaces variables aren't in the cache but
are important enough to be forwarded to subprojects
(such as the generators and compilers) so make sure that
they are in the cache before forwarding them.

--- ImportedProjectUtils.cmake
+++ ImportedProjectUtils.cmake
@@ -613,6 +613,12 @@
     psq_assign_variables_in_list (IMPORT_PROJECT_INCLUDE_DIRS
                                   INCLUDE_DIR_VARIABLES)

+    # Make sure CMAKE_C_COMPILER, CMAKE_CXX_COMPILER and CMAKE_MODULE_PATH
+    # are in the cache
+    set (CMAKE_C_COMPILER "${CMAKE_C_COMPILER}" CACHE STRING "" FORCE)
+    set (CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER}" CACHE STRING "" FORCE)
+    set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" CACHE STRING "" FORCE)
+
     # Forward cache namespaces. The CMAKE namespace will be forwarded by
     # default. This ensures that all subprojects are built with the
     # same builder, compiler flags, etc.


改善osx兼容性

改善osx兼容性

--- project/cmake/modules/FindConfigurePackage.cmake
+++ project/cmake/modules/FindConfigurePackage.cmake
@@ -1,4 +1,4 @@
-#.rst:
+#.rst:
 # FindConfigurePackage
 # ----------------
 #
@@ -154,9 +154,15 @@

                 find_program(TAR_EXECUTABLE tar PATHS "${CYGWIN_INSTALL_PATH}/bin")
                 if(TAR_EXECUTABLE AND NOT EXISTS "${FindConfigurePackage_WORKING_DIRECTORY}/${FindConfigurePackage_SRC_DIRECTORY_NAME}")
-                    execute_process(COMMAND ${TAR_EXECUTABLE} -axvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
-                        WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
-                    )
+                    if(APPLE)
+                        execute_process(COMMAND ${TAR_EXECUTABLE} -xvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
+                            WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
+                        )
+                    else()
+                        execute_process(COMMAND ${TAR_EXECUTABLE} -axvf "${FindConfigurePackage_WORKING_DIRECTORY}/${DOWNLOAD_FILENAME}"
+                            WORKING_DIRECTORY "${FindConfigurePackage_WORKING_DIRECTORY}"
+                        )
+                    endif()
                 endif()

                 if(NOT TAR_EXECUTABLE)


Automated merge with ssh://bitbucket.org/brad_linden/viewer-mustbuildfaster-0

--- indra/cmake/LLAddBuildTest.cmake
+++ indra/cmake/LLAddBuildTest.cmake
@@ -95,7 +95,7 @@
     IF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
       SET(${name}_test_additional_INCLUDE_DIRS "")
     ENDIF(${name}_test_additional_INCLUDE_DIRS MATCHES NOTFOUND)
-    INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${name}_test_additional_INCLUDE_DIRS )
+    INCLUDE_DIRECTORIES(${alltest_INCLUDE_DIRS} ${${name}_test_additional_INCLUDE_DIRS} )
     IF(LL_TEST_VERBOSE)
       MESSAGE("LL_ADD_PROJECT_UNIT_TESTS ${name}_test_additional_INCLUDE_DIRS ${${name}_test_additional_INCLUDE_DIRS}")
     ENDIF(LL_TEST_VERBOSE)


ossim link error when using OpenThreads archive on windows

--- CMake/External_OpenThreads.cmake
+++ CMake/External_OpenThreads.cmake
@@ -18,25 +18,42 @@
   set(OPENTHREADS_SB_BUILD_DIR ${CMAKE_BINARY_DIR}/${proj}/build)
   set(OPENTHREADS_SB_SRC ${CMAKE_BINARY_DIR}/${proj}/src/${proj})

-  ExternalProject_Add(${proj}
-    PREFIX ${proj}
-    #SVN_REPOSITORY "http://svn.openscenegraph.org/osg/OpenThreads/tags/OpenThreads-2.3.0/"
-    #SVN_REVISION -r 14667
-    URL "http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip"
-    URL_MD5 4980f8692712a24d4c99f363f80c6814
-    SOURCE_DIR ${OPENTHREADS_SB_SRC}
-    BINARY_DIR ${OPENTHREADS_SB_BUILD_DIR}
-    INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
-    CMAKE_CACHE_ARGS
-      -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
-      -DCMAKE_BUILD_TYPE:STRING=Release
-      -DBUILD_SHARED_LIBS:BOOL=ON
-    CMAKE_COMMAND ${SB_CMAKE_COMMAND}
-    DEPENDS ${${proj}_DEPENDENCIES}
-    PATCH_COMMAND ${CMAKE_COMMAND} -E copy
-      ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
-      ${OPENTHREADS_SB_SRC}
+  #TODO: try to use cmake variable for DOWNLOAD_COMMAND for different platforms
+  if(MSVC)
+    ExternalProject_Add(${proj}
+      PREFIX ${proj}
+      SVN_REPOSITORY "http://svn.openscenegraph.org/osg/OpenThreads/tags/OpenThreads-2.3.0/"
+      SVN_REVISION -r 14667
+      SOURCE_DIR ${OPENTHREADS_SB_SRC}
+      BINARY_DIR ${OPENTHREADS_SB_BUILD_DIR}
+      INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
+      CMAKE_CACHE_ARGS
+        -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
+        -DCMAKE_BUILD_TYPE:STRING=Release
+        -DBUILD_SHARED_LIBS:BOOL=ON
+        PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt ${OPENTHREADS_SB_SRC}
+        CMAKE_COMMAND ${SB_CMAKE_COMMAND}
     )
+  else(UNIX or APPLE)
+    ExternalProject_Add(${proj}
+      PREFIX ${proj}
+      URL "http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.2.0.zip"
+      URL_MD5 4980f8692712a24d4c99f363f80c6814
+      SOURCE_DIR ${OPENTHREADS_SB_SRC}
+      BINARY_DIR ${OPENTHREADS_SB_BUILD_DIR}
+      INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
+      CMAKE_CACHE_ARGS
+        -DCMAKE_INSTALL_PREFIX:STRING=${CMAKE_INSTALL_PREFIX}
+        -DCMAKE_BUILD_TYPE:STRING=Release
+        -DBUILD_SHARED_LIBS:BOOL=ON
+      CMAKE_COMMAND ${SB_CMAKE_COMMAND}
+      DEPENDS ${${proj}_DEPENDENCIES}
+      PATCH_COMMAND ${CMAKE_COMMAND} -E copy
+        ${CMAKE_SOURCE_DIR}/patches/${proj}/CMakeLists.txt
+        ${OPENTHREADS_SB_SRC}
+    )
+  endif()

   message(STATUS "  Using OpenThreads SuperBuild version")


Correcting typo in FindFreeImage

Correcting typo in FindFreeImage

--- CMakeModules/FindFreeImage.cmake
+++ CMakeModules/FindFreeImage.cmake
@@ -36,9 +36,9 @@
 ENDIF (WIN32)

 IF (FREEIMAGE_INCLUDE_PATH AND FREEIMAGE_LIBRARY)
-	SET( FREEIMAGE_FOUND TRUE CACHE BOOL "Set to TRUE if GLEW is found, FALSE otherwise")
+    SET( FREEIMAGE_FOUND TRUE CACHE BOOL "Set to TRUE if FREEIMAGE is found, FALSE otherwise")
 ELSE (FREEIMAGE_INCLUDE_PATH AND FREEIMAGE_LIBRARY)
-	SET( FREEIMAGE_FOUND FALSE CACHE BOOL "Set to TRUE if GLEW is found, FALSE otherwise")
+    SET( FREEIMAGE_FOUND FALSE CACHE BOOL "Set to TRUE if FREEIMAGE is found, FALSE otherwise")
     SET( FREEIMAGE_INCLUDE_PATH "" )
     SET( FREEIMAGE_LIBRARY "" )
 ENDIF (FREEIMAGE_INCLUDE_PATH AND FREEIMAGE_LIBRARY)


Hide FREETYPE_FT2BUILD_INCLUDE_DIR variable

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -49,6 +49,7 @@
 make_library_set(FREETYPE_LIBRARY)

 findpkg_finish(FREETYPE)
+mark_as_advanced(FREETYPE_FT2BUILD_INCLUDE_DIR)
 if (NOT FREETYPE_FT2BUILD_INCLUDE_DIR STREQUAL FREETYPE_INCLUDE_DIR)
   set(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_FT2BUILD_INCLUDE_DIR})
 endif ()


cmake: Use search-specific-dirs-then-system-dirs idiom

An inconsistency was introduced with the previous fix to allow Cap'n Proto
installations in system directories to be found by CapnProtoTargets.cmake:
if the user installed Cap'n Proto in two locations, one of which is a
system directory, e.g. /usr and /somewhere/else, and set
PKG_CONFIG_PATH=/somewhere/else/lib/pkgconfig, the dependent project
would use headers from /somewhere/else/include, but libraries from /usr/lib.

This change resolves the inconsistency, allowing PKG_CONFIG_PATH to solely
control the location of the desired installation of Cap'n Proto.

--- c++/cmake/CapnProtoTargets.cmake
+++ c++/cmake/CapnProtoTargets.cmake
@@ -86,7 +86,14 @@
   find_library(CapnProto_${target}_IMPORTED_LOCATION
     NAMES ${target_name_shared} ${target_name_static}  # prefer libfoo-version.so over libfoo.a
     PATHS ${${target}_LIBRARY_DIRS}
+    NO_DEFAULT_PATH
   )
+  # If the installed version of Cap'n Proto is in a system location, pkg-config will not have filled
+  # in ${target}_LIBRARY_DIRS. To account for this, fall back to a regular search.
+  find_library(CapnProto_${target}_IMPORTED_LOCATION
+    NAMES ${target_name_shared} ${target_name_static}  # prefer libfoo-version.so over libfoo.a
+  )
+
   if(NOT CapnProto_${target}_IMPORTED_LOCATION)
     # Not an error if the library doesn't exist -- we may have found a lite mode installation.
     if(CapnProto_DEBUG)


cmake: Reenable several warnings

cmake: Reenable several warnings

--- cmake/CompilerWarnings.cmake
+++ cmake/CompilerWarnings.cmake
@@ -61,11 +61,12 @@
     -Wduplicated-branches # Warn when an if-else has identical branches.

     # disabled because these lead to false positives
+    -Wswitch
     #-Wswitch-enum   # Warn whenever a switch statement has an index of enumerated type and lacks a case for one or more of the named codes of that enumeration.
                     # case labels outside the enumeration range also provoke warnings when this option is used. The only difference between -Wswitch and this option is
                     # that this option gives a warning about an omitted enumeration code even if there is a default label.
-    # -Wsuggest-override # Warn about overriding virtual functions that are not marked with the override keyword.
-    # -Wsuggest-final-methods # Warn about virtual methods where code quality would be improved if the method were declared with the C++11 final specifier, or, if possible, its type were declared in an anonymous namespace or with the final specifier.
+    -Wsuggest-override # Warn about overriding virtual functions that are not marked with the override keyword.
+    -Wsuggest-final-methods # Warn about virtual methods where code quality would be improved if the method were declared with the C++11 final specifier, or, if possible, its type were declared in an anonymous namespace or with the final specifier.

     # disabled by christopher 2020/02/20


Update compiler warnings

Update compiler warnings

--- cmake/CompilerWarnings.cmake
+++ cmake/CompilerWarnings.cmake
@@ -1,61 +1,50 @@
-# credit: https://github.com/lefticus/cpp_starter_project
+# credit: https://github.com/cpp-best-practices/cpp_starter_project

 function(target_set_strict_warnings target_name)

   set(MSVC_WARNINGS
       /W4 # Baseline reasonable warnings
-      /w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss
-              # of data
-      /w14254 # 'operator': conversion from 'type1:field_bits' to
-              # 'type2:field_bits', possible loss of data
-      /w14263 # 'function': member function does not override any base class
-              # virtual member function
-      /w14265 # 'classname': class has virtual functions, but destructor is not
-              # virtual instances of this class may not be destructed correctly
+      /w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss of data
+      /w14254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data
+      /w14263 # 'function': member function does not override any base class virtual member function
+      /w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of this class may not
+              # be destructed correctly
       /w14287 # 'operator': unsigned/negative constant mismatch
-      /we4289 # nonstandard extension used: 'variable': loop control variable
-              # declared in the for-loop is used outside the for-loop scope
+      /we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside
+              # the for-loop scope
       /w14296 # 'operator': expression is always 'boolean_value'
       /w14311 # 'variable': pointer truncation from 'type1' to 'type2'
-      /w14545 # expression before comma evaluates to a function which is missing
-              # an argument list
+      /w14545 # expression before comma evaluates to a function which is missing an argument list
       /w14546 # function call before comma missing argument list
-      /w14547 # 'operator': operator before comma has no effect; expected
-              # operator with side-effect
-      /w14549 # 'operator': operator before comma has no effect; did you intend
-              # 'operator'?
+      /w14547 # 'operator': operator before comma has no effect; expected operator with side-effect
+      /w14549 # 'operator': operator before comma has no effect; did you intend 'operator'?
       /w14555 # expression has no effect; expected expression with side- effect
       /w14619 # pragma warning: there is no warning number 'number'
       /w14640 # Enable warning on thread un-safe static member initialization
-      /w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may
-              # cause unexpected runtime behavior.
+      /w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior.
       /w14905 # wide string literal cast to 'LPSTR'
       /w14906 # string literal cast to 'LPWSTR'
-      /w14928 # illegal copy-initialization; more than one user-defined
-              # conversion has been implicitly applied
+      /w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly applied
       /permissive- # standards conformance mode for MSVC compiler.
   )

   set(CLANG_WARNINGS
       -Wall
       -Wextra # reasonable and standard
-      -Wshadow # warn the user if a variable declaration shadows one from a
-               # parent context
-      -Wnon-virtual-dtor # warn the user if a class with virtual functions has a
-                         # non-virtual destructor. This helps catch hard to
-                         # track down memory errors
+      -Wshadow # warn the user if a variable declaration shadows one from a parent context
+      -Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps
+                         # catch hard to track down memory errors
       -Wold-style-cast # warn for c-style casts
       -Wcast-align # warn for potential performance problem casts
       -Wunused # warn on anything being unused
-      -Woverloaded-virtual # warn if you overload (not override) a virtual
-                           # function
+      -Woverloaded-virtual # warn if you overload (not override) a virtual function
       -Wpedantic # warn if non-standard C++ is used
       -Wconversion # warn on type conversions that may lose data
       -Wsign-conversion # warn on sign conversions
       -Wnull-dereference # warn if a null dereference is detected
       -Wdouble-promotion # warn if float is implicit promoted to double
-      -Wformat=2 # warn on security issues around functions that format output
-                 # (ie printf)
+      -Wformat=2 # warn on security issues around functions that format output (ie printf)
+      -Wimplicit-fallthrough # warn on statements that fallthrough without an explicit annotation
   )

   set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror)
@@ -63,12 +52,10 @@

   set(GCC_WARNINGS
       ${CLANG_WARNINGS}
-      -Wmisleading-indentation # warn if indentation implies blocks where blocks
-                               # do not exist
+      -Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist
       -Wduplicated-cond # warn if if / else chain has duplicated conditions
       -Wduplicated-branches # warn if if / else branches have duplicated code
-      -Wlogical-op # warn about logical operations being used where bitwise were
-                   # probably wanted
+      -Wlogical-op # warn about logical operations being used where bitwise were probably wanted
       -Wuseless-cast # warn if you perform a cast to the same type
   )


Do not set CH_IRRLICHT_SDKDIR if using Linux or Darwin

--- cmake/FindChronoEngine.cmake
+++ cmake/FindChronoEngine.cmake
@@ -348,9 +348,8 @@
     ##### ADDITIONAL DEPENDENCIES FOR CHRONOENGINE COMPONENTS

     if (${CH_USE_UNIT_IRRLICHT})
-        SET(CH_IRRLICHT_SDKDIR ""  CACHE PATH   "Where is your Irrlicht SDK installed? You must set this path to compile demos with 3D display.")
-
         IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
+            SET(CH_IRRLICHT_SDKDIR ""  CACHE PATH   "Where is your Irrlicht SDK installed? You must set this path to compile demos with 3D display.")
             IF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC")
                 FIND_LIBRARY( CH_IRRLICHTLIB NAMES Irrlicht PATHS "${CH_IRRLICHT_SDKDIR}/lib/Win32-visualstudio")
             ELSEIF ("${CH_COMPILER}" STREQUAL "COMPILER_MSVC_X64")


CUDA: allow to use external FindCUDA from modern CMake

CMake 3.9.0+ is required

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -8,14 +8,23 @@
   return()
 endif()

-set(CMAKE_MODULE_PATH "${OpenCV_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
-
-if(ANDROID)
-  set(CUDA_TARGET_OS_VARIANT "Android")
-endif()
-find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
-
-list(REMOVE_AT CMAKE_MODULE_PATH 0)
+
+if(((NOT CMAKE_VERSION VERSION_LESS "3.9.0")  # requires https://gitlab.kitware.com/cmake/cmake/merge_requests/663
+      OR OPENCV_CUDA_FORCE_EXTERNAL_CMAKE_MODULE)
+    AND NOT OPENCV_CUDA_FORCE_BUILTIN_CMAKE_MODULE)
+  ocv_update(CUDA_LINK_LIBRARIES_KEYWORD "LINK_PRIVATE")
+  find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
+else()
+  # Use OpenCV's patched "FindCUDA" module
+  set(CMAKE_MODULE_PATH "${OpenCV_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
+
+  if(ANDROID)
+    set(CUDA_TARGET_OS_VARIANT "Android")
+  endif()
+  find_host_package(CUDA "${MIN_VER_CUDA}" QUIET)
+
+  list(REMOVE_AT CMAKE_MODULE_PATH 0)
+endif()

 if(CUDA_FOUND)
   set(HAVE_CUDA 1)


Update OpenCVFindMatlab.cmake

Update OpenCVFindMatlab.cmake

Added fix to OpenCVFindMatlab.cmake to properly locate modern versions of unix- MATLAB.  Tested with MATLAB R2015a and Ubuntu 14.04.

--- cmake/OpenCVFindMatlab.cmake
+++ cmake/OpenCVFindMatlab.cmake
@@ -62,7 +62,7 @@
     # possible root locations, in order of likelihood
     set(SEARCH_DIRS_ /Applications /usr/local /opt/local /usr /opt)
     foreach (DIR_ ${SEARCH_DIRS_})
-      file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/*matlab*)
+      file(GLOB MATLAB_ROOT_DIR_ ${DIR_}/MATLAB/R*)
       if (MATLAB_ROOT_DIR_)
         # sort in order from highest to lowest
         # normally it's in the format MATLAB_R[20XX][A/B]


Organize DEFINEs for MSVC in cmake. Add FREEIMAGE_LIB define.

--- cmake/PlatformSpecific.cmake
+++ cmake/PlatformSpecific.cmake
@@ -38,13 +38,26 @@
 	message(STATUS "MSVC")

 	# Change warning level to something saner
-  # Force to always compile with W3
-  if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-    string(REGEX REPLACE "/W[0-4]" "/W3" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-  else()
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
-  endif()
+	# Force to always compile with W3
+	if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
+		string(REGEX REPLACE "/W[0-4]" "/W3" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+	else()
+		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
+	endif()

+	# Minimizes Windows header files
+	ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN)
+	# Do not define MIN and MAX macros
+	ADD_DEFINITIONS(-DNOMINMAX)
+	# Do not warn about standard but insecure functions
+	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
+	# Enable Unicode
+	ADD_DEFINITIONS(-D_UNICODE)
+	# Use static FreeImage
+	ADD_DEFINITIONS(-DFREEIMAGE_LIB)
+	# Enable SSE2/SSE/MMX
+	ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
+
 	IF(MSVC90)
 		message(STATUS "Version 9")
 		# Whole Program Opt. gui display fixed in cmake 2.8.5
@@ -64,11 +77,6 @@
 		# currently not in release version but should be soon - in meantime linker will inform you about switching this flag automatically because of /GL
 		set(MSVC_RELEASE_LINKER_FLAGS "/LTCG")
 		set(STATIC_LIBRARY_FLAGS_RELEASE "${STATIC_LIBRARY_FLAGS_RELEASE} ${MSVC_RELEASE_LINKER_FLAGS}")
-
-		# Definitions.
-		ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
-		ADD_DEFINITIONS(-D_UNICODE -DUNICODE)
-		ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)

 	ENDIF(MSVC90)

@@ -92,14 +100,8 @@
 		set(MSVC_RELEASE_LINKER_FLAGS "/LTCG")
 		set(STATIC_LIBRARY_FLAGS_RELEASE "${STATIC_LIBRARY_FLAGS_RELEASE} ${MSVC_RELEASE_LINKER_FLAGS}")

-		# Definitions.
-		ADD_DEFINITIONS(-D__SSE2__ -D__SSE__ -D__MMX__)
-		ADD_DEFINITIONS(-D_UNICODE -DUNICODE)
-		ADD_DEFINITIONS(-DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
+	ENDIF(MSVC10)

-	ENDIF(MSVC10)
-
-	ADD_DEFINITIONS(-DNOMINMAX)
 ENDIF(MSVC)


[axl_cmake] added -Wno-xxx as defaults to Xcode-specific warnings

CMake uses -Wmost in Xcode generator, so we need to suppress more

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -414,24 +414,6 @@
 		"-Wno-stringop-overflow"
 		)

-	axl_create_compiler_flag_setting(
-		GCC_FLAG_WARNING_MISSING_BRACES
-		DESCRIPTION "Warn about missing braces in aggregate initializers"
-		"-Wmissing-braces" "-Wno-missing-braces"
-		)
-
-	axl_create_compiler_flag_setting(
-		GCC_FLAG_WARNING_UNUSED_VARIABLE
-		DESCRIPTION "Warn about unused variables"
-		"-Wunused-variable" "-Wno-unused-variable"
-		)
-
-	axl_create_compiler_flag_setting(
-		GCC_FLAG_WARNING_UNUSED_VALUE
-		DESCRIPTION "Warn about unused expressions"
-		"-Wunused-value" "-Wno-unused-value"
-		)
-
 	# C++ specific warnings

 	axl_create_compiler_flag_setting(
@@ -448,11 +430,37 @@
 		"-Wnarrowing" "-Wno-narrowing"
 		)

-	axl_create_compiler_flag_setting(
-		GCC_FLAG_CPP_WARNING_DELETE_NON_VIRTUAL_DTOR
-		DESCRIPTION "Warn about calling non-virtual dtor of a class with virtual funtions"
-		"-Wdelete-non-virtual-dtor" "-Wno-delete-non-virtual-dtor"
-		)
+	# these warnings only pop up with -Wmost (hardcoded by the Xcode generator)
+
+	if (CMAKE_GENERATOR MATCHES "Xcode")
+		axl_create_compiler_flag_setting(
+			GCC_FLAG_WARNING_MISSING_BRACES
+			DESCRIPTION "Warn about missing braces in aggregate initializers"
+			DEFAULT "-Wno-missing-braces"
+			"-Wmissing-braces" "-Wno-missing-braces"
+			)
+
+		axl_create_compiler_flag_setting(
+			GCC_FLAG_WARNING_UNUSED_VARIABLE
+			DESCRIPTION "Warn about unused variables"
+			DEFAULT "-Wno-unused-variable"
+			"-Wunused-variable" "-Wno-unused-variable"
+			)
+
+		axl_create_compiler_flag_setting(
+			GCC_FLAG_WARNING_UNUSED_VALUE
+			DESCRIPTION "Warn about unused expressions"
+			DEFAULT "-Wno-unused-value"
+			"-Wunused-value" "-Wno-unused-value"
+			)
+
+		axl_create_compiler_flag_setting(
+			GCC_FLAG_CPP_WARNING_DELETE_NON_VIRTUAL_DTOR
+			DESCRIPTION "Warn about calling non-virtual dtor of a class with virtual funtions"
+			DEFAULT "-Wno-delete-non-virtual-dtor"
+			"-Wdelete-non-virtual-dtor" "-Wno-delete-non-virtual-dtor"
+			)
+	endif()

 	# the cppcheck static analyzer (introduced in CMake 3.10)


[cmake] disable pch for clang for now (apparently, there are some clang-specific issues to be worked out; pct settings for gcc do not work out-of-the-box)

--- cmake/axl_std_settings.cmake
+++ cmake/axl_std_settings.cmake
@@ -156,11 +156,15 @@
 macro (
 axl_create_gcc_settings)

-	option (
-		GCC_USE_PCH
-		"Use precompiled headers in GNU C/C++"
-		ON
-		)
+	if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+		unset (GCC_USE_PCH CACHE) # axl pch does not work on clang yet
+	else ()
+		option (
+			GCC_USE_PCH
+			"Use precompiled headers in GNU C/C++"
+			ON
+			)
+	endif ()

 	axl_create_c_cxx_flag_setting (
 		GCC_FLAG_SHOW_INCLUDES


fix wrong commitID with patch file of warpctc (#21755)

--- cmake/external/warpctc.cmake
+++ cmake/external/warpctc.cmake
@@ -18,7 +18,7 @@
 SET(WARPCTC_SOURCE_DIR ${THIRD_PARTY_PATH}/warpctc/src/extern_warpctc)
 SET(WARPCTC_INSTALL_DIR ${THIRD_PARTY_PATH}/install/warpctc)
 set(WARPCTC_REPOSITORY https://github.com/baidu-research/warp-ctc)
-set(WARPCTC_TAG        14858fef201244c983f5f965d2166379bf3f11a5)
+set(WARPCTC_TAG        6d5b8fac130638862d97dc48ef43a8d7b5a503bb)

 SET(WARPCTC_INCLUDE_DIR "${WARPCTC_INSTALL_DIR}/include"
     CACHE PATH "Warp-ctc Directory" FORCE)
@@ -41,7 +41,7 @@
     file(TO_NATIVE_PATH ${WARPCTC_SOURCE_DIR} native_dst)
     set(WARPCTC_PATCH_COMMAND xcopy ${native_src} ${native_dst} /E/Y)
 else()
-    set(WARPCTC_PATCH_COMMAND cp -r ${PADDLE_SOURCE_DIR}/patches/warpctc ${THIRD_PARTY_PATH})
+    set(WARPCTC_PATCH_COMMAND cp -r ${PADDLE_SOURCE_DIR}/patches/warpctc/ ${WARPCTC_SOURCE_DIR})
 endif()

 ExternalProject_Add(


Add support for emitting sib files to _compile_swift_files.

I am going to use this to enable the perftestsuite to compile .sib files next to
.o files. It will make it easier to work with the PerfTestSuite for the perf
engineers.

Swift SVN r30885

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -202,10 +202,11 @@
 #     [MODULE_NAME]                     # The module name. If not specified, the name
 #                                       # is derived from the output name
 #     [IS_STDLIB]                       # Install produced files.
+#     [EMIT_SIB]                        # Emit the file as a sib file instead of a .o
 #     )
 function(_compile_swift_files dependency_target_out_var_name)
   cmake_parse_arguments(SWIFTFILE
-    "IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY"
+    "IS_MAIN;IS_STDLIB;IS_STDLIB_CORE;IS_SDK_OVERLAY;EMIT_SIB"
     "OUTPUT;MODULE_NAME;INSTALL_IN_COMPONENT"
     "SOURCES;FLAGS;DEPENDS;SDK;ARCHITECTURE;API_NOTES;OPT_FLAGS;MODULE_DIR"
     ${ARGN})
@@ -343,11 +344,17 @@
       message(FATAL_ERROR "Don't know where to put the module files")
     endif()

-    set(module_file "${module_dir}/${module_name}.swiftmodule")
-    set(module_doc_file "${module_dir}/${module_name}.swiftdoc")
-    list(APPEND swift_flags
-        "-parse-as-library"
-        "-emit-module" "-emit-module-path" "${module_file}")
+    if (NOT SWIFTFILE_EMIT_SIB)
+      # Right now sib files seem to not be output when we emit a module. So
+      # don't emit it.
+      set(module_file "${module_dir}/${module_name}.swiftmodule")
+      set(module_doc_file "${module_dir}/${module_name}.swiftdoc")
+      list(APPEND swift_flags
+          "-parse-as-library"
+          "-emit-module" "-emit-module-path" "${module_file}")
+    else()
+      list(APPEND swift_flags "-parse-as-library")
+    endif()

     list(APPEND command_create_dirs
         COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
@@ -371,25 +378,29 @@
   set(command_create_apinotes)
   set(depends_create_apinotes)
   set(apinote_files)
-  foreach(apinote_module ${SWIFTFILE_API_NOTES})
-    set(apinote_file "${module_dir}/${apinote_module}.apinotesc")
-    set(apinote_input_file
+
+  # If we use sib don't emit api notes for now.
+  if (NOT SWIFTFILE_EMIT_SIB)
+    foreach(apinote_module ${SWIFTFILE_API_NOTES})
+      set(apinote_file "${module_dir}/${apinote_module}.apinotesc")
+      set(apinote_input_file
         "${SWIFT_API_NOTES_PATH}/${apinote_module}.apinotes")
-    set(CLANG_APINOTES "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang")
-
-    list(APPEND command_create_apinotes
+      set(CLANG_APINOTES "${SWIFT_NATIVE_CLANG_TOOLS_PATH}/clang")
+
+      list(APPEND command_create_apinotes
         COMMAND
-          "${CLANG_APINOTES}" "-cc1apinotes" "-yaml-to-binary"
-          "-o" "${apinote_file}"
-          "-target" "${SWIFT_SDK_${SWIFTFILE_SDK}_ARCH_${SWIFTFILE_ARCHITECTURE}_TRIPLE}"
-          "${apinote_input_file}")
-    list(APPEND depends_create_apinotes "${apinote_input_file}")
-
-    list(APPEND apinote_files "${apinote_file}")
-    swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
+        "${CLANG_APINOTES}" "-cc1apinotes" "-yaml-to-binary"
+        "-o" "${apinote_file}"
+        "-target" "${SWIFT_SDK_${SWIFTFILE_SDK}_ARCH_${SWIFTFILE_ARCHITECTURE}_TRIPLE}"
+        "${apinote_input_file}")
+      list(APPEND depends_create_apinotes "${apinote_input_file}")
+
+      list(APPEND apinote_files "${apinote_file}")
+      swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
         FILES ${apinote_file}
         DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}")
-  endforeach()
+    endforeach()
+  endif()

   set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive")
   set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
@@ -404,6 +415,12 @@
   set(output_option)
   if (${num_outputs} EQUAL 1)
     set(output_option "-o" ${first_output})
+  endif()
+
+  set(main_command "-c")
+  if (SWIFTFILE_EMIT_SIB)
+    # Change the command to emit-sib if we are asked to emit sib
+    set(main_command "-emit-sib")
   endif()

   add_custom_command_target(
@@ -414,7 +431,7 @@
       ${command_create_apinotes}
       COMMAND
         "${line_directive_tool}" "${source_files}" --
-        "${swift_compiler_tool}" "-c" ${swift_flags}
+        "${swift_compiler_tool}" "${main_command}" ${swift_flags}
         ${output_option} "${source_files}"
       OUTPUT
         ${SWIFTFILE_OUTPUT} "${module_file}" "${module_doc_file}"


Re-enable SLPVectorizer in stdlib build (revert r24342 and r24345)

The SLPVectorizer is now faster (rdar://problem/19430955): it needs 2.5% of stdlib compile time.
Related radar: rdar://problem/19433841

Swift SVN r24511

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -333,16 +333,11 @@
     list(APPEND swift_flags "-Xfrontend" "-emit-sorted-sil")
   endif()

-  # FIXME: Remove -disable-llvm-slp-vectorizer
-  #        (rdar://problem/19433841) once the underlying LLVM issue is
-  #        resolved (rdar://problem/19430955).
-
   # FIXME: Cleaner way to do this?
   if(SWIFTFILE_IS_STDLIB_CORE)
     list(APPEND swift_flags
         "-nostdimport" "-parse-stdlib" "-module-name" "Swift"
-        "-Xfrontend" "-sil-serialize-all" "-Xfrontend"
-        "-disable-llvm-slp-vectorizer")
+        "-Xfrontend" "-sil-serialize-all")
   endif()

   if(SWIFTFILE_IS_SDK_OVERLAY)


add_swift_host_tool: DCE SWIFT_MODULE_DEPENDS (NFC)

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -2361,8 +2361,7 @@
   set(ADDSWIFTHOSTTOOL_multiple_parameter_options
         SWIFT_COMPONENT
         COMPILE_FLAGS
-        DEPENDS
-        SWIFT_MODULE_DEPENDS)
+        DEPENDS)

   cmake_parse_arguments(
       ADDSWIFTHOSTTOOL # prefix
@@ -2370,15 +2369,6 @@
       "" # single-value args
       "${ADDSWIFTHOSTTOOL_multiple_parameter_options}" # multi-value args
       ${ARGN})
-
-  # Configure variables for this subdirectory.
-  set(VARIANT_SUFFIX "-${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR}-${SWIFT_HOST_VARIANT_ARCH}")
-  set(MODULE_VARIANT_SUFFIX "-swiftmodule${VARIANT_SUFFIX}")
-
-  foreach(mod ${ADDSWIFTHOSTTOOL_SWIFT_MODULE_DEPENDS})
-    list(APPEND ADDSWIFTHOSTTOOL_DEPENDS "swift${mod}${MODULE_VARIANT_SUFFIX}")
-    list(APPEND ADDSWIFTHOSTTOOL_DEPENDS "swift${mod}${VARIANT_SUFFIX}")
-  endforeach()

   # Create the executable rule.
   add_swift_executable(


Squashed 'cmake/yacma/' changes from 32b12a9b..4244193e

4244193e Tentative YACMA updates.

git-subtree-dir: cmake/yacma
git-subtree-split: 4244193e465f45c7915ca52479363a1b30560e1d

--- YACMACompilerLinkerSettings.cmake
+++ YACMACompilerLinkerSettings.cmake
@@ -112,6 +112,13 @@
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wsizeof-array-div)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wxor-used-as-pow)
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wfinal-dtor-non-final-class)
+        # New warnings in clang 11.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wpointer-to-int-cast)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wuninitialized-const-reference)
+        # New warnings in clang 13.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wunused-but-set-parameter)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wunused-but-set-variable)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wnull-pointer-subtraction)
         # NOTE: this is a new flag in Clang 13 which seems to give
         # incorrect warnings for UDLs.
         _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-reserved-identifier)
@@ -171,6 +178,12 @@
             message(STATUS "Activating the '-Wno-maybe-uninitialized' workaround for GCC.")
             _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wno-maybe-uninitialized)
         endif()
+        # From GCC 10.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wmismatched-tags)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wredundant-tags)
+        # From GCC 12.
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Warray-compare)
+        _YACMA_CHECK_ENABLE_DEBUG_CXX_FLAG(-Wmissing-requires)
     endif()

     # MSVC setup.


Do not force OSX arch flags, fix them for ARM

Do not use `FORCE` here, if the user truly wants to override these flags we should let them.  Furthermore, the correct value for the `CMAKE_OSX_ARCHITECTURE` flag for ARM (ie, an IPhone build target) is actually `arm`, not `x86_64;i386`.

--- standard/SetStandardOutputVariables.cmake
+++ standard/SetStandardOutputVariables.cmake
@@ -12,7 +12,11 @@
 ]]
 macro(set_standard_output_variables)
   if(APPLE)
-    set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures" FORCE)
+    if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm")
+      set(CMAKE_OSX_ARCHITECTURES "arm" CACHE STRING "Mac OS X build architectures")
+    else()
+      set(CMAKE_OSX_ARCHITECTURES "x86_64;i386" CACHE STRING "Mac OS X build architectures")
+    endif()
   endif()

   if(CMAKE_COMPILER_IS_GNUCC)


Fix lcm_option eating variables from packages

Change lcm_option into a macro, so that it does not "consume" (by scope
limiting) variables that might be set by finding required packages. In
particular, this, along with ff031969461, was causing the Python version
variables to be "lost" to the parent scope.

--- lcm-cmake/functions.cmake
+++ lcm-cmake/functions.cmake
@@ -9,18 +9,19 @@
 endfunction()

 #------------------------------------------------------------------------------
-function(lcm_option NAME DOCSTRING TEST)
+macro(lcm_option NAME DOCSTRING TEST)
   find_package(${ARGN})
   if(${TEST})
-    set(default ON)
+    set(_${NAME}_DEFAULT ON)
   else()
-    set(default OFF)
+    set(_${NAME}_DEFAULT OFF)
   endif()
-  option(${NAME} ${DOCSTRING} ${default})
+  option(${NAME} ${DOCSTRING} ${_${NAME}_DEFAULT})
+  unset(_${NAME}_DEFAULT)
   if(${NAME})
     find_package(${ARGN} REQUIRED)
   endif()
-endfunction()
+endmacro()

 #------------------------------------------------------------------------------
 function(lcm_copy_file_target TARGET INPUT OUTPUT)


Added macros for appending flags

Added macros for appending flags

--- build/macros.cmake
+++ build/macros.cmake
@@ -192,6 +192,25 @@
 	endif()
 endmacro()

+macro(append_all_compiler_flag _flag)
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${_flag}")
+endmacro()
+
+macro(append_debug_compiler_flag _flag)
+	set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${_flag}")
+	set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${_flag}")
+endmacro()
+
+macro(append_release_compiler_flag _flag)
+	set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${_flag}")
+	set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${_flag}")
+	set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${_flag}")
+	set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${_flag}")
+	set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${_flag}")
+	set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${_flag}")
+endmacro()
+
 macro(enable_fast_floating_point _enable)
 	get_compiler_name(COMPILER)
 	if(${_enable})


- Fix never-ending build on OSX

- Fix never-ending build on OSX

--- cmake/Modules/BuildLibrary.cmake
+++ cmake/Modules/BuildLibrary.cmake
@@ -172,9 +172,11 @@
         BUNDLE_RSRCS BUNDLE_HDRS
         LIBRARIES BUNDLE_LIBRARIES)
     if(APPLE AND NOT IOS)
-        file ( GLOB_RECURSE ${TARGET}_HEADERS
-            ${HEADER_DIR}/*
-            )
+        if(HEADER_DIR)
+            file ( GLOB_RECURSE ${TARGET}_HEADERS
+                ${HEADER_DIR}/*
+                )
+        endif()
         source_group ( "${TARGET}_headers" FILES ${ALL_HEADERS} )

         MACFRAMEWORK_PACKAGE(


Fix QtCore dependency on Windows

Fix QtCore dependency on Windows

--- cmake/Qt5Core_HunterPlugin.cmake
+++ cmake/Qt5Core_HunterPlugin.cmake
@@ -43,7 +43,15 @@

   _qt_cmake_extra_helpers_add_interface(Qt5::Core "dl")
 elseif(MSVC)
-  #
+  # defined: '_pcre16_compile2'
+  _qt_cmake_extra_helpers_add_interface_release_debug(
+      Qt5::Core
+      "${_qt_install_prefix}/lib/qtpcre.lib"
+      "${_qt_install_prefix}/lib/qtpcred.lib"
+  )
+
+  # defined: '_WSAAsyncSelect'
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core ws2_32)
 elseif(MINGW)
   #
 endif()


added debian 7 support

added debian 7 support

make them all have no dep

--- cmake/ElektraPackaging.cmake
+++ cmake/ElektraPackaging.cmake
@@ -69,11 +69,14 @@
 		# thus only one package is build you must list here *any* depending libraries,
 		# even if they are only used in one module
 		if ("${LSB_DISTRIB}" MATCHES "Debian5.*")
-			set (CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2-dev")
+			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ")
 		endif ("${LSB_DISTRIB}" MATCHES "Debian5.*")
 		if ("${LSB_DISTRIB}" MATCHES "Debian6.*")
-			set (CPACK_DEBIAN_PACKAGE_DEPENDS "libxml2-dev")
+			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ")
 		endif ("${LSB_DISTRIB}" MATCHES "Debian6.*")
+		if ("${LSB_DISTRIB}" MATCHES "Debian7.*")
+			set (CPACK_DEBIAN_PACKAGE_DEPENDS " ") # if build with no plugins
+		endif ("${LSB_DISTRIB}" MATCHES "Debian7.*")
 		if (NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
 			message ("WARNING: ${LSB_DISTRIB} not supported yet.\nPlease set deps in cmake/ElektraPackaging.cmake before packaging.")
 		endif (NOT CPACK_DEBIAN_PACKAGE_DEPENDS)


* stop showing old generations   * keep it possible to build for old CC   * make sure old generations don't come up for the choice   * remove related version check of old one

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -78,7 +78,12 @@

   message(STATUS "CUDA detected: " ${CUDA_VERSION})

-  set(_generations "Fermi" "Kepler" "Maxwell" "Pascal" "Volta" "Turing" "Ampere")
+  OCV_OPTION(CUDA_ENABLE_DEPRECATED_GENERATION "Enable deprecated generations in the list" OFF)
+  set(_generations "Maxwell" "Pascal" "Volta" "Turing" "Ampere")
+  if(CUDA_ENABLE_DEPRECATED_GENERATION)
+    set(_generations "Fermi" "${_generations}")
+    set(_generations "Kepler" "${_generations}")
+  endif()
   set(_arch_fermi   "2.0")
   set(_arch_kepler  "3.0;3.5;3.7")
   set(_arch_maxwell "5.0;5.2")
@@ -199,10 +204,6 @@
     endif()
   endmacro()

-  macro(ocv_wipeout_deprecated _arch_bin_list)
-    string(REPLACE "2.1" "2.1(2.0)" ${_arch_bin_list} "${${_arch_bin_list}}")
-  endmacro()
-
   set(__cuda_arch_ptx "")
   if(CUDA_GENERATION STREQUAL "Fermi")
     set(__cuda_arch_bin ${_arch_fermi})
@@ -265,7 +266,6 @@
       )
     endif()
   endif()
-  ocv_wipeout_deprecated(__cuda_arch_bin)

   set(CUDA_ARCH_BIN ${__cuda_arch_bin} CACHE STRING "Specify 'real' GPU architectures to build binaries for, BIN(PTX) format is supported")
   set(CUDA_ARCH_PTX ${__cuda_arch_ptx} CACHE STRING "Specify 'virtual' PTX architectures to build PTX intermediate code for")
@@ -273,10 +273,14 @@
   string(REGEX REPLACE "\\." "" ARCH_BIN_NO_POINTS "${CUDA_ARCH_BIN}")
   string(REGEX REPLACE "\\." "" ARCH_PTX_NO_POINTS "${CUDA_ARCH_PTX}")

-  # Check if user specified 1.0 compute capability: we don't support it
-  if(" ${CUDA_ARCH_BIN} ${CUDA_ARCH_PTX}" MATCHES " 1.0")
-    message(SEND_ERROR "CUDA: 1.0 compute capability is not supported - exclude it from ARCH/PTX list are re-run CMake")
-  endif()
+  # Check if user specified 1.0/2.1 compute capability: we don't support it
+  macro(ocv_wipeout_deprecated_cc target_cc)
+    if(" ${CUDA_ARCH_BIN} ${CUDA_ARCH_PTX}" MATCHES " ${target_cc}")
+      message(SEND_ERROR "CUDA: ${target_cc} compute capability is not supported - exclude it from ARCH/PTX list and re-run CMake")
+    endif()
+  endmacro()
+  ocv_wipeout_deprecated_cc("1.0")
+  ocv_wipeout_deprecated_cc("2.1")

   # NVCC flags to be set
   set(NVCC_FLAGS_EXTRA "")


Bugfix: Detect CUDA archs for Windows

Bugfix: Detect CUDA archs for Windows

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -68,6 +68,12 @@
     endif()
     unset(CUDA_ARCH_BIN CACHE)
     unset(CUDA_ARCH_PTX CACHE)
+  endif()
+
+  SET(DETECT_ARCHS_COMMAND "${CUDA_NVCC_EXECUTABLE}" ${CUDA_NVCC_FLAGS} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run")
+  if(WIN32 AND CMAKE_LINKER) #Workaround for VS cl.exe not being in the env. path
+    get_filename_component(host_compiler_bindir ${CMAKE_LINKER} DIRECTORY)
+    SET(DETECT_ARCHS_COMMAND ${DETECT_ARCHS_COMMAND} "-ccbin" "${host_compiler_bindir}")
   endif()

   set(__cuda_arch_ptx "")
@@ -82,10 +88,11 @@
   elseif(CUDA_GENERATION STREQUAL "Volta")
     set(__cuda_arch_bin "7.0")
   elseif(CUDA_GENERATION STREQUAL "Auto")
-    execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${CUDA_NVCC_FLAGS} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
+    execute_process( COMMAND ${DETECT_ARCHS_COMMAND}
                      WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
                      RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
                      ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+    string(REGEX REPLACE ".*\n" "" _nvcc_out "${_nvcc_out}") #Strip leading warning messages, if any
     if(NOT _nvcc_res EQUAL 0)
       message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
     else()
@@ -99,10 +106,11 @@
       set(__cuda_arch_bin "3.2")
       set(__cuda_arch_ptx "")
     elseif(AARCH64)
-      execute_process( COMMAND "${CUDA_NVCC_EXECUTABLE}" ${CUDA_NVCC_FLAGS} "${OpenCV_SOURCE_DIR}/cmake/checks/OpenCVDetectCudaArch.cu" "--run"
+      execute_process( COMMAND ${DETECT_ARCHS_COMMAND}
                        WORKING_DIRECTORY "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/"
                        RESULT_VARIABLE _nvcc_res OUTPUT_VARIABLE _nvcc_out
                        ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
+      string(REGEX REPLACE ".*\n" "" _nvcc_out "${_nvcc_out}") #Strip leading warning messages, if any
       if(NOT _nvcc_res EQUAL 0)
         message(STATUS "Automatic detection of CUDA generation failed. Going to build for all known architectures.")
         set(__cuda_arch_bin "5.3 6.2 7.0")


fixed CUDA_FAST_MATH flag

fixed CUDA_FAST_MATH flag

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -81,7 +81,7 @@

   OCV_OPTION(CUDA_FAST_MATH  "Enable --use_fast_math for CUDA compiler " OFF)

-  if(ENABLE_CUDA_MATH)
+  if(CUDA_FAST_MATH)
     set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --use_fast_math)
   endif()


Remove quotation marks as they confuse cmake

--- cmake/PlatformLinuxGCC.cmake
+++ cmake/PlatformLinuxGCC.cmake
@@ -60,9 +60,9 @@

 if (CMAKE_COMPILER_IS_GNUCXX)
     if (NOT (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "4.9"))
-        set(LINUX_COMPILE_FLAGS "${LINUX_COMPILE_FLAGS}
+        set(LINUX_COMPILE_FLAGS ${LINUX_COMPILE_FLAGS}
             -Wno-error=float-conversion
-        ")
+        )
     endif ()
 endif ()


build: specify the Windows family when building for Windows

`_pipe` is only available in the Desktop App family.  Indicate to msvcrt
that we wish to use the desktop app family windows APIs.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -133,6 +133,8 @@
     list(APPEND result "-DLLVM_ON_WIN32")
     list(APPEND result "-D_CRT_SECURE_NO_WARNINGS")
     list(APPEND result "-D_CRT_NONSTDC_NO_WARNINGS")
+    # TODO(compnerd) permit building for different families
+    list(APPEND result "-D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP")
     # TODO(compnerd) handle /MT
     list(APPEND result "-D_DLL")
     list(APPEND result "-fms-compatibility-version=1900")


pass gio-unix includes to compiler

pass gio-unix includes to compiler

--- cmake/modules/FindGLIB.cmake
+++ cmake/modules/FindGLIB.cmake
@@ -101,6 +101,7 @@
         # are separate from the shared glib ones. Since this is currently only used
         # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
         pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
+        include_directories(${GIO_UNIX_INCLUDE_DIRS})
     endif ()
 endforeach ()


cmake: Install llvm-tblgen again

cmake: Install llvm-tblgen again

It was removed in r189130, but it turns out this makes life hard for
folks packaging LLVM and Clang and building the latter based on the
LLVM package.

Note that this only adds back the LLVM tblgen, and it's obviously
not included when LLVM_INSTALL_TOOLCHAIN_ONLY is set.

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

--- cmake/modules/TableGen.cmake
+++ cmake/modules/TableGen.cmake
@@ -136,4 +136,8 @@
   if( LLVM_ENABLE_THREADS AND HAVE_LIBPTHREAD AND NOT BEOS )
     target_link_libraries(${target} pthread)
   endif()
+
+  if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+    install(TARGETS ${target} RUNTIME DESTINATION bin)
+  endif()
 endmacro()


Tweak whitespace

Tweak whitespace

svn path=/trunk/; revision=6758

--- cmake/modules/instdirs.cmake
+++ cmake/modules/instdirs.cmake
@@ -61,7 +61,3 @@

 set(LIB_DIR_CMD "-L${LIB_DIR}")
 set(INCLUDE_DIR_CMD "-I${INCLUDE_DIR}")
-
-
-
-


Support plain checkout, i.e., LIBXSMMROOT pointing to directory that does not stem from installing LIBXSMM (make install). Updated LIBXSMM (fetch).

--- cmake/third_party/xsmm.cmake
+++ cmake/third_party/xsmm.cmake
@@ -6,15 +6,21 @@
 if(LIBXSMMROOT AND NOT LIBXSMMFETCH)
   message(STATUS "Found LIBXSMM (${LIBXSMMROOT})")
   file(GLOB XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/include/libxsmm/*.c)
-  list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/include/libxsmm/libxsmm_generator_gemm_driver.c)
+
+  if(${XSMM_SRCS})
+    list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/include/libxsmm/libxsmm_generator_gemm_driver.c)
+  else()
+    file(GLOB XSMM_SRCS LIST_DIRECTORIES false CONFIGURE_DEPENDS ${LIBXSMMROOT}/src/*.c)
+    list(REMOVE_ITEM XSMM_SRCS ${LIBXSMMROOT}/src/libxsmm_generator_gemm_driver.c)
+  endif()
 else()
   message(STATUS "Fetching LIBXSMM")
   include(FetchContent)

   FetchContent_Declare(
     xsmm
-    URL https://github.com/libxsmm/libxsmm/archive/f58b32fb89c52a1a074c1de1ec19f8cd07ddbeb1.tar.gz
-    URL_HASH SHA256=23ef5b38d538067db5cfe3d5027973abb59761cbf53152e98429010069a06530
+    URL https://github.com/libxsmm/libxsmm/archive/e6eedc0ef1f34aa640375b93bd9e964e4823abd8.tar.gz
+    URL_HASH SHA256=fa6615a4ed6dc35cf344301acd868165ae4416eaff81614f12a8c384b7c1e84d
   )

   FetchContent_GetProperties(xsmm)


pathelf -> makeself -> package-tools dependency for unix

--- SuperBuild/CMake/External_pkgtools.cmake
+++ SuperBuild/CMake/External_pkgtools.cmake
@@ -7,7 +7,7 @@
 set(PATCHELF_STAMP_DIR   "${PKGTOOLS_SB_PREFIX_DIR}/stamp/patchelf")
 set(PATCHELF_TMP_DIR     "${PKGTOOLS_SB_PREFIX_DIR}/tmp/patchelf")

-#This variable is referenced in PMacros.cmake
+#This variable is referenced in CreateCMakeProjects.cmake
 set(PATCHELF_PROGRAM "${PATCHELF_SOURCE_DIR}/src/patchelf")

@@ -16,7 +16,7 @@
 set(MAKESELF_STAMP_DIR   "${PKGTOOLS_SB_PREFIX_DIR}/stamp/makeself")
 set(MAKESELF_TMP_DIR     "${PKGTOOLS_SB_PREFIX_DIR}/tmp/makeself")

-#This variable is referenced in PMacros.cmake
+#This variable is referenced in CreateCMakeProjects.cmake
 set(MAKESELF_SCRIPT "${MAKESELF_SOURCE_DIR}/makeself.sh")

 if( __EXTERNAL_PACKAGE_TOOLS__)
@@ -32,6 +32,25 @@

 include(ExternalProject)

+
+if(APPLE)
+  add_custom_target(PATCHELF)
+else()
+  ExternalProject_Add(PATCHELF
+    PREFIX "${PKGTOOLS_SB_PREFIX_DIR}"
+    URL                 "http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2"
+    URL_MD5             d02687629c7e1698a486a93a0d607947
+    DOWNLOAD_DIR        "${DOWNLOAD_LOCATION}"
+    SOURCE_DIR          "${PATCHELF_SOURCE_DIR}"
+    BINARY_DIR          "${PATCHELF_SOURCE_DIR}"
+    INSTALL_DIR         "${PATCHELF_INSTALL_DIR}"
+    STAMP_DIR           "${PATCHELF_STAMP_DIR}"
+    TMP_DIR             "${PATCHELF_TMP_DIR}"
+    CONFIGURE_COMMAND "./configure" "--prefix" "${PATCHELF_INSTALL_DIR}"
+    INSTALL_COMMAND ""
+    )
+endif()
+
 ExternalProject_Add(MAKESELF
   PREFIX            "${PKGTOOLS_SB_PREFIX_DIR}"
   URL               "https://www.orfeo-toolbox.org/packages/makeself-2.2.0.tar.gz"
@@ -45,26 +64,7 @@
   CONFIGURE_COMMAND ""
   BUILD_COMMAND ""
   INSTALL_COMMAND ""
+  DEPENDS PATCHELF
   )

-if(APPLE)
-  add_custom_target(PATCHELF)
-  return()
-endif()
-
-ExternalProject_Add(PATCHELF
-  PREFIX "${PKGTOOLS_SB_PREFIX_DIR}"
-  URL                 "http://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.bz2"
-  URL_MD5             d02687629c7e1698a486a93a0d607947
-  DOWNLOAD_DIR        "${DOWNLOAD_LOCATION}"
-  SOURCE_DIR          "${PATCHELF_SOURCE_DIR}"
-  BINARY_DIR          "${PATCHELF_SOURCE_DIR}"
-  INSTALL_DIR         "${PATCHELF_INSTALL_DIR}"
-  STAMP_DIR           "${PATCHELF_STAMP_DIR}"
-  TMP_DIR             "${PATCHELF_TMP_DIR}"
-  CONFIGURE_COMMAND "./configure" "--prefix" "${PATCHELF_INSTALL_DIR}"
-  INSTALL_COMMAND ""
-  DEPENDS MAKESELF
-  )
-
-add_custom_target(PACKAGE-TOOLS DEPENDS PATCHELF)
+add_custom_target(PACKAGE-TOOLS DEPENDS MAKESELF)


STYLE: better docs

STYLE: better docs

--- Utilities/Upgrading/NewPipeConvert.cmake
+++ Utilities/Upgrading/NewPipeConvert.cmake
@@ -1,5 +1,5 @@
 # This file  attempts to  convert an  old pipeline filter  to a  new pipeline
-# filter. Run it with a  -DCLASS:STRING=classname it will use that class name
+# filter. Run it with a  -DCLASS=classname it will use that class name
 # for processing

 IF (NOT DEFINED CLASS)


ARROW-4290: [C++/Gandiva] Support detecting correct LLVM version in Homebrew

Author: Korn, Uwe <Uwe.Korn@blue-yonder.com>
Author: Uwe L. Korn <uwelk@xhochy.com>

Closes #3429 from xhochy/ARROW-4290 and squashes the following commits:

4617b2f8 <Uwe L. Korn> Simplify check for brew
1746e928 <Korn, Uwe> ARROW-4290:  Support detecting correct LLVM version in Homebrew

--- cpp/cmake_modules/FindLLVM.cmake
+++ cpp/cmake_modules/FindLLVM.cmake
@@ -21,9 +21,23 @@
 #

 set(GANDIVA_LLVM_VERSION 6.0)
+
+if (APPLE)
+  # Also look in homebrew for a matching llvm version
+  find_program(BREW_BIN brew)
+  if (BREW_BIN)
+    execute_process(
+      COMMAND ${BREW_BIN} --prefix "llvm@6"
+      OUTPUT_VARIABLE LLVM_BREW_PREFIX
+      OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+  endif()
+endif()
+
 find_package(LLVM ${GANDIVA_LLVM_VERSION} REQUIRED CONFIG HINTS
              /usr/local/opt/llvm
              /usr/share
+             ${LLVM_BREW_PREFIX}
              ${LLVM_DIR})
 message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
 message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")


cmake: updated FindGSL.cmake

cmake: updated FindGSL.cmake

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -25,27 +25,35 @@
 pkg_check_modules(PC_GSL gsl)
 find_path(GSL_INCLUDE_DIR gsl/gsl_linalg.h HINTS ${PC_GSL_INCLUDE_DIRS})
 find_library(GSL_LIBRARY NAMES gsl HINTS ${PC_GSL_LIBRARY_DIRS} )
-find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )

 include(FindPackageHandleStandardArgs)
 # handle the QUIETLY and REQUIRED arguments and set GSL_FOUND to TRUE
 # if all listed variables are TRUE
-find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR GSLCBLAS_LIBRARY)
+find_package_handle_standard_args(GSL DEFAULT_MSG GSL_LIBRARY GSL_INCLUDE_DIR)

-set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
+set(GSL_LIBRARIES "${GSL_LIBRARY}")
 set(GSL_INCLUDE_DIRS ${GSL_INCLUDE_DIR} )

 if (GSL_FOUND)
   include(CheckLibraryExists)
-  check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
-  if(NOT FOUND_DSYRK)
-    message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
-  endif(NOT FOUND_DSYRK)
   #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
   check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_decomp "" FOUND_QR_DECOMP)
   if(NOT FOUND_QR_DECOMP)
-    message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong.  If you are using a static lib (.a) make sure you have specified all dependencies of libgsl in GSL_LIBRARY by hand (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libm.so') !")
+    #Some distributions like OpenSUSE need cblas in the linker flags, too
+    find_library(GSLCBLAS_LIBRARY NAMES gslcblas cblas HINTS ${PC_GSL_LIBRARY_DIRS} )
+    find_package_handle_standard_args(GSLCBLAS DEFAULT_MSG GSLCBLAS_LIBRARY)
+    if (GSLCBLAS_FOUND)
+      check_library_exists("${GSLCBLAS_LIBRARY};${MATH_LIBRARIES}" cblas_dsyrk "" FOUND_DSYRK)
+      if(NOT FOUND_DSYRK)
+        message(FATAL_ERROR "Could not find cblas_dsyrk in ${GSLCBLAS_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of libcblas in GSLCBLAS_LIBRARY by hand (i.e. -DGSLCBLAS_LIBRARY='/path/to/libcblas.so;/path/to/libm.so')! If your gsl was build against an different version of cblas, specify it in GSLCBLAS_LIBRARY")
+      endif(NOT FOUND_DSYRK)
+      set(GSL_LIBRARIES "${GSL_LIBRARY};${GSLCBLAS_LIBRARY}")
+      check_library_exists("${GSL_LIBRARIES};${MATH_LIBRARIES}" gsl_linalg_QR_lssolve "" FOUND_QR_DECOMP_AGAIN)
+    endif(GSLCBLAS_FOUND)
   endif(NOT FOUND_QR_DECOMP)
+  if(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
+      message(FATAL_ERROR "Could not find gsl_linalg_QR_decompx in ${GSL_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong.  If you are using a static lib (.a) make sure you have specified all dependencies of libgsl in GSL_LIBRARY by hand (i.e. -DGSL_LIBRARY='/path/to/libgsl.so;/path/to/libm.so') !")
+  endif(NOT FOUND_QR_DECOMP AND NOT FOUND_QR_DECOMP_AGAIN)
 endif (GSL_FOUND)

 mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY)


Conditional mark libxml2 GUI variables as hidden when no longer needed.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -48,10 +48,13 @@
     mark_as_advanced(CMAKE_OSX_SYSROOT)
   endif()
   if(WIN32)
-    mark_as_advanced(LIBXML2_INCLUDE_DIR)
-    mark_as_advanced(LIBXML2_LIBRARY)
-    mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE)
-    mark_as_advanced(LibXml2_DIR)
+    if(LibXml2_FOUND AND HAVE_LIBXML2_CONFIG)
+      mark_as_advanced(LibXml2_DIR)
+    elseif(LibXml2_FOUND AND NOT HAVE_LIBXML2_CONFIG)
+      mark_as_advanced(LIBXML2_INCLUDE_DIR)
+      mark_as_advanced(LIBXML2_LIBRARY)
+      mark_as_advanced(LIBXML2_XMLLINT_EXECUTABLE)
+    endif()
   else()
     mark_as_advanced(pkgcfg_lib_PC_LIBXML_xml2)
   endif()


fix some dos line endings.

fix some dos line endings.

--- indra/cmake/GoogleBreakpad.cmake
+++ indra/cmake/GoogleBreakpad.cmake
@@ -1,19 +1,19 @@
-# -*- cmake -*-
-include(Prebuilt)
-
-if (STANDALONE)
-  MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented")
-  # *TODO - implement this include(FindGoogleBreakpad)
-else (STANDALONE)
-  use_prebuilt_binary(google_breakpad)
-  if (DARWIN)
-    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
-  endif (DARWIN)
-  if (LINUX)
-    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client)
-  endif (LINUX)
-  if (WINDOWS)
-    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common)
-  endif (WINDOWS)
-endif (STANDALONE)
-
+# -*- cmake -*-
+include(Prebuilt)
+
+if (STANDALONE)
+  MESSAGE(FATAL_ERROR "*TODO standalone support for google breakad is unimplemented")
+  # *TODO - implement this include(FindGoogleBreakpad)
+else (STANDALONE)
+  use_prebuilt_binary(google_breakpad)
+  if (DARWIN)
+    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler)
+  endif (DARWIN)
+  if (LINUX)
+    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES breakpad_client)
+  endif (LINUX)
+  if (WINDOWS)
+    set(BREAKPAD_EXCEPTION_HANDLER_LIBRARIES exception_handler crash_generation_client common)
+  endif (WINDOWS)
+endif (STANDALONE)
+


Hadoop was contrib-ified earlier, now also remove jar file from packages

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -533,7 +533,7 @@
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/gsoap/2.7.10-p5)
 add_subdirectory(${CONDOR_SOURCE_DIR}/src/classad)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/curl/7.19.6-p1 )
-add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/hadoop/0.21.0)
+#add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/hadoop/0.21.0)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/postgresql/8.2.3-p1)
 add_subdirectory(${CONDOR_EXTERNAL_DIR}/bundles/drmaa/1.6)
 add_subdirectory(${CONDOR_SOURCE_DIR}/src/safefile)


Fix proper builds to use RPATH with option to disable now that we link internal shared libraries.

--- build/cmake/CondorConfigure.cmake
+++ build/cmake/CondorConfigure.cmake
@@ -121,12 +121,6 @@
 	endif()

 	set( CMAKE_SUPPRESS_REGENERATION FALSE )
-
-	# when we want to distro dynamic libraries only with localized rpaths.
-	set (CMAKE_SKIP_RPATH TRUE)
-	# set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-	# set (CMAKE_INSTALL_RPATH YOUR_LOC)
-	# set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

 	set(HAVE_PTHREAD_H ${CMAKE_HAVE_PTHREAD_H})

@@ -393,6 +387,8 @@
 option(WANT_MAN_PAGES "Generate man pages as part of the default build" OFF)
 option(ENABLE_JAVA_TESTS "Enable java tests" ON)

+#####################################
+# PROPER option
 if (UW_BUILD OR WINDOWS)
   option(PROPER "Try to build using native env" OFF)

@@ -410,6 +406,25 @@
   option(CLIPPED "disable the standard universe" ON)
 endif()

+if (NOT CLIPPED AND NOT LINUX)
+	message (FATAL_ERROR "standard universe is *only* supported on Linux")
+endif()
+
+#####################################
+# RPATH option
+if (LINUX)
+	option(CMAKE_SKIP_RPATH "Skip RPATH on executables" OFF)
+else()
+	option(CMAKE_SKIP_RPATH "Skip RPATH on executables" ON)
+endif()
+
+if ( NOT CMAKE_SKIP_RPATH )
+	set( CMAKE_INSTALL_RPATH ${CONDOR_RPATH} )
+	set( CMAKE_BUILD_WITH_INSTALL_RPATH TRUE )
+endif()
+
+#####################################
+# KBDD option
 if (NOT WINDOWS)
     if (HAVE_X11)
         if (NOT (${HAVE_X11} STREQUAL "HAVE_X11-NOTFOUND"))
@@ -420,10 +435,8 @@
     option(HAVE_KBDD "Support for condor_kbdd" ON)
 endif()

-if (NOT CLIPPED AND NOT LINUX)
-	message (FATAL_ERROR "standard universe is *only* supported on Linux")
-endif()
-
+#####################################
+# KBDD option
 if (NOT HPUX)
 	option(HAVE_SHARED_PORT "Support for condor_shared_port" ON)
 	if (NOT WINDOWS)
@@ -431,6 +444,8 @@
 	endif()
 endif(NOT HPUX)

+#####################################
+# ssh_to_job option
 if (NOT WINDOWS)
     option(HAVE_SSH_TO_JOB "Support for condor_ssh_to_job" ON)
 endif()
@@ -444,8 +459,7 @@
 # setup for the externals, the variables defined here
 # are used in the construction of externals within
 # the condor build.  The point of main interest is
-# how "cacheing" is performed by performing the build
-# external to the tree itself.
+# how "cacheing" is performed.
 if (PROPER)
 	message(STATUS "********* Configuring externals using [local env] a.k.a. PROPER *********")
 	option(CACHED_EXTERNALS "enable/disable cached externals" OFF)
@@ -453,12 +467,6 @@
 	cmake_minimum_required(VERSION 2.8)
 	message(STATUS "********* Configuring externals using [uw-externals] a.k.a NONPROPER *********")
 	option(CACHED_EXTERNALS "enable/disable cached externals" ON)
-
-	if (LINUX)
-		set(CMAKE_SKIP_RPATH FALSE)
-		set(CMAKE_INSTALL_RPATH ${CONDOR_RPATH})
-		set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
-	endif()
 endif(PROPER)

 if (WINDOWS)
@@ -937,6 +945,8 @@

 # If set, runtime paths are not added when using shared libraries. Default it is set to OFF
 dprint ( "CMAKE_SKIP_RPATH: ${CMAKE_SKIP_RPATH}" )
+dprint ( "CMAKE_INSTALL_RPATH: ${CMAKE_INSTALL_RPATH}")
+dprint ( "CMAKE_BUILD_WITH_INSTALL_RPATH: ${CMAKE_BUILD_WITH_INSTALL_RPATH}")

 # set this to true if you are using makefiles and want to see the full compile and link
 # commands instead of only the shortened ones


添加规则提示

添加规则提示

--- build/cmake/dios_cmake_init.cmake
+++ build/cmake/dios_cmake_init.cmake
@@ -6,8 +6,8 @@
 	CMAKE_POLICY( SET CMP0003 NEW )
 	CMAKE_POLICY( SET CMP0006 OLD )
 	CMAKE_POLICY( SET CMP0011 OLD )
-	#CMAKE_POLICY( SET CMP0053 OLD )
-	#CMAKE_POLICY( SET CMP0054 OLD )
+	CMAKE_POLICY( SET CMP0053 OLD )
+	CMAKE_POLICY( SET CMP0054 OLD )
 endif()

 #


build...

build...

--- cmake/CFlags.cmake
+++ cmake/CFlags.cmake
@@ -1,4 +1,4 @@
-set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wdelete-non-virtual-dtor${CMAKE_CXX_FLAGS} -Wno-predefined-identifier-outside-function")
+set(CMAKE_CXX_FLAGS "-std=c++0x -ftemplate-depth=500 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -Wdelete-non-virtual-dtor ${CMAKE_CXX_FLAGS} -Wno-predefined-identifier-outside-function")
 set(CMAKE_C_FLAGS "-std=c11 -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -Wall -pedantic ${CMAKE_C_FLAGS}")

 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz -lpthread")


SWDEV-1 - switch to C++17

SWDEV-1 - switch to C++17

Change-Id: I7e6a28a20ca163fe86dd6d53b031e9bb6f9b22c9

--- cmake/ROCclr.cmake
+++ cmake/ROCclr.cmake
@@ -48,7 +48,7 @@
 mark_as_advanced(ROCCLR_SRC_DIR)

 set_target_properties(rocclr PROPERTIES
-    CXX_STANDARD 14
+    CXX_STANDARD 17
     CXX_STANDARD_REQUIRED ON
     CXX_EXTENSIONS OFF
     POSITION_INDEPENDENT_CODE ON)


test: symlink for plugin specific test data

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -74,10 +74,12 @@
             COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/testdata
             COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/path_to_dextool
             COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/libgmock_gtest.a
+            COMMAND rm -f ${CMAKE_CURRENT_BINARY_DIR}/plugin_testdata
             COMMAND ln -sf ${CMAKE_BINARY_DIR}/fused_gmock ${CMAKE_CURRENT_BINARY_DIR}/fused_gmock
             COMMAND ln -sf ${CMAKE_BINARY_DIR}/testdata ${CMAKE_CURRENT_BINARY_DIR}/testdata
             COMMAND ln -sf ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/path_to_dextool
             COMMAND ln -sf ${CMAKE_BINARY_DIR}/libgmock_gtest.a ${CMAKE_CURRENT_BINARY_DIR}/libgmock_gtest.a
+            COMMAND ln -sf ${CMAKE_CURRENT_LIST_DIR}/testdata ${CMAKE_CURRENT_BINARY_DIR}/plugin_testdata
             )
     endif()
 endmacro()


Add ability to define icon flags for bannertool

--- cmake/cpp3ds.cmake
+++ cmake/cpp3ds.cmake
@@ -218,7 +218,7 @@

 function(__add_smdh target APP_TITLE APP_DESCRIPTION APP_AUTHOR APP_ICON)
     if(BANNERTOOL AND NOT FORCE_SMDHTOOL)
-        set(__SMDH_COMMAND ${BANNERTOOL} makesmdh -s ${APP_TITLE} -l ${APP_DESCRIPTION}  -p ${APP_AUTHOR} -i ${APP_ICON} -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target})
+        set(__SMDH_COMMAND ${BANNERTOOL} makesmdh -s ${APP_TITLE} -l ${APP_DESCRIPTION}  -p ${APP_AUTHOR} -i ${APP_ICON} -o ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target} ${ICON_FLAGS})
     else()
         set(__SMDH_COMMAND ${SMDHTOOL} --create ${APP_TITLE} ${APP_DESCRIPTION} ${APP_AUTHOR} ${APP_ICON} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target})
     endif()


build: macos: Handle w/o patch version returning case (#5096)

In macOS monterey, `sw_vers -productVersion` will return `12.x` (w/o
patch version).
We don't need to handle patch version to determine proper value for
`MACOSX_DEPLOYMENT_TARGET` variable.

Signed-off-by: Hiroshi Hatake <a476a6e5b5893650242fbf0b2961500a9bd9032e@calyptia.com>

--- cmake/luajit.cmake
+++ cmake/luajit.cmake
@@ -24,7 +24,6 @@
     string(REPLACE "." ";" DEPLOYMENT_VERSION_LIST ${MACOSX_DEPLOYMENT_TARGET})
     list(GET DEPLOYMENT_VERSION_LIST 0 MACOSX_DEPLOYMENT_TARGET_MAJOR)
     list(GET DEPLOYMENT_VERSION_LIST 1 MACOSX_DEPLOYMENT_TARGET_MINOR)
-    list(GET DEPLOYMENT_VERSION_LIST 2 MACOSX_DEPLOYMENT_TARGET_PATCH)
     set(DEPLOYMENT_TARGET "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET_MAJOR}.${MACOSX_DEPLOYMENT_TARGET_MINOR}")
   endif()
 else()


ENH: attempt to solve dashboard warning

ENH: attempt to solve dashboard warning

--- src/Testing/Dashboard/elxDashboardCommon.cmake
+++ src/Testing/Dashboard/elxDashboardCommon.cmake
@@ -64,7 +64,8 @@

 # Select a source directory name.
 if( NOT DEFINED CTEST_SOURCE_DIRECTORY )
-  set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/src" )
+  set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}" )
+  #set( CTEST_SOURCE_DIRECTORY "${CTEST_DASHBOARD_ROOT}/src" )
 endif()

 # Select a build directory name.


- Fix issue with GLES on Android

- Fix issue with GLES on Android

--- cmake/Find/FindStandardLibs.cmake
+++ cmake/Find/FindStandardLibs.cmake
@@ -90,7 +90,8 @@
         # Logging and Android functions
         log android
         # OpenGL ES
-        GLESv1_CM GLESv2
+#        GLESv1_CM
+        GLESv2
         EGL

         ${SDL2_LIBRARY}


cmake: fix '-fvisibility' options regression

CMAKE_COMPILER_ID => CMAKE_CXX_COMPILER_ID

--- cmake/OpenCVCompilerOptions.cmake
+++ cmake/OpenCVCompilerOptions.cmake
@@ -280,7 +280,7 @@
 set(OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG   "${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}"   CACHE INTERNAL "Extra linker flags for Debug build")

 # set default visibility to hidden
-if((CMAKE_COMPILER_ID STREQUAL "GNU" OR CMAKE_COMPILER_ID STREQUAL "Clang")
+if((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
     AND NOT OPENCV_SKIP_VISIBILITY_HIDDEN
     AND NOT CMAKE_CXX_FLAGS MATCHES "-fvisibility")
   add_extra_compiler_option(-fvisibility=hidden)


Fix the KAccounts cmake module

Fix the KAccounts cmake module

Matches AccountsQt module now

--- cmake/modules/FindKAccounts.cmake
+++ cmake/modules/FindKAccounts.cmake
@@ -7,21 +7,24 @@
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.

 SET (KACCOUNTS_FIND_REQUIRED ${KAccounts_FIND_REQUIRED})
-if (KACCOUNTS_INCLUDE_DIRS AND KACCOUNTS_LIBRARIES)
+if (KACCOUNTS_INCLUDE_DIR AND KACCOUNTS_LIBRARY)
   # Already in cache, be silent
   set(KACCOUNTS_FIND_QUIETLY TRUE)
-endif (KACCOUNTS_INCLUDE_DIRS AND KACCOUNTS_LIBRARIES)
+endif (KACCOUNTS_INCLUDE_DIR AND KACCOUNTS_LIBRARY)

-find_path(KACCOUNTS_INCLUDE_DIRS
+find_path(KACCOUNTS_INCLUDE_DIR
   NAMES KAccounts/kaccountsuiplugin.h
-  PATHS ${KF5_INCLUDE_DIR}
+  PATHS ${CMAKE_INSTALL_FULL_INCLUDEDIR}
 )

-find_library(KACCOUNTS_LIBRARIES NAMES kaccounts)
+find_library(KACCOUNTS_LIBRARY NAMES kaccounts)
+
+set(KACCOUNTS_INCLUDE_DIRS ${KACCOUNTS_INCLUDE_DIR})
+set(KACCOUNTS_LIBRARIES ${KACCOUNTS_LIBRARY})

 include(FindPackageHandleStandardArgs)
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(KAccounts DEFAULT_MSG
-                                  KACCOUNTS_LIBRARIES
-                                  KACCOUNTS_INCLUDE_DIRS)
+                                  KACCOUNTS_LIBRARY
+                                  KACCOUNTS_INCLUDE_DIR)

-mark_as_advanced(KACCOUNTS_INCLUDE_DIRS KACCOUNTS_LIBRARIES)
+mark_as_advanced(KACCOUNTS_INCLUDE_DIR KACCOUNTS_LIBRARY)


Fixed capitalization on LIBCRYPTO_FOUND, which has never worked right

--- cmake/modules/FindLibCrypto.cmake
+++ cmake/modules/FindLibCrypto.cmake
@@ -71,7 +71,7 @@
     LibCrypto_STATIC_LIBRARY
     )

-if(LibCrypto_FOUND)
+if(LIBCRYPTO_FOUND)
     message(STATUS "LibCrypto Include Dir: ${LibCrypto_INCLUDE_DIR}")
     message(STATUS "LibCrypto Shared Lib:  ${LibCrypto_SHARED_LIBRARY}")
     message(STATUS "LibCrypto Static Lib:  ${LibCrypto_STATIC_LIBRARY}")


Add include directory to ROOT exported library targets


RootNewMacros.cmake: remove some unused variables

--- cmake/modules/RootNewMacros.cmake
+++ cmake/modules/RootNewMacros.cmake
@@ -4,11 +4,7 @@

 set(THISDIR ${CMAKE_CURRENT_LIST_DIR})

-set(lib lib)
-set(bin bin)
 if(WIN32)
-  set(ssuffix .bat)
-  set(scomment rem)
   set(libprefix lib)
   set(ld_library_path PATH)
   set(libsuffix .dll)
@@ -16,8 +12,6 @@
   set(runtimedir ${CMAKE_INSTALL_BINDIR})
 elseif(APPLE)
   set(ld_library_path DYLD_LIBRARY_PATH)
-  set(ssuffix .csh)
-  set(scomment \#)
   set(libprefix ${CMAKE_SHARED_LIBRARY_PREFIX})
   if(CMAKE_PROJECT_NAME STREQUAL ROOT)
     set(libsuffix .so)
@@ -28,8 +22,6 @@
   set(runtimedir ${CMAKE_INSTALL_LIBDIR})
 else()
   set(ld_library_path LD_LIBRARY_PATH)
-  set(ssuffix .csh)
-  set(scomment \#)
   set(libprefix ${CMAKE_SHARED_LIBRARY_PREFIX})
   set(libsuffix ${CMAKE_SHARED_LIBRARY_SUFFIX})
   set(localruntimedir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})


Fix missing include of hunter_cmake_args module.

--- cmake/projects/Avahi/hunter.cmake
+++ cmake/projects/Avahi/hunter.cmake
@@ -8,8 +8,9 @@
 endif()

 include(hunter_add_version)
+include(hunter_cmake_args)
+include(hunter_pick_scheme)
 include(hunter_download)
-include(hunter_pick_scheme)

 hunter_add_version(
     PACKAGE_NAME


cmake: compat: add warning when people try to use sdk_add_include

(it's hard to do anything more than that, by sdk_add_include is so
tricky to use that it should not be a problem :)

--- cmake/qibuild/compat/compat.cmake
+++ cmake/qibuild/compat/compat.cmake
@@ -21,7 +21,32 @@
 endfunction()

 function(sdk_add_include _name _subfolder)
-  qi_deprecated("no implementation")
+  qi_warning("sdk_add_include is deprectated.
+
+  Note:
+    Assuming you have a foo.h in a bar library,
+    calling this function lets you use:
+
+      #include<foo.h>
+
+    Instead of
+
+      #include<bar/foo.h>
+
+    Don't use that if you can fix the client code
+    of the library !
+
+  If you can not fix the client code, use the PATH_SUFFIXES argument of
+  qi_stage_lib instead.
+
+  Old:
+    install_header(FOO SUBFOLDER bar foo.h)
+    sdk_add_include(FOO bar)
+    stage_lib(foo FOO)
+  New:
+    qi_stage_lib(foo PATH_SUFFIXES bar)
+    qi_install_header(bar foo.h)
+  ")
 endfunction()

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


Fix regresion: missing c++17 flags in old cmake or msvc

--- cmakemodules/DeclareMRPTLib.cmake
+++ cmakemodules/DeclareMRPTLib.cmake
@@ -22,26 +22,28 @@

 # Enforce C++17 in all dependent projects:
 function(mrpt_lib_target_requires_cpp17 _TARGET)
-	if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
+	get_target_property(target_type ${_TARGET} TYPE)
+	if (${target_type} STREQUAL "INTERFACE_LIBRARY")
+		set(INTERF_TYPE "INTERFACE")
+	else()
+		set(INTERF_TYPE "PUBLIC")
+	endif()
+
+
+	if(NOT ${CMAKE_VERSION} VERSION_LESS "3.8.0")
+		# Modern, clean way to do this:
+		get_target_property(target_type ${_TARGET} TYPE)
+		target_compile_features(${_TARGET} ${INTERF_TYPE} cxx_std_17)
+
+		# At present (CMake 3.12 + MSVC 19.15.26732.1) it seems cxx_std_17
+		# does not enable C++17 in MSVC (!).
+		# target_compile_options(${_TARGET} ${INTERF_TYPE} "/std:c++17")
+	else()
 		# Support older cmake versions:
 		if (MSVC)
-			target_compile_options(${_TARGET} INTERFACE "/std:c++latest")
+			target_compile_options(${_TARGET} ${INTERF_TYPE} "/std:c++latest")
 		else()
-			target_compile_options(${_TARGET} INTERFACE "-std=c++17")
-		endif()
-	else()
-		if (NOT MSVC)
-			# Modern, clean way to do this:
-			get_target_property(target_type ${_TARGET} TYPE)
-			if (${target_type} STREQUAL "INTERFACE_LIBRARY")
-				target_compile_features(${_TARGET} INTERFACE cxx_std_17)
-			else()
-				target_compile_features(${_TARGET} PUBLIC cxx_std_17)
-			endif()
-		else()
-			# At present (CMake 3.12 + MSVC 19.15.26732.1) it seems cxx_std_17
-			# does not enable C++17 in MSVC (!).
-			target_compile_options(${_TARGET} INTERFACE "/std:c++17")
+			target_compile_options(${_TARGET} ${INTERF_TYPE} "-std=c++17")
 		endif()
 	endif()
 endfunction()


Add clustercontroller jars.

Add clustercontroller jars.

--- install_java.cmake
+++ install_java.cmake
@@ -18,6 +18,11 @@
 install_java_artifact(vespajlib)

 install_fat_java_artifact(application-preprocessor)
+install_fat_java_artifact(clustercontroller-apps)
+install_fat_java_artifact(clustercontroller-apputil)
+install_fat_java_artifact(clustercontroller-utils)
+install_fat_java_artifact(clustercontroller-core)
+
 install_fat_java_artifact(component)
 install_fat_java_artifact(config-bundle)
 install_fat_java_artifact(config-model-api)


add /wx option

add /wx option

--- projects/cmake/internal_utils.cmake
+++ projects/cmake/internal_utils.cmake
@@ -8,13 +8,17 @@
              CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
              CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
       if (NOT BUILD_SHARED_LIBS AND NOT iutest_force_shared_crt)
-        # 置換
         string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
       endif()

-      # Replaces /W3 with /W4 in defaults.
-      string(REPLACE "/W3" "-W4" ${flag_var} "${${flag_var}}")
+      # Force to always compile with W4
+      if(${flag_var} MATCHES "/W[0-4]")
+        string(REGEX REPLACE "/W[0-4]" "/W4" ${flag_var} "${${flag_var}}")
+      #else()
+      #  set(${flag_var} "${${flag_var}} /W4")
+      endif()
     endforeach()
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
   endif()
 endmacro()


BUG: Set CTEST_GIT_UPDATE_COMMAND with CircleCI

'git fetch' will fail.

--- Docker/itksoftwareguide-dashboard/dashboard.cmake
+++ Docker/itksoftwareguide-dashboard/dashboard.cmake
@@ -26,6 +26,9 @@
 find_program(CTEST_GIT_COMMAND NAMES git git.cmd)
 if(NOT DEFINED CTEST_GIT_COMMAND)
   message(FATAL_ERROR "No Git Found.")
+endif()
+if("$ENV{CIRCLE_PROJECT_REPONAME}")
+  set(CTEST_GIT_UPDATE_CUSTOM "${CTEST_GIT_COMMAND}" "reset" "--hard" "HEAD")
 endif()

 # Upload information


cmake: added compiler check for scoped enums

--- cmake/Modules/LibPKMNCompilerCheck.cmake
+++ cmake/Modules/LibPKMNCompilerCheck.cmake
@@ -34,6 +34,30 @@
 IF(NOT HAVE_STRONGLY_TYPED_ENUMS)
     MESSAGE(FATAL_ERROR "Strongly typed enums not supported!")
 ENDIF(NOT HAVE_STRONGLY_TYPED_ENUMS)
+
+CHECK_CXX_SOURCE_COMPILES("
+    namespace testnamespace
+    {
+        enum testenum
+        {
+            foo,
+            bar,
+            baz
+        };
+    }
+
+    int main()
+    {
+        int a = testnamespace::bar;
+
+        return 0;
+    }
+    " HAVE_SCOPED_ENUMS
+)
+
+IF(NOT HAVE_SCOPED_ENUMS)
+    MESSAGE(FATAL_ERROR "Scoped enums not supported!")
+ENDIF(NOT HAVE_SCOPED_ENUMS)

 #
 # It's harder to check the compiler with CMake and test for the


add license to top of toolchain file

add license to top of toolchain file

--- cmake/toolchains/iOS/iOS.toolchain.cmake
+++ cmake/toolchains/iOS/iOS.toolchain.cmake
@@ -1,3 +1,16 @@
+#Copyright (c) 2016, Bogdan Cristea <cristeab@gmail.com>
+#All rights reserved.
+#
+#Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+#
+#1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+#
+#2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+#
+#3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+#
+#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
 # Standard settings
 set (CMAKE_SYSTEM_NAME Darwin)
 set (CMAKE_SYSTEM_VERSION 1)


modules: updated FindCorrade.cmake from Corrade repository.

--- modules/FindCorrade.cmake
+++ modules/FindCorrade.cmake
@@ -26,6 +26,9 @@
 #  CORRADE_BUILD_DEPRECATED     - Defined if compiled with deprecated APIs
 #   included
 #  CORRADE_BUILD_STATIC         - Defined if compiled as static libraries
+#  CORRADE_TARGET_UNIX          - Defined if compiled for some Unix flavor
+#   (Linux, BSD, OS X)
+#  CORRADE_TARGET_WINDOWS       - Defined if compiled for Windows
 #  CORRADE_TARGET_NACL          - Defined if compiled for Google Chrome
 #   Native Client
 #  CORRADE_TARGET_NACL_NEWLIB   - Defined if compiled for Google Chrome
@@ -171,6 +174,14 @@
 if(NOT _BUILD_STATIC EQUAL -1)
     set(CORRADE_BUILD_STATIC 1)
 endif()
+string(FIND "${_corradeConfigure}" "#define CORRADE_TARGET_UNIX" _TARGET_UNIX)
+if(NOT _TARGET_UNIX EQUAL -1)
+    set(CORRADE_TARGET_UNIX 1)
+endif()
+string(FIND "${_corradeConfigure}" "#define CORRADE_TARGET_WINDOWS" _TARGET_WINDOWS)
+if(NOT _TARGET_WINDOWS EQUAL -1)
+    set(CORRADE_TARGET_WINDOWS 1)
+endif()
 string(FIND "${_corradeConfigure}" "#define CORRADE_TARGET_NACL" _TARGET_NACL)
 if(NOT _TARGET_NACL EQUAL -1)
     set(CORRADE_TARGET_NACL 1)


COMP: Remove unknown doxygen command in AnisotropicDiffusionLBR.

Addresses:

  ITK/Modules/Remote/AnisotropicDiffusionLBR/include/itkCoherenceEnhancingDiffusionFilter.h:51:
  warning: Found unknown command `\br'

Change-Id: Ie220dc93ac4756228055c78da3b94e3e795ff952

--- Modules/Remote/AnisotropicDiffusionLBR.remote.cmake
+++ Modules/Remote/AnisotropicDiffusionLBR.remote.cmake
@@ -20,5 +20,5 @@
     http://insight-journal.org/browse/publication/953
   "
   GIT_REPOSITORY https://github.com/InsightSoftwareConsortium/ITKAnisotropicDiffusionLBR.git
-  GIT_TAG ddbe9fd0417fa9a828b785c43dace6dedb8f4274
+  GIT_TAG 6437f1ac37b7402d0bfc45c8cdc53e1819f2f20b
   )


ENH: Allow to disable SPTW build and modules

--- Modules/ThirdParty/SPTW/otb-module.cmake
+++ Modules/ThirdParty/SPTW/otb-module.cmake
@@ -11,4 +11,4 @@
     "${DOCUMENTATION}"
   )

-
+otb_module_activation_option("Enable SPTW dependent modules" ON)


[changed] version number corresponding to fix in #58

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,2 +1,2 @@
 # This version number is loaded by the package and the project.
-SET( VERSION "0.9.4" )
+SET( VERSION "0.9.5" )


Updated FindMagnum.cmake from Magnum repository.

--- modules/FindMagnum.cmake
+++ modules/FindMagnum.cmake
@@ -22,6 +22,8 @@
 #  Primitives    - Library with stock geometric primitives (static)
 #  SceneGraph    - Scene graph library
 #  Shaders       - Library with stock shaders
+#  Text          - Text rendering library
+#  TextureTools  - TextureTools library
 #  GlxApplication - GLX application (depends on X11 libraries)
 #  XEglApplication - X/EGL application (depends on EGL and X11 libraries)
 #  WindowlessGlxApplication - Windowless GLX application (depends on X11
@@ -83,12 +85,18 @@
 if(NOT _TARGET_NACL EQUAL -1)
     set(MAGNUM_TARGET_NACL 1)
 endif()
-
-if(NOT MAGNUM_TARGET_GLES)
+string(FIND "${_magnumConfigure}" "#define MAGNUM_TARGET_DESKTOP_GLES" _TARGET_DESKTOP_GLES)
+if(NOT _TARGET_DESKTOP_GLES EQUAL -1)
+    set(MAGNUM_TARGET_DESKTOP_GLES 1)
+endif()
+
+if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
     find_package(OpenGL REQUIRED)
-    find_package(GLEW REQUIRED)
 else()
     find_package(OpenGLES2 REQUIRED)
+endif()
+if(NOT MAGNUM_TARGET_GLES)
+    find_package(GLEW REQUIRED)
 endif()

 # On Windows, *Application libraries need to have ${MAGNUM_LIBRARY} listed
@@ -195,6 +203,16 @@
     # Shaders library
     if(${component} STREQUAL Shaders)
         set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES PhongShader.h)
+    endif()
+
+    # Text library
+    if(${component} STREQUAL Text)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Font.h)
+    endif()
+
+    # TextureTools library
+    if(${component} STREQUAL TextureTools)
+        set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES Atlas.h)
     endif()

     # Try to find the includes
@@ -230,13 +248,13 @@
 set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARY}
     ${CORRADE_UTILITY_LIBRARY}
     ${CORRADE_PLUGINMANAGER_LIBRARY})
+if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGL_gl_LIBRARY})
+else()
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${OPENGLES2_LIBRARY})
+endif()
 if(NOT MAGNUM_TARGET_GLES)
-    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES}
-        ${OPENGL_gl_LIBRARY}
-        ${GLEW_LIBRARY})
-else()
-    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES}
-        ${OPENGLES2_LIBRARY})
+    set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARIES} ${GLEW_LIBRARY})
 endif()

 # Installation dirs


- remove unused lines

- remove unused lines

--- CMakeModules/FindLIBSBML.cmake
+++ CMakeModules/FindLIBSBML.cmake
@@ -110,9 +110,6 @@
   add_library(${LIBSBML_LIBRARY_NAME} UNKNOWN IMPORTED)
   set_target_properties(${LIBSBML_LIBRARY_NAME} PROPERTIES IMPORTED_LOCATION ${LIBSBML_LIBRARY})

-  include(CheckLibraryExists)
-  check_library_exists(ExpartParser "" HAVE_EXPAT)
-
 endif()


FindSQLITE3.cmake: fixed a typo

FindSQLITE3.cmake: fixed a typo

--- CMakeModules/FindSQLITE3.cmake
+++ CMakeModules/FindSQLITE3.cmake
@@ -1,5 +1,5 @@
-# - Find libgmx
-# Find the native libgmx headers and libraries.
+# - Find libsqlite3
+# Find the native libsqlite3 headers and libraries.
 #
 #  SQLITE3_INCLUDE_DIRS - where to find sqlite3.h, etc
 #  SQLITE3_LIBRARIES    - List of libraries when using sqlite3.


Check compilers

Check compilers

--- scripts/Arduino.cmake
+++ scripts/Arduino.cmake
@@ -10,6 +10,16 @@
 enable_language(ASM)

 # set compilers
+find_program(AVR_GCC avr-gcc)
+find_program(AVR_G++ avr-g++)
+
+if (NOT AVR_GCC)
+    message(FATAL_ERROR "Please install avr-gcc")
+endif ()
+if (NOT AVR_G++)
+    message(FATAL_ERROR "Please install avr-g++")
+endif ()
+
 set(CMAKE_ASM_COMPILER avr-gcc)
 set(CMAKE_C_COMPILER avr-gcc)
 set(CMAKE_CXX_COMPILER avr-g++)


Added CMake option for generating parallel VS2010 solutions (/MP)

--- cmake/BALLCompilerSpecific.cmake
+++ cmake/BALLCompilerSpecific.cmake
@@ -129,6 +129,12 @@

 	## minimal code rebuild
 	#add_definitions(/Gm /Zi)
+
+	## if requested, produce a parallel solution
+	OPTION(BALL_BUILD_SOLUTION_PARALLEL OFF)
+	IF (BALL_BUILD_SOLUTION_PARALLEL)
+		ADD_DEFINITIONS(/MP)
+	ENDIF()
 ELSEIF(CMAKE_CXX_COMPILER MATCHES "icpc")

 	SET(CXX_COMPILER_ID "Intel")


feat: enable install of interface libraries (#4008)

This PR copies the `google_cloud_cpp_install_headers` cmake function
from the -spanner repo. This version knows how to install headers
associated with interface libraries, in addition to regular libraries.
Spanner needs this support.

Part of https://github.com/googleapis/google-cloud-cpp/issues/3561

--- cmake/GoogleCloudCppCommon.cmake
+++ cmake/GoogleCloudCppCommon.cmake
@@ -153,7 +153,6 @@
     endif ()
 endfunction ()

-#
 # google_cloud_cpp_install_headers : install all the headers in a target
 #
 # Find all the headers in @p target and install them at @p destination,
@@ -165,13 +164,24 @@
 #   destination in case some headers get installed elsewhere in the future.
 #
 function (google_cloud_cpp_install_headers target destination)
-    get_target_property(target_sources ${target} SOURCES)
+    get_target_property(target_type ${target} TYPE)
+    if ("${target_type}" STREQUAL "INTERFACE_LIBRARY")
+        # For interface libraries we use `INTERFACE_SOURCES` to get the list of
+        # sources, which are actually just headers in this case.
+        get_target_property(target_sources ${target} INTERFACE_SOURCES)
+    else ()
+        get_target_property(target_sources ${target} SOURCES)
+    endif ()
     foreach (header ${target_sources})
         if (NOT "${header}" MATCHES "\\.h$" AND NOT "${header}" MATCHES
                                                 "\\.inc$")
             continue()
         endif ()
+        # Sometimes we generate header files into the binary directory, do not
+        # forget to install those with their relative path.
         string(REPLACE "${CMAKE_CURRENT_BINARY_DIR}/" "" relative "${header}")
+        # INTERFACE libraries use absolute paths, yuck.
+        string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/" "" relative "${relative}")
         get_filename_component(dir "${relative}" DIRECTORY)
         install(FILES "${header}" DESTINATION "${destination}/${dir}")
     endforeach ()


cmake module fix

cmake module fix

git-svn-id: 1af002208e930b4d920e7c2b948d1e98a012c795@898 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/Modules/FindCMinpack.cmake
+++ cmake/Modules/FindCMinpack.cmake
@@ -19,12 +19,12 @@

 find_library(CMINPACK_LIBRARY cminpack
     HINTS ${PC_CMINPACK_LIBDIR} ${PC_CMINPACK_LIBRARY_DIRS} "${CMINPACK_ROOT}" "$ENV{CMINPACK_ROOT}"
-    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.13" "$ENV{PROGRAMW6432}/CMINPACK 1.1.13"
+    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.3" "$ENV{PROGRAMW6432}/CMINPACK 1.1.3"
     PATH_SUFFIXES lib)

 find_library(CMINPACK_LIBRARY_DEBUG cminpack-gd cminpack
     HINTS ${PC_CMINPACK_LIBDIR} ${PC_CMINPACK_LIBRARY_DIRS} "${CMINPACK_ROOT}" "$ENV{CMINPACK_ROOT}"
-    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.13" "$ENV{PROGRAMW6432}/CMINPACK 1.1.13"
+    PATHS "$ENV{PROGRAMFILES}/CMINPACK 1.1.3" "$ENV{PROGRAMW6432}/CMINPACK 1.1.3"
     PATH_SUFFIXES lib)

 if(NOT CMINPACK_LIBRARY_DEBUG)


Add TODO.

Add TODO.

--- cmake/catkin_add_env_hooks.cmake
+++ cmake/catkin_add_env_hooks.cmake
@@ -60,9 +60,10 @@
   configure_file(${catkin_EXTRAS_DIR}/templates/env.sh.buildspace.in
     ${CMAKE_BINARY_DIR}/env.sh)

+  message("TODO: Find another install location for *.*sh files.  They shouldn't go into CMAKE_INSTALL_PREFIX.")
   install(PROGRAMS
     ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/env.sh
     DESTINATION ${CMAKE_INSTALL_PREFIX}
     )

-endfunction()+endfunction()


add arm64 support for M1 Mac

add arm64 support for M1 Mac

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -9,10 +9,12 @@
 function(get_swift_host_arch result_var_name)
   if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
     set("${result_var_name}" "x86_64" PARENT_SCOPE)
-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64")
-    set("${result_var_name}" "arm64" PARENT_SCOPE)
-  elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64")
-    set("${result_var_name}" "aarch64" PARENT_SCOPE)
+  elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "AArch64|aarch64|arm64")
+    if(CMAKE_SYSTEM_NAME MATCHES Darwin)
+      set("${result_var_name}" "arm64" PARENT_SCOPE)
+    else()
+      set("${result_var_name}" "aarch64" PARENT_SCOPE)
+    endif()
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64")
     set("${result_var_name}" "powerpc64" PARENT_SCOPE)
   elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ppc64le")


Update TestCompiler.cmake

Update TestCompiler.cmake

--- cmake/modules/TestCompiler.cmake
+++ cmake/modules/TestCompiler.cmake
@@ -1,13 +1,13 @@
-message(STATUS "Checking for working template compiler")
-try_compile(HAVE_TEMPLATES17 ${CMAKE_BINARY_DIR} SOURCES ${CMAKE_TESTS_PATH}/templates17_test.cpp
-  CXX_STANDARD 17
-  CXX_STANDARD_REQUIRED true
-  CXX_EXTENSIONS OFF
-)
+#message(STATUS "Checking for working template compiler")
+#try_compile(HAVE_TEMPLATES17 ${CMAKE_BINARY_DIR} SOURCES ${CMAKE_TESTS_PATH}/templates17_test.cpp
+#  CXX_STANDARD 17
+#  CXX_STANDARD_REQUIRED true
+#  CXX_EXTENSIONS OFF
+#)

-if(NOT ${HAVE_TEMPLATES17})
-  message(FATAL_ERROR "Compiler is not compatible with our template usage.")
-endif()
+#if(NOT ${HAVE_TEMPLATES17})
+#  message(FATAL_ERROR "Compiler is not compatible with our template usage.")
+#endif()

 message(STATUS "Checking if compiler supports sqlpp11")
 try_compile(HAVE_SQLPP11_TEMPLATE_SUPPORT ${CMAKE_BINARY_DIR} SOURCES ${CMAKE_TESTS_PATH}/sqlpp11_template_input_test.cpp


Tweak commentary.

Tweak commentary.

svn path=/trunk/; revision=10533

--- cmake/modules/drivers-init.cmake
+++ cmake/modules/drivers-init.cmake
@@ -181,7 +181,7 @@
   # linuxvga is retired because it is poorly maintained (e.g., colours
   # are incorrect), it is primitive (e.g., Hershey fonts, software
   # fill), and it must be run as root.  Also, svgalib is not supported
-  # for mainstream (e.g., intel) graphics chips anymore so it is
+  # for some mainstream (e.g., intel) graphics chips anymore so it is
   # difficult to even test this device.
   #"linuxvga:linuxvga:OFF:I:OFF"
   # ljii is unmaintained and both the ljii and ljiip segfault on example 14.


pkg-config: Fix library name

pkg-config: Fix library name

--- data/tcam.pc.cmake
+++ data/tcam.pc.cmake
@@ -7,5 +7,5 @@
 Description: Camera control and image acquisition library
 Version: @TCAM_VERSION@
 Requires: @tcam_pkgconfig_dependencies@
-Libs: -L${libdir} -ltcamprop
+Libs: -L${libdir} -ltcam-property
 Cflags: -I${includedir}/


Cygwin support: Disable -fPIC compilation option for luajit

--- external/luajit/luajit.cmake
+++ external/luajit/luajit.cmake
@@ -5,7 +5,12 @@
 set(INSTALL_FULLDIR ${CMAKE_INSTALL_PREFIX}/share/haka/lua)
 set(LUAJIT_DIR "external/luajit/src")

-set(LUAJIT_CFLAGS -fPIC -DLUAJIT_ENABLE_LUA52COMPAT)
+# -fPIC disabled on Cygwin
+if(CYGWIN)
+	set(LUAJIT_CFLAGS -DLUAJIT_ENABLE_LUA52COMPAT)
+else()
+	set(LUAJIT_CFLAGS -fPIC -DLUAJIT_ENABLE_LUA52COMPAT)
+endif()
 set(LUAJIT_CCDEBUG "")

 if(NOT ${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL "x86_64")


Fix 'openssl-skip-update' make target not found with older CMake versions

There's no real need to specify UPDATE_COMMAND or UPDATE_DISCONNECTED since as far as I can tell there is no default update step for URL sources, so there's no update that we need to skip.

In older CMake versions, specifying a custom update step with/without UPDATE_DISCONNECTED could cause this error.

CMake bug: https://cmake.org/Bug/view.php?id=15904

Closes #208

--- deps/openssl.cmake
+++ deps/openssl.cmake
@@ -38,8 +38,6 @@
       CONFIGURE_COMMAND ${OPENSSL_CONFIGURE_COMMAND}
       INSTALL_COMMAND   ""
       TEST_COMMAND      ""
-      UPDATE_COMMAND    ""
-      UPDATE_DISCONNECTED YES
   )

   set(OPENSSL_DIR ${CMAKE_BINARY_DIR}/openssl/src/openssl)


os2: Add os2386 library to linkage list

os2: Add os2386 library to linkage list

--- platforms/os2-gcc/platform.cmake
+++ platforms/os2-gcc/platform.cmake
@@ -3,3 +3,5 @@
 set (PLIBSYS_TIME_PROFILER_MODEL generic)
 set (PLIBSYS_DIR_MODEL none)
 set (PLIBSYS_LIBRARYLOADER_MODEL none)
+
+set (PLIBSYS_PLATFORM_LINK_LIBRARIES os2386)