[nuemrics] extract difficult from the list to treat them apart

--- numerics/numerics_tests.cmake
+++ numerics/numerics_tests.cmake
@@ -240,8 +240,12 @@
   NEW_TEST(FC3D_DefaultSolverOptionstest fc3d_DefaultSolverOptions_test.c)
   NEW_TEST(FC3D_sparse_test fc3d_sparse_test.c)

-  SET(FC3D_DATA_SET
-    "Capsules-i100-1090.dat;Capsules-i100-889.dat;Capsules-i101-404.dat;Capsules-i103-990.dat;Capsules-i122-1617.dat;Example1_Fc3D.dat;Example1_Fc3D_SBM.dat;FrictionContact3D_1c.dat;FrictionContact3D_RR_1c.dat;NESpheres_10_1.dat;NESpheres_30_1.dat;Rover1039.dat;Rover1040.dat;Rover1041.dat;Rover11035.dat;Rover11211.dat;Rover3865.dat;Rover4144.dat;Rover4396.dat;Rover4493.dat;Rover4516.dat;Rover4609.dat;Rover4613.dat;Rover4622.dat;Rover9770.dat;Confeti-ex13-Fc3D-SBM.dat;BoxesStack1-i100000-32.hdf5.dat")
+  STRING(CONCAT FC3D_DATA_SET "Capsules-i100-1090.dat;Capsules-i100-889.dat;Capsules-i101-404.dat;Capsules-i103-990.dat;Capsules-i122-1617.dat;")
+  STRING(CONCAT FC3D_DATA_SET "Example1_Fc3D.dat;Example1_Fc3D_SBM.dat;FrictionContact3D_1c.dat;FrictionContact3D_RR_1c.dat;")
+  STRING(CONCAT FC3D_DATA_SET "NESpheres_10_1.dat;NESpheres_30_1.dat;")
+  STRING(CONCAT FC3D_DATA_SET "Rover1039.dat;Rover1040.dat;Rover1041.dat;Rover11035.dat;Rover11211.dat;Rover3865.dat;Rover4144.dat;")
+  STRING(CONCAT FC3D_DATA_SET "Rover4493.dat;Rover4516.dat;Rover4609.dat;Rover4613.dat;Rover4622.dat;Rover9770.dat;")
+  STRING(CONCAT FC3D_DATA_SET "Confeti-ex13-Fc3D-SBM.dat;")

   foreach(_DAT ${FC3D_DATA_SET})
     # --- GAMS Solvers ---
@@ -256,23 +260,27 @@

     # --- NSGS on FC3D_DATA_SET ---
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000)
+
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000
       SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
-      INTERNAL_IPARAM 10 1)
+      INTERNAL_IPARAM 10 1)
+
+    NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000
+      SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration 1e-12  10)
+
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSGS 1e-5 10000
       SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
       INTERNAL_IPARAM SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP)

     # --- Nonsmooth Newton on FC3D_DATA_SET ---
-    NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSN_AC 1e-5 100
+    NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSN_AC 1e-5 1000
       0 0 0
       IPARAM 1 1)
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSN_AC 1e-3 1000)
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSN_FB 1e-3 1000)
     NEW_FC_3D_TEST(${_DAT} SICONOS_FRICTION_3D_NSN_NM 1e-3 1000)
   endforeach()
-  set(fc3d_NSGS_Tol_1e-5_Max_10000_inTol_0_inMax_0___Rover4396_PROPERTIES WILL_FAIL TRUE)
-
+

   # --- NSGS with different local solvers and parameters ---
@@ -589,21 +597,69 @@
   NEW_FC_3D_TEST(OneObject-i100000-499.hdf5.dat SICONOS_FRICTION_3D_NSN_AC 1e-3 1000)
   NEW_FC_3D_TEST(OneObject-i100000-499.hdf5.dat SICONOS_FRICTION_3D_NSN_FB 1e-3 1000)
   NEW_FC_3D_TEST(OneObject-i100000-499.hdf5.dat SICONOS_FRICTION_3D_NSN_NM 1e-3 1000)
-
   NEW_FC_3D_TEST(OneObject-i100000-499.hdf5.dat
     SICONOS_FRICTION_3D_PROX  1e-8 100000
     0 0 0
     DPARAM 3 1e4
     IPARAM 1 1)
-
-
   NEW_FC_3D_TEST(OneObject-i100000-499.hdf5.dat
     SICONOS_FRICTION_3D_TFP 1e-8 100
     0 0 0
     DPARAM 3 1e4
     WILL_FAIL)
-
-
+
+  # BoxesStack1-i100000-32.hdf5.dat
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat
+    SICONOS_FRICTION_3D_NSGS 1e-5 100000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    WILL_FAIL)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    INTERNAL_IPARAM 10 1
+    WILL_FAIL)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    INTERNAL_IPARAM SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP
+    WILL_FAIL)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSN_AC 1e-5 500
+    0 0 0
+    IPARAM 1 1)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSN_AC 1e-3 1000)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSN_FB 1e-3 1000)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat SICONOS_FRICTION_3D_NSN_NM 1e-3 1000)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat
+    SICONOS_FRICTION_3D_PROX  1e-8 100000
+    0 0 0
+    DPARAM 3 1e4
+    IPARAM 1 1)
+  NEW_FC_3D_TEST(BoxesStack1-i100000-32.hdf5.dat
+    SICONOS_FRICTION_3D_TFP 1e-8 100
+    0 0 0
+    DPARAM 3 1e4
+    WILL_FAIL)
+
+  # Rover4396.dat
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    WILL_FAIL)
+
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    INTERNAL_IPARAM 10 1)
+
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_ProjectionOnConeWithLocalIteration 1e-12  10)
+
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSGS 1e-5 10000
+    SICONOS_FRICTION_3D_ONECONTACT_NSN_GP 0 0
+    INTERNAL_IPARAM SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY SICONOS_FRICTION_3D_NSN_HYBRID_STRATEGY_PLI_NSN_LOOP WILL_FAIL)
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSN_AC 1e-5 1000
+    0 0 0
+    IPARAM 1 1)
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSN_AC 1e-3 1000)
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSN_FB 1e-3 1000)
+  NEW_FC_3D_TEST(Rover4396.dat SICONOS_FRICTION_3D_NSN_NM 1e-3 1000)
+

   # --- LMGC driver ---


fptu-cmake: fix add_compile_flags macro.

--- cmake.fptu/utils.cmake
+++ cmake.fptu/utils.cmake
@@ -2,9 +2,9 @@
   foreach(_lang ${langs})
     string(REPLACE ";" " " _flags "${ARGN}")
     set("${_lang}_FLAGS" "${${_lang}_FLAGS} ${_flags}")
-    unset(${_lang})
-    unset(${_flags})
   endforeach()
+  unset(_lang)
+  unset(_flags)
 endmacro(add_compile_flags)

 macro(set_source_files_compile_flags)


Fixed RTfact detection on Windows.

Fixed RTfact detection on Windows.

--- cmake/FindRTfact.cmake
+++ cmake/FindRTfact.cmake
@@ -23,7 +23,7 @@
 	## Now, try to find the rtfact library itself.
 	FIND_LIBRARY(RTFACT_OPT_LIBRARY
 		NAMES RTfactRemote
-		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build
+		PATHS ${RTFACT_POSSIBLE_ROOT_DIRS} ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build ${RTFACT_POSSIBLE_ROOT_DIRS}/remote/build/Release
 		PATH_SUFFIXES lib
 		DOC "RTfact library, optimized")


fix spdlog detection

fix spdlog detection

--- cmake/Findspdlog.cmake
+++ cmake/Findspdlog.cmake
@@ -1,7 +1,7 @@
 find_package(PkgConfig)

 if(NOT EXISTS "${spdlog_INCLUDE_DIR}")
-    find_path(rxcpp_INCLUDE_DIR
+    find_path(spdlog_INCLUDE_DIR
             NAMES spdlog/spdlog.h
             DOC "spdlog library header files"
             )


install the libraries in the right place at build time

--- cmake/ectoMacros.cmake
+++ cmake/ectoMacros.cmake
@@ -97,7 +97,12 @@
 macro(link_ecto NAME)
   target_link_libraries(${NAME}_ectomodule
     ${ARGN}
+  )
+  if (ecto_module_PYTHON_INSTALL)
+    set_target_properties(${NAME}_ectomodule PROPERTIES
+                          LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${ecto_module_PYTHON_INSTALL}
     )
+  endif()
 endmacro()

 # ==============================================================================


fix building libpng fix finding zlib dependency

--- cmake/get-libpng.cmake
+++ cmake/get-libpng.cmake
@@ -9,29 +9,10 @@

 set(LIBPNG_VERSION "1.6.24")

-# For Windows it's faster to download the pre-compiled development binaries.
-if (WIN32)
-
-  if(MSVC)
-
-    ExternalProject_Add(
-      libpng
-      DEPENDS         zlib
-      PREFIX          ${DEPENDENCY_EXTRACT_DIR}
-      DOWNLOAD_DIR    ${DEPENDENCY_DOWNLOAD_DIR}
-      URL             ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/lpng1624.zip
-      URL_MD5         9572a426a87407f6cfa41f61cbe2e3b2
-      BUILD_COMMAND   "msbuild ${DEPENDENCY_EXTRACT_DIR}/src/libpng/projects/vstudio/vstudio.sln /target:libpng /p:Configuration=Release /p:Platform=Win32 /v:minimal"
-      INSTALL_COMMAND
-        COMMAND ${CMAKE_COMMAND} -E copy "${DEPENDENCY_EXTRACT_DIR}/src/libpng/projects/vstudio/Release Library/libpng16.lib" "${DEPENDENCY_INSTALL_DIR}/lib/libpng16.lib"
-    )
-
-  endif(MSVC)
-
-else() # build from source
-
-  set(LIBPNG_CMAKE_ARGS
+set(LIBPNG_CMAKE_ARGS
       ${COMMON_CMAKE_ARGS}
+      -DZLIB_LIBRARY=${DEPENDENCY_INSTALL_DIR}/lib
+      -DZLIB_INCLUDE_DIR=${DEPENDENCY_INSTALL_DIR}/include
       -DPNG_SHARED=off
       -DPNG_STATIC=on
       -DPNG_TESTS=off
@@ -45,8 +26,31 @@
       -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
       -DCMAKE_C_FLAGS=${GL_BINDING_C_FLAGS}
       -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}
-  )
+)

+# For Windows it's faster to download the pre-compiled development binaries.
+if (WIN32)
+
+  if(MSVC)
+
+    ExternalProject_Add(
+      libpng
+      DEPENDS         zlib
+      PREFIX          ${DEPENDENCY_EXTRACT_DIR}
+      DOWNLOAD_DIR    ${DEPENDENCY_DOWNLOAD_DIR}
+      URL             ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng16/lpng1624.zip
+      URL_MD5         9572a426a87407f6cfa41f61cbe2e3b2
+      #BUILD_COMMAND   "msbuild ${DEPENDENCY_EXTRACT_DIR}/src/libpng/projects/vstudio/vstudio.sln /t:libpng /p:Configuration=Release /p:Platform=Win32 /v:minimal"
+      INSTALL_COMMAND
+        COMMAND ${CMAKE_COMMAND} -E copy "${DEPENDENCY_EXTRACT_DIR}/src/libpng/projects/vstudio/Release Library/libpng16.lib" "${DEPENDENCY_INSTALL_DIR}/lib/libpng16.lib"
+      INSTALL_DIR     ${DEPENDENCY_INSTALL_DIR}
+      CMAKE_ARGS      ${LIBPNG_CMAKE_ARGS}
+    )
+
+  endif(MSVC)
+
+else() # build from source
+
   ExternalProject_Add(
     libpng
     DEPENDS      zlib


Allow for gccxy instead for gcc-x.y

Allow for gccxy instead for gcc-x.y

--- cmake/nvcc-check.cmake
+++ cmake/nvcc-check.cmake
@@ -6,8 +6,8 @@
 #
 # This script:
 #   * Checks the version of default gcc
-#   * If CUDA 4.x, we look for gcc-4.4
-#   * If not found or CUDA<4, we look for gcc-4.3 on the system
+#   * If CUDA 4.x, we look for gcc-4.4 or gcc44
+#   * If not found or CUDA<4, we look for gcc-4.3 or gcc43 on the system
 #   * If found we tell nvcc to use it
 #   * If not found, fatal error
 ######################################################################
@@ -15,26 +15,30 @@
 # This function searches for gcc version x.y (arguments 2 and 3 of the macro)
 # Return the result in argument 1, empty if not found
 FUNCTION(FIND_GCC GCC_PATH GCC_MAJOR GCC_MINOR)
-
   # Search for gcc-x.y
   FIND_PROGRAM(EXACT_GCC "gcc-${GCC_MAJOR}.${GCC_MINOR}")
   IF(EXACT_GCC)
     SET(GCC_PATH "${EXACT_GCC}" PARENT_SCOPE)
   ELSE(EXACT_GCC)
-    # gcc-x.y not found, check default gcc
-    FIND_PROGRAM(DEFAULT_GCC gcc)
-    EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
-
-    # Get major and minor revs
-    STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" GCCVER_MAJOR "${GCCVER}")
-    STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" GCCVER_MINOR "${GCCVER}")
-
-    # Check that adequate
-    IF("${GCCVER_MAJOR}" MATCHES "${GCC_MAJOR}" AND "${GCCVER_MINOR}" MATCHES "${GCC_MINOR}")
-      SET(GCC_PATH ${DEFAULT_GCC} PARENT_SCOPE)
-    ENDIF()
+    # Search for gccxy
+    FIND_PROGRAM(EXACT_GCC2 "gcc${GCC_MAJOR}${GCC_MINOR}")
+    IF(EXACT_GCC2)
+      SET(GCC_PATH "${EXACT_GCC2}" PARENT_SCOPE)
+    ELSE(EXACT_GCC2)
+      # gcc-x.y not found, check default gcc
+      FIND_PROGRAM(DEFAULT_GCC gcc)
+      EXEC_PROGRAM(${DEFAULT_GCC} ARGS "-dumpversion" OUTPUT_VARIABLE GCCVER)
+
+      # Get major and minor revs
+      STRING(REGEX REPLACE "^([0-9]+)\\..*" "\\1" GCCVER_MAJOR "${GCCVER}")
+      STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" GCCVER_MINOR "${GCCVER}")
+
+      # Check that adequate
+      IF("${GCCVER_MAJOR}" MATCHES "${GCC_MAJOR}" AND "${GCCVER_MINOR}" MATCHES "${GCC_MINOR}")
+        SET(GCC_PATH ${DEFAULT_GCC} PARENT_SCOPE)
+      ENDIF()
+    ENDIF(EXACT_GCC2)
   ENDIF(EXACT_GCC)
-
 ENDFUNCTION(FIND_GCC)

 # Main code dealing with each version of cuda


variable cleanup
fixed some weird aliasing between macros and local variable

git-svn-id: 609522d7d408cfa97e9ff3bac4923f7fa96011fc@166 3149698f-976c-419d-aa71-eec1decff2c2

--- extensions/FindMatlab.cmake
+++ extensions/FindMatlab.cmake
@@ -208,7 +208,7 @@
         current_match ${match})
       #message(STATUS "current match is ${CMAKE_MATCH_0} ${CMAKE_MATCH_1} ${CMAKE_MATCH_2} ${CMAKE_MATCH_3} ${CMAKE_MATCH_4}")

