PIPOL_MAKE_COMMAND_TARGET (--> example : Experimental)
+
variables in cache

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

--- Numerics/cmake/Pipol.cmake
+++ Numerics/cmake/Pipol.cmake
@@ -17,14 +17,30 @@
 ENDIF(_STMP STREQUAL "[]")

 #
-#
+# default
 #

-SET(PIPOL_USER $ENV{PIPOL_USER})
+SET(PIPOL_USER $ENV{PIPOL_USER} CACHE STRING "user login on a pipol system")

-IF(NOT PIPOL_DURATION)
-  SET(PIPOL_DURATION 02:00)
-ENDIF(NOT PIPOL_DURATION)
+SET(PIPOL_CONFIGURE_COMMAND cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_SOURCE_DIR} CACHE STRING "the configuration command")
+
+SET(PIPOL_CONFIGURE_COMMAND cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_SOURCE_DIR} CACHE STRING "configuration command on a pipol system")
+
+SET(PIPOL_MAKE_COMMAND_TARGET "" CACHE STRING "make command target on a pipol system")
+
+SET(PIPOL_MAKE_COMMAND make -j 2 -$(MAKEFLAGS) CACHE STRING "make command on a pipol system")
+
+SET(PIPOL_MAKE_TEST_COMMAND make -j 2 -$(MAKEFLAGS) test CACHE STRING "make test command on a pipol system")
+
+SET(PIPOL_MAKE_INSTALL_COMMAND sudo make -$(MAKEFLAGS) install CACHE STRING "make install command on a pipol system")
+
+SET(PIPOL_POST_INSTALL_COMMAND sudo chown ${PIPOL_USER} install_manifest.txt  CACHE STRING "post install command on a pipol system")
+
+SET(PIPOL_PACKAGE_COMMAND cpack -G \\\$$PIPOL_CPACK_G . CACHE STRING "package command on a pipol system")
+
+SET(PIPOL_SUB_RSYNC_OPTIONS -aC CACHE STRING "rsync options")
+
+SET(PIPOL_DURATION 02:00 CACHE STRING "duration of system reservation")

 # ssh/rsync mandatory
 FIND_PROGRAM(HAVE_SSH ssh)
@@ -43,35 +59,6 @@
     MACRO(PIPOL_TARGET
         SYSTEM_PATTERN)

-      # defaults
-      IF(NOT PIPOL_CONFIGURE_COMMAND)
-        SET(PIPOL_CONFIGURE_COMMAND "cmake -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} ${CMAKE_SOURCE_DIR}")
-      ENDIF(NOT PIPOL_CONFIGURE_COMMAND)
-
-      IF(NOT PIPOL_MAKE_COMMAND)
-        SET(PIPOL_MAKE_COMMAND make -j 2 -$(MAKEFLAGS))
-      ENDIF(NOT PIPOL_MAKE_COMMAND)
-
-      IF(NOT PIPOL_MAKE_TEST_COMMAND)
-        SET(PIPOL_MAKE_TEST_COMMAND make -$(MAKEFLAGS) test)
-      ENDIF(NOT PIPOL_MAKE_TEST_COMMAND)
-
-      IF(NOT PIPOL_MAKE_INSTALL_COMMAND)
-        SET(PIPOL_MAKE_INSTALL_COMMAND sudo make -$(MAKEFLAGS) install)
-      ENDIF(NOT PIPOL_MAKE_INSTALL_COMMAND)
-
-      IF(NOT PIPOL_POST_INSTALL_COMMAND)
-        SET(PIPOL_POST_INSTALL_COMMAND sudo chown ${PIPOL_USER} install_manifest.txt)
-      ENDIF(NOT PIPOL_POST_INSTALL_COMMAND)
-
-      IF(NOT PIPOL_PACKAGE_COMMAND)
-        SET(PIPOL_PACKAGE_COMMAND cpack -G \\\$$PIPOL_CPACK_G .)
-      ENDIF(NOT PIPOL_PACKAGE_COMMAND)
-
-      IF(NOT PIPOL_SUB_RSYNC_OPTIONS)
-        SET(PIPOL_SUB_RSYNC_OPTIONS "-aC")
-      ENDIF(NOT PIPOL_SUB_RSYNC_OPTIONS)
-
       STRING(REPLACE ".dd.gz" "" SYSTEM_TARGET ${SYSTEM_PATTERN})

       ADD_CUSTOM_TARGET(
@@ -83,7 +70,7 @@
           sudo chown ${PIPOL_USER} \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           cd \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           ${PIPOL_CONFIGURE_COMMAND} \;
-          ${PIPOL_MAKE_COMMAND} \;
+          ${PIPOL_MAKE_COMMAND} ${PIPOL_MAKE_COMMAND_TARGET}\;
           ${PIPOL_MAKE_TEST_COMMAND} \;
           ${PIPOL_MAKE_INSTALL_COMMAND} \;
           ${PIPOL_POST_INSTALL_COMMAND} \"
@@ -97,7 +84,7 @@
         \"sudo mkdir -p \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           sudo chown ${PIPOL_USER} \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           cd \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
-          ${PIPOL_MAKE_COMMAND} \"
+          ${PIPOL_MAKE_COMMAND} ${PIPOL_MAKE_COMMAND_TARGET}\"
         )

       ADD_CUSTOM_TARGET(
@@ -109,7 +96,7 @@
         sudo chown ${PIPOL_USER} \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
         cd \\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME} \;
           ${PIPOL_CONFIGURE_COMMAND} \;
-          ${PIPOL_MAKE_COMMAND} \;
+          ${PIPOL_MAKE_COMMAND} ${PIPOL_MAKE_COMMAND_TARGET}\;
           ${PIPOL_PACKAGE_COMMAND} \" \;\\
        COMMAND rsync -av ${PIPOL_USER}@`./pipol-sub --pipol-user=${PIPOL_USER} ${SYSTEM_PATTERN} ${PIPOL_DURATION} --reconnect --group --keep --verbose=0 echo \\\\$$PIPOL_HOST`.inrialpes.fr:`./pipol-sub --pipol-user=${PIPOL_USER} ${SYSTEM_PATTERN} ${PIPOL_DURATION} --reconnect --group --keep --verbose=0 ls \\\\$$PIPOL_WDIR/${PIPOL_USER}/${CMAKE_BUILD_TYPE}/${PROJECT_NAME}/*.\\\\$$PIPOL_PACK_EXT` .
        )


removed names for licensing issues

removed names for licensing issues

--- SuperBuild/External_CCPi-FrameworkPlugins.cmake
+++ SuperBuild/External_CCPi-FrameworkPlugins.cmake
@@ -1,6 +1,4 @@
 #========================================================================
-# Author: Benjamin A Thomas
-# Author: Kris Thielemans
 # Author: Edoardo Pasca
 # Copyright 2018 University College London
 # Copyright 2018 STFC


CMake summary wrong alignment

CMake summary wrong alignment

--- cmakemodules/script_show_final_summary.cmake
+++ cmakemodules/script_show_final_summary.cmake
@@ -125,19 +125,19 @@
 SHOW_CONFIG_LINE_SYSTEM("Assimp (3D models)                  " CMAKE_MRPT_HAS_ASSIMP "[Version: ${ASSIMP_VERSION}]")
 SHOW_CONFIG_LINE_SYSTEM("ffmpeg libs (Video streaming)       " CMAKE_MRPT_HAS_FFMPEG "[avcodec ${LIBAVCODEC_VERSION}, avutil ${LIBAVUTIL_VERSION}, avformat ${LIBAVFORMAT_VERSION}]")
 SHOW_CONFIG_LINE_SYSTEM("gtest (Google unit testing library) " CMAKE_MRPT_HAS_GTEST )
-SHOW_CONFIG_LINE("lib3ds (3DStudio scenes)            " CMAKE_MRPT_HAS_LIB3DS)
+SHOW_CONFIG_LINE       ("lib3ds (3DStudio scenes)            " CMAKE_MRPT_HAS_LIB3DS)
 SHOW_CONFIG_LINE_SYSTEM("libjpeg (jpeg)                      " CMAKE_MRPT_HAS_JPEG)
 SHOW_CONFIG_LINE_SYSTEM("liblas (ASPRS LAS LiDAR format)     " CMAKE_MRPT_HAS_LIBLAS)
-SHOW_CONFIG_LINE("mexplus                                    " CMAKE_MRPT_HAS_MATLAB)
+SHOW_CONFIG_LINE       ("mexplus                             " CMAKE_MRPT_HAS_MATLAB)
 SHOW_CONFIG_LINE_SYSTEM("OpenCV (Image manipulation)         " CMAKE_MRPT_HAS_OPENCV "[Version: ${MRPT_OPENCV_VERSION}]")
 SHOW_CONFIG_LINE_SYSTEM("OpenGL                              " CMAKE_MRPT_HAS_OPENGL_GLUT)
 SHOW_CONFIG_LINE_SYSTEM("GLUT                                " CMAKE_MRPT_HAS_GLUT)
 SHOW_CONFIG_LINE_SYSTEM("PCAP (Wireshark logs for Velodyne)  " CMAKE_MRPT_HAS_LIBPCAP)
 SHOW_CONFIG_LINE_SYSTEM("PCL (Pointscloud library)           " CMAKE_MRPT_HAS_PCL  "[Version: ${PCL_VERSION}]")
-SHOW_CONFIG_LINE("SuiteSparse                                " CMAKE_MRPT_HAS_SUITESPARSE)
-SHOW_CONFIG_LINE("VTK                                        " CMAKE_MRPT_HAS_VTK)
+SHOW_CONFIG_LINE       ("SuiteSparse                         " CMAKE_MRPT_HAS_SUITESPARSE)
+SHOW_CONFIG_LINE       ("VTK                                 " CMAKE_MRPT_HAS_VTK)
 SHOW_CONFIG_LINE_SYSTEM("wxWidgets                           " CMAKE_MRPT_HAS_WXWIDGETS)
-SHOW_CONFIG_LINE("Qt5                                 " CMAKE_MRPT_HAS_Qt5)
+SHOW_CONFIG_LINE       ("Qt5                                 " CMAKE_MRPT_HAS_Qt5)
 SHOW_CONFIG_LINE_SYSTEM("yamlcpp (YAML file format)          " CMAKE_MRPT_HAS_YAMLCPP "[Version: ${LIBYAMLCPP_VERSION}]")
 MESSAGE(STATUS  "")


SuperBuild: takeout unsued macro for autconf. better strategy in place

