Remove unused file FindLibKVkontakte.cmake

--- cmake/modules/FindLibKVkontakte.cmake
+++ cmake/modules/FindLibKVkontakte.cmake
@@ -1,122 +0,0 @@
-# - Try to find the VKONTAKTE library
-#
-# If you have put a local version of libkvkontakte into your source tree,
-# set LIBKVKONTAKTE_LOCAL_DIR to the relative path to the local directory.
-#
-# Once done this will define
-#
-#  LIBKVKONTAKTE_FOUND - system has libkvkontakte
-#  LIBKVKONTAKTE_INCLUDES - the libkvkontakte include directory
-#  LIBKVKONTAKTE_LIBRARIES - Link these to use libkvkontakte
-#  LIBKVKONTAKTE_DEFINITIONS - Compiler switches required for using libkvkontakte
-#
-
-# Copyright (c) 2010, Gilles Caulier, <caulier.gilles@gmail.com>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-IF (LIBKVKONTAKTE_INCLUDES AND LIBKVKONTAKTE_LIBRARIES AND LIBKVKONTAKTE_DEFINITIONS)
-
-  MESSAGE(STATUS "Found Vkontakte library in cache: ${LIBKVKONTAKTE_LIBRARIES}")
-
-  # in cache already
-  SET(LIBKVKONTAKTE_FOUND TRUE)
-
-ELSE (LIBKVKONTAKTE_INCLUDES AND LIBKVKONTAKTE_LIBRARIES AND LIBKVKONTAKTE_DEFINITIONS)
-
-  MESSAGE(STATUS "Check Vkontakte library in local sub-folder...")
-
-  # Check if library is not in local sub-folder
-
-  IF (LIBKVKONTAKTE_LOCAL_DIR)
-    SET(VKONTAKTE_LOCAL_FOUND TRUE)
-  ELSE (LIBKVKONTAKTE_LOCAL_DIR)
-    FIND_FILE(VKONTAKTE_LOCAL_FOUND libkvkontakte/version.h.cmake ${CMAKE_SOURCE_DIR}/libkvkontakte ${CMAKE_SOURCE_DIR}/libs/libkvkontakte NO_DEFAULT_PATH)
-
-    IF (VKONTAKTE_LOCAL_FOUND)
-      FIND_FILE(VKONTAKTE_LOCAL_FOUND_IN_LIBS libkvkontakte/version.h.cmake ${CMAKE_SOURCE_DIR}/libs/libkvkontakte NO_DEFAULT_PATH)
-      IF (VKONTAKTE_LOCAL_FOUND_IN_LIBS)
-        SET(LIBKVKONTAKTE_LOCAL_DIR libs/libkvkontakte)
-      ELSE (VKONTAKTE_LOCAL_FOUND_IN_LIBS)
-        SET(LIBKVKONTAKTE_LOCAL_DIR libkvkontakte)
-      ENDIF (VKONTAKTE_LOCAL_FOUND_IN_LIBS)
-    ENDIF (VKONTAKTE_LOCAL_FOUND)
-  ENDIF (LIBKVKONTAKTE_LOCAL_DIR)
-
-  IF (VKONTAKTE_LOCAL_FOUND)
-
-    # we need two include directories: because the version.h file is put into the build directory
-    # TODO LIBKVKONTAKTE_INCLUDES sounds like it should contain only one directory...
-    SET(LIBKVKONTAKTE_INCLUDES ${CMAKE_SOURCE_DIR}/${LIBKVKONTAKTE_LOCAL_DIR} ${CMAKE_BINARY_DIR}/${LIBKVKONTAKTE_LOCAL_DIR})
-    SET(LIBKVKONTAKTE_DEFINITIONS "-I${CMAKE_SOURCE_DIR}/${LIBKVKONTAKTE_LOCAL_DIR}" "-I${CMAKE_BINARY_DIR}/${LIBKVKONTAKTE_LOCAL_DIR}")
-    SET(LIBKVKONTAKTE_LIBRARIES kvkontakte)
-    MESSAGE(STATUS "Found Vkontakte library in local sub-folder: ${CMAKE_SOURCE_DIR}/${LIBKVKONTAKTE_LOCAL_DIR}")
-    SET(LIBKVKONTAKTE_FOUND TRUE)
-    MARK_AS_ADVANCED(LIBKVKONTAKTE_INCLUDES LIBKVKONTAKTE_LIBRARIES LIBKVKONTAKTE_DEFINITIONS)
-
-  ELSE(VKONTAKTE_LOCAL_FOUND)
-    IF(NOT WIN32)
-      MESSAGE(STATUS "Check Vkontakte library using pkg-config...")
-
-      # use pkg-config to get the directories and then use these values
-      # in the FIND_PATH() and FIND_LIBRARY() calls
-      INCLUDE(UsePkgConfig)
-
-      PKGCONFIG(libkvkontakte _VKONTAKTEIncDir _VKONTAKTELinkDir _VKONTAKTELinkFlags _VKONTAKTECflags)
-
-      IF(_VKONTAKTELinkFlags)
-        # query pkg-config asking for a libkvkontakte >= 1.0.0
-        EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=1.0.0 libkvkontakte RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull )
-        IF(_return_VALUE STREQUAL "0")
-            MESSAGE(STATUS "Found libkvkontakte release >= 1.0.0")
-            SET(VKONTAKTE_VERSION_GOOD_FOUND TRUE)
-        ELSE(_return_VALUE STREQUAL "0")
-            MESSAGE(STATUS "Found libkvkontakte release < 1.0.0, too old")
-            SET(VKONTAKTE_VERSION_GOOD_FOUND FALSE)
-            SET(LIBKVKONTAKTE_FOUND FALSE)
-        ENDIF(_return_VALUE STREQUAL "0")
-      ELSE(_VKONTAKTELinkFlags)
-        SET(VKONTAKTE_VERSION_GOOD_FOUND FALSE)
-        SET(LIBKVKONTAKTE_FOUND FALSE)
-      ENDIF(_VKONTAKTELinkFlags)
-    ELSE(NOT WIN32)
-      SET(VKONTAKTE_VERSION_GOOD_FOUND TRUE)
-    ENDIF(NOT WIN32)
-
-    IF(VKONTAKTE_VERSION_GOOD_FOUND)
-        SET(LIBKVKONTAKTE_DEFINITIONS "${_VKONTAKTECflags}")
-
-        FIND_PATH(LIBKVKONTAKTE_INCLUDES libkvkontakte/version.h
-        ${_VKONTAKTEIncDir}
-        )
-
-        FIND_LIBRARY(LIBKVKONTAKTE_LIBRARIES NAMES kvkontakte
-        PATHS
-        ${_VKONTAKTELinkDir}
-        )
-
-        IF (LIBKVKONTAKTE_INCLUDES AND LIBKVKONTAKTE_LIBRARIES)
-            SET(LIBKVKONTAKTE_FOUND TRUE)
-        ENDIF (LIBKVKONTAKTE_INCLUDES AND LIBKVKONTAKTE_LIBRARIES)
-      ENDIF(VKONTAKTE_VERSION_GOOD_FOUND)
-      IF (LIBKVKONTAKTE_FOUND)
-          IF (NOT Vkontakte_FIND_QUIETLY)
-              MESSAGE(STATUS "Found libkvkontakte: ${LIBKVKONTAKTE_LIBRARIES}")
-          ENDIF (NOT Vkontakte_FIND_QUIETLY)
-      ELSE (LIBKVKONTAKTE_FOUND)
-          IF (Vkontakte_FIND_REQUIRED)
-              IF (NOT LIBKVKONTAKTE_INCLUDES)
-                  MESSAGE(FATAL_ERROR "Could NOT find libkvkontakte header files")
-              ENDIF (NOT LIBKVKONTAKTE_INCLUDES)
-              IF (NOT LIBKVKONTAKTE_LIBRARIES)
-                  MESSAGE(FATAL_ERROR "Could NOT find libkvkontakte library")
-              ENDIF (NOT LIBKVKONTAKTE_LIBRARIES)
-          ENDIF (Vkontakte_FIND_REQUIRED)
-      ENDIF (LIBKVKONTAKTE_FOUND)
-
-    MARK_AS_ADVANCED(LIBKVKONTAKTE_INCLUDES LIBKVKONTAKTE_LIBRARIES LIBKVKONTAKTE_DEFINITIONS)
-
-  ENDIF(VKONTAKTE_LOCAL_FOUND)
-
-ENDIF (LIBKVKONTAKTE_INCLUDES AND LIBKVKONTAKTE_LIBRARIES AND LIBKVKONTAKTE_DEFINITIONS)


From Pere: fix ACLiC for CMake builds on Windows

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@42285 27541ba8-7e3a-0410-8455-c3a389f83636

--- cmake/modules/RootConfiguration.cmake
+++ cmake/modules/RootConfiguration.cmake
@@ -352,12 +352,16 @@
 install(FILES ${CMAKE_BINARY_DIR}/include/RConfigure.h DESTINATION include)

 #---Configure and install various files----------------------------------------------------------------------
-execute_Process(COMMAND uname -a OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE )
+execute_Process(COMMAND hostname OUTPUT_VARIABLE BuildNodeInfo OUTPUT_STRIP_TRAILING_WHITESPACE )

 configure_file(${CMAKE_SOURCE_DIR}/config/rootrc.in ${CMAKE_BINARY_DIR}/etc/system.rootrc @ONLY)
 configure_file(${CMAKE_SOURCE_DIR}/config/RConfigOptions.in include/RConfigOptions.h)
-configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.in include/compiledata.h)
+if(WIN32)
+  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.win32.in include/compiledata.h)
+else()
+  configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/compiledata.in include/compiledata.h)
+endif()
 configure_file(${CMAKE_SOURCE_DIR}/config/Makefile-comp.in config/Makefile.comp)
 configure_file(${CMAKE_SOURCE_DIR}/config/Makefile.in config/Makefile.config)
 configure_file(${CMAKE_SOURCE_DIR}/config/mimes.unix.in ${CMAKE_BINARY_DIR}/etc/root.mimes)


Remove trailing whitespaces

Remove trailing whitespaces

--- cmake/modules/hunter_setup_msvc.cmake
+++ cmake/modules/hunter_setup_msvc.cmake
@@ -16,19 +16,19 @@
     hunter_status_print("MSVC generator: ${CMAKE_GENERATOR}")
     STRING(REGEX REPLACE "^Visual Studio (8 2005|9 2008|10 2010|11 2012|12 2013)( Win64| ARM|)" "\\1;\\2" _hunter_msvc_check "${CMAKE_GENERATOR}")
     list(GET _hunter_msvc_check 0 _hunter_msvc_check_string)
-
+
     string(COMPARE EQUAL "${_hunter_msvc_check_string}" "${CMAKE_GENERATOR}" _hunter_msvc_check_string_bool)
-
+
     if(_hunter_msvc_check_string_bool)
       hunter_internal_error("Invalid MSVC generator: ${CMAKE_GENERATOR}")
     else()
       STRING(REPLACE " " ";" _hunter_msvc_version_list "${_hunter_msvc_check_string}")
       list(GET _hunter_msvc_version_list 0 HUNTER_MSVC_VERSION)
       list(GET _hunter_msvc_version_list 1 HUNTER_MSVC_YEAR)
-
+
       hunter_status_print("HUNTER_MSVC_VERSION: ${HUNTER_MSVC_VERSION}")
       hunter_status_print("HUNTER_MSVC_YEAR: ${HUNTER_MSVC_YEAR}")
-
+
       list(GET _hunter_msvc_check 1 HUNTER_MSVC_ARCH)
       string(STRIP "${HUNTER_MSVC_ARCH}" HUNTER_MSVC_ARCH)

@@ -45,9 +45,9 @@
       else()
         hunter_internal_error("Can't detect generator arch: ${CMAKE_GENERATOR}")
       endif()
-
+
       hunter_status_print("HUNTER_MSVC_ARCH: ${HUNTER_MSVC_ARCH}")
-
+
       set(_hunter_result "${HUNTER_MSVC_VERSION}0")
       set(_hunter_result "VS${_hunter_result}COMNTOOLS")

@@ -63,7 +63,7 @@
       if(NOT HUNTER_MSVC_VCVARSALL)
         hunter_internal_error("vcvarsall.bat not found in `${_hunter_result}`")
       endif()
-
+
       hunter_status_print("vcvarsall.bat file location: ${HUNTER_MSVC_VCVARSALL}")

       unset(_hunter_result_win64)


qibuild.cmake version 9

qibuild.cmake version 9

Never look for qibuild executable, it's useless.
Never try to find qibuild/cmake twice, it's also useless

--- cmake/qibuild/templates/qibuild.cmake
+++ cmake/qibuild/templates/qibuild.cmake
@@ -6,89 +6,16 @@
 # This file is part of the qibuild project    #
 ###############################################

-set(QIBUILD_BOOTSTRAP_VERSION 8)
+set(QIBUILD_BOOTSTRAP_VERSION 9)

-
-##
-# Create a use_qibuild.cmake file in CMAKE_BINARY_DIR,
-# and include it.
-# This allow us to find all qibuild/qibuild.cmake
-function(bootstrap)
-  find_program(PYTHON_EXECUTABLE NAMES python2 python python.exe
-    PATHS
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]
-      [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath]
-  )
-
-
-  if(NOT PYTHON_EXECUTABLE)
-    message(STATUS
-      "
-      Could not find python executable.
-
-      Please check your setup.
-
-      "
-    )
-    message(FATAL_ERROR "")
-  endif()
-
-  get_filename_component(_python_root ${PYTHON_EXECUTABLE} PATH)
-  find_program(QI_BUILD_EXECUTABLE NAMES qibuild.py qibuild
-    PATHS
-      "${_python_root}/Scripts"
-  )
-
-  if(NOT QI_BUILD_EXECUTABLE)
-    message(STATUS
-      "
-      Could not find qibuild executable.
-
-      Please check your setup.
-
-      "
-    )
-    message(FATAL_ERROR "")
-  endif()
-  set(_cmd ${PYTHON_EXECUTABLE} ${QI_BUILD_EXECUTABLE})
-  set(_cmd ${_cmd} configure --single --bootstrap "--build-directory=${CMAKE_BINARY_DIR}")
-  execute_process(
-      COMMAND ${_cmd}
-      RESULT_VARIABLE  _retcode
-      OUTPUT_VARIABLE  _stdout
-      ERROR_VARIABLE   _stderr
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
-      )
-  if(NOT ${_retcode} EQUAL 0)
-    message(STATUS
-        "
-        qibuild bootstrap fail!
-        Log:
-        ====
-        ${_cmd}
-        ${_stdout}
-        ${_stderr}
-
-        ===
-
-        Please file a bug report with a comple CMake log
-        "
-    )
-      message(FATAL_ERROR "")
-  endif()
-endfunction()
-
-
-include(qibuild/general OPTIONAL RESULT_VARIABLE _qibuild_found)
-if(_qibuild_found)
-  return()
+# Someone used qibuild and generated a dependencies.cmake
+# file (for the dependencies and where to find qibuild/cmake file),
+# so just use it.
+if(EXISTS ${CMAKE_BINARY_DIR}/dependencies.cmake)
+  include(${CMAKE_BINARY_DIR}/dependencies.cmake)
 endif()

-if(NOT EXISTS ${CMAKE_BINARY_DIR}/dependencies.cmake)
-  bootstrap()
-endif()
-
-include(${CMAKE_BINARY_DIR}/dependencies.cmake)
-
-
+# Someone called cmake with a toolchain file that is
+# able to find qibuild/cmake code, so just include it.
+# Else, fail loudly.
 include(qibuild/general)


ENH: should package on all plateforms

ENH: should package on all plateforms