-      set(current_matlab_version ${CMAKE_MATCH_1})
+      set(_matlab_current_version ${CMAKE_MATCH_1})
       set(current_matlab_version_major ${CMAKE_MATCH_2})
       set(current_matlab_version_minor ${CMAKE_MATCH_4})
       if(NOT current_matlab_version_minor)
@@ -217,7 +217,8 @@

       #message(STATUS "Matlab in registry ${current_matlab_version_major}.${current_matlab_version_minor}")

-      list(APPEND matlabs_from_registry ${current_matlab_version})
+      list(APPEND matlabs_from_registry ${_matlab_current_version})
+      unset(_matlab_current_version)
     endforeach(match)

   endif()
@@ -275,18 +276,20 @@
 function(matlab_get_all_valid_matlab_roots_from_registry matlab_versions matlab_roots)

   set(_matlab_roots_list )
-  foreach(current_matlab_version ${matlab_versions})
+  foreach(_matlab_current_version ${matlab_versions})
     get_filename_component(
       current_MATLAB_ROOT
-      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\${current_matlab_version};MATLABROOT]"
+      "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\${_matlab_current_version};MATLABROOT]"
       ABSOLUTE)

     if(EXISTS ${current_MATLAB_ROOT})
-      list(APPEND _matlab_roots_list ${current_matlab_version} ${current_MATLAB_ROOT})
-    endif()
-
-  endforeach(current_matlab_version)
+      list(APPEND _matlab_roots_list ${_matlab_current_version} ${current_MATLAB_ROOT})
+    endif()
+
+  endforeach(_matlab_current_version)
+  unset(_matlab_current_version)
   set(${matlab_roots} ${_matlab_roots_list} PARENT_SCOPE)
+  unset(_matlab_roots_list)
 endfunction(matlab_get_all_valid_matlab_roots_from_registry)

@@ -527,18 +530,22 @@
                        "the variable MATLAB_ADDITIONAL_VERSIONS can be set according to the documentation")
       endif()

-      foreach(_current_matlab_release IN LISTS _matlab_releases)
-        set(_matlab_full_string "/Applications/MATLAB_${_current_matlab_release}.app")
+      foreach(_matlab_current_release IN LISTS _matlab_releases)
+        set(_matlab_full_string "/Applications/MATLAB_${_matlab_current_release}.app")
         if(EXISTS ${_matlab_full_string})
-          set(current_matlab_version)
-          matlab_get_version_from_release_name(${_current_matlab_release} current_matlab_version)
-          list(APPEND _matlab_possible_roots ${_current_matlab_version})
+          set(_matlab_current_version)
+          matlab_get_version_from_release_name(${_matlab_current_release} _matlab_current_version)
+          if(MATLAB_FIND_DEBUG)
+            message(STATUS "[MATLAB] Found version ${_matlab_current_release} (${_matlab_current_version}) in ${_matlab_full_string}")
+          endif()
+          list(APPEND _matlab_possible_roots ${_matlab_current_version})
           list(APPEND _matlab_possible_roots ${_matlab_full_string})
+          unset(_matlab_current_version)
         endif()

         unset(_matlab_full_string)
-      endforeach(_current_matlab_release)
-      unset(_current_matlab_release)
+      endforeach(_matlab_current_release)
+      unset(_matlab_current_release)
       unset(_matlab_releases)
     endif()


Remove leading /

Remove leading /

--- CMake/FindEigen.cmake
+++ CMake/FindEigen.cmake
@@ -89,7 +89,7 @@
   /opt/local/include
   /usr/include)
 # Additional suffixes to try appending to each search path.
-file(GLOB EIGEN_CANDIDATES ${EIGEN_ROOT}/eigen*)
+file(GLOB EIGEN_CANDIDATES ${EIGEN_ROOT}eigen*)
 LIST(APPEND EIGEN_CHECK_PATH_SUFFIXES
   eigen3 # Default root directory for Eigen.
   Eigen/include/eigen3 ) # Windows (for C:/Program Files prefix).


ENH: better job at finding mysql

ENH: better job at finding mysql

--- CMake/FindMySQL.cmake
+++ CMake/FindMySQL.cmake
@@ -25,6 +25,8 @@
   /usr/local/mysql/include
   "C:/Program Files/MySQL/include"
   "C:/MySQL/include"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/include"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/include"
   DOC "Specify the directory containing mysql.h."
 )

@@ -38,6 +40,8 @@
   /usr/local/mysql/lib
   "C:/Program Files/MySQL/lib"
   "C:/MySQL/lib/debug"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
+  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt"
   DOC "Specify the mysql library here."
 )


SuperBuild: fix match string for platforms

--- SuperBuild/CMake/SuperBuild_Macro.cmake
+++ SuperBuild/CMake/SuperBuild_Macro.cmake
@@ -122,13 +122,11 @@
 macro(ADD_SUPERBUILD_CONFIGURE_VAR project var name)
   set(suffix "${ARGV3}")
   if(DEFINED _SB_${var})
-    list(APPEND ${project}_SB_CONFIG
-      ${name}=${_SB_${var}}${suffix}
-      )
+    set(${project}_SB_CONFIG
+      ${${project}_SB_CONFIG} ${name}=${_SB_${var}}${suffix})
   elseif(DEFINED ${var})
-    list(APPEND ${project}_SB_CONFIG
-      ${name}=${${var}}${suffix}
-      )
+    set(${project}_SB_CONFIG
+      ${${project}_SB_CONFIG} ${name}=${${var}}${suffix})
   endif()
 endmacro(ADD_SUPERBUILD_CONFIGURE_VAR)

@@ -144,13 +142,27 @@
     #default value
     set(${project}_PATCH_DIR ${CMAKE_SOURCE_DIR}/patches/${project})
   endif()
-  ExternalProject_Add_Step(${project} ${external_project_step_name}
-    COMMAND
-    ${CMAKE_COMMAND}
-    -DSOURCE_DIR=${${project}_SB_SRC}
-    -DPATCH_DIR=${${project}_PATCH_DIR}
-    -P ${CMAKE_SOURCE_DIR}/CMake/patch.cmake
-    DEPENDEES patch update
-    DEPENDERS configure
-    )
+
+  if(WIN32)
+    set(DIFF_FILE_MATCH_STRING "win")
+  else()
+    if(APPLE)
+      set(DIFF_FILE_MATCH_STRING "macx")
+    else() #Linux
+      set(DIFF_FILE_MATCH_STRING "linux")
+    endif()
+  endif() #WIN32
+  file(GLOB files_list "${PATCH_DIR}/*${DIFF_FILE_MATCH_STRING}*diff")
+  if(files_list)
+    ExternalProject_Add_Step(${project} ${external_project_step_name}
+      COMMAND
+      ${CMAKE_COMMAND}
+      -DSOURCE_DIR=${${project}_SB_SRC}
+      -DPATCH_DIR=${${project}_PATCH_DIR}
+      -DDIFF_FILE_MATCH_STRING=${DIFF_FILE_MATCH_STRING}
+      -P ${CMAKE_SOURCE_DIR}/CMake/patch.cmake
+      DEPENDEES patch update
+      DEPENDERS configure
+      )
+  endif()
 endmacro(SUPERBUILD_PATCH_SOURCE)


Use whole numbers for dynamic libraries versioning

--- Shared/CMake/JamomaConfiguration.cmake
+++ Shared/CMake/JamomaConfiguration.cmake
@@ -11,7 +11,7 @@
 set(ConfigPackageLocation share/cmake/Jamoma)

 # Jamoma configuration
-set(Jamoma_VERSION 0.6)
+set(Jamoma_VERSION 6)
 set(Jamoma_SOVERSION 6)
 set(Jamoma_MAJOR_VERSION 6)


add doc [skip ci]

add doc [skip ci]

--- modules/export_header.cmake
+++ modules/export_header.cmake
@@ -1,6 +1,9 @@
 #.rst:
 #
 # Generates export header for your API using best practices.
+# This module wraps https://cmake.org/cmake/help/v3.0/module/GenerateExportHeader.html and
+# it is needed because of these, Very Good Indeed, reasons: https://gcc.gnu.org/wiki/Visibility.
+# If you are not afraid of jargon, please also have a look at https://www.akkadia.org/drepper/dsohowto.pdf.
 #
 # Variables used::
 #


Adding support for easybuild

Adding support for easybuild

Former-commit-id: 724421aae0d2de4c81b5eac24a1a77ac754b701e

--- cmake-modules/FindPackageHDF5.cmake
+++ cmake-modules/FindPackageHDF5.cmake
@@ -78,9 +78,8 @@
         if(HDF5_USE_STATIC_LIBRARIES)
         message(STATUS "The HDF5 library is parallel and you are linking with -static.\n   The find_package(MPI) command is likely to give a shared library")
         endif()
-#        set(MPI_C_COMPILER mpicc)
-#        find_package(MPI)
-        target_link_libraries(hdf5 INTERFACE -lmpi )
+#        find_package(MPI REQUIRED)
+#        target_link_libraries(hdf5 INTERFACE MPI::MPI_C )
 #        get_target_property(MPI_LIB MPI::MPI_C INTERFACE_LINK_LIBRARIES)
 #        message("Found MPI Library: ${MPI_LIB}")
 #        include(cmake-modules/PrintTargetProperties.cmake)


GoogleBenchmark: do not build self-tests

--- cmake/Modules/GoogleBenchmark.cmake
+++ cmake/Modules/GoogleBenchmark.cmake
@@ -29,6 +29,9 @@
 # let's insist on static library.
 set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)

+# not interested
+set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "" FORCE)
+
 set(CMAKE_C_FLAGS_SAVE "${CMAKE_C_FLAGS}")
 set(CMAKE_CXX_FLAGS_SAVE "${CMAKE_CXX_FLAGS}")


xf86vidmodeproto: Generate CMake config

xf86vidmodeproto: Generate CMake config

--- cmake/projects/xf86vidmodeproto/hunter.cmake
+++ cmake/projects/xf86vidmodeproto/hunter.cmake
@@ -29,8 +29,9 @@
 )
 hunter_cmake_args(
     xf86vidmodeproto
-    CMAKE_ARGS         # do not use double quotes on CMAKE_ARGS
-      DEPENDS_ON_PACKAGES=${xf86vidmodeproto_dependencies}
+    CMAKE_ARGS
+    DEPENDS_ON_PACKAGES=${xf86vidmodeproto_dependencies}
+    PKGCONFIG_EXPORT_TARGETS=xf86vidmodeproto
 )
 hunter_cacheable(xf86vidmodeproto)
 hunter_download(


Add path suffixes for metis

Add path suffixes for metis

--- cmake/FindMetis.cmake
+++ cmake/FindMetis.cmake
@@ -4,11 +4,18 @@
     find_path(METIS_INCLUDE_DIRS
         NAMES metis.h parmetis.h
         PATHS $ENV{METIS_ROOT}
-        PATH_SUFFIXES metis
+        PATH_SUFFIXES metis include
         )

-    find_library(METIS_LIBRARY    metis    PATHS $ENV{METIS_ROOT})
-    find_library(PARMETIS_LIBRARY parmetis PATHS $ENV{METIS_ROOT})
+    find_library(METIS_LIBRARY metis
+        PATHS $ENV{METIS_ROOT}
+        PATH_SUFFIXES lib
+        )
+
+    find_library(PARMETIS_LIBRARY parmetis
+        PATHS $ENV{METIS_ROOT}
+        PATH_SUFFIXES lib
+        )

     set(METIS_LIBRARIES "${PARMETIS_LIBRARY};${METIS_LIBRARY}")
 endif()


ENH: clang support for sanitizer.  NOTE: clang 3.7 needs to be built using CMake to get the asan library.  Autotool built does not provide it.  unfortunately, default ubuntu package does not use Cmake build.

--- cmake/Sanitizer.cmake
+++ cmake/Sanitizer.cmake
@@ -4,10 +4,21 @@
   # probably should be specific based on sanitizer style.  no-omit-frame-pointer is for address.
   add_definitions(-fsanitize=${SANITIZER_STYLE} -fPIE -fno-omit-frame-pointer)
   # and static-libtsan is for thread.
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie -static-libtsan")
-  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie -static-libtsan")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie -static-libtsan")
-  set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie -static-libtsan")
+
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+    if ("${SANITIZER_STYLE}" MATCHES "thread")
+		set(SANITIZER_EXTRA_FLAGS "-static-libtsan")
+	else()
+	    set(SANITIZER_EXTRA_FLAGS "")
+	endif()
+else()
+	set(SANITIZER_EXTRA_FLAGS "")
+endif()
+
+  set(CMAKE_EXE_LINKER_FLAGS    "${CMAKE_EXE_LINKER_FLAGS}    -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie ${SANITIZER_EXTRA_FLAGS}")
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie ${SANITIZER_EXTRA_FLAGS}")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie ${SANITIZER_EXTRA_FLAGS}")
+  set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -fsanitize=${SANITIZER_STYLE} -fno-omit-frame-pointer -pie ${SANITIZER_EXTRA_FLAGS}")

   # NOTE: if using thread sanitizer, please use g++ 4.9 and later, compiled with --disable-linux-futex (for libgomp)
   #  else lots of false positives from OMP will be reported by tsan


Skip building TSan on platforms where there are no 64-bit architectures.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -371,7 +371,11 @@
         if(DARWIN_${platform}_ARCHS)
           list(APPEND SANITIZER_COMMON_SUPPORTED_OS ${platform})
           list(APPEND PROFILE_SUPPORTED_OS ${platform})
-          list(APPEND TSAN_SUPPORTED_OS ${platform})
+
+          list_intersect(DARWIN_${platform}_TSAN_ARCHS DARWIN_${platform}_ARCHS ALL_TSAN_SUPPORTED_ARCH)
+          if(DARWIN_${platform}_TSAN_ARCHS)
+            list(APPEND TSAN_SUPPORTED_OS ${platform})
+          endif()
         endif()
         foreach(arch ${DARWIN_${platform}_ARCHS})
           list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})


[Compiler-rt][MIPS][Profile] Adding support for MIPS32/64

Summary:
Changed cmake/config-ix.cmake to add support for different MIPS architectures: mips, mipsel, mips64, mips64el
In profile code there is no target  based dependencies, so just enabling mips flag does the work.

Patch by Mohit Bhakkad