--- SuperBuild/CMake/SuperBuild_Macro.cmake
+++ SuperBuild/CMake/SuperBuild_Macro.cmake
@@ -154,26 +154,3 @@
     DEPENDERS configure
     )
 endmacro(SUPERBUILD_PATCH_SOURCE)
-
-#used only for OSX. DEPENDEES is always install target
-macro(FIX_RPATH_FOR_AUTOCONF_BUILD project pattern)
-  if(APPLE)
-    find_program(INSTALL_NAME_TOOL_PROGRAM NAMES install_name_tool)
-    if(INSTALL_NAME_TOOL_PROGRAM)
-      file(GLOB dylib_names ${SB_INSTALL_PREFIX}/lib/${pattern})
-      foreach(dylib_name ${dylib_names})
-        get_filename_component(dylib_name_base_name ${dylib_name} NAME)
-      ExternalProject_Add_Step(${project} fix_rpath_${dylib_name_base_name}
-        COMMAND
-        ${INSTALL_NAME_TOOL_PROGRAM}
-        -id
-        "@rpath/${dylib_name_base_name}"
-        "${dylib_name}"
-        DEPENDEES install)
-
-      endforeach()
-    else()
-      message(FATAL_ERROR "Cannot find install_name_tool. Tried names: install_name_tool")
-    endif()
-  endif()
-endmacro(FIX_RPATH_FOR_AUTOCONF_BUILD)


Revert "Find python3 first"

Revert "Find python3 first"

This reverts commit 8b5f31f83df0a0e59574f53f5cabb6d1964ca98f.

--- CMake/hoomd/HOOMDPythonSetup.cmake
+++ CMake/hoomd/HOOMDPythonSetup.cmake
@@ -5,8 +5,6 @@
 if (HOOMD_INCLUDE_DIR)
     list(APPEND CMAKE_MODULE_PATH ${HOOMD_INCLUDE_DIR}/hoomd/extern/pybind/tools)
 endif()
-
-set(PYBIND11_PYTHON_VERSION 3)

 # trick pybind11 tools to allow us to manage C++ flags
 # cmake ignores this in 2.8, but when pybind11 sees this


Update hunter.cmake

Update hunter.cmake

--- cmake/projects/puffin-buffer/hunter.cmake
+++ cmake/projects/puffin-buffer/hunter.cmake
@@ -1,8 +1,21 @@
 include(hunter_add_version)
+include(hunter_cacheable)
+include(hunter_cmake_args)
 include(hunter_download)
 include(hunter_pick_scheme)

 # List of versions here...