--- DTIAtlasFiberAnalyzer.cmake
+++ DTIAtlasFiberAnalyzer.cmake
@@ -67,14 +67,18 @@

 if( EXTENSION_SUPERBUILD_BINARY_DIR )
   set( ToolsList
-  dtitractstat
-  DTIAtlasFiberAnalyzer
-  MergeStatWithFiber
-  FiberCompare
   fiberprocess
   )
   foreach( tool ${ToolsList})
-    install(PROGRAMS ${SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY}/${tool} DESTINATION ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION})
+    find_program( path_to_tool
+       NAMES ${tool}
+       PATHS ${SlicerExecutionModel_DEFAULT_CLI_RUNTIME_OUTPUT_DIRECTORY}
+       PATH_SUFFIXES Debug Release RelWithDebInfo MinSizeRel
+       NO_DEFAULT_PATH
+       NO_SYSTEM_ENVIRONMENT_PATH
+      )
+    message(WARNING "${path_to_tool}" )
+    install(PROGRAMS ${path_to_tool} DESTINATION ${SlicerExecutionModel_DEFAULT_CLI_INSTALL_RUNTIME_DESTINATION})
   endforeach()
   set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_INSTALL_CMAKE_PROJECTS};${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
   include(${Slicer_EXTENSION_CPACK})


ChangeLog do not need to be execute when make all

--- Modules/ManageVersion.cmake
+++ Modules/ManageVersion.cmake
@@ -154,7 +154,7 @@

     PRJ_INFO_CMAKE_WRITE()

-    ADD_CUSTOM_TARGET(changelog ALL
+    ADD_CUSTOM_TARGET(changelog
 	COMMAND ${CMAKE_COMMAND} -Dcmd=update
 	-Dchangelog=${CHANGELOG_FILE}
 	-Drelease=${RELEASE_NOTES_FILE}


MakeFile: cmake-fedora.conf: more search route

--- Modules/ManageFile.cmake
+++ Modules/ManageFile.cmake
@@ -132,7 +132,8 @@
     "BIN" "PRJ_DOC" "DATA" "PRJ_DATA" "SYSCONF" "SYSCONF_NO_REPLACE"
     "LIB" "LIBEXEC"
     )
-INCLUDE(ManageMessage)
+INCLUDE(ManageMessage RESULT_VARIABLE MANAGE_MODULE_PATH)
+GET_FILENAME_COMPONENT(CMAKE_FEDORA_MODULE_DIR "${MANAGE_MODULE_PATH}" PATH)
 INCLUDE(ManageVariable)

 MACRO(_MANAGE_FILE_SET_FILE_INSTALL_LIST fileType)
@@ -314,6 +315,8 @@
 	FIND_ARGS cmake-fedora.conf
 	PATHS ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/cmake-fedora
 	. cmake-fedora /etc
+	${CMAKE_FEDORA_MODULE_DIR}/..
+	${CMAKE_FEDORA_MODULE_DIR}/../cmake-fedora
 	${CMAKE_SOURCE_DIR}/../../..
 	${CMAKE_SOURCE_DIR}/../../../cmake-fedora
 	${CMAKE_SOURCE_DIR}/../..


Follow-up for r264162 to fix the CMake build (update LLDBDependencies.cmake).

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

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -73,6 +73,7 @@
   lldbPluginOSPython
   lldbPluginMemoryHistoryASan
   lldbPluginInstrumentationRuntimeAddressSanitizer
+  lldbPluginInstrumentationRuntimeThreadSanitizer
   lldbPluginSystemRuntimeMacOSX
   lldbPluginProcessElfCore
   lldbPluginJITLoaderGDB


fix cp bug of warpctc repository,test=develop (#21901)

--- cmake/external/warpctc.cmake
+++ cmake/external/warpctc.cmake
@@ -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/ ${WARPCTC_SOURCE_DIR})
+    set(WARPCTC_PATCH_COMMAND cp -r ${PADDLE_SOURCE_DIR}/patches/warpctc/. ${WARPCTC_SOURCE_DIR})
 endif()

 ExternalProject_Add(


Forward compiler flags to Fortran workaround

--- cmake/language_support.cmake
+++ cmake/language_support.cmake
@@ -24,6 +24,8 @@
   set(text
     "project(test NONE)
     cmake_minimum_required(VERSION 2.6.0)
+    set (CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS}\")
+    set (CMAKE_EXE_LINKER_FLAGS \"${CMAKE_EXE_LINKER_FLAGS}\")
     enable_language(${language} OPTIONAL)
   ")
   file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language})


[OCaml] Install .mli (interface) files

[OCaml] Install .mli (interface) files

Install the OCaml interface .mli files. Those files were most likely
omitted because they are input files for the compiled .cmi files.
However, installing them is reasonable since -- unlike .cmi files --
they are human-readable.

The issue was originally spotted by @jpdeplaix.

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

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

--- cmake/modules/AddOCaml.cmake
+++ cmake/modules/AddOCaml.cmake
@@ -180,10 +180,11 @@

   set(install_files)
   set(install_shlibs)
-  foreach( ocaml_output ${ocaml_outputs} )
+  foreach( ocaml_output ${ocaml_inputs} ${ocaml_outputs} )
     get_filename_component(ext "${ocaml_output}" EXT)

     if( NOT (ext STREQUAL ".cmo" OR
+             ext STREQUAL ".ml" OR
              ext STREQUAL CMAKE_C_OUTPUT_EXTENSION OR
              ext STREQUAL CMAKE_SHARED_LIBRARY_SUFFIX) )
       list(APPEND install_files "${ocaml_output}")


Build: search libraries in Apple SDKs (if needed)

Addresses rdar://problem/56204969

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1260,6 +1260,10 @@
       "${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
       "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
       "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
+
+  if(DEFINED ENV{SDKROOT})
+      list(APPEND library_search_directories "$ENV{SDKROOT}/usr/lib/swift")
+  endif()

   # Add variant-specific flags.
   if(SWIFTLIB_SINGLE_TARGET_LIBRARY)


Added a new argument to add_swift_target_library to control the install_name_dir.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -739,6 +739,7 @@
         DEPLOYMENT_VERSION_TVOS
         DEPLOYMENT_VERSION_WATCHOS
         INSTALL_IN_COMPONENT
+        LIBRARY_INSTALL_NAME_DIR
         MODULE_TARGET
         SDK)
   set(SWIFTLIB_SINGLE_multiple_parameter_options
@@ -1052,6 +1053,10 @@
     # Always use @rpath for XCTest
     if(module_name STREQUAL "XCTest")
       set(install_name_dir "@rpath")
+    endif()
+
+    if(SWIFTLIB_SINGLE_LIBRARY_INSTALL_NAME_DIR)
+      set(install_name_dir "${SWIFTLIB_SINGLE_LIBRARY_INSTALL_NAME_DIR}")
     endif()

     set_target_properties("${target}"
@@ -1619,7 +1624,8 @@
         DEPLOYMENT_VERSION_OSX
         DEPLOYMENT_VERSION_TVOS
         DEPLOYMENT_VERSION_WATCHOS
-        INSTALL_IN_COMPONENT)
+        INSTALL_IN_COMPONENT
+        LIBRARY_INSTALL_NAME_DIR)
   set(SWIFTLIB_multiple_parameter_options
         C_COMPILE_FLAGS
         DEPENDS
@@ -1921,6 +1927,7 @@
         ${SWIFTLIB_TARGET_LIBRARY_keyword}
         ${SWIFTLIB_FORCE_BUILD_OPTIMIZED_keyword}
         ${SWIFTLIB_NOSWIFTRT_keyword}
+        LIBRARY_INSTALL_NAME_DIR "${SWIFTLIB_LIBRARY_INSTALL_NAME_DIR}"
         INSTALL_IN_COMPONENT "${SWIFTLIB_INSTALL_IN_COMPONENT}"
         DEPLOYMENT_VERSION_OSX "${SWIFTLIB_DEPLOYMENT_VERSION_OSX}"
         DEPLOYMENT_VERSION_IOS "${SWIFTLIB_DEPLOYMENT_VERSION_IOS}"


Removed all extra MSVC flags

Removed all extra MSVC flags

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -124,21 +124,16 @@

  elseif (TUDAT_BUILD_MSVC)
      add_compile_definitions(TUDAT_BUILD_MSVC)
-     add_definitions( "-D_ENABLE_EXTENDED_ALIGNED_STORAGE" )
+     add_definitions("-D_ENABLE_EXTENDED_ALIGNED_STORAGE")
      message(STATUS "Using MSVC compiler.")
      # problem: https://dev.azure.com/tudat-team/feedstock-builds/_build/results?buildId=95&view=logs&j=00f5923e-fdef-5026-5091-0d5a0b3d5a2c&t=3cc4a9ed-60e1-5810-6eb3-5f9cd4a26dba
      # solution: https://stackoverflow.com/questions/1091662/vc-internal-compiler-error
-#     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /Ox /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
-     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
+     #     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /Ox /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
+#     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
      if (TUDAT_FORCE_DYNAMIC_RUNTIME)
          # This is needed for conda builds, as the prebuilt libraries are MD.
-         foreach (flag_var
-                 CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
-                 CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-             # Find all dynamic runtime (MD) references and replace with static (MT)
-             set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")
-             message(STATUS "Forcing MD_DynamicRuntime on MSVC")
-         endforeach (flag_var)
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")
+         message(STATUS "Forcing MD_DynamicRuntime on MSVC")
      else ()
          # The following applied to legacy Tudat.
          # Because we are using static boost libraries, with static runtime, we need to force MSVC to


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -209,7 +209,8 @@
                  "C3280" # Declaration hides variable
                  )
      endif ()
-     if (NOT CLANG)
+     if (CMAKE_C_COMPILER_ID MATCHES "Clang")
+     else()
          string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR ${MSVC_DISABLED_WARNINGS_LIST})
          string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
      endif ()


Update compiler.cmake

Update compiler.cmake

Added final flags missed in regex

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -207,6 +207,8 @@
                      " -Wno-exit-time-destructors"
                      " -Wno-undefined-func-template"
                      " -Wno-c++98-compat"
+                     " -Wno-shorten-64-to-32"
+                     " -Wno-c++98-compat-pedantic"
                      )
              string(CONCAT CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
              #endif ()


fixed error

fixed error

--- cmake/expr/expressions/interpret_ellipsis.cmake
+++ cmake/expr/expressions/interpret_ellipsis.cmake
@@ -11,8 +11,7 @@
   list_select_property(dots type)
   ans(dot_types)

-  if(NOT "${dot_types}" STREQUAL "dot;dot;dot")
-    list(REVERSE dot_types)
+  if(NOT "${dot_types}" STREQUAL "dot;dot;dot")
     throw("not ellipsis: ${dot_types}")
   endif()


Pass stripping related flags from super build to SimpleITK

Change-Id: I662081ac504d324f6a030fbda6fda7351773320b

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -197,6 +197,8 @@
   CMAKE_SHARED_LINKER_FLAGS_RELEASE
   CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO

+  CMAKE_STRIP
+
   CMAKE_GENERATOR
   CMAKE_EXTRA_GENERATOR
   MEMORYCHECK_COMMAND_OPTIONS
@@ -209,6 +211,11 @@
   list( APPEND ep_common_list
     CMAKE_OSX_SYSROOT
     CMAKE_OSX_DEPLOYMENT_TARGET )
+endif()
+
+if( DEFINED CMAKE_STRIP_FLAGS )
+  list( APPEND ep_common_list
+    CMAKE_STRIP_FLAGS )
 endif()

 VariableListToArgs( ep_common_list ep_common_args )


cmake: do not set default build type when using a multi-config generator

--- cmake/HextDefaultBuildRelease.cmake
+++ cmake/HextDefaultBuildRelease.cmake
@@ -1,6 +1,6 @@
 # If build type was not specified, build Release.

-if(NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE Release)
-endif(NOT CMAKE_BUILD_TYPE)
+if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
+  set(CMAKE_BUILD_TYPE "Release")
+endif()


Revert "[CMake] Explicitly add --target option to compiler flags"

This reverts commit r282024.

This broke some bots, and I'm going to revert while I figure it out.

See: http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/21120

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

--- cmake/Modules/CompilerRTUtils.cmake
+++ cmake/Modules/CompilerRTUtils.cmake
@@ -227,18 +227,6 @@
     set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${COMPILER_RT_TEST_TARGET_TRIPLE})
   endif()

-  if(NOT APPLE)
-    # Much of the non-darwin compiler-rt build assumes that
-    # COMPILER_RT_DEFAULT_TARGET_TRIPLE is the default target of the compiler
-    # being used. That isn't always a safe assumption, but adding this here
-    # makes it all work.
-    # This doesn't prevent needing to set CMAKE_<LANG>_COMPILER_TARGET in some
-    # situations, so YMMV.
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
-    set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} --target=${COMPILER_RT_DEFAULT_TARGET_TRIPLE}")
-  endif()
-
   string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE})
   list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH)
   list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_DEFAULT_TARGET_OS)


added support clang compiler

added support clang compiler

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -3,6 +3,14 @@
 # ----------------------------------------------------------------------------
 if(CMAKE_CL_64)
     set(MSVC64 1)
+endif()
+
+if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+  set(CMAKE_COMPILER_IS_GNUCXX 1)
+endif()
+
+if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
+  set(CMAKE_COMPILER_IS_GNUC 1)
 endif()

 # ----------------------------------------------------------------------------
@@ -47,7 +55,7 @@

     # Typical output in CMAKE_OPENCV_GCC_VERSION_FULL: "c+//0 (whatever) 4.2.3 (...)"
     # Look for the version number
-    string(REGEX MATCH "[0-9]+.[0-9]+.[0-9]+" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")
+    string(REGEX MATCH "[0-9]+.[0-9]+(.[0-9]+)?" CMAKE_GCC_REGEX_VERSION "${CMAKE_OPENCV_GCC_VERSION_FULL}")

     # Split the three parts:
     string(REGEX MATCHALL "[0-9]+" CMAKE_OPENCV_GCC_VERSIONS "${CMAKE_GCC_REGEX_VERSION}")


mark USE_AVX2 as advanced

mark USE_AVX2 as advanced

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -279,7 +279,7 @@
       set(USE_AVX    ${AVX_FOUND}    CACHE BOOL "Use AVX. This will double some of the vector sizes relative to SSE." ${_force})
       set(USE_XOP    ${XOP_FOUND}    CACHE BOOL "Use XOP." ${_force})
       set(USE_FMA4   ${FMA4_FOUND}   CACHE BOOL "Use FMA4." ${_force})
-      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_XOP USE_FMA4)
+      mark_as_advanced(USE_SSE2 USE_SSE3 USE_SSSE3 USE_SSE4_1 USE_SSE4_2 USE_SSE4a USE_AVX USE_AVX2 USE_XOP USE_FMA4)
       if(USE_SSE2)
          list(APPEND _enable_vector_unit_list "sse2")
       else(USE_SSE2)


Check Qt5::QTcpServerConnection target exists

--- cmake/Qt5Qml_ZZZ_HunterPlugin.cmake
+++ cmake/Qt5Qml_ZZZ_HunterPlugin.cmake
@@ -20,6 +20,7 @@
   message(FATAL_ERROR "Expected target Qt5::Qml")
 endif()

-if(IOS)
+if(IOS AND TARGET Qt5::QTcpServerConnection)
+  # No Qt5::QTcpServerConnection target in Qt 5.6
   _qt_cmake_extra_helpers_add_interface(Qt5::Qml Qt5::QTcpServerConnection)
 endif()


idl-config: Fix usage of bool arguments.

Change-Id: I0fcf690d400505a4f13a3c077e5e0c7f4e5c57d8

--- codegen/src/idl-config.cmake
+++ codegen/src/idl-config.cmake
@@ -33,19 +33,19 @@
   #ARGN are sources too
   set(ARG_SRC ${ARG_UNPARSED_ARGUMENTS} ${ARG_SRC})
   #Reformat arguments to be able to bounce them