Reviewers: dsanders, void, petarj, kcc, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits, farazs, kumarsukhani

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

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -132,7 +132,14 @@
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC")
     test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS})
   elseif("${LLVM_NATIVE_ARCH}" STREQUAL "Mips")
-    test_target_arch(mips "")
+    if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "mipsel|mips64el")
+      # regex for mipsel, mips64el
+      test_target_arch(mipsel ${TARGET_32_BIT_CFLAGS})
+      test_target_arch(mips64el ${TARGET_64_BIT_CFLAGS})
+    else()
+      test_target_arch(mips ${TARGET_32_BIT_CFLAGS})
+      test_target_arch(mips64 ${TARGET_64_BIT_CFLAGS})
+    endif()
   endif()
   # Build ARM libraries if we are configured to test on ARM
   if("${COMPILER_RT_TEST_TARGET_ARCH}" MATCHES "arm|aarch64")
@@ -158,7 +165,7 @@

 # Arhcitectures supported by compiler-rt libraries.
 filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
-  x86_64 i386 i686 powerpc64 arm aarch64 mips)
+  x86_64 i386 i686 powerpc64 arm aarch64 mips mips64 mipsel mips64el)
 filter_available_targets(ASAN_SUPPORTED_ARCH
   x86_64 i386 i686 powerpc64 arm mips)
 filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64)
@@ -168,7 +175,7 @@
 filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH
   ${SANITIZER_COMMON_SUPPORTED_ARCH})
 filter_available_targets(MSAN_SUPPORTED_ARCH x86_64)
-filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64)
+filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 i686 arm mips mips64 mipsel mips64el aarch64)
 filter_available_targets(TSAN_SUPPORTED_ARCH x86_64)
 filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386 i686 arm aarch64 mips)


search for deb only in linux, nsis only in windows, programmanager only in macos, rpm disabled

git-svn-id: e7ea667a1d39a4453c4efcc4ba7bca3d620c3f19@740 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_cpack.cmake
+++ cmake/pcl_cpack.cmake
@@ -3,27 +3,36 @@
 ###############################################################################
 #find available package generators

-# RPM
-find_program(RPM_PROGRAM rpm)
-if(EXISTS ${RPM_PROGRAM})
-  list(APPEND CPACK_GENERATOR "RPM")
-endif(EXISTS ${RPM_PROGRAM})
+# RPM (disabled until RedHat/Fedora users/developers need this)
+#find_program(RPM_PROGRAM rpm)
+#if(EXISTS ${RPM_PROGRAM})
+#  list(APPEND CPACK_GENERATOR "RPM")
+#endif(EXISTS ${RPM_PROGRAM})
+
 # DEB
-find_program(DPKG_PROGRAM dpkg)
-if(EXISTS ${DPKG_PROGRAM})
-  list(APPEND CPACK_GENERATOR "DEB")
-endif(EXISTS ${DPKG_PROGRAM})
+if("${CMAKE_SYSTEM}" MATCHES "Linux")
+  find_program(DPKG_PROGRAM dpkg)
+  if(EXISTS ${DPKG_PROGRAM})
+    list(APPEND CPACK_GENERATOR "DEB")
+  endif(EXISTS ${DPKG_PROGRAM})
+endif()
+
 # NSIS
-find_program(NSIS_PROGRAM makensis MakeNSIS)
-if(EXISTS ${NSIS_PROGRAM})
-  list(APPEND CPACK_GENERATOR "NSIS")
-endif(EXISTS ${NSIS_PROGRAM})
+if(WIN32)
+  find_program(NSIS_PROGRAM makensis MakeNSIS)
+  if(EXISTS ${NSIS_PROGRAM})
+    list(APPEND CPACK_GENERATOR "NSIS")
+  endif(EXISTS ${NSIS_PROGRAM})
+endif()
+
 # dpkg
-find_program(PACKAGE_MAKER_PROGRAM PackageMaker
-	    HINTS /Developer/Applications/Utilities)
-if(EXISTS ${PACKAGE_MAKER_PROGRAM})
-  list(APPEND CPACK_GENERATOR "PackageMaker")
-endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
+if(APPLE)
+  find_program(PACKAGE_MAKER_PROGRAM PackageMaker
+               HINTS /Developer/Applications/Utilities)
+  if(EXISTS ${PACKAGE_MAKER_PROGRAM})
+    list(APPEND CPACK_GENERATOR "PackageMaker")
+  endif(EXISTS ${PACKAGE_MAKER_PROGRAM})
+endif()

 include(InstallRequiredSystemLibraries)


rename the main macro

rename the main macro