+
+hunter_add_version(
+    PACKAGE_NAME
+    puffin-buffer
+    VERSION
+    "0.1.1.0"
+    URL
+    "https://github.com/designerror/puffin-buffer/archive/v0.1.1.0.tar.gz"
+    SHA1
+    c49d8c706295c7be885ba2a57fed6cc31a6557a5
+)

 hunter_add_version(
     PACKAGE_NAME
@@ -17,4 +30,13 @@

 hunter_pick_scheme(DEFAULT url_sha1_cmake)

+hunter_cmake_args(puffin-buffer)
+
+hunter_cmake_args(
+    puffin-buffer
+    CMAKE_ARGS
+    BUILD_DOCS=NO
+    BUILD_TESTS=NO
+)
+
 hunter_download(PACKAGE_NAME puffin-buffer)


Find MKL Threading libraries

Find MKL Threading libraries

--- modules/FindMKL.cmake
+++ modules/FindMKL.cmake
@@ -280,7 +280,8 @@
 if (MKL_FOUND)

   # Work out whether to search the ia32/ or intel64/ lib/ subdirectories
-  set(_MKL_LIBRARY_SEARCH_DIRS "${MKL_INCLUDE_DIR}/../lib")
+  set(_MKL_LIBRARY_SEARCH_DIRS
+      "${MKL_INCLUDE_DIR}/../lib;${MKL_INCLUDE_DIR}/../../compiler/lib;${MKL_INCLUDE_DIR}/../../tbb/lib")
   try_run(_MKL_IS_64BIT
           _MKL_IS_64BIT_COMPILE_RESULT
           "${CMAKE_BINARY_DIR}"
@@ -340,6 +341,35 @@
     unset(_MKL_IS_64BIT)
   endif()

+  # Work out threading layer
+  string(TOLOWER ${MKL_THREADING} _MKL_THREADING_LC)
+  if(${_MKL_THREADING_LC} STREQUAL "sequential")
+    set(_MKL_THREADING_LIBS "mkl_sequential")
+  elseif(${_MKL_THREADING_LC} STREQUAL "tbb")
+    set(_MKL_THREADING_LIBS "mkl_tbb_thread;tbb")
+  elseif(${_MKL_THREADING_LC} STREQUAL "openmp")
+    string(TOLOWER ${MKL_OPENMP} _MKL_OPENMP_LC)
+    if (${_MKL_OPENMP_LC} STREQUAL "intel")
+      set(_MKL_THREADING_LIBS "mkl_intel_thread;iomp5")
+    elseif(${_MKL_OPENMP_LC} STREQUAL "gnu")
+      set(_MKL_THREADING_LIBS "mkl_gnu_thread;gomp")
+    elseif(${_MKL_OPENMP_LC} STREQUAL "pgi")
+      set(_MKL_THREADING_LIBS "mkl_pgi_thread;pgf90libs")
+    endif()
+  endif()
+  foreach(lib ${_MKL_THREADING_LIBS})
+    find_library(_MKL_THREADING_${lib}
+                 "${lib}"
+                 HINTS ${_MKL_LIBRARY_SEARCH_DIRS})
+    if("${_MKL_THREADING_${lib}}" STREQUAL "_MKL_THREADING_${lib}-NOTFOUND")
+      set(MKL_FOUND 0)
+    else()
+      list(APPEND MKL_LIBRARIES ${_MKL_THREADING_${lib}})
+    endif()
+  endforeach()
+  unset(_MKL_THREADING_LC)
+  unset(_MKL_THREADING_LIBS)
+
   # Construct MKL_LIBRARIES and MKL_DEFINITIONS
   list(REMOVE_DUPLICATES MKL_DEFINITIONS)
   list(REMOVE_DUPLICATES MKL_LIBRARIES)


Add Debian 10 version name mapping (#978)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 04)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   07)
+SET(KWSYS_DATE_STAMP_DAY   08)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   26)
+SET(KWSYS_DATE_STAMP_DAY   27)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
+++ Modules/ThirdParty/KWSys/src/KWSys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

 # KWSys version date day component.  Format is DD.
-SET(KWSYS_DATE_STAMP_DAY   02)
+SET(KWSYS_DATE_STAMP_DAY   03)


cmake nuttx use defconfig matching config label if available

 - otherwise use default nsh

--- platforms/nuttx/cmake/px4_impl_os.cmake
+++ platforms/nuttx/cmake/px4_impl_os.cmake
@@ -115,8 +115,8 @@
 			REQUIRED OUT
 			ARGN ${ARGN})

-	if(PX4_BOARD_LABEL MATCHES "stackcheck")
-		set(NUTTX_CONFIG "stackcheck" CACHE INTERNAL "NuttX config" FORCE)
+	if(EXISTS ${PX4_BOARD_DIR}/nuttx-config/${PX4_BOARD_LABEL})
+		set(NUTTX_CONFIG "${PX4_BOARD_LABEL}" CACHE INTERNAL "NuttX config" FORCE)
 	else()
 		set(NUTTX_CONFIG "nsh" CACHE INTERNAL "NuttX config" FORCE)
 	endif()


Build modules required for LidarView to open .series

--- Superbuild/Projects/paraview.cmake
+++ Superbuild/Projects/paraview.cmake
@@ -76,6 +76,15 @@

     -DModule_vtklibproj4:BOOL=TRUE

+    # beginning of modules required when opening a .series
+    -DModule_vtkIOAMR:BOOL=TRUE
+    -DModule_vtkIOLSDyna:BOOL=TRUE
+    -DModule_vtkIOParallelLSDyna:BOOL=TRUE
+    -DModule_vtkIOTecplotTable:BOOL=TRUE
+    -DModule_vtkIOTRUCHAS:BOOL=TRUE
+    -DModule_vtkIOVPIC:BOOL=TRUE
+    # end of modules required when opening a .series
+
     -DPQWIDGETS_DISABLE_QTWEBKIT:BOOL=ON

     # specify the apple app install prefix. No harm in specifying it for all


added comment

added comment

--- dist/WkDoc.cmake
+++ dist/WkDoc.cmake
@@ -65,6 +65,8 @@
 endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile" )

   ADD_CUSTOM_TARGET(doc ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile" )
+
+  #forcing doc generation whenever main target is being built
   add_dependencies( ${PROJECT_NAME} doc )

 ENDIF(DOXYGEN_FOUND)


another assert

another assert

--- cmake/assert.cmake
+++ cmake/assert.cmake
@@ -3,6 +3,13 @@
     message(FATAL_ERROR "Assertion failed: ${VAR} (value is ${${VAR}})")
   endif()
   log(3 "assert(${VAR}) okay (== ${${VAR}})")
+endfunction()
+
+function(assert_unset VAR)
+  if (${VAR})
+    message(FATAL_ERROR "Assertion failed: ${VAR} is set but shoudl not be (value is ${${VAR}})")
+  endif()
+  log(3 "assert_unset(${VAR}) okay")
 endfunction()

 function(assert_file_exists FILENAME MESSAGE)
@@ -15,3 +22,6 @@
   endif()
 endfunction()

+
+function(abort)
+  message(FATAL_ERROR "Aborting: ${ARGN}")


Some minor cleaning up.

Some minor cleaning up.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -86,9 +86,7 @@
       -Wno-documentation-unknown-command
       -Wno-exit-time-destructors
       -Wno-global-constructors
-      -Wno-gnu-zero-variadic-macro-arguments
       -Wno-missing-prototypes
-      -Wno-newline-eof
       -Wno-padded
       -Wno-reserved-id-macro
       -Wno-switch-enum


cmake(dotnet): Fix windows build

cmake(dotnet): Fix windows build

--- cmake/dotnet.cmake
+++ cmake/dotnet.cmake
@@ -121,7 +121,7 @@
   CONTENT
   "FILE(READ ${PROJECT_SOURCE_DIR}/ortools/dotnet/${OR_TOOLS_DOTNET_NATIVE}/${OR_TOOLS_DOTNET_NATIVE}.csproj.in input)
 STRING(REPLACE \"@PROJECT_VERSION@\" \"${PROJECT_VERSION}\" input \"\${input}\")
-STRING(REPLACE \"@ortools@\" \"$<TARGET_SONAME_FILE:${PROJECT_NAME}>\" input \"\${input}\")
+STRING(REPLACE \"@ortools@\" \"$<$<NOT:$<PLATFORM_ID:Windows>>:$<TARGET_SONAME_FILE:${PROJECT_NAME}>>\" input \"\${input}\")
 STRING(REPLACE \"@native@\" \"$<TARGET_FILE:google-ortools-native>\" input \"\${input}\")
 FILE(WRITE ${OR_TOOLS_DOTNET_NATIVE}/${OR_TOOLS_DOTNET_NATIVE}.csproj \"\${input}\")"
 )


Removed extra `include(ExternalProject)`

--- cmake/physfs.cmake
+++ cmake/physfs.cmake
@@ -4,7 +4,6 @@
 set(physfs_VERSION "2.0.3")

 # Download `physfs` and build it using CMake.
-include(ExternalProject)
 ExternalProject_Add(physfs_EXTERNAL
     URL "https://icculus.org/physfs/downloads/physfs-${physfs_VERSION}.tar.bz2"
     INSTALL_COMMAND ""


fbcode_builder: minor fixup to normalize python installation paths

Summary:
This just strips off a trailing '/' from the `INSTALL_DIR` property that we
set on python targets, to avoid having double-slashes in the paths that we use
during installation.  This shouldn't really have any material difference other
than cleaning up the paths that get printed during the installation phase.

Reviewed By: chadaustin

Differential Revision: D17089207

fbshipit-source-id: ab36bb76c19fa60fe037f7a5290ccfd6bdbf13b0

--- build/fbcode_builder/CMake/FBPythonBinary.cmake
+++ build/fbcode_builder/CMake/FBPythonBinary.cmake
@@ -326,6 +326,7 @@
   if(NOT IS_ABSOLUTE "${abs_install_dir}")
     set(abs_install_dir "${CMAKE_INSTALL_PREFIX}/${abs_install_dir}")
   endif()
+  string(REGEX REPLACE "/$" "" abs_install_dir "${abs_install_dir}")
   set_target_properties(
     "${LIB_NAME}.py_lib_install"
     PROPERTIES


don't mess with cmake source/root folder

--- cmake/Templates/GoogleTest.CMakeLists.txt.cmake
+++ cmake/Templates/GoogleTest.CMakeLists.txt.cmake
@@ -9,7 +9,7 @@
 ExternalProject_Add(googletest
     GIT_REPOSITORY    https://github.com/google/googletest.git
     GIT_TAG           master
-    SOURCE_DIR        "${CMAKE_SOURCE_DIR}/thirdparty/googletest"
+    SOURCE_DIR        "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-src"
     BINARY_DIR        "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-build"
     INSTALL_DIR       "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-install"
     CMAKE_ARGS        -Dgtest_build_samples=ON -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/thirdparty/googletest-install


Allow users of _cppcheck_add_checks_to_target to specify when checks run.

For binary targets, it makes sense to set this to PRE_LINK so that failures
will cause a binary build failure when the error bit is set, for custom
targets, it probably makes a lot more sense to set this to PRE_BUILD
as they don't have a linking phase.

--- CPPCheck.cmake
+++ CPPCheck.cmake
@@ -30,7 +30,10 @@

 endfunction (_validate_cppcheck)

-function (_cppcheck_add_checks_to_target SOURCES_VAR TARGET OPTIONS_VAR)
+function (_cppcheck_add_checks_to_target SOURCES_VAR
+                                         TARGET
+                                         WHEN
+                                         OPTIONS_VAR)

     set (ADD_CHECKS_OPTIONS COMMENT)
     cmake_parse_arguments (ADD_CHECKS_TO_TARGET "${COMMENT}" "" "")
@@ -44,7 +47,7 @@
     endif (ADD_CHECKS_OPTIONS_COMMENT)

     add_custom_command (TARGET ${TARGET}
-                        PRE_LINK
+                        ${WHEN}
                         COMMAND
                         ${CPPCHECK_EXECUTABLE}
                         ARGS
@@ -148,6 +151,7 @@

     _cppcheck_add_checks_to_target (_cppcheck_unused_function_sources
                                     ${TARGET}
+                                    PRE_BUILD
                                     OPTIONS
                                     COMMENT "Checking for unused functions")

@@ -225,6 +229,7 @@

     _cppcheck_add_checks_to_target (${SOURCES_VAR}
                                     ${TARGET}
+                                    PRE_LINK
                                     CPPCHECK_OPTIONS
                                     ${EXTRA_ARGS})


Fix the error of 'Target names may not contain a slash'.

--- cmake/TbagModule/TbagObjectProtobufPython.cmake
+++ cmake/TbagModule/TbagObjectProtobufPython.cmake
@@ -10,8 +10,9 @@
 if (PROTOBUF_FOUND)
     tbag_protobuf__generate_py (__proto_srcs __proto_headers "${TBAG_OBJECT_CONST_SOURCES}")

-    #add_custom_target ("${TBAG_PROJECT_CONST_NAME}_pythyon" ALL DEPENDS ${__proto_srcs})
-    add_custom_target ("${TBAG_PROJECT_CONST_NAME}_${__proto_srcs}" ALL DEPENDS ${__proto_srcs})
+    string (MD5 __proto_srcs_hash "${__proto_srcs}")
+    set (__protobuf_python_target_name "${TBAG_PROJECT_CONST_NAME}_protobuf_python_${__proto_srcs_hash}")
+    add_custom_target ("${__protobuf_python_target_name}" ALL DEPENDS ${__proto_srcs})
     list (APPEND TBAG_OBJECT_DEPENDENCIES ${TBAG_PROJECT_CONST_NAME}_python)
 endif ()


rust: find cargo with find_program to give a better error message when cargo isn't available

Summary:
If you build Watchman from source on a machine without cargo, the
error message was confusing. You'd see "command not found" somewhere
mixed into ninja's output.

Change RustStaticLibrary, which is only used by Watchman and EdenFS,
to find cargo with find_program instead of guessing its name and
assuming it exists. This gives a much less confusing error message at
CMake configure time.

Reviewed By: genevievehelsel

Differential Revision: D40441374

fbshipit-source-id: eeafe615616775c660c700e14cf1f6b2fd9715a8

--- build/fbcode_builder/CMake/RustStaticLibrary.cmake
+++ build/fbcode_builder/CMake/RustStaticLibrary.cmake
@@ -57,6 +57,8 @@
     "directory = \"${ESCAPED_RUST_VENDORED_CRATES_DIR}\"\n"
   )
 endif()
+
+find_program(CARGO_COMMAND cargo REQUIRED)

 # Cargo is a build system in itself, and thus will try to take advantage of all
 # the cores on the system. Unfortunately, this conflicts with Ninja, since it
@@ -119,11 +121,6 @@
   set(staticlib_name "${CMAKE_STATIC_LIBRARY_PREFIX}${crate_name}${CMAKE_STATIC_LIBRARY_SUFFIX}")
   set(rust_staticlib "${CMAKE_CURRENT_BINARY_DIR}/${target_dir}/${staticlib_name}")

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -142,7 +139,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust crate '${crate_name}'..."
     JOB_POOL rust_job_pool
@@ -195,11 +192,6 @@
     set(features )
   endif()

-  set(cargo_cmd cargo)
-  if(WIN32)
-    set(cargo_cmd cargo.exe)
-  endif()
-
   if(DEFINED ARG_FEATURES)
     set(cargo_flags build $<IF:$<CONFIG:Debug>,,--release> -p ${crate_name} --features ${ARG_FEATURES})
   else()
@@ -219,7 +211,7 @@
       "${CMAKE_COMMAND}" -E env
       "CARGO_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR}"
       ${extra_cargo_env}
-      ${cargo_cmd}
+      ${CARGO_COMMAND}
       ${cargo_flags}
     COMMENT "Building Rust executable '${crate_name}'..."
     JOB_POOL rust_job_pool


cmake/BuildPCRE2.cmake: d library and WIN32 [ci skip]

--- cmake/BuildPCRE2.cmake
+++ cmake/BuildPCRE2.cmake
@@ -45,7 +45,7 @@
   INSTALL_COMMAND "${CMAKE_MAKE_PROGRAM}" install "DESTDIR="
   )
 SET (PCRE2_INCLUDE_DIR "${3RDPARTY_OUTPUT_PATH}/include")
-IF (WIN32 AND ((CMAKE_BUILD_TYPE STREQUAL Debug) OR (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)))
+IF (WIN32 AND (CMAKE_BUILD_TYPE STREQUAL Debug))
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8d${CMAKE_STATIC_LIBRARY_SUFFIX}")
 ELSE ()
   SET (PCRE2_LINK_FLAGS  "${3RDPARTY_OUTPUT_PATH}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}pcre2-8${CMAKE_STATIC_LIBRARY_SUFFIX}")


cmake/FindInline.cmake: removed extra parenthesis

--- cmake/FindInline.cmake
+++ cmake/FindInline.cmake
@@ -28,9 +28,9 @@
       SET (C_INLINE "${_C_INLINE}" CACHE STRING "C inline keyword")
       MARK_AS_ADVANCED (C_INLINE)
       IF ("${C_INLINE}" STREQUAL "inline")
-        SET (C_INLINE_IS_INLINE TRUE CACHE BOOL "C inline keyword is inline"))
+        SET (C_INLINE_IS_INLINE TRUE CACHE BOOL "C inline keyword is inline")
       ELSE ()
-        SET (C_INLINE_IS_INLINE FALSE CACHE BOOL "C inline keyword is inline"))
+        SET (C_INLINE_IS_INLINE FALSE CACHE BOOL "C inline keyword is inline")
       ENDIF ()
       MARK_AS_ADVANCED (C_INLINE_IS_INLINE)
     ENDIF ()


Fix for bug 3061570.  Use a path suffix of plplot when finding headers.
Thanks to http://sourceforge.net/users/?user_id=3049819 (Gareth) for
finding and solving this issue.

svn path=/trunk/; revision=11161

--- cmake/FindPLplot.cmake
+++ cmake/FindPLplot.cmake
@@ -8,9 +8,9 @@

 FIND_PATH(
   PLplot_INCLUDE_DIR
-  plplot.h
-  /usr/local/include
-  /usr/include
+  NAMES plplot.h
+  PATHS /usr/local/include /usr/include
+  PATH_SUFFIXES plplot
 )

 IF( PLplot_INCLUDE_DIR )


cmake: Avoid collisions with upstream libprotobuf

When libprotobuf from the upstream is installed FindSC2Api macro
always reports path to it, not to the API headers causing broken
compilation and broken linking.

This commit forces cmake to ignore system include directories
when we search for protobuf headers and libraries.

--- cmake/FindSC2Api.cmake
+++ cmake/FindSC2Api.cmake
@@ -37,6 +37,7 @@
         "google/protobuf/stubs/common.h"
     PATHS
         "${SC2Api_INCLUDE_DIR}/sc2api"
+    NO_DEFAULT_PATH
 )

 # Put all the headers together.
@@ -58,9 +59,9 @@
         PATHS
             "/opt/local/lib"
             "/usr/local/lib"
-            "/usr/lib"
         PATH_SUFFIXES
             "sc2api"
+        NO_DEFAULT_PATH
     )

     if(SC2Api_${UPPERCOMPONENT}_LIB)


propagate link target properties

propagate link target properties

--- cmake/LLVMIRUtil.cmake
+++ cmake/LLVMIRUtil.cmake
@@ -66,6 +66,21 @@
   get_property(IN_FILES TARGET ${DEPENDS_TRGT} PROPERTY SOURCES)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
   get_property(EXTERNAL_TYPE TARGET ${DEPENDS_TRGT} PROPERTY TYPE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   debug(
     "@llvmir_attach_bc_target ${DEPENDS_TRGT} linker lang: ${LINKER_LANGUAGE}")
@@ -142,6 +157,18 @@
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_DIR ${WORK_DIR})
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_FILES ${OUT_LLVMIR_FILES})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+  set_property(TARGET ${TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY
+    LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)
 endfunction()

@@ -184,6 +211,21 @@
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(IN_LLVMIR_FILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_BINARY_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to target of type: \
@@ -228,6 +270,18 @@
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_DIR ${WORK_DIR})
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_FILES ${OUT_LLVMIR_FILES})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+  set_property(TARGET ${TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY
+    LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)
 endfunction()

@@ -270,6 +324,21 @@
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(IN_LLVMIR_FILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_BINARY_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to a ${IN_LLVMIR_TYPE} target.")
@@ -308,6 +377,18 @@
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_DIR ${WORK_DIR})
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_FILES ${OUT_LLVMIR_FILES})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+  set_property(TARGET ${TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY
+    LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)
 endfunction()

@@ -350,6 +431,21 @@
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(IN_LLVMIR_FILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_TEXT_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to a ${IN_LLVMIR_TYPE} target.")
@@ -388,6 +484,18 @@
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_DIR ${WORK_DIR})
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_FILES ${OUT_LLVMIR_FILES})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+  set_property(TARGET ${TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY
+    LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)
 endfunction()

@@ -430,6 +538,21 @@
   get_property(INFILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_BINARY_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to a ${IN_LLVMIR_TYPE} target.")
@@ -459,6 +582,18 @@
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_DIR ${WORK_DIR})
   set_property(TARGET ${TRGT} PROPERTY LLVMIR_FILES ${OUT_LLVMIR_FILES})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
+  set_property(TARGET ${TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  set_property(TARGET ${TRGT}
+    PROPERTY
+    LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)

   add_custom_command(OUTPUT ${FULL_OUT_LLVMIR_FILE}
@@ -517,6 +652,21 @@
   get_property(INFILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_BINARY_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to a ${IN_LLVMIR_TYPE} target.")
@@ -534,8 +684,37 @@

   add_executable(${TRGT} ${IN_FULL_LLVMIR_FILES})

+  # simply setting the property does not seem to work
+  #set_property(TARGET ${TRGT}
+  #PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  #set_property(TARGET ${TRGT}
+  #PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  #set_property(TARGET ${TRGT}
+  #PROPERTY
+  #LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+  #${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
+
+  # FIXME: cmake bags PUBLIC link dependencies under both interface and private
+  # target properties, so for an exact propagation it is required to search for
+  # elements that are only in the INTERFACE properties and set them as such
+  # correctly with the target_link_libraries command
+  if(INTERFACE_LINK_LIBRARIES)
+    target_link_libraries(${TRGT} PUBLIC ${INTERFACE_LINK_LIBRARIES})
+  endif()
+  if(LINK_INTERFACE_LIBRARIES)
+    target_link_libraries(${TRGT} PUBLIC ${LINK_INTERFACE_LIBRARIES})
+  endif()
+  if(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})
+    target_link_libraries(${TRGT}
+      PUBLIC ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
+  endif()
+
+  set_property(TARGET ${TRGT} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
-  set_property(TARGET ${TRGT} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${OUT_DIR})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)

   # this marks the object as to be linked but not compiled
@@ -582,6 +761,21 @@
   get_property(INFILES TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_FILES)
   get_property(IN_LLVMIR_DIR TARGET ${DEPENDS_TRGT} PROPERTY LLVMIR_DIR)
   get_property(LINKER_LANGUAGE TARGET ${DEPENDS_TRGT} PROPERTY LINKER_LANGUAGE)
+  get_property(LINK_DEPENDS TARGET ${DEPENDS_TRGT} PROPERTY LINK_DEPENDS)
+  get_property(LINK_FLAGS TARGET ${DEPENDS_TRGT} PROPERTY LINK_FLAGS)
+  get_property(LINK_FLAGS_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE})
+  get_property(INTERFACE_LINK_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY INTERFACE_LINK_LIBRARIES)
+  get_property(LINK_LIBRARIES TARGET ${DEPENDS_TRGT} PROPERTY LINK_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES)
+  get_property(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+    TARGET ${DEPENDS_TRGT}
+    PROPERTY LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})

   if(NOT "${IN_LLVMIR_TYPE}" STREQUAL "${LLVMIR_BINARY_TYPE}")
     message(FATAL_ERROR "Cannot attach ${TRGT} to a ${IN_LLVMIR_TYPE} target.")
@@ -600,8 +794,37 @@
   add_library(${TRGT}
     ${LLVMIR_ATTACH_UNPARSED_ARGUMENTS} ${IN_FULL_LLVMIR_FILES})

+  # simply setting the property does not seem to work
+  #set_property(TARGET ${TRGT}
+  #PROPERTY INTERFACE_LINK_LIBRARIES ${INTERFACE_LINK_LIBRARIES})
+  #set_property(TARGET ${TRGT}
+  #PROPERTY LINK_INTERFACE_LIBRARIES ${LINK_INTERFACE_LIBRARIES})
+  #set_property(TARGET ${TRGT}
+  #PROPERTY
+  #LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}
+  #${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
+
+  # FIXME: cmake bags PUBLIC link dependencies under both interface and private
+  # target properties, so for an exact propagation it is required to search for
+  # elements that are only in the INTERFACE properties and set them as such
+  # correctly with the target_link_libraries command
+  if(INTERFACE_LINK_LIBRARIES)
+    target_link_libraries(${TRGT} PUBLIC ${INTERFACE_LINK_LIBRARIES})
+  endif()
+  if(LINK_INTERFACE_LIBRARIES)
+    target_link_libraries(${TRGT} PUBLIC ${LINK_INTERFACE_LIBRARIES})
+  endif()
+  if(LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE})
+    target_link_libraries(${TRGT}
+      PUBLIC ${LINK_INTERFACE_LIBRARIES_${CMAKE_BUILD_TYPE}})
+  endif()
+
+  set_property(TARGET ${TRGT} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${OUT_DIR})
   set_property(TARGET ${TRGT} PROPERTY LINKER_LANGUAGE ${LINKER_LANGUAGE})
-  set_property(TARGET ${TRGT} PROPERTY LIBRARY_OUTPUT_DIRECTORY ${OUT_DIR})
+  set_property(TARGET ${TRGT} PROPERTY LINK_DEPENDS ${LINK_DEPENDS})
+  set_property(TARGET ${TRGT} PROPERTY LINK_FLAGS ${LINK_FLAGS})
+  set_property(TARGET ${TRGT}
+    PROPERTY LINK_FLAGS_${CMAKE_BUILD_TYPE} ${LINK_FLAGS_${CMAKE_BUILD_TYPE}})
   set_property(TARGET ${TRGT} PROPERTY EXCLUDE_FROM_ALL On)

   # this marks the object as to be linked but not compiled


put endif token in comment to avoid warning

--- include/pgmlink/pgmlink_export.h.cmake
+++ include/pgmlink/pgmlink_export.h.cmake
@@ -4,4 +4,4 @@
 #define PGMLINK_EXPORT
 #define PGMLINK_NO_EXPORT

-#endif PGMLINK_EXPORT_H+#endif /* PGMLINK_EXPORT_H */


Removed stray merge conflict line

Removed stray merge conflict line

--- plugin.cmake
+++ plugin.cmake
@@ -26,7 +26,6 @@
 add_python_test(wms PLUGIN minerva)
 add_python_test(elasticsearch PLUGIN minerva)
 add_python_test(geojson PLUGIN minerva)
-<<<<<<< 1f2c43bced4279ffd3c93214b4aa8c6df7fdabcc
 add_python_test(postgres PLUGIN minerva)
 add_python_test(mongo_dataset PLUGIN minerva)


Add DATA support to external_cc_library.cmake.

Closes https://github.com/google/iree/pull/1013

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/1013 from ScottTodd:cmake-data-2 49f39a3c55e4d96f56f85c7a48e5ec5ab6d0fa05
PiperOrigin-RevId: 299967079

--- build_tools/cmake/external_cc_library.cmake
+++ build_tools/cmake/external_cc_library.cmake
@@ -26,6 +26,7 @@
 # ROOT: Path to the source root where files are found
 # HDRS: List of public header files for the library
 # SRCS: List of source files for the library
+# DATA: List of other targets and files required for this binary
 # DEPS: List of other libraries to be linked in to the binary targets
 # COPTS: List of private compile options
 # DEFINES: List of public defines
@@ -80,7 +81,7 @@
   cmake_parse_arguments(_RULE
     "PUBLIC;ALWAYSLINK;TESTONLY"
     "PACKAGE;NAME;ROOT"
-    "HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DEPS;INCLUDES"
+    "HDRS;SRCS;COPTS;DEFINES;LINKOPTS;DATA;DEPS;INCLUDES"
     ${ARGN}
   )

@@ -137,6 +138,7 @@
         PUBLIC
           ${_RULE_DEFINES}
       )
+      iree_add_data_dependencies(NAME ${_NAME} DATA ${_RULE_DATA})

       if(DEFINED _RULE_ALWAYSLINK)
         set_property(TARGET ${_NAME} PROPERTY ALWAYSLINK 1)
@@ -173,6 +175,7 @@
           ${_RULE_LINKOPTS}
           ${IREE_DEFAULT_LINKOPTS}
       )
+      iree_add_data_dependencies(NAME ${_NAME} DATA ${_RULE_DATA})
       target_compile_definitions(${_NAME}
         INTERFACE
           ${_RULE_DEFINES}


do not warn on using auto_ptr

do not warn on using auto_ptr

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -38,7 +38,7 @@
 #
 # Common flags can be used by both C and C++
 #
-set (COMMON_FLAGS "${COMMON_FLAGS} -Wall -Wextra")
+set (COMMON_FLAGS "${COMMON_FLAGS} -Wall -Wextra -Wno-deprecated-declarations")


Link NetBSD with execinfo (CMAKE build)

Link NetBSD with execinfo (CMAKE build)

Summary: FreeBSD and NetBSD share the same library execinfo.

Reviewers: joerg, sas, brucem

Subscribers: brucem, sas, lldb-commits

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

Change by Kamil Rytarowski <n54@gmx.com>

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

--- cmake/LLDBDependencies.cmake
+++ cmake/LLDBDependencies.cmake
@@ -147,8 +147,8 @@
     endif()
   endif()
 endif()
-# On FreeBSD backtrace() is provided by libexecinfo, not libc.
-if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+# On FreeBSD/NetBSD backtrace() is provided by libexecinfo, not libc.
+if (CMAKE_SYSTEM_NAME MATCHES "FreeBSD" OR CMAKE_SYSTEM_NAME MATCHES "NetBSD")
   list(APPEND LLDB_SYSTEM_LIBS execinfo)
 endif()


Add QVTK hint for Apple to FindQVTK.cmake (thanks Bill Lorensen)

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

--- cmake/Modules/FindQVTK.cmake
+++ cmake/Modules/FindQVTK.cmake
@@ -8,7 +8,7 @@
 # if QVTK_FOUND then QVTK_INCLUDE_DIR is appended to VTK_INCLUDE_DIRS and
 # QVTK_LIBRARY is appended to QVTK_LIBRARY_DIR

-find_library (QVTK_LIBRARY QVTK HINT ${VTK_DIR})
+find_library (QVTK_LIBRARY QVTK HINTS ${VTK_DIR} ${VTK_DIR}/bin)
 find_path (QVTK_INCLUDE_DIR QVTKWidget.h HINT ${VTK_INCLUDE_DIRS})
 find_package_handle_standard_args(QVTK DEFAULT_MSG
   QVTK_LIBRARY QVTK_INCLUDE_DIR)


cmake: make swiftRemoteMirror export interfaces on Windows

Unfortunately, `swift-reflection-test` links against the *TARGET*
library `swiftRemoteMirror`.  The linked library is built as a target
library, which means that we use the custom library target construction
which suffixes the target with a variant spelling.  Because the number
of variants is really high, we pass along the explicit EXPORTS macro
manually.  However, we also build the library as a static library for
the *HOST*.  This means that we need the sources to be aware of whether
they are built statically or dyanmically.  This is accomplished by means
of the `_WINDLL` macro.  The target library is shared and is built using
the custom wrapper for the library construction, which will create all
the variants and then use `_compute_variant_c_flags` which does not get
told what type of library is being built, so it assumes static and does
not append `_WINDLL`.  This results in the shared library not exposing
any interfaces on Windows.  When this happens, link will helpfully elide
the import library.  The result of that is that the
swift-reflection-test binary will fail to link due to no import library
for the RemoteMirror.  Explicitly add the -D_WINDLL if appropriate
manually after we have computed the C flags.  *siiiiiiigh*

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -1195,6 +1195,11 @@
     "${SWIFTLIB_SINGLE_FORCE_BUILD_OPTIMIZED_keyword}"
     RESULT_VAR_NAME c_compile_flags
     )
+  if(SWIFTLIB_SINGLE_SDK STREQUAL WINDOWS)
+    if(libkind STREQUAL SHARED)
+      list(APPEND c_compile_flags -D_WINDLL)
+    endif()
+  endif()
   _add_variant_link_flags(
     SDK "${SWIFTLIB_SINGLE_SDK}"
     ARCH "${SWIFTLIB_SINGLE_ARCHITECTURE}"


Fixed HDF4 static library linker flags

Fixed HDF4 static library linker flags

--- cmake_include/FindHDF4.cmake
+++ cmake_include/FindHDF4.cmake
@@ -74,6 +74,24 @@
 #------------------------------------------------------------------------------
 # add libraries to the link list for NAPI
 #------------------------------------------------------------------------------
-list(APPEND NAPI_LINK_LIBS  ${HDF4_DF_LIBRARY} ${HDF4_MFHDF_LIBRARY} jpeg)
+get_filename_component(LIB_EXT ${HDF4_DF_LIBRARY} EXT)
+if(LIB_EXT MATCHES .a)
+    message(STATUS "HDF4 DF library is static")
+    list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_DF_LIBRARY} "-Wl,-no-whole-archive")
+else()
+    list(APPEND NAPI_LINK_LIBS ${HDF4_DF_LIBRARY})
+endif()
+
+
+get_filename_component(LIB_EXT ${HDF4_MFHDF_LIBRARY} EXT)
+if(LIB_EXT MATCHES .a)
+    message(STATUS "HDF4 MFHDF library is static")
+    list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_MFHDF_LIBRARY} "-Wl,-no-whole-archive")
+else()
+    list(APPEND NAPI_LINK_LIBS ${HDF4_MFHDF_LIBRARY})
+endif()
+
+list(APPEND NAPI_LINK_LIBS jpeg)
+
 include_directories ( SYSTEM ${HDF4_INCLUDE_DIRS} )
 link_directories(${HDF4_LIBRARY_DIRS})