-  if (${ARG_NO_INSTALL})
+  if (ARG_NO_INSTALL)
     set(ARGOPT_NO_INSTALL NO_INSTALL)
   endif()
-  if (${ARG_NO_FPIC})
+  if (ARG_NO_FPIC)
     set(ARGOPT_NO_FPIC NO_FPIC)
   endif()
-  if (${ARG_SHARED})
+  if (ARG_SHARED)
     set(ARGOPT_SHARED SHARED)
   endif()
-  if (${ARG_STATIC})
+  if (ARG_STATIC)
     set(ARGOPT_STATIC STATIC)
   endif()
-  if (${ARG_INTERNAL})
+  if (ARG_INTERNAL)
     set(ARGOPT_INTERNAL INTERNAL)
   endif()
   if ("${ARG_HEADERS}" STREQUAL "")
@@ -70,7 +70,7 @@
   message("input classes: ${ARG_SERVICES} ${ARG_CLASSES}")
   message("classes: '${classes}'")
   # Generate proxy if asked to
-  if (${ARG_PROXY})
+  if (ARG_PROXY)
     qi_generate_src(
       ${CMAKE_CURRENT_BINARY_DIR}/${name}_proxy.hpp
       SRC ${ARG_SRC}


ENH: Updated to use modern FILE command for writing to output logs instead of WRITE_FILE.

--- kwsysPlatformCxxTests.cmake
+++ kwsysPlatformCxxTests.cmake
@@ -7,11 +7,11 @@
       COMPILE_DEFINITIONS -DTEST_${var} ${KWSYS_PLATFORM_CXX_TEST_DEFINES}
       OUTPUT_VARIABLE OUTPUT)
     IF(${var}_COMPILED)
-      WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeOutput.log
-        "${description} compiled with the following output:\n${OUTPUT}\n\n" APPEND)
+      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeOutput.log
+        "${description} compiled with the following output:\n${OUTPUT}\n\n")
     ELSE(${var}_COMPILED)
-      WRITE_FILE(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeError.log
-        "${description} failed to compile with the following output:\n${OUTPUT}\n\n" APPEND)
+      FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/CMakeError.log
+        "${description} failed to compile with the following output:\n${OUTPUT}\n\n")
     ENDIF(${var}_COMPILED)
     IF(${invert} MATCHES INVERT)
       IF(${var}_COMPILED)


[numerics] correct double test introduced

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -435,7 +435,7 @@

   NEW_TEST(test_fc3d_43 fc3d_test43.c) # DSFP converges with specific rho guessed with the nose
   NEW_FC_TEST(BoxesStack1-i100000-32.hdf5.dat
-    SICONOS_FRICTION_3D_VI_DSFP 1e-3 100000
+    SICONOS_FRICTION_3D_VI_FPP 1e-3 100000
     0 0 0
     DPARAM 3 8e-4)

@@ -445,11 +445,6 @@
     0 0 0
     IPARAM 2 1)

-  NEW_TEST(test_fc3d_45 fc3d_test45.c) # VI_EG
-  NEW_FC_TEST(BoxesStack1-i100000-32.hdf5.dat
-    SICONOS_FRICTION_3D_VI_EG 1e-8 100000
-    0 0 0
-    IPARAM 2 1)

   NEW_TEST(test_fc3d_46 fc3d_test46.c) # FPP
   NEW_TEST(test_fc3d_47 fc3d_test47.c) # EG


Revert "link against single shared libclang-cpp when building with llvm 9, too"

This reverts commit 4c98e36ab636dd799772e3c8a2d9ddaaebaf64e2.

After speaking with Andreas, this will be in Debian as Debian-specific patch.

--- cmake/LLVM.cmake
+++ cmake/LLVM.cmake
@@ -247,8 +247,8 @@
 ####################################################################

 # llvm-config does not include clang libs