--- cmake/rosbuild2.cmake
+++ cmake/rosbuild2.cmake
@@ -1,6 +1,6 @@
 get_filename_component(dynamic_reconfigure_SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

-macro(generate_cfg)
+macro(generate_dynamic_reconfigure_options)
   set(_autogen "")
   foreach(_cfg ${ARGN})


Revert "- Fix regression introduced on commit:"

This reverts commit 9e191386c76008f3fb2e02b30eadb91e70e4ecf9.
Pull request/review process not completed.

--- cmake/cmake-3.2.0-modules/FindGit.cmake
+++ cmake/cmake-3.2.0-modules/FindGit.cmake
@@ -100,6 +100,7 @@
 # Handle the QUIETLY and REQUIRED arguments and set GIT_FOUND to TRUE if
 # all listed variables are TRUE

+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
 find_package_handle_standard_args(Git
                                   REQUIRED_VARS GIT_EXECUTABLE
                                   VERSION_VAR GIT_VERSION_STRING)


Update FindCouchbaseErlang.cmake to latest from tlm

Change-Id: Ida715df99c94080fa8d2fcf9a61035317a5981ba
Reviewed-on: http://review.couchbase.org/37379
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>

--- cmake_modules/FindCouchbaseErlang.cmake
+++ cmake_modules/FindCouchbaseErlang.cmake
@@ -64,46 +64,65 @@
   IF (NOT ERLANG_FOUND)
     FIND_PROGRAM(ERLC_EXECUTABLE erlc)
     FIND_PROGRAM(ERL_EXECUTABLE erl)
-    IF (ERLC_EXECUTABLE-NOTFOUND OR ERL_EXECUTABLE-NOTFOUND)
-      SET(ERLANG_FOUND False)
-      IF (ERL_EXECUTABLE-NOTFOUND)
-        MESSAGE(STATUS "Erlang runtime (erl) not found")
-      ENDIF (ERL_EXECUTABLE-NOTFOUND)
-      IF (ERLC_EXECUTABLE-NOTFOUND)
-        MESSAGE(STATUS "Erlang compiler (erlc) not found")
-      ENDIF (ERLC_EXECUTABLE-NOTFOUND)
-    ELSE (ERLC_EXECUTABLE-NOTFOUND OR ERL_EXECUTABLE-NOTFOUND)
+    IF (ERLC_EXECUTABLE AND ERL_EXECUTABLE)
       SET(ERLANG_FOUND True CACHE BOOL "Whether Erlang has been found")
       GET_FILENAME_COMPONENT(ERL_REAL_EXE ${ERL_EXECUTABLE} REALPATH)
       GET_FILENAME_COMPONENT(ERL_LOCATION ${ERL_REAL_EXE} PATH)
-      FIND_PATH(ERLANG_INCLUDE_PATH erl_nif.h
+
+      FIND_PATH(ERL_NATIVE_FEATURES_CONFIG_INCLUDE_PATH erl_native_features_config.h
+        HINTS
+        ${ERL_LOCATION}/../usr/include
         PATHS
-        ${ERL_LOCATION}/../usr/include
         /usr/lib/erlang/usr/include
         /usr/local/lib/erlang/usr/include
         /opt/local/lib/erlang/usr/include
         /usr/lib64/erlang/usr/include)

+      IF (ERL_NATIVE_FEATURES_CONFIG_INCLUDE_PATH)
+         SET(ERLANG_INCLUDE_PATH "${ERL_NATIVE_FEATURES_CONFIG_INCLUDE_PATH}"
+             CACHE STRING "Path to Erlang include files")
+      ELSE (ERL_NATIVE_FEATURES_CONFIG_INCLUDE_PATH)
+         FIND_PATH(ERL_NIF_INCLUDE_PATH erl_nif.h
+                   HINTS
+                   ${ERL_LOCATION}/../usr/include
+                   PATHS
+                   /usr/lib/erlang/usr/include
+                   /usr/local/lib/erlang/usr/include
+                   /opt/local/lib/erlang/usr/include
+                   /usr/lib64/erlang/usr/include)
+         SET(ERLANG_INCLUDE_PATH "${ERL_NIF_INCLUDE_PATH}"
+             CACHE STRING "Path to Erlang include files")
+      ENDIF (ERL_NATIVE_FEATURES_CONFIG_INCLUDE_PATH)
+
       MESSAGE(STATUS "Erlang runtime and compiler found in ${ERL_EXECUTABLE} and ${ERLC_EXECUTABLE}")

       FIND_PROGRAM(PROVE_EXECUTABLE prove)
-      IF (PROVE_EXECUTABLE-NOTFOUND)
-        MESSAGE ("prove testdriver not found - "
+      IF (NOT PROVE_EXECUTABLE)
+        MESSAGE (STATUS "prove testdriver not found - "
           "erlang testing unavailable")
-      ENDIF (PROVE_EXECUTABLE-NOTFOUND)
+      ENDIF (NOT PROVE_EXECUTABLE)

       FIND_PROGRAM(ESCRIPT_EXECUTABLE escript)
-      IF (ESCRIPT_EXECUTABLE-NOTFOUND)
-        MESSAGE ("escript interpreter not found - "
+      IF (NOT ESCRIPT_EXECUTABLE)
+        MESSAGE (STATUS "escript interpreter not found - "
           "rebar support will be unavailable")
-      ELSE (ESCRIPT_EXECUTABLE-NOTFOUND)
+      ELSE (NOT ESCRIPT_EXECUTABLE)
         MESSAGE(STATUS "Escript interpreter found in ${ESCRIPT_EXECUTABLE}")
         SET (REBAR_SCRIPT "${CMAKE_CURRENT_LIST_DIR}/rebar"
           CACHE STRING "Path to default rebar script")
-      ENDIF (ESCRIPT_EXECUTABLE-NOTFOUND)
+      ENDIF (NOT ESCRIPT_EXECUTABLE)

       MESSAGE(STATUS "Erlang nif header in ${ERLANG_INCLUDE_PATH}")
-    ENDIF(ERLC_EXECUTABLE-NOTFOUND OR ERL_EXECUTABLE-NOTFOUND)
+    ELSE(ERLC_EXECUTABLE AND ERL_EXECUTABLE)
+      SET(ERLANG_FOUND False)
+      IF (NOT ERL_EXECUTABLE)
+        MESSAGE(STATUS "Erlang runtime (erl) not found")
+      ENDIF (NOT ERL_EXECUTABLE)
+      IF (NOT ERLC_EXECUTABLE)
+        MESSAGE(STATUS "Erlang compiler (erlc) not found")
+      ENDIF (NOT ERLC_EXECUTABLE)
+      MESSAGE (FATAL_ERROR "Erlang not found - cannot continue building")
+    ENDIF(ERLC_EXECUTABLE AND ERL_EXECUTABLE)

     MARK_AS_ADVANCED(ERLANG_FOUND ERL_EXECUTABLE ERLC_EXECUTABLE ESCRIPT_EXECUTABLE ERLANG_INCLUDE_PATH)
   ENDIF (NOT ERLANG_FOUND)
@@ -119,10 +138,10 @@
   # "rebar clean". <target>-clean will be added as a dependency to
   # "realclean".
   MACRO (Rebar)
-    IF (ESCRIPT_EXECUTABLE-NOTFOUND)
+    IF (NOT ESCRIPT_EXECUTABLE)
       MESSAGE (FATAL_ERROR "escript not found, therefore Rebar() "
         "cannot function.")
-    ENDIF (ESCRIPT_EXECUTABLE-NOTFOUND)
+    ENDIF (NOT ESCRIPT_EXECUTABLE)

     PARSE_ARGUMENTS (Rebar "DEPENDS;REBAR_OPTS" "TARGET;REBAR_SCRIPT"
       "NOCLEAN;NOALL" ${ARGN})
@@ -212,5 +231,49 @@
     ADD_CUSTOM_TARGET(${AppName} ALL DEPENDS ${outfiles})
   ENDMACRO (ERL_BUILD)

+  MACRO (ERL_BUILD_OTP AppName)
+    SET(outfiles)
+    GET_FILENAME_COMPONENT(EBIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ebin" ABSOLUTE)
+    IF (IS_DIRECTORY ${EBIN_DIR})
+      SET(${AppName}_ebin ${EBIN_DIR})
+    ELSE (IS_DIRECTORY ${EBIN_DIR})
+      SET(${AppName}_ebin ${CMAKE_CURRENT_BINARY_DIR}/ebin)
+      FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ebin)
+    ENDIF (IS_DIRECTORY ${EBIN_DIR})
+
+    IF (ERLANG_INCLUDE_DIR)
+      SET(ERLANG_INCLUDES ${ERLANG_INCLUDE_DIR})
+    ENDIF (ERLANG_INCLUDE_DIR)
+
+    SET(${AppName}_src ${CMAKE_CURRENT_SOURCE_DIR})
+
+    #Set application modules
+    SET(${AppName}_module_list)
+
+    FOREACH (it ${ARGN})
+      GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
+      GET_FILENAME_COMPONENT(outfile_ext ${it} EXT)
+      SET(${AppName}_module_list ${${AppName}_module_list} "'${outfile}'")
+      IF (${outfile_ext} STREQUAL ".asn" OR ${outfile_ext} STREQUAL ".ASN")
+        SET(outfile
+          ${${AppName}_ebin}/${outfile}.erl
+          ${${AppName}_ebin}/${outfile}.hrl
+          ${${AppName}_ebin}/${outfile}.asn1db
+          ${${AppName}_ebin}/${outfile}.beam)
+      ELSE(${outfile_ext} STREQUAL ".asn" OR ${outfile_ext} STREQUAL ".ASN")
+        SET(outfile
+          ${${AppName}_ebin}/${outfile}.beam)
+      ENDIF(${outfile_ext} STREQUAL ".asn" OR ${outfile_ext} STREQUAL ".ASN")
+      SET(outfiles ${outfiles} ${outfile})
+      GET_FILENAME_COMPONENT(it ${it} ABSOLUTE)
+      ADD_CUSTOM_COMMAND(
+        OUTPUT ${outfile}
+        COMMAND ${ERLC_EXECUTABLE} -o ${${AppName}_ebin} ${ERLANG_INCLUDES} ${ERLANG_COMPILE_FLAGS} ${it}
+        DEPENDS ${it}
+        VERBATIM)
+    ENDFOREACH(it)
+    ADD_CUSTOM_TARGET(${AppName} ALL DEPENDS ${outfiles})
+  ENDMACRO (ERL_BUILD_OTP)
+
   SET (FindCouchbaseErlang_INCLUDED 1)
 ENDIF (NOT FindCouchbaseErlang_INCLUDED)


PARQUET-1067: Update arrow hash to 0.5.0

Author: Uwe L. Korn <uwe@apache.org>

Closes #374 from xhochy/PARQUET-1067 and squashes the following commits:

a10aaef [Uwe L. Korn] PARQUET-1067: Update arrow hash to 0.5.0

--- cmake_modules/ThirdpartyToolchain.cmake
+++ cmake_modules/ThirdpartyToolchain.cmake
@@ -339,7 +339,7 @@
     -DARROW_BUILD_TESTS=OFF)

   if ("$ENV{PARQUET_ARROW_VERSION}" STREQUAL "")
-    set(ARROW_VERSION "afb192824a75ab81fbc8dcd2da56409186bb23e0")
+    set(ARROW_VERSION "e9f76e125b836d0fdc0a533e2fee3fca8bf4c1a1")
   else()
     set(ARROW_VERSION "$ENV{PARQUET_ARROW_VERSION}")
   endif()


CastXML 0.4.4

CastXML 0.4.4

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


Increase stack size for applications on Windows, closes #133

--- components/ospcommon/cmake/macros.cmake
+++ components/ospcommon/cmake/macros.cmake
@@ -368,6 +368,12 @@
   ELSE()
     MESSAGE(FATAL_ERROR
             "Unsupported compiler specified: '${CMAKE_CXX_COMPILER_ID}'")
+  ENDIF()
+
+  IF (WIN32)
+    # increase stack to 8MB (the default size of 1MB is too small for our apps)
+    # note: linker options are independent of compiler (icc or MSVC)
+    SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:8388608")
   ENDIF()
 ENDMACRO()


Fix memcheck flags

Fix memcheck flags

--- Testing/script/travis_script.cmake
+++ Testing/script/travis_script.cmake
@@ -126,7 +126,7 @@
 endif()

 if($ENV{CC} MATCHES "^gcc.*")
-  set(MERCURY_C_FLAGS "-Wall -Wextra -Wshadow -Winline -Wundef -Wcast-qual -Wconversion -Wmissing-prototypes -pedantic -Wpointer-arith -Wformat=2 -std=gnu99" ${MERCURY_MEMCHECK_FLAGS})
+  set(MERCURY_C_FLAGS "-Wall -Wextra -Wshadow -Winline -Wundef -Wcast-qual -Wconversion -Wmissing-prototypes -pedantic -Wpointer-arith -Wformat=2 -std=gnu99 ${MERCURY_MEMCHECK_FLAGS}")
 endif()

 # Initial cache used to build mercury, options can be modified here


Suppression du module CMAKE de free tds

Suppression du module CMAKE de free tds

\o/
\o/
\o/
\o/
\o/
\o/

--- source/cmake_modules/FindfreeTDS.cmake
+++ source/cmake_modules/FindfreeTDS.cmake
@@ -1,37 +0,0 @@
-IF(WIN32)
-  FIND_PATH(FreeTDS_INCLUDE_DIR sqlfront.h PATHS D:/freeTDS/include c:/freeTDS/include "${LIB_PREFIX}FreeTDS/include")
-  IF(CMAKE_CFG_INTDIR MATCHES "Debug")
-    SET(FreeTDS_LIBRARY_DIR ${FreeTDS_INCLUDE_DIR}/../lib-debug)
-  else(CMAKE_CFG_INTDIR MATCHES "Debug")
-    SET(FreeTDS_LIBRARY_DIR ${FreeTDS_INCLUDE_DIR}/../lib)
-  ENDIF(CMAKE_CFG_INTDIR MATCHES "Debug")
-ELSE(WIN32)
-  FIND_PATH(FreeTDS_INCLUDE_DIR sqlfront.h)
-ENDIF(WIN32)
-
-IF(WIN32)
-  FIND_LIBRARY(FreeTDS_DBLIB NAMES dblib PATHS ${FreeTDS_LIBRARY_DIR})
-  FIND_LIBRARY(FreeTDS_TDSLIB NAMES libTDS PATHS ${FreeTDS_LIBRARY_DIR})
-    MESSAGE(STATUS "Found FreeTDS bleau: ${FreeTDS_DBLIB} ${FreeTDS_TDSLIB}")
-  IF(FreeTDS_DBLIB AND FreeTDS_TDSLIB AND FreeTDS_INCLUDE_DIR)
-    SET(FreeTDS_LIBS ${FreeTDS_DBLIB} ${FreeTDS_TDSLIB} Ws2_32)
-    SET(FreeTDS_FOUND TRUE)
-  ENDIF(FreeTDS_DBLIB AND FreeTDS_TDSLIB AND FreeTDS_INCLUDE_DIR)
-ELSE(WIN32)
-  FIND_LIBRARY(FreeTDS_SYBDB NAMES sybdb)
-  IF(FreeTDS_SYBDB AND FreeTDS_INCLUDE_DIR)
-    SET(FreeTDS_LIBS ${FreeTDS_SYBDB})
-    SET(FreeTDS_FOUND TRUE)
-  ENDIF(FreeTDS_SYBDB AND FreeTDS_INCLUDE_DIR)
-ENDIF(WIN32)
-
-IF (FreeTDS_FOUND)
-   IF (NOT FreeTDS_FIND_QUIETLY)
-      MESSAGE(STATUS "Found FreeTDS: ${FreeTDS_LIBS}")
-   ENDIF (NOT FreeTDS_FIND_QUIETLY)
-ELSE (FreeTDS_FOUND)
-   IF (FreeTDS_FIND_REQUIRED)
-      MESSAGE(FATAL_ERROR "Could not find FreeTDS")
-   ENDIF (FreeTDS_FIND_REQUIRED)
-ENDIF (FreeTDS_FOUND)
-


added: header for coverage exclusion

added: header for coverage exclusion

--- cmake/HUGH_SUPPORT_SetupVariables.cmake
+++ cmake/HUGH_SUPPORT_SetupVariables.cmake
@@ -13,3 +13,5 @@
 include(CMakeAddons_SetupVariables)

 set(${PROJECT_NAME}_COVERAGE_EXCLUDE "${${PROJECT_NAME}_COVERAGE_EXCLUDE} 'inc/boost/*'")
+set(${PROJECT_NAME}_COVERAGE_EXCLUDE "${${PROJECT_NAME}_COVERAGE_EXCLUDE} 'support/chrono_io.hpp'")
+set(${PROJECT_NAME}_COVERAGE_EXCLUDE "${${PROJECT_NAME}_COVERAGE_EXCLUDE} 'support/ratio_io.hpp'")


waffle: Bump version to 1.4.90 for post-release

We always bump the version on master after a release and before merging
any non-trival patches.

Signed-off-by: Chad Versace <a557f7f75bf28dc19ac99107f5cc7cd6b3fbdb1a@linux.intel.com>

--- cmake/Modules/WaffleDefineVersion.cmake
+++ cmake/Modules/WaffleDefineVersion.cmake
@@ -40,7 +40,7 @@
 #
 set(waffle_major_version "1")
 set(waffle_minor_version "4")
-set(waffle_patch_version "0")
+set(waffle_patch_version "90")

 set(waffle_version "${waffle_major_version}.${waffle_minor_version}.${waffle_patch_version}")


Revert requirements

Revert requirements

--- cmake/Qt5Widgets_HunterPlugin_5_5.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_5.cmake
@@ -259,7 +259,7 @@
   _qt_cmake_extra_helpers_add_interface(Qt5::Widgets winmm)

   # defined: '_eglChooseConfig'
-  # _qt_cmake_extra_helpers_add_interface(Qt5::Widgets Qt5::Gui_EGL)
+  _qt_cmake_extra_helpers_add_interface(Qt5::Widgets Qt5::Gui_EGL)

   # defined: '_Direct3DCreate9'
   _qt_cmake_extra_helpers_add_interface(Qt5::Widgets d3d9)


CCBC-816: Fix DNS SRV support on Fedora 26 and FreeBSD

Change-Id: I0cbb54b615f5c71c75e91a02145def0df031633d
Reviewed-on: http://review.couchbase.org/82000
Tested-by: Build Bot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Sergey Avseyev <87f6d5e4fd3644c3c20800cde7fd3ad1569370b3@gmail.com>

--- cmake/Modules/GenerateConfigDotH.cmake
+++ cmake/Modules/GenerateConfigDotH.cmake
@@ -9,7 +9,7 @@
     CHECK_FUNCTION_EXISTS(clock_gettime HAVE_CLOCK_GETTIME)
     CHECK_FUNCTION_EXISTS(setitimer HAVE_SETITIMER)
     CHECK_SYMBOL_EXISTS(htonll arpa/inet.h HAVE_HTONLL)
-    CHECK_SYMBOL_EXISTS(res_search resolv.h HAVE_RES_SEARCH)
+    CHECK_SYMBOL_EXISTS(res_search "netinet/in.h; resolv.h" HAVE_RES_SEARCH)
     CHECK_INCLUDE_FILES(dlfcn.h HAVE_DLFCN_H)
     CHECK_INCLUDE_FILES(netdb.h HAVE_NETDB_H)
     CHECK_INCLUDE_FILES(stdint.h HAVE_STDINT_H)


removed NO_DERAULT_PATH from FindMumps.cmake

--- cmake/FindMumps.cmake
+++ cmake/FindMumps.cmake
@@ -21,6 +21,7 @@
 if($ENV{MUMPS_ROOT})
 set(LIB_SEARCH_PATH ${LIB_SEARCH_PATH} $ENV{MUMPS_ROOT}/lib)
 endif()
+set(LIB_SEARCH_PATH ${LIB_SEARCH_PATH} ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.2/lib)
 set(LIB_SEARCH_PATH ${LIB_SEARCH_PATH} ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.1/lib)
 set(LIB_SEARCH_PATH ${LIB_SEARCH_PATH} ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.0/lib)
 set(LIB_SEARCH_PATH ${LIB_SEARCH_PATH} ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.2/lib)
@@ -33,20 +34,21 @@

 find_library(MUMPS_D_LIB
   NAMES dmumps
-  HINTS ${LIB_SEARCH_PATH} NO_DEFAULT_PATH
+  HINTS ${LIB_SEARCH_PATH}
 )
 find_library(MUMPS_COMMON_LIB
   NAMES mumps_common
-  HINTS ${LIB_SEARCH_PATH} NO_DEFAULT_PATH
+  HINTS ${LIB_SEARCH_PATH}
 )
 find_library(MUMPS_PORD_LIB
   NAMES pord
-  HINTS ${LIB_SEARCH_PATH} NO_DEFAULT_PATH
+  HINTS ${LIB_SEARCH_PATH}
 )

 find_path(MUMPS_INCLUDE_PATH
   NAMES mumps_compat.h
   HINTS $ENV{MUMPS_ROOT}/include
+    ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.2/include
     ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.1/include
     ${CMAKE_SOURCE_DIR}/../MUMPS_5.1.0/include
     ${CMAKE_SOURCE_DIR}/../MUMPS_5.0.2/include
@@ -56,7 +58,6 @@
     ${CMAKE_INCLUDE_PATH}
     /usr/local/include
     /usr/include
-    NO_DEFAULT_PATH
 )
 if(MUMPS_D_LIB AND MUMPS_COMMON_LIB AND MUMPS_PORD_LIB AND MUMPS_INCLUDE_PATH)
   set(MUMPS_LIBRARIES ${MUMPS_D_LIB} ${MUMPS_COMMON_LIB} ${MUMPS_PORD_LIB})


refs #71, fix warning disable syntax for msvc

--- cmake/GhcHelper.cmake
+++ cmake/GhcHelper.cmake
@@ -50,7 +50,7 @@
             $<$<BOOL:${EMSCRIPTEN}>:-s DISABLE_EXCEPTION_CATCHING=0>
             $<$<CXX_COMPILER_ID:Clang>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Werror -Wno-error=deprecated-declarations>
             $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra -Wshadow -Wconversion -Wsign-conversion -Wpedantic -Wno-psabi -Werror -Wno-error=deprecated-declarations>
-            $<$<CXX_COMPILER_ID:MSVC>:/WX /WD4996>)
+            $<$<CXX_COMPILER_ID:MSVC>:/WX /wd"4996">)
     if(CMAKE_CXX_COMPILER_ID MATCHES MSVC)
         target_compile_definitions(filesystem_test_cpp${cppStd} PRIVATE _CRT_SECURE_NO_WARNINGS)
     endif()


[cmake] major change in GridUtils * we add the include dirs and link dirs per grid type   depending only on the fact, that the grid was found * we also add the libs of all found grids to GRIDLIBS * depending on the users choice of GRIDTYPE we only   set stuff like -DENABLE_FOO for the   Dune::GridSelector, nothing else All in all, this should finally allow to use different grids in one place (e.g. lib).

--- cmake/GridUtils.cmake
+++ cmake/GridUtils.cmake
@@ -12,32 +12,38 @@
 add_definitions( "-D${GRIDTYPE}" )
 add_definitions( "-DGRIDDIM=${GRIDDIM}" )

+if(UG_GRID_FOUND)
+  include_sys_dir( ${UG_GRID_INCLUDE_DIRS} )
+  link_directories( ${UG_GRID_LIBRARY_DIRS} )
+  # althoug we use pkg_config to find ug we do not use UG_LIBRARIES,
+  # because those listed in lubug.pc are wrong
+  set(UGGRID_LIBS ugS2 ugS3 devS m)
+endif(UG_GRID_FOUND)
+
 set( ENABLE_UG OFF )
 if( ${GRIDTYPE} MATCHES "UGGRID" )
   if( NOT UG_GRID_FOUND )
     message( FATAL_ERROR "Gridtype ${GRIDTYPE} requested, but libug was not found!" )
   endif( NOT UG_GRID_FOUND )
-  include_sys_dir( ${UG_GRID_INCLUDE_DIRS} )
-  link_directories( ${UG_GRID_LIBRARY_DIRS} )
-  # althoug we use pkg_config to find ug we do not use UG_LIBRARIES,
-  # because those listed in lubug.pc are wrong
-  set( GRIDLIBS ugS2 ugS3 devS m )
   add_definitions( "-DENABLE_UG=1" )
 endif( ${GRIDTYPE} MATCHES "UGGRID" )
+
+if(ALU_GRID_FOUND)
+  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS} )
+  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS}/serial )
+  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS}/duneinterface )
+	if(ENABLE_MPI)
+		include_sys_dir( ${ALUGRID_BASE_PATH}/include/parallel )
+	endif(ENABLE_MPI)
+  link_directories( ${ALU_GRID_LIBRARY_DIRS} )
+  set(ALUGRID_LIBS ${ALU_GRID_LIBRARIES} )
+endif(ALU_GRID_FOUND)

 SET( ENABLE_ALUGRID OFF )
 if( ${GRIDTYPE} MATCHES "ALUGRID" )
   if( NOT ALU_GRID_FOUND )
     message( FATAL_ERROR "Gridtype ${GRIDTYPE} requested, but alugrid was not found!" )
   endif( NOT ALU_GRID_FOUND )