Update compiler.cmake

Update compiler.cmake

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -75,8 +75,11 @@
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libc++")
      elseif (NOT WIN32)
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -stdlib=libstdc++")
-     else()
+     else()
+         # this implies clang on windows
          set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable -std=c++11 -Wno-unused-result /MD")
+         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} -fexceptions")
+         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
      endif ()
      set(CMAKE_CXX_FLAGS_DEBUG "-g")
      set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
@@ -135,10 +138,6 @@
      # solution: https://stackoverflow.com/questions/1091662/vc-internal-compiler-error
      #     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /Ox /W3 /FC -D_SCL_SECURE_NO_WARNINGS")
      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc /W3 /FC /Ox -D_SCL_SECURE_NO_WARNINGS")
-     if(CMAKE_COMPILER_ID MATCHES "Clang")
-          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXXFLAGS} -fexceptions")
-          set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CFLAGS}")
-     endif()
      if (TUDAT_FORCE_DYNAMIC_RUNTIME)
          # This is needed for conda builds, as the prebuilt libraries are MD.
          set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MD")


Update compiler.cmake

Update compiler.cmake

Fix for clang-cl

--- cmake_modules/compiler.cmake
+++ cmake_modules/compiler.cmake
@@ -211,7 +211,9 @@
      endif ()
      string(REPLACE "C" " -wd" MSVC_DISABLED_WARNINGS_STR
              ${MSVC_DISABLED_WARNINGS_LIST})