-if((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
-  # For Clang 9+, link against a single shared library instead of multiple component shared
+if((9 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))
+  # For Clang 10+, link against a single shared library instead of multiple component shared
   # libraries.
   if("${LLVM_LIBNAMES}" MATCHES "LLVMTCE")
     set(CLANG_LIBNAMES clangTCE-cpp)
@@ -265,7 +265,7 @@
 foreach(LIBNAME ${CLANG_LIBNAMES})
   find_library(C_LIBFILE_${LIBNAME} NAMES "${LIBNAME}" HINTS "${LLVM_LIBDIR}")
   list(APPEND CLANG_LIBFILES "${C_LIBFILE_${LIBNAME}}")
-  if(UNIX AND (NOT APPLE) AND (NOT ((8 LESS LLVM_MAJOR) AND (NOT STATIC_LLVM))))
+  if(UNIX AND (NOT APPLE))
     set(LLVM_LDFLAGS "${LLVM_LDFLAGS} -Wl,--exclude-libs,lib${LIBNAME}")
   endif()
 endforeach()


add build comment for cocl outputs to makelists

--- cmake/cocl.cmake
+++ cmake/cocl.cmake
@@ -1,6 +1,7 @@
 macro(add_cocl_executable OUTPUT SRCFILE)
     add_custom_command(
         OUTPUT ${OUTPUT}
+        COMMENT "${CMAKE_CURRENT_SOURCE_DIR}/bin/cocl ${SRCFILE} -o ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}"
         COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bin/cocl ${SRCFILE} -o ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT}
         DEPENDS cocl clblast clew easycl
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}


SVN_SILENT made messages (.desktop file)

--- plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
+++ plugins/sipe/ktpaccountskcm_plugin_sipe.desktop.cmake
@@ -12,6 +12,7 @@
 Comment[fr]=Interface utilisateur personnalisée pour la configuration de comptes en utilisant le gestionnaire de connexions « sipe ».
 Comment[ia]=Interfacie de usator pro configuration de conto personalisate pro contos usante le gerente de connexion sipe.
 Comment[it]=Interfaccia utente personalizzata di configurazione account per account che usano il gestore di connessioni Sipe.
+Comment[ko]=sipe 연결 관리자를 사용하는 계정 설정 사용자 인터페이스입니다.
 Comment[lt]=Savito paskyros konfigūravimo naudotojo sąsaja paskyroms naudojant sipe ryšio tvarkyklę.
 Comment[nb]=Brukerflate for å sette opp egendefinerte kontoer ved bruk av sipe tilkoblingsbehandler.
 Comment[nl]=Gebruikersinterface voor aangepaste accountconfiguratie voor accounts die de Sipe verbindingenbeheerder gebruiken.
@@ -41,6 +42,7 @@
 Name[fr]=Interface utilisateur pour la configuration de comptes « sipe ».
 Name[ia]=Interfacie de usator de configuration de conto de Sipe
 Name[it]=Interfaccia utente di configurazione account Sipe
+Name[ko]=Sipe 계정 설정 사용자 인터페이스
 Name[lt]=Sipe paskyros konfigūravimo naudotojo sąsaja
 Name[nb]=Brukerflate for å sette opp Sipe-konto
 Name[nl]=Gebruikersinterface voor Sipe accountconfiguratie


cmake: fix JNI configuration problem for Android samples

Some CMake 3.x (2.8.12.2 is fine) provides broken build configurations
with following build error message:
    ld: fatal error: -soname: must take a non-empty argument

Linker command line sample contains this:
"-shared -Wl,-soname, -o"

--- cmake/OpenCVDetectAndroidSDK.cmake
+++ cmake/OpenCVDetectAndroidSDK.cmake
@@ -290,7 +290,7 @@
           set(android_proj_NATIVE_DEPS ${android_proj_NATIVE_DEPS} android)
         endif()

-        add_library(${JNI_LIB_NAME} MODULE ${android_proj_jni_files})
+        add_library(${JNI_LIB_NAME} SHARED ${android_proj_jni_files})
         target_link_libraries(${JNI_LIB_NAME} ${OPENCV_LINKER_LIBS} ${android_proj_NATIVE_DEPS})

         set_target_properties(${JNI_LIB_NAME} PROPERTIES


dlpack: Build with 'BUILD_MOCK=OFF'

dlpack: Build with 'BUILD_MOCK=OFF'

--- cmake/projects/dlpack/hunter.cmake
+++ cmake/projects/dlpack/hunter.cmake
@@ -5,6 +5,7 @@

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

@@ -52,6 +53,8 @@
     0be27ccdaf2142517e21b62cb3629c363ccebbf2
 )

+hunter_cmake_args(dlpack CMAKE_ARGS BUILD_MOCK=OFF)
+
 hunter_pick_scheme(DEFAULT url_sha1_cmake)
 hunter_cacheable(dlpack)
 hunter_download(PACKAGE_NAME dlpack)


added error test when  a dependency location hasnt been found

--- dist/WkTest.cmake
+++ dist/WkTest.cmake
@@ -82,6 +82,9 @@
 				#needed for each run library dependency as well
 				#message ( STATUS "Detected run libraries to copy : ${${PROJECT_NAME}_RUN_LIBRARIES}" )
 				foreach ( looparg ${${PROJECT_NAME}_RUN_LIBRARIES} )
+					if ( NOT looparg )
+						message ( SEND_ERROR "Error with dependency needed to run test : ${looparg}" )
+					endif ( NOT looparg )
 					ADD_CUSTOM_COMMAND( TARGET ${test_name} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${looparg} ${${test_name}_PATH}
 														COMMENT "Copying ${looparg} to ${${test_name}_PATH}" )
 				endforeach ( looparg ${${PROJECT_NAME}_RUN_LIBRARIES} )


Fix case of filename

Fix case of filename

--- plugins/autojoin/plugin.cmake
+++ plugins/autojoin/plugin.cmake
@@ -10,5 +10,5 @@

 add_web_client_test(
     autojoin
-    "${PROJECT_SOURCE_DIR}/plugins/autojoin/plugin_tests/autoJoinSpec.js"
+    "${PROJECT_SOURCE_DIR}/plugins/autojoin/plugin_tests/autojoinSpec.js"
     PLUGIN autojoin)


Revert changes to tryrun.cmake (#27697)

Revert changes to tryrun.cmake (#27697)


dts: add support for soc family level fixups

We duplicate a lot of fixup info per board which could be done at the
SoC family level.  So introduce the concept of DTS_SOC_FIXUP_FILE which
we default to arch/<ARCH>/soc/<SOC_FAMILY>/<SOC_SERIES>/dts.fixup.

Signed-off-by: Kumar Gala <a5e5248af4cd4f0ed8c515f61d40a6e2db46a66e@linaro.org>

--- dts/dts.cmake
+++ dts/dts.cmake
@@ -89,10 +89,14 @@
   if(EXISTS ${DTS_BOARD_FIXUP_FILE})
     set(DTS_BOARD_FIXUP -f ${DTS_BOARD_FIXUP_FILE})
   endif()
+  set_ifndef(DTS_SOC_FIXUP_FILE ${PROJECT_SOURCE_DIR}/arch/${ARCH}/soc/${CONFIG_SOC_FAMILY}/${CONFIG_SOC_SERIES}/dts.fixup)
+  if(EXISTS ${DTS_SOC_FIXUP_FILE})
+    set(DTS_SOC_FIXUP -f ${DTS_SOC_FIXUP_FILE})
+  endif()
   set(CMD_EXTRACT_DTS_INCLUDES ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/dts/extract_dts_includes.py
     --dts ${BOARD_FAMILY}.dts_compiled
     --yaml ${PROJECT_SOURCE_DIR}/dts/bindings
-    ${DTS_BOARD_FIXUP}
+    ${DTS_SOC_FIXUP} ${DTS_BOARD_FIXUP}
     )
   execute_process(
     COMMAND ${CMD_EXTRACT_DTS_INCLUDES}


Updated MKL find module

Updated MKL find module

Former-commit-id: e66f350a05b9ef2b59a2812c35f09734a0d4da1e

--- cmake-modules/SetupMKL.cmake
+++ cmake-modules/SetupMKL.cmake
@@ -55,7 +55,11 @@
             target_link_libraries(mkl::mkl INTERFACE mkl::mkl_gf_lp_seq)
         endif()
         target_compile_definitions(mkl::mkl INTERFACE MKL_AVAILABLE )
-        target_link_libraries(mkl::mkl INTERFACE gfortran::gfortran)
+
+        find_package(Fortran REQUIRED)
+        find_package(Threads REQUIRED)
+        target_link_libraries(mkl::mkl INTERFACE gfortran::gfortran Threads::Threads dl)
+

         # Make the rest of the build structure aware of blas and lapack included in MKL.
         add_library(blas::blas          INTERFACE IMPORTED)


Added some extra checks to verify GitHub access is properly setup

--- cmake/CheckEnvironment.cmake
+++ cmake/CheckEnvironment.cmake
@@ -31,6 +31,12 @@
 	message( SEND_ERROR "You need to install Git and add it to the PATH environment variable." )
 endif()

+# SSH
+find_program(SSH_BIN NAMES ssh)
+if (NOT SSH_BIN)
+	message( SEND_ERROR "You need to install SSH and add it to the PATH environment variable." )
+endif()
+
 # Subversion
 find_program(SVN_BIN NAMES svn)
 if (NOT SVN_BIN)
@@ -49,26 +55,63 @@
 	message( SEND_WARNING "You need to install Perl and add it to the PATH environment variable if you want to be able to generate packages." )
 endif()

-# Add github.com's SSH signature to the .ssh/known_hosts file
-set(GITHUB_SIGN "github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==")
-file(TO_CMAKE_PATH ${HOME_PATH} HOME_PATH)
-set(SSH_KNOWN_HOSTS_PATH ${HOME_PATH}/.ssh/known_hosts)
-file(STRINGS ${SSH_KNOWN_HOSTS_PATH} KNOWN_HOSTS REGEX github\\.com)
-list(LENGTH KNOWN_HOSTS N)
-set (INDEX 0)
-while(INDEX LESS N)
-	list(GET KNOWN_HOSTS ${INDEX} KNOWN_HOST)
-	string(STRIP ${KNOWN_HOST} KNOWN_HOST)
-	string(COMPARE EQUAL ${KNOWN_HOST} ${GITHUB_SIGN} GITHUB_FOUND)
-	if (GITHUB_FOUND)
-		message(STATUS "Found Github's SSH signature in ${SSH_KNOWN_HOSTS_PATH}")
-		break()
+set (SKIP_GITHUB_TESTS Off CACHE BOOL "Set this to On to skip GitHub access tests")
+set_property(CACHE SKIP_GITHUB_TESTS PROPERTY ADVANCED True)
+
+if (NOT ${SKIP_GITHUB_TESTS})
+
+	# Add github.com's SSH signature to the .ssh/known_hosts file
+	set(GITHUB_SIGN "github.com,207.97.227.239 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==")
+	file(TO_CMAKE_PATH ${HOME_PATH} HOME_PATH)
+	set(SSH_KNOWN_HOSTS_PATH ${HOME_PATH}/.ssh/known_hosts)
+	file(STRINGS ${SSH_KNOWN_HOSTS_PATH} KNOWN_HOSTS REGEX github\\.com)
+	list(LENGTH KNOWN_HOSTS N)
+	set (INDEX 0)
+	while(INDEX LESS N)
+		list(GET KNOWN_HOSTS ${INDEX} KNOWN_HOST)
+		string(STRIP ${KNOWN_HOST} KNOWN_HOST)
+		string(COMPARE EQUAL ${KNOWN_HOST} ${GITHUB_SIGN} GITHUB_FOUND)
+		if (GITHUB_FOUND)
+			message(STATUS "Found Github's SSH signature in ${SSH_KNOWN_HOSTS_PATH}")
+			break()
+		endif()
+		math( EXPR INDEX "${INDEX} + 1" )
+	endwhile()
+
+	if ( NOT GITHUB_FOUND)
+		message( STATUS "Could not find Github's SSH signature, appending to ${SSH_KNOWN_HOSTS_PATH}..." )
+		file(APPEND ${SSH_KNOWN_HOSTS_PATH} "\n${GITHUB_SIGN}\n")
 	endif()
-	math( EXPR INDEX "${INDEX} + 1" )
-endwhile()

-if ( NOT GITHUB_FOUND)
-	message( STATUS "Could not find Github's SSH signature, appending to ${SSH_KNOWN_HOSTS_PATH}..." )
-	file(APPEND ${SSH_KNOWN_HOSTS_PATH} "\n${GITHUB_SIGN}\n")
+	# Test for a SSH key
+	set(SSH_PUB_KEY ${HOME_PATH}/.ssh/id_rsa.pub)
+	if (NOT EXISTS ${SSH_PUB_KEY})
+		message( FATAL_ERROR "Could not find a public SSH key, you need to generate one." )
+	else()
+		message( STATUS "Found the user's public SSH key..." )
+	endif()
+
+	# Make sure the user's key has been upload to GitHub
+	message( STATUS "Testing user's access to GitHub..." )
+	execute_process(COMMAND ${SSH_BIN} -T git@github.com
+		            TIMEOUT 10
+		            RESULT_VARIABLE SSH_TEST_RESULT
+		            OUTPUT_QUIET
+		            ERROR_QUIET
+		           )
+
+	if (SSH_TEST_RESULT EQUAL 255)
+		file(READ ${SSH_PUB_KEY} SSH_PUB_KEY_VALUE)
+		message( FATAL_ERROR "
+Could not connect to GitHub using SSH public key (found here : ${SSH_PUB_KEY})
+Add this key to your GitHub account ( https://github.com/settings/ssh ) :
+${SSH_PUB_KEY_VALUE}" )
+
+	else()
+		message( STATUS "GitHub access successful !" )
+	endif()
+
+	set (SKIP_GITHUB_TESTS On CACHE BOOL "GitHub access tests were successful, set On to force re-evaluation" FORCE)
 endif()

+


Update DefaultBuildType.cmake with a little future proofing

--- cmake/DefaultBuildType.cmake
+++ cmake/DefaultBuildType.cmake
@@ -4,11 +4,12 @@
 # https://blog.kitware.com/cmake-and-the-default-build-type/

 # Set a default build type if none was specified
-set(default_build_type "Release")
+# This var is used to be compatible with Ninja Multi-Config in CMake 3.17+
+set(CMAKE_DEFAULT_BUILD_TYPE "Release")

 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
-  set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
+  set(CMAKE_BUILD_TYPE "${CMAKE_DEFAULT_BUILD_TYPE}" CACHE
       STRING "Choose the type of build." FORCE)
   # Set the possible values of build type for cmake-gui
   set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS


Don't pass -nostdlib when linking with MSVC/Clang-cl

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -321,9 +321,12 @@
   elseif("${LFLAGS_SDK}" STREQUAL "CYGWIN")
     # No extra libraries required.
   elseif("${LFLAGS_SDK}" STREQUAL "WINDOWS")
-    # NOTE: we do not use "/MD" or "/MDd" and select the runtime via linker
-    # options.  This causes conflicts.
-    list(APPEND result "-nostdlib")
+    # We don't need to add -nostdlib using MSVC or clang-cl, as MSVC and clang-cl rely on auto-linking entirely.
+    if(NOT SWIFT_COMPILER_IS_MSVC_LIKE)
+      # NOTE: we do not use "/MD" or "/MDd" and select the runtime via linker
+      # options. This causes conflicts.
+      list(APPEND result "-nostdlib")
+    endif()
   elseif("${LFLAGS_SDK}" STREQUAL "ANDROID")
     list(APPEND result
         "-ldl"


avoid using versioned R_HOME

avoid using versioned R_HOME

As it causes warnings when R is launched as a subprocess.

--- cmake/modules/FindLibR.cmake
+++ cmake/modules/FindLibR.cmake
@@ -23,9 +23,7 @@
    find_library(LIBR_LIBRARIES R)

    if(LIBR_LIBRARIES MATCHES ".*\\.framework")
-      set(_LIBR_RESOURCES "${LIBR_LIBRARIES}/Resources")
-      get_filename_component(_LIBR_HOME "${_LIBR_RESOURCES}" REALPATH)
-      set(LIBR_HOME "${_LIBR_HOME}" CACHE PATH "R home directory")
+      set(LIBR_HOME "${LIBR_LIBRARIES}/Resources" CACHE PATH "R home directory")
       set(LIBR_INCLUDE_DIRS "${LIBR_HOME}/include" CACHE PATH "R include directory")
       set(LIBR_DOC_DIR "${LIBR_HOME}/doc" CACHE PATH "R doc directory")
       set(LIBR_EXECUTABLE "${LIBR_HOME}/bin/R" CACHE PATH "R executable")


Update for CUDA 8.0

Update for CUDA 8.0

--- cmake/modules/FindNVML.cmake
+++ cmake/modules/FindNVML.cmake
@@ -5,8 +5,7 @@
 #  NVML_LIBRARIES       - where to find NVML libs
 #  NVML_FOUND           - True if NVML is found

-SET(NVML_INC_PATHS /usr/include/nvidia/gdk/ /usr/include)
-FIND_PATH(NVML_INCLUDE_DIR nvml.h PATHS ${NVML_INC_PATHS})
+FIND_PATH(NVML_INCLUDE_DIR nvml.h PATHS ${CUDA_INCLUDE_DIRS} /usr/include/nvidia/gdk /usr/include)
 FIND_LIBRARY(NVML_LIBRARY nvidia-ml)

 INCLUDE(FindPackageHandleStandardArgs)


fix(build): properly use correct lib/lib64 folder for CIVETWEB_LIB variables.

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

--- cmake/modules/civetweb.cmake
+++ cmake/modules/civetweb.cmake
@@ -12,8 +12,8 @@
 #

 set(CIVETWEB_SRC "${PROJECT_BINARY_DIR}/civetweb-prefix/src/civetweb/")
-set(CIVETWEB_LIB "${CIVETWEB_SRC}/install/lib/libcivetweb.a")
-SET(CIVETWEB_CPP_LIB "${CIVETWEB_SRC}/install/lib/libcivetweb-cpp.a")
+set(CIVETWEB_LIB "${CIVETWEB_SRC}/install/${CMAKE_INSTALL_LIBDIR}/libcivetweb.a")
+SET(CIVETWEB_CPP_LIB "${CIVETWEB_SRC}/install/${CMAKE_INSTALL_LIBDIR}/libcivetweb-cpp.a")
 set(CIVETWEB_INCLUDE_DIR "${CIVETWEB_SRC}/install/include")
 message(STATUS "Using bundled civetweb in '${CIVETWEB_SRC}'")
 if (USE_BUNDLED_OPENSSL)


CMake: PRIVATE'ly linking to zlib, not PUBLIC'ly.

--- cmake/src-dependencies.cmake
+++ cmake/src-dependencies.cmake
@@ -183,7 +183,7 @@
       set_property(TARGET ZLIB::ZLIB PROPERTY INTERFACE_LINK_LIBRARIES "${ZLIB_LIBRARIES}")
     endif()

-    target_link_libraries(rawspeed PUBLIC ZLIB::ZLIB)
+    target_link_libraries(rawspeed PRIVATE ZLIB::ZLIB)
     set_package_properties(ZLIB PROPERTIES
                            TYPE RECOMMENDED
                            DESCRIPTION "software library used for data compression"


Add `libboost_context.so` to fix OSS build

Reviewed By: zeroxoneb

Differential Revision: D19041624

fbshipit-source-id: 6f69eb04a6a17740fec2f4fb129c2d9f8805ae00

--- bistro/cmake/setup.cmake
+++ bistro/cmake/setup.cmake
@@ -25,6 +25,7 @@
   libfmt.so
   libglog.so
   libgflags.so
+  libboost_context.so
   libboost_date_time.so
   libboost_regex.so
   libboost_system.so


BUG: INCREMENT() macro decrements the value

--- Wrapping/WrapITK/CMakeUtilityFunctions.cmake
+++ Wrapping/WrapITK/CMakeUtilityFunctions.cmake
@@ -71,7 +71,7 @@

 MACRO(INCREMENT var_name input)
   # Increment the input variable and store the result in var_name.
-  MATH(EXPR ${var_name} "${input} - 1")
+  MATH(EXPR ${var_name} "${input} + 1")
 ENDMACRO(INCREMENT)

 MACRO(DECREMENT var_name input)


Add extra clean policy

Add extra clean policy

--- test/module_test.cmake
+++ test/module_test.cmake
@@ -102,7 +102,7 @@
 # Target to clean the generated file (Output of clawfc)
 add_custom_target(
   clean-${TEST_NAME}
-  COMMAND rm -f ${OUTPUT_FILE_CPU} ${OUTPUT_FILE_GPU}
+  COMMAND rm -f ${OUTPUT_FILE_CPU} ${OUTPUT_FILE_GPU} ${XMOD_DIR}/*
 )

 # Add target to the global build/clean target


Add support for CMSIS RTOS

Add support for CMSIS RTOS

--- cmake/FindCMSIS.cmake
+++ cmake/FindCMSIS.cmake
@@ -1,3 +1,5 @@
+set(CMSIS_RTOS RTOS RTOS_V2)
+
 if(NOT CMSIS_FIND_COMPONENTS)
     set(CMSIS_FIND_COMPONENTS ${STM32_SUPPORTED_FAMILIES_LONG_NAME})
 endif()
@@ -6,6 +8,32 @@
     list(APPEND CMSIS_FIND_COMPONENTS STM32H7_M7 STM32H7_M4)
 endif()
 list(REMOVE_DUPLICATES CMSIS_FIND_COMPONENTS)
+
+foreach(COMP ${CMSIS_FIND_COMPONENTS})
+    string(TOLOWER ${COMP} COMP_L)
+    string(TOUPPER ${COMP} COMP)
+
+    if(${COMP} IN_LIST CMSIS_RTOS)
+        list(APPEND CMSIS_FIND_COMPONENTS_RTOS ${COMP})
+        continue()
+    endif()
+
+    string(REGEX MATCH "^STM32([A-Z][0-9])([0-9A-Z][0-9][A-Z][0-9A-Z])?_?(M[47])?.*$" COMP ${COMP})
+    if(CMAKE_MATCH_1)
+        list(APPEND CMSIS_FIND_COMPONENTS_FAMILIES ${COMP})
+    endif()
+endforeach()
+
+if(NOT CMSIS_FIND_COMPONENTS_FAMILIES)
+    set(CMSIS_FIND_COMPONENTS_FAMILIES ${STM32_SUPPORTED_FAMILIES_LONG_NAME})
+endif()
+
+if(NOT CMSIS_FIND_COMPONENTS_RTOS)
+    set(CMSIS_FIND_COMPONENTS_RTOS ${CMSIS_RTOS})
+endif()
+
+message(STATUS "Search for CMSIS families: ${CMSIS_FIND_COMPONENTS_FAMILIES}")
+message(STATUS "Search for CMSIS RTOS: ${CMSIS_FIND_COMPONENTS_RTOS}")

 include(stm32/devices)

@@ -41,7 +69,7 @@
     stm32_add_linker_script(CMSIS::STM32::${DEVICE}${CORE_C} INTERFACE "${OUTPUT_LD_FILE}")
 endfunction()

-foreach(COMP ${CMSIS_FIND_COMPONENTS})
+foreach(COMP ${CMSIS_FIND_COMPONENTS_FAMILIES})
     string(TOLOWER ${COMP} COMP_L)
     string(TOUPPER ${COMP} COMP)

@@ -176,6 +204,44 @@
     else()
        set(CMSIS_${COMP}_FOUND FALSE)
     endif()
+
+    foreach(RTOS_COMP ${CMSIS_FIND_COMPONENTS_RTOS})
+        if (${RTOS_COMP} STREQUAL "RTOS_V2")
+            set(RTOS_COMP_VERSION "2")
+        else()
+            unset(RTOS_COMP_VERSION)
+        endif()
+
+        find_path(CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_PATH
+            NAMES "cmsis_os${RTOS_COMP_VERSION}.h"
+            PATHS "${STM32_CUBE_${FAMILY}_PATH}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_${RTOS_COMP}"
+            NO_DEFAULT_PATH
+        )
+        if (NOT CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_PATH)
+            continue()
+        endif()
+
+        find_file(CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_SOURCE
+            NAMES "cmsis_os${RTOS_COMP_VERSION}.c"
+            PATHS "${STM32_CUBE_${FAMILY}_PATH}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_${RTOS_COMP}"
+            NO_DEFAULT_PATH
+        )
+        if (NOT CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_SOURCE)
+            continue()
+        endif()
+
+        if(NOT (TARGET CMSIS::STM32::${FAMILY}${CORE_C}::${RTOS_COMP}))
+            add_library(CMSIS::STM32::${FAMILY}${CORE_C}::${RTOS_COMP} INTERFACE IMPORTED)
+            target_link_libraries(CMSIS::STM32::${FAMILY}${CORE_C}::${RTOS_COMP} INTERFACE CMSIS::STM32::${FAMILY}${CORE_C})
+            target_include_directories(CMSIS::STM32::${FAMILY}${CORE_C}::${RTOS_COMP} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_PATH}")
+            target_sources(CMSIS::STM32::${FAMILY}${CORE_C}::${RTOS_COMP} INTERFACE "${CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_SOURCE}")
+        endif()
+
+        list(APPEND CMSIS_SOURCES "${CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_SOURCE}")
+        list(APPEND CMSIS_INCLUDE_DIRS "${CMSIS_${FAMILY}${CORE_U}_${RTOS_COMP}_PATH}")
+        set(CMSIS_${RTOS_COMP}_FOUND TRUE)
+    endforeach()
+
     list(REMOVE_DUPLICATES CMSIS_INCLUDE_DIRS)
     list(REMOVE_DUPLICATES CMSIS_SOURCES)
 endforeach()


add mariadb 10.4 and 10.5 (alpha) to mysql lib discovery

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -85,6 +85,8 @@
     "${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/include"
     "${PROGRAM_FILES_64}/MySQL/include"
     "${PROGRAM_FILES_64}/MariaDB 10.3/include/mysql"
+    "${PROGRAM_FILES_64}/MariaDB 10.4/include/mysql"
+    "${PROGRAM_FILES_64}/MariaDB 10.5/include/mysql"
     "C:/MySQL/include"
     "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/include"
     "$ENV{ProgramFiles}/MySQL/MySQL Server 5.7/include"
@@ -124,6 +126,8 @@
       "${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/lib/opt"
       "${PROGRAM_FILES_64}/MySQL/lib"
       "${PROGRAM_FILES_64}/MariaDB 10.3/lib"
+      "${PROGRAM_FILES_64}/MariaDB 10.4/lib"
+      "${PROGRAM_FILES_64}/MariaDB 10.5/lib"
       "C:/MySQL/lib/debug"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib"
       "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/lib/opt"
@@ -177,6 +181,8 @@
         "${PROGRAM_FILES_64}/MySQL/MySQL Server 5.7/bin/opt"
         "${PROGRAM_FILES_64}/MySQL/bin"
         "${PROGRAM_FILES_64}/MariaDB 10.3/bin"
+        "${PROGRAM_FILES_64}/MariaDB 10.4/bin"
+        "${PROGRAM_FILES_64}/MariaDB 10.5/bin"
         "C:/MySQL/bin/debug"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/bin"
         "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.7;Location]/bin/opt"


Remove code for making standalone executable with Cython since it is unlikely to ever be useful within dynd-python.

--- cmake/UseCython.cmake
+++ cmake/UseCython.cmake
@@ -242,38 +242,3 @@
 endfunction()

 include( CMakeParseArguments )
-# cython_add_standalone_executable( _name [MAIN_MODULE src3.py] src1 src2 ... srcN )
-# Creates a standalone executable the given sources.
-function( cython_add_standalone_executable _name )
-  set( pyx_module_sources "" )
-  set( other_module_sources "" )
-  set( main_module "" )
-  cmake_parse_arguments( cython_arguments "" "MAIN_MODULE" "" ${ARGN} )
-  include_directories( ${PYTHON_INCLUDE_DIRS} )
-  foreach( _file ${cython_arguments_UNPARSED_ARGUMENTS} )
-    if( ${_file} MATCHES ".*\\.py[x]?$" )
-      get_filename_component( _file_we ${_file} NAME_WE )
-      if( "${_file_we}" STREQUAL "${_name}" )
-        set( main_module "${_file}" )
-      elseif( NOT "${_file}" STREQUAL "${cython_arguments_MAIN_MODULE}" )
-        set( PYTHON_MODULE_${_file_we}_static_BUILD_SHARED OFF )
-        compile_pyx( "${_file_we}_static" generated_file "${_file}" )
-        list( APPEND pyx_module_sources "${generated_file}" )
-      endif()
-    else()
-      list( APPEND other_module_sources ${_file} )
-    endif()
-  endforeach()
-
-  if( cython_arguments_MAIN_MODULE )
-    set( main_module ${cython_arguments_MAIN_MODULE} )
-  endif()
-  if( NOT main_module )
-    message( FATAL_ERROR "main module not found." )
-  endif()
-  get_filename_component( main_module_we "${main_module}" NAME_WE )
-  set( CYTHON_FLAGS ${CYTHON_FLAGS} --embed )
-  compile_pyx( "${main_module_we}_static" generated_file ${main_module} )
-  add_executable( ${_name} ${generated_file} ${pyx_module_sources} ${other_module_sources} )
-  target_link_libraries( ${_name} ${PYTHON_LIBRARIES} ${pyx_module_libs} )
-endfunction()


[CMake] [Darwin] [builtins] Add support for building libclang_rt.10.4.a

This builtin library is used when setting the OS X deployment target to 10.4, which we still support.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -341,6 +341,17 @@
       set(CAN_TARGET_${arch} 1)
     endforeach()

+    # Need to build a 10.4 compatible libclang_rt
+    set(DARWIN_10.4_SYSROOT ${DARWIN_osx_SYSROOT})
+    set(DARWIN_10.4_BUILTIN_MIN_VER 10.4)
+    set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG
+        -mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER})
+    set(DARWIN_10.4_SKIP_CC_KEXT On)
+    list(APPEND BUILTIN_SUPPORTED_OS 10.4)
+    darwin_test_archs(10.4
+      DARWIN_10.4_ARCHS
+      ${toolchain_arches})
+
     if(DARWIN_iossim_SYSROOT)
       set(DARWIN_iossim_CFLAGS
         ${DARWIN_COMMON_CFLAGS}


minor

minor

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

--- cmake/gsLibrary.cmake
+++ cmake/gsLibrary.cmake
@@ -95,7 +95,7 @@

  set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)

-#  if( WIN32 ) # Copy the dll to the bin folder to allow executables to find it
+ if( WIN32 ) # Copy the dll to the bin folder to allow executables to find it
     if(CMAKE_CONFIGURATION_TYPES)
       add_custom_command(
       TARGET ${PROJECT_NAME}
@@ -113,7 +113,7 @@
       COMMAND ${CMAKE_COMMAND} -E copy_if_different $<TARGET_FILE:${PROJECT_NAME}> ${CMAKE_BINARY_DIR}/bin
       COMMAND ${CMAKE_COMMAND} -E echo 'The file $<TARGET_FILE:${PROJECT_NAME}> is copied to the bin folder for convenience.' )
     endif()
-#  endif( WIN32 )
+  endif( WIN32 )

 endif(GISMO_BUILD_LIB)


place constraints: removed error disabling in placement

Signed-off-by: Alessandro Comodi <622632e70fd6771cf2cd943f69e5e51ab66adef8@antmicro.com>

--- xc7/make/arch_define.cmake
+++ xc7/make/arch_define.cmake
@@ -28,7 +28,7 @@
       --strict_checks off \
       --clustering_pin_feasibility_filter off \
       --allow_dangling_combinational_nodes on \
-      --disable_errors check_unbuffered_edges:check_route:read_user_pad_loc \
+      --disable_errors check_unbuffered_edges:check_route \
       --congested_routing_iteration_threshold 0.8 \
       --incremental_reroute_delay_ripup off \
       --base_cost_type delay_normalized_length_bounded \


remove duplicates in test libs

remove duplicates in test libs

--- cmake/BuildTests.cmake
+++ cmake/BuildTests.cmake
@@ -32,9 +32,11 @@
         else(BUILD_python)

             add_dependencies(${test_project} ${${ROOT_PROJECT}_MODULES})
-            target_link_libraries(${test_project} ${${ROOT_PROJECT}_LIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} ts ${${ROOT_PROJECT}_MODULES})
+            set(${test_project}_LIBS ${${ROOT_PROJECT}_LIBS} ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES} ts ${${ROOT_PROJECT}_MODULES})
+            list(REMOVE_DUPLICATES ${test_project}_LIBS)
+            target_link_libraries(${test_project} ${${test_project}_LIBS})

-        endif (BUILD_python)
+        endif(BUILD_python)

     else(nbTestFiles GREATER 0)
         message( WARNING  "Unable to locate any test files. No tests to add to this project")


CMake: Remove trailing arguments for mpicc with GASNet mpi conduit

--- cmake/FindGASNet.cmake
+++ cmake/FindGASNet.cmake
@@ -94,6 +94,8 @@
       OUTPUT_VARIABLE _GASNet_LD
       OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET
     )
+    # Strip any arguments from _GASNet_LD
+    string(REGEX REPLACE "^([^ ]+).*" "\\1" _GASNet_LD "${_GASNet_LD}")
     execute_process(
       COMMAND ${GASNet_MAKE_PROGRAM} -s -f ${_TEMP_MAKEFILE} gasnet-ldflags
       OUTPUT_VARIABLE _GASNet_LDFLAGS


FindLIBVLC: Detect libvlc's version even if pkg-config fails.

Do so by reading libvlc_version.h and parsing LIBVLC_VERSION_MAJOR,
LIBVLC_VERSION_MINOR and LIBVLC_VERSION_REVISION accordingly.

libvlc_version.h also defines LIBVLC_VERSION_EXTRA, but it does not seem to
be reported by libvlc.pc, so compatibility with it was preferred.

REVIEW:	113791

--- cmake/FindLIBVLC.cmake
+++ cmake/FindLIBVLC.cmake
@@ -67,7 +67,21 @@

 set(LIBVLC_VERSION ${PC_LIBVLC_VERSION})
 if (NOT LIBVLC_VERSION)
-# TODO: implement means to detect version on windows (vlc --version && regex? ... ultimately we would get it from a header though...)
+    file(READ "${LIBVLC_INCLUDE_DIR}/vlc/libvlc_version.h" _libvlc_version_h)
+
+    string(REGEX MATCH "# define LIBVLC_VERSION_MAJOR +\\(([0-9])\\)" _dummy "${_libvlc_version_h}")
+    set(_version_major "${CMAKE_MATCH_1}")
+
+    string(REGEX MATCH "# define LIBVLC_VERSION_MINOR +\\(([0-9])\\)" _dummy "${_libvlc_version_h}")
+    set(_version_minor "${CMAKE_MATCH_1}")
+
+    string(REGEX MATCH "# define LIBVLC_VERSION_REVISION +\\(([0-9])\\)" _dummy "${_libvlc_version_h}")
+    set(_version_revision "${CMAKE_MATCH_1}")
+
+    # Optionally, one could also parse LIBVLC_VERSION_EXTRA, but it does not
+    # seem to be used by libvlc.pc.
+
+    set(LIBVLC_VERSION "${_version_major}.${_version_minor}.${_version_revision}")
 endif (NOT LIBVLC_VERSION)

 if (LIBVLC_INCLUDE_DIR AND LIBVLC_LIBRARY AND LIBVLCCORE_LIBRARY)


Don't link to libpython in linux and osx as they are not needed.

This is a fix to a bug introduced at 98d7bf85a7cf1a8c3fabf0132970dbd4f79c27e8

--- cmake/FindPython.cmake
+++ cmake/FindPython.cmake
@@ -116,8 +116,8 @@
     ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     set_target_properties(${name} PROPERTIES PREFIX "")
     set_target_properties(${name} PROPERTIES OUTPUT_NAME "${name}${PYTHON_EXTENSION_SOABI}")
-    target_link_libraries(${name} ${PYTHON_LIBRARY})
     IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+        target_link_libraries(${name} ${PYTHON_LIBRARY})
         set_target_properties(${name} PROPERTIES SUFFIX ".pyd")
     ENDIF()
 endmacro(ADD_PYTHON_LIBRARY)


Fixed CMP0077 warnings.

Fixed CMP0077 warnings.

--- cmake/TbagConfig.cmake
+++ cmake/TbagConfig.cmake
@@ -150,8 +150,10 @@
 macro (tbag_config__set_library_option __value __package_name __found_value)
     if ((DEFINED ${__value} AND ${__value}) OR (NOT DEFINED ${__value}))
         find_package (${__package_name} QUIET)
-        set (${__value} ${${__found_value}})
-    else ()
+        if (CMAKE_VERSION VERSION_LESS "3.12")
+            set (${__value} ${${__found_value}})
+        endif ()
+    elseif (CMAKE_VERSION VERSION_LESS "3.12")
         set (${__value} OFF)
     endif ()


Remove unused nvcc-check

Remove unused nvcc-check

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -1,52 +0,0 @@
-# James Shackleford
-# Date: 08.24.2010
-# File: PLM_nvcc-check.cmake
-#
-# Currently, nvcc only works with gcc-4.3
-#
-# This script:
-#   * Checks the version of default gcc
-#   * If not 4.3, we look for gcc-4.3 on the system
-#   * If found we tell nvcc to use it
-#   * If not found, we kill CMake and tell user to install gcc-4.3
-#
-# NOTE: If nvcc tries to use gcc-4.4 (for example) the build simply
-#       fails.  Ending things at CMake with a request for gcc-4.3
-#       is the most graceful failure I could provide.
-######################################################################
-IF(CUDA_FOUND)
-    IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-        IF(CMAKE_COMPILER_IS_GNUCC)
-
-            # Get the gcc version number
-            EXEC_PROGRAM(gcc ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
-
-            # Get major and minor revs
-            STRING(REGEX REPLACE "([0-9]+).[0-9]+.[0-9]+" "\\1" GCCVER_MAJOR "${GCCVER}")
-            STRING(REGEX REPLACE "[0-9]+.([0-9]+).[0-9]+" "\\1" GCCVER_MINOR "${GCCVER}")
-            STRING(REGEX REPLACE "[0-9]+.[0-9]+.([0-9]+)" "\\1" GCCVER_PATCH "${GCCVER}")
-
-#            MESSAGE(STATUS "nvcc-check: GCC Version is ${GCCVER_MAJOR}.${GCCVER_MINOR}.${GCCVER_PATCH}")
-
-            IF(GCCVER_MAJOR MATCHES "4")
-                IF(GCCVER_MINOR MATCHES "3")
-                    MESSAGE(STATUS "nvcc-check: Found gcc-${GCCVER_MAJOR}.${GCCVER_MINOR}... success.")
-                ELSE(GCCVER_MINOR MATCHES "3")
-                    MESSAGE(STATUS "nvcc-check: Found gcc-${GCCVER_MAJOR}.${GCCVER_MINOR}... searching for gcc-4.3")
-                    EXEC_PROGRAM(which ARGS "gcc-4.3" OUTPUT_VARIABLE GCC43)
-
-                    IF(GCC43 STREQUAL "")
-                        MESSAGE(FATAL_ERROR "nvcc-check: Please install gcc-4.3, it is needed by nvcc \(CUDA\).\nNote that gcc-4.3 can be installed side-by-side with your current version of gcc (${GCCVER_MAJOR}.${GCCVER_MINOR}.${GCCVER_PATCH}).\nYou need not replace your current version of gcc; just make gcc-4.3 available as well so that nvcc can use it.\nDebian/Ubuntu users with root privilages may simply enter the following at a terminal prompt:\n  sudo apt-get install gcc-4.3\n")
-                    ELSE(GCC43 STREQUAL "")
-                        MESSAGE(STATUS "nvcc-check: Found gcc-4.3... telling nvcc to use it!")
-                        MESSAGE(STATUS "nvcc-check: CUDA_NVCC_FLAGS set to \"${CUDA_NVCC_FLAGS} --compiler-bindir=${GCC43}\"")
-                        SET (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --compiler-bindir=${GCC43})
-                    ENDIF(GCC43 STREQUAL "")
-
-                ENDIF(GCCVER_MINOR MATCHES "3")
-            ENDIF(GCCVER_MAJOR MATCHES "4")
-
-
-        ENDIF(CMAKE_COMPILER_IS_GNUCC)
-    ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
-ENDIF(CUDA_FOUND)


Install Vulkan-HPP fix generate call (#46)

--- cmake/vulkan-hpp.cmake
+++ cmake/vulkan-hpp.cmake
@@ -17,11 +17,12 @@
 set(VULKAN_HPP_VULKAN_HEADERS_SRC_DIR "${VKB_VULKAN_HEADERS_SOURCE_DIR}")
 set(VULKAN_HPP_PATH "${CMAKE_CURRENT_BINARY_DIR}/third_party/vulkan-hpp")
 set(VULKAN_HPP_TINYXML2_SRC_DIR "${VKB_TINYXML2_SOURCE_DIR}")
+set(VULKAN_HPP_INSTALL ON CACHE BOOL "vulkan-hpp install")

 if (ANDROID)
   set(VULKAN_HPP_RUN_GENERATOR OFF CACHE BOOL "vulkan-hpp disable generator")
   message(STATUS "VKB Vulkan-Hpp: Disable generator on Android")
-elseif()
+else()
   set(VULKAN_HPP_RUN_GENERATOR ON CACHE BOOL "vulkan-hpp run generator")
 endif()


removed unnecessary var

removed unnecessary var

--- include.cmake
+++ include.cmake
@@ -56,14 +56,14 @@
 # Project file version defines
 add_definitions(-DAPI_VERSION="${VERSION}")

-message("$ENV{GAMS_FOR_LINUX}")
-message("$ENV{GAMS_CORE_PATH}")
+message("a $ENV{GAMS_FOR_LINUX}")
+message("b $ENV{GAMS_CORE_PATH}")
+message("c $ENV{GAMS_BUILD_ENV}")

 # GAMS_CORE_PATH is Jenkins build switch
-set(GAMS_CORE_TMP $ENV{GAMS_CORE_PATH})
 if(NOT EXISTS ${PWD}/gamsinclude.pri)
     message("RGDBG1: $ENV{GAMS_CORE_TMP}")
-    if(NOT DEFINED $ENV{GAMS_CORE_TMP})
+    if(NOT DEFINED $ENV{GAMS_CORE_PATH})
         message("-- NOT DEFINED")
         if(APPLE)
             set(GAMS_DISTRIB /Library/Frameworks/GAMS.framework/Versions/${GAMS_DISTRIB_MAJOR}/Resources)


cmake: Also check for some gl headers.

cmake: Also check for some gl headers.

--- extras/buildsystem/cmake/include/config.cmake
+++ extras/buildsystem/cmake/include/config.cmake
@@ -403,6 +403,9 @@
 find_package(OpenGL)
 if(OPENGL_FOUND)
   vlc_enable_modules(opengl)
+  vlc_check_include_files (gl/gl.h)
+  vlc_check_include_files (gl/glu.h)
+  vlc_check_include_files (gl/glx.h)
   vlc_add_module_compile_flag(opengl ${OPENGL_CFLAGS})
   vlc_module_add_link_libraries(opengl ${OPENGL_LIBRARIES})
 endif(OPENGL_FOUND)


Also create jsobjects_cpp used for testing.

--- config/JSObjects.cmake
+++ config/JSObjects.cmake
@@ -11,7 +11,7 @@
     BINARY_DIR ${DOWNLOAD_DIR}/bin
     UPDATE_COMMAND "" # skip update
     CONFIGURE_COMMAND ${CMAKE_COMMAND} -DIMPORT=ON
-        -DENABLE_JSC=ON -DENABLE_TESTS=OFF
+        -DENABLE_JSC=ON -DENABLE_CPP=ON -DENABLE_TESTS=OFF
         -DEXTERNALS_DIR=${EXTERNALS_DIR}
         -DLIBRARY_TYPE=STATIC
         ${DOWNLOAD_DIR}/jsobjects
@@ -22,5 +22,4 @@
 endif ()

 set(jsobjects_INCLUDE_DIRS ${DOWNLOAD_DIR}/jsobjects/include)
-set(jsobjects_LIBRARY_DIRS ${DOWNLOAD_DIR}/bin/src/jsc)
-set(jsobjects_LIBRARIES jsobjects_jsc)+set(jsobjects_LIBRARY_DIRS ${DOWNLOAD_DIR}/bin/src/jsc ${DOWNLOAD_DIR}/bin/src/cpp)


Added inttypes.h and sys/inttypes.h

Added inttypes.h and sys/inttypes.h

--- cmake/MyPackageCheckCommonIncludeFiles.cmake
+++ cmake/MyPackageCheckCommonIncludeFiles.cmake
@@ -1,17 +1,19 @@
 MACRO (MYPACKAGECHECKCOMMONINCLUDEFILES)
   INCLUDE (CheckIncludeFile)
-  CHECK_INCLUDE_FILE ("stdio.h"      HAVE_STDIO_H)
-  CHECK_INCLUDE_FILE ("stddef.h"     HAVE_STDDEF_H)
-  CHECK_INCLUDE_FILE ("stdlib.h"     HAVE_STDLIB_H)
-  CHECK_INCLUDE_FILE ("stdarg.h"     HAVE_STDARG_H)
-  CHECK_INCLUDE_FILE ("stdint.h"     HAVE_STDINT_H)
-  CHECK_INCLUDE_FILE ("sys/time.h"   HAVE_SYS_TIME_H)
-  CHECK_INCLUDE_FILE ("sys/types.h"  HAVE_SYS_TYPES_H)
-  CHECK_INCLUDE_FILE ("sys/stat.h"   HAVE_SYS_STAT_H)
-  CHECK_INCLUDE_FILE ("errno.h"      HAVE_ERRNO_H)
-  CHECK_INCLUDE_FILE ("string.h"     HAVE_STRING_H)
-  CHECK_INCLUDE_FILE ("unistd.h"     HAVE_UNISTD_H)
-  CHECK_INCLUDE_FILE ("io.h"         HAVE_IO_H)
-  CHECK_INCLUDE_FILE ("time.h"       HAVE_TIME_H)
-  CHECK_INCLUDE_FILE ("fcntl.h"      HAVE_FCNTL_H)
+  CHECK_INCLUDE_FILE ("stdio.h"        HAVE_STDIO_H)
+  CHECK_INCLUDE_FILE ("stddef.h"       HAVE_STDDEF_H)
+  CHECK_INCLUDE_FILE ("stdlib.h"       HAVE_STDLIB_H)
+  CHECK_INCLUDE_FILE ("stdarg.h"       HAVE_STDARG_H)
+  CHECK_INCLUDE_FILE ("stdint.h"       HAVE_STDINT_H)
+  CHECK_INCLUDE_FILE ("inttypes.h"     HAVE_INTTYPES_H)
+  CHECK_INCLUDE_FILE ("sys/inttypes.h" HAVE_SYS_INTTYPES_H)
+  CHECK_INCLUDE_FILE ("sys/time.h"     HAVE_SYS_TIME_H)
+  CHECK_INCLUDE_FILE ("sys/types.h"    HAVE_SYS_TYPES_H)
+  CHECK_INCLUDE_FILE ("sys/stat.h"     HAVE_SYS_STAT_H)
+  CHECK_INCLUDE_FILE ("errno.h"        HAVE_ERRNO_H)
+  CHECK_INCLUDE_FILE ("string.h"       HAVE_STRING_H)
+  CHECK_INCLUDE_FILE ("unistd.h"       HAVE_UNISTD_H)
+  CHECK_INCLUDE_FILE ("io.h"           HAVE_IO_H)
+  CHECK_INCLUDE_FILE ("time.h"         HAVE_TIME_H)
+  CHECK_INCLUDE_FILE ("fcntl.h"        HAVE_FCNTL_H)
 ENDMACRO()


fix name of libMini to search for with cmake, on windows we search for "libMini", on linux we search for "Mini" because the lib prefix is added automatically

--- CMakeModules/FindMINI.cmake
+++ CMakeModules/FindMINI.cmake
@@ -17,7 +17,7 @@

 find_path(MINI_INCLUDE_DIR mini/mini.h PATHS .. ../deps DOC "Directory containing mini/mini.h")

-find_library(MINI_LIBRARY NAMES libMini PATHS .. ../mini ../deps/mini DOC "Path to Mini library")
+find_library(MINI_LIBRARY NAMES Mini libMini PATHS .. ../mini ../deps/mini DOC "Path to Mini library")
 if(MINI_FIND_DEBUG)
 	find_library(MINI_LIBRARY_DEBUG NAMES libMinid PATHS .. ../mini ../deps/mini DOC "Path to Mini debug library")
 endif(MINI_FIND_DEBUG)


Identify clang++ even if it is not named llvm-clang++

--- cmake/EigenTesting.cmake
+++ cmake/EigenTesting.cmake
@@ -434,6 +434,8 @@
     set(${CNAME} "llvm-g++")
   elseif((ei_has_llvm) AND (ei_has_clang))
     set(${CNAME} "llvm-clang++")
+  elseif(ei_has_clang)
+    set(${CNAME} "clang++")
   elseif(ei_has_icpc)
     set(${CNAME} "icpc")
   elseif(ei_has_gpp OR ei_has_gcc)


world build: fix modules instantiation order

opencv_hal before opencv_world
opencv_world before opencv_ts

--- cmake/OpenCVModule.cmake
+++ cmake/OpenCVModule.cmake
@@ -305,9 +305,10 @@
   set(OPENCV_INITIAL_PASS OFF PARENT_SCOPE)
   set(OPENCV_INITIAL_PASS OFF)
   if(${BUILD_opencv_world})
-    add_subdirectory("${OPENCV_MODULE_opencv_world_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/world")
     foreach(m ${OPENCV_MODULES_BUILD})
-      if(NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD AND NOT ${m} STREQUAL opencv_world)
+      if("${m}" STREQUAL opencv_world)
+        add_subdirectory("${OPENCV_MODULE_opencv_world_LOCATION}" "${CMAKE_CURRENT_BINARY_DIR}/world")
+      elseif(NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD AND NOT ${m} STREQUAL opencv_world)
         message(STATUS "Processing module ${m}...")
         if(m MATCHES "^opencv_")
           string(REGEX REPLACE "^opencv_" "" __shortname "${m}")
@@ -446,6 +447,17 @@
               list(APPEND deps_${m} ${d})
               set(has_changes ON)
             endif()
+            if(BUILD_opencv_world
+                AND NOT "${m}" STREQUAL "opencv_world"
+                AND NOT "${m2}" STREQUAL "opencv_world"
+                AND OPENCV_MODULE_${m2}_IS_PART_OF_WORLD
+                AND NOT OPENCV_MODULE_${m}_IS_PART_OF_WORLD)
+              if(NOT (";${deps_${m}};" MATCHES ";opencv_world;"))
+#                message(STATUS "  Transfer dependency opencv_world alias ${m2} to ${m}")
+                list(APPEND deps_${m} opencv_world)
+                set(has_changes ON)
+              endif()
+            endif()
           endforeach()
         endif()
       endforeach()


[docs] Compiling documentation with Sphinx requires finding Python.

--- cmake/SiconosSetup.cmake
+++ cmake/SiconosSetup.cmake
@@ -89,7 +89,7 @@

 # ---- Python ---
 # (interp and lib)
-if(WITH_PYTHON_WRAPPER)
+if(WITH_PYTHON_WRAPPER OR WITH_DOCUMENTATION)
   find_package(PythonFull REQUIRED)
   include(FindPythonModule)


Bumped version to 1.3.1

Bumped version to 1.3.1

--- conf/LiboroVersion.cmake
+++ conf/LiboroVersion.cmake
@@ -4,4 +4,4 @@

 SET(CPACK_PACKAGE_VERSION_MAJOR "1")
 SET(CPACK_PACKAGE_VERSION_MINOR "3")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_PATCH "1")


Closes #25

Closes #25

--- scripts/TargetCopyFiles.cmake
+++ scripts/TargetCopyFiles.cmake
@@ -104,7 +104,7 @@
     file(GLOB_RECURSE in_files RELATIVE "${dircopy_RELATIVE}" ${in_globs})
     if(NOT "${exclude_globs}" STREQUAL "")
         file(GLOB_RECURSE exclude_files RELATIVE "${dircopy_RELATIVE}" ${exclude_globs})
-        if(NOT "${excluded_files}" STREQUAL "")
+        if(exclude_files)
           list(REMOVE_ITEM in_files ${exclude_files})
         endif()
     endif()


Fix Forge shared files being installer directly in /usr/local

--- CMakeModules/osx_install/OSXInstaller.cmake
+++ CMakeModules/osx_install/OSXInstaller.cmake
@@ -261,10 +261,10 @@
     PKG_BUILD(  PKG_NAME        ForgeLibrary
                 DEPENDS         OSX_INSTALL_SETUP_FORGE_LIB
                 TARGETS         forge_lib_package
-                INSTALL_LOCATION /usr/local/
+                INSTALL_LOCATION /usr/local/lib
                 SCRIPT_DIR      ${OSX_INSTALL_SOURCE}/forge_scripts
                 IDENTIFIER      com.arrayfire.pkg.forge.lib
-                PATH_TO_FILES   ${OSX_TEMP}/Forge)
+                PATH_TO_FILES   ${OSX_TEMP}/Forge/lib)

     PKG_BUILD(  PKG_NAME        ForgeHeaders
                 DEPENDS         OSX_INSTALL_SETUP_FORGE_INCLUDE


BUG: Fix detection of the gold linker.

BUG: Fix detection of the gold linker.

The detection of the presence of the gold linker was using the
ITK_CHECK_CXX_COMPILER_FLAG macro. However, this macro uses the CMake macro
CHECK_CXX_SOURCE_COMPILES and it was testing the falg with
CMAKE_REQUIRED_DEFINITIONS instead of CMAKE_REQUIRED_FLAGS. But, this is a
linking flag, and the flag is not used in the link line when it is added to
CMAKE_REQUIRED_DEFINITIONS.

Use CMAKE_REQUIRED_FLAGS and CHECK_CXX_SOURCE_COMPILES directly.

Change-Id: I28f94a8452a5cf0a2cd2c59e616128fc61cf0336

--- CMake/ITKSetStandardCompilerFlags.cmake
+++ CMake/ITKSetStandardCompilerFlags.cmake
@@ -197,7 +197,10 @@
     endif()

     if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
-      ITK_CHECK_CXX_COMPILER_FLAG("-fuse-ld=gold" have_gold)
+      set(_safe_cmake_required_flags "${CMAKE_REQUIRED_FLAGS}")
+      set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fuse-ld=gold")
+      CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" have_gold)
+      set(CMAKE_REQUIRED_FLAGS "${_safe_cmake_required_flags}")
       if(have_gold)
         set(_use_gold_linker_default ON)
         set(_gold_linker_failure_condition_0 "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.8.4")


hopefully there will be no need for the suppressions file anymore

--- CTestConfig.cmake
+++ CTestConfig.cmake
@@ -4,4 +4,3 @@
 SET (CTEST_DROP_SITE "http://fifthelement.inf.ethz.ch:8082")
 SET (CTEST_DROP_LOCATION "zorba")
 SET (CTEST_COMPRESS_SUBMISSION ON)
-SET (MEMORYCHECK_SUPPRESSIONS_FILE ${CMAKE_CURRENT_SOURCE_DIR}/test/valgrind.suppressions)


Make larger enums easier to read

Make larger enums easier to read

--- doc/Doxyfile.cmake
+++ doc/Doxyfile.cmake
@@ -137,7 +137,7 @@
 BINARY_TOC = NO
 TOC_EXPAND = NO
 DISABLE_INDEX = NO
-ENUM_VALUES_PER_LINE = 4
+ENUM_VALUES_PER_LINE = 1
 GENERATE_TREEVIEW = YES
 TREEVIEW_WIDTH = 350
 FORMULA_FONTSIZE = 10


Use cdash on cmacslab2 machine due to 10-build per day restriction

--- src/CTestConfig.cmake
+++ src/CTestConfig.cmake
@@ -9,9 +9,14 @@
 set(CTEST_PROJECT_NAME "Lean")
 set(CTEST_NIGHTLY_START_TIME "00:00:00 EST")

+#set(CTEST_DROP_METHOD "http")
+#set(CTEST_DROP_SITE "my.cdash.org")
+#set(CTEST_DROP_LOCATION "/submit.php?project=Lean")
+#set(CTEST_DROP_SITE_CDASH TRUE)
+
 set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "my.cdash.org")
-set(CTEST_DROP_LOCATION "/submit.php?project=Lean")
+set(CTEST_DROP_SITE "cmacslab2.modck.cs.cmu.edu")
+set(CTEST_DROP_LOCATION "/CDash-2-0-2/submit.php?project=Lean")
 set(CTEST_DROP_SITE_CDASH TRUE)

 set(UPDATE_COMMAND "git")


Fix if not called from FindEqualizer

Fix if not called from FindEqualizer

--- FindCollage.cmake
+++ FindCollage.cmake
@@ -75,6 +75,9 @@
 set(_Collage_Lunchbox_version_0.5.2 "1.3.5")
 set(_Collage_Lunchbox_version_0.5.5 "1.3.5")

+# needed if called directly w/o called from FindEqualizer
+set(COLLAGE_ROOT ${EQ_ROOT})
+
 find_library_package(Collage INCLUDE co TRANSIENT Lunchbox)
 find_package_handle_standard_args(Collage DEFAULT_MSG
                                   COLLAGE_LIBRARIES COLLAGE_INCLUDE_DIRS)


fficonfig: Add test to set HAVE_MMAP_FILE

--- cmake/ConfigureChecks.cmake
+++ cmake/ConfigureChecks.cmake
@@ -996,6 +996,26 @@
   DIRECT
   )

+# libffi specific: Check whether read-only mmap of a plain file works
+if(NOT DEFINED HAVE_MMAP_FILE)
+  set(msg "Checking whether read-only mmap of a plain file works")
+  message(STATUS "${msg}")
+  set(value 1)
+  set(status "yes")
+  if(NOT HAVE_SYS_MMAN_H OR NOT HAVE_MMAP)
+    set(value 0)
+    set(status "no")
+  endif()
+  message(STATUS "${msg} - ${status}")
+  set(HAVE_MMAP_FILE "${value}" CACHE INTERNAL "Have support for mmap_file")
+endif()
+
+# libffi specific: check whether mmap works
+# XXX Add a system to this blacklist if
+#     mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
+#     memory area containing the same data that you'd get if you applied
+#     read() to the same fd.  The only system known to have a problem here
+#     is VMS, where text files have record structure.

 # libffi specific: Check whether assembler supports .cfi_* directives
 set(check_src ${PROJECT_BINARY_DIR}/CMakeFiles/have_as_cfi_pseudo_op.c)


Add statically built zlib/libjpeg/libpng that weren't getting into qt.

--- cmake/FishDetFindLibs.cmake
+++ cmake/FishDetFindLibs.cmake
@@ -78,10 +78,17 @@
   if( NOT CUPS_FOUND )
     message (FATAL_ERROR "Could not find Cups.  Build cannot continue." )
   endif()
+  find_package( ZLIB )
+  if( NOT ZLIB_FOUND )
+    message( FATAL_ERROR "Could not find zlib.  Build cannot continue." )
+  endif()
   set( APPLE_LIBRARIES
     ${COCOA_LIBRARY}
     ${CARBON_LIBRARY}
     ${IOKIT_LIBRARY}
     ${CUPS_LIBRARIES}
+    ${ZLIB_LIBRARIES}
+    ${JPEG_LIBRARIES}
+    ${PNG_LIBRARIES}
     )
 endif()


Squashed '3rdparty/github/cmake-utils/' changes from b3d50043..f3884112

f3884112 inttypes.h repair +

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

--- cmake/MyPackageRepair.cmake
+++ cmake/MyPackageRepair.cmake
@@ -2,9 +2,6 @@
   #
   # We optionaly create a __fixme__.cmake
   #
-  SET (FIXME_CMAKE_SINGLETON FALSE)
-  SET (HAVE_STDINT_H FALSE)
-  SET (HAVE_INTTYPES_H FALSE)
   IF (NOT FIXME_CMAKE_SINGLETON)
     IF ((NOT HAVE_STDINT_H) OR (NOT HAVE_INTTYPES_H))
       GET_PROPERTY(source_dir GLOBAL PROPERTY MYPACKAGE_SOURCE_DIR)


Updated MD5 for modmetis-5.1.0 after updates to metis package.

--- cmake/ThirdPartyMetis.cmake
+++ cmake/ThirdPartyMetis.cmake
@@ -7,7 +7,7 @@
         modmetis-5.1.0
         PREFIX ${TPSRC}
         URL http://www.nektar.info/thirdparty/modmetis-5.1.0.tar.bz2
-        URL_MD5 "1519db68141ed79fdd45064375c65e88"
+        URL_MD5 "8f8313a768e4611d1748d10f88f3d702"
         DOWNLOAD_DIR ${TPSRC}
         CONFIGURE_COMMAND ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist -DCMAKE_C_FLAGS:STRING=-fPIC -DGKLIB_PATH:PATH=${TPSRC}/src/modmetis-5.1.0/GKlib ${TPSRC}/src/modmetis-5.1.0
     )


Reinstate target dependencies on Table_gen targets in CMake

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -58,4 +58,7 @@
   endif( TABLEGEN_OUTPUT )
   include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
   add_llvm_library(LLVM${target_name} ${ARGN} ${TABLEGEN_OUTPUT})
+  if ( TABLEGEN_OUTPUT )
+    add_dependencies(LLVM${target_name} ${target_name}Table_gen)
+  endif (TABLEGEN_OUTPUT)
 endmacro(add_llvm_target)


Fix mingw build failures caused by r349839

Reviewers: mstorsjo

Subscribers: mgorny, llvm-commits

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

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -656,6 +656,10 @@
         endif()
       else()
         set(install_type ARCHIVE)
+      endif()
+
+      if (ARG_MODULE)
+        set(install_type LIBRARY)
       endif()

       if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR


Fix mis-merging in AddLLVM.cmake. Sorry.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -50,6 +50,7 @@
     else()
       set_property(TARGET ${target_name} APPEND_STRING PROPERTY
                    LINK_FLAGS " ${CMAKE_CURRENT_BINARY_DIR}/${native_export_file}")
+    endif()
   endif()

   add_custom_target(${target_name}_exports DEPENDS ${native_export_file})


Added library selection options and messages

--- cmake_modules/Findbta.cmake
+++ cmake_modules/Findbta.cmake
@@ -1,8 +1,8 @@
 # - Try to find btatofapi headers and binaries
 # Once done this will define
 #
-set(BTA_ETH OFF)
-set(BTA_P100 OFF)
+set(BTA_ETH)
+set(BTA_P100)

 FIND_PATH(bta_INCLUDE_DIR NAMES bta.h
  	PATHS
@@ -21,6 +21,7 @@
       set(ARCH_DIR "x86")
   	endif()

+
 find_library(bta_eth_LIBRARY NAMES bta_eth
         PATHS
   		/usr/lib/
@@ -29,6 +30,7 @@
 	NO_DEFAULT_PATH
 	DOC "Library binary"
 )
+set(bta_LIBRARIES ${bta_eth_LIBRARY})

 find_library(bta_p100_LIBRARY NAMES bta_p100
         PATHS
@@ -39,12 +41,18 @@
 	DOC "Library binary"
 )

+message( BTA_ETH:  ${BTA_ETH} )
+message( BTA_P100:  ${BTA_P100} )
+
 if (BTA_ETH)
 	set(bta_LIBRARIES ${bta_eth_LIBRARY})
+	#message( "BTA_ETH" )
 elseif (BTA_P100)
-	set(bta_LIBRARIES ${bta_eth_LIBRARY})
+	set(bta_LIBRARIES ${bta_p100_LIBRARY})
+	#message( "BTA_P100" )
 else ()
-set(bta_LIBRARIES ${bta_p100_LIBRARY} ${bta_eth_LIBRARY})
+	set(bta_LIBRARIES ${bta_eth_LIBRARY} ${bta_p100_LIBRARY})
+	#message( "BTA_ETH BTA_P100" )
 endif()
 #set(m100_INCLUDE_DIRS ${m100_INCLUDE_DIR} )


Make Rabbitmq_DIR take precidence over system paths

--- Modules/FindRabbitmqc.cmake
+++ Modules/FindRabbitmqc.cmake
@@ -2,19 +2,19 @@

 INCLUDE(LibFindMacros)

-
 # Find the include directories
 FIND_PATH(Rabbitmqc_INCLUDE_DIR
 	NAMES amqp.h
-	PATHS ${Rabbitmqc_DIR}/include
+    HINTS ${Rabbitmqc_DIR}/include
 	)

 FIND_LIBRARY(Rabbitmqc_LIBRARY
 	NAMES rabbitmq
-	PATHS ${Rabbitmqc_DIR}/lib
+    HINTS ${Rabbitmqc_DIR}/lib
 	)

 SET(Rabbitmqc_PROCESS_INCLUDES Rabbitmqc_INCLUDE_DIR)
 SET(Rabbitmqc_PROCESS_LIBS Rabbitmqc_LIBRARY)
+
 LIBFIND_PROCESS(Rabbitmqc)


Fix folder organization of OpenSpaceTest

--- support/cmake/support_macros.cmake
+++ support/cmake/support_macros.cmake
@@ -249,8 +249,8 @@

         set_target_properties(OpenSpaceTest PROPERTIES LINK_FLAGS
             "/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib"
+        )
         set_property(TARGET OpenSpaceTest PROPERTY FOLDER "Unit Tests")
-        )
     endif (OPENSPACE_HAVE_TESTS)
     if (TARGET GhoulTest)
         set_property(TARGET GhoulTest PROPERTY FOLDER "Unit Tests")


BUG: Need to specify itk install path + /lib/cmake to detect ITK

On windows platforms just using itk's install path was
insufficient. And resulted in cmake finding some random other ITK
installations, and error followed.

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -245,7 +245,7 @@
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/SimpleITK-build/CMakeCacheInit.txt" "${ep_common_cache}\n${ep_languages_cache}" )

 ExternalProject_Get_Property(ITK install_dir)
-set(itk_dir "${intall_dir}")
+set(itk_dir "${intall_dir}/lib/cmake")

 set(proj SimpleITK)
 ExternalProject_Add(${proj}


fixing logic for required version for testing

Change-Id: I8776f095d88926b72cf099f64f95c57c858c6f7c

--- SuperBuild/SuperBuild.cmake
+++ SuperBuild/SuperBuild.cmake
@@ -12,7 +12,7 @@
 option( BUILD_TESTING "Turn on Testing for SimpleITK" ${BUILD_TESTING_DEFAULT} )

 # 2.8.11 required for ExternalData.cmake.
-if( ${CMAKE_VERSION} VERSION_LESS 2.8.11 )
+if( BUILD_TESTING AND CMAKE_VERSION VERSION_LESS 2.8.11 )
   message( FATAL_ERROR "BUILD_TESTING ON requires CMake 2.8.11 or newer." )
 endif()


Provide a meaningful diagnostic when LLVM_PATH doesn't point to a directory

git-svn-id: 6a9f6578bdee8d959f0ed58970538b4ab6004734@369312 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/Modules/HandleOutOfTreeLLVM.cmake
+++ cmake/Modules/HandleOutOfTreeLLVM.cmake
@@ -9,6 +9,9 @@
     set(LLVM_PATH ${LLVM_PATH} CACHE PATH "Path to LLVM source tree")
     set(LLVM_MAIN_SRC_DIR ${LLVM_PATH})
     set(LLVM_CMAKE_PATH "${LLVM_PATH}/cmake/modules")
+    if (NOT IS_DIRECTORY "${LLVM_PATH}")
+      message(FATAL_ERROR "The provided LLVM_PATH (${LLVM_PATH}) is not a valid directory")
+    endif()
   elseif(LLVM_CONFIG_PATH)
     message(STATUS "Found LLVM_CONFIG_PATH as ${LLVM_CONFIG_PATH}")
     set(LIBCXXABI_USING_INSTALLED_LLVM 1)


cmake(opt): force separate targets for dispatched code

- PCH may not pass compilation flags properly

--- cmake/OpenCVCompilerOptimizations.cmake
+++ cmake/OpenCVCompilerOptimizations.cmake
@@ -680,7 +680,7 @@
           if(fname_LOWER MATCHES "\\.${OPT_LOWER}\\.cpp$")
 #message("${fname} BASELINE-${OPT}")
             set(__opt_found 1)
-            list(APPEND __result "${fname}")
+            list(APPEND __result_${OPT} "${fname}")
             break()
           endif()
         endforeach()
@@ -714,7 +714,7 @@
     endif()
   endforeach()

-  foreach(OPT ${CPU_DISPATCH_FINAL})
+  foreach(OPT ${CPU_BASELINE_FINAL} ${CPU_DISPATCH_FINAL})
     if(__result_${OPT})
 #message("${OPT}: ${__result_${OPT}}")
       if(CMAKE_GENERATOR MATCHES "^Visual"


Version: Update development date

Version: Update development date

--- src/Version.cmake
+++ src/Version.cmake
@@ -1,7 +1,7 @@
 # CastXML version number components.
 set(CastXML_VERSION_MAJOR 0)
 set(CastXML_VERSION_MINOR 2)
-set(CastXML_VERSION_PATCH 20190819)
+set(CastXML_VERSION_PATCH 20200213)
 set(CastXML_VERSION_RC 0)
 set(CastXML_VERSION_IS_DIRTY 0)


Add sitk namespace alias on example page.

This enable links from the C++ example to the used classes in the
doxygen.

Change-Id: Iaea442402f0ff27a4a83f1c380ed60a6fab52b72

--- Utilities/Doxygen/GenerateExamplesDox.cmake
+++ Utilities/Doxygen/GenerateExamplesDox.cmake
@@ -25,7 +25,7 @@
 file( REMOVE ${OUTPUT_FILE} )

 # begin comment
-file( APPEND ${OUTPUT_FILE} "/**\n")
+file( APPEND ${OUTPUT_FILE} "namespace sitk = itk::simple;/**\n")

 FOREACH( f IN LISTS EXAMPLES_LIST )
   file( APPEND ${OUTPUT_FILE}  "\\example ${f}\n" )


Don't test piston on dashboards that don't have CUDA.

The accompanying cmakelists.txt file correctly prevents the
module from compiling if cuda is not present. We don't
want the that to prevent the rest of vtk from compiling
when the all module set is on.

Change-Id: I142835197bf90b848c964460f8bc8a58af65c468

--- Accelerators/Piston/module.cmake
+++ Accelerators/Piston/module.cmake
@@ -14,4 +14,5 @@
     vtkParallelCore
     vtkParallelMPI
     vtkRenderingParallel
+  EXCLUDE_FROM_ALL
   )


Modified FindDirectX.cmake to behave closer to our other find scripts. Should fix part 2 of 2765664.

--- CMake/Packages/FindDirectX.cmake
+++ CMake/Packages/FindDirectX.cmake
@@ -6,51 +6,49 @@
 # DirectX_LIBRARY
 # DirectX_ROOT_DIR

-set(DirectX_FOUND false)
-
 if(WIN32) # The only platform it makes sense to check for DirectX SDK
-
-  # We start with Microsoft DirectX SDK (August 2008) 9.24.1400
-  # Example of path is C:\apps_x86\Microsoft DirectX SDK (August 2008)\Include
-  find_path(DirectX_INCLUDE_DIR d3d9.h
-    "$ENV{DXSDK_DIR}/Include"
-    "C:/apps_x86/Microsoft DirectX SDK*/Include"
-    "C:/Program Files (x86)/Microsoft DirectX SDK*/Include"
-    "C:/apps/Microsoft DirectX SDK*/Include"
-    "C:/Program Files/Microsoft DirectX SDK*/Include"
-    )
-  mark_as_advanced(DirectX_INCLUDE_DIR)
+  include(FindPkgMacros)
+  findpkg_begin(DirectX)
+
+  # construct search paths
+  set(DirectX_PREFIX_PATH ${DXSDK_DIR} $ENV{DXSDK_DIR}
+    "C:/apps_x86/Microsoft DirectX SDK*"
+    "C:/Program Files (x86)/Microsoft DirectX SDK*"
+    "C:/apps/Microsoft DirectX SDK*"
+    "C:/Program Files/Microsoft DirectX SDK*"
+	"$ENV{ProgramFiles}/Microsoft DirectX SDK*"
+  )
+  create_search_paths(DirectX)
+  # redo search if prefix path changed
+  clear_if_changed(DirectX_PREFIX_PATH
+    DirectX_LIBRARY
+	DirectX_INCLUDE_DIR
+	DirectX_ROOT_DIR
+  )
+
+  find_path(DirectX_INCLUDE_DIR NAMES d3d9.h HINTS ${DirectX_INC_SEARCH_PATH})
+  # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
+  # lib files are in DirectX_ROOT_DIR/Lib/x64|x86
+  if(CMAKE_CL_64)
+    set(DirectX_LIBPATH_SUFFIX "x64")
+  else(CMAKE_CL_64)
+    set(DirectX_LIBPATH_SUFFIX "x86")
+  endif(CMAKE_CL_64)
+  find_library(DirectX_LIBRARY NAMES d3d9 HINTS ${DirectX_LIB_SEARCH_PATH} PATH_SUFFIXES ${DirectX_LIBPATH_SUFFIX})
+
   if(DirectX_INCLUDE_DIR)
     set(DirectX_ROOT_DIR "${DirectX_INCLUDE_DIR}/..")
   endif(DirectX_INCLUDE_DIR)

-  # dlls are in DirectX_ROOT_DIR/Developer Runtime/x64|x86
-  # lib files are in DirectX_ROOT_DIR/Lib/x64|x86

-  set(DirectX_LIBRARY_PATHS)
-  if(CMAKE_CL_64)
-    set(DirectX_LIBRARY_PATHS
-      "${DirectX_ROOT_DIR}/Lib/x64")
-  else(CMAKE_CL_64)
-    set(DirectX_LIBRARY_PATHS
-      "${DirectX_ROOT_DIR}/Lib/x86" "${DirectX_ROOT_DIR}/Lib")
-  endif(CMAKE_CL_64)
+  findpkg_finish(DirectX)

-  find_library(DirectX_LIBRARY d3d9 ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)
-  if(DirectX_INCLUDE_DIR AND DirectX_LIBRARY)
-    set(DirectX_FOUND true)
-  endif(DirectX_INCLUDE_DIR AND DirectX_LIBRARY)
-  mark_as_advanced(DirectX_LIBRARY)
-
-  #message("DirectX_FOUND=${DirectX_FOUND}")
-  #message("DirectX_INCLUDE_DIR=${DirectX_INCLUDE_DIR}")
-  #message("DirectX_LIBRARY=${DirectX_LIBRARY}")
-  #message("DirectX_ROOT_DIR=${DirectX_ROOT_DIR}")
-
   # look for D3D10.1 components
   if (DirectX_FOUND)
-    find_path(DirectX_D3D10_INCLUDE_DIR NAMES d3d10_1shader.h HINTS ${DirectX_INCLUDE_DIR})
-	find_library(DirectX_D3D10_LIBRARY NAMES d3d10 HINTS ${DirectX_LIBRARY_PATHS} NO_DEFAULT_PATH)
+    find_path(DirectX_D3D10_INCLUDE_DIR NAMES d3d10_1shader.h HINTS ${DirectX_INCLUDE_DIR} NO_DEFAULT_PATH)
+	get_filename_component(DirectX_LIBRARY_DIR "${DirectX_LIBRARY}" PATH)
+	message(STATUS "DX lib dir: ${DirectX_LIBRARY_DIR}")
+	find_library(DirectX_D3D10_LIBRARY NAMES d3d10 HINTS ${DirectX_LIBRARY_DIR} NO_DEFAULT_PATH)
 	if (DirectX_D3D10_INCLUDE_DIR AND DirectX_D3D10_LIBRARY)
 	  set(DirectX_D3D10_FOUND TRUE)
 	  set(DirectX_D3D10_INCLUDE_DIRS ${DirectX_D3D10_INCLUDE_DIR})


COMP: fix use of install tree

COMP: fix use of install tree

--- CMake/otbGenerateOTBConfig.cmake
+++ CMake/otbGenerateOTBConfig.cmake
@@ -44,19 +44,19 @@
 # Settings specific to the install tree.

 # The library dependencies file.
-SET(OTB_LIBRARY_DEPENDS_FILE "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_PACKAGE_DIR}/OTBLibraryDepends.cmake")
+SET(OTB_LIBRARY_DEPENDS_FILE "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBLibraryDepends.cmake")

 # The "use" file.
-SET(OTB_USE_FILE \${OTB_INSTALL_PREFIX}${OTB_INSTALL_PACKAGE_DIR}/UseOTB.cmake)
+SET(OTB_USE_FILE \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/UseOTB.cmake)

 # The build settings file.
-SET(OTB_BUILD_SETTINGS_FILE \${OTB_INSTALL_PREFIX}${OTB_INSTALL_PACKAGE_DIR}/OTBBuildSettings.cmake)
+SET(OTB_BUILD_SETTINGS_FILE \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_PACKAGE_DIR}/OTBBuildSettings.cmake)

 # Include directories.
-SET(OTB_INCLUDE_DIRS_CONFIG \${OTB_INSTALL_PREFIX}${OTB_INSTALL_INCLUDE_DIR})
+SET(OTB_INCLUDE_DIRS_CONFIG \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_INCLUDE_DIR})
 FOREACH(DIR ${OTB_INCLUDE_RELATIVE_DIRS})
-  LIST(APPEND OTB_INCLUDE_DIRS_CONFIG \${OTB_INSTALL_PREFIX}${OTB_INSTALL_INCLUDE_DIR}/${DIR})
+  LIST(APPEND OTB_INCLUDE_DIRS_CONFIG \${OTB_INSTALL_PREFIX}/${OTB_INSTALL_INCLUDE_DIR}/${DIR})
 ENDFOREACH(DIR)
 IF(OTB_INCLUDE_DIRS_SYSTEM)
   LIST(APPEND OTB_INCLUDE_DIRS_CONFIG ${OTB_INCLUDE_DIRS_SYSTEM})
@@ -67,10 +67,10 @@
         ${OTB_INCLUDE_ABSOLUE_DIRS}  )

 # Link directories.
-SET(OTB_LIBRARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_LIB_DIR}")
+SET(OTB_LIBRARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_LIB_DIR}")

 # Binary directories
-SET(OTB_BINARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}${OTB_INSTALL_BIN_DIR}")
+SET(OTB_BINARY_DIRS_CONFIG "\${OTB_INSTALL_PREFIX}/${OTB_INSTALL_BIN_DIR}")

 #-----------------------------------------------------------------------------
 # Configure OTBConfig.cmake for the INSTALL tree.


Added windows license information to WIX installer

--- CMakeModules/CPackSettings.cmake
+++ CMakeModules/CPackSettings.cmake
@@ -11,6 +11,7 @@
 IF(WIN32)
   SET(CPACK_GENERATOR "WIX")
   SET(CPACK_WIX_UPGRADE_GUID 6D28652E-751D-42F0-9D8A-44EAA79CB84B)
+  SET(CPACK_WIX_LICENSE_RTF "${PROJECT_SOURCE_DIR}/msvc/license.txt")
   SET(CPACK_SOURCE_GENERATOR "ZIP")
   SET(CPACK_SOURCE_PACKAGE_FILE_NAME
   "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")


cmake: Build lapack libraries as position independent code

This allows other projects to easily build shared libraries linking
against the statically built lapack libraries.

--- SuperBuild/External_LAPACK.cmake
+++ SuperBuild/External_LAPACK.cmake
@@ -170,6 +170,7 @@
         -DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED}
         -DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS}
         -DCMAKE_Fortran_COMPILER:FILEPATH=${Fortran_${Fortran_COMPILER_ID}_EXECUTABLE}
+        -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=1
         # Output directories
         ## NA
         # Install directories


COMP: Bump OpenCV to 3.1.0.

COMP: Bump OpenCV to 3.1.0.

To address:

In file included from
/home/matt/bin/ITKExamples-Clang-MinSizeRel/opencv/modules/ts/src/ts.cpp:116:
/usr/include/setjmp.h:59:12: error: conflicting types for '__sigsetjmp'
extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask)
__THROWNL;

/usr/include/pthread.h:743:12: note: previous declaration is here
extern int __sigsetjmp (struct __jmp_buf_tag *__env, int
__savemask) __THROWNL;

Change-Id: I566c17ba6200bed6f0f8a1850cf6a45f4e1a24a4

--- Superbuild/External-OpenCV.cmake
+++ Superbuild/External-OpenCV.cmake
@@ -2,7 +2,7 @@
 # Get and build OpenCV

 if( NOT OpenCV_TAG )
-  set( OpenCV_TAG "3.0.0" )
+  set( OpenCV_TAG "3.1.0" )
 endif()

 ExternalProject_Add(OpenCV


MRG: Merged from origin/develop.

MRG: Merged from origin/develop.

--- SuperBuild/CMake/External_otb.cmake
+++ SuperBuild/CMake/External_otb.cmake
@@ -63,6 +63,12 @@
 if(OTB_WRAP_PYTHON OR OTB_WRAP_JAVA)
   ADD_SUPERBUILD_CMAKE_VAR(OTB SWIG_EXECUTABLE)
   ADDTO_DEPENDENCIES_IF_NOT_SYSTEM(OTB SWIG)
+endif()
+
+if(OTB_WRAP_PYTHON)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB PYTHON_INCLUDE_DIR)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB PYTHON_LIBRARY)
+  ADD_SUPERBUILD_CMAKE_VAR(OTB PYTHON_EXECUTABLE)
 endif()

 if(OTB_USE_QT4)


Only override add_library/add_executable once

If subprojects try to redefine these names (multiple times), cmake behaves badly

--- TargetHooks.cmake
+++ TargetHooks.cmake
@@ -1,5 +1,7 @@
-# hooks to gather targets in global properties ALL_DEP_TARGETS and
-# ALL_LIB_TARGETS for future processing
+# hooks to gather targets in global properties ${PROJECT_NAME}_ALL_DEP_TARGETS and
+# ${PROJECT_NAME}_ALL_LIB_TARGETS for future processing
+# We add ${PROJECT_NAME}_ to the start of the global property so that when
+# multiple subprojects are built in a single go, the properties are unique per project

 include(CMakeParseArguments)
 include(CppcheckTargets)
@@ -10,50 +12,66 @@
 set(CPPCHECK_EXTRA_ARGS --suppress=unusedFunction --suppress=missingInclude
   -I${OUTPUT_INCLUDE_DIR} -D${UPPER_PROJECT_NAME}_STATIC=)

-macro(add_executable _target)
-  _add_executable(${_target} ${ARGN})
-  add_cppcheck(${_target} POSSIBLE_ERROR FAIL_ON_WARNINGS EXCLUDE_QT_MOC_FILES)
-  add_cpplint(${_target} CATEGORY_FILTER_OUT readability/streams
-    EXCLUDE_PATTERN ".*moc_.*\\.cxx|Buildyard/Build")
-  set_property(GLOBAL APPEND PROPERTY ALL_DEP_TARGETS ${_target})
-endmacro()
-macro(add_library _target)
-  _add_library(${_target} ${ARGN})
-  add_cppcheck(${_target} POSSIBLE_ERROR FAIL_ON_WARNINGS EXCLUDE_QT_MOC_FILES)
-  add_cpplint(${_target} CATEGORY_FILTER_OUT readability/streams
-    EXCLUDE_PATTERN ".*moc_.*\\.cxx|Buildyard/Build")
+# only ever define this macro once, just in case sub-projects include the same rules
+get_property(ADD_EXE_DEFINED GLOBAL PROPERTY ADD_EXE_MACRO_DEFINED)
+if(NOT ADD_EXE_DEFINED)
+  set_property(GLOBAL PROPERTY ADD_EXE_MACRO_DEFINED "1")
+  macro(add_executable _target)
+    _add_executable(${_target} ${ARGN})
+    add_cppcheck(${_target} POSSIBLE_ERROR FAIL_ON_WARNINGS EXCLUDE_QT_MOC_FILES)
+    add_cpplint(${_target} CATEGORY_FILTER_OUT readability/streams
+      EXCLUDE_PATTERN ".*moc_.*\\.cxx|Buildyard/Build")
+    set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_ALL_DEP_TARGETS ${_target})
+  endmacro()
+endif()