-  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS} )
-  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS}/serial )
-  include_sys_dir( ${ALU_GRID_INCLUDE_DIRS}/duneinterface )
-  link_directories( ${ALU_GRID_LIBRARY_DIRS} )
-  set( GRIDLIBS ${ALU_GRID_LIBRARIES} )
-	if( ENABLE_MPI )
-		include_sys_dir( ${ALUGRID_BASE_PATH}/include/parallel )
-	endif( ENABLE_MPI )
 	add_definitions( "-DENABLE_ALUGRID=1" )
 endif( ${GRIDTYPE} MATCHES "ALUGRID" )

@@ -50,3 +56,5 @@
 	#SET( ENABLE_ALBERTA ON )
 	#ADD_DEFINITIONS( -DENABLE_ALBERTA=1 -DDEBUG )
 #ENDIF( ${GRIDTYPE} MATCHES "ALBERTAGRID" )
+
+set( GRIDLIBS ${UGGRID_LIBS} ${ALUGRID_LIBS} )


Revert change for LibFuzzer target archs

Broke buildbot.

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -194,7 +194,7 @@
 set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64}
     ${MIPS32} ${MIPS64} ${PPC64} ${S390X})
 set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64})
-set(ALL_FUZZER_SUPPORTED_ARCH ${X86_64})
+set(ALL_FUZZER_SUPPORTED_ARCH x86_64)

 if(APPLE)
   set(ALL_LSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${MIPS64} ${ARM64})


[runtimes] Use -Wunknown-pragmas for the pragma check

This is a follow up to r362055, we need -Wunknown-pragmas otherwise
the check is going to succeed it the pragma isn't supported.

git-svn-id: 62ef012455b6b8fcec9c41ca270ebf409aae1006@362057 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -1,3 +1,4 @@
+include(CMakePushCheckState)
 include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 include(CheckLibraryExists)
@@ -57,10 +58,13 @@

 # Check compiler pragmas
 if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+  cmake_push_check_state()
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror=unknown-pragmas")
   check_c_source_compiles("
 #pragma comment(lib, \"c\")
 int main() { return 0; }
 " LIBUNWIND_HAS_COMMENT_LIB_PRAGMA)
+  cmake_pop_check_state()
 endif()

 # Check compiler flags


no need for no-omit-frame-pointer for the RelWithDefInfo build

--- cmake/configure.cmake
+++ cmake/configure.cmake
@@ -50,7 +50,7 @@
         set(CMAKE_CXX_FLAGS                     "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
         set(CMAKE_CXX_FLAGS_DEBUG               "-g -fno-omit-frame-pointer")
         set(CMAKE_CXX_FLAGS_RELEASE             "-O3 -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO      "-O2 -g -fno-omit-frame-pointer")       # -DEIGEN_NO_DEBUG")
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO      "-O3 -g")                               # -DEIGEN_NO_DEBUG")
         set(CMAKE_CXX_FLAGS_MINSIZEREL          "-Os -DNDEBUG")                         # -DEIGEN_NO_DEBUG")
         set(CMAKE_EXE_LINKER_FLAGS              "-flto")


[cmake] fix component find

[cmake] fix component find

--- cmake/nd-config.cmake
+++ cmake/nd-config.cmake
@@ -54,8 +54,14 @@
 endif()

 ### Handle components
+# component name and the imported target must be the same
 foreach(package ${ND_FIND_COMPONENTS})
   find_package(${package} CONFIG PATHS .)
+  get_property(plugin TARGET ${package} PROPERTY LOCATION)
+  if(plugin) ## should remove this when I add config files for the plugins?
+    set(ND_${package}_FOUND TRUE)
+  endif()
+  install(FILES ${plugin} DESTINATION bin/plugins)
 endforeach()

 ### Check everything got found
@@ -67,12 +73,43 @@
 )

 ### macro for copying plugins to a target's build Location
-macro(nd_copy_plugins_to_target _target)
-    add_custom_command(TARGET ${_target} POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E copy_directory
-          ${INSTALL_DIR}/bin/plugins
-          $<TARGET_FILE_DIR:${_target}>/plugins
-          COMMENT "Copying libnd plugins to build path for ${_target}."
-          )
-    add_dependencies(${_target} libnd)
-endmacro()
+# component name and the imported target must be the same
+#
+# plugins should define an "Extras" variable named <plugin>-EXTRAS
+# that has an extra files (eg associated shared libraries) to be copied
+# along side the plugin.
+function(nd_copy_plugins_to_target _target _plugins)
+    list(REMOVE_AT ARGV 0)
+    foreach(package ${ARGV})
+      if(NOT TARGET ${package})
+        find_package(${package} CONFIG PATHS .)
+      endif()
+      if(TARGET ${package})
+        get_property(plugin TARGET ${package} PROPERTY LOCATION)
+        if(plugin)
+          message(STATUS "Configuring ${package} to be copied to build path for ${_target}.")
+          add_custom_command(TARGET ${_target} POST_BUILD
+            COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${_target}>/plugins/
+            COMMAND ${CMAKE_COMMAND} -E copy
+                ${plugin}
+                $<TARGET_FILE_DIR:${_target}>/plugins
+                COMMENT "Copying ${package} to build path for ${_target}."
+                )
+          add_dependencies(${_target} ${package})
+          # extras
+          if(${package}-EXTRAS)
+            message(STATUS "Configuring ${package} extras to be copied to build path for ${_target}.")
+            foreach(extra ${${package}-EXTRAS})
+            add_custom_command(TARGET ${_target} POST_BUILD
+                COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:${_target}>/plugins/
+                COMMAND ${CMAKE_COMMAND} -E copy
+                    ${extra}
+                    $<TARGET_FILE_DIR:${_target}>/plugins
+                    COMMENT "Copying ${extra} to build path for ${_target}."
+                    )
+            endforeach()
+          endif()
+        endif()
+      endif()
+    endforeach()
+endfunction()


CMake: Add CentOS to the RPM-based distributions (#5809)

--- cmake/packaging.cmake
+++ cmake/packaging.cmake
@@ -61,6 +61,7 @@

     set(rpm_distros
       Fedora
+      CentOS
     )

     if("${lsb_release_id_short}" IN_LIST deb_distros)


Fix some issues with app set up on the Mac - oops :)

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -272,27 +272,27 @@
     endif()

     file (REMOVE_RECURSE
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Resources
+            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
+            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
     )
     file (MAKE_DIRECTORY
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Frameworks
-            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Resources
+            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks
+            ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources
     )

-    if (NOT _STATIC)
-        add_custom_command(TARGET ${CEGUI_TARGET_NAME} POST_BUILD
-            COMMAND ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Frameworks/
-            COMMENT "Creating ${_ACTIONMSG} built cegui libraries in ${CEGUI_TARGET_NAME}.app")
-    endif()
-
-    add_custom_command(TARGET ${CEGUI_TARGET_NAME} POST_BUILD
-        COMMAND ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Frameworks/
-        COMMENT "Creating ${_ACTIONMSG} dependency libraries in ${CEGUI_TARGET_NAME}.app")
-
-    add_custom_command(TARGET ${CEGUI_TARGET_NAME} POST_BUILD
-        COMMAND ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CEGUI_TARGET_NAME}.app/Contents/Resources/
-        COMMENT "Creating ${_ACTIONMSG} sample datafiles ${CEGUI_TARGET_NAME}.app")
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND ${_ACTIONCMD} ${CMAKE_PREFIX_PATH}/lib/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+        COMMENT "Creating ${_ACTIONMSG} dependency libraries in ${_TARGET_NAME}.app")
+
+    if (NOT ${_STATIC})
+        add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+            COMMAND ${_ACTIONCMD} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/*.dylib ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Frameworks/
+            COMMENT "Creating ${_ACTIONMSG} built cegui libraries in ${_TARGET_NAME}.app")
+    endif()
+
+    add_custom_command(TARGET ${_TARGET_NAME} POST_BUILD
+        COMMAND ${_ACTIONCMD} ${CMAKE_SOURCE_DIR}/datafiles ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_TARGET_NAME}.app/Contents/Resources/
+        COMMENT "Creating ${_ACTIONMSG} sample datafiles ${_TARGET_NAME}.app")
 endmacro()

 #
@@ -390,7 +390,7 @@
             ARCHIVE DESTINATION ${CEGUI_LIB_INSTALL_DIR}
     )

-    if (CEGUI_BUILD_STATIC_CONFIGURATION)
+        if (CEGUI_BUILD_STATIC_CONFIGURATION)
             install(TARGETS ${CEGUI_TARGET_NAME}_Static
                 RUNTIME DESTINATION bin
                 LIBRARY DESTINATION ${CEGUI_LIB_INSTALL_DIR}


Update Package Contact information.

Update Package Contact information.

--- cmake/CPackConfig.cmake
+++ cmake/CPackConfig.cmake
@@ -10,7 +10,7 @@
 SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY "FALSE")
 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Source Routing Machine (OSRM) is a high-performance routing engine. It combines sophisticated routing algorithms with the open and free data of the OpenStreetMap.")
-SET(CPACK_PACKAGE_CONTACT "Dennis Luxen <info@project-osrm.org>")
+SET(CPACK_PACKAGE_CONTACT "Project OSRM <info@project-osrm.org>")
 SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENCE.TXT")

 SET(CPACK_STRIP_FILES "TRUE")


fix compilation on Win 7

fix compilation on Win 7

--- cmake/FindCLAPACK.cmake
+++ cmake/FindCLAPACK.cmake
@@ -23,15 +23,15 @@
 #

 find_library( LAPACK_LIBRARY NAMES lapack
-  PATHS $ENV{CLAPACK_DIR} $CLAPACK_DIR}
+  PATHS $ENV{CLAPACK_DIR} ${CLAPACK_DIR}
   PATH_SUFFIXES "lib")

 find_library( BLAS_LIBRARY NAMES blas
-  PATHS $ENV{CLAPACK_DIR} $CLAPACK_DIR}
+  PATHS $ENV{CLAPACK_DIR} ${CLAPACK_DIR}
   PATH_SUFFIXES "lib")

 find_library( F2C_LIBRARY NAMES f2c
-  PATHS $ENV{CLAPACK_DIR} $CLAPACK_DIR}
+  PATHS $ENV{CLAPACK_DIR} ${CLAPACK_DIR}
   PATH_SUFFIXES "lib")

@@ -39,7 +39,7 @@

 find_path( CLAPACK_INCLUDE_DIR
   NAMES "clapack.h"
-  PATHS $ENV{CLAPACK_DIR} $CLAPACK_DIR}
+  PATHS $ENV{CLAPACK_DIR} ${CLAPACK_DIR}
   PATH_SUFFIXES "include" )


CMake: ivw_private_get_ivw_module_name: check whole contents, not line by line, to find cases where a line break exists within ivw_module(...)

--- cmake/globalutils.cmake
+++ cmake/globalutils.cmake
@@ -560,14 +560,11 @@
 # Get the module name from a CMakeLists.txt
 function(ivw_private_get_ivw_module_name path retval)
     file(READ ${path} contents)
-     string(REPLACE "\n" ";" lines "${contents}")
-     foreach(line ${lines})
-        string(REGEX MATCH "ivw_module\\([ \t\r\n]*([A-Za-z0-9_-]+)[ \t\r\n]*\\)" found_item ${line})
-        if(CMAKE_MATCH_1)
-            set(${retval} ${CMAKE_MATCH_1} PARENT_SCOPE)
-            return()
-       endif()
-     endforeach()
+    string(REGEX MATCH "ivw_module\\([ \t\r\n]*([A-Za-z0-9_-]+)[ \t\r\n]*\\)" found_item ${contents})
+    if(CMAKE_MATCH_1)
+        set(${retval} ${CMAKE_MATCH_1} PARENT_SCOPE)
+        return()
+    endif()
      set(${retval} NOTFOUND PARENT_SCOPE)
 endfunction()


Update: make explanatory statement when a subsystem is disabled

git-svn-id: 5398946ba177a3e438c2dae55e2cdfc2fb96c905@3958 a9d63959-f2ad-4865-b262-bf0e56cfafb6

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -595,8 +595,8 @@
     string(TOUPPER "pcl_${_subsys}_dependies" PCL_SUBSYS_DEPENDIES)
     if(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
         foreach(dep ${${PCL_SUBSYS_DEPENDIES}})
-            PCL_SET_SUBSYS_HYPERSTATUS(${_subsys} ${dep} AUTO_OFF "Automatically disabled.")
-            set(BUILD_${dep} OFF CACHE BOOL "Automatically disabled ${dep}" FORCE)
+            PCL_SET_SUBSYS_HYPERSTATUS(${_subsys} ${dep} AUTO_OFF "Disabled: ${_subsys} missing.")
+            set(BUILD_${dep} OFF CACHE BOOL "Disabled: ${_subsys} missing." FORCE)
         endforeach(dep)
     endif(NOT ("${${PCL_SUBSYS_DEPENDIES}}" STREQUAL ""))
 endmacro(PCL_DISABLE_DEPENDIES subsys)


switch to CACHE to avoid warnings about missing PARENT_SCOPE, #101

--- cmake/tools/gtest.cmake
+++ cmake/tools/gtest.cmake
@@ -30,9 +30,9 @@
 if(NOT GTEST_FOUND)
   message(WARNING "GTest not found; C++ tests will fail to build.")
 else()
-  set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} PARENT_SCOPE)
-  set(GTEST_LIBRARIES ${GTEST_LIBRARIES} PARENT_SCOPE)
-  set(GTEST_MAIN_LIBRARIES ${GTEST_MAIN_LIBRARIES} PARENT_SCOPE)
-  set(GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} PARENT_SCOPE)
-  set(GTEST_FOUND ${GTEST_FOUND} PARENT_SCOPE)
+  set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIRS} CACHE INTERNAL "")
+  set(GTEST_LIBRARIES ${GTEST_LIBRARIES} CACHE INTERNAL "")
+  set(GTEST_MAIN_LIBRARIES ${GTEST_MAIN_LIBRARIES} CACHE INTERNAL "")
+  set(GTEST_BOTH_LIBRARIES ${GTEST_BOTH_LIBRARIES} CACHE INTERNAL "")
+  set(GTEST_FOUND ${GTEST_FOUND} CACHE INTERNAL "")
 endif()


Add comment back in.

Add comment back in.

--- cmake/Modules/FindLuaBuild/LuaJIT.cmake
+++ cmake/Modules/FindLuaBuild/LuaJIT.cmake
@@ -255,20 +255,20 @@

 # # Post-Build moving steps for necessary items
 # Add post-step to move library afterwards
-set(LUA_JIT_POSTBUILD_COMMENTS "Executable - Moving \"${LUA_JIT_SOURCE_LUA_INTERPRETER}\" to \"${LUA_JIT_DESTINATION_LUA_INTERPRETER}\"...\n")
+set(LUA_JIT_POSTBUILD_COMMENTS "Executable - Moving \"${LUA_JIT_SOURCE_LUA_INTERPRETER}\" to \"${LUA_JIT_DESTINATION_LUA_INTERPRETER}\"...")
 set(LUA_JIT_POSTBUILD_COMMANDS COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_INTERPRETER}" "${LUA_JIT_DESTINATION_LUA_INTERPRETER}")
 if (BUILD_LUA_AS_DLL)
 	if (MSVC)
-		set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}Import Library - Moving \"${LUA_JIT_SOURCE_LUA_IMP_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_IMP_LIB}\"...\n")
+		set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}\nImport Library - Moving \"${LUA_JIT_SOURCE_LUA_IMP_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_IMP_LIB}\"...")
 		set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_IMP_LIB}" "${LUA_JIT_DESTINATION_LUA_IMP_LIB}")

-		set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}Library - Moving \"${LUA_JIT_SOURCE_LUA_LIB_EXP}\" to \"${LUA_JIT_DESTINATION_LUA_LIB_EXP}\"...\n")
+		set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}\nLibrary - Moving \"${LUA_JIT_SOURCE_LUA_LIB_EXP}\" to \"${LUA_JIT_DESTINATION_LUA_LIB_EXP}\"...")
 		set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} && "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_LIB_EXP}" "${LUA_JIT_DESTINATION_LUA_LIB_EXP}")
 	endif()
-	set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}Dynamic Library - Moving \"${LUA_JIT_SOURCE_LUA_DLL}\" to \"${LUA_JIT_DESTINATION_LUA_DLL}\"...\n")
+	set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}\nDynamic Library - Moving \"${LUA_JIT_SOURCE_LUA_DLL}\" to \"${LUA_JIT_DESTINATION_LUA_DLL}\"...")
 	set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_DLL}" "${LUA_JIT_DESTINATION_LUA_DLL}")
 else()
-	set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}Library - Moving \"${LUA_JIT_SOURCE_LUA_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_LIB}\"...\n")
+	set(LUA_JIT_POSTBUILD_COMMENTS "${LUA_JIT_POSTBUILD_COMMENTS}\nLibrary - Moving \"${LUA_JIT_SOURCE_LUA_LIB}\" to \"${LUA_JIT_DESTINATION_LUA_LIB}\"...")
 	set(LUA_JIT_POSTBUILD_COMMANDS ${LUA_JIT_POSTBUILD_COMMANDS} COMMAND "${CMAKE_COMMAND}" -E copy "${LUA_JIT_SOURCE_LUA_LIB}" "${LUA_JIT_DESTINATION_LUA_LIB}")
 endif()

@@ -325,6 +325,7 @@
 add_custom_command(TARGET LUA_JIT
 	POST_BUILD
 	${LUA_JIT_POSTBUILD_COMMANDS}
+	COMMENT ${LUA_JIT_POSTBUILD_COMMENTS}
 	BYPRODUCTS "${LUA_JIT_INSTALL_BYPRODUCTS}"
 )


Qt 5.9 Linux: Link to libQt5ServiceSupport.a

--- cmake/Qt5Widgets_HunterPlugin_5_9.cmake
+++ cmake/Qt5Widgets_HunterPlugin_5_9.cmake
@@ -200,6 +200,12 @@
       Qt5::Widgets "${_qt_install_prefix}/lib/libQt5ThemeSupport.a"
   )

+  # undefined reference to `vtable for QGenericUnixServices'
+  # (before libQt5XcbQpa.a)
+  _qt_cmake_extra_helpers_add_interface(
+      Qt5::Widgets "${_qt_install_prefix}/lib/libQt5ServiceSupport.a"
+  )
+
   # undefined reference to `SmcCloseConnection' (depends on SM, ICE)
   _qt_cmake_extra_helpers_add_interface(
       Qt5::Widgets "${_qt_install_prefix}/lib/libQt5XcbQpa.a"


cmake: compiler: Add nostdincxx property for gcc

This commit adds the `nostdincxx` C++ compiler property for GCC, which
is specified when the C++ standard library (`CONFIG_LIB_CPLUSPLUS`) is
disabled.

Signed-off-by: Stephanos Ioannidis <dc76e9f0c0006e8f919e0c515c66dbba3982f785@stephanos.io>

--- cmake/compiler/gcc/compiler_flags.cmake
+++ cmake/compiler/gcc/compiler_flags.cmake
@@ -120,6 +120,8 @@
   set_compiler_property(APPEND PROPERTY nostdinc_include ${NOSTDINC})
 endif()

+set_compiler_property(TARGET compiler-cpp PROPERTY nostdincxx "-nostdinc++")
+
 # Required C++ flags when using gcc
 set_property(TARGET compiler-cpp PROPERTY required "-fcheck-new")


cmake: fix usage of Zephyr SDK tools with 3rd party toolchains

Fixes: #25183

This commit fixes the issue where combining a 3rd party toolchain with
Zephyr SDK Tools would result in the Zephyr SDK overruling the toolchain
in use.

This is fixed by keeping track of current toolchain variant.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>

--- cmake/toolchain/zephyr/host-tools.cmake
+++ cmake/toolchain/zephyr/host-tools.cmake
@@ -39,7 +39,16 @@
   SET(CMAKE_FIND_PACKAGE_SORT_ORDER NATURAL)

   if(DEFINED ZEPHYR_SDK_INSTALL_DIR)
+    # The Zephyr SDK will automatically set the toolchain variant.
+    # To support Zephyr SDK tools (DTC, and other tools) with 3rd party toolchains
+    # then we keep track of current toolchain variant.
+    set(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT ${ZEPHYR_TOOLCHAIN_VARIANT})
     find_package(Zephyr-sdk ${MINIMUM_REQUIRED_SDK_VERSION} QUIET HINTS $ENV{ZEPHYR_SDK_INSTALL_DIR})
+    if(ZEPHYR_CURRENT_TOOLCHAIN_VARIANT)
+      if(NOT "zephyr" STREQUAL ${ZEPHYR_CURRENT_TOOLCHAIN_VARIANT})
+        set(ZEPHYR_TOOLCHAIN_VARIANT ${ZEPHYR_CURRENT_TOOLCHAIN_VARIANT})
+      endif()
+    endif()
   else()
     find_package(Zephyr-sdk ${MINIMUM_REQUIRED_SDK_VERSION} QUIET PATHS
                  /usr


[Build] Added the macro for Readline dependency.

--- config/project_config_embeddable.cmake
+++ config/project_config_embeddable.cmake
@@ -252,6 +252,10 @@
       get_boost (${_arg_version})
     endif (${_arg_lower} STREQUAL "boost")

+    if (${_arg_lower} STREQUAL "readline")
+      get_readline (${_arg_version})
+    endif (${_arg_lower} STREQUAL "readline")
+
     if (${_arg_lower} STREQUAL "mysql")
       get_mysql (${_arg_version})
     endif (${_arg_lower} STREQUAL "mysql")
@@ -333,6 +337,33 @@
   endif (Boost_FOUND)

 endmacro (get_boost)
+
+# ~~~~~~~~~~ Readline ~~~~~~~~~
+macro (get_readline)
+  set (_required_version 0)
+  if (${ARGC} GREATER 0)
+    set (_required_version ${ARGV0})
+    message (STATUS "Requires Readline-${_required_version}")
+  else (${ARGC} GREATER 0)
+    message (STATUS "Requires Readline without specifying any version")
+  endif (${ARGC} GREATER 0)
+
+  set (READLINE_FOUND False)
+
+  find_package (Readline)
+  if (READLINE_LIBRARY)
+    set (READLINE_FOUND True)
+  endif (READLINE_LIBRARY)
+
+  if (READLINE_FOUND)
+    # Update the list of include directories for the project
+    include_directories (${READLINE_INCLUDE_DIR})
+
+    # Update the list of dependencies for the project
+    set (PROJ_DEP_LIBS_FOR_LIB ${PROJ_DEP_LIBS_FOR_LIB} ${READLINE_LIBRARY})
+  endif (READLINE_FOUND)
+
+endmacro (get_readline)

 # ~~~~~~~~~~ MySQL ~~~~~~~~~
 macro (get_mysql)
@@ -829,7 +860,7 @@

   # Register the (CMake) target for the executable, and specify the name
   # of that latter
-  add_executable (${_exec_name}bin ${_exec_source_dir}/${MODULE_NAME}.cpp)
+  add_executable (${_exec_name}bin ${_exec_source_dir}/${_exec_name}.cpp)
   set_target_properties (${_exec_name}bin PROPERTIES OUTPUT_NAME ${_exec_name})

   # Register the dependencies on which the binary depends upon
@@ -848,7 +879,7 @@

   # Register, for reporting purpose, the list of executables to be built
   # and installed for that module
-  list (APPEND ${MODULE_NAME}_ALL_EXECS ${PROJ_ALL_BIN_TARGETS})
+  list (APPEND ${MODULE_NAME}_ALL_EXECS ${_exec_name})
   set (${MODULE_NAME}_ALL_EXECS ${${MODULE_NAME}_ALL_EXECS} PARENT_SCOPE)

 endmacro (module_binary_add)
@@ -1026,6 +1057,17 @@
     message (STATUS "  - Boost required libraries ... : ${BOOST_REQUIRED_LIBS}")
   endif (Boost_FOUND)
 endmacro (display_boost)
+
+# Readline
+macro (display_readline)
+  if (READLINE_FOUND)
+    message (STATUS)
+    message (STATUS "* Readline:")
+    message (STATUS "  - READLINE_VERSION ........... : ${READLINE_VERSION}")
+    message (STATUS "  - READLINE_INCLUDE_DIR ....... : ${READLINE_INCLUDE_DIR}")
+    message (STATUS "  - READLINE_LIBRARY ........... : ${READLINE_LIBRARY}")
+  endif (READLINE_FOUND)
+endmacro (display_readline)

 # MySQL
 macro (display_mysql)
@@ -1136,6 +1178,7 @@
   message (STATUS "---------------------------------")
   #
   display_boost ()
+  display_readline ()
   display_mysql ()
   display_soci ()
   display_stdair ()


remove SD_USE_ASAN definition

remove SD_USE_ASAN definition

* code that was using this has been removed
* Avoid abort in plugin unit tests when running under ASan.
  * https://isrhub.usurf.usu.edu/petemace/VantageShared/commit/38bd94bb3d52567956dde1a3886225bab0a75537

see issue https://github.com/smanders/externpro/issues/180

--- modules/xpfunmac.cmake
+++ modules/xpfunmac.cmake
@@ -1847,7 +1847,6 @@
   option(XP_USE_ASAN "use address sanitizer" OFF)
   if(XP_USE_ASAN)
     xpStringAppendIfDne(CMAKE_CXX_FLAGS "-fsanitize=address")
-    add_definitions(-DSD_USE_ASAN)
   endif()
   check_cxx_compiler_flag("-O0" has_O0)
   if(has_O0)


Libmal was necessary by kpilot but it's not maintain.
Remove it

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

--- config.h.cmake
+++ config.h.cmake
@@ -109,9 +109,6 @@

 /* Define if you have libjpeg */
 #cmakedefine HAVE_LIBJPEG 1
-
-/* Define if you have MAL libraries */
-#define HAVE_LIBMAL 1

 /* Define if you have libpng */
 #cmakedefine HAVE_LIBPNG 1


Update hip-targets.cmake for hip::host & hip::device

--- packaging/hip-targets.cmake
+++ packaging/hip-targets.cmake
@@ -16,7 +16,7 @@
 set(_targetsDefined)
 set(_targetsNotDefined)
 set(_expectedTargets)
-foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device)
+foreach(_expectedTarget hip::hip_hcc_static hip::hip_hcc hip::hip_device hip::host hip::device)
   list(APPEND _expectedTargets ${_expectedTarget})
   if(NOT TARGET ${_expectedTarget})
     list(APPEND _targetsNotDefined ${_expectedTarget})
@@ -65,6 +65,24 @@
   INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/opt/rocm/hsa/include"
 )

+# Create imported target hip::host
+add_library(hip::host INTERFACE IMPORTED)
+
+set_target_properties(hip::host PROPERTIES
+  INTERFACE_LINK_LIBRARIES "hip::hip_hcc"
+)
+
+# Create imported target hip::device
+add_library(hip::device INTERFACE IMPORTED)
+
+set_target_properties(hip::device PROPERTIES
+  INTERFACE_LINK_LIBRARIES "hip::host;hip::hip_device;hcc::hccrt;hcc::hc_am"
+)
+
+if(CMAKE_VERSION VERSION_LESS 3.0.0)
+  message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.")
+endif()
+
 # Load information for each installed configuration.
 get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
 file(GLOB CONFIG_FILES "${_DIR}/hip-targets-*.cmake")


fix: an error in FindProtobufWithTargets.cmake (#3299)

--- cmake/FindProtobufWithTargets.cmake
+++ cmake/FindProtobufWithTargets.cmake
@@ -87,11 +87,11 @@

 if (protobuf_DEBUG)
     message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
-                   "protobuf_FOUND = ${protobuf_FOUND}"
-                   " protobuf_VERSION = ${protobuf_VERSION}")
-endif ()
-
-if (NOT protobuf_FOUND)
+                   "Protobuf_FOUND = ${Protobuf_FOUND}"
+                   " Protobuf_VERSION = ${Protobuf_VERSION}")
+endif ()
+
+if (NOT Protobuf_FOUND)
     find_package(Protobuf QUIET)
 endif ()


Fix MinGW detection on x86

Fix MinGW detection on x86

MinGW-w64 always uses "w64" as vendor key which the previously
used check for "64" anywhere in the target triplet matched. This
would lead to MinGW-w64 setups always being treated as x64.

Turns out we do not even need this additional check since the
architecture has been correctly determined earlier in this file.
No need to do it again.

--- cmake/OpenCVDetectCXXCompiler.cmake
+++ cmake/OpenCVDetectCXXCompiler.cmake
@@ -147,11 +147,7 @@
 elseif(MINGW)
   set(OpenCV_RUNTIME mingw)

-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpmachine
-                  OUTPUT_VARIABLE OPENCV_GCC_TARGET_MACHINE
-                  OUTPUT_STRIP_TRAILING_WHITESPACE)
-  if(CMAKE_OPENCV_GCC_TARGET_MACHINE MATCHES "64")
-    set(MINGW64 1)
+  if(MINGW64)
     set(OpenCV_ARCH x64)
   else()
     set(OpenCV_ARCH x86)


Slight modification of detecting CPU features under macOS (#178)

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -68,10 +68,13 @@
       string(REGEX REPLACE ".*model[ \t]*:[ \t]+([a-zA-Z0-9_-]+).*" "\\1" _cpu_model "${_cpuinfo}")
       string(REGEX REPLACE ".*flags[ \t]*:[ \t]+([^\n]+).*" "\\1" _cpu_flags "${_cpuinfo}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor" OUTPUT_VARIABLE _vendor_id)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.model"  OUTPUT_VARIABLE _cpu_model)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.family" OUTPUT_VARIABLE _cpu_family)
-      exec_program("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE _cpu_flags)
+      exec_program("/usr/sbin/sysctl -n machdep.cpu.vendor machdep.cpu.model machdep.cpu.family machdep.cpu.features" OUTPUT_VARIABLE _sysctl_output_string)
+      string(REPLACE "\n" ";" _sysctl_output ${_sysctl_output_string})
+      list(GET _sysctl_output 0 _vendor_id)
+      list(GET _sysctl_output 1 _cpu_model)
+      list(GET _sysctl_output 2 _cpu_family)
+      list(GET _sysctl_output 3 _cpu_flags)
+
       string(TOLOWER "${_cpu_flags}" _cpu_flags)
       string(REPLACE "." "_" _cpu_flags "${_cpu_flags}")
    elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")


add support for Intel icelake

add support for Intel icelake

--- cmake/OptimizeForArchitecture.cmake
+++ cmake/OptimizeForArchitecture.cmake
@@ -130,16 +130,18 @@
          # 4E | Skylake Client
          # 3C | Broadwell (likely a bug in the SDE)
          # 3C | Haswell
-         if(_cpu_model EQUAL 87) # 57
+         if(_cpu_model EQUAL 142 OR _cpu_model EQUAL 158) # 8E, 9E
+            set(TARGET_ARCHITECTURE "kaby-lake")
+         elseif(_cpu_model EQUAL 106)
+            set(TARGET_ARCHITECTURE "icelake")
+         elseif(_cpu_model EQUAL 102)
+            set(TARGET_ARCHITECTURE "cannonlake")
+         elseif(_cpu_model EQUAL 87) # 57
             set(TARGET_ARCHITECTURE "knl")  # Knights Landing
          elseif(_cpu_model EQUAL 92)
             set(TARGET_ARCHITECTURE "goldmont")
          elseif(_cpu_model EQUAL 90 OR _cpu_model EQUAL 76)
             set(TARGET_ARCHITECTURE "silvermont")
-         elseif(_cpu_model EQUAL 102)
-            set(TARGET_ARCHITECTURE "cannonlake")
-         elseif(_cpu_model EQUAL 142 OR _cpu_model EQUAL 158) # 8E, 9E
-            set(TARGET_ARCHITECTURE "kaby-lake")
          elseif(_cpu_model EQUAL 85) # 55
             set(TARGET_ARCHITECTURE "skylake-avx512")
          elseif(_cpu_model EQUAL 78 OR _cpu_model EQUAL 94) # 4E, 5E
@@ -225,7 +227,7 @@
 Setting the value to \"auto\" will try to optimize for the architecture where cmake is called. \
 Other supported values are: \"none\", \"generic\", \"core\", \"merom\" (65nm Core2), \
 \"penryn\" (45nm Core2), \"nehalem\", \"westmere\", \"sandy-bridge\", \"ivy-bridge\", \
-\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kaby-lake\", \"cannonlake\", \"silvermont\", \
+\"haswell\", \"broadwell\", \"skylake\", \"skylake-xeon\", \"kaby-lake\", \"cannonlake\", \"icelake\", \"silvermont\", \
 \"goldmont\", \"knl\" (Knights Landing), \"atom\", \"k8\", \"k8-sse3\", \"barcelona\", \
 \"istanbul\", \"magny-cours\", \"bulldozer\", \"interlagos\", \"piledriver\", \
 \"AMD 14h\", \"AMD 16h\", \"zen\", \"zen3\".")
@@ -327,6 +329,8 @@
       endif()
    elseif(TARGET_ARCHITECTURE STREQUAL "knl")
       _knightslanding()
+   elseif(TARGET_ARCHITECTURE STREQUAL "icelake")
+      _cannonlake()
    elseif(TARGET_ARCHITECTURE STREQUAL "cannonlake")
       _cannonlake()
    elseif(TARGET_ARCHITECTURE STREQUAL "kaby-lake")
@@ -509,6 +513,7 @@
          endforeach(_flag)
       elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
          set(OFA_map_knl "-xMIC-AVX512")
+         set(OFA_map_icelake "-xCORE-AVX512")
          set(OFA_map_cannonlake "-xCORE-AVX512")
          set(OFA_map_skylake-avx512 "-xCORE-AVX512")
          set(OFA_map_skylake "-xCORE-AVX2")


Allow GluonCommon CMake module to find it correctly when Gluon is installed outside of KDEDIR

--- cmake/modules/FindGluonCommon.cmake
+++ cmake/modules/FindGluonCommon.cmake
@@ -20,15 +20,15 @@

 find_path(GLUONCOMMON_INCLUDE_DIR
     NAMES
-    common/ksingleton.h
+    gluon/common/ksingleton.h
     PATHS
-    ${INCLUDE_INSTALL_DIR}/gluon
+    ${INCLUDE_INSTALL_DIR}
 )

 set(GLUONCOMMON_INCLUDES
-    ${GLUONCOMMON_INCLUDE_DIR}
+    ${GLUONCOMMON_INCLUDE_DIR}/gluon
     CACHE STRING "Common files for Gluon"
 )

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GluonCommon DEFAULT_MSG GLUONCOMMON_INCLUDE_DIR)
+find_package_handle_standard_args(GluonCommon DEFAULT_MSG GLUONCOMMON_INCLUDES)


hunter_download: fix priority in toolchain

--- cmake/modules/hunter_download.cmake
+++ cmake/modules/hunter_download.cmake
@@ -192,17 +192,7 @@
   file(REMOVE "${HUNTER_DOWNLOAD_TOOLCHAIN}")
   file(REMOVE "${HUNTER_ARGS_FILE}")

-  file(
-      WRITE
-      "${HUNTER_DOWNLOAD_TOOLCHAIN}"
-      "set(HUNTER_ALREADY_LOCKED_DIRECTORIES \"${HUNTER_ALREADY_LOCKED_DIRECTORIES}\" CACHE INTERNAL \"\")\n"
-  )
-
-  file(
-      APPEND
-      "${HUNTER_DOWNLOAD_TOOLCHAIN}"
-      "set(HUNTER_PARENT_PACKAGE \"${HUNTER_PACKAGE_NAME};${HUNTER_PACKAGE_COMPONENT}\" CACHE INTERNAL \"\")\n"
-  )
+  file(WRITE "${HUNTER_DOWNLOAD_TOOLCHAIN}" "")

   hunter_jobs_number(HUNTER_JOBS_OPTION "${HUNTER_DOWNLOAD_TOOLCHAIN}")
   hunter_status_debug("HUNTER_JOBS_NUMBER: ${HUNTER_JOBS_NUMBER}")
@@ -214,6 +204,19 @@
     get_filename_component(x "${CMAKE_TOOLCHAIN_FILE}" ABSOLUTE)
     file(APPEND "${HUNTER_DOWNLOAD_TOOLCHAIN}" "include(\"${x}\")\n")
   endif()
+
+  # After toolchain! (toolchain may already have this variables)
+  file(
+      APPEND
+      "${HUNTER_DOWNLOAD_TOOLCHAIN}"
+      "set(HUNTER_PARENT_PACKAGE \"${HUNTER_PACKAGE_NAME};${HUNTER_PACKAGE_COMPONENT}\" CACHE INTERNAL \"\")\n"
+  )
+  file(
+      APPEND
+      "${HUNTER_DOWNLOAD_TOOLCHAIN}"
+      "set(HUNTER_ALREADY_LOCKED_DIRECTORIES \"${HUNTER_ALREADY_LOCKED_DIRECTORIES}\" CACHE INTERNAL \"\")\n"
+  )
+

   hunter_create_args_file(
       "${HUNTER_${h_name}_CMAKE_ARGS}" "${HUNTER_ARGS_FILE}"


[wasm] use same export name for SIMD/NOSIMD build (#12545)

--- cmake/onnxruntime_webassembly.cmake
+++ cmake/onnxruntime_webassembly.cmake
@@ -223,19 +223,17 @@
   endif()

   if (onnxruntime_ENABLE_WEBASSEMBLY_THREADS)
+    set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasmThreaded -s USE_PTHREADS=1")
     if (onnxruntime_ENABLE_WEBASSEMBLY_SIMD)
-      set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasmSimdThreaded -s USE_PTHREADS=1")
       set_target_properties(onnxruntime_webassembly PROPERTIES OUTPUT_NAME "ort-wasm-simd-threaded")
     else()
-      set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasmThreaded -s USE_PTHREADS=1")
       set_target_properties(onnxruntime_webassembly PROPERTIES OUTPUT_NAME "ort-wasm-threaded")
     endif()
   else()
+    set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasm")
     if (onnxruntime_ENABLE_WEBASSEMBLY_SIMD)
-      set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasmSimd")
       set_target_properties(onnxruntime_webassembly PROPERTIES OUTPUT_NAME "ort-wasm-simd")
     else()
-      set_property(TARGET onnxruntime_webassembly APPEND_STRING PROPERTY LINK_FLAGS " -s EXPORT_NAME=ortWasm")
       set_target_properties(onnxruntime_webassembly PROPERTIES OUTPUT_NAME "ort-wasm")
     endif()
   endif()


Disable OpenSim support when compiling with Havok.

--- indra/cmake/Variables.cmake
+++ indra/cmake/Variables.cmake
@@ -164,5 +164,15 @@

 set(USE_PRECOMPILED_HEADERS ON CACHE BOOL "Enable use of precompiled header directives where supported.")

+# <FS:ND> When using Havok, we have to turn OpenSim support off
+if( HAVOK_TPV )
+ if( HAS_OPENSIM_SUPPORT )
+  message( "Compiling with Havok, turning OpenSim support off" )
+ endif( HAS_OPENSIM_SUPPORT )
+
+ set( HAS_OPENSIM_SUPPORT OFF )
+endif( HAVOK_TPV )
+# </FS:ND>
+
 source_group("CMake Rules" FILES CMakeLists.txt)


Remove some NaCl special-casing in CMake

This is no longer necessary now that we are producing static library
output by default.

Former-commit-id: 504a5871dc1d13c3c10490eaa71abb7d92cb7da1

--- HalideGenerator.cmake
+++ HalideGenerator.cmake
@@ -68,12 +68,6 @@
   set(FILTER_LIB "${args_GENERATED_FUNCTION}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(FILTER_HDR "${args_GENERATED_FUNCTION}.h")

-  # Check to see if the target includes pnacl
-  if ("${args_GENERATOR_ARGS}" MATCHES ".*pnacl.*")
-    set(FILTER_LIB "${args_GENERATED_FUNCTION}.bc")
-    set(target_is_pnacl TRUE)
-  endif()
-
   set(invoke_args "-g" "${args_GENERATOR_NAME}" "-f" "${args_GENERATED_FUNCTION_NAMESPACE}${args_GENERATED_FUNCTION}" "-o" "${SCRATCH_DIR}" ${args_GENERATOR_ARGS})
   set(generator_exec ${args_GENERATOR_TARGET}${CMAKE_EXECUTABLE_SUFFIX})

@@ -96,13 +90,6 @@
       # build script.
       COMMAND "${CMAKE_BINARY_DIR}/bin/$(CONFIGURATION)/${generator_exec}" ${invoke_args}

-      WORKING_DIRECTORY "${SCRATCH_DIR}"
-      )
-  elseif(target_is_pnacl)
-    # No archive step for pnacl targets
-    add_custom_command(OUTPUT "${SCRATCH_DIR}/${FILTER_LIB}" "${SCRATCH_DIR}/${FILTER_HDR}"
-      DEPENDS "${args_GENERATOR_TARGET}"
-      COMMAND "${CMAKE_BINARY_DIR}/bin/${generator_exec}" ${invoke_args}
       WORKING_DIRECTORY "${SCRATCH_DIR}"
       )
   else()


[CMake][Fuchsia] Enable --build-id linker flag by default

This enables passing --build-id to linker by default.

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

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@350459 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/caches/Fuchsia-stage2.cmake
+++ cmake/caches/Fuchsia-stage2.cmake
@@ -13,6 +13,8 @@
 set(LLVM_ENABLE_ZLIB ON CACHE BOOL "")
 set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
+
+set(ENABLE_LINKER_BUILD_ID ON CACHE BOOL "")

 set(LLVM_ENABLE_LTO ON CACHE BOOL "")
 if(NOT APPLE)


Fix typo visibilty

Fix typo visibilty

--- cmake/iOS.cmake
+++ cmake/iOS.cmake
@@ -68,7 +68,7 @@
 set (CMAKE_CXX_OSX_COMPATIBILITY_VERSION_FLAG "${CMAKE_C_OSX_COMPATIBILITY_VERSION_FLAG}")
 set (CMAKE_CXX_OSX_CURRENT_VERSION_FLAG "${CMAKE_C_OSX_CURRENT_VERSION_FLAG}")

-# Hidden visibilty is required for cxx on iOS
+# Hidden visibility is required for cxx on iOS
 set (CMAKE_C_FLAGS_INIT "")
 set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden -isysroot ${CMAKE_OSX_SYSROOT}")


[Phi] Unify kernel build targets (#41091)

* unify_kernel_build_target

* fix dnn kernel failed

* fix dnn kernel loss target

* fix xpu compile failed

--- cmake/phi.cmake
+++ cmake/phi.cmake
@@ -110,7 +110,7 @@

     cmake_parse_arguments(kernel_library "${options}" "${oneValueArgs}"
         "${multiValueArgs}" ${ARGN})
-
+
     # used for cc_library selected_rows dir target
     set(target_suffix "")
     if ("${kernel_library_SUB_DIR}" STREQUAL "selected_rows")
@@ -146,16 +146,11 @@
             endif()
         endif()
         if (WITH_XPU_KP)
-            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu)
-                # Change XPU2 file suffix
-                # NOTE(chenweihang): If we can be sure that the *.kps suffix is no longer used, it can be copied directly to *.xpu
-                file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps)
-                file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.cu ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
-                list(APPEND kps_srcs ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
-            endif()
-            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc )
-                list(APPEND kps_srcs ${CMAKE_CURRENT_SOURCE_DIR}/cpu/${TARGET}.cc)
-            endif()
+            # Change XPU2 file suffix
+            # NOTE(chenweihang): If we can be sure that the *.kps suffix is no longer used, it can be copied directly to *.xpu
+            file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/kps/${TARGET}.cu DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/kps)
+            file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.cu ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
+            list(APPEND kps_srcs ${CMAKE_CURRENT_BINARY_DIR}/kps/${TARGET}.kps)
         endif()
     else()
         # TODO(chenweihang): impl compile by source later
@@ -186,7 +181,7 @@
             string(REGEX MATCHALL "#include \"paddle\/phi\/kernels\/${kernel_library_SUB_DIR}\/[a-z0-9_]+_kernel.h\"" include_kernels ${target_content})
             list(APPEND all_include_kernels ${include_kernels})
         endif()
-
+
         foreach(include_kernel ${all_include_kernels})
             if ("${kernel_library_SUB_DIR}" STREQUAL "")
                 string(REGEX REPLACE "#include \"paddle\/phi\/kernels\/" "" kernel_name ${include_kernel})
@@ -219,71 +214,76 @@
     list(LENGTH kps_srcs kps_srcs_len)

     # kernel source file level
-    # level 1: base device kernel
-    # - cpu_srcs / gpu_srcs / xpu_srcs / gpudnn_srcs / kps_srcs
+    # level 1: base device kernel (if any device or dnn kernel exists, the cpu_kernel must be exists!!!)
+    # - cpu_srcs / gpu_srcs / xpu_srcs / kps_srcs
+    # = dnn srcs: gpudnn_srcs
     # level 2: device-independent kernel
     # - common_srcs
-    set(base_device_kernels)
-    set(device_independent_kernel)
-
-    # 1. Base device kernel compile
-    if (${cpu_srcs_len} GREATER 0)
-        cc_library(${TARGET}_cpu${target_suffix} SRCS ${cpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
-        list(APPEND base_device_kernels ${TARGET}_cpu${target_suffix})
-    endif()
-    if (${gpu_srcs_len} GREATER 0)
-        if (WITH_GPU)
-            nv_library(${TARGET}_gpu${target_suffix} SRCS ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
-        elseif (WITH_ROCM)
-            hip_library(${TARGET}_gpu${target_suffix} SRCS ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
-        endif()
-        list(APPEND base_device_kernels ${TARGET}_gpu${target_suffix})
-    endif()
-    if (${xpu_srcs_len} GREATER 0)
-        cc_library(${TARGET}_xpu${target_suffix} SRCS ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
-        list(APPEND base_device_kernels ${TARGET}_xpu${target_suffix})
-    endif()
+
+    set(partial_build_flag 0)
+    set(base_build_flag 0)
+    if (${common_srcs_len} GREATER 0)
+        set(partial_build_flag 1)
+    endif()
+    if (${cpu_srcs_len} GREATER 0 OR ${gpu_srcs_len} GREATER 0 OR ${xpu_srcs_len} GREATER 0 OR ${kps_srcs_len} GREATER 0)
+        set(base_build_flag 1)
+    endif()
+
+    # gpudnn or mkldnn needs to be compiled separately
+    set(dnn_kernels)
     if (${gpudnn_srcs_len} GREATER 0)
         if (WITH_GPU)
             nv_library(${TARGET}_gpudnn${target_suffix} SRCS ${gpudnn_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         elseif (WITH_ROCM)
             hip_library(${TARGET}_gpudnn${target_suffix} SRCS ${gpudnn_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         endif()
-        list(APPEND base_device_kernels ${TARGET}_gpudnn${target_suffix})
-    endif()
-    if (${kps_srcs_len} GREATER 0)
-        # only when WITH_XPU_KP, the kps_srcs_len can be > 0
-        xpu_library(${TARGET}_kps${target_suffix} SRCS ${kps_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
-        list(APPEND base_device_kernels ${TARGET}_kps${target_suffix})
-    endif()
-
-    # 2. Device-independent kernel compile
-    if (${common_srcs_len} GREATER 0)
+        list(APPEND dnn_kernels ${TARGET}_gpudnn${target_suffix})
+    endif()
+    list(LENGTH dnn_kernels dnn_kernels_len)
+
+    if (${partial_build_flag} EQUAL 0 AND ${base_build_flag} EQUAL 1)
         if (WITH_GPU)
-            nv_library(${TARGET}_common${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels})
+            if (${dnn_kernels_len} GREATER 0)
+                nv_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+                nv_library(${TARGET}${target_suffix} DEPS ${TARGET}_base${target_suffix} ${dnn_kernels})
+            else()
+                nv_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            endif()
         elseif (WITH_ROCM)
-            hip_library(${TARGET}_common${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels})
+            if (${dnn_kernels_len} GREATER 0)
+                hip_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+                hip_library(${TARGET}${target_suffix} DEPS ${TARGET}_base${target_suffix} ${dnn_kernels})
+            else()
+                hip_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            endif()
         elseif (WITH_XPU_KP)
-            xpu_library(${TARGET}_common${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels})
+            xpu_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         else()
-            cc_library(${TARGET}_common${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels})
-        endif()
-        list(APPEND device_independent_kernel ${TARGET}_common${target_suffix})
-    endif()
-
-
-    # 3. Unify target compile
-    list(LENGTH base_device_kernels base_device_kernels_len)
-    list(LENGTH device_independent_kernel device_independent_kernel_len)
-    if (${base_device_kernels_len} GREATER 0 OR ${device_independent_kernel_len} GREATER 0)
+            cc_library(${TARGET}${target_suffix} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+        endif()
+    elseif (${partial_build_flag} EQUAL 1 AND ${base_build_flag} EQUAL 1)
         if (WITH_GPU)
-            nv_library(${TARGET}${target_suffix} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels} ${device_independent_kernel})
+            nv_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            nv_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix} ${dnn_kernels})
         elseif (WITH_ROCM)
-            hip_library(${TARGET}${target_suffix} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels} ${device_independent_kernel})
+            hip_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${gpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            hip_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix} ${dnn_kernels})
         elseif (WITH_XPU_KP)
-            xpu_library(${TARGET}${target_suffix} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels} ${device_independent_kernel})
+            xpu_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${kps_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            xpu_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix})
         else()
-            cc_library(${TARGET}${target_suffix} DEPS ${kernel_library_DEPS} ${kernel_deps} ${base_device_kernels} ${device_independent_kernel})
+            cc_library(${TARGET}_base${target_suffix} SRCS ${cpu_srcs} ${xpu_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+            cc_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${TARGET}_base${target_suffix})
+        endif()
+    elseif (${partial_build_flag} EQUAL 1 AND ${base_build_flag} EQUAL 0)
+        if (WITH_GPU)
+            nv_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+        elseif (WITH_ROCM)
+            hip_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+        elseif (WITH_XPU_KP)
+            xpu_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
+        else()
+            cc_library(${TARGET}${target_suffix} SRCS ${common_srcs} DEPS ${kernel_library_DEPS} ${kernel_deps})
         endif()
     else()
         set(target_build_flag 0)


vigra.cmake: Pass CMAKE_CXX_FLAGS_RELEASE, etc. to vigra cmake configuration.

--- vigra.cmake
+++ vigra.cmake
@@ -81,8 +81,10 @@
         -DFFTW3F_LIBRARY=
         -DFFTW3_INCLUDE_DIR=${BUILDEM_DIR}/include
         -DFFTW3_LIBRARY=${BUILDEM_DIR}/lib/libfftw3.${BUILDEM_PLATFORM_DYLIB_EXTENSION}
-        -DCMAKE_CXX_FLAGS=-pthread
-        -DCMAKE_CXX_LINK_FLAGS=-pthread
+        -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -pthread"
+        -DCMAKE_CXX_LINK_FLAGS="${CMAKE_CXX_LINK_FLAGS} -pthread"
+        -DCMAKE_CXX_FLAGS_RELEASE="${CMAKE_CXX_FLAGS_RELEASE}"
+        -DCMAKE_CXX_FLAGS_DEBUG="${CMAKE_CXX_FLAGS_DEBUG}"
     BUILD_COMMAND       ${BUILDEM_ENV_STRING} $(MAKE)
     TEST_COMMAND        ${BUILDEM_ENV_STRING} $(MAKE) check
     INSTALL_COMMAND     ${BUILDEM_ENV_STRING} $(MAKE) install


Fix gmp build on win32

Fix gmp build on win32

--- external/libgmp.cmake
+++ external/libgmp.cmake
@@ -191,7 +191,7 @@
         )
         add_dependencies(GMP config_h fib_table fac_table mp_bases)
         target_include_directories(GMP
-            INTERFACE gmp-6.1.2
+            PUBLIC gmp-6.1.2
         )
         set(GMP_TARGET "GMP")
     else (WIN32)


fix install command for PointCloudLibraryPlugin external

--- distro/superbuild/cmake/externals.cmake
+++ distro/superbuild/cmake/externals.cmake
@@ -238,7 +238,7 @@
 if(NOT USE_SYSTEM_VTK)
   ExternalProject_Add(vtk
     GIT_REPOSITORY https://github.com/liangfok/VTK.git
-    GIT_TAG ec43254f432af2e49f10bd2d1996cc578895c19f # vtk 5.10 with fixes for Visual Studio 2013 and GLX_GLXEXT_LEGACY.
+    GIT_TAG ec43254 # vtk 5.10 with fixes for Visual Studio 2013 and GLX_GLXEXT_LEGACY.
     CMAKE_CACHE_ARGS
       ${default_cmake_args}
       ${python_args}
@@ -346,8 +346,7 @@

 ExternalProject_Add(PointCloudLibraryPlugin
   GIT_REPOSITORY https://github.com/patmarion/PointCloudLibraryPlugin.git
-  GIT_TAG filters-library
-  INSTALL_COMMAND ""
+  GIT_TAG cb119b0
   CMAKE_CACHE_ARGS
     ${default_cmake_args}
     ${eigen_args}


Add default clang tools path on CentOS 7 to search path

--- cmake/FindClangTools.cmake
+++ cmake/FindClangTools.cmake
@@ -34,7 +34,8 @@
     ${ClangTools_PATH}
     $ENV{CLANG_TOOLS_PATH}
     /usr/local/bin
-    /usr/bin)
+    /usr/bin
+    /opt/rh/llvm-toolset-7/root/usr/bin)
 if(LLVM_BREW_PREFIX)
   list(APPEND CLANG_TOOLS_SEARCH_PATHS "${LLVM_BREW_PREFIX}/bin")
 endif()


update

update

--- cmake/SetupPackaging.cmake
+++ cmake/SetupPackaging.cmake
@@ -8,14 +8,33 @@

 INCLUDE(InstallRequiredSystemLibraries)

-SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${CMAKE_PROJECT_NAME} infrastructure")
+
+STRING(TOLOWER ${CMAKE_PROJECT_NAME} PACKAGE_PREFIX)
+
+SET(CPACK_PACKAGE_NAME                "${PACKAGE_PREFIX}")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PACKAGE_PREFIX} infrastructure")
 SET(CPACK_PACKAGE_VENDOR              "dcs.hull.ac.uk")
-SET(CPACK_PACKAGE_DESCRIPTION_FILE    "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
+#SET(CPACK_PACKAGE_DESCRIPTION_FILE    "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
 SET(CPACK_RESOURCE_FILE_LICENSE       "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
 SET(CPACK_PACKAGE_VERSION_MAJOR       "0")
 SET(CPACK_PACKAGE_VERSION_MINOR       "1")
 SET(CPACK_PACKAGE_VERSION_PATCH       "0")
-SET(CPACK_PACKAGE_INSTALL_DIRECTORY   "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
+SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY  0)
+
+SET(CPACK_COMPONENTS_ALL app doc hdr lib)
+
+SET(CPACK_COMPONENT_APP_DISPLAY_NAME "Applications")
+SET(CPACK_COMPONENT_DOC_DISPLAY_NAME "Documentation")
+SET(CPACK_COMPONENT_HDR_DISPLAY_NAME "C++ Header")
+SET(CPACK_COMPONENT_LIB_DISPLAY_NAME "Libraries")
+SET(CPACK_COMPONENT_APP_DEPENDS       lib)
+SET(CPACK_COMPONENT_HDR_DEPENDS       lib)
+SET(CPACK_COMPONENT_APP_GROUP "app")
+SET(CPACK_COMPONENT_DOC_GROUP "doc")
+SET(CPACK_COMPONENT_HDR_GROUP "devel")
+SET(CPACK_COMPONENT_LIB_GROUP "lib")
+
+SET(CPACK_SOURCE_IGNORE_FILES "/.git/" ".gitignore" ".#" "/#" ".*~" "/build.*/")

 # see [http://www.cmake.org/Wiki/CMake:CPackPackageGenerators]
 IF(WIN32)
@@ -25,15 +44,15 @@
 ELSEIF(UNIX)
   MESSAGE(STATUS "Creating RPM package-installer configuration")

-  SET(CPACK_GENERATOR "RPM")
-  SET(CPACK_RPM_PACKAGE_SUMMARY     ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
-  SET(CPACK_RPM_PACKAGE_NAME        ${CPACK_PACKAGE_NAME})
-  SET(CPACK_RPM_PACKAGE_VERSION     ${CPACK_PACKAGE_VERSION})
-  SET(CPACK_RPM_PACKAGE_RELEASE     1)
-  SET(CPACK_RPM_PACKAGE_LICENSE     "LGPLv2")
-  SET(CPACK_RPM_PACKAGE_GROUP       "Development/Libraries")
-  SET(CPACK_RPM_PACKAGE_VENDOR      ${CPACK_PACKAGE_VENDOR})
-  SET(CPACK_RPM_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_FILE})
+  SET(CPACK_GENERATOR                "RPM")
+  SET(CPACK_SOURCE_GENERATOR         "RPM")
+  SET(CPACK_RPM_COMPRESSION_TYPE     bzip2)
+  # SET(CPACK_RPM_PACKAGE_ARCHITECTURE ${ARCH})
+  SET(CPACK_RPM_COMPONENT_INSTALL    ON)
+  SET(CPACK_RPM_PACKAGE_RELEASE      1)
+  SET(CPACK_RPM_PACKAGE_LICENSE      "LGPLv2")
+  SET(CPACK_RPM_PACKAGE_GROUP        "Development/Libraries")
+  SET(CPACK_RPM_PACKAGE_DEBUG        OFF)
 ELSE()
   MESSAGE(SEND_ERROR "Unsupported platform for creating package installer")
 ENDIF()


Changed ZLIB_ROOT variable for MacPorts.

--- cmake/ThirdPartyZlib.cmake
+++ cmake/ThirdPartyZlib.cmake
@@ -8,7 +8,7 @@

 # Attempt to identify Macports libraries, if they exist. This prevents
 # cmake warnings later on.
-SET(ZLIB_ROOT /opt/local/lib)
+SET(ZLIB_ROOT /opt/local/)

 # Find a system ZLIB library


better manifest.xml handling.

better manifest.xml handling.

--- cmake/catkin_project.cmake
+++ cmake/catkin_project.cmake
@@ -111,9 +111,9 @@

   string(TOLOWER ${PROJECT_NAME} project_lower)

-  if (EXISTS manifest.xml.in)
-    configure_file(manifest.xml.in
-      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/manifest.xml.in
+  if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml.in)
+    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/manifest.xml.in
+      ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/manifest.xml
       @ONLY)
     install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/manifest.xml
       DESTINATION share/${project_lower}