-     string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+     if (NOT CLANG)
+         string(REGEX REPLACE "[/-]W[1234][ ]?" "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
+     endif ()
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -MP -W4 ${MSVC_DISABLED_WARNINGS_STR}")

      message(STATUS "CMAKE_C_FLAGS: ${CMAKE_C_FLAGS}")


Fix to allow for large objects (like RQ Decomposition class)

Change-Id: I64df3bd34d1e8678ae520de8ed20f33bc3641047

--- cmake/OptimizeTheiaCompilerFlags.cmake
+++ cmake/OptimizeTheiaCompilerFlags.cmake
@@ -175,6 +175,10 @@
     # the warnings.
     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4049")

+    # Visual Studio has a limit to how many addresses and object can hold. This
+    # can hobble templated classes that are large and result in compiler errors.
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigoj")
+
     # Update the C/CXX flags for MSVC to use either the static or shared
     # C-Run Time (CRT) library based on the user option: MSVC_USE_STATIC_CRT.
     list(APPEND C_CXX_FLAGS


Removing changes made inadvertantly to the make file.

--- cmake/configs/qurt_eagle_release.cmake
+++ cmake/configs/qurt_eagle_release.cmake
@@ -70,7 +70,7 @@
 	modules/uORB
 	modules/commander
 	modules/controllib
-
+
 	#
 	# Libraries
 	#


haskell-bindings-improve-cmake: fix typo

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -150,7 +150,7 @@
 			endif (GHC_FFI_LIB)

 		else (FINDEX GREATER -1)
-			remove_plugin (${target} "haskell bindings are not included in the make configuration")
+			remove_plugin (${target} "haskell bindings are not included in the cmake configuration")
 		endif (FINDEX GREATER -1)
 		else (GHC-PKG_EXECUTABLE)
 			remove_plugin (${target} "ghc-pkg not found")


haskell-cmake-improvements: fix issue with markdown tests and custom sandbox locations

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -154,7 +154,7 @@
 									configure_file (${CABAL_CUSTOM_SETUP_FILE}
 											"${CMAKE_CURRENT_BINARY_DIR}/Setup.hs"
 											@ONLY)
-
+
 									configure_haskell_sandbox (SHARED_SANDBOX
 												   ${HASKELL_SHARED_SANDBOX}
 												   SANDBOX_ADD_SOURCES
@@ -368,7 +368,7 @@
 	# Therefore we use the --offline flag to make the build guaranteed independent
 	# Furthermore we implicitly add the haskell bindings as they are always required
 	add_custom_command (OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config"
-				COMMAND ${CABAL_EXECUTABLE} sandbox add-source ${CMAKE_BINARY_DIR}/src/bindings/haskell/ -v0
+			    COMMAND ${CABAL_EXECUTABLE} sandbox add-source ${CMAKE_BINARY_DIR}/src/bindings/haskell/ -v0
 			    COMMAND ${CABAL_EXECUTABLE} install ${CABAL_OPTS} --only-dependencies --avoid-reinstalls --offline -v0 || true
 			    APPEND)
 	add_custom_target (${HASKELL_ADD_SOURCES_TARGET} ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/cabal.sandbox.config")


Tentative fix for problem (found by Orion Poplawski) with <FLAGS> used in
Ada build step for Fedora.

svn path=/trunk/; revision=7421

--- cmake/modules/CMakeAdaInformation.cmake
+++ cmake/modules/CMakeAdaInformation.cmake
@@ -177,10 +177,10 @@
     # Temporary fixup for one user's Ada/Mac OS X problems when using the
     # the 4.2 version of the http://macada.org/ version of the GNAT compiler.
     SET(CMAKE_Ada_LINK_EXECUTABLE
-    "${GNAT_EXECUTABLE_BUILDER} <FLAGS> <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -largs <LINK_LIBRARIES> -lgcc_s.1")
+    "${GNAT_EXECUTABLE_BUILDER} <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -cargs <FLAGS> -largs <LINK_LIBRARIES> -lgcc_s.1")
   ELSE(APPLE)
     SET(CMAKE_Ada_LINK_EXECUTABLE
-    "${GNAT_EXECUTABLE_BUILDER} <FLAGS> <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -largs <LINK_LIBRARIES>")
+    "${GNAT_EXECUTABLE_BUILDER} <CMAKE_Ada_LINK_FLAGS> <LINK_FLAGS> <TARGET_BASE>.adb -cargs <FLAGS> -largs <LINK_LIBRARIES>")
   ENDIF(APPLE)
 ENDIF(NOT CMAKE_Ada_LINK_EXECUTABLE)


added minimal hardware name and cache size detection during build


Added option ARDLIBS to specify specific Arduino libraries to be included when generating Arduino firmware.  Needed because sometime when libraries depend on libraries, not all the needed libraries are automatically added.


FMUv1: Reduce flash use

FMUv1: Reduce flash use

--- cmake/configs/nuttx_px4fmu-v1_default.cmake
+++ cmake/configs/nuttx_px4fmu-v1_default.cmake
@@ -27,16 +27,16 @@
 	drivers/trone
 	drivers/gps
 	drivers/pwm_out_sim
-	drivers/hott
-	drivers/hott/hott_telemetry
-	drivers/hott/hott_sensors
+	#drivers/hott
+	#drivers/hott/hott_telemetry
+	#drivers/hott/hott_sensors
 	drivers/blinkm
 	drivers/airspeed
 	drivers/ets_airspeed
 	drivers/meas_airspeed
 	drivers/frsky_telemetry
 	modules/sensors
-	drivers/mkblctrl
+	#drivers/mkblctrl
 	drivers/px4flow

 	#


Require at least GCC 5.2.0 to enable Vc in ROOT

Vc has ABI issues with GCC 4.x (needs -fabi-version=6 or 0 to work),
and at least with GCC 4.9.3, Vc triggers the static asserts shown below:

include/Vc/common/simdize.h:758:1: error: static assertion failed:
is_constructible_with_double_brace<int> does not work as expected

include/Vc/common/simdize.h:762:1: error: static assertion failed:
is_constructible_with_double_brace<tuple> does not work as expected

include/Vc/common/simdize.h:765:1: error: static assertion failed:
is_constructible_with_double_brace<array> does not work as expected

Reference: http://cdash.cern.ch/viewBuildError.php?buildid=383616

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -1243,8 +1243,8 @@
 #---Check for Vc compatibility-----------------------------------------------------------
 if(vc OR builtin_vc)
   if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.5)
-      message(STATUS "Vc requires GCC version >= 4.8.5; switching OFF 'vc' option")
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.2.0)
+      message(STATUS "Vc requires GCC version >= 5.2.0; switching OFF 'vc' option")
       set(vc OFF CACHE BOOL "" FORCE)
       set(builtin_vc OFF CACHE BOOL "" FORCE)
     endif()


[cmake] Check for TBB without captured exceptions

Related to ROOT-10636

--- cmake/modules/SearchInstalledSoftware.cmake
+++ cmake/modules/SearchInstalledSoftware.cmake
@@ -5,6 +5,7 @@
 # For the list of contributors see $ROOTSYS/README/CREDITS.

 #---Check for installed packages depending on the build options/components enabled --
+include(CheckCXXSourceCompiles)
 include(ExternalProject)
 include(FindPackageHandleStandardArgs)

@@ -1238,6 +1239,25 @@
       set(builtin_tbb ON CACHE BOOL "Enabled because imt is enabled, but TBB was not found" FORCE)
     endif()
   endif()
+
+  # Check that the found TBB does not use captured exceptions.
+  if(TBB_FOUND)
+    set(CMAKE_REQUIRED_INCLUDES "${TBB_INCLUDE_DIRS}")
+    check_cxx_source_compiles("
+#include <tbb/tbb_config.h>
+#if TBB_USE_CAPTURED_EXCEPTION == 1
+#error TBB uses tbb::captured_exception, not suitable for ROOT!
+#endif
+int main() { return 0; }" tbb_exception_result)
+    if(NOT tbb_exception_result)
+      if(fail-on-missing)
+        message(FATAL_ERROR "Found TBB uses tbb::captured_exception, not suitable for ROOT!")
+      endif()
+      message(STATUS "Found TBB uses tbb::captured_exception, enabling 'builtin_tbb' option")
+      set(builtin_tbb ON CACHE BOOL "Enabled because imt is enabled and found TBB is not suitable" FORCE)
+    endif()
+  endif()
+
   set(TBB_CXXFLAGS "-DTBB_SUPPRESS_DEPRECATED_MESSAGES=1")
 endif()

@@ -1891,7 +1911,6 @@
 # using atomic operations without the help of a library. Only if it can't do we start
 # looking for libatomic for the build.
 #
-include(CheckCXXSourceCompiles)
 check_cxx_source_compiles("
 #include <atomic>
 #include <cstdint>


Non-CMake packages: Respect 'CMAKE_POSITION_INDEPENDENT_CODE' variable

--- cmake/modules/hunter_dump_cmake_flags.cmake
+++ cmake/modules/hunter_dump_cmake_flags.cmake
@@ -89,6 +89,20 @@
     )
   endif()

+  string(COMPARE NOTEQUAL "${CMAKE_CXX_COMPILE_OPTIONS_PIC}" "" has_pic)
+  if(CMAKE_POSITION_INDEPENDENT_CODE AND has_pic)
+    set(
+        CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_COMPILE_OPTIONS_PIC}"
+    )
+  endif()
+
+  string(COMPARE NOTEQUAL "${CMAKE_C_COMPILE_OPTIONS_PIC}" "" has_pic)
+  if(CMAKE_POSITION_INDEPENDENT_CODE AND has_pic)
+    set(
+        CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_COMPILE_OPTIONS_PIC}"
+    )
+  endif()
+
   string(COMPARE EQUAL "${x_CPPFLAGS}" "" is_empty)
   if(NOT is_empty)
     set("${x_CPPFLAGS}" "${${x_CPPFLAGS}} ${cppflags}" PARENT_SCOPE)


CHG (#2122): simplified module macros

CHG (#2122): simplified module macros

--- CMake/CoreHelpers.cmake
+++ CMake/CoreHelpers.cmake
@@ -131,8 +131,12 @@
 INCLUDE(MacroParseArguments)

 MACRO(MITK_CREATE_MODULE_CONF MODULE_NAME_IN)
-  MACRO_PARSE_ARGUMENTS(MODULE "INCLUDE_DIRS;INTERNAL_INCLUDE_DIRS;DEPENDS;DEPENDS_INTERNAL;PROVIDES;PACKAGE_DEPENDS;GENERATED_CPP" "QT_MODULE" ${ARGN})
+  MACRO_PARSE_ARGUMENTS(MODULE "INCLUDE_DIRS;DEPENDS;PROVIDES" "QT_MODULE" ${ARGN})
   SET(MODULE_NAME ${MODULE_NAME_IN})
+  _MITK_CREATE_MODULE_CONF()
+ENDMACRO(MITK_CREATE_MODULE_CONF)
+
+MACRO(_MITK_CREATE_MODULE_CONF)
   IF(NOT MODULE_PROVIDES)
     SET(MODULE_PROVIDES ${MODULE_NAME})
   ENDIF(NOT MODULE_PROVIDES)
@@ -146,11 +150,11 @@

   # Qt generates headers in the binary tree
   IF(MODULE_QT_MODULE)
-    SET(MODULE_INTERNAL_INCLUDE_DIRS ${MODULE_INTERNAL_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
+    SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
   ENDIF(MODULE_QT_MODULE)

   CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleConf.cmake.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake @ONLY)
-ENDMACRO(MITK_CREATE_MODULE_CONF)
+ENDMACRO(_MITK_CREATE_MODULE_CONF)

 ##################################################################
 #
@@ -166,32 +170,14 @@
 #     [INTERNAL_INCLUDE_DIRS <internally used include directories>]
 #     [DEPENDS <modules we need>]
 #     [PROVIDES <library name which is built>]
-#     [PACKAGE_DEPENDS ]
-#)
-
-
-
-
+#     [PACKAGE_DEPENDS <packages we need, like ITK, VTK, QT>]
+#     [EXPORT_DEFINE <declspec macro name for dll exports>]

 MACRO(MITK_CREATE_MODULE MODULE_NAME_IN)
   MACRO_PARSE_ARGUMENTS(MODULE "INCLUDE_DIRS;INTERNAL_INCLUDE_DIRS;DEPENDS;DEPENDS_INTERNAL;PROVIDES;PACKAGE_DEPENDS;EXPORT_DEFINE;ADDITIONAL_LIBS;GENERATED_CPP" "QT_MODULE;FORCE_STATIC" ${ARGN})
   SET(MODULE_NAME ${MODULE_NAME_IN})
-  IF(NOT MODULE_PROVIDES)
-    SET(MODULE_PROVIDES ${MODULE_NAME})
-  ENDIF(NOT MODULE_PROVIDES)
-  SET(MODULE_INCLUDE_DIRS_ABSOLUTE "")
-  FOREACH(dir ${MODULE_INCLUDE_DIRS})
-    GET_FILENAME_COMPONENT(abs_dir ${dir} ABSOLUTE)
-    SET(MODULE_INCLUDE_DIRS_ABSOLUTE ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${abs_dir})
-  ENDFOREACH(dir)
-  SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS_ABSOLUTE} ${CMAKE_CURRENT_SOURCE_DIR})
-
-  # Qt generates headers in the binary tree
-  IF(MODULE_QT_MODULE)
-    SET(MODULE_INCLUDE_DIRS ${MODULE_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
-  ENDIF(MODULE_QT_MODULE)
-
-  CONFIGURE_FILE(${MITK_SOURCE_DIR}/CMake/moduleConf.cmake.in ${MITK_MODULES_CONF_DIR}/${MODULE_NAME}Config.cmake @ONLY)
+  _MITK_CREATE_MODULE_CONF()
+
   IF(NOT MODULE_EXPORT_DEFINE)
     SET(MODULE_EXPORT_DEFINE ${MODULE_NAME}_EXPORT)
   ENDIF(NOT MODULE_EXPORT_DEFINE)
@@ -207,37 +193,10 @@
   SET(DEPENDS "${MODULE_DEPENDS}")
   SET(DEPENDS_BEFORE "not initialized")
   SET(PACKAGE_DEPENDS "${MODULE_PACKAGE_DEPENDS}")
-  WHILE(NOT "${DEPENDS}" STREQUAL "${DEPENDS_BEFORE}")
-    SET(DEPENDS_BEFORE ${DEPENDS})
-    FOREACH(dependency ${DEPENDS})
-      INCLUDE(${MITK_MODULES_CONF_DIR}/${dependency}Config.cmake)
-      LIST(APPEND DEPENDS ${${dependency}_DEPENDS})
-      LIST(APPEND PACKAGE_DEPENDS ${${dependency}_PACKAGE_DEPENDS})
-    ENDFOREACH(dependency)
-    LIST(REMOVE_DUPLICATES DEPENDS)
-    LIST(REMOVE_DUPLICATES PACKAGE_DEPENDS)
-    LIST(SORT DEPENDS)
-    LIST(SORT PACKAGE_DEPENDS)
-  ENDWHILE()
-  # CMake Debug
-  # MESSAGE("${MODULE_NAME} dependencies: ${DEPENDS}")
-  FOREACH(dependency ${DEPENDS} ${MODULE_DEPENDS_INTERNAL})
-    INCLUDE(${MITK_MODULES_CONF_DIR}/${dependency}Config.cmake)
-    SET(ALL_INCLUDE_DIRECTORIES ${ALL_INCLUDE_DIRECTORIES} ${${dependency}_INCLUDE_DIRS})
-    SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${${dependency}_PROVIDES})
-  ENDFOREACH(dependency)
-
-  FOREACH(package ${PACKAGE_DEPENDS})
-    INCLUDE(${MITK_SOURCE_DIR}/CMake/MITK_${package}_Config.cmake)
-    #FIND_PACKAGE(${package})
-    #SET(ALL_INCLUDE_DIRECTORIES ${ALL_INCLUDE_DIRECTORIES} ${${package}_INCLUDE_DIRS})
-    #SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${${package}_LIBRARIES})
-  ENDFOREACH(package)
-  SET(ALL_LIBRARIES ${ALL_LIBRARIES} ${MODULE_ADDITIONAL_LIBS})
-  SET(ALL_INCLUDE_DIRECTORIES ${ALL_INCLUDE_DIRECTORIES} ${MODULE_INCLUDE_DIRS} ${MODULE_INTERNAL_INCLUDE_DIRS} ${MITK_MODULES_CONF_DIR})
+  MITK_USE_MODULE("${MODULE_DEPENDS}")

   # ok, now create the module itself
-  INCLUDE_DIRECTORIES(${ALL_INCLUDE_DIRECTORIES})
+  INCLUDE_DIRECTORIES(. ${ALL_INCLUDE_DIRECTORIES})
   INCLUDE(files.cmake)

   IF(NOT MODULE_QT_MODULE)
@@ -292,10 +251,9 @@
 )
 ENDMACRO(MITK_CREATE_MODULE)

-MACRO(MITK_USE_MODULE )
+MACRO(MITK_USE_MODULE)
   SET(DEPENDS "${ARGN}")
   SET(DEPENDS_BEFORE "not initialized")
-  SET(PACKAGE_DEPENDS "")
   WHILE(NOT "${DEPENDS}" STREQUAL "${DEPENDS_BEFORE}")
     SET(DEPENDS_BEFORE ${DEPENDS})
     FOREACH(dependency ${DEPENDS})
@@ -303,10 +261,14 @@
       LIST(APPEND DEPENDS ${${dependency}_DEPENDS})
       LIST(APPEND PACKAGE_DEPENDS ${${dependency}_PACKAGE_DEPENDS})
     ENDFOREACH(dependency)
-    LIST(REMOVE_DUPLICATES DEPENDS)
-    LIST(REMOVE_DUPLICATES PACKAGE_DEPENDS)
-    LIST(SORT DEPENDS)
-    LIST(SORT PACKAGE_DEPENDS)
+    IF(DEPENDS)
+      LIST(REMOVE_DUPLICATES DEPENDS)
+      LIST(SORT DEPENDS)
+    ENDIF(DEPENDS)
+    IF(PACKAGE_DEPENDS)
+      LIST(REMOVE_DUPLICATES PACKAGE_DEPENDS)
+      LIST(SORT PACKAGE_DEPENDS)
+    ENDIF(PACKAGE_DEPENDS)
   ENDWHILE()
   # CMake Debug
   FOREACH(dependency ${DEPENDS} ${MODULE_DEPENDS_INTERNAL})


Find the 64bit drivers for the LabJack on Windows in 64bit builds.

64 bit builds already work on Linux.

--- CMake/FindLabJack.cmake
+++ CMake/FindLabJack.cmake
@@ -20,6 +20,14 @@
 	set(LABJACK_ROOT_DIR ${LABJACK_INCLUDE_DIR})
 endif(LABJACK_INCLUDE_DIR)

+if(WIN32 AND CMAKE_CL_64)
+	 find_library(LABJACK_LIBRARY
+		NAMES LabJackUD
+		PATHS ${LABJACK_ROOT_DIR}/64bit
+		NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_SYSTEM_PATH
+	)
+endif(WIN32 AND CMAKE_CL_64)
+
 find_library(LABJACK_LIBRARY
 	NAMES LabJackUD labjackusb
 	HINTS ${LABJACK_ROOT_DIR} "/usr/local/lib" "/usr/lib"


change cmake to generate planner registry code in a package-specific location to avoid potential conflits with other packages in the catkin workspace

--- catkin.cmake
+++ catkin.cmake
@@ -30,15 +30,15 @@
 )

 # Generate the OMPL planner wrappers.
-file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/src")
+file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/src")

-add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
+add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/src/PlannerRegistry.cpp"
     MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/planners.yaml"
     DEPENDS "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
     COMMAND "${PROJECT_SOURCE_DIR}/scripts/wrap_planners.py"
             --include-dirs="${OMPL_INCLUDE_DIRS}"
             --planners-yaml="${PROJECT_SOURCE_DIR}/planners.yaml"
-            --generated-cpp="${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
+            --generated-cpp="${CMAKE_CURRENT_BINARY_DIR}/src/PlannerRegistry.cpp"
 )

 # Helper library.
@@ -51,7 +51,7 @@
     src/TSR.cpp
     src/TSRGoal.cpp
     src/TSRRobot.cpp
-    "${CMAKE_BINARY_DIR}/src/PlannerRegistry.cpp"
+    "${CMAKE_CURRENT_BINARY_DIR}/src/PlannerRegistry.cpp"
 )
 target_link_libraries(${PROJECT_NAME}
     ${OpenRAVE_LIBRARIES}


STYLE: fix documentation

STYLE: fix documentation

--- CMake/ImportGdal.cmake
+++ CMake/ImportGdal.cmake
@@ -39,7 +39,7 @@
        SET(CHECK_GDAL_BUILT_WITH_HDF 0 CACHE INTERNAL "GDAL_BUILT_WITH_HDF" FORCE)
     ENDIF(${GDAL_FORMATS} MATCHES "hdf")
   ELSE (UNIX)
-  	# For WIN32 platform, GDAL is automatically built with HDF support.
+  	# For WIN32 platform, we suppose that GDAL is built with HDF support (case with OSGeo4W)
     SET(CHECK_GDAL_BUILT_WITH_HDF 1 CACHE INTERNAL "GDAL_BUILT_WITH_HDF" FORCE)
     # GDAL_INCLUDE_DIR has already been checked here
     FILE(READ "${GDAL_INCLUDE_DIR}/gdal_version.h" _gdal_version_h_CONTENTS)


fix gmock

fix gmock

--- cmaki.cmake
+++ cmaki.cmake
@@ -5,7 +5,7 @@

 option(FIRST_ERROR "stop on first compilation error" FALSE)
 option(COVERAGE "active coverage (only clang)" FALSE)
-option(SANITIZER "active sanitizers (address,address-full,memory,thread)" "memory")
+option(SANITIZER "active sanitizers" FALSE)

 macro(cmaki_setup)
 	enable_modern_cpp()
@@ -232,25 +232,25 @@

 	if(SANITIZER)
 		if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
-			message("-- sanitizer enabled: ${SANITIZER} (clang)")
-			add_definitions(-g3)
-			# "address-full" "memory" "thread"
-			SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZER}")
-			SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER}")
-			add_definitions(-fsanitize=${SANITIZER})
-		endif()
-	endif()
-
-	IF(COVERAGE)
+			# (address,address-full,memory,thread)
+			# http://clang.llvm.org/docs/AddressSanitizer.html
+			set(SANITIZER_MODE "address")
+			message("-- sanitizer enabled: ${SANITIZER_MODE} (clang)")
+			add_definitions(-g -fno-omit-frame-pointer)
+			SET(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -fsanitize=${SANITIZER_MODE}")
+			SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=${SANITIZER_MODE}")
+			add_definitions(-fsanitize=${SANITIZER_MODE})
+		endif()
+	endif()
+
+	# IF(COVERAGE)
 		if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
 			message("-- coverage enabled (clang)")
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-instr-generate -fcoverage-mapping")
 		else()
 			message("-- coverage enabled (gcc)")
-
 			# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs")
 			# SET(CMAKE_EXE_LINKER_FLAGS  "${CMAKE_EXE_LINKER_FLAGS} -fprofile-arcs -lgcov")
-
 			set(CMAKE_C_OUTPUT_EXTENSION_REPLACE 1)
 			set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -coverage")
 			set(CMAKE_CXX_OUTPUT_EXTENSION_REPLACE 1)
@@ -258,7 +258,7 @@
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-elide-constructors")
 			set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-inline")
 		endif()
-	endif()
+	# endif()

 	if(WIN32 AND (NOT MINGW) AND (NOT MSYS))
 		# c++ exceptions and RTTI


add include in setup

add include in setup

--- cmaki.cmake
+++ cmaki.cmake
@@ -14,6 +14,8 @@
 		include(${CMAKE_CURRENT_LIST_DIR}/build/conanbuildinfo.cmake)
 		conan_basic_setup()
 	endif()
+	include_directories(.)
+	include_directories(node_modules)
 endmacro()

 macro (mark_as_internal _var)


Support for static multidb mode

Support for static multidb mode

--- cmake/Modules/UseODB.cmake
+++ cmake/Modules/UseODB.cmake
@@ -36,6 +36,7 @@

 	if(PARAM_MULTI_DATABASE)
 		list(APPEND ODB_ARGS --multi-database "${PARAM_MULTI_DATABASE}")
+		list(APPEND PARAM_DB common)
 	endif()

 	foreach(db ${PARAM_DB})
@@ -139,10 +140,14 @@
 		set(outputs)

 		foreach(sfx ${ODB_COMPILE_FILE_SUFFIX})
+			string(REGEX REPLACE ":.*$" "" pfx "${sfx}")
 			string(REGEX REPLACE "^.*:" "" sfx "${sfx}")
-			set(output "${ODB_COMPILE_OUTPUT_DIR}/${fname}${sfx}${ODB_COMPILE_SOURCE_SUFFIX}")
-			list(APPEND ${outvar} "${output}")
-			list(APPEND outputs "${output}")
+
+			if(NOT "${PARAM_MULTI_DATABASE}" MATCHES "static" OR NOT "${pfx}" MATCHES "common")
+				set(output "${ODB_COMPILE_OUTPUT_DIR}/${fname}${sfx}${ODB_COMPILE_SOURCE_SUFFIX}")
+				list(APPEND ${outvar} "${output}")
+				list(APPEND outputs "${output}")
+			endif()
 		endforeach()

 		if(ODB_COMPILE_DEBUG)


fix the permission issue of installing mklml

--- cmake/external/mklml.cmake
+++ cmake/external/mklml.cmake
@@ -21,33 +21,37 @@
 SET(MKLML_PROJECT       "extern_mklml")
 SET(MKLML_VER           "mklml_lnx_2018.0.20170425")
 SET(MKLML_URL           "https://github.com/01org/mkl-dnn/releases/download/v0.9/${MKLML_VER}.tgz")
-SET(MKLML_DOWNLOAD_DIR  "${THIRD_PARTY_PATH}/mklml")
-SET(MKLML_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/opt/paddle/third_party/mklml")
+SET(MKLML_SOURCE_DIR    "${THIRD_PARTY_PATH}/mklml")
+SET(MKLML_DOWNLOAD_DIR  "${MKLML_SOURCE_DIR}/src/${MKLML_PROJECT}")
+SET(MKLML_DST_DIR       "opt/paddle/third_party/mklml")
+SET(MKLML_INSTALL_DIR   "${CMAKE_INSTALL_PREFIX}/${MKLML_DST_DIR}")

 SET(MKLML_ROOT          ${MKLML_INSTALL_DIR}/${MKLML_VER})
 SET(MKLML_INC_DIR       ${MKLML_ROOT}/include)
 SET(MKLML_LIB_DIR       ${MKLML_ROOT}/lib)
 SET(MKLML_LIB           ${MKLML_LIB_DIR}/libmklml_intel.so)
 SET(MKLML_IOMP_LIB      ${MKLML_LIB_DIR}/libiomp5.so)
-SET(CMAKE_INSTALL_RPATH    "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib")
+SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib")

 INCLUDE_DIRECTORIES(${MKLML_INC_DIR})
+
+SET(mklml_cmakefile ${MKLML_DOWNLOAD_DIR}/CMakeLists.txt)
+FILE(WRITE ${mklml_cmakefile} "PROJECT(MKLML)\n"
+                              "cmake_minimum_required(VERSION 3.0)\n"
+                              "install(DIRECTORY ${MKLML_VER}\n"
+                              "        DESTINATION ${MKLML_DST_DIR})\n")

 ExternalProject_Add(
     ${MKLML_PROJECT}
     ${EXTERNAL_PROJECT_LOG_ARGS}
-    PREFIX                ${MKLML_DOWNLOAD_DIR}
+    PREFIX                ${MKLML_SOURCE_DIR}
     DOWNLOAD_DIR          ${MKLML_DOWNLOAD_DIR}
     DOWNLOAD_COMMAND      wget --no-check-certificate -O ${MKLML_DOWNLOAD_DIR}/${MKLML_VER}.tgz ${MKLML_URL}
-                          && mkdir -p ${MKLML_INSTALL_DIR}
-                          && tar -xzf ${MKLML_DOWNLOAD_DIR}/${MKLML_VER}.tgz -C ${MKLML_INSTALL_DIR}
+                          && tar -xzf ${MKLML_DOWNLOAD_DIR}/${MKLML_VER}.tgz
     DOWNLOAD_NO_PROGRESS  1
     UPDATE_COMMAND        ""
-    PATCH_COMMAND         ""
-    CONFIGURE_COMMAND     ""
-    BUILD_COMMAND         ""
-    INSTALL_COMMAND       ""
-    TEST_COMMAND          ""
+    CMAKE_ARGS            -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
+    CMAKE_CACHE_ARGS      -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
 )

 ADD_LIBRARY(mklml SHARED IMPORTED GLOBAL)


Update external_cldnn.cmake (#2488)

Update external_cldnn.cmake (#2488)

Changing clDNN to latest commit.

--- cmake/external_cldnn.cmake
+++ cmake/external_cldnn.cmake
@@ -22,7 +22,7 @@
 #------------------------------------------------------------------------------

 set(CLDNN_GIT_REPO_URL https://github.com/intel/clDNN.git)
-set(CLDNN_GIT_LABEL a34a1614af20dafa2864e2be0806a8d80b4eb356)
+set(CLDNN_GIT_LABEL e0efde85b3cfdd776b53447500ce0bb2aa8bca54)
 set(BOOST_VERSION 1.64.0)
 set(OUT_DIR ${EXTERNAL_PROJECTS_ROOT}/cldnn/out)


Fix SVR4 datadir

Fix SVR4 datadir

--- cmake/install_layout.cmake
+++ cmake/install_layout.cmake
@@ -167,7 +167,7 @@
 SET(INSTALL_SQLBENCHROOTDIR_SVR4 ".")
 SET(INSTALL_DOCREADMEDIR_SVR4 ".")
 SET(INSTALL_SUPPORTFILESDIR_SVR4 "support-files")
-SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
+SET(INSTALL_MYSQLDATADIR_SVR4 "/var/lib/mysql")

 # Clear cached variables if install layout was changed
 IF(OLD_INSTALL_LAYOUT)


update(cmake/modules): driver version bump to a259b4bf49c3

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

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


Optional components removed seems that cmake doesn't like it

Boost is reported as non found due to the second call to find_package

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

--- cmake/pcl_find_boost.cmake
+++ cmake/pcl_find_boost.cmake
@@ -19,8 +19,6 @@

 if(Boost_FOUND)
   set(BOOST_FOUND TRUE)
-	# Optional boost modules
-	find_package(Boost 1.40.0 COMPONENTS mpi serialization)
   # Obtain diagnostic information about Boost's automatic linking outputted
   # during compilation time.
   add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINITIONS})


Update find Boost versions

Update find Boost versions

Update find Boost versions.
Add Boost 1.62.0 and Boost 1.63.0.


DetermineTomvizVersion: check the right variable

--- cmake/DetermineTomvizVersion.cmake
+++ cmake/DetermineTomvizVersion.cmake
@@ -27,7 +27,7 @@
   endif()
 endfunction()

-if(TomViz_FROM_SOURCE_DIR)
+if(tomviz_FROM_SOURCE_DIR)
   # We can use GitDescribe in this case, so let's use it.

   # First, set the vars using the hard coded version if everything fails.


- Add missing libraries to Windows build

--- cmake/Modules/BuildFunctions.cmake
+++ cmake/Modules/BuildFunctions.cmake
@@ -71,6 +71,17 @@
             VERSION ${COFFEE_BUILD_STRING}
             SOVERSION 1
             )
+		target_link_libraries ( ${TARGET}
+			user32
+			gdi32
+			winmm
+			imm32
+			ole32
+			oleaut32
+			version
+			uuid
+			dinput8
+			)
         install(
             FILES ${BUNDLE_LIBS}
             DESTINATION bin


Update SHA256 of ROOT for Apple M1.

Update SHA256 of ROOT for Apple M1.


[cmake] Various nit in FindBerkeleyDB

[cmake] Various nit in FindBerkeleyDB

Summary: As per title.

Test Plan:
  ninja

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1812

--- cmake/modules/FindBerkeleyDB.cmake
+++ cmake/modules/FindBerkeleyDB.cmake
@@ -9,24 +9,20 @@
 find_brew_prefix(BREW_HINT berkeley-db)

 find_path(BDB_INCLUDE_DIR
-	NAMES
-		db.h
+	NAMES db.h
 	HINTS ${BREW_HINT}
 )
 find_library(BDB_LIBRARY
-	NAMES
-		db libdb
+	NAMES db libdb
 	HINTS ${BREW_HINT}
 )

 find_path(BDBXX_INCLUDE_DIR
-	NAMES
-		db_cxx.h
+	NAMES db_cxx.h
 	HINTS ${BREW_HINT}
 )
 find_library(BDBXX_LIBRARY
-	NAMES
-		db_cxx libdb_cxx
+	NAMES db_cxx libdb_cxx
 	HINTS ${BREW_HINT}
 )


modified FindCOI to find all newer MPSS installations

--- common/cmake/FindCOI.cmake
+++ common/cmake/FindCOI.cmake
@@ -16,7 +16,7 @@

 FIND_PATH(COI_INCLUDE_PATH source/COIProcess_source.h /opt/intel/mic/coi/include /usr/include/intel-coi)
 FIND_PATH(COI_HOST_LIBRARY_DIR libcoi_host.so /opt/intel/mic/coi/host-linux-release/lib/)
-FIND_PATH(COI_DEV_LIBRARY_DIR libcoi_device.so /opt/intel/mic/coi/device-linux-release/lib/ /opt/mpss/3.1/sysroots/k1om-mpss-linux/usr/lib64/  /opt/mpss/3.1.2/sysroots/k1om-mpss-linux/usr/lib64/  /opt/mpss/3.1.4/sysroots/k1om-mpss-linux/usr/lib64/ /opt/mpss/3.2/sysroots/k1om-mpss-linux/usr/lib64/ /opt/mpss/3.2.1/sysroots/k1om-mpss-linux/usr/lib64/)
+FIND_PATH(COI_DEV_LIBRARY_DIR libcoi_device.so /opt/mpss/*/sysroots/k1om-mpss-linux/usr/lib64/)

 IF (COI_INCLUDE_PATH AND COI_HOST_LIBRARY_DIR AND COI_DEV_LIBRARY_DIR)
   SET(COI_FOUND TRUE)


increasing timeout for BuildPackage test

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -260,3 +260,7 @@
   ENDIF()

 ENDIF()
+
+IF (EMBREE_TESTING_PACKAGE)
+  SET_TESTS_PROPERTIES(BuildPackage PROPERTIES TIMEOUT 1200)
+ENDIF()