-  # ignore IMPORTED add_library from finders (e.g. Qt)
-  cmake_parse_arguments(_arg "IMPORTED" "" "" ${ARGN})
+# only ever define this macro once, just in case sub-projects include the same rules
+get_property(ADD_LIBRARY_DEFINED GLOBAL PROPERTY ADD_LIBRARY_MACRO_DEFINED)
+message("Testing ADD_LIBRARY_DEFINED gives result ${ADD_LIBRARY_DEFINED}")
+if(NOT ADD_LIBRARY_DEFINED)
+  message("Creating an add_library macro")
+  set_property(GLOBAL PROPERTY ADD_LIBRARY_MACRO_DEFINED "1")
+  macro(add_library _target)
+    _add_library(${_target} ${ARGN})
+    add_cppcheck(${_target} POSSIBLE_ERROR FAIL_ON_WARNINGS EXCLUDE_QT_MOC_FILES)
+    add_cpplint(${_target} CATEGORY_FILTER_OUT readability/streams
+      EXCLUDE_PATTERN ".*moc_.*\\.cxx|Buildyard/Build")

-  # ignore user-specified targets, e.g. language bindings
-  list(FIND IGNORE_LIB_TARGETS ${_target} _ignore_target)
+    # ignore IMPORTED add_library from finders (e.g. Qt)
+    cmake_parse_arguments(_arg "IMPORTED" "" "" ${ARGN})

-  if(NOT _arg_IMPORTED AND _ignore_target EQUAL -1)
-    # add defines TARGET_DSO_NAME and TARGET_SHARED for dlopen() usage
-    get_target_property(THIS_DEFINITIONS ${_target} COMPILE_DEFINITIONS)
-    if(NOT THIS_DEFINITIONS)
-      set(THIS_DEFINITIONS) # clear THIS_DEFINITIONS-NOTFOUND
+    # ignore user-specified targets, e.g. language bindings
+    list(FIND IGNORE_LIB_TARGETS ${_target} _ignore_target)
+
+    if(NOT _arg_IMPORTED AND _ignore_target EQUAL -1)
+      # add defines TARGET_DSO_NAME and TARGET_SHARED for dlopen() usage
+      get_target_property(THIS_DEFINITIONS ${_target} COMPILE_DEFINITIONS)
+      if(NOT THIS_DEFINITIONS)
+        set(THIS_DEFINITIONS) # clear THIS_DEFINITIONS-NOTFOUND
+      endif()
+      string(TOUPPER ${_target} _TARGET)
+
+      if(MSVC OR XCODE_VERSION)
+        set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX})
+      else()
+        if(APPLE)
+          set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}.${VERSION_ABI}${CMAKE_SHARED_LIBRARY_SUFFIX})
+        else()
+          set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION_ABI})
+        endif()
+      endif()
+
+      list(APPEND THIS_DEFINITIONS
+        ${_TARGET}_SHARED ${_TARGET}_DSO_NAME=\"${_libraryname}\")
+
+      set_target_properties(${_target} PROPERTIES
+        COMPILE_DEFINITIONS "${THIS_DEFINITIONS}")
+
+      set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_ALL_DEP_TARGETS ${_target})
+      set_property(GLOBAL APPEND PROPERTY ${PROJECT_NAME}_ALL_LIB_TARGETS ${_target})
+get_property(XXX_LIBRARY_TARGETS GLOBAL PROPERTY ${PROJECT_NAME}_ALL_LIB_TARGETS)
+
+message("We have added ${_target} to the ALL_LIB_TARGETS global which is now ${XXX_LIBRARY_TARGETS}")
     endif()
-    string(TOUPPER ${_target} _TARGET)
-
-    if(MSVC OR XCODE_VERSION)
-      set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX})
-    else()
-      if(APPLE)
-        set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}.${VERSION_ABI}${CMAKE_SHARED_LIBRARY_SUFFIX})
-      else()
-        set(_libraryname ${CMAKE_SHARED_LIBRARY_PREFIX}${_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${VERSION_ABI})
-      endif()
-    endif()
-
-    list(APPEND THIS_DEFINITIONS
-      ${_TARGET}_SHARED ${_TARGET}_DSO_NAME=\"${_libraryname}\")
-
-    set_target_properties(${_target} PROPERTIES
-      COMPILE_DEFINITIONS "${THIS_DEFINITIONS}")
-
-    set_property(GLOBAL APPEND PROPERTY ALL_DEP_TARGETS ${_target})
-    set_property(GLOBAL APPEND PROPERTY ALL_LIB_TARGETS ${_target})
-  endif()
-endmacro()
+  endmacro()
+endif()


ci_gitlab: Serialization with generation requires documentation (doxy xml).

--- ci_gitlab/siconos_confs/siconos_with_serialization.cmake
+++ ci_gitlab/siconos_confs/siconos_with_serialization.cmake
@@ -40,9 +40,9 @@

 # --- Documentation setup ---
-option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" OFF)
+option(WITH_DOCUMENTATION "Build Documentation. Default = OFF" ON)
 option(WITH_DOXYGEN_WARNINGS "Explore doxygen warnings. Default = OFF" OFF)
-option(WITH_DOXY2SWIG "Build swig docstrings from doxygen xml output. Default = OFF." OFF)
+option(WITH_DOXY2SWIG "Build swig docstrings from doxygen xml output. Default = OFF." ON)