fbcode_builder: update FBPythonBinary.cmake to work on Windows

Summary:
On Windows we have to explicitly invoke `make_fbpy_archive.py` with python.
Therefore use CMake's built-in `FindPythonInterp` module to find the python
executable and use that when invoking `make_fbpy_archive.py`

This is slightly complicated by the effort required to find python with older
versions of CMake.  We ideally still want to support versions of CMake back to
at least 3.8, which means we need to still support finding Python with the
older `FindPythonInterp.cmake` module

Reviewed By: wez

Differential Revision: D17128606

fbshipit-source-id: 3f4beff76848b8a362ebdf21198e7a8bf1b0537f

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -23,18 +23,45 @@
 # library paths.
 #

+# If the caller has not already found Python, do so now.
+# If we fail to find python now we won't fail immediately, but
+# add_fb_python_executable() or add_fb_python_library() will fatal out if they
+# are used.
+if(NOT Python3_EXECUTABLE)
+  # CMake 3.12+ ships with a FindPython3.cmake module.  Try using it first.
+  # We find with QUIET here, since otherwise this generates some noisy warnings
+  # on versions of CMake before 3.12
+  find_package(Python3 COMPONENTS Interpreter QUIET)
+  if(Python3_Interpreter_FOUND)
+    message(STATUS "Found Python 3: ${Python3_EXECUTABLE}")
+  else()
+    # Try with the FindPythonInterp.cmake module available in older CMake
+    # versions.  Check to see if the caller has already searched for this
+    # themselves first.
+    if(NOT PYTHONINTERP_FOUND)
+      set(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1)
+      find_package(PythonInterp)
+    endif()
+    if(PYTHONINTERP_FOUND)
+      if("${PYTHON_VERSION_MAJOR}" GREATER_EQUAL 3)
+        set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE}")
+      else()
+        string(
+          CONCAT FBPY_FIND_PYTHON_ERR
+          "found Python ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}, "
+          "but need Python 3"
+        )
+      endif()
+    endif()
+  endif()
+endif()
+
 # Find our helper program.
 # We typically install this in the same directory as this .cmake file.
 find_program(
-  MAKE_PYTHON_ARCHIVE "make_fbpy_archive.py"
+  FB_MAKE_PYTHON_ARCHIVE "make_fbpy_archive.py"
   PATHS ${CMAKE_MODULE_PATH}
 )
-if (NOT MAKE_PYTHON_ARCHIVE)
-  message(
-    FATAL_ERROR "unable to find make_fbpy_archive.py helper program (it "
-    "should be located in the same directory as FBPythonRules.cmake)"
-  )
-endif()

 # An option to control the default installation location for
 # install_fb_python_library().  This is relative to ${CMAKE_INSTALL_PREFIX}
@@ -52,7 +79,10 @@
 # which module should be started as the __main__ module when the executable is
 # run.  If left unspecified, a __main__.py script must be present in the
 # manifest.
+#
 function(add_fb_python_executable EXE_NAME)
+  fb_py_check_available()
+
   # Parse the arguments
   set(one_value_args BASE_DIR NAMESPACE MAIN_MODULE TYPE)
   set(multi_value_args SOURCES DEPENDS)
@@ -107,19 +137,20 @@
   endif()

   if(DEFINED ARG_MAIN_MODULE)
-    set(main_argument "--main" "${ARG_MAIN_MODULE}")
+    list(APPEND make_py_args "--main" "${ARG_MAIN_MODULE}")
   endif()

   add_custom_command(
     OUTPUT "${output_file}"
     ${extra_cmd_params}
     COMMAND
-      "${MAKE_PYTHON_ARCHIVE}" -o "${EXE_NAME}" ${main_argument}
+      "${Python3_EXECUTABLE}" "${FB_MAKE_PYTHON_ARCHIVE}"
+      -o "${EXE_NAME}"
       ${make_py_args}
     DEPENDS
       ${source_files}
       "${EXE_NAME}.main_lib.py_sources_built"
-      "${MAKE_PYTHON_ARCHIVE}"
+      "${FB_MAKE_PYTHON_ARCHIVE}"
   )

   # Add an "ALL" target that depends on force ${EXE_NAME},
@@ -184,6 +215,8 @@
 #   will then be read at build-time in order to build executables.
 #
 function(add_fb_python_library LIB_NAME)
+  fb_py_check_available()
+
   # Parse the arguments
   # We use fb_cmake_parse_args() rather than cmake_parse_arguments() since
   # cmake_parse_arguments() does not handle empty arguments, and it is common
@@ -332,13 +365,13 @@
       "${build_install_dir}/${LIB_NAME}.manifest"
     COMMAND "${CMAKE_COMMAND}" -E remove_directory "${build_install_dir}"
     COMMAND
-      "${MAKE_PYTHON_ARCHIVE}" --type lib-install
+      "${Python3_EXECUTABLE}" "${FB_MAKE_PYTHON_ARCHIVE}" --type lib-install
       --install-dir "${LIB_NAME}"
       -o "${build_install_dir}/${LIB_NAME}" "${manifest_path}"
     DEPENDS
       "${abs_sources}"
       "${manifest_path}"
-      "${MAKE_PYTHON_ARCHIVE}"
+      "${FB_MAKE_PYTHON_ARCHIVE}"
   )
   add_custom_target(
     "${LIB_NAME}.py_lib_install"
@@ -435,3 +468,22 @@
     get_filename_component("${BASE_DIR_VAR}" "${${BASE_DIR_VAR}}" ABSOLUTE)
   endif()
 endmacro()
+
+function(fb_py_check_available)
+  # Make sure that Python 3 and our make_fbpy_archive.py helper script are
+  # available.
+  if(NOT Python3_EXECUTABLE)
+    if(FBPY_FIND_PYTHON_ERR)
+      message(FATAL_ERROR "Unable to find Python 3: ${FBPY_FIND_PYTHON_ERR}")
+    else()
+      message(FATAL_ERROR "Unable to find Python 3")
+    endif()
+  endif()
+
+  if (NOT FB_MAKE_PYTHON_ARCHIVE)
+    message(
+      FATAL_ERROR "unable to find make_fbpy_archive.py helper program (it "
+      "should be located in the same directory as FBPythonRules.cmake)"
+    )
+  endif()
+endfunction()


Fix typo

Fix typo

--- GithubOrganization.cmake
+++ GithubOrganization.cmake
@@ -6,7 +6,7 @@

 if(GIT_ROOT_URL)
   set(_git_origin_url ${GIT_ROOT_URL})
-elif(GIT_ORIGIN_URL)
+elseif(GIT_ORIGIN_URL)
   set(_git_origin_url ${GIT_ORIGIN_URL})
 endif()


PKG: try adding dependency to ALL

PKG: try adding dependency to ALL

--- SuperBuild/Packaging/PMacros.cmake
+++ SuperBuild/Packaging/PMacros.cmake
@@ -116,6 +116,7 @@
       )
   else()
     add_custom_target(PACKAGE-${pkg}
+      ALL DEPENDS
       COMMAND ${MAKESELF_SCRIPT}
       "--quiet"
       "--target"


Updated error messages and error handling

Former-commit-id: be942ff73f5a123e444d3afef39b8af5183cd6c8

--- cmake-modules/Fetch_OpenBLAS.cmake
+++ cmake-modules/Fetch_OpenBLAS.cmake
@@ -121,14 +121,15 @@
             BUILD_COMMAND export LD_LIBRARY_PATH=${GFORTRAN_PATH} &&
                           export LDFLAGS=-L${GFORTRAN_LIB_SHARED} &&
                           $(MAKE) TARGET=${OPENBLAS_MARCH}
+                          DYNAMIC_ARCH=1
                           USE_THREAD=${OpenBLAS_MULTITHREADED}
                           USE_OPENMP=${OpenBLAS_USE_OPENMP}
                           NO_AFFINITY=1
                           GEMM_MULTITHREAD_THRESHOLD=50
-                          NUM_THREADS=64
-                          BINARY64=64
-                          QUIET_MAKE=0
-                          FFLAGS=-Wno-maybe-uninitialized
+                          QUIET_MAKE=1
+                          NUM_THREADS=128
+                          FFLAGS=-frecursive
+#                          BINARY64=64
                           LDFLAGS=-L${GFORTRAN_LIB_SHARED}
             INSTALL_COMMAND $(MAKE) PREFIX=<INSTALL_DIR> install
             DEPENDS gfortran


Use `CMAKE_HOST_UNIX` to check the host.

`UNIX` is for the target.

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

--- cmake/Modules/SanitizerUtils.cmake
+++ cmake/Modules/SanitizerUtils.cmake
@@ -84,7 +84,7 @@
 endmacro()

 # Add target to check code style for sanitizer runtimes.
-if(UNIX)
+if(CMAKE_HOST_UNIX)
   add_custom_target(SanitizerLintCheck
     COMMAND env LLVM_CHECKOUT=${LLVM_MAIN_SRC_DIR} SILENT=1 TMPDIR=
       PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}


We can't use pkgconfig on windows

We can't use pkgconfig on windows

svn path=/trunk/KDE/kdepim/; revision=703184

--- cmake/modules/FindOpenChange.cmake
+++ cmake/modules/FindOpenChange.cmake
@@ -17,10 +17,11 @@
   SET(LIBMAPI_FOUND TRUE)

 else (LIBMAPI_INCLUDE_DIRS AND LIBMAPI_LIBRARIES)
+  if(NOT WIN32)
+    INCLUDE(UsePkgConfig)

-  INCLUDE(UsePkgConfig)
-
-  PKGCONFIG(libmapi _MAPIIncDir _MAPILinkDir _MAPILinkFlags _MAPICflags)
+    PKGCONFIG(libmapi _MAPIIncDir _MAPILinkDir _MAPILinkFlags _MAPICflags)
+  endif(NOT WIN32)

   set(LIBMAPI_DEFINITIONS ${_MAPICflags})
   set(LIBMAPI_INCLUDE_DIRS ${_MAPIIncDir})


Revert "Fix the search path for CMake files"

This reverts commit 1924d31f0a2516f3e374e59a1e45f3c0d60d9b1a.

This change assumes a more recent version of llvm/cmake than
currently exists in swift-llvm/stable and swift-clang/stable.

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -85,9 +85,9 @@
     message("-- Found PythonInterp: ${PYTHON_EXECUTABLE}")
   endif()
   # Import CMake library targets from LLVM and Clang.
-  include("${LLDB_PATH_TO_LLVM_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm/LLVMConfig.cmake")
-  if (EXISTS "${LLDB_PATH_TO_CLANG_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
-      include("${LLDB_PATH_TO_CLANG_BUILD}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
+  include("${LLDB_PATH_TO_LLVM_BUILD}/share/llvm/cmake/LLVMConfig.cmake")
+  if (EXISTS "${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
+      include("${LLDB_PATH_TO_CLANG_BUILD}/share/clang/cmake/ClangConfig.cmake")
   endif()

   set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")


[cmake] fix for external dir with back slashes (windows).

--- cmake/radium_setup_functions.cmake
+++ cmake/radium_setup_functions.cmake
@@ -769,7 +769,8 @@
     set(oneValueArgs NAME)
     cmake_parse_arguments(CHECKDEP "DUMMY_OPTION" "${oneValueArgs}" "DUMMY_MULTI" ${ARGN} )
     if (${CHECKDEP_NAME})
-        set(LocalDependencies "${LocalDependencies};-D${CHECKDEP_NAME}=${${CHECKDEP_NAME}}")
+        string(REPLACE "\\" "/" CHECKDEP_STRING ${${CHECKDEP_NAME}})
+        set(LocalDependencies "${LocalDependencies};-D${CHECKDEP_NAME}=${CHECKDEP_STRING}")
         set(LocalDependencies ${LocalDependencies} PARENT_SCOPE)
     endif ()
 endmacro()


Split off 8.4.10

Split off 8.4.10

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

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 9 )
+set ( HPCC_POINT 11 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


All: Increment version number post-release

--- version.cmake
+++ version.cmake
@@ -2,9 +2,9 @@
 	set(PROJECT_NAME "mGBA")
 endif()
 set(LIB_VERSION_MAJOR 0)
-set(LIB_VERSION_MINOR 4)
+set(LIB_VERSION_MINOR 5)
 set(LIB_VERSION_PATCH 0)
-set(LIB_VERSION_ABI 0.4)
+set(LIB_VERSION_ABI 0.5)
 set(LIB_VERSION_STRING ${LIB_VERSION_MAJOR}.${LIB_VERSION_MINOR}.${LIB_VERSION_PATCH})
 set(SUMMARY "${PROJECT_NAME} Game Boy Advance Emulator")


Split off 7.6.50

Split off 7.6.50

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

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


Split off 8.4.14

Split off 8.4.14

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

--- version.cmake
+++ version.cmake
@@ -5,7 +5,7 @@
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
 set ( HPCC_MINOR 4 )
-set ( HPCC_POINT 13 )
+set ( HPCC_POINT 15 )
 set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Graph Control 6.0.0-rc5 Release Candidate 5

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

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "rc" )
-set ( HPCC_SEQUENCE 4 )
+set ( HPCC_SEQUENCE 5 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Graph Control 4.0.0-2

Graph Control 4.0.0-2

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

--- version.cmake
+++ version.cmake
@@ -6,7 +6,7 @@
 set ( HPCC_MINOR 0 )
 set ( HPCC_POINT 0 )
 set ( HPCC_MATURITY "release" )
-set ( HPCC_SEQUENCE 1 )
+set ( HPCC_SEQUENCE 2 )
 ###
 IF ( ${HPCC_POINT} GREATER 65 )
   error ( "HPCC_POINT must be less than 66." )


Split off 8.6.0

Split off 8.6.0

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

--- version.cmake
+++ version.cmake
@@ -4,8 +4,8 @@
 set ( HPCC_NAME "Nagios Monitoring" )
 set ( HPCC_PROJECT "nagios-monitoring" )
 set ( HPCC_MAJOR 8 )
-set ( HPCC_MINOR 5 )
+set ( HPCC_MINOR 6 )
 set ( HPCC_POINT 0 )
-set ( HPCC_MATURITY "trunk" )
+set ( HPCC_MATURITY "closedown" )
 set ( HPCC_SEQUENCE 0 )
 ###


Drop -fno-omit-frame-pointer

Drop -fno-omit-frame-pointer

We'll use DWARF CFI unwinding information to do this

--- arch/x86_64/platform.cmake
+++ arch/x86_64/platform.cmake
@@ -3,7 +3,7 @@
     -DX86_64
 )

-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=x86_64-pc-none-elf -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone -O3")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --target=x86_64-pc-none-elf -mcmodel=kernel -mno-red-zone -O3")

 # Be careful of what you pass in here. Input will go directly to LLD, so no Clang flags allowed
 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T${CMAKE_SOURCE_DIR}/arch/x86_64/mint.lds")


Working on UseBoost fix

Working on UseBoost fix

--- Superbuild/UseBoost.cmake
+++ Superbuild/UseBoost.cmake
@@ -35,7 +35,7 @@
       if(WIN32)
 		    set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt${CMAKE_STATIC_LIBRARY_SUFFIX}")
         set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      else()
+      else(WIN32)
         if (${USER_PYTHON_VERSION} VERSION_GREATER "3.7")
           set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt${CMAKE_STATIC_LIBRARY_SUFFIX}")
           set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python${USER_PYTHON_VERSION_MAJOR}${USER_PYTHON_VERSION_MINOR}-mt${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
@@ -43,11 +43,11 @@
           set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python3-mt${CMAKE_STATIC_LIBRARY_SUFFIX}")
           set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}boost_python3-mt${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
         endif()
-      endif()
-	  else()
-		  set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-      set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
-	  endif()
+      endif(WIN32)
+	else() # non-python libraries
+	  set(FULL_LIB_NAME_RELEASE "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	  set(FULL_LIB_NAME_DEBUG "${SCI_BOOST_LIBRARY_DIR}/${boost_LIB_PREFIX}${lib}${DEBUG_POSTFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+	endif()
   endif()

   message(STATUS "Configure Boost library ${lib}")


COMP: further bug fix in PackageDepends command for OpenCV

--- CMake/PackageDepends/MITK_OpenCV_Config.cmake
+++ CMake/PackageDepends/MITK_OpenCV_Config.cmake
@@ -1,46 +1,50 @@
+macro(REMOVE_LAST_PATH_ELEMENT_IF_EQUALS INPUT_VAR TARGET_VALUE)
+  STRING( REPLACE "/" ";" INPUT_VARLIST ${${INPUT_VAR}} )
+  LIST( LENGTH INPUT_VARLIST INPUT_VARLIST_LENGTH )
+
+  SET(INPUT_VARLIST_LAST_INDEX ${INPUT_VARLIST_LENGTH})
+  MATH( EXPR INPUT_VARLIST_LAST_INDEX "${INPUT_VARLIST_LENGTH}-1" )
+  LIST( GET INPUT_VARLIST ${INPUT_VARLIST_LAST_INDEX} INPUT_VARLAST_ELEMENT )
+
+  if(INPUT_VARLAST_ELEMENT MATCHES "^${TARGET_VALUE}$")
+    LIST( REMOVE_AT INPUT_VARLIST ${INPUT_VARLIST_LAST_INDEX} )
+  endif()
+
+  set(NEW_VAR "")
+  foreach(folderPart ${INPUT_VARLIST})
+    if(NOT NEW_VAR)
+      if(NOT WIN32)
+        set(folderPart "/${folderPart}")
+      endif()
+      set(NEW_VAR "${folderPart}")
+    else()
+      set(NEW_VAR "${NEW_VAR}/${folderPart}")
+    endif()
+  endforeach()
+
+  set(${INPUT_VAR} ${NEW_VAR})
+endmacro()
+
 # bug in opencv 2.4.2 and mitk: if we have a submodule OpenCV_LIB_DIR_OPT and
 # OpenCV_LIB_DIR_DBG is cached when find_package is called
 # resulting in wrong windows output paths, e.g. C:\OpenCV\lib\Release\Release
 # removing last Release and Debug string manually to fix it
 if( OpenCV_LIB_DIR )

-  string(REPLACE "/" ";" OpenCV_LIB_DIR_OPT_LIST ${OpenCV_LIB_DIR_OPT})
-  set(OpenCV_LIB_DIR_OPT "")
-  foreach(folderPart ${OpenCV_LIB_DIR_OPT_LIST})
-    if(NOT folderPart EQUAL "Release")
-      if(NOT OpenCV_LIB_DIR_OPT)
-        if(NOT WIN32)
-          set(folderPart "/${folderPart}")
-        endif()
-        set(OpenCV_LIB_DIR_OPT "${folderPart}")
-      else()
-        set(OpenCV_LIB_DIR_OPT "${OpenCV_LIB_DIR_OPT}/${folderPart}")
-      endif()
-    endif()
-  endforeach()
-  set(OpenCV_LIB_DIR_DBG ${OpenCV_LIB_DIR_OPT})
-
-  string(REPLACE "/" ";" OpenCV_3RDPARTY_LIB_DIR_OPT_LIST ${OpenCV_3RDPARTY_LIB_DIR_OPT})
-  set(OpenCV_3RDPARTY_LIB_DIR_OPT "")
-  foreach(folderPart ${OpenCV_3RDPARTY_LIB_DIR_OPT_LIST})
-    if(NOT folderPart EQUAL "Release")
-      if(NOT OpenCV_3RDPARTY_LIB_DIR_OPT)
-        if(NOT WIN32)
-          set(folderPart "/${folderPart}")
-        endif()
-        set(OpenCV_3RDPARTY_LIB_DIR_OPT "${folderPart}")
-      else()
-        set(OpenCV_3RDPARTY_LIB_DIR_OPT "${OpenCV_3RDPARTY_LIB_DIR_OPT}/${folderPart}")
-      endif()
-    endif()
-  endforeach()
-  set(OpenCV_3RDPARTY_LIB_DIR_DBG ${OpenCV_3RDPARTY_LIB_DIR_OPT})
+  # remove the Release/Debug in <path>\Release and <path>\Debug
+  # of OpenCV_LIB_DIR_OPT and OpenCV_LIB_DIR_DBG here
+  REMOVE_LAST_PATH_ELEMENT_IF_EQUALS(OpenCV_LIB_DIR_DBG Debug)
+  #message("OpenCV_LIB_DIR_DBG: ${OpenCV_LIB_DIR_DBG}")

+  set(OpenCV_LIB_DIR_OPT ${OpenCV_LIB_DIR_DBG})
   #message("OpenCV_LIB_DIR_OPT: ${OpenCV_LIB_DIR_OPT}")
-  #message("OpenCV_LIB_DIR_DBG: ${OpenCV_LIB_DIR_DBG}")
+
+  REMOVE_LAST_PATH_ELEMENT_IF_EQUALS(OpenCV_3RDPARTY_LIB_DIR_DBG Debug)
   #message("OpenCV_3RDPARTY_LIB_DIR_DBG: ${OpenCV_3RDPARTY_LIB_DIR_DBG}")
+
+  set(OpenCV_3RDPARTY_LIB_DIR_OPT ${OpenCV_3RDPARTY_LIB_DIR_DBG})
   #message("OpenCV_3RDPARTY_LIB_DIR_OPT: ${OpenCV_3RDPARTY_LIB_DIR_OPT}")
-
+
 endif()

 find_package(OpenCV REQUIRED)


Script - added struct and fixed json modules

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "a7b77e897e1967661cd58410316f6f9d1d62246d")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "edbc10f7a3fcbd6d09f93a1805e291c19548b3df")

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


Update FW: - fix for high system load crash, especially on PoE devices - for for OV9282 as MonoCamera on RGB/CAM_A socket

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

 # "full commit hash of device side binary"
-set(DEPTHAI_DEVICE_SIDE_COMMIT "a555263a9dbff1166088bcb758ab4306dca9ae1a")
+set(DEPTHAI_DEVICE_SIDE_COMMIT "c62955ce3e726f06e81eb5b0b868c3cb0866a5bf")

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


Remove sugar_add_ios_arch_library [skip ci]

--- cmake/core/sugar_add_ios_arch_library.cmake
+++ cmake/core/sugar_add_ios_arch_library.cmake
@@ -1,89 +0,0 @@
-# Copyright (c) 2013, Ruslan Baratov
-# All rights reserved.
-
-include(sugar_add_this_to_sourcelist)
-sugar_add_this_to_sourcelist()
-
-include(sugar_improper_number_of_arguments)
-include(sugar_set_xcode_ios_sdkroot)
-include(sugar_test_variable_not_empty)
-
-function(sugar_add_ios_arch_library libname)
-  sugar_improper_number_of_arguments(${ARGC} 0)
-  sugar_improper_number_of_arguments(${ARGC} 1)
-
-  sugar_test_variable_not_empty(SUGAR_IOS_ARCH)
-
-  set(libsources ${ARGV})
-  list(REMOVE_AT libsources 0) # remove libname
-
-  add_library(${libname} ${libsources})
-  sugar_set_xcode_ios_sdkroot(TARGET ${libname})
-  # Build only one architecture
-  set_target_properties(
-      ${libname}
-      PROPERTIES
-      XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH
-      "YES"
-  )
-  # Specify archs
-  set_target_properties(
-      ${libname}
-      PROPERTIES
-      XCODE_ATTRIBUTE_ARCHS
-      "${SUGAR_IOS_ARCH}"
-  )
-  set_target_properties(
-      ${libname}
-      PROPERTIES
-      XCODE_ATTRIBUTE_VALID_ARCHS
-      "${SUGAR_IOS_ARCH}"
-  )
-  set_target_properties(
-      ${libname}
-      PROPERTIES
-      OSX_ARCHITECTURES
-      "${SUGAR_IOS_ARCH}"
-  )
-
-  get_target_property(path_debug ${libname} LOCATION_DEBUG)
-  get_target_property(path_release ${libname} LOCATION_RELEASE)
-
-  string(COMPARE EQUAL "${SUGAR_IOS_ARCH}" "i386" is_i386_simulator)
-  string(COMPARE EQUAL "${SUGAR_IOS_ARCH}" "x86_64" is_x64_simulator)
-
-  if(is_i386_simulator OR is_x64_simulator)
-    set(sdk "iphonesimulator")
-  else()
-    set(sdk "iphoneos")
-  endif()
-
-  string(
-      REGEX
-      REPLACE
-      "/DEBUG/"
-      "/Debug-${sdk}/"
-      path_debug
-      "${path_debug}"
-  )
-
-  string(
-      REGEX
-      REPLACE
-      "/RELEASE/"
-      "/Release-${sdk}/"
-      path_release
-      "${path_release}"
-  )
-
-  set_target_properties(
-      ${libname}
-      PROPERTIES
-      SUGAR_IOS
-      TRUE
-      SUGAR_IOS_PATH_DEBUG
-      "${path_debug}"
-      SUGAR_IOS_PATH_RELEASE
-      "${path_release}"
-  )
-endfunction()


Upgraded the bundled version of Davix.

Upgraded the bundled version of Davix.

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -981,7 +981,7 @@
     if(NOT davix)
       set(davix ON CACHE BOOL "" FORCE)
     endif()
-    set(DAVIX_VERSION 0.3.6)
+    set(DAVIX_VERSION 0.6.2)
     message(STATUS "Downloading and building Davix version ${DAVIX_VERSION}")
     string(REPLACE "-Wall " "" __cxxflags "${CMAKE_CXX_FLAGS}")                      # Otherwise it produces tones of warnings
     string(REPLACE "-W " "" __cxxflags "${__cxxflags}")
@@ -995,7 +995,7 @@
       # http://grid-deployment.web.cern.ch/grid-deployment/dms/lcgutil/tar/davix/davix-embedded-${DAVIX_VERSION}.tar.gz
       URL ${repository_tarfiles}/davix-embedded-${DAVIX_VERSION}.tar.gz
       # Patch need. see https://github.com/cern-it-sdc-id/davix/issues/6
-      PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/cmake/patches/davix-${DAVIX_VERSION}.patch
+      # PATCH_COMMAND patch -p1 -i ${CMAKE_SOURCE_DIR}/cmake/patches/davix-${DAVIX_VERSION}.patch
       CMAKE_CACHE_ARGS -DCMAKE_PREFIX_PATH:STRING=${OPENSSL_PREFIX}
       CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
                  -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
@@ -1009,7 +1009,7 @@
                  -DCMAKE_CXX_FLAGS=${__cxxflags}
                  -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT}
                  -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET}
-                 -DLIB_SUFFIX=""
+                 -DLIB_SUFFIX=
       LOG_BUILD 1 LOG_CONFIGURE 1 LOG_DOWNLOAD 1 LOG_INSTALL 1
     )
     ExternalProject_Get_Property(DAVIX INSTALL_DIR)


Search for VecGeom after Vc and VecCore have been setup in ROOT

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1240,22 +1240,6 @@
   endif()
 endif()

-#---Check for VecGeom--------------------------------------------------------------------
-if (vecgeom)
-  message(STATUS "Looking for VecGeom")
-  find_package(VecGeom ${VecGeom_FIND_VERSION} CONFIG QUIET)
-  if(NOT VecGeom_FOUND )
-    if(fail-on-missing)
-      message(FATAL_ERROR "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH")
-    else()
-      message(STATUS "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH")
-      message(STATUS "              example: CMAKE_PREFIX_PATH=<VecGeom_install_path>/lib/CMake/VecGeom")
-      message(STATUS "              For the time being switching OFF 'vecgeom' option")
-      set(vecgeom OFF CACHE BOOL "" FORCE)
-    endif()
-  endif()
-endif()
-
 #---Check for Vc compatibility-----------------------------------------------------------
 if(vc OR builtin_vc)
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -1502,6 +1486,22 @@
     install(DIRECTORY ${CMAKE_BINARY_DIR}/include/vdt
             DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT extra-headers)
     set(vdt ON CACHE BOOL "" FORCE)
+  endif()
+endif()
+
+#---Check for VecGeom--------------------------------------------------------------------
+if (vecgeom)
+  message(STATUS "Looking for VecGeom")
+  find_package(VecGeom ${VecGeom_FIND_VERSION} CONFIG QUIET)
+  if(NOT VecGeom_FOUND )
+    if(fail-on-missing)
+      message(FATAL_ERROR "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH")
+    else()
+      message(STATUS "VecGeom not found. Ensure that the installation of VecGeom is in the CMAKE_PREFIX_PATH")
+      message(STATUS "              example: CMAKE_PREFIX_PATH=<VecGeom_install_path>/lib/CMake/VecGeom")
+      message(STATUS "              For the time being switching OFF 'vecgeom' option")
+      set(vecgeom OFF CACHE BOOL "" FORCE)
+    endif()
   endif()
 endif()


Minor updates to cmake

Minor updates to cmake

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1487,11 +1487,12 @@
   find_package(MPI)
   if(NOT MPI_FOUND)
     if(fail-on-missing)
-      message(FATAL_ERROR "MPI not found. Ensure that the installation of MPI is in the CMAKE_PREFIX_PATH")
+      message(FATAL_ERROR "MPI not found. Ensure that the installation of MPI is in the CMAKE_PREFIX_PATH."
+        " Example: CMAKE_PREFIX_PATH=<MPI_install_path> (e.g. \"/usr/local/mpich\")")
     else()
       message(STATUS "MPI not found. Ensure that the installation of MPI is in the CMAKE_PREFIX_PATH")
-      message(STATUS "              example: CMAKE_PREFIX_PATH=<MPI_install_path>/lib/CMake/MPI")
-      message(STATUS "              For the time being switching OFF 'mpi' option")
+      message(STATUS "     Example: CMAKE_PREFIX_PATH=<MPI_install_path> (e.g. \"/usr/local/mpich\")")
+      message(STATUS "     For the time being switching OFF 'mpi' option")
       set(mpi OFF CACHE BOOL "Disabled because MPI not found (${mpi_description})" FORCE)
     endif()
   endif()


halide_add_generator_dependency() is broken

It does ‘ar q’ every build, so multiple builds with clean produce an
archive with multiple object files embedded, making for suboptimal
debugging.

Hack fix is to just rm it each time. (There’s probably a better flag to
ar.)

--- test/HalideGenerator.cmake
+++ test/HalideGenerator.cmake
@@ -47,6 +47,7 @@
     add_custom_command(OUTPUT "${FILTER_LIB}" "${FILTER_HDR}"
       DEPENDS "${gen_target}"
       COMMAND "${CMAKE_BINARY_DIR}/bin/${gen_target}${CMAKE_EXECUTABLE_SUFFIX}" "-g" "${gen_name}" "-f" "${func_name}" "-o" "${SCRATCH_DIR}" ${ARGN}
+      COMMAND rm "${FILTER_LIB}"
       COMMAND "${CMAKE_AR}" q "${FILTER_LIB}" "${SCRATCH_DIR}/${func_name}.o"
       WORKING_DIRECTORY "${SCRATCH_DIR}"
       )


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 7364837d56bfdc7c0f69b5c02cebe28dc2dcc16a

--- cmake-modules/FindGFortran.cmake
+++ cmake-modules/FindGFortran.cmake
@@ -1,5 +1,5 @@

-#enable_language(Fortran)
+enable_language(Fortran)

 if(CMAKE_Fortran_COMPILER)
     if(BUILD_SHARED_LIBS)


Add plugin: Add option to specify required plugins

--- cmake/Modules/LibAddPlugin.cmake
+++ cmake/Modules/LibAddPlugin.cmake
@@ -233,12 +233,15 @@
 # TEST_ENVIRONMENT:
 #   Specifies environment variables for the **Markdown Shell Recorder** test
 #
+# TEST_REQUIRED_PLUGINS:
+#   Specifies a list of required plugins for the **Markdown Shell Recorder** test
+#
 function (add_plugin PLUGIN_SHORT_NAME)
 	cmake_parse_arguments (ARG
 		"CPP;ADD_TEST;TEST_README;INSTALL_TEST_DATA" # optional keywords
 		"INCLUDE_SYSTEM_DIRECTORIES" # one value keywords
 		# multi value keywords
-		"SOURCES;LINK_LIBRARIES;COMPILE_DEFINITIONS;INCLUDE_DIRECTORIES;LINK_ELEKTRA;DEPENDS;TEST_ENVIRONMENT"
+		"SOURCES;LINK_LIBRARIES;COMPILE_DEFINITIONS;INCLUDE_DIRECTORIES;LINK_ELEKTRA;DEPENDS;TEST_ENVIRONMENT;TEST_REQUIRED_PLUGINS"
 		${ARGN}
 	)

@@ -255,6 +258,7 @@
 	restore_variable (${PLUGIN_NAME} ARG_ADD_TEST)
 	restore_variable (${PLUGIN_NAME} ARG_TEST_README)
 	restore_variable (${PLUGIN_NAME} ARG_TEST_ENVIRONMENT)
+	restore_variable (${PLUGIN_NAME} ARG_TEST_REQUIRED_PLUGINS)
 	restore_variable (${PLUGIN_NAME} ARG_INSTALL_TEST_DATA)

 	if (ARG_UNPARSED_ARGUMENTS)
@@ -286,7 +290,9 @@
 		endif ()

 		if (ARG_TEST_README)
-			add_msr_test_plugin (${PLUGIN_SHORT_NAME} ENVIRONMENT ${ARG_TEST_ENVIRONMENT})
+			add_msr_test_plugin (${PLUGIN_SHORT_NAME}
+				ENVIRONMENT ${ARG_TEST_ENVIRONMENT}
+				REQUIRED_PLUGINS ${ARG_TEST_REQUIRED_PLUGINS})
 		endif (ARG_TEST_README)

 		return ()


ENH: openssl update

ENH: openssl update

--- cmake/dependencies/openssl.cmake
+++ cmake/dependencies/openssl.cmake
@@ -55,11 +55,11 @@
 		endif()

 		sources_url(OPENSSL
-			"openssl/openssl/openssl-1.1.0c.tar.gz"
-			"https://www.openssl.org/source/openssl-1.1.0c.tar.gz")
+			"openssl/openssl/openssl-1.1.0e.tar.gz"
+			"https://www.openssl.org/source/openssl-1.1.0e.tar.gz")
 		ExternalProject_Add(dependencies_openssl
 			URL ${OPENSSL_URL}
-			URL_HASH SHA256=fc436441a2e05752d31b4e46115eb89709a28aef96d4fe786abe92409b2fd6f5
+			URL_HASH SHA256=57be8618979d80c910728cfc99369bf97b2a1abd8f366ab6ebdee8975ad3874c
 			CONFIGURE_COMMAND ./config --prefix=<INSTALL_DIR> no-shared ${CFG_SUFFIX}
 			INSTALL_DIR "${STAGING_DIR}"
 			BUILD_IN_SOURCE 1


[cmake] Remove redundant call to cmake when building host tools.

Summary:
Remove the redundant, config-time call to cmake when
building host tools for cross compiles or optimized tablegen..

The config-time call to cmake is redundant because it will always get
called again when the CONFIGURE_LLVM_${target_name} target fires at
build-time.  This speeds up initial configuration, but has no affect
on build behavior.

Reviewers: beanz

Reviewed By: beanz

Subscribers: mgorny, llvm-commits

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

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

--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -12,6 +12,14 @@
         CACHE STRING "Toolchain file for ${target_name}")
   endif()

+  if (buildtype)
+    set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
+  endif()
+  if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
+    # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
+    set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
+  endif()
+
   add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}
     COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_${target_name}_BUILD}
     COMMENT "Creating ${LLVM_${target_name}_BUILD}...")
@@ -23,38 +31,14 @@
     COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
         ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
         -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
+        -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
+        ${build_type_flags} ${external_clang_dir}
     WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
     DEPENDS CREATE_LLVM_${target_name}
     COMMENT "Configuring ${target_name} LLVM...")

   add_custom_target(CONFIGURE_LLVM_${target_name}
                     DEPENDS ${LLVM_${target_name}_BUILD}/CMakeCache.txt)
-
-  set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES
-                                      ${LLVM_${target_name}_BUILD})
-
-  if(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})
-
-
-    message(STATUS "Configuring ${target_name} build...")
-    execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory
-      ${LLVM_${target_name}_BUILD} )
-
-    message(STATUS "Configuring ${target_name} targets...")
-    if (buildtype)
-      set(build_type_flags "-DCMAKE_BUILD_TYPE=${buildtype}")
-    endif()
-	if (LLVM_EXTERNAL_CLANG_SOURCE_DIR)
-	  # Propagate LLVM_EXTERNAL_CLANG_SOURCE_DIR so that clang-tblgen can be built
-	  set(external_clang_dir "-DLLVM_EXTERNAL_CLANG_SOURCE_DIR=${LLVM_EXTERNAL_CLANG_SOURCE_DIR}")
-	endif()
-    execute_process(COMMAND ${CMAKE_COMMAND} ${build_type_flags}
-        -G "${CMAKE_GENERATOR}" -DLLVM_TARGETS_TO_BUILD=${LLVM_TARGETS_TO_BUILD}
-        ${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
-        -DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
-        ${external_clang_dir}
-      WORKING_DIRECTORY ${LLVM_${target_name}_BUILD} )
-  endif(NOT IS_DIRECTORY ${LLVM_${target_name}_BUILD})

 endfunction()


build: pass `-target` to the driver when linking

This allows us to crosslink when building with CMake.

--- cmake/modules/SwiftSupport.cmake
+++ cmake/modules/SwiftSupport.cmake
@@ -8,34 +8,35 @@

   cmake_parse_arguments(AST "${options}" "${single_value_options}" "${multiple_value_options}" ${ARGN})

-  set(flags ${CMAKE_SWIFT_FLAGS})
+  set(compile_flags ${CMAKE_SWIFT_FLAGS})
   set(link_flags)

   if(AST_TARGET)
-    list(APPEND flags -target;${AST_TARGET})
+    list(APPEND compile_flags -target;${AST_TARGET})
+    list(APPEND link_flags -target;${AST_TARGET})
   endif()
   if(AST_MODULE_NAME)
-    list(APPEND flags -module-name;${AST_MODULE_NAME})
+    list(APPEND compile_flags -module-name;${AST_MODULE_NAME})
   else()
-    list(APPEND flags -module-name;${target})
+    list(APPEND compile_flags -module-name;${target})
   endif()
   if(AST_MODULE_LINK_NAME)
-    list(APPEND flags -module-link-name;${AST_MODULE_LINK_NAME})
+    list(APPEND compile_flags -module-link-name;${AST_MODULE_LINK_NAME})
   endif()
   if(AST_MODULE_CACHE_PATH)
-    list(APPEND flags -module-cache-path;${AST_MODULE_CACHE_PATH})
+    list(APPEND compile_flags -module-cache-path;${AST_MODULE_CACHE_PATH})
   endif()
   if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
-    list(APPEND flags -g)
+    list(APPEND compile_flags -g)
   endif()
   if(AST_SWIFT_FLAGS)
     foreach(flag ${AST_SWIFT_FLAGS})
-      list(APPEND flags ${flag})
+      list(APPEND compile_flags ${flag})
     endforeach()
   endif()
   if(AST_CFLAGS)
     foreach(flag ${AST_CFLAGS})
-      list(APPEND flags -Xcc;${flag})
+      list(APPEND compile_flags -Xcc;${flag})
     endforeach()
   endif()
   if(AST_LINK_FLAGS)
@@ -83,7 +84,7 @@
                          ${source}
                          ${AST_DEPENDS}
                        COMMAND
-                         ${CMAKE_SWIFT_COMPILER} -frontend ${flags} -emit-module-path ${mod} -emit-module-doc-path ${doc} -o ${obj} -c ${all_sources})
+                         ${CMAKE_SWIFT_COMPILER} -frontend ${compile_flags} -emit-module-path ${mod} -emit-module-doc-path ${doc} -o ${obj} -c ${all_sources})

     list(APPEND objs ${obj})
     list(APPEND mods ${mod})
@@ -106,7 +107,7 @@
                          ${docs}
                          ${AST_DEPENDS}
                        COMMAND
-                         ${CMAKE_SWIFT_COMPILER} -frontend ${flags} -sil-merge-partial-modules -emit-module ${mods} -o ${module} -emit-module-doc-path ${documentation})
+                         ${CMAKE_SWIFT_COMPILER} -frontend ${compile_flags} -sil-merge-partial-modules -emit-module ${mods} -o ${module} -emit-module-doc-path ${documentation})
   endif()

   if(AST_LIBRARY)


Tidy up indentation.

Tidy up indentation.

--- cmake_modules/IMPFindC++11.cmake
+++ cmake_modules/IMPFindC++11.cmake
@@ -1,5 +1,5 @@
 if(NOT DEFINED IMP_CXX11)
-set(IMP_CXX11 1 CACHE BOOL "Whether to use C++11 if possible")
+  set(IMP_CXX11 1 CACHE BOOL "Whether to use C++11 if possible")
 endif()

 # Put flags in a cmake variable so we can set them before running compiler
@@ -7,36 +7,36 @@
 set(IMP_CXX11_FLAGS "" CACHE INTERNAL "Flags to enable C++11 support" FORCE)

 if(IMP_CXX11)
-if (APPLE)
-  execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION)
-  string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
-endif()
+  if (APPLE)
+    execute_process(COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION)
+    string(REGEX MATCH "[0-9]+" DARWIN_VERSION ${DARWIN_VERSION})
+  endif()

-if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
-execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE
-		        GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
-message(STATUS "GCC version: ${GCC_VERSION}")
-if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
-message(STATUS "Enabling g++ C++11 support")
-set(IMP_CXX11_FLAGS "--std=c++11" CACHE INTERNAL "" FORCE)
-elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
-message(STATUS "Enabling g++ C++0x support")
-set(IMP_CXX11_FLAGS "--std=c++0x" CACHE INTERNAL "" FORCE)
-endif()
-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  # c++11's std::move (which boost/CGAL use) doesn't work until
-  # OS X 10.9 (Darwin version 13)
-  if(APPLE AND DARWIN_VERSION LESS 13)
-    message(STATUS "Disabling C++11 for mac os < 10.9")
-  elseif(BOOST_VERSION LESS 105000)
-    message(STATUS "Disabling C++11 due to clang and older boost")
+  if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+    execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE
+                            GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+    message(STATUS "GCC version: ${GCC_VERSION}")
+    if (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7)
+      message(STATUS "Enabling g++ C++11 support")
+      set(IMP_CXX11_FLAGS "--std=c++11" CACHE INTERNAL "" FORCE)
+    elseif (GCC_VERSION VERSION_GREATER 4.3 OR GCC_VERSION VERSION_EQUAL 4.3)
+      message(STATUS "Enabling g++ C++0x support")
+      set(IMP_CXX11_FLAGS "--std=c++0x" CACHE INTERNAL "" FORCE)
+    endif()
+  elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+    # c++11's std::move (which boost/CGAL use) doesn't work until
+    # OS X 10.9 (Darwin version 13)
+    if(APPLE AND DARWIN_VERSION LESS 13)
+      message(STATUS "Disabling C++11 for mac os < 10.9")
+    elseif(BOOST_VERSION LESS 105000)
+      message(STATUS "Disabling C++11 due to clang and older boost")
+    else()
+      message(STATUS "Enabling clang C++11 support")
+      set(IMP_CXX11_FLAGS "--std=c++11" CACHE INTERNAL "" FORCE)
+    endif()
   else()
-    message(STATUS "Enabling clang C++11 support")
-    set(IMP_CXX11_FLAGS "--std=c++11" CACHE INTERNAL "" FORCE)
+    message(STATUS "Unknown compiler, not sure what to do about C++11")
   endif()
-else()
-  message(STATUS "Unknown compiler, not sure what to do about C++11")
-endif()
 endif()

 if(IMP_CXX11_FLAGS)


CompileOptions.cmake: remove clang/stdlib code

with clang 9, it compiles out of the box, and this block wrongly did set clang to use gcc libstdc++

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -190,29 +190,6 @@
   build_string("EXTRA_FLAGS" "${WFLAGS_STR}")
 endif()

-# Add -stdlib=libc++ when using Clang if possible
-if(NOT OPTION_NO_AUTO_LIBCPP AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-  set(CXXFLAGS_BACKUP "${CMAKE_CXX_FLAGS}")
-  set(CMAKE_EXE_LINKER_FLAGS_BACKUP "${CMAKE_EXE_LINKER_FLAGS}")
-  set(CMAKE_CXX_FLAGS "-std=c++1y -stdlib=libc++")
-  set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-lstdc++")
-  try_run(ProgramResult
-          CompilationSucceeded
-          "${CMAKE_CURRENT_BINARY_DIR}"
-          "${CMAKE_MODULE_PATH}/get_compiler_version.cpp"
-          RUN_OUTPUT_VARIABLE CompilerVersion)
-  if(NOT CompilationSucceeded OR NOT ProgramResult EQUAL 0)
-    message(STATUS "Use clang with GCC' libstdc++")
-  else()
-    message(STATUS "Automatically added '-stdlib=libc++' flag "
-                   "(OPTION_NO_AUTO_LIBCPP not defined)")
-    set(EXTRA_FLAGS "${EXTRA_FLAGS} -stdlib=libc++")
-    set(EXTRA_LINKER_FLAGS "-lstdc++")
-  endif()
-  # Restore CXX flags
-  set(CMAKE_CXX_FLAGS "${CXXFLAGS_BACKUP}")
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_BACKUP}")
-endif()

 # Allow unused private fields when using clang
 if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")


CompileOptions.cmake: do not override CMAKE_CXX_FLAGS_DEBUG & co

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -233,22 +233,23 @@
   set(CMAKE_CXX_FLAGS                   "${CMAKE_CXX_FLAGS} ${WFLAGS}")
 endif()

-# Check if the user provided CXXFLAGS, set defaults otherwise
 if(NOT CMAKE_CXX_FLAGS)
   set(CMAKE_CXX_FLAGS                   "-Wextra -Wall -pedantic ${EXTRA_FLAGS}")
 endif()
-if(NOT CMAKE_CXX_FLAGS_DEBUG)
-  set(CMAKE_CXX_FLAGS_DEBUG             "-O0 -g")
-endif()
-if(NOT CMAKE_CXX_FLAGS_MINSIZEREL)
-  set(CMAKE_CXX_FLAGS_MINSIZEREL        "-Os")
-endif()
-if(NOT CMAKE_CXX_FLAGS_RELEASE)
-  set(CMAKE_CXX_FLAGS_RELEASE           "-O3 -DNDEBUG")
-endif()
-if(NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO)
-  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO    "-O2 -g")
-endif()
+
+# Check if the user provided CXXFLAGS, set defaults otherwise
+#if(NOT CMAKE_CXX_FLAGS_DEBUG)
+#  set(CMAKE_CXX_FLAGS_DEBUG             "-O0 -g")
+#endif()
+#if(NOT CMAKE_CXX_FLAGS_MINSIZEREL)
+#  set(CMAKE_CXX_FLAGS_MINSIZEREL        "-Os")
+#endif()
+#if(NOT CMAKE_CXX_FLAGS_RELEASE)
+#  set(CMAKE_CXX_FLAGS_RELEASE           "-O3 -DNDEBUG")
+#endif()
+#if(NOT CMAKE_CXX_FLAGS_RELWITHDEBINFO)
+#  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO    "-O2 -g")
+#endif()

 if (EXTRA_LINKER_FLAGS)
   if(NOT CMAKE_EXE_LINKER_FLAGS)


Update InstallPackage.cmake from h5pp

Update InstallPackage.cmake from h5pp

--- cmake/InstallPackage.cmake
+++ cmake/InstallPackage.cmake
@@ -103,16 +103,17 @@
         set(COMPONENTS COMPONENTS)
     endif()
     if(PKG_LINK_TYPE)
-        set(pkg_link ${PKG_LINK_TYPE})
+        set(pkg_link_type ${PKG_LINK_TYPE})
     elseif(BUILD_SHARED_LIBS)
-        set(pkg_link shared)
-    else()
-        set(pkg_link static)
-    endif()
+        set(pkg_link_type shared)
+    else()
+        set(pkg_link_type static)
+    endif()
+

     if(NOT PKG_TARGET_NAME)
         foreach(tgt ${PKG_TARGET_HINTS})
-            list(APPEND PKG_TARGET_HINTS_LINK_TYPE ${tgt}-${pkg_link})
+            list(APPEND PKG_TARGET_HINTS_LINK_TYPE ${tgt}-${pkg_link_type})
         endforeach()

         list(APPEND PKG_TARGET_HINTS
@@ -121,10 +122,10 @@
                 ${pkg_find_name}::${pkg_find_name}
                 ${pkg_name}
                 ${pkg_find_name}
-                ${pkg_name}::${pkg_name}-${pkg_link}
-                ${pkg_find_name}::${pkg_find_name}-${pkg_link}
-                ${pkg_name}-${pkg_link}
-                ${pkg_find_name}-${pkg_link}
+                ${pkg_name}::${pkg_name}-${pkg_link_type}
+                ${pkg_find_name}::${pkg_find_name}-${pkg_link_type}
+                ${pkg_name}-${pkg_link_type}
+                ${pkg_find_name}-${pkg_link_type}
                 ${PKG_TARGET_HINTS_LINK_TYPE}
                 )
     endif()
@@ -155,7 +156,11 @@
     if(PKG_LIBRARY_NAMES)
         # This attempts to find <PackageName>_LIBRARY with given names before calling find_package
         # This is necessary for ZLIB
-        pkg_message(DEBUG "Looking for library names ${PKG_LIBRARY_NAMES}")
+        if(pkg_link_type MATCHES "static|STATIC|Static")
+            set(pkg_link_type_msg ${pkg_link_type})
+            set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
+        endif()
+        pkg_message(DEBUG "Looking for ${pkg_link_type_msg} library names ${PKG_LIBRARY_NAMES}")
         find_library(${pkg_find_name}_LIBRARY
                 NAMES ${PKG_LIBRARY_NAMES}
                 HINTS ${pkg_install_dir} ${${pkg_find_name}_ROOT} ${${pkg_name}_ROOT}
@@ -189,29 +194,19 @@
     # Set _FOUND variables for alternate names and components
     if(NOT ${pkg_name}_FOUND)
         if(${pkg_find_name}_FOUND)
-            set(${pkg_name}_FOUND TRUE PARENT_SCOPE)
+            pkg_set(${pkg_name}_FOUND TRUE)
         else()
             # Some packages, such as SZIP, may only set each components as found but not the package itself,
             # with variables like SZIP_shared_FOUND and so on
             foreach(comp ${COMPONENTS})
                 if(${pkg_name}_${comp}_FOUND)
-                    set(${pkg_name}_FOUND TRUE PARENT_SCOPE)
+                    pkg_set(${pkg_name}_FOUND TRUE)
                 endif()
             endforeach()
         endif()
     endif()
     # Check if the package was found
     if(${pkg_name}_FOUND)
-        if(PKG_DEPENDS)
-            target_link_libraries(${pkg_target_name} INTERFACE ${PKG_DEPENDS})
-        endif()
-        if(PKG_CHECK)
-            check_compile(${pkg_name} ${pkg_target_name} ${PROJECT_SOURCE_DIR}/cmake/compile/${pkg_name}.cpp)
-            if(PKG_DEBUG AND NOT check_compile_${pkg_name} AND EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
-                file(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log" ERROR_LOG)
-                pkg_message(STATUS "CMakeError.log: \n ${ERROR_LOG}")
-            endif()
-        endif()
         foreach(tgt ${PKG_TARGET_HINTS})
             if(TARGET ${tgt})
                 pkg_set(${pkg_name}_FOUND TRUE)
@@ -230,6 +225,16 @@
             pkg_message(VERBOSE "Found ${pkg_name}: [${PKG_${pkg_name}_TARGET}]")
         else()
             pkg_message(WARNING "Found ${pkg_name} but no target matches the hint list: [${PKG_TARGET_HINTS}]")
+        endif()
+        if(PKG_DEPENDS)
+            target_link_libraries(${PKG_${pkg_name}_TARGET} INTERFACE ${PKG_DEPENDS})
+        endif()
+        if(PKG_CHECK)
+            check_compile(${pkg_name} ${PKG_${pkg_name}_TARGET} ${PROJECT_SOURCE_DIR}/cmake/compile/${pkg_name}.cpp)
+            if(PKG_DEBUG AND NOT check_compile_${pkg_name} AND EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
+                file(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log" ERROR_LOG)
+                pkg_message(STATUS "CMakeError.log: \n ${ERROR_LOG}")
+            endif()
         endif()
         return()
     endif()
@@ -335,28 +340,15 @@
                 )
         find_package(${pkg_find_name} ${PKG_VERSION} ${COMPONENTS} ${PKG_COMPONENTS} ${QUIET} REQUIRED)
     endif()
-
     if(PKG_MODULE)
         find_package(${pkg_find_name} ${PKG_VERSION} ${COMPONENTS} ${PKG_COMPONENTS} ${QUIET} REQUIRED)
     else()
-        set(HDF5_FIND_DEBUG ON)
         find_package(${pkg_find_name} ${PKG_VERSION}
                 HINTS ${pkg_install_dir}
                 PATH_SUFFIXES ${PKG_PATH_SUFFIXES}
                 ${COMPONENTS} ${PKG_COMPONENTS}
                 ${CONFIG} ${QUIET}
                 NO_DEFAULT_PATH REQUIRED)
-    endif()
-
-    if(PKG_DEPENDS)
-        target_link_libraries(${pkg_target_name} INTERFACE ${PKG_DEPENDS})
-    endif()
-    if(PKG_CHECK)
-        check_compile(${pkg_name} ${pkg_target_name} ${PROJECT_SOURCE_DIR}/cmake/compile/${pkg_name}.cpp)
-        if(PKG_DEBUG AND NOT check_compile_${pkg_name} AND EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
-            file(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log" ERROR_LOG)
-            pkg_message(STATUS "CMakeError.log: \n ${ERROR_LOG}")
-        endif()
     endif()
     foreach(tgt ${PKG_TARGET_HINTS})
         if(TARGET ${tgt})
@@ -377,5 +369,16 @@
     else()
         pkg_message(WARNING "Found ${pkg_name} but no target matches hint list:\n [${PKG_TARGET_HINTS}]")
     endif()
+    if(PKG_DEPENDS)
+        target_link_libraries(${PKG_${pkg_name}_TARGET} INTERFACE ${PKG_DEPENDS})
+    endif()
+    if(PKG_CHECK)
+        check_compile(${pkg_name} ${PKG_${pkg_name}_TARGET} ${PROJECT_SOURCE_DIR}/cmake/compile/${pkg_name}.cpp)
+        if(PKG_DEBUG AND NOT check_compile_${pkg_name} AND EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log")
+            file(READ "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log" ERROR_LOG)
+            pkg_message(STATUS "CMakeError.log: \n ${ERROR_LOG}")
+        endif()
+    endif()
+
 endfunction()


build_system: ignore old style casts on macOS

Otherwise, strange enough, we get a warning for tinyxml2.h even though
the include should be flagged as SYSTEM.

--- cmake/compiler_flags.cmake
+++ cmake/compiler_flags.cmake
@@ -31,9 +31,11 @@
     endif()
 endif()

-# We need a define if on APPLE
 if(APPLE)
+    # We need a define if on APPLE
     add_definitions("-DAPPLE")
+    # Otherwise tinyxml2 complains.
+    set(warnings "-Wno-old-style-cast")
 endif()

 # Add DEBUG define for Debug target


Update expat build rules

Update expat build rules

--- cmake/external/expat.cmake
+++ cmake/external/expat.cmake
@@ -38,11 +38,12 @@
     UPDATE_COMMAND ""
     CONFIGURE_COMMAND cd ${EXPAT_SRC_DIR} && ./buildconf.sh  && ./configure
                                                     --prefix=${EXPAT_INSTALL_DIR}
+                                                    --without-xmlwf
                                                     CC=${CMAKE_C_COMPILER}
                                                     CXX=${CMAKE_CXX_COMPILER}
                                                     "CFLAGS=${EXPAT_CFLAGS} -w -DXML_POOR_ENTROPY"
                                                     "CXXFLAGS=${EXPAT_CXXFLAGS} -w -DXML_POOR_ENTROPY"
-    BUILD_COMMAND cd ${EXPAT_SRC_DIR} &&  make -j ${CPU_COUNT} buildlib
-    INSTALL_COMMAND cd ${EXPAT_SRC_DIR} &&  make installlib
+    BUILD_COMMAND cd ${EXPAT_SRC_DIR} &&  make -j ${CPU_COUNT}
+    INSTALL_COMMAND cd ${EXPAT_SRC_DIR} &&  make install
     BUILD_BYPRODUCTS ${EXPAT_BUILD_BYPRODUCTS}
 )


Attempt to fix RPM support-files directory.

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -114,7 +114,7 @@
 SET(INSTALL_MYSQLTESTDIR_RPM "mysql-test")
 SET(INSTALL_SQLBENCHROOTDIR_RPM "")
 SET(INSTALL_DOCREADMEDIR_RPM "share/mysql/doc/MySQL-server-${MYSQL_NO_DASH_VERSION}")
-SET(INSTALL_SUPPORTFILESDIR_RPM "")
+SET(INSTALL_SUPPORTFILESDIR_RPM "share/mysql")
 SET(INSTALL_MYSQLDATADIR_RPM "var")

 # SVR4 layout


update(cmake/modules): bump driver version to 96bd9bc560f67742738eb7255aeb4d03046b8045

This driver version contains a fix for kernels < 3.17

Co-authored-by: Lorenzo Fontana <638e8f0171575864326f06d2a5f8e72287427b15@linux.com>
Signed-off-by: Leonardo Di Donato <2012e0ca99d70aa6c893822ff73002216e5dba72@gmail.com>

--- cmake/modules/sysdig.cmake
+++ cmake/modules/sysdig.cmake
@@ -26,8 +26,8 @@
 # To update sysdig version for the next release, change the default below
 # In case you want to test against another sysdig version just pass the variable - ie., `cmake -DSYSDIG_VERSION=dev ..`
 if(NOT SYSDIG_VERSION)
-  set(SYSDIG_VERSION "47374b2b73734d509f3c99890c80be5242021c3d")
-  set(SYSDIG_CHECKSUM "SHA256=df73b5c69eca8880e30c618dc47b995140286b47fa845c97a3d7a6ddb2d6f1b1")
+  set(SYSDIG_VERSION "96bd9bc560f67742738eb7255aeb4d03046b8045")
+  set(SYSDIG_CHECKSUM "SHA256=766e8952a36a4198fd976b9d848523e6abe4336612188e4fc911e217d8e8a00d")
 endif()
 set(PROBE_VERSION "${SYSDIG_VERSION}")


tests are always built when being enabled

--- ament_cmake_gtest/cmake/ament_add_gtest.cmake
+++ ament_cmake_gtest/cmake/ament_add_gtest.cmake
@@ -4,8 +4,8 @@
 #
 # Add a gtest.
 #
-# Call add_executable(target EXCLUDE_FROM_ALL ARGN), link it against
-# the gtest library and register the executable as a test.
+# Call add_executable(target ARGN), link it against the gtest library
+# and register the executable as a test.
 #
 # :param target: the target name which will also be used as the test name
 # :type target: string
@@ -32,7 +32,8 @@
     message(FATAL_ERROR "ament_add_gtest() must be invoked with at least one source file")
   endif()

-  add_executable("${target}" EXCLUDE_FROM_ALL ${ARG_UNPARSED_ARGUMENTS})
+  # should be EXCLUDE_FROM_ALL if it would be possible to add this target as a dependency to the "test" target
+  add_executable("${target}" ${ARG_UNPARSED_ARGUMENTS})
   target_link_libraries("${target}" gtest)

   get_target_property(target_path "${target}" RUNTIME_OUTPUT_DIRECTORY)
@@ -53,4 +54,8 @@
     ${ARG_TIMEOUT}
     ${ARG_WORKING_DIRECTORY}
   )
+  set_tests_properties(
+    "${target}"
+    PROPERTIES REQUIRED_FILES "${target_path}/${target}"
+  )
 endfunction()


cmake: drop NO_DEFAULT_PATHS when searching libraries

It looks like pkg-config silently drops -I and -L flags pointing to
default directories:

```
$ cat /usr/lib/pkgconfig/capnp.pc
prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: Cap'n Proto
Description: Insanely fast serialization system
Version: 0.7-dev
Libs: -L${libdir} -lcapnp -pthread  -lpthread
Libs.private:  -lpthread
Requires: kj = 0.7-dev
Cflags: -I${includedir} -pthread

$ pkg-config --libs capnp
-lcapnp -pthread -lpthread -lkj -pthread -lpthread
```

Ideally, however, we should use FindPkgConfig.cmake's own facilities
to generate IMPORTED targets from pkg-config files.

--- c++/cmake/CapnProtoTargets.cmake
+++ c++/cmake/CapnProtoTargets.cmake
@@ -86,7 +86,6 @@
   find_library(CapnProto_${target}_IMPORTED_LOCATION
     NAMES ${target_name_shared} ${target_name_static}  # prefer libfoo-version.so over libfoo.a
     PATHS ${${target}_LIBRARY_DIRS}
-    NO_DEFAULT_PATH
   )
   if(NOT CapnProto_${target}_IMPORTED_LOCATION)
     # Not an error if the library doesn't exist -- we may have found a lite mode installation.


Add WITH_GSSAPI config option, defaults to OFF

--- cmake/ConfigOptions.cmake
+++ cmake/ConfigOptions.cmake
@@ -136,6 +136,7 @@
 option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF)
 option(WITH_CCACHE "Use ccache support if available" ON)
 option(WITH_ICU "Use ICU for unicode conversion" OFF)
+option(WITH_GSSAPI "Compile support for kerberos authentication. (EXPERIMENTAL)" OFF)

 option(WITH_DSP_EXPERIMENTAL "Enable experimental sound encoder/decoder formats" OFF)
 if (WITH_FFMPEG)


fix license / readme filenames

fix license / readme filenames

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


Minor update to LibSMV cmake

Minor update to LibSMV cmake

--- cmake/ThirdPartySMV.cmake
+++ cmake/ThirdPartySMV.cmake
@@ -12,12 +12,19 @@
           -DCMAKE_INSTALL_PREFIX:PATH=${TPSRC}/dist ${TPSRC}/src/libsmvf1.0
         INSTALL_COMMAND echo "LibSMV compiled successfully"
     )
-    SET(SMV sbtk CACHE FILEPATH "Path to LibSMV." FORCE)
+    SET(SMV smv CACHE FILEPATH "Path to LibSMV." FORCE)
+
     MARK_AS_ADVANCED(SMV)
     LINK_DIRECTORIES(${TPSRC}/dist/lib)
+    MESSAGE(STATUS "Build LibSMV: ${TPSRC}/dist/lib/lib${SMV}.a")
+    SET(NEKTAR_USING_SMV TRUE)
+    ADD_DEFINITIONS(-DNEKTAR_USING_SMV)
 ELSE (THIRDPARTY_BUILD_SMV)
     IF (NEKTAR_USE_SMV)
         INCLUDE(FindSMV)
+        IF (SMV_FOUND)
+            MESSAGE(STATUS "Found LibSMV: ${SMV_LIBRARY}")
+        ENDIF(SMV_FOUND)
     ENDIF (NEKTAR_USE_SMV)
 ENDIF (THIRDPARTY_BUILD_SMV)


fixup! tests: samples: Split checking code in its own file

--- test/samples/samples.cmake
+++ test/samples/samples.cmake
@@ -1,5 +1,6 @@
 list(APPEND SAMPLE_TEST_SRCS
     samples/main.cpp
+    samples/Tester.cpp
 )

 add_executable(samples ${SAMPLE_TEST_SRCS})


Fixed a nasty bug in link line construction and added an interlock to prevent trying to build static executables and shared libs at the same time

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -213,7 +213,7 @@
     list(REVERSE ${_prefix}_LIBRARIES)
     #list(REMOVE_DUPLICATES ${_prefix}_LIBRARIES)
     _rosbuild_list_remove_duplicates("${${_prefix}_LIBRARIES}" _tmplist)
-    set(${_prefix}_LIBRARIES ${__tmplist})
+    set(${_prefix}_LIBRARIES ${_tmplist})
     list(REVERSE ${_prefix}_LIBRARIES)

     # Also throw in the libs that we want to link everything against (only
@@ -483,6 +483,11 @@
   if(NOT ROS_BUILD_STATIC_LIBS AND NOT ROS_BUILD_SHARED_LIBS)
     message(FATAL_ERROR "Neither shared nor static libraries are enabled.  Please set either ROS_BUILD_STATIC_LIBS or ROS_BUILD_SHARED_LIBS to true in your $ROS_ROOT/rosconfig.cmake")
   endif(NOT ROS_BUILD_STATIC_LIBS AND NOT ROS_BUILD_SHARED_LIBS)
+  # Sanity check; it's too hard to support building shared libs and static
+  # executables.
+  if(ROS_BUILD_STATIC_EXES AND ROS_BUILD_SHARED_LIBS)
+    message(FATAL_ERROR "Static executables are requested, but so are shared libs. This configuration is unsupported.  Please either set ROS_BUILD_SHARED_LIBS to false or set ROS_BUILD_STATIC_EXES to false.")
+  endif(ROS_BUILD_STATIC_EXES AND ROS_BUILD_SHARED_LIBS)

   # What are we building?
   if(ROS_BUILD_SHARED_LIBS)


add argument to invocation to get returncode 0 for both connext 5.2.4 and 5.3.0 (#253)

--- connext_cmake_module/cmake/Modules/FindConnext.cmake
+++ connext_cmake_module/cmake/Modules/FindConnext.cmake
@@ -327,7 +327,7 @@
 if(Connext_DDSGEN_SERVER)
   # check that the generator is invocable / finds a Java runtime environment
   execute_process(
-    COMMAND "${Connext_DDSGEN_SERVER}"
+    COMMAND "${Connext_DDSGEN_SERVER}" "-version"
     RESULT_VARIABLE _retcode
     OUTPUT_QUIET ERROR_QUIET)
   if(NOT _retcode EQUAL 0)


noasneeded

noasneeded

Former-commit-id: 281f8b52b751693e33ab4b9870f2e74e735a7dbe

--- cmake-modules/Find_dont_install_INTELMKL.cmake
+++ cmake-modules/Find_dont_install_INTELMKL.cmake
@@ -48,7 +48,7 @@
         #This doesn't seem to work,  The gnu fortran GF_LP library doesn't get enabled --> arpack++ complains!
         set(MKL_LIBRARIES -Wl,--no-as-needed ${MKL_RT_LIBRARY} -Wl,--as-needed  )
     else()
-        set(MKL_LIBRARIES ${MKL_BLAS_LP_LIBRARY} ${MKL_LAPACK_LP_LIBRARY}   -Wl,--start-group  ${MKL_GF_LP_LIBRARY})
+        set(MKL_LIBRARIES  -Wl,--no-as-needed ${MKL_BLAS_LP_LIBRARY} ${MKL_LAPACK_LP_LIBRARY}   -Wl,--start-group  ${MKL_GF_LP_LIBRARY})

         if(MKL_MULTI_THREADED)
             list(APPEND MKL_LIBRARIES  ${MKL_GNUTHREAD_LIBRARY} ${MKL_INTELTHREAD_LIBRARY} ${MKL_CORE_LIBRARY} -Wl,--end-group)
@@ -58,7 +58,7 @@
                 list(APPEND MKL_LIBRARIES ${OpenMP_LIBRARIES})
             endif()
         else()
-            list(APPEND MKL_LIBRARIES  ${MKL_SEQUENTIAL_LIBRARY}  ${MKL_CORE_LIBRARY}  -Wl,--end-group )
+            list(APPEND MKL_LIBRARIES  ${MKL_SEQUENTIAL_LIBRARY}  ${MKL_CORE_LIBRARY}  -Wl,--end-group -Wl,--as-needed )
         endif()
     endif()


Remove unnecesary boost_filesystem library.

--- bin/dsn.cmake
+++ bin/dsn.cmake
@@ -367,7 +367,6 @@
 function(dsn_setup_packages)
     set(DSN_BOOST_PACKAGES
         system
-        filesystem
         )
     set(DSN_BOOST_LIBS "")
     ms_setup_boost(TRUE "${DSN_BOOST_PACKAGES}" DSN_BOOST_LIBS)


+ fixes #0001872: HAVE_CONFIG_H regression

--- cMake/FindOpenCasCade.cmake
+++ cMake/FindOpenCasCade.cmake
@@ -19,7 +19,8 @@
 find_package(OCE QUIET)
 if(OCE_FOUND)
   message(STATUS "-- OpenCASCADE Community Edition has been found.")
-  add_definitions (-DHAVE_CONFIG_H)
+  # Disable this define. For more details see bug #0001872
+  #add_definitions (-DHAVE_CONFIG_H)
   set(OCC_INCLUDE_DIR ${OCE_INCLUDE_DIRS})
   #set(OCC_LIBRARY_DIR ${OCE_LIBRARY_DIR})
 else(OCE_FOUND) #look for OpenCASCADE


Deb package build fix for CUDA 6.5 and newer.

(cherry picked from commit e650d87e470b2e6a8f87ad4dd81977748a136aee)
(cherry picked from commit ca9c52ac9778d01eba933a786b4303c79d0162be)

Conflicts:
	cmake/OpenCVPackaging.cmake

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -78,8 +78,22 @@

 if(HAVE_CUDA)
   string(REPLACE "." "-" cuda_version_suffix ${CUDA_VERSION})
-  set(CPACK_DEB_LIBS_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
-  set(CPACK_DEB_DEV_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
+  if(${CUDA_VERSION} VERSION_LESS "6.5")
+    set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-core-libs-${cuda_version_suffix}, cuda-extra-libs-${cuda_version_suffix}")
+    set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-headers-${cuda_version_suffix}")
+  else()
+    set(CPACK_DEB_libs_PACKAGE_DEPENDS "cuda-cudart-${cuda_version_suffix}, cuda-npp-${cuda_version_suffix}")
+    set(CPACK_DEB_dev_PACKAGE_DEPENDS "cuda-cudart-dev-${cuda_version_suffix}, cuda-npp-dev-${cuda_version_suffix}")
+    if(HAVE_CUFFT)
+      set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cufft-${cuda_version_suffix}")
+      set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cufft-dev-${cuda_version_suffix}")
+    endif()
+    if(HAVE_HAVE_CUBLAS)
+      set(CPACK_DEB_libs_PACKAGE_DEPENDS "${CPACK_DEB_libs_PACKAGE_DEPENDS}, cuda-cublas-${cuda_version_suffix}")
+      set(CPACK_DEB_dev_PACKAGE_DEPENDS "${CPACK_DEB_dev_PACKAGE_DEPENDS}, cuda-cublas-dev-${cuda_version_suffix}")
+    endif()
+  endif()
+  set(CPACK_COMPONENT_dev_DEPENDS libs)
 endif()

 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)


Debian package names replaced by lower case version to satisfy lintian.

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -97,31 +97,31 @@
 endif()

 if(NOT OPENCV_CUSTOM_PACKAGE_INFO)
-  set(CPACK_COMPONENT_libs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}")
+  set(CPACK_COMPONENT_libs_DISPLAY_NAME "libopencv")
   set(CPACK_COMPONENT_libs_DESCRIPTION "Open Computer Vision Library")
   set(CPACK_COMPONENT_libs_SECTION "libs")

-  set(CPACK_COMPONENT_python_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-python")
+  set(CPACK_COMPONENT_python_DISPLAY_NAME "libopencv-python")
   set(CPACK_COMPONENT_python_DESCRIPTION "Python bindings for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_python_SECTION "python")

-  set(CPACK_COMPONENT_java_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-java")
+  set(CPACK_COMPONENT_java_DISPLAY_NAME "libopencv-java")
   set(CPACK_COMPONENT_java_DESCRIPTION "Java bindings for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_java_SECTION "java")

-  set(CPACK_COMPONENT_dev_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-dev")
+  set(CPACK_COMPONENT_dev_DISPLAY_NAME "libopencv-dev")
   set(CPACK_COMPONENT_dev_DESCRIPTION "Development files for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_dev_SECTION "libdevel")

-  set(CPACK_COMPONENT_docs_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-docs")
+  set(CPACK_COMPONENT_docs_DISPLAY_NAME "libopencv-docs")
   set(CPACK_COMPONENT_docs_DESCRIPTION "Documentation for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_docs_SECTION "doc")

-  set(CPACK_COMPONENT_samples_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-samples")
+  set(CPACK_COMPONENT_samples_DISPLAY_NAME "libopencv-samples")
   set(CPACK_COMPONENT_samples_DESCRIPTION "Samples for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_samples_SECTION "devel")

-  set(CPACK_COMPONENT_tests_DISPLAY_NAME "lib${CMAKE_PROJECT_NAME}-tests")
+  set(CPACK_COMPONENT_tests_DISPLAY_NAME "libopencv-tests")
   set(CPACK_COMPONENT_tests_DESCRIPTION "Accuracy and performance tests for Open Source Computer Vision Library")
   set(CPACK_COMPONENT_tests_SECTION "misc")
 endif(NOT OPENCV_CUSTOM_PACKAGE_INFO)
@@ -148,20 +148,18 @@
   set(CHANGELOG_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
   set(ALL_COMPONENTS "libs" "dev" "docs" "python" "java" "samples")
   foreach (comp ${ALL_COMPONENTS})
-    if(CPACK_${comp}_COMPONENT_INSTALL)
-      set(DEBIAN_CHANGELOG_OUT_FILE    "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian")
-      set(DEBIAN_CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian.gz")
-      set(CHANGELOG_PACKAGE_NAME "${CPACK_COMPONENT_${comp}_DISPLAY_NAME}")
-      configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/changelog.Debian.in" "${DEBIAN_CHANGELOG_OUT_FILE}" @ONLY)
+    set(DEBIAN_CHANGELOG_OUT_FILE    "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian")
+    set(DEBIAN_CHANGELOG_OUT_FILE_GZ "${CMAKE_BINARY_DIR}/deb-packages-gen/${comp}/changelog.Debian.gz")
+    set(CHANGELOG_PACKAGE_NAME "${CPACK_COMPONENT_${comp}_DISPLAY_NAME}")
+    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/templates/changelog.Debian.in" "${DEBIAN_CHANGELOG_OUT_FILE}" @ONLY)

-      execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
-                      OUTPUT_FILE "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
-                      WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")
+    execute_process(COMMAND "${GZIP_TOOL}" "-cf9" "${DEBIAN_CHANGELOG_OUT_FILE}"
+                    OUTPUT_FILE "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
+                    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}")

-      install(FILES "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
-              DESTINATION "share/doc/${CPACK_COMPONENT_${comp}_DISPLAY_NAME}"
-              COMPONENT "${comp}")
-    endif()
+    install(FILES "${DEBIAN_CHANGELOG_OUT_FILE_GZ}"
+            DESTINATION "share/doc/${CPACK_COMPONENT_${comp}_DISPLAY_NAME}"
+            COMPONENT "${comp}")
   endforeach()
 endif()


Added helpful warnings when Boost libraries are not found.

--- cmake/ThirdPartyBoost.cmake
+++ cmake/ThirdPartyBoost.cmake
@@ -123,30 +123,80 @@
     ELSE()
         FIND_PACKAGE( Boost COMPONENTS thread iostreams zlib date_time filesystem system program_options regex)
     ENDIF()
+
     IF (Boost_IOSTREAMS_FOUND)
-        MESSAGE(STATUS "Found Boost iostreams library: ${Boost_IOSTREAMS_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost iostreams library: "
+                       "${Boost_IOSTREAMS_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost IOSTREAM library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-iostreams option.")
+    ENDIF ()
+
     IF (Boost_THREAD_FOUND)
-        MESSAGE(STATUS "Found Boost thread library: ${Boost_THREAD_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost thread library: "
+                       "${Boost_THREAD_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost THREAD library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-thread option.")
+    ENDIF ()
+
     IF (Boost_DATE_TIME_FOUND)
-        MESSAGE(STATUS "Found Boost date_time library: ${Boost_DATE_TIME_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost date_time library: "
+                       "${Boost_DATE_TIME_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost DATE_TIME library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-date_time option.")
+    ENDIF ()
+
     IF (Boost_FILESYSTEM_FOUND)
-        MESSAGE(STATUS "Found Boost filesystem library: ${Boost_FILESYSTEM_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost filesystem library: "
+                       "${Boost_FILESYSTEM_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost FILESYSTEM library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-filesystem option.")
+    ENDIF ()
+
     IF (Boost_SYSTEM_FOUND)
-        MESSAGE(STATUS "Found Boost system library: ${Boost_SYSTEM_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost system library: "
+                       "${Boost_SYSTEM_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost SYSTEM library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-filesystem option.")
+    ENDIF ()
+
     IF (Boost_PROGRAM_OPTIONS_FOUND)
-        MESSAGE(STATUS "Found Boost program_options library: ${Boost_PROGRAM_OPTIONS_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost program_options library: "
+                       "${Boost_PROGRAM_OPTIONS_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost PROGRAM_OPTIONS library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-program_options option.")
+    ENDIF ()
+
     IF (Boost_REGEX_FOUND)
-        MESSAGE(STATUS "Found Boost regex library: ${Boost_REGEX_LIBRARY}")
-    ENDIF ()
+        MESSAGE(STATUS "Found Boost regex library: "
+                       "${Boost_REGEX_LIBRARY}")
+    ELSE ()
+        MESSAGE(WARNING "Boost REGEX library not found. "
+                        "Please ensure it is installed, or Boost was "
+                        "compiled with the --with-regex option.")
+    ENDIF ()
+
     IF (BOOST_THREAD_LIBRARY)
         MARK_AS_ADVANCED(BOOST_THREAD_LIBRARY)
     ENDIF (BOOST_THREAD_LIBRARY)
+
+    IF (NOT Boost_FOUND)
+        MESSAGE(FATAL_ERROR "One of more Boost libraries could not be found. "
+                            "See above warnings. To have CMake automatically "
+                            "build and install the necessary Boost libraries "
+                            "select the THIRDPARTY_BUILD_BOOST option.")
+    ENDIF ()
 ENDIF (THIRDPARTY_BUILD_BOOST)

 INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})


Make gflags third_party path configurable

--- cmake/external/gflags.cmake
+++ cmake/external/gflags.cmake
@@ -14,8 +14,8 @@

 INCLUDE(ExternalProject)

-SET(GFLAGS_SOURCES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gflags)
-SET(GFLAGS_INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/install/gflags)
+SET(GFLAGS_SOURCES_DIR ${THIRD_PARTY_PATH}/gflags)
+SET(GFLAGS_INSTALL_DIR ${THIRD_PARTY_PATH}/install/gflags)
 SET(GFLAGS_INCLUDE_DIR "${GFLAGS_INSTALL_DIR}/include" CACHE PATH "gflags include directory." FORCE)
 IF(WIN32)
     set(GFLAGS_LIBRARIES "${GFLAGS_INSTALL_DIR}/lib/gflags.lib" CACHE FILEPATH "GFLAGS_LIBRARIES" FORCE)


block xxhash warning of c4711 (#37442)

block xxhash warning of c4711 (#37442)

* block xxhash warning of c4711

* modify according to zhouwei's comment

* fix syntax error

--- cmake/external/xxhash.cmake
+++ cmake/external/xxhash.cmake
@@ -31,8 +31,12 @@

 if (WIN32)
   set(XXHASH_LIBRARIES "${XXHASH_INSTALL_DIR}/lib/xxhash.lib")
+  set(XXHASH_CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4710 /wd4711")
+  set(XXHASH_CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4710 /wd4711")
 else()
   set(XXHASH_LIBRARIES "${XXHASH_INSTALL_DIR}/lib/libxxhash.a")
+  set(XXHASH_CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+  set(XXHASH_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 endif ()

 if(WIN32)
@@ -55,6 +59,12 @@
                       -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
                       -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
                       -DBUILD_SHARED_LIBS=OFF
+                      -DCMAKE_CXX_FLAGS=${XXHASH_CMAKE_CXX_FLAGS}
+                      -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
+                      -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
+                      -DCMAKE_C_FLAGS=${XXHASH_CMAKE_C_FLAGS}
+                      -DCMAKE_C_FLAGS_DEBUG=${CMAKE_C_FLAGS_DEBUG}
+                      -DCMAKE_C_FLAGS_RELEASE=${CMAKE_C_FLAGS_RELEASE}
                       ${OPTIONAL_CACHE_ARGS}
       TEST_COMMAND      ""
       BUILD_BYPRODUCTS ${XXHASH_LIBRARIES}


config: Add figlet polybar banner (#1281)

--- doc/config.cmake
+++ doc/config.cmake
@@ -1,11 +1,20 @@
-;=====================================================
+;==========================================================
+;
+;
+;   ██████╗  ██████╗ ██╗  ██╗   ██╗██████╗  █████╗ ██████╗
+;   ██╔══██╗██╔═══██╗██║  ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
+;   ██████╔╝██║   ██║██║   ╚████╔╝ ██████╔╝███████║██████╔╝
+;   ██╔═══╝ ██║   ██║██║    ╚██╔╝  ██╔══██╗██╔══██║██╔══██╗
+;   ██║     ╚██████╔╝███████╗██║   ██████╔╝██║  ██║██║  ██║
+;   ╚═╝      ╚═════╝ ╚══════╝╚═╝   ╚═════╝ ╚═╝  ╚═╝╚═╝  ╚═╝
+;
 ;
 ;   To learn more about how to configure Polybar
 ;   go to https://github.com/jaagr/polybar
 ;
 ;   The README contains alot of information
 ;
-;=====================================================
+;==========================================================

 [colors]
 ;background = ${xrdb:color0:#222}


Now requiring target android SDK 14 by default.

--- cmake/ConfigOptionsAndroid.cmake
+++ cmake/ConfigOptionsAndroid.cmake
@@ -27,7 +27,7 @@
 option(ANDROID_BUILD_JAVA_DEBUG "Create a android debug package" ${JAVA_DEBUG_DEFAULT})

 set(ANDROID_APP_VERSION 3 CACHE STRING "Application version")
-set(ANDROID_APP_TARGET_SDK 11 CACHE STRING "Application target android SDK")
+set(ANDROID_APP_TARGET_SDK 14 CACHE STRING "Application target android SDK")
 set(ANDROID_APP_MIN_SDK 9 CACHE STRING "Application minimum android SDK requirement")
 set(ANDROID_APP_GOOGLE_TARGET_SDK "16" CACHE STRING "Application target google SDK")


fix cross-compilation problem #434

fix cross-compilation problem #434

find_program uses first arg as internal cache
thus it must have a different arg for every invocation

--- cmake/Modules/LibAddMacros.cmake
+++ cmake/Modules/LibAddMacros.cmake
@@ -179,22 +179,22 @@
 function(find_util util output_loc output_arg)
 	if (CMAKE_CROSSCOMPILING)
 		if (WIN32)
-			find_program(EXE_LOC wine)
-			if (EXE_LOC)
+			find_program(${util}_EXE_LOC wine)
+			if (${util}_EXE_LOC)
 				set (ARG_LOC "${CMAKE_BINARY_DIR}/bin/${util}.exe")
 			else()
-				find_program (EXE_LOC
+				find_program (${util}_EXE_LOC
 					HINTS
 						${CMAKE_BINARY_DIR}
 					${util}.exe)
 			endif ()
 		else()
-			find_program (EXE_LOC ${util})
+			find_program (${util}_EXE_LOC ${util})
 		endif ()
 	else (CMAKE_CROSSCOMPILING)
-		get_target_property (EXE_LOC ${util} LOCATION)
+		get_target_property (${util}_EXE_LOC ${util} LOCATION)
 	endif (CMAKE_CROSSCOMPILING)
-	set (${output_loc} ${EXE_LOC} PARENT_SCOPE)
+	set (${output_loc} ${${util}_EXE_LOC} PARENT_SCOPE)
 	set (${output_arg} ${ARG_LOC} PARENT_SCOPE)
 endfunction(find_util util output)


Unsetting CACHE'd METIS variables in FindParMETIS.cmake (thanks to a suggestion from Marcin Copik)

--- cmake/modules/FindParMETIS.cmake
+++ cmake/modules/FindParMETIS.cmake
@@ -155,8 +155,8 @@
   set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY})
   set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${METIS_INCLUDE_DIR})
 else()
-  unset(METIS_LIBRARY)
-  unset(METIS_INCLUDE_DIR)
+  unset(METIS_LIBRARY CACHE)
+  unset(METIS_INCLUDE_DIR CACHE)
 endif()

 mark_as_advanced(PARMETIS_INCLUDE_DIR METIS_INCLUDE_DIR


[t:5006] change what we search for so VALGRIND_PREFIX makes more sense

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

--- cmake_modules/FindValgrind.cmake
+++ cmake_modules/FindValgrind.cmake
@@ -10,10 +10,7 @@

 message(STATUS "Valgrind Prefix: ${VALGRIND_PREFIX}")

-find_path(VALGRIND_INCLUDE_DIR valgrind/memcheck.h
-  ${VALGRIND_PREFIX}/include ${VALGRIND_PREFIX}/include/valgrind
-  /usr/local/include /usr/local/include/valgrind
-  /usr/include /usr/include/valgrind)
+find_path(VALGRIND_INCLUDE_DIR include/valgrind/memcheck.h ${VALGRIND_PREFIX} /usr/local /usr)
 find_program(VALGRIND_PROGRAM NAMES valgrind PATH ${VALGRIND_PREFIX}/bin /usr/local/bin /usr/bin)

 find_package_handle_standard_args(VALGRIND DEFAULT_MSG


BUG: add missing depends to OTBSupervised

--- Modules/Learning/Supervised/otb-module.cmake
+++ Modules/Learning/Supervised/otb-module.cmake
@@ -1,4 +1,4 @@
-set(DOCUMENTATION "This module provides the Orfeo Toolbox supervised
+set(DOCUMENTATION "This module provides the Orfeo Toolbox supervised
 classification and regression framework, currently based on
 OpenCV and/or libSVM")

@@ -7,6 +7,7 @@
     OTBBoost
     OTBCommon
     OTBITK
+    OTBImageBase

   OPTIONAL_DEPENDS
     OTBOpenCV


ENH: Update SimpleITKFilters remote module

$ git log --oneline d67058..3344aa

3344aa9 ENH: Throw exception when desired orientation is invalid.
a0b9eca ENH: Refactor enums into DICOMOrientation class
2fd3893 ENH: Add test demonstrating behavior of INVALID enum on execution
9240a0f Rename SetDesiredCoordinateDirection by string to ...Orientation
6d6c7a9 Fix up documentation and test compilation
24bc712 Update documentation and clean up unused code
455c241 Rename Given.. to InputCoordinateOrientation
9a74379 Add testing for DICOMOrientImageFilter
a3216d6 Refactoring of OrientImageFilter into DICOMOrientImageFilter
ef6dcac Renamed to DICOMOrientImageFilter
94b56ec Import existing itkOrientImageFilter
243bcab Restore atoi usage in test
e7bc846 Configure AZP to build pull requests
61d6ee1 Update AZP to macos-10.14
d8fac5c STYLE: Apply clang format styling

--- Modules/Remote/SimpleITKFilters.remote.cmake
+++ Modules/Remote/SimpleITKFilters.remote.cmake
@@ -12,14 +12,14 @@
 #-- ## Compliance Level 4 star (Very high-quality code, perhaps small community dependance)
 #--   - [X ] Meets all ITK code style standards
 #--   - [X] No external requirements beyond those needed by ITK proper
-#--   - [ ] Builds and passes tests on all supported platforms within 1 month of each core tagged release
+#--   - [X] Builds and passes tests on all supported platforms within 1 month of each core tagged release
 #--            - [ ] Windows Shared Library Build with Visual Studio
 #--            - [ ] Mac with clang compiller
 #--            - [ ] Linux with gcc compiler
 #--   - [ ] Active developer community dedicated to maintaining code-base
 #--   - [ ] 75% code coverage demonstrated for testing suite
-#--   - [ ] Continuous integration testing performed
-#--   - [ ] All requirements of Levels 3,2,1
+#--   - [X] Continuous integration testing performed
+#--   - [X] All requirements of Levels 3,2,1
 #--
 #-- ## Compliance Level 3 star (Quality beta code)
 #--   - [X] API | executable interface is considered mostly stable and feature complete
@@ -47,7 +47,7 @@
   filters, adapters of existing ITK filters or alternative
   implementations designed for SimpleITK's requirements. Currently it
   contains a discrete hessian, and a composite filter to compute objectness."
-  MODULE_COMPLIANCE_LEVEL 2
+  MODULE_COMPLIANCE_LEVEL 3
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKSimpleITKFilters.git
-  GIT_TAG d67058d605a4a57674e5bc756a389cf7040dcc6d
+  GIT_TAG 3344aa9d61dbf6672dbc81dacab7b99fc0cfb7b5
   )


ENH: Added some standard paths in which to look for UseCABLE.cmake.

--- Wrapping/FindCABLE.cmake
+++ Wrapping/FindCABLE.cmake
@@ -4,4 +4,7 @@
 # Sets CABLE_USE_FILE to the "UseCABLE.cmake".
 #

-FIND_PATH(CABLE_USE_FILE UseCABLE.cmake ../lib/Cable)
+FIND_PATH(CABLE_USE_FILE UseCABLE.cmake
+  /usr/local/lib/Cable
+  /usr/lib/Cable
+)


[CMake] Fix LLVM_EXTERNAL_LIT path does not exist

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -48,6 +48,14 @@
   set(LLVM_DIR ${LLVM_OBJ_ROOT}/cmake/modules/CMakeFiles CACHE PATH "Path to LLVM build tree CMake files")
   set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
   set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+
+  set(LLVMCONFIG_FILE "${LLDB_PATH_TO_LLVM_BUILD}/lib/cmake/llvm/LLVMConfig.cmake")
+  if(EXISTS ${LLVMCONFIG_FILE})
+    list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
+    include(${LLVMCONFIG_FILE})
+  else()
+    message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
+  endif()
   # END Swift Mods

   set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")
@@ -55,14 +63,6 @@
     NO_DEFAULT_PATH)

   # BEGIN Swift Mods
-  set(LLVMCONFIG_FILE "${LLDB_PATH_TO_LLVM_BUILD}/lib/cmake/llvm/LLVMConfig.cmake")
-  if(EXISTS ${LLVMCONFIG_FILE})
-    list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
-    include(${LLVMCONFIG_FILE})
-  else()
-    message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
-  endif()
-
   get_filename_component(PATH_TO_SWIFT_BUILD ${LLDB_PATH_TO_SWIFT_BUILD}
                          ABSOLUTE)


qibuild/cmake: fix previous fix in qi_stage_lib ...

this construct is just horrible:

create_lib(foo ...)
stage_lib(foo ${CMAKE_CURRENT_SOURCE_DIR})

what we *really* want is:

include_directories(${CMAKE_CURRENT_SOURCE_DIR})
qi_stage_lib(foo)

....

--- cmake/qibuild/internal/stage.cmake
+++ cmake/qibuild/internal/stage.cmake
@@ -116,7 +116,7 @@
 function(_qi_gen_inc_dir_code_sdk res target)
   string(TOUPPER ${target} _U_target)
   get_directory_property(_inc_dirs INCLUDE_DIRECTORIES)
-  set(${_U_target}_INCLUDE_DIRS ${_inc_dirs})
+  list(APPEND ${_U_target}_INCLUDE_DIRS ${_inc_dirs})

   _qi_gen_code_from_vars(_res ${_U_target}_INCLUDE_DIRS)


Fix version number

Fix version number

--- CMakeExternals/HDF5.cmake
+++ CMakeExternals/HDF5.cmake
@@ -27,7 +27,7 @@
     # bad :( This would be fixed by using an external HDF-Installation with ITK/VTK

     ExternalProject_Add(${proj}
-       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/hdf5_1.8.12.tar.gz
+       URL ${MITK_THIRDPARTY_DOWNLOAD_PREFIX_URL}/hdf5_1.8.14.tar.gz
        URL_MD5 a482686e733514a51cde12d6fe5c5d95
        CMAKE_GENERATOR ${gen}
        CMAKE_ARGS


build: fix dpdk library link order

build: fix dpdk library link order

The eal library refers to symbols in the kvargs library, so it has to come before.
This fixes build errors due to unresolved symbols:

/home/avi/scylla/seastar/build/dev/_cooking/installed/lib/librte_eal.a(eal_common_devargs.o):eal_common_devargs.c:function rte_devargs_layers_parse: error: undefined reference to 'rte_kvargs_parse_delim'
/home/avi/scylla/seastar/build/dev/_cooking/installed/lib/librte_eal.a(eal_common_devargs.o):eal_common_devargs.c:function rte_devargs_layers_parse: error: undefined reference to 'rte_kvargs_free'
collect2: error: ld returned 1 exit status

Seastar's executables build before and after this patch; I don't
know why the problem only affects external executables.
Message-Id: <710dee32e77f32080a11e66f4898836c9044a357@scylladb.com>

--- cmake/Finddpdk.cmake
+++ cmake/Finddpdk.cmake
@@ -93,9 +93,9 @@
     ${dpdk_CMDLINE_LIBRARY}
     ${dpdk_ETHDEV_LIBRARY}
     ${dpdk_HASH_LIBRARY}
-    ${dpdk_KVARGS_LIBRARY}
     ${dpdk_MBUF_LIBRARY}
     ${dpdk_EAL_LIBRARY}
+    ${dpdk_KVARGS_LIBRARY}
     ${dpdk_MEMPOOL_LIBRARY}
     ${dpdk_MEMPOOL_RING_LIBRARY}
     ${dpdk_PMD_BNXT_LIBRARY}


Include existing source directories in installed include list before setting them in dtkBuild

--- cmake/dtkBuild.cmake
+++ cmake/dtkBuild.cmake
@@ -85,7 +85,7 @@
 set(${PROJECT_NAME}_CMAKE_DIRS ${PROJECT_SOURCE_DIR}/cmake)
 set(${PROJECT_NAME}_USE_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Use.cmake)

-set(${PROJECT_NAME}_INSTALL_INCLUDE_DIRS ${CMAKE_INSTALL_PREFIX}/include)
+set(${PROJECT_NAME}_INSTALL_INCLUDE_DIRS ${${PROJECT_NAME}_INSTALL_INCLUDE_DIRS} ${CMAKE_INSTALL_PREFIX}/include)
 set(${PROJECT_NAME}_INSTALL_LIBRARY_DIRS ${LIBRARY_INSTALL_OUTPUT_PATH})
 set(${PROJECT_NAME}_INSTALL_RUNTIME_DIRS ${RUNTIME_INSTALL_OUTPUT_PATH})
 set(${PROJECT_NAME}_INSTALL_CMAKE_DIRS ${CMAKE_INSTALL_PREFIX}/cmake)


config for older compilers

config for older compilers

--- cmake/gsConfig.cmake
+++ cmake/gsConfig.cmake
@@ -150,7 +150,7 @@
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") #-ftrack-macro-expansion=0 -Wno-ignored-attributes
   endif()
   if ("x${CMAKE_CXX_STANDARD}" STREQUAL "x98"
-      AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.2)
+      AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.4)
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-compat")
   endif()


Downloading Catch from master branch

Downloading Catch from master branch

--- scripts/AddCatchTest.cmake
+++ scripts/AddCatchTest.cmake
@@ -2,7 +2,7 @@
 find_package(Catch)
 if(NOT CATCH_FOUND)
   set(catch_url
-      https://raw.githubusercontent.com/philsquared/Catch/develop/single_include/catch.hpp)
+      https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp)
   set(catch_file "${EXTERNAL_ROOT}/include/catch.hpp")
   file(MAKE_DIRECTORY "${EXTERNAL_ROOT}/include")
   file(DOWNLOAD ${catch_url} "${catch_file}")


Modified plugin.cmake removed tracebounds test

--- plugin.cmake
+++ plugin.cmake
@@ -53,12 +53,6 @@
     PLUGIN HistomicsTK
 )

-add_python_test(segmentation_label
-    SUBMODULE TraceBoundsTest
-    DBNAME core_segmentation_trace_bounds
-    PLUGIN HistomicsTK
-)
-
 # front-end tests
 add_web_client_test(
     HistomicsTK_schema "${PROJECT_SOURCE_DIR}/plugins/HistomicsTK/plugin_tests/client/parser.js"


(apps/paper) Move CMake file

(apps/paper) Move CMake file


python.cmake: BUILD_IN_SOURCE, which seems to be required on Mac OS X.

--- python.cmake
+++ python.cmake
@@ -22,6 +22,7 @@
     http://www.python.org/ftp/python/2.7.3)

 message ("Installing ${python_NAME} into FlyEM build area: ${FLYEM_BUILD_DIR} ...")
+
 ExternalProject_Add(${python_NAME}
     DEPENDS             ${zlib_NAME}
     PREFIX              ${FLYEM_BUILD_DIR}
@@ -36,6 +37,7 @@
         CPPFLAGS=-I${FLYEM_BUILD_DIR}/include
     BUILD_COMMAND       ${FLYEM_ENV_STRING} make
     INSTALL_COMMAND     ${FLYEM_ENV_STRING} make install
+    BUILD_IN_SOURCE 1
 )

 set (PYTHON_INCLUDE_PATH ${FLYEM_BUILD_DIR}/include/python2.7)


[C++] Fixed cmake version check in AddExternalProject

* use VERION_LESS to compare CMAKE_VERSION

--- cpp/CMake/AddExternalProject.cmake
+++ cpp/CMake/AddExternalProject.cmake
@@ -57,7 +57,7 @@
         # otherwise, BUILD_BYPRODUCTS and the following value from the argument list is removed
         list(FIND INPUT_ARGS "BUILD_BYPRODUCTS" BUILD_BYPRODUCTS_INDEX)
         if (BUILD_BYPRODUCTS_INDEX GREATER -1)
-            if(CMAKE_VERSION LESS 3.2)
+            if(CMAKE_VERSION VERSION_LESS 3.2)
                 list(REMOVE_AT INPUT_ARGS ${BUILD_BYPRODUCTS_INDEX})
                 list(REMOVE_AT INPUT_ARGS ${BUILD_BYPRODUCTS_INDEX})
             endif()


ENH: Update ITK to v4.8.2

ENH: Update ITK to v4.8.2

kaspermarstal/SimpleElastix#15

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -35,7 +35,7 @@
 set(ITK_REPOSITORY git://itk.org/ITK.git)

 # NOTE: it is very important to update the ITK_DIR path with the ITK version
-set(ITK_TAG_COMMAND GIT_TAG v4.8.1)
+set(ITK_TAG_COMMAND GIT_TAG v4.8.2)

 if( ${ITK_WRAPPING} OR ${BUILD_SHARED_LIBS} )
   set( ITK_BUILD_SHARED_LIBS ON )


Update Superbuild ITK version to v5.3rc3

This version of ITK is not required for the factory generation macro.

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

-set(_DEFAULT_ITK_GIT_TAG "af32a779c4586304e52ddc27eb81656b949c9eeb")
+set(_DEFAULT_ITK_GIT_TAG "v5.3rc03")
 set(ITK_GIT_TAG "${_DEFAULT_ITK_GIT_TAG}" CACHE STRING "Tag in ITK git repo")
 mark_as_advanced(ITK_GIT_TAG)
 set(ITK_TAG_COMMAND GIT_TAG "${ITK_GIT_TAG}")


GIT: Remove merge conflict markers

GIT: Remove merge conflict markers

--- SuperBuild/External_ITK.cmake
+++ SuperBuild/External_ITK.cmake
@@ -98,10 +98,5 @@

 ExternalProject_Get_Property(ITK install_dir)
-<<<<<<< HEAD
-set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.8" )
-set(WrapITK_DIR "${install_dir}/lib/cmake/ITK-4.8/WrapITK")
-=======
 set(ITK_DIR "${install_dir}/lib/cmake/ITK-4.10" )
 set(WrapITK_DIR "${ITK_DIR}/WrapITK")
->>>>>>> v0.10rc1


Add NO_INSTALL option back to basic_plugin

For upstream compatibility, allow the NO_INSTALL option in basic_plugin
but warn when used. It is intended that basic_plugin only build a
plugin, with clients being responsible for installing.

--- Modules/BasicPlugin.cmake
+++ Modules/BasicPlugin.cmake
@@ -81,13 +81,17 @@
 # Basic plugin libraries.
 function(basic_plugin name type)
   cmake_parse_arguments(BP
-    "USE_BOOST_UNIT;ALLOW_UNDERSCORES;BASENAME_ONLY;USE_PRODUCT_NAME;NOP"
+    "USE_BOOST_UNIT;ALLOW_UNDERSCORES;BASENAME_ONLY;USE_PRODUCT_NAME;NOP;NO_INSTALL"
     ""
     "SOURCE"
     ${ARGN})
   if(BP_BASENAME_ONLY AND BP_USE_PRODUCT_NAME)
     message(FATAL_ERROR "BASENAME_ONLY AND USE_PRODUCT_NAME are mutually exclusive")
   endif()
+  if(BP_NO_INSTALL)
+    message(WARNING "basic_plugin no longer accepts the NO_INSTALL option")
+  endif(()
+
   if(BP_BASENAME_ONLY)
     set(plugin_name "${name}_${type}")
   else()


Fix FindCuda cmake file.

Fix FindCuda cmake file.

git-svn-id: bd2008fbba0f7d30fd6598b54f2cd88503fdd2e4@320 95f4ed2b-212e-0410-8b90-d31948207fce

--- cmake/FindCUDA.cmake
+++ cmake/FindCUDA.cmake
@@ -84,29 +84,29 @@

 ENDMACRO(GET_CUDA_INC_DIRS)

-
+
 # Get file dependencies.
 MACRO (GET_CUFILE_DEPENDENCIES dependencies file)
 	GET_FILENAME_COMPONENT(filepath ${file} PATH)

 	#  parse file for dependencies
-	FILE(READ "${file}" CONTENTS)
+	FILE(READ "${file}" CONTENTS)
+	#STRING(REGEX MATCHALL "#[ \t]*include[ \t]+[<\"][^>\"]*" DEPS "${CONTENTS}")
+	STRING(REGEX MATCHALL "#[ \t]*include[ \t]+\"[^\"]*" DEPS "${CONTENTS}")

 	SET(${dependencies})

 	FOREACH(DEP ${DEPS})
 		STRING(REGEX REPLACE "#[ \t]*include[ \t]+\"" "" DEP "${DEP}")
-
+
 		FIND_PATH(PATH_OF_${DEP} ${DEP}
 			${filepath})
-
+
 		IF(NOT ${PATH_OF_${DEP}} STREQUAL PATH_OF_${DEP}-NOTFOUND)
-			MESSAGE("${filepath} ${PATH_OF_${DEP}}/${DEP}")
+			#MESSAGE("${file} : ${PATH_OF_${DEP}}/${DEP}")
 			SET(${dependencies} ${${dependencies}} ${PATH_OF_${DEP}}/${DEP})
 		ENDIF(NOT ${PATH_OF_${DEP}} STREQUAL PATH_OF_${DEP}-NOTFOUND)

-		# reset path.
-		#SET(PATH_OF_${DEP})
 	ENDFOREACH(DEP)

 ENDMACRO (GET_CUFILE_DEPENDENCIES)


Fix dpdk_LIBRARIES order.

Fix dpdk_LIBRARIES order.

The order shows up in the seastar.pc file and is important for static
linking dpdk.

The issue is not currently visible since we are not linking in the
native network stack.

Signed-off-by: Rafael Ávila de Espíndola <1975039f9046bf513b77c0c5639a0efc25f00e7f@scylladb.com>
Message-Id: <20181217233446.614-2-1975039f9046bf513b77c0c5639a0efc25f00e7f@scylladb.com>

--- cmake/Finddpdk.cmake
+++ cmake/Finddpdk.cmake
@@ -81,11 +81,11 @@
   set (dpdk_LIBRARIES
     ${dpdk_CFGFILE_LIBRARY}
     ${dpdk_CMDLINE_LIBRARY}
-    ${dpdk_EAL_LIBRARY}
     ${dpdk_ETHDEV_LIBRARY}
     ${dpdk_HASH_LIBRARY}
     ${dpdk_KVARGS_LIBRARY}
     ${dpdk_MBUF_LIBRARY}
+    ${dpdk_EAL_LIBRARY}
     ${dpdk_MEMPOOL_LIBRARY}
     ${dpdk_MEMPOOL_RING_LIBRARY}
     ${dpdk_PMD_BNXT_LIBRARY}


remove debug output

remove debug output

--- cmake/VcMacros.cmake
+++ cmake/VcMacros.cmake
@@ -394,7 +394,6 @@
    foreach(_i ${_inc})
       list(APPEND _flags "-I${_i}")
    endforeach()
-   message(STATUS "_flags: ${_flags}")

    set(_vc_compile_src "${_src}")


COMP: Bad CMake warning

COMP: Bad CMake warning

EXCLUDE_FROM_ALL$ is deprecated, please use EXCLUDE_FROM_DEFAULT$.
should read
EXCLUDE_FROM_ALL is deprecated, please use EXCLUDE_FROM_DEFAULT.

Change-Id: Ib148abf0b994141db5fbb92adfdc22c43ed40cbb

--- CMake/ITKModuleMacros.cmake
+++ CMake/ITKModuleMacros.cmake
@@ -32,7 +32,7 @@
       set(ITK_MODULE_${itk-module}_EXCLUDE_FROM_DEFAULT 1)
     elseif("${arg}" MATCHES "^EXCLUDE_FROM_ALL$") # To maintain backward compatibility
       set(_doing "")
-      message(AUTHOR_WARNING "EXCLUDE_FROM_ALL$ is deprecated, please use EXCLUDE_FROM_DEFAULT$.")
+      message(AUTHOR_WARNING "EXCLUDE_FROM_ALL is deprecated, please use EXCLUDE_FROM_DEFAULT.")
       set(ITK_MODULE_${itk-module}_EXCLUDE_FROM_DEFAULT 1)
     elseif("${arg}" MATCHES "^ENABLE_SHARED$")
       set(_doing "")


Added LIB_SUFFIX option so that cuda libs get installed in the right place

git-svn-id: 4ba210d0a933e3fb1aa9ab096f190cd38965d92a@3871 fa922fa7-2fde-0310-acd8-f43f465a7996

--- CMake_install_options.cmake
+++ CMake_install_options.cmake
@@ -28,8 +28,8 @@
     set(INC_INSTALL_DIR "HOOMD-blue.app/Contents/include/hoomd")
 else (WIN32)
     set(DATA_INSTALL_DIR "share/hoomd")
-    set(LIB_INSTALL_DIR "lib/hoomd")
-    set(LIB_BASE_INSTALL_DIR "lib")
+    set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}/hoomd")
+    set(LIB_BASE_INSTALL_DIR "lib${LIB_SUFFIX}")
     set(BIN_INSTALL_DIR "bin")
     set(INC_INSTALL_DIR "include/hoomd")
 endif (WIN32)


Drop FLAGS default (#6702)

Drop FLAGS default (#6702)

Switches to explicitly passing the flags. The previous default flag
`-iree-mlir-to-vm-bytecode-module` wasn't a useful default as it is
required to additionaly specify backends via
`-iree-hal-target-backends=`.

--- build_tools/cmake/iree_bytecode_module.cmake
+++ build_tools/cmake/iree_bytecode_module.cmake
@@ -13,8 +13,7 @@
 # Parameters:
 # NAME: Name of target (see Note).
 # SRC: Source file to compile into a bytecode module.
-# FLAGS: Flags to pass to the translation tool (list of strings). The
-#     default flag set is "-iree-mlir-to-vm-bytecode-module".
+# FLAGS: Flags to pass to the translation tool (list of strings).
 # TRANSLATE_TOOL: Translation tool to invoke (CMake target). The default
 #     tool is "iree-translate".
 # C_IDENTIFIER: Identifier to use for generate c embed code.
@@ -42,12 +41,7 @@
     return()
   endif()

-  # Set defaults for FLAGS and TRANSLATE_TOOL
-  if(DEFINED _RULE_FLAGS)
-    set(_FLAGS ${_RULE_FLAGS})
-  else()
-    set(_FLAGS "-iree-mlir-to-vm-bytecode-module")
-  endif()
+  # Set default for TRANSLATE_TOOL.
   if(DEFINED _RULE_TRANSLATE_TOOL)
     set(_TRANSLATE_TOOL ${_RULE_TRANSLATE_TOOL})
   else()
@@ -57,7 +51,7 @@
   iree_get_executable_path(_TRANSLATE_TOOL_EXECUTABLE ${_TRANSLATE_TOOL})
   iree_get_executable_path(_EMBEDDED_LINKER_TOOL_EXECUTABLE "lld")

-  set(_ARGS "${_FLAGS}")
+  set(_ARGS "${_RULE_FLAGS}")
   list(APPEND _ARGS "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRC}")
   list(APPEND _ARGS "-o")
   list(APPEND _ARGS "${_RULE_NAME}.vmfb")


[cmake] Update iree_bytecode_module to support source with the absolute path (#6888)

--- build_tools/cmake/iree_bytecode_module.cmake
+++ build_tools/cmake/iree_bytecode_module.cmake
@@ -52,7 +52,12 @@
   iree_get_executable_path(_EMBEDDED_LINKER_TOOL_EXECUTABLE "lld")

   set(_ARGS "${_RULE_FLAGS}")
-  list(APPEND _ARGS "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRC}")
+  # Check source file path to support absolute path.
+  set(_SRC_PATH "${_RULE_SRC}")
+  if (NOT IS_ABSOLUTE ${_SRC_PATH})
+    set(_SRC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${_RULE_SRC}")
+  endif()
+  list(APPEND _ARGS "${_SRC_PATH}")
   list(APPEND _ARGS "-o")
   list(APPEND _ARGS "${_RULE_NAME}.vmfb")
   list(APPEND _ARGS "-iree-llvm-embedded-linker-path=${_EMBEDDED_LINKER_TOOL_EXECUTABLE}")


fixed typos and formatting.

fixed typos and formatting.

--- sandbox/share/cmake/Modules/FindAppleseed.cmake
+++ sandbox/share/cmake/Modules/FindAppleseed.cmake
@@ -1,3 +1,4 @@
+
 #
 # This source file is part of appleseed.
 # Visit http://appleseedhq.net/ for additional information and resources.
@@ -26,32 +27,33 @@
 #

-# Find Appleseed's headers and libraries.
 #
-#  This module defines
-# APPLESEED_INCLUDE_DIRS - where to find APPLESEED uncludes.
-# APPLESEED_LIBRARIES    - List of libraries when using APPLESEED.
-# APPLESEED_FOUND        - True if APPLESEED found.
+# Find appleseed's headers and libraries.
+#
+# This module defines:
+#
+#   APPLESEED_INCLUDE_DIRS - Where to find appleseed header files
+#   APPLESEED_LIBRARIES    - List of libraries when using appleseed
+#   APPLESEED_FOUND        - True if appleseed was found
+#

-# Look for the header file.
-FIND_PATH( APPLESEED_INCLUDE_DIR NAMES renderer/api/project.h)
+# Look for a core header file.
+FIND_PATH (APPLESEED_INCLUDE_DIR NAMES renderer/api/project.h)

-# Look for the libraries.
-FIND_LIBRARY( APPLESEED_LIBRARY NAMES appleseed)
+# Look for the library.
+FIND_LIBRARY (APPLESEED_LIBRARY NAMES appleseed)

-# handle the QUIETLY and REQUIRED arguments and set APPLESEED_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE( FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS( APPLESEED DEFAULT_MSG APPLESEED_LIBRARY
-                                                         APPLESEED_INCLUDE_DIR)
+# Handle the QUIETLY and REQUIRED arguments and set APPLESEED_FOUND to TRUE if all listed variables are TRUE.
+INCLUDE (FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS (APPLESEED DEFAULT_MSG APPLESEED_LIBRARY APPLESEED_INCLUDE_DIR)
+
 # Copy the results to the output variables.
-IF(APPLESEED_FOUND)
-    SET( APPLESEED_LIBRARIES ${APPLESEED_LIBRARY})
-    SET( APPLESEED_INCLUDE_DIRS ${APPLESEED_INCLUDE_DIR})
-ELSE()
-    SET( APPLESEED_LIBRARIES)
-    SET( APPLESEED_INCLUDE_DIRS)
-ENDIF()
+IF (APPLESEED_FOUND)
+    SET (APPLESEED_LIBRARIES ${APPLESEED_LIBRARY})
+    SET (APPLESEED_INCLUDE_DIRS ${APPLESEED_INCLUDE_DIR})
+ELSE ()
+    SET (APPLESEED_LIBRARIES)
+    SET (APPLESEED_INCLUDE_DIRS)
+ENDIF ()

-MARK_AS_ADVANCED( APPLESEED_LIBRARY
-                  APPLESEED_INCLUDE_DIR)
+MARK_AS_ADVANCED (APPLESEED_LIBRARY APPLESEED_INCLUDE_DIR)


CMake: set the flag Boost_NO_BOOST_CMAKE to avoid that the *standard* FindBoost.cmake tries to do a find_package() in config mode ... man what were they having in mind when they wrote this ...

--- salome_adm/cmake_files/FindSalomeBoost.cmake
+++ salome_adm/cmake_files/FindSalomeBoost.cmake
@@ -26,6 +26,7 @@
 SET(Boost_USE_STATIC_LIBS        OFF)
 SET(Boost_USE_MULTITHREADED      ON )
 SET(Boost_USE_STATIC_RUNTIME     OFF)
+SET(Boost_NO_BOOST_CMAKE         ON)

 SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Boost Boost_INCLUDE_DIRS 1)
 IF(Boost_FOUND OR BOOST_FOUND)


Create tarball target

Create tarball target

--- GitTargets.cmake
+++ GitTargets.cmake
@@ -60,6 +60,31 @@
   WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
   )

+add_custom_target(tarball-clone
+  COMMAND ${CMAKE_COMMAND} -E remove_directory
+                              "${CMAKE_PROJECT_NAME}-${VERSION}"
+  COMMAND ${GIT_EXECUTABLE} clone "${CMAKE_SOURCE_DIR}"
+                                  "${CMAKE_PROJECT_NAME}-${VERSION}"
+  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+  COMMENT "Cloning source"
+  )
+
+add_custom_target(tarball-prepare
+  COMMAND ${GIT_EXECUTABLE} checkout -q release-${VERSION}
+  COMMAND ${CMAKE_COMMAND} -E remove_directory ".git"
+  DEPENDS tarball-clone
+  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}"
+  COMMENT "Preparing ${CMAKE_PROJECT_NAME}-${VERSION}"
+  )
+
+add_custom_target(tarball
+  COMMAND ${CMAKE_COMMAND} -E tar czf "${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz"
+                                      "${CMAKE_PROJECT_NAME}-${VERSION}"
+  DEPENDS tarball-prepare
+  WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+  COMMENT "Creating ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz"
+  )
+
 set(_gittargets_TARGETS branch cut tag erase)
 foreach(_gittargets_TARGET ${_gittargets_TARGETS})
   set_target_properties(${_gittargets_TARGET} PROPERTIES EXCLUDE_FROM_ALL ON)