make mkl link to threaded version with GCC (#958)

--- lib/TH/cmake/FindMKL.cmake
+++ lib/TH/cmake/FindMKL.cmake
@@ -50,7 +50,7 @@
 IF(CMAKE_COMPILER_IS_GNUCC)
   SET(mklthreads "mkl_gnu_thread" "mkl_intel_thread")
   SET(mklifaces  "gf" "intel")
-  SET(mklrtls)
+  SET(mklrtls "iomp5")
 ELSE(CMAKE_COMPILER_IS_GNUCC)
   SET(mklthreads "mkl_intel_thread")
   SET(mklifaces  "intel")


fixed to FindTBB.cmake

fixed to FindTBB.cmake

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -14,12 +14,19 @@
 ## limitations under the License.                                           ##
 ## ======================================================================== ##

+FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
+    DOC "Root of TBB installation"
+    PATHS ${PROJECT_SOURCE_DIR}/tbb
+          "C:/Program Files (x86)/Intel/Composer XE/tbb"
+          /opt/intel/composerxe/tbb
+          NO_DEFAULT_PATH
+)
+UNSET(TBB_INCLUDE_DIR CACHE)
+UNSET(TBB_LIBRARY)
+UNSET(TBB_LIBRARY_MALLOC)
+
 IF (WIN32)
-  FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
-    DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb "C:/Program Files (x86)/Intel/Composer XE/tbb"
-  )
-
+
   IF (CMAKE_SIZEOF_VOID_P EQUAL 8)
     SET(TBB_ARCH intel64)
   ELSE()
@@ -43,11 +50,6 @@

 ELSE ()

-  FIND_PATH(TBB_ROOT include/tbb/task_scheduler_init.h
-    DOC "Root of TBB installation"
-    PATHS ${PROJECT_SOURCE_DIR}/tbb /opt/intel/composerxe/tbb
-  )
-
   IF (APPLE)
     IF (ENABLE_INSTALLER)
       FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h)
@@ -60,8 +62,8 @@
     ENDIF()
   ELSE()
     FIND_PATH(TBB_INCLUDE_DIR tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)
-    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib/intel64/gcc4.4)
-    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib/intel64/gcc4.4)
+    FIND_LIBRARY(TBB_LIBRARY tbb PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
+    FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc PATHS ${TBB_ROOT}/lib ${TBB_ROOT}/lib64 ${TBB_ROOT}/lib/intel64/gcc4.4 NO_DEFAULT_PATH)
   ENDIF()

   FIND_PATH(TBB_INCLUDE_DIR_MIC tbb/task_scheduler_init.h PATHS ${TBB_ROOT}/include NO_DEFAULT_PATH)


updated package.cmake

updated package.cmake

--- common/cmake/package.cmake
+++ common/cmake/package.cmake
@@ -174,11 +174,11 @@
     SET(ARCH win32)
     SET(PROGRAMFILES "\$PROGRAMFILES")
   ENDIF()
-  SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.windows")

   # NSIS specific settings
   IF (ENABLE_INSTALLER)
     SET(CPACK_GENERATOR NSIS)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}")
     SET(CPACK_COMPONENTS_ALL libraries headers documentation tutorials utilities)
     SET(CPACK_NSIS_INSTALL_ROOT "${PROGRAMFILES}\\\\Intel")
     SET(CPACK_NSIS_DISPLAY_NAME "Embree: High Performance Ray Tracing Kernels")
@@ -189,6 +189,7 @@
     SET(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
   ELSE()
     SET(CPACK_GENERATOR ZIP)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.${ARCH}.windows")
     SET(CPACK_MONOLITHIC_INSTALL 1)
   ENDIF()

@@ -197,10 +198,10 @@

   CONFIGURE_FILE(README.md README.txt)
   SET(CPACK_RESOURCE_FILE_README ${PROJECT_BINARY_DIR}/README.txt)
-  SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")

   IF (ENABLE_INSTALLER)
     SET(CPACK_GENERATOR PackageMaker)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
     #SET(CPACK_COMPONENTS_ALL libraries headers documentation tutorials utilities)
     SET(CPACK_MONOLITHIC_INSTALL 1)
     SET(CPACK_PACKAGE_NAME embree-${EMBREE_VERSION})
@@ -208,17 +209,18 @@
     SET(CPACK_OSX_PACKAGE_VERSION 10.7)
   ELSE()
     SET(CPACK_GENERATOR TGZ)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.macosx")
     SET(CPACK_MONOLITHIC_INSTALL 1)
   ENDIF()

 # Linux specific settings
 ELSE()

-  SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")

   IF (ENABLE_INSTALLER)

     SET(CPACK_GENERATOR RPM)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64")
     SET(CPACK_COMPONENTS_ALL libraries headers documentation tutorials utilities libraries_xeonphi tutorials_xeonphi utilities_xeonphi)
     SET(CPACK_RPM_COMPONENT_INSTALL ON)
     SET(CPACK_RPM_PACKAGE_LICENSE "ASL 2.0") # Apache Software License, Version 2.0
@@ -235,6 +237,7 @@
   ELSE()

     SET(CPACK_GENERATOR TGZ)
+    SET(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}.x86_64.linux")
     SET(CPACK_MONOLITHIC_INSTALL 1)
   ENDIF()


minor imp

minor imp

--- salome_adm/cmake_files/SalomeMacros.cmake
+++ salome_adm/cmake_files/SalomeMacros.cmake
@@ -286,7 +286,7 @@
   IF(SALOME_PACKAGE_REPORT_JUSTIFY)
     SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY})
   ELSE()
-    SET(_length 10)
+    SET(_length 23)
   ENDIF()
   MESSAGE(STATUS "")
   MESSAGE(STATUS "  Optional packages - Detection report ")


feat(WASMExports): Export all functions in WASI

--- src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
+++ src/docker/itk-wasm/ITKWebAssemblyInterface.cmake
@@ -52,7 +52,7 @@
     if (NOT ${_is_imported})
       _target_link_libraries(${target} PRIVATE $<$<LINK_LANGUAGE:CXX>:wasi-exception-shim>)
       get_property(_link_flags TARGET ${wasm_target} PROPERTY LINK_FLAGS)
-      set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS "-Wl,--export-if-defined=\"main\" -Wl,--export-if-defined=itk_wasm_input_array_alloc ${_link_flags}")
+      set_property(TARGET ${wasm_target} PROPERTY LINK_FLAGS "-Wl,--export-if-defined=main -Wl,--export-if-defined=itk_wasm_input_array_alloc --export-if-defined=itk_wasm_input_json_alloc --export-if-defined=itk_wasm_output_json_address --export-if-defined=itk_wasm_output_json_size --export-if-defined=itk_wasm_output_array_address --export-if-defined=itk_wasm_output_array_size --export-if-defined=itk_wasm_free_all ${_link_flags}")
     endif()
   endif()
 endfunction()


cmake: dts: Drop loading symbols from generated_dts_board.conf

Now that DT symbols from generated_dts_board.conf are deprecated remove
loading symbols from it.

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

--- cmake/dts.cmake
+++ cmake/dts.cmake
@@ -214,8 +214,6 @@
     message(FATAL_ERROR "command failed with return code: ${ret}")
   endif()

-  import_kconfig(DT_     ${GENERATED_DTS_BOARD_CONF})
-
 else()
   file(WRITE ${GENERATED_DTS_BOARD_UNFIXED_H} "/* WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! */")
   file(WRITE ${GENERATED_DTS_BOARD_UNFIXED_H}.deprecated "/* WARNING. THIS FILE IS AUTO-GENERATED. DO NOT MODIFY! */")


Dev Checkpoint 201901211426

Dev Checkpoint 201901211426

--- FindImpactSockets.cmake
+++ FindImpactSockets.cmake
@@ -12,44 +12,54 @@
 #   SOCKETS_LIBRARIES      - List of libraries when using ImpactSockets.
 #   SOCKETS_FOUND          - True if ImpactSockets found.
 #   SOCKETS_VERSION_STRING - the version of ImpactSockets found.
+#

-# Look for the header file.
-find_path(SOCKETS_INCLUDE_DIR
-    PATHS
-    /usr/include/sockets
-    /usr/local/include/sockets
-    NAMES basic_socket
-)
-mark_as_advanced(SOCKETS_INCLUDE_DIR)
+IF (SOCKETS_LIBRARIES AND SOCKETS_INCLUDE_DIRS)
+    SET(SOCKETS_FOUND TRUE)
+ELSE (SOCKETS_LIBRARIES AND SOCKETS_INCLUDE_DIRS)
+    FIND_PATH(SOCKETS_INCLUDE_DIR
+        NAMES basic_socket
+        PATHS
+        /usr/include/sockets
+        /usr/local/include/sockets
+    )
+
+    FIND_LIBRARY(SOCKETS_LIBRARY
+        NAMES ImpactSockets
+        PATHS
+        /usr/lib
+        /usr/local/lib
+        # Windows MSVC prebuilts:
+        # <->lib
+        # lib<->_imp
+        # <->lib_static
+        # Windows older "Win32 - MSVC" prebuilts
+        # lib<->
+    )
+
+    #IF (SOCKETS_INCLUDE_DIR)
+    #    IF (EXISTS "${SOCKETS_INCLUDE_DIR}/SocVersion.h")
+    #        FILE(STRINGS "${SOCKETS_INCLUDE_DIR}/SocVersion.h" soc_version_str REGEX "^#define[\t ]+SOCKETS_VERSION[\t ]+\".*\"")
+    #        STRING(REGEX REPLACE "^#define[\t ]+SOCKETS_VERSION[\t ]+\"([^\"]*)\".*" "\\1" SOCKETS_VERSION_STRING "${soc_version_str}")
+    #        UNSET(soc_version_str)
+    #    ENDIF ()
+    #ENDIF ()
+
+    IF (SOCKETS_INCLUDE_DIR AND SOCKETS_LIBRARY)
+        SET(SOCKETS_FOUND TRUE)
+    ENDIF ()

-# Look for the library (sorted from most current/relevant entry to least).
-find_library(SOCKETS_LIBRARY NAMES
-    ImpactSockets
-    # Windows MSVC prebuilts:
-    # <->lib
-    # lib<->_imp
-    # <->lib_static
-    # Windows older "Win32 - MSVC" prebuilts
-    # lib<->
-)
-mark_as_advanced(SOCKETS_LIBRARY)
+    SET(SOCKETS_INCLUDE_DIRS ${SOCKETS_INCLUDE_DIR})

-IF (SOCKETS_INCLUDE_DIR)
-    IF (EXISTS "${SOCKETS_INCLUDE_DIR}/SocVersion.h")
-    FILE(STRINGS "${SOCKETS_INCLUDE_DIR}/SocVersion.h" soc_version_str REGEX "^#define[\t ]+SOCKET_VERSION[\t ]+\".*\"")
-
-    STRING(REGEX REPLACE "^#define[\t ]+SOCKET_VERSION[\t ]+\"([^\"]*)\".*" "\\1" SOCKET_VERSION_STRING "${soc_version_str}")
-    UNSET(soc_version_str)
-    ENDIF ()
-ENDIF ()
+    IF (SOCKETS_LIBRARY)
+        SET(SOCKETS_LIBRARIES ${SOCKETS_LIBRARIES} ${SOCKETS_LIBRARY})
+    ENDIF (SOCKETS_LIBRARY)

-#include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sockets
-                                  REQUIRED_VARS SOCKETS_LIBRARY SOCKETS_INCLUDE_DIR
-                                  VERSION_VAR SOCKETS_VERSION_STRING)
+    INCLUDE(FindPackageHandleStandardArgs)
+    FIND_PACKAGE_HANDLE_STANDARD_ARGS(ImpactSockets DEFAULT_MSG
+        SOCKETS_LIBRARIES SOCKETS_INCLUDE_DIRS
+        #VERSION_VAR SOCKETS_VERSION_STRING
+    )

-IF (SOCKETS_FOUND)
-    SET(SOCKETS_LIBRARIES ${SOCKETS_LIBRARY})
-    SET(SOCKETS_INCLUDE_DIRS ${SOCKETS_INCLUDE_DIR})
-ENDIF ()
+    MARK_AS_ADVANCED(SOCKETS_INCLUDE_DIRS SOCKETS_LIBRARIES)
+ENDIF (SOCKETS_LIBRARIES AND SOCKETS_INCLUDE_DIRS)


ENH: Added Utilities/png to accessible header list.

--- GenerateVTKConfig.cmake
+++ GenerateVTKConfig.cmake
@@ -63,8 +63,7 @@
 # Library directory.
 SET(VTK_LIBRARY_DIRS ${VTK_LIBRARY_PATH})

-# Determine the include directories needed.  Note that use projects
-# should not need the "Utilities" directory or its subdirectories.
+# Determine the include directories needed.
 SET(VTK_INCLUDE_DIRS ${VTK_BINARY_DIR})
 IF(VTK_USE_PARALLEL)
   SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_SOURCE_DIR}/Parallel)
@@ -85,9 +84,14 @@
   ${VTK_SOURCE_DIR}/Imaging
   ${VTK_SOURCE_DIR}/Graphics
   ${VTK_SOURCE_DIR}/Filtering
-  ${VTK_SOURCE_DIR}/Common
-  ${VTK_SOURCE_DIR}/Utilities/zlib
-  ${VTK_BINARY_DIR}/Utilities/zlib)
+  ${VTK_SOURCE_DIR}/Common)
+
+# Give access to a few utilities.
+SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS}
+  ${VTK_BINARY_DIR}/Utilities/png
+  ${VTK_SOURCE_DIR}/Utilities/png
+  ${VTK_BINARY_DIR}/Utilities/zlib
+  ${VTK_SOURCE_DIR}/Utilities/zlib)

 # Add the system include directories last.
 SET(VTK_INCLUDE_DIRS ${VTK_INCLUDE_DIRS} ${VTK_INCLUDE_DIRS_SYS})


:bug: else should be elseif

:bug: else should be elseif

--- scripts/PackageLookup.cmake
+++ scripts/PackageLookup.cmake
@@ -308,7 +308,7 @@
     # Then write or append to file.
     if(_wpls${package}_APPEND AND NOT _wpls${package}_CONFIGURE)
         file(APPEND "${hook_script}" ${_wpls${package}_UNPARSED_ARGUMENTS})
-    else(NOT _wpls${package}_CONFIGURE)
+    elseif(NOT _wpls${package}_CONFIGURE)
         file(WRITE "${hook_script}" ${_wpls${package}_UNPARSED_ARGUMENTS})
     else()
         configure_file("${_wpls${package}_CONFIGURE}" "${hook_script}" @ONLY)


version bump libvisual alsa

version bump libvisual alsa

git-svn-id: 647c2dfdf120d9af8205d960f30c8711574448cd@1404 6778bc44-b910-0410-a7a0-be141de4315d

--- src/projectM-libvisual-alsa/cmake/CPack-projectM.cmake
+++ src/projectM-libvisual-alsa/cmake/CPack-projectM.cmake
@@ -17,8 +17,8 @@
 #SET(CPACK_BINARY_TGZ ON)
 #SET(CPACK_SOURCE_Z OFF)
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "0")
-SET(CPACK_PACKAGE_VERSION_PATCH "1")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")

 INCLUDE(CPack)


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 06)

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


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 12)

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


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 08)

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


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 03)

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


x86: allow easily changing the CPU optimization

--- build/cmake/arch-x86.cmake
+++ build/cmake/arch-x86.cmake
@@ -1,6 +1,9 @@
 arch("x86" "arch/x86")
-option(OPTIMIZE_NATIVE "Optimize for the native machine." OFF)
 option(ENABLE_X64 "Enable x86_64 mode." OFF)
+
+set(OPTIMIZE_FOR "generic" CACHE STRING "CPU to Optimize For")
+set(QEMU_CPU "core2duo" CACHE STRING "QEMU CPU")
+set(QEMU_NIC "e1000" CACHE STRING "QEMU NIC Model")

 cflags(
   -DARCH_X86
@@ -16,13 +19,9 @@
   cflags(-target i686-pc-elf)
 endif()

-if(OPTIMIZE_NATIVE)
-  cflags(-march=native)
-elseif(NOT COMPCERT)
-  cflags(-mtune=generic)
-endif()
+if(NOT COMPCERT)
+  cflags(-march=${OPTIMIZE_FOR})

-if(NOT COMPCERT)
   kernel_cflags(
     -fno-stack-protector
     -fno-pic
@@ -41,9 +40,9 @@

 set(QEMU_CMD_BASE
   qemu-system-i386
-    -cpu core2duo
+    -cpu ${QEMU_CPU}
     -m 256
-    -net nic,model=e1000
+    -net nic,model=${QEMU_NIC}
     -drive "file=${CMAKE_BINARY_DIR}/raptor.img,format=raw,if=ide,media=disk"
 )

@@ -109,8 +108,8 @@
     add_custom_target(qemu-windows
       COMMAND "C:/Program Files/qemu/qemu-system-i386.exe"
             -netdev user,id=net0
-            -device e1000,netdev=net0
-            -cpu core2duo
+            -device ${QEMU_NIC},netdev=net0
+            -cpu ${QEMU_CPU}
             -m 256
             -kernel "${CMAKE_BINARY_DIR}/kernel.elf"
       DEPENDS kernel


cmake: fixing infinite loop when searching for Zephyr on windows

Fixes: #24909

This commit compares against previous search path instead of '/'.
This fixes the infinite loop issue on windows when building a Zephyr
standalone application and not setting ZEPHYR_BASE.

Signed-off-by: Torsten Rasmussen <a7c5b1d5a1f41fce6edfa3f7c2392ae0c59deafe@nordicsemi.no>
Signed-off-by: Ethan Slattery <0a27e12d062ad71673d57f9c2799b207af316885@wildlifecomputers.com>

--- share/zephyr-package/cmake/zephyr_package_search.cmake
+++ share/zephyr-package/cmake/zephyr_package_search.cmake
@@ -12,12 +12,13 @@
 # This macro returns a list of parent folders to use for later searches.
 macro(get_search_paths START_PATH SEARCH_PATHS PREFERENCE_LIST)
   get_filename_component(SEARCH_PATH ${START_PATH} DIRECTORY)
-  while(NOT (SEARCH_PATH STREQUAL "/"))
+  while(NOT (SEARCH_PATH STREQUAL SEARCH_PATH_PREV))
     foreach(preference ${PREFERENCE_LIST})
       list(APPEND SEARCH_PATHS ${SEARCH_PATH}/${preference})
     endforeach()
     list(APPEND SEARCH_PATHS ${SEARCH_PATH}/zephyr)
     list(APPEND SEARCH_PATHS ${SEARCH_PATH})
+    set(SEARCH_PATH_PREV ${SEARCH_PATH})
     get_filename_component(SEARCH_PATH ${SEARCH_PATH} DIRECTORY)
   endwhile()
 endmacro()


Add flag to build metadata to indicate modified/uncommitted files are used in the build.

--- cmake/CSEVersion.cmake
+++ cmake/CSEVersion.cmake
@@ -68,7 +68,20 @@
   message(FATAL_ERROR "GIT_BUILD value ${GIT_BUILD} is not accessible." )
 endif()

-set(CSEVRSN_META "+${GIT_BRANCH}.${GIT_SHA}.${GIT_BUILD}")
+# Check for modified ("dirty") state
+execute_process(
+  COMMAND ${GIT_EXECUTABLE} diff --shortstat
+  WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+  RESULT_VARIABLE git_stat_exit_status
+  OUTPUT_VARIABLE GIT_STATUS
+  OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+if (${GIT_STATUS} MATCHES "changed")
+  set(GIT_STATUS ".dirty")
+endif()
+
+set(CSEVRSN_META "+${GIT_BRANCH}.${GIT_SHA}.${GIT_BUILD}${GIT_STATUS}")

 message("Building CSE ${CSEVRSN_MAJOR}.${CSEVRSN_MINOR}.${CSEVRSN_PATCH}${CSEVRSN_PRERELEASE}${CSEVRSN_META}")


cmake: some changes of minor importance

cmake: some changes of minor importance

--- cmake/DPF-plugin.cmake
+++ cmake/DPF-plugin.cmake
@@ -110,6 +110,8 @@
       dpf__build_lv2("${NAME}" "${_dgl_library}" "${_dpf_plugin_MONOLITHIC}")
     elseif(_target STREQUAL "vst")
       dpf__build_vst("${NAME}" "${_dgl_library}")
+    else()
+      message(FATAL_ERROR "Unrecognized target type for plugin: ${_target}")
     endif()
   endforeach()
 endfunction()
@@ -416,7 +418,7 @@
 # dpf__add_static_library
 # ------------------------------------------------------------------------------
 #
-# Adds a module target, and set some default properties on the target.
+# Adds a static library target, and set some default properties on the target.
 #
 function(dpf__add_static_library NAME)
   add_library("${NAME}" STATIC ${ARGN})


Permanent cache of C_INLINE_IS_INLINE

Permanent cache of C_INLINE_IS_INLINE

--- 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)
+        SET (C_INLINE_IS_INLINE TRUE CACHE BOOL "C inline keyword is inline"))
       ELSE ()
-        SET (C_INLINE_IS_INLINE FALSE)
+        SET (C_INLINE_IS_INLINE FALSE CACHE BOOL "C inline keyword is inline"))
       ENDIF ()
       MARK_AS_ADVANCED (C_INLINE_IS_INLINE)
     ENDIF ()


add -Wextra for generating more warnings

--- cmake/flags_unix.cmake
+++ cmake/flags_unix.cmake
@@ -1,5 +1,5 @@
 # don't even want the old compiler
-set(LRCX_COMPILER_FLAGS "-std=c++11 -fvisibility=hidden")
+set(LRCX_COMPILER_FLAGS "-std=c++11 -fvisibility=hidden -Wextra")

 # when using AddressSanitizer, clang won't compiles with --no-undefined
 if (LRCX_ENABLE_ASAN AND "!${CMAKE_CXX_COMPILER_ID}" STREQUAL "!Clang")
@@ -13,6 +13,14 @@
 if (LRCX_WARN_AS_ERROR)
 	set(LRCX_COMPILER_FLAGS "-Wall -Werror ${LRCX_COMPILER_FLAGS}")
 endif()
+
+set(IGNORED_WARNINGS
+	unused-parameter
+	)
+
+foreach(warning ${IGNORED_WARNINGS})
+	set(LRCX_COMPILER_FLAGS " ${LRCX_COMPILER_FLAGS} -Wno-${warning}")
+endforeach()

 set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG ${CMAKE_C_FLAGS_DEBUG}")
 set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")


experimentally disabling stack protector for ICC under Windows

--- common/cmake/icc.cmake
+++ common/cmake/icc.cmake
@@ -28,11 +28,11 @@
   SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /MP")          # compile source files in parallel
   SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GR")          # enable runtime type information (on by default)
   SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qvec-")       # disable auto vectorizer
-  IF (EMBREE_STACK_PROTECTOR)
-    SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS")          # protects against return address overrides
-  ELSE()
+  #IF (EMBREE_STACK_PROTECTOR)
+  #  SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS")          # protects against return address overrides
+  #ELSE()
     SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /GS-")          # do not protect against return address overrides
-  ENDIF()
+  #ENDIF()

   SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11074 ")  # remark #11074: Inlining inhibited by limit max-size
   SET(COMMON_CXX_FLAGS "${COMMON_CXX_FLAGS} /Qdiag-disable:11075 ")  # remark #11075: To get full report use -Qopt-report:4 -Qopt-report-phase ipo


BUG: Mantis-856: allow both internal and external MuParser

--- CMake/ImportMuParser.cmake
+++ CMake/ImportMuParser.cmake
@@ -1,37 +1,43 @@
 message(STATUS "Importing MuParser...")
-find_package(MuParser)

-if(MUPARSER_FOUND)
-  option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." ON)
+option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." ON)
+mark_as_advanced(OTB_USE_EXTERNAL_MUPARSER)

-  # Starting with muparser 2.0.0,
-  #  intrinsic operators "and", "or", "xor" have been removed
-  #  and intrinsic operators "&&" and "||" have been introduced as replacements
-  set(CMAKE_REQUIRED_INCLUDES ${MUPARSER_INCLUDE_DIR})
-  set(CMAKE_REQUIRED_LIBRARIES ${MUPARSER_LIBRARIES})
-  unset(CMAKE_REQUIRED_FLAGS)
-  unset(CMAKE_REQUIRED_DEFINES)
-  file(READ ${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestMuParserHasCxxLogicalOperators.cxx
-       OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS_SOURCEFILE)
-  check_cxx_source_runs(
-    "${OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS_SOURCEFILE}"
-    OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS
-    )
-  unset(CMAKE_REQUIRED_INCLUDES)
-  unset(CMAKE_REQUIRED_LIBRARIES)
-  unset(CMAKE_REQUIRED_FLAGS)
-  unset(CMAKE_REQUIRED_DEFINES)
+if(OTB_USE_EXTERNAL_MUPARSER)
+  find_package(MuParser)

-  if(OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS)
-    message(STATUS "  Testing if muParser has '&&' operator -- yes")
+  if(MUPARSER_FOUND)
+    # Starting with muparser 2.0.0,
+    #  intrinsic operators "and", "or", "xor" have been removed
+    #  and intrinsic operators "&&" and "||" have been introduced as replacements
+    set(CMAKE_REQUIRED_INCLUDES ${MUPARSER_INCLUDE_DIR})
+    set(CMAKE_REQUIRED_LIBRARIES ${MUPARSER_LIBRARIES})
+    unset(CMAKE_REQUIRED_FLAGS)
+    unset(CMAKE_REQUIRED_DEFINES)
+    file(READ ${CMAKE_CURRENT_SOURCE_DIR}/CMake/otbTestMuParserHasCxxLogicalOperators.cxx
+        OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS_SOURCEFILE)
+    check_cxx_source_runs(
+      "${OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS_SOURCEFILE}"
+      OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS
+      )
+    unset(CMAKE_REQUIRED_INCLUDES)
+    unset(CMAKE_REQUIRED_LIBRARIES)
+    unset(CMAKE_REQUIRED_FLAGS)
+    unset(CMAKE_REQUIRED_DEFINES)
+
+    if(OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS)
+      message(STATUS "  Testing if muParser has '&&' operator -- yes")
+    else()
+      message(STATUS "  Testing if muParser has '&&' operator -- no")
+    endif()
   else()
-    message(STATUS "  Testing if muParser has '&&' operator -- no")
+    message(FATAL_ERROR "Can't build OTB without MuParser. Instal MuParser on your system, or disable the option OTB_USE_EXTERNAL_MUPARSER")
   endif()

 else()
-  option(OTB_USE_EXTERNAL_MUPARSER "Use external MuParser library." OFF)
+
   set(MUPARSER_LIBRARIES otbmuparser)
   unset(OTB_MUPARSER_HAS_CXX_LOGICAL_OPERATORS) # internal version is < 2.0.0
-  message(STATUS "  Using MuParser internal version")
+  message(STATUS "  Using MuParser internal version (no '&&' operator)")
 endif()
-mark_as_advanced(OTB_USE_EXTERNAL_MUPARSER)
+


Incrementing the version to 3.3.2

Incrementing the version to 3.3.2

--- CMakeModules/Version.cmake
+++ CMakeModules/Version.cmake
@@ -3,7 +3,7 @@
 #
 SET(AF_VERSION_MAJOR "3")
 SET(AF_VERSION_MINOR "3")
-SET(AF_VERSION_PATCH "1")
+SET(AF_VERSION_PATCH "2")

 SET(AF_VERSION "${AF_VERSION_MAJOR}.${AF_VERSION_MINOR}.${AF_VERSION_PATCH}")
 SET(AF_API_VERSION_CURRENT ${AF_VERSION_MAJOR}${AF_VERSION_MINOR})


Remove forced /MT setting

Remove forced /MT setting

--- cmake/Modules/AR_CompilerSettings.cmake
+++ cmake/Modules/AR_CompilerSettings.cmake
@@ -47,18 +47,18 @@
     # it always reports 199711L (i.e. C++98).
     set(${flag_var} "${${flag_var}} /Zc:__cplusplus")

-    if (flag_var MATCHES "DEBUG")
-      set(${flag_var} "${${flag_var}} /MTd")
-    else ()
-      set(${flag_var} "${${flag_var}} /MT")
-    endif ()
+    #if (flag_var MATCHES "DEBUG")
+    #  set(${flag_var} "${${flag_var}} /MTd")
+    #else ()
+    #  set(${flag_var} "${${flag_var}} /MT")
+    #endif ()
   endforeach()

   # https://msdn.microsoft.com/en-us/library/aa267384%28VS.60%29.aspx
-  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /LTCG /ignore:4099 /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:msvcrtd.lib")
-  set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /SUBSYSTEM:CONSOLE /ignore:4099 /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:msvcrtd.lib")
-  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /SUBSYSTEM:CONSOLE /ignore:4099 /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:msvcrtd.lib")
-  set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /SUBSYSTEM:CONSOLE /ignore:4099 /NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib /NODEFAULTLIB:msvcrtd.lib")
+  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /LTCG")
+  set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} /SUBSYSTEM:CONSOLE /ignore:4099")
+  set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /SUBSYSTEM:CONSOLE /ignore:4099")
+  set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /SUBSYSTEM:CONSOLE /ignore:4099")

   set(CanUseSSE42 True CACHE BOOL "Use SSE4.2 optimizations")
 else()


haskell-debian-stretch: add memleak label

--- cmake/Modules/LibAddHaskellPlugin.cmake
+++ cmake/Modules/LibAddHaskellPlugin.cmake
@@ -276,7 +276,8 @@
 		get_target_property (HASKELL_RPATH elektra-${target} INSTALL_RPATH)
 		set_target_properties (testmod_${target}
 			PROPERTIES
-			INSTALL_RPATH "${HASKELL_RPATH}")
+			INSTALL_RPATH "${HASKELL_RPATH}"
+			LABELS memleak)
 	endif (ADDTESTING_PHASE AND BUILD_TESTING AND (BUILD_SHARED OR BUILD_FULL))
 	endif (TARGET elektra-${target})


compiler/xcc: Remove -Werror flag unknown to XCC

XCC (based on GCC 4.2) doesn't recognize -Wvla (for variable-length
array), so remove it from "warning_error_misra_sane" property.

Signed-off-by: Ederson de Souza <1da3dd06fbb9d545ec21e96bca6ffa5cba52ede5@intel.com>

--- cmake/compiler/xcc/compiler_flags.cmake
+++ cmake/compiler/xcc/compiler_flags.cmake
@@ -18,4 +18,6 @@
   # time.  Suppress the warning, it's the best we can do given that
   # it's a legacy compiler.
   set_compiler_property(APPEND PROPERTY warning_base "-fgnu89-inline")
+
+  set_compiler_property(PROPERTY warning_error_misra_sane)
 endif()


Updated cmake/FindOpenVDB.cmake to propagate cxx11 standard requirement

Signed-off-by: Nick Avramoussis <ce9ae7fb000f2865db247e53b12753caeda92c74@users.noreply.github.com>

--- cmake/FindOpenVDB.cmake
+++ cmake/FindOpenVDB.cmake
@@ -470,6 +470,7 @@
       INTERFACE_INCLUDE_DIRECTORIES "${OpenVDB_INCLUDE_DIR}"
       IMPORTED_LINK_DEPENDENT_LIBRARIES "${_OPENVDB_HIDDEN_DEPENDENCIES}" # non visible deps
       INTERFACE_LINK_LIBRARIES "${_OPENVDB_VISIBLE_DEPENDENCIES}" # visible deps (headers)
+      INTERFACE_COMPILE_FEATURES cxx_std_11
    )
   endif()
 endforeach()


Fix cmake bug where src/core static libs were built into bin instead of lib.

--- cmake/ModuleSetup.cmake
+++ cmake/ModuleSetup.cmake
@@ -42,7 +42,7 @@
     link_directories (${PROJECT_BINARY_DIR}/lib)

     # set TARGET_DIR
-    if (${TARGET_NAME}_OUTPUT)
+    if (NOT "${TARGET_NAME_OUTPUT}" STREQUAL "")
         set (TARGET_DIR ${PROJECT_BINARY_DIR}/bin/${ARGV2})
         if (MSVC)
             # export symbols, copy needs to be added via copy_target


etcd => libexec

etcd => libexec

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -46,6 +46,7 @@

   # bin dir ----------------------------
   set(ARANGODB_INSTALL_BIN "bin")
+  set(ARANGODB_INSTALL_LIBEXEC "libexec")
   set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")

   # MS stuff ---------------------------
@@ -121,6 +122,7 @@
     set(ARANGODB_INSTALL_BIN "bin")
     set(TRI_BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
   endif ()
+  set(ARANGODB_INSTALL_LIBEXEC "libexec")

   # sbinaries
   if (MSVC)
@@ -170,7 +172,7 @@
 if (NOT WINDOWS)
   install(
     PROGRAMS ${PROJECT_BINARY_DIR}/bin/etcd-arango
-    DESTINATION ${ARANGODB_INSTALL_BIN}
+    DESTINATION ${ARANGODB_INSTALL_LIBEXEC}
   )
 endif ()


added LibPoco dependencies for MySQL, fixes #4

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -26,9 +26,10 @@
 )

 find_package(Boost COMPONENTS system filesystem REQUIRED)
+find_package(OpenCV REQUIRED)
+find_package(Poco COMPONENTS Foundation Util Data DataMySQL REQUIRED)
 find_package(Qt5Core REQUIRED)
 find_package(Qt5Xml REQUIRED)
-find_package(OpenCV REQUIRED)

 #
 # Include directories
@@ -41,7 +42,7 @@
 # Libraries
 #

-set(DEFAULT_LIBRARIES ${Boost_LIBRARIES} ${OpenCV_LIBS} Qt5::Core Qt5::Xml)
+set(DEFAULT_LIBRARIES ${Boost_LIBRARIES} ${OpenCV_LIBS} ${Poco_LIBRARIES} Qt5::Core Qt5::Xml)

 #


Fix Findgoogletest.cmake for MSVC

Fix Findgoogletest.cmake for MSVC

--- cmake/Findgoogletest.cmake
+++ cmake/Findgoogletest.cmake
@@ -5,13 +5,27 @@
 include(FindPackageHandleStandardArgs)

 find_package(PkgConfig)
+
+# enable MSVC syntax if required
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
+    set(PKG_CONFIG_ARGN ${PKG_CONFIG_ARGN} "--msvc-syntax")
+endif()
+
 pkg_search_module(GMOCK QUIET gmock_main)

 find_package_handle_standard_args(googletest REQUIRED_VARS GMOCK_CFLAGS GMOCK_LDFLAGS)
 mark_as_advanced(GMOCK_CFLAGS GMOCK_LDFLAGS)

 if (googletest_FOUND)
-
+    # the linker flags aren't correct for use with target_link_libraries
+    # example: /libpath:[path]/lib.lib;gmock_main.lib;gmock.lib;gtest.lib
+    # note that the path arg falsely includes a .lib suffix
+    # additionally, cmake expects linker flags to start with -
+    # thus, the leading / has to be replaced
+    # example result: -libpath:[path]/lib;gmock_main.lib;gmock.lib;gtest.lib
+    if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
+        string(REGEX REPLACE "(\\/)(libpath[^;]*)(\\.lib)" "-\\2" GMOCK_LDFLAGS "${GMOCK_LDFLAGS}")
+    endif()

     # Create interface library to link against gmock
     add_library(googletest::googletest INTERFACE IMPORTED)


Changing minimum version of czmq (now 2.1.0).

--HG--
branch : fix_czmq_version

--- cmake/SearchForStuff.cmake
+++ cmake/SearchForStuff.cmake
@@ -58,7 +58,7 @@

 #################################################
 # Find czmq.:
-pkg_check_modules(czmq libczmq>=1.4.0)
+pkg_check_modules(czmq libczmq>=2.1.0)

 if (NOT czmq_FOUND)
   message (STATUS "Looking for czmq pkgconfig file - not found")


[CMake] Support cross-compiling with Fuchsia toolchain build

When second stage is being cross-compiled for a different platform
we need to build enough of first stage runtimes to get a working
compiler.

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

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

--- cmake/caches/Fuchsia.cmake
+++ cmake/caches/Fuchsia.cmake
@@ -1,6 +1,6 @@
 # This file sets up a CMakeCache for a Fuchsia toolchain build.

-set(LLVM_TARGETS_TO_BUILD Native CACHE STRING "")
+set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")

 set(PACKAGE_VENDOR Fuchsia CACHE STRING "")

@@ -43,6 +43,37 @@
   set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
 endif()

+if(BOOTSTRAP_CMAKE_SYSTEM_NAME)
+  set(target "${BOOTSTRAP_CMAKE_CXX_COMPILER_TARGET}")
+  if(STAGE2_LINUX_${target}_SYSROOT)
+    set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+    set(BUILTINS_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
+    set(BUILTINS_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
+    set(LLVM_BUILTIN_TARGETS "${target}" CACHE STRING "")
+
+    set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME Linux CACHE STRING "")
+    set(RUNTIMES_${target}_CMAKE_BUILD_TYPE Release CACHE STRING "")
+    set(RUNTIMES_${target}_CMAKE_SYSROOT ${STAGE2_LINUX_${target}_SYSROOT} CACHE STRING "")
+    set(RUNTIMES_${target}_LLVM_ENABLE_ASSERTIONS ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBUNWIND_USE_COMPILER_RT ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBUNWIND_INSTALL_LIBRARY OFF CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXXABI_USE_COMPILER_RT ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXXABI_INSTALL_LIBRARY OFF CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXX_USE_COMPILER_RT ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "")
+    set(RUNTIMES_${target}_LIBCXX_ABI_VERSION 2 CACHE STRING "")
+    set(RUNTIMES_${target}_SANITIZER_CXX_ABI "libc++" CACHE STRING "")
+    set(RUNTIMES_${target}_SANITIZER_CXX_ABI_INTREE ON CACHE BOOL "")
+    set(RUNTIMES_${target}_COMPILER_RT_USE_BUILTINS_LIBRARY ON CACHE BOOL "")
+    set(LLVM_RUNTIME_TARGETS "${target}" CACHE STRING "")
+  endif()
+endif()
+
 set(CLANG_BOOTSTRAP_TARGETS
   check-all
   check-llvm


Fix "invalid escape" issue when eigen_SOURCE_PATH contains "\". (#258)

--- cmake/external/eigen.cmake
+++ cmake/external/eigen.cmake
@@ -1,7 +1,7 @@
 include (ExternalProject)

 if (onnxruntime_USE_PREINSTALLED_EIGEN)
-    set(eigen_INCLUDE_DIRS ${eigen_SOURCE_PATH})
+    file(TO_CMAKE_PATH ${eigen_SOURCE_PATH} eigen_INCLUDE_DIRS)
     ExternalProject_Add(eigen
         PREFIX eigen
         SOURCE_DIR ${eigen_SOURCE_PATH}


improve doc of qi_add_optional_package

improve doc of qi_add_optional_package

--- cmake/qibuild/option.cmake
+++ cmake/qibuild/option.cmake
@@ -11,8 +11,19 @@
 #   # Create a WITH_FOO option if FOO_PACKAGE is found
 #   qi_add_optional_package(FOO)
 #
+#   # Add some foo-dependent sources when buidling bar library:
+#   set(bar_srcs
+#         bar_spam.cpp
+#         bar_eggs.cpp
+#   )
 #   if(WITH_FOO)
-#      ...
+#      list(APPEND bar_srcs bar_foo.cpp)
+#   endif()
+#
+#   qi_create_bin(bar ${bar_srcs})
+#   qi_use_lib(bar SPAM EGGS)
+#   if(WITH_FOO)
+#      qi_use_lib(bar FOO)
 #   endif()
 #
 # \arg:  NAME             Name of the package, a WITH_${NAME} option will be created


cmake : find qi modules before upstream modules.

--- cmake/qibuild/uselib.cmake
+++ cmake/qibuild/uselib.cmake
@@ -27,6 +27,7 @@
   foreach(_pkg ${ARGN})
     string(TOUPPER ${_pkg} _U_PKG)
     if (NOT ${_U_PKG}_SEARCHED)
+      find_package(${_pkg} NO_MODULE QUIET)
       find_package(${_pkg} ${_is_required})
       qi_set_global("${_U_PKG}_SEARCHED" TRUE)
     endif()


Ignore EOL type when comparing golden files

--- cmake/test_functions.cmake
+++ cmake/test_functions.cmake
@@ -35,7 +35,7 @@

         add_test(
             NAME    "${COS_COMMAND}_${COS_NAME}_compare_stdout"
-            COMMAND ${CMAKE_COMMAND} -E compare_files
+            COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol
                     "${CMAKE_SOURCE_DIR}/test/compare/${COS_COMMAND}/out/${COS_NAME}"
                     "${COS_NAME}.out"
         )
@@ -48,7 +48,7 @@

         add_test(
             NAME    "${COS_COMMAND}_${COS_NAME}_compare_stderr"
-            COMMAND ${CMAKE_COMMAND} -E compare_files
+            COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol
                     "${CMAKE_SOURCE_DIR}/test/compare/${COS_COMMAND}/err/${COS_NAME}"
                     "${COS_NAME}.err"
         )


Convert from rrgraph XML to capnp during lookahead computation.

The incremental XML writer we use during rr graph patching is actually
pretty memory efficent, so for now I don't see a reason to do anything
other than to write XML first, then convert to capnp using VPR.

Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>

--- common/cmake/devices.cmake
+++ common/cmake/devices.cmake
@@ -72,7 +72,8 @@
   # * RR_PATCH_TOOL - Value of RR_PATCH_TOOL property of <arch>.
   # * DEVICE - What device is being patch (see DEFINE_DEVICE).
   # * OUT_RRXML_VIRT - Input virtual rr_graph file for device.
-  # * OUT_RRXML_REAL - Out real rr_graph file for device.
+  # * OUT_RRXML_REAL - Output real XML rr_graph file for device.
+  # * OUT_RRBIN_REAL - Output real BIN rr_graph file for device.
   #
   # PLACE_TOOL_CMD variables:
   #
@@ -509,6 +510,8 @@
       rr_graph_${DEVICE}_${PACKAGE}.rr_graph.virt${RR_GRAPH_EXT})
     set(OUT_RRXML_REAL_FILENAME
       rr_graph_${DEVICE}_${PACKAGE}.rr_graph.real${RR_GRAPH_EXT})
+    set(OUT_RRBIN_REAL_FILENAME
+      rr_graph_${DEVICE}_${PACKAGE}.rr_graph.real.bin)
     set(LOOKAHEAD_FILENAME
       rr_graph_${DEVICE}_${PACKAGE}.lookahead.bin)
     set(PLACE_DELAY_FILENAME
@@ -516,6 +519,7 @@
     set(OUT_RRXML_REAL_LINT_FILENAME rr_graph_${DEVICE}_${PACKAGE}.rr_graph.real.lint.html)
     set(OUT_RRXML_VIRT ${CMAKE_CURRENT_BINARY_DIR}/${OUT_RRXML_VIRT_FILENAME})
     set(OUT_RRXML_REAL ${CMAKE_CURRENT_BINARY_DIR}/${OUT_RRXML_REAL_FILENAME})
+    set(OUT_RRBIN_REAL ${CMAKE_CURRENT_BINARY_DIR}/${OUT_RRBIN_REAL_FILENAME})
     set(OUT_RRXML_REAL_LINT ${CMAKE_CURRENT_BINARY_DIR}/${OUT_RRXML_REAL_LINT_FILENAME})

     #
@@ -604,64 +608,75 @@
         )
     endif()

+    # Generate lookahead and place delay lookup caches
+    set(DEPS)
+    append_file_dependency(DEPS ${OUT_RRXML_REAL_FILENAME})
+    append_file_dependency(DEPS ${VIRT_DEVICE_MERGED_FILE})
+
+    set(OUTPUTS ${OUT_RRBIN_REAL_FILENAME})
+    set(ARGS)
+    list(APPEND OUTPUTS ${LOOKAHEAD_FILENAME})
+    if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
+        list(APPEND OUTPUTS ${LOOKAHEAD_FILENAME})
+        list(APPEND ARGS --write_router_lookahead ${LOOKAHEAD_FILENAME})
+    endif()
+    if(${DEFINE_DEVICE_CACHE_PLACE_DELAY})
+        list(APPEND OUTPUTS ${PLACE_DELAY_FILENAME})
+        list(APPEND ARGS --write_placement_delay_lookup ${PLACE_DELAY_FILENAME})
+    endif()
+
+    add_custom_command(
+      OUTPUT ${OUT_RRXML_REAL}.cache ${OUTPUTS}
+      DEPENDS
+          ${symbiflow-arch-defs_SOURCE_DIR}/common/wire.eblif
+          ${VPR} ${VPR_TARGET}
+          ${QUIET_CMD} ${QUIET_CMD_TARGET}
+          ${DEFINE_DEVICE_DEVICE_TYPE}
+          ${DEPS} ${PYTHON3} ${PYTHON3_TARGET}
+      COMMAND
+          ${PYTHON3} ${symbiflow-arch-defs_SOURCE_DIR}/utils/check_cache.py ${OUT_RRXML_REAL} ${OUT_RRXML_REAL}.cache ${OUTPUTS} || (
+          ${QUIET_CMD} ${VPR} ${DEVICE_MERGED_FILE}
+          --device ${DEVICE_FULL}
+          ${symbiflow-arch-defs_SOURCE_DIR}/common/wire.eblif
+          --read_rr_graph ${OUT_RRXML_REAL}
+          --write_rr_graph ${OUT_RRBIN_REAL}
+          --read_edge_metadata on
+          --outfile_prefix ${DEVICE}_${PACKAGE}_cache
+          --pack
+          --place
+          ${ARGS}
+          ${DEFINE_DEVICE_CACHE_ARGS} &&
+          ${PYTHON3} ${symbiflow-arch-defs_SOURCE_DIR}/utils/update_cache.py ${OUT_RRXML_REAL} ${OUT_RRXML_REAL}.cache)
+      COMMAND
+          ${CMAKE_COMMAND} -E copy vpr_stdout.log
+            rr_graph_${DEVICE}_${PACKAGE}.cache.out
+      WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+    )
+
+    add_file_target(FILE ${OUT_RRBIN_REAL_FILENAME} GENERATED)
+
+    set_target_properties(
+      ${DEFINE_DEVICE_DEVICE}
+      PROPERTIES
+        ${PACKAGE}_OUT_RRBIN_REAL ${CMAKE_CURRENT_SOURCE_DIR}/${OUT_RRBIN_REAL_FILENAME}
+    )
+
+    if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
+      add_file_target(FILE ${LOOKAHEAD_FILENAME} GENERATED)
+    endif()
+    if(${DEFINE_DEVICE_CACHE_PLACE_DELAY})
+      add_file_target(FILE ${PLACE_DELAY_FILENAME} GENERATED)
+
+      if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
+          get_file_target(LOOKAHEAD_TARGET ${LOOKAHEAD_FILENAME})
+          get_file_target(PLACE_DELAY_TARGET ${PLACE_DELAY_FILENAME})
+
+          # Linearize target dependency.
+          add_dependencies(${PLACE_DELAY_TARGET} ${LOOKAHEAD_TARGET})
+      endif()
+    endif()
+
     if(${DEFINE_DEVICE_CACHE_LOOKAHEAD} OR ${DEFINE_DEVICE_CACHE_PLACE_DELAY})
-      # Generate lookahead and place delay lookup caches
-      set(DEPS)
-      append_file_dependency(DEPS ${OUT_RRXML_REAL_FILENAME})
-      append_file_dependency(DEPS ${VIRT_DEVICE_MERGED_FILE})
-
-      set(OUTPUTS)
-      set(ARGS)
-      if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
-          list(APPEND OUTPUTS ${LOOKAHEAD_FILENAME})
-          list(APPEND ARGS --write_router_lookahead ${LOOKAHEAD_FILENAME})
-      endif()
-      if(${DEFINE_DEVICE_CACHE_PLACE_DELAY})
-          list(APPEND OUTPUTS ${PLACE_DELAY_FILENAME})
-          list(APPEND ARGS --write_placement_delay_lookup ${PLACE_DELAY_FILENAME})
-      endif()
-
-      add_custom_command(
-        OUTPUT ${OUT_RRXML_REAL}.cache ${OUTPUTS}
-        DEPENDS
-            ${symbiflow-arch-defs_SOURCE_DIR}/common/wire.eblif
-            ${VPR} ${VPR_TARGET}
-            ${QUIET_CMD} ${QUIET_CMD_TARGET}
-            ${DEFINE_DEVICE_DEVICE_TYPE}
-            ${DEPS} ${PYTHON3} ${PYTHON3_TARGET}
-        COMMAND
-            ${PYTHON3} ${symbiflow-arch-defs_SOURCE_DIR}/utils/check_cache.py ${OUT_RRXML_REAL} ${OUT_RRXML_REAL}.cache ${OUTPUTS} || (
-            ${QUIET_CMD} ${VPR} ${DEVICE_MERGED_FILE}
-            --device ${DEVICE_FULL}
-            ${symbiflow-arch-defs_SOURCE_DIR}/common/wire.eblif
-            --read_rr_graph ${OUT_RRXML_REAL}
-            --outfile_prefix ${DEVICE}_${PACKAGE}_cache
-            --pack
-            --place
-            ${ARGS}
-            ${DEFINE_DEVICE_CACHE_ARGS} &&
-            ${PYTHON3} ${symbiflow-arch-defs_SOURCE_DIR}/utils/update_cache.py ${OUT_RRXML_REAL} ${OUT_RRXML_REAL}.cache)
-        COMMAND
-            ${CMAKE_COMMAND} -E copy vpr_stdout.log
-              rr_graph_${DEVICE}_${PACKAGE}.cache.out
-        WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-      )
-
-      if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
-        add_file_target(FILE ${LOOKAHEAD_FILENAME} GENERATED)
-      endif()
-      if(${DEFINE_DEVICE_CACHE_PLACE_DELAY})
-        add_file_target(FILE ${PLACE_DELAY_FILENAME} GENERATED)
-
-        if(${DEFINE_DEVICE_CACHE_LOOKAHEAD})
-            get_file_target(LOOKAHEAD_TARGET ${LOOKAHEAD_FILENAME})
-            get_file_target(PLACE_DELAY_TARGET ${PLACE_DELAY_FILENAME})
-
-            # Linearize target dependency.
-            add_dependencies(${PLACE_DELAY_TARGET} ${LOOKAHEAD_TARGET})
-        endif()
-      endif()
-
       set_target_properties(
         ${DEFINE_DEVICE_DEVICE}
         PROPERTIES
@@ -941,6 +956,9 @@
   )
   get_target_property_required(
     OUT_RRXML_REAL ${DEVICE} ${PACKAGE}_OUT_RRXML_REAL
+  )
+  get_target_property_required(
+    OUT_RRBIN_REAL ${DEVICE} ${PACKAGE}_OUT_RRBIN_REAL
   )
   get_target_property_required(
     OUT_RRXML_VIRT ${DEVICE} OUT_RRXML_VIRT
@@ -1099,9 +1117,10 @@

   get_file_location(OUT_RRXML_VIRT_LOCATION ${OUT_RRXML_VIRT})
   get_file_location(OUT_RRXML_REAL_LOCATION ${OUT_RRXML_REAL})
+  get_file_location(OUT_RRBIN_REAL_LOCATION ${OUT_RRBIN_REAL})
   get_file_location(DEVICE_MERGED_FILE_LOCATION ${DEVICE_MERGED_FILE})

-  foreach(SRC ${DEVICE_MERGED_FILE} ${OUT_RRXML_REAL})
+  foreach(SRC ${DEVICE_MERGED_FILE} ${OUT_RRBIN_REAL})
     append_file_dependency(VPR_DEPS ${SRC})
   endforeach()

@@ -1144,7 +1163,7 @@
     ${DEVICE_MERGED_FILE_LOCATION}
     ${OUT_EBLIF}
     --device ${DEVICE_FULL}
-    --read_rr_graph ${OUT_RRXML_REAL_LOCATION}
+    --read_rr_graph ${OUT_RRBIN_REAL_LOCATION}
     ${VPR_BASE_ARGS_LIST}
     ${VPR_ARCH_ARGS_LIST}
     ${VPR_EXTRA_ARGS_LIST}
@@ -1371,7 +1390,7 @@
       ${DEVICE_MERGED_FILE_LOCATION}
       ${OUT_EBLIF}
       --device ${DEVICE_FULL}
-      --read_rr_graph ${OUT_RRXML_REAL_LOCATION}
+      --read_rr_graph ${OUT_RRBIN_REAL_LOCATION}
       ${VPR_BASE_ARGS_LIST}
       ${VPR_ARCH_ARGS_LIST}
       ${VPR_EXTRA_ARGS_LIST}
@@ -1385,7 +1404,7 @@
       ${DEVICE_MERGED_FILE_LOCATION}
       ${OUT_EBLIF}
       --device ${DEVICE_FULL}
-      --read_rr_graph ${OUT_RRXML_REAL_LOCATION}
+      --read_rr_graph ${OUT_RRBIN_REAL_LOCATION}
       ${VPR_BASE_ARGS_LIST}
       ${VPR_ARCH_ARGS_LIST}
       ${VPR_EXTRA_ARGS_LIST}


Synchronize adm files

Synchronize adm files

--- adm_local_without_kernel/cmake_files/FindGraphviz.cmake
+++ adm_local_without_kernel/cmake_files/FindGraphviz.cmake
@@ -38,17 +38,14 @@
 FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY   NAMES cgraph)
 FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY    NAMES graph)
 FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY      NAMES gvc)
-FIND_LIBRARY(GRAPHVIZ_gvpr_LIBRARY     NAMES gvpr)
 FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan)
-FIND_LIBRARY(GRAPHVIZ_xdot_LIBRARY     NAMES xdot)
+
 SET(GRAPHVIZ_LIBRARIES
   ${GRAPHVIZ_cdt_LIBRARY}
   ${GRAPHVIZ_cgraph_LIBRARY}
   ${GRAPHVIZ_graph_LIBRARY}
   ${GRAPHVIZ_gvc_LIBRARY}
-  ${GRAPHVIZ_gvpr_LIBRARY}
   ${GRAPHVIZ_pathplan_LIBRARY}
-  ${GRAPHVIZ_xdot_LIBRARY}
   )

 # Handle the standard arguments of the find_package() command:


C++11 fix (Raffaele)

C++11 fix (Raffaele)

--- cmake/ALICE_CMake.cmake
+++ cmake/ALICE_CMake.cmake
@@ -132,6 +132,7 @@
   ALICE_RootConfig(RLFLAGS --ldflags)

   set(CXXFLAGS "${CXXFLAGS} ${RCFLAGS}")
+  string(REPLACE "-std=c++11" " " RCFLAGS "${RCFLAGS}")
   set(CFLAGS  "${CFLAGS} ${RCFLAGS}")
   set(SOFLAGS "${SOFLAGS} ${RLFLAGS}")
   set(LDFLAGS "${LDFLAGS} ${RLFLAGS}")


Only download qtbase and not entire qt

Only download qtbase and not entire qt

--- cmake/ExternalQt5.cmake
+++ cmake/ExternalQt5.cmake
@@ -5,8 +5,8 @@
 if(WIN32)
 	#set(BUILD_COMMAND set CL=/MP; nmake)
 	set(BUILD_COMMAND nmake)
-	set(URL "http://download.qt.io/official_releases/qt/5.7/5.7.1/single/qt-everywhere-opensource-src-5.7.1.zip")
-	set(URL_HASH SHA256=4e50c645ff614d831712f5ef19a4087b4c00824920c79e96fee17d9373b42cf3)
+	set(URL "http://download.qt.io/official_releases/qt/5.7/5.7.1/submodules/qtbase-opensource-src-5.7.1.zip")
+	set(URL_HASH SHA256=3570b8a107903615fef0faddcdbe80b35d788a80979a9f6d0de420c3339f45bf)
 	set(OPTIONS
             -opensource;
             -confirm-license;
@@ -17,41 +17,7 @@
             -no-qml-debug;
             -nomake tools;
             -nomake tests;
-            -skip qt3d;
-            -skip qtactiveqt;
-            -skip qtandroidextras;
-            -skip qtcanvas3d;
-            -skip qtcharts;
-            -skip qtconnectivity;
-            -skip qtdatavis3d;
-            -skip qtdeclarative;
-            -skip qtdoc;
-            -skip qtgamepad;
-            -skip qtgraphicaleffects;
-            -skip qtlocation;
-            -skip qtmacextras;
-            -skip qtmultimedia;
-            -skip qtpurchasing;
-            -skip qtquickcontrols;
-            -skip qtquickcontrols2;
-            -skip qtscript;
-            -skip qtscxml;
-            -skip qtsensors;
-            -skip qtserialbus;
-            -skip qtserialport;
-            -skip qtsvg;
-            -skip qttools;
-            -skip qttranslations;
-            -skip qtvirtualkeyboard;
-            -skip qtwayland;
-            -skip qtwebchannel;
-            -skip webengine;
-            -skip qtwebsockets;
-            -skip qtwebview;
-            -skip qtwinextras;
-            -skip qtx11extras;
-            -skip qtxmlpatterns;
-            -opengl desktop;
+              -opengl desktop;
             -qt-zlib;
             -qt-libpng;
             -qt-libjpeg;
@@ -73,40 +39,6 @@
             -no-alsa;
             -nomake tools;
             -nomake tests;
-            -skip qt3d;
-            -skip qtactiveqt;
-            -skip qtandroidextras;
-            -skip qtcanvas3d;
-            -skip qtcharts;
-            -skip qtconnectivity;
-            -skip qtdatavis3d;
-            -skip qtdeclarative;
-            -skip qtdoc;
-            -skip qtgamepad;
-            -skip qtgraphicaleffects;
-            -skip qtlocation;
-            -skip qtmacextras;
-            -skip qtmultimedia;
-            -skip qtpurchasing;
-            -skip qtquickcontrols;
-            -skip qtquickcontrols2;
-            -skip qtscript;
-            -skip qtscxml;
-            -skip qtsensors;
-            -skip qtserialbus;
-            -skip qtserialport;
-            -skip qtsvg;
-            -skip qttools;
-            -skip qttranslations;
-            -skip qtvirtualkeyboard;
-            -skip qtwayland;
-            -skip qtwebchannel;
-            -skip webengine;
-            -skip qtwebsockets;
-            -skip qtwebview;
-            -skip qtwinextras;
-            -skip qtx11extras;
-            -skip qtxmlpatterns;
             -opengl desktop;
             -qt-zlib;
             -qt-libpng;


making shared PCL libs as default also for windows

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

--- cmake/pcl_options.cmake
+++ cmake/pcl_options.cmake
@@ -1,9 +1,5 @@
 # Options for building PCL.

 # Build shared libraries by default.
-if(WIN32)
-	option(PCL_SHARED_LIBS "Build shared libraries." OFF)
-else(WIN32)
-	option(PCL_SHARED_LIBS "Build shared libraries." ON)
-endif(WIN32)
+option(PCL_SHARED_LIBS "Build shared libraries." ON)
 mark_as_advanced(PCL_SHARED_LIBS)


Build: Require exact version if PYTHON_VERSION is specified (#1286)

Signed-off-by: Larry Gritz <f0a1ce6f80112d72f7276457fd261d671b827567@larrygritz.com>

--- src/cmake/pythonutils.cmake
+++ src/cmake/pythonutils.cmake
@@ -20,10 +20,12 @@

     # Attempt to find the desired version, but fall back to other
     # additional versions.
+    unset (_req)
     if (USE_PYTHON)
         set (_req REQUIRED)
-    else ()
-        unset (_req)
+        if (PYTHON_VERSION)
+            list (APPEND _req EXACT)
+        endif ()
     endif ()
     checked_find_package (Python ${PYTHON_VERSION}
                           ${_req}


microatf: print out stderr of tests

microatf: print out stderr of tests

--- test/cmake/ATFRunTest.cmake
+++ test/cmake/ATFRunTest.cmake
@@ -26,6 +26,10 @@

 file(STRINGS "${_wd}/result" _result_line)
 file(STRINGS "${_wd}/stderr" _stderr_lines)
+
+foreach(line IN LISTS _stderr_lines)
+  message(STATUS "stderr: ${line}")
+endforeach()

 execute_process(COMMAND "${CMAKE_COMMAND}" -E remove_directory "${_wd}")


Removed the Ofast option from fast-math flags (as it would turn on the O3 optimization level in Os builds).

--- toolchains/gcc_compatibles.cmake
+++ toolchains/gcc_compatibles.cmake
@@ -15,7 +15,7 @@
 set( TNUN_compiler_debug_flags         -O0 -DDEBUG                           )
 set( TNUN_compiler_LTO                 -flto                                 )
 set( TNUN_linker_LTO                   -flto                                 )
-set( TNUN_compiler_fastmath            -ffast-math -ffp-contract=fast -Ofast )
+set( TNUN_compiler_fastmath            -ffast-math -ffp-contract=fast        )
 set( TNUN_compiler_rtti_on             -frtti                                )
 set( TNUN_compiler_rtti_off            -fno-rtti                             )
 set( TNUN_compiler_exceptions_on       -fexceptions                          )


Don't add `-arch` explictly to stdlib compile flags on Darwin

Rely instead on setting the `OSX_ARCHITECTURES` property (#38415)

Address rdar://96087734

--- stdlib/cmake/modules/AddSwiftStdlib.cmake
+++ stdlib/cmake/modules/AddSwiftStdlib.cmake
@@ -104,7 +104,6 @@
     # of options by target_compile_options -- this way no undesired
     # side effects are introduced should a new search path be added.
     list(APPEND result
-      "-arch" "${CFLAGS_ARCH}"
       "-F${SWIFT_SDK_${CFLAGS_SDK}_PATH}/../../../Developer/Library/Frameworks")
   endif()


Removed csr_gps from module list

Removed csr_gps from module list

Signed-off-by: Mark Charlebois <f1891e7fc976ae1bd489627e2954fb730751d728@gmail.com>

--- cmake/configs/qurt_eagle_legacy_driver_release.cmake
+++ cmake/configs/qurt_eagle_legacy_driver_release.cmake
@@ -44,7 +44,6 @@
 	${EAGLE_DRIVERS_SRC}/mpu_spi
 	${EAGLE_DRIVERS_SRC}/uart_esc
 	${EAGLE_DRIVERS_SRC}/rc_receiver
-	${EAGLE_DRIVERS_SRC}/csr_gps

 	#
 	# System commands


Fix jsonpatch md5sum

Fix jsonpatch md5sum

It appears to be incorrect. I'm not sure if this suspicious behavior, or
it just needs to be fixed.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

--- versions.cmake
+++ versions.cmake
@@ -174,7 +174,7 @@

 add_revision(jsonpatch
   URL "https://github.com/stefankoegl/python-json-patch/archive/v1.21.zip"
-  URL_MD5 27073971f1fd0b78d63bdd29e1cdb703)
+  URL_MD5 a5aac0214434c0db6be86ea77ad8da3f)

 set(_holoplay_sha256 "8626082ddc89dbbd018e6113e069eb64c9f8e540db06c4c7e85162dc38b5ddad")
 add_revision(holoplay


set current time, instead of zero, on generated files, #3396

--- core/rosbuild/public.cmake
+++ core/rosbuild/public.cmake
@@ -787,8 +787,10 @@
   else(NOT _srvlist)
     file(WRITE ${PROJECT_SOURCE_DIR}/srv_gen/generated "yes")
     # Now set the mtime to something consistent.  We only want whether or not this file exists to matter
+    # But we set it to the current time, because setting it to zero causes
+    # annoying warning, #3396.
     execute_process(
-      COMMAND python -c "import os; os.utime('${PROJECT_SOURCE_DIR}/srv_gen/generated', (0, 0))"
+      COMMAND python -c "import os; os.utime('${PROJECT_SOURCE_DIR}/srv_gen/generated', None)"
       ERROR_VARIABLE _set_mtime_error
       RESULT_VARIABLE _set_mtime_failed
       OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -822,8 +824,10 @@
   else(NOT _msglist)
     file(WRITE ${PROJECT_SOURCE_DIR}/msg_gen/generated "yes")
     # Now set the mtime to something consistent.  We only want whether or not this file exists to matter
+    # But we set it to the current time, because setting it to zero causes
+    # annoying warning, #3396.
     execute_process(
-      COMMAND python -c "import os; os.utime('${PROJECT_SOURCE_DIR}/msg_gen/generated', (0, 0))"
+      COMMAND python -c "import os; os.utime('${PROJECT_SOURCE_DIR}/msg_gen/generated', None)"
       ERROR_VARIABLE _set_mtime_error
       RESULT_VARIABLE _set_mtime_failed
       OUTPUT_STRIP_TRAILING_WHITESPACE)


Fix empty cmake arguments.

Fix empty cmake arguments.

--- src/inserts/functions.cmake
+++ src/inserts/functions.cmake
@@ -193,6 +193,10 @@

 function(find_flag in_flags f out)
     if (NOT "${${out}}" STREQUAL "")
+        return()
+    endif()
+    if ("${in_flags}" STREQUAL "")
+        set(${out} 0 PARENT_SCOPE)
         return()
     endif()
     set(flags ${in_flags})
@@ -252,9 +256,9 @@
         endif()
     endif()

-    prepare_config_part(system ${CMAKE_SYSTEM_NAME})
-    prepare_config_part(processor ${CMAKE_SYSTEM_PROCESSOR})
-    prepare_config_part(compiler ${CMAKE_CXX_COMPILER_ID})
+    prepare_config_part(system "${CMAKE_SYSTEM_NAME}")
+    prepare_config_part(processor "${CMAKE_SYSTEM_PROCESSOR}")
+    prepare_config_part(compiler "${CMAKE_CXX_COMPILER_ID}")
     set(config ${system}${CPPAN_CONFIG_PART_DELIMETER}${processor}${CPPAN_CONFIG_PART_DELIMETER}${compiler})

     string(REGEX MATCH "[0-9]+\\.[0-9]" version "${CMAKE_CXX_COMPILER_VERSION}")
@@ -273,19 +277,29 @@

     set(toolset)
     if (CMAKE_GENERATOR_TOOLSET)
-        prepare_config_part(toolset ${CMAKE_GENERATOR_TOOLSET})
+        prepare_config_part(toolset "${CMAKE_GENERATOR_TOOLSET}")
         set(toolset ${CPPAN_CONFIG_PART_DELIMETER}${toolset})
     endif()

+    # msvc arch
     set(msvc_arch)
-    if (MSVC AND (MSVC_C_ARCHITECTURE_ID OR MSVC_CXX_ARCHITECTURE_ID))
-        prepare_config_part(msvc_arch ${MSVC_C_ARCHITECTURE_ID})
-        set(msvc_arch ${CPPAN_CONFIG_PART_DELIMETER}${msvc_arch})
-
-        # can they differ?
-        if (MSVC_CXX_ARCHITECTURE_ID AND NOT "${MSVC_C_ARCHITECTURE_ID}" STREQUAL "${MSVC_CXX_ARCHITECTURE_ID}")
-            prepare_config_part(msvc_arch2 ${MSVC_CXX_ARCHITECTURE_ID})
-            set(msvc_arch ${msvc_arch}${CPPAN_CONFIG_PART_DELIMETER}${msvc_arch2})
+    if (MSVC)
+        set(msvc_c_arch)
+        if (MSVC_C_ARCHITECTURE_ID)
+            prepare_config_part(msvc_c_arch "${MSVC_C_ARCHITECTURE_ID}")
+            set(msvc_c_arch ${CPPAN_CONFIG_PART_DELIMETER}${msvc_c_arch})
+        endif()
+
+        set(msvc_cxx_arch)
+        if (MSVC_CXX_ARCHITECTURE_ID)
+            prepare_config_part(msvc_cxx_arch "${MSVC_CXX_ARCHITECTURE_ID}")
+            set(msvc_cxx_arch ${CPPAN_CONFIG_PART_DELIMETER}${msvc_cxx_arch})
+        endif()
+
+        if ("${msvc_c_arch}" STREQUAL "${msvc_cxx_arch}")
+            set(msvc_arch ${msvc_c_arch})
+        else()
+            set(msvc_arch ${msvc_c_arch}${msvc_cxx_arch})
         endif()
     endif()

@@ -310,7 +324,7 @@
 function(get_configuration_with_generator_unhashed out)
     get_configuration_unhashed(config)

-    prepare_config_part(generator ${CMAKE_GENERATOR})
+    prepare_config_part(generator "${CMAKE_GENERATOR}")
     if (NOT "${generator}" STREQUAL "")
         set(config ${config}${CPPAN_CONFIG_PART_DELIMETER}${generator})
     endif()
@@ -323,12 +337,12 @@
 ########################################

 function(get_configuration_exe_unhashed out)
-    prepare_config_part(system ${CMAKE_SYSTEM_NAME})
-    prepare_config_part(processor ${CMAKE_HOST_SYSTEM_PROCESSOR})
+    prepare_config_part(system "${CMAKE_SYSTEM_NAME}")
+    prepare_config_part(processor "${CMAKE_HOST_SYSTEM_PROCESSOR}")
     set(config ${system}${CPPAN_CONFIG_PART_DELIMETER}${processor})

     # add generator to executables since we're using the same generator as for libraries
-    prepare_config_part(generator ${CMAKE_GENERATOR})
+    prepare_config_part(generator "${CMAKE_GENERATOR}")
     if (NOT "${generator}" STREQUAL "")
         set(config ${config}${CPPAN_CONFIG_PART_DELIMETER}${generator})
     endif()


- Fix indent

- Fix indent

--- Build.cmake
+++ Build.cmake
@@ -75,10 +75,10 @@

    IF (MSVC OR MINGW)
          list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_unix.cpp)
-	 list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_android.cpp)
+         list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_android.cpp)
    ELSEIF(ANDROID)
-	 list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_unix.cpp)
-	 list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp)
+         list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_unix.cpp)
+         list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp)
    ELSE()
  	 list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_android.cpp)
          list(REMOVE_ITEM SRC_FILES  ${LOG_SRC}/crashhandler_windows.cpp ${LOG_SRC}/g3log/stacktrace_windows.hpp ${LOG_SRC}/stacktrace_windows.cpp)


force /utf-8 for MSVC compiler

force /utf-8 for MSVC compiler

--- Build.cmake
+++ Build.cmake
@@ -58,6 +58,7 @@

 IF (MSVC OR MINGW)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8") # source code already in utf-8, force it for compilers in non-utf8_windows_locale
   set(PLATFORM_LINK_LIBRIES dbghelp)
       # VC11 bug: http://code.google.com/p/googletest/issues/detail?id=408
       #          add_definition(-D_VARIADIC_MAX=10)


FIX: Workaround a problem in VTK:  I need to CONFIGURE VTKConfig.cmake in non-immediate mode so that it can pick the variables that are set in SUBDIRS.  On the other hand, CMake's FindVTK is looking for VTKConfig.cmake to  find VTK. In an app like ParaViewComplete, VTK is accessed through  SUBDIRS(), Xdmf too. If we are in non-immediate mode, at the time  we go into the Xdmf subdir, VTKConfig.cmake has not been created, hence  VTK is not found.

--- vtkGenerateVTKConfig.cmake
+++ vtkGenerateVTKConfig.cmake
@@ -94,6 +94,17 @@

 #-----------------------------------------------------------------------------
 # Configure VTKConfig.cmake for the build tree.
+CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
+               ${VTK_BINARY_DIR}/VTKConfig.cmake @ONLY IMMEDIATE)
+
+# Workaround a problem in VTK:
+# I need to CONFIGURE this file in non-immediate mode so that it can pick
+# the variable that are set in SUBDIRS.
+# On the other hand, CMake's FindVTK is looking for VTKConfig.cmake to
+# find VTK. In an app like ParaViewComplete, VTK is accessed through
+# SUBDIRS(), Xdmf too. If we are in non-immediate mode, at the time
+# we go into the Xdmf subdir, VTKConfig.cmake has not been created, hence
+# VTK is not found.
 CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
                ${VTK_BINARY_DIR}/VTKConfig.cmake @ONLY)

@@ -203,4 +214,15 @@
 #-----------------------------------------------------------------------------
 # Configure VTKConfig.cmake for the install tree.
 CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
+               ${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake @ONLY IMMEDIATE)
+
+# Workaround a problem in VTK:
+# I need to CONFIGURE this file in non-immediate mode so that it can pick
+# the variable that are set in SUBDIRS.
+# On the other hand, CMake's FindVTK is looking for VTKConfig.cmake to
+# find VTK. In an app like ParaViewComplete, VTK is accessed through
+# SUBDIRS(), Xdmf too. If we are in non-immediate mode, at the time
+# we go into the Xdmf subdir, VTKConfig.cmake has not been created, hence
+# VTK is not found.
+CONFIGURE_FILE(${VTK_SOURCE_DIR}/VTKConfig.cmake.in
                ${VTK_BINARY_DIR}/Utilities/VTKConfig.cmake @ONLY)


static libraries can be tested inside XCode

--- cmake/Cuti.cmake
+++ cmake/Cuti.cmake
@@ -26,6 +26,60 @@
 	set_source_files_properties(${CUTI_SOURCE} PROPERTIES COMPILE_FLAGS "-x objective-c++")
 ENDIF(USE_CUTI_INTEGRATION AND APPLE)

+
+
+function(cuti_xctest_add_bundle target testee)
+  if(NOT XCTest_FOUND)
+    message(FATAL_ERROR "XCTest is required to create a XCTest Bundle.")
+  endif(NOT XCTest_FOUND)
+
+  if(NOT CMAKE_OSX_SYSROOT)
+    message(FATAL_ERROR "Adding XCTest bundles requires CMAKE_OSX_SYSROOT to be set.")
+  endif()
+
+  add_library(${target} MODULE ${ARGN})
+
+  set_target_properties(${target} PROPERTIES
+    BUNDLE TRUE
+    XCTEST TRUE
+    XCTEST_TESTEE ${testee})
+
+  target_link_libraries(${target} PRIVATE "-framework Foundation")
+  target_link_libraries(${target} PRIVATE ${XCTest_LIBRARIES})
+  target_include_directories(${target} PRIVATE ${XCTest_INCLUDE_DIRS})
+
+  # retrieve testee target type
+  if(NOT TARGET ${testee})
+    message(FATAL_ERROR "${testee} is not a target.")
+  endif()
+  get_property(_testee_type TARGET ${testee} PROPERTY TYPE)
+  get_property(_testee_framework TARGET ${testee} PROPERTY FRAMEWORK)
+  get_property(_testee_macosx_bundle TARGET ${testee} PROPERTY MACOSX_BUNDLE)
+
+  if(_testee_type STREQUAL "SHARED_LIBRARY" OR _testee_type STREQUAL "STATIC_LIBRARY" AND _testee_framework)
+    # testee is a Framework
+    target_link_libraries(${target} PRIVATE ${testee})
+
+  elseif(_testee_type STREQUAL "EXECUTABLE" AND _testee_macosx_bundle)
+    # testee is an App Bundle
+    add_dependencies(${target} ${testee})
+    if(XCODE)
+      set_target_properties(${target} PROPERTIES
+        XCODE_ATTRIBUTE_BUNDLE_LOADER "$(TEST_HOST)"
+        XCODE_ATTRIBUTE_TEST_HOST "$<TARGET_FILE:${testee}>")
+    else(XCODE)
+      target_link_libraries(${target}
+        PRIVATE -bundle_loader $<TARGET_FILE:${testee}>)
+    endif(XCODE)
+
+  else()
+    message(FATAL_ERROR "Testee ${testee} is of unsupported type.")
+  endif()
+endfunction(cuti_xctest_add_bundle)
+
+
+
+
 function(cuti_creates_test_target target testee)
 	IF(USE_CUTI_INTEGRATION AND APPLE)
 		find_package(XCTest REQUIRED)
@@ -36,7 +90,7 @@
 			SOVERSION "1.0.0"
 			FRAMEWORK_VERSION "A"
 		)
-		xctest_add_bundle(${target} ${testee} ${CUTI_SOURCE} ${ARGN} ${CUTI_INCLUDE})
+		cuti_xctest_add_bundle(${target} ${testee} ${CUTI_SOURCE} ${ARGN} ${CUTI_INCLUDE})
 	ELSE()
 		add_library(${target} SHARED ${ARGN} ${CUTI_INCLUDE})
 	ENDIF(USE_CUTI_INTEGRATION AND APPLE)


Add a tooling target

Add a tooling target

--- cmake/test.cmake
+++ cmake/test.cmake
@@ -25,6 +25,8 @@
 enable_testing()
 include(CTest)

+add_custom_target(tooling)
+
 find_program(VALGRIND_EXECUTABLE valgrind)

 if (VALGRIND_EXECUTABLE)
@@ -58,12 +60,26 @@
   add_custom_target(dhat)
   add_custom_target(sgcheck)
   add_custom_target(bbv)
+
+  add_dependencies(tooling
+    valgrind
+    cachegrind
+    callgrind
+    helgrind
+    drd
+    massif
+    dhat
+    sgcheck
+    bbv)
 endif (VALGRIND_EXECUTABLE)

 find_program(GPROF_EXECUTABLE gprof)

 if (GPROF_EXECUTABLE)
   add_custom_target(gprof)
+
+  add_dependencies(tooling
+    gprof)
 endif (GPROF_EXECUTABLE)

 set(TEST_WORKING_DIRECTORY


cmake: FindGSL.cmake fixed some warning

cmake: FindGSL.cmake fixed some warning

--- CMakeModules/FindGSL.cmake
+++ CMakeModules/FindGSL.cmake
@@ -30,12 +30,14 @@
 #added gsl depends
 #BUG in OpenSuse (missing libgslcblas.so link libgsl.so)
 #if (NOT BUILD_SHARED_LIBS)
+if (PC_GSL_LIBRARIES)
   list(REMOVE_ITEM PC_GSL_LIBRARIES gsl)
   foreach (LIB ${PC_GSL_LIBRARIES})
     find_library(GSL_${LIB} NAMES ${LIB} HINTS ${PC_GSL_LIBRARY_DIRS} )
     list(APPEND GSL_LIBRARY ${GSL_${LIB}})
     unset(GSL_${LIB} CACHE)
   endforeach(LIB)
+endif (PC_GSL_LIBRARIES)
 #endif (NOT BUILD_SHARED_LIBS)

 include(FindPackageHandleStandardArgs)


Bump version number

Bump version number

This version contains breaking API changes, we need a minor version number increment

--- version.cmake
+++ version.cmake
@@ -1 +1 @@
-set(LeapSerial_VERSION 0.1.1)
+set(LeapSerial_VERSION 0.2.0)


[jancy] release 1.6.2

[jancy] release 1.6.2

[axl] release 5.5.2

--- version.cmake
+++ version.cmake
@@ -1,6 +1,6 @@
 set (VERSION_MAJOR     1)
 set (VERSION_MINOR     6)
-set (VERSION_REVISION  1)
+set (VERSION_REVISION  2)
 set (VERSION_TAG)

 set (VERSION_FILE_SUFFIX "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}")


Fix the cmake file for linking sfml

Fix the cmake file for linking sfml

--- SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
+++ SFML-2.3.2/share/SFML/cmake/Modules/FindSFML.cmake
@@ -98,7 +98,7 @@
     math(EXPR SFML_REQUESTED_VERSION "${SFML_FIND_VERSION_MAJOR} * 10000 + ${SFML_FIND_VERSION_MINOR} * 100 + ${SFML_FIND_VERSION_PATCH}")

     # if we could extract them, compare with the requested version number
-    if (SFML_VERSION_PATCH)
+    if (SFML_VERSION_MINOR)
         # transform version numbers to an integer
         math(EXPR SFML_VERSION "${SFML_VERSION_MAJOR} * 10000 + ${SFML_VERSION_MINOR} * 100 + ${SFML_VERSION_PATCH}")


enabling memory growth has some specific implications

- see https://github.com/emscripten-core/emscripten/blob/1.38.43/src/settings.js#L113
  for the details
- whether or not it should be used should be decided by the user

--- toolchains/emscripten.cmake
+++ toolchains/emscripten.cmake
@@ -10,7 +10,6 @@

 set( TNUN_compiler_debug_symbols -g4 "SHELL:-s DEMANGLE_SUPPORT=1" )
 set( TNUN_linker_debug_symbols   -g4 "SHELL:-s DEMANGLE_SUPPORT=1" )
-

 set( TNUN_linker_exceptions_on  "SHELL:-s DISABLE_EXCEPTION_CATCHING=0" )
 set( TNUN_linker_exceptions_off "SHELL:-s DISABLE_EXCEPTION_CATCHING=1" )
@@ -29,8 +28,3 @@
 # see: https://github.com/emscripten-core/emscripten/blob/master/src/settings.js

 set( TNUN_MALLOC_OVERCOMMIT_POLICY Partial )
-
-set( enable_memory_growth "SHELL:-s ALLOW_MEMORY_GROWTH=1" )
-
-add_compile_options( ${enable_memory_growth} )
-add_link_options( ${enable_memory_growth} )


Fix an annoying problem with the CMake file-copying code.

--- CMake/SurgSimUtilities.cmake
+++ CMake/SurgSimUtilities.cmake
@@ -40,6 +40,9 @@
 			# multiple tokens within the body of a $<{0,1}:...> generator
 			# expression.  So to conditionalize the command "foo bar", you
 			# can't do "$<COND:foo bar>"; you need "$<COND:foo> $<COND:bar>"...
+			# And on top of that, we can't use VERBATIM or each of the
+			# conditional tokens will become "" rather than being skipped
+			# altogether.
 			get_filename_component(FNAME "${FILE}" NAME)
 			set(CMD_COPY copy_if_different "${FILE}" $<TARGET_FILE_DIR:${TARGET}>)
 			set(CMD_SKIP echo "${TARGET}: Not copying ${FNAME} for $<CONFIGURATION>")
@@ -51,9 +54,9 @@
 			foreach(TOKEN ${CMD_SKIP})
 				list(APPEND CONDITIONAL_COMMAND $<$<NOT:${CONDITION}>:${TOKEN}>)
 			endforeach(TOKEN ${CMD_SKIP})
-			# Now use the conditional command we built.
+			# Now use the conditional command we built.  (Can't use VERBATIM!)
 			add_custom_command(TARGET ${TARGET} POST_BUILD
-				COMMAND ${CONDITIONAL_COMMAND} VERBATIM)
+				COMMAND ${CONDITIONAL_COMMAND})
 		endif(NOT "${FILE}" STREQUAL "")
 	endforeach(FILE ${ARGN})
 endfunction()


Search also for Qt plugins with CMAKE_SHARED_MODULE_SUFFIX.

This fixes issues with missing plug-ins on Mac where .so is used for
plug-ins.

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -100,9 +100,12 @@
         \"\${CMAKE_INSTALL_PREFIX}/${_bundle_dest_dir}/lib*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
     endif()

-    file(GLOB_RECURSE GLOBBED_QT_PLUGINS
-      # glob for Qt plugins
-      \"\${CMAKE_INSTALL_PREFIX}/${${_target_location}_qt_plugins_install_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+    set(_qt_plugin_glob_expressions \"\${CMAKE_INSTALL_PREFIX}/${${_target_location}_qt_plugins_install_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")
+    if(CMAKE_SHARED_MODULE_SUFFIX AND NOT CMAKE_SHARED_MODULE_SUFFIX STREQUAL CMAKE_SHARED_LIBRARY_SUFFIX)
+      list(APPEND _qt_plugin_glob_expressions \"\${CMAKE_INSTALL_PREFIX}/${${_target_location}_qt_plugins_install_dir}/plugins/*${CMAKE_SHARED_MODULE_SUFFIX}\")
+    endif()
+
+    file(GLOB_RECURSE GLOBBED_QT_PLUGINS ${_qt_plugin_glob_expressions})

     set(PLUGINS )
     foreach(_plugin ${_install_PLUGINS} \${GLOBBED_QT_PLUGINS} \${GLOBBED_PLUGINS})


CMakeModules/FindFFTW3.cmake: fix a typo

--- CMakeModules/FindFFTW3.cmake
+++ CMakeModules/FindFFTW3.cmake
@@ -36,7 +36,7 @@
 if (FFTW3_FOUND)
   include(CheckLibraryExists)
   #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it
-  check_library_exists("${FFTW3_LIBRARIES};${MATH_LIBRARIES}" fftw_plan_r2r_1d "" FOUND_FFTW_PLAN)
+  check_library_exists("${FFTW3_LIBRARY};${MATH_LIBRARIES}" fftw_plan_r2r_1d "" FOUND_FFTW_PLAN)
   if(NOT FOUND_FFTW_PLAN)
     message(FATAL_ERROR "Could not find fftw_plan_r2r_1d in ${FFTW3_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what was going wrong. If you are using a static lib (.a) make sure you have specified all dependencies of fftw3 in FFTW3_LIBRARY by hand (i.e. -DFFTW3_LIBRARY='/path/to/libfftw3.so;/path/to/libm.so') !")
   endif(NOT FOUND_FFTW_PLAN)


fix(cmake): fix issue with handling of EXCLUDE_SRCS

--- tools/cmake/component.cmake
+++ tools/cmake/component.cmake
@@ -271,7 +271,7 @@
         if(__EXCLUDE_SRCS)
             foreach(src ${__EXCLUDE_SRCS})
                 get_filename_component(src "${src}" ABSOLUTE)
-                list(REMOVE_ITEM source "${src}")
+                list(REMOVE_ITEM sources "${src}")
             endforeach()
         endif()
     endif()


Align package name to FindFlatBuffers.cmake (#5899)

This change is for fix warning:
```
CMake Warning (dev) at /home/aoleksy/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
  The package name passed to `find_package_handle_standard_args`
  (flatbuffers) does not match the name of the calling package (FlatBuffers).
  This can lead to problems in calling code that expects `find_package`
  result variables (e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
  FindFlatBuffers.cmake:33 (find_package_handle_standard_args)
  CMakeLists.txt:6 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.
```

--- CMake/FindFlatBuffers.cmake
+++ CMake/FindFlatBuffers.cmake
@@ -30,7 +30,7 @@
 find_path(FLATBUFFERS_INCLUDE_DIR NAMES flatbuffers/flatbuffers.h)

 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(flatbuffers
+find_package_handle_standard_args(FlatBuffers
   DEFAULT_MSG FLATBUFFERS_FLATC_EXECUTABLE FLATBUFFERS_INCLUDE_DIR)

 if(FLATBUFFERS_FOUND)
@@ -58,4 +58,4 @@
   set(FLATBUFFERS_INCLUDE_DIR)
 endif()

-include("${FLATBUFFERS_CMAKE_DIR}/BuildFlatBuffers.cmake")+include("${FLATBUFFERS_CMAKE_DIR}/BuildFlatBuffers.cmake")


Standardise package search for Cg. On OS X since the removal of the CEGUI check in trunk, the frameworks search path was not getting set to include ogre/Dependencies, which meant that the Cg plugin would not build correctly unless you had Cg.framework in your global framework path. Seems to be because Cg was not going through our standard library detection routines, it was using a customised one we got form elsewhere which picked up useless things like the location of the command-line cgc. Switched to the same as our others which fixes OS X (will need testing on other platforms)

--- CMake/Packages/FindCg.cmake
+++ CMake/Packages/FindCg.cmake
@@ -7,129 +7,46 @@
 # free to make use of it in any way you like.
 #-------------------------------------------------------------------

+# - Try to find Cg
+# Once done, this will define
 #
-# Try to find nVidia's Cg compiler, runtime libraries, and include path.
-# Once done this will define
-#
-# Cg_FOUND        - system has NVidia Cg and it can be used.
-# Cg_INCLUDE_DIRS = directory where cg.h resides
-# Cg_LIBRARIES = full path to libCg.so (Cg.DLL on win32)
-# Cg_GL_LIBRARIES = full path to libCgGL.so (CgGL.dll on win32)
-# Cg_COMPILER = full path to cgc (cgc.exe on win32)
-#
+#  Cg_FOUND - system has Cg
+#  Cg_INCLUDE_DIRS - the Cg include directories
+#  Cg_LIBRARIES - link these to use Cg

-# On OSX default to using the framework version of Cg.
-include(OgreFindFrameworks)
+include(FindPkgMacros)
+findpkg_begin(Cg)

-IF (APPLE)
-  SET(Cg_FRAMEWORK_INCLUDES)
-  OGRE_FIND_FRAMEWORKS(Cg)
-  IF (Cg_FRAMEWORKS)
-    FOREACH(dir ${Cg_FRAMEWORKS})
-      SET(Cg_FRAMEWORK_INCLUDES ${Cg_FRAMEWORK_INCLUDES}
-        ${dir}/Headers ${dir}/PrivateHeaders)
-    ENDFOREACH(dir)
+# Get path, convert backslashes as ${ENV_${var}}
+getenv_path(Cg_HOME)
+getenv_path(OGRE_SOURCE)
+getenv_path(OGRE_HOME)

-    #Find the include  dir
-    FIND_PATH(Cg_INCLUDE_DIRS cg.h
-      ${Cg_FRAMEWORK_INCLUDES}
-      )
+# construct search paths
+set(Cg_PREFIX_PATH ${Cg_HOME} ${ENV_Cg_HOME}
+  ${OGRE_SOURCE}/Dependencies
+  ${ENV_OGRE_SOURCE}/Dependencies
+  ${OGRE_HOME} ${ENV_OGRE_HOME})
+create_search_paths(Cg)
+# redo search if prefix path changed
+clear_if_changed(Cg_PREFIX_PATH
+  Cg_LIBRARY_FWK
+  Cg_LIBRARY_REL
+  Cg_LIBRARY_DBG
+  Cg_INCLUDE_DIR
+)

-    #Since we are using Cg framework, we must link to it.
-    SET(Cg_LIBRARIES "-framework Cg" CACHE STRING "Cg library")
-    SET(Cg_GL_LIBRARIES "-framework Cg" CACHE STRING "Cg GL library")
-  ENDIF (Cg_FRAMEWORKS)
-  FIND_PROGRAM(Cg_COMPILER cgc
-    /usr/bin
-    /usr/local/bin
-    DOC "The Cg compiler"
-    )
-ELSE (APPLE)
-  IF (WIN32)
-    FIND_PROGRAM( Cg_COMPILER cgc
-      "C:/Program Files/NVIDIA Corporation/Cg/bin"
-      "C:/Program Files/Cg"
-      ${PROJECT_SOURCE_DIR}/../Cg
-      DOC "The Cg Compiler"
-      )
-    IF (Cg_COMPILER)
-      GET_FILENAME_COMPONENT(Cg_COMPILER_DIR ${Cg_COMPILER} PATH)
-      GET_FILENAME_COMPONENT(Cg_COMPILER_SUPER_DIR ${Cg_COMPILER_DIR} PATH)
-    ELSE (Cg_COMPILER)
-      SET (Cg_COMPILER_DIR .)
-      SET (Cg_COMPILER_SUPER_DIR ..)
-    ENDIF (Cg_COMPILER)
-    FIND_PATH( Cg_INCLUDE_DIRS Cg/cg.h
-      "C:/Program Files/NVIDIA Corporation/Cg/include"
-      "C:/Program Files/Cg"
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${Cg_COMPILER_SUPER_DIR}/include
-      ${Cg_COMPILER_DIR}
-      DOC "The directory where Cg/cg.h resides"
-      )
-    FIND_LIBRARY( Cg_LIBRARIES
-      NAMES Cg
-      PATHS
-      "C:/Program Files/NVIDIA Corporation/Cg/lib"
-      "C:/Program Files/Cg"
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${Cg_COMPILER_SUPER_DIR}/lib
-      ${Cg_COMPILER_DIR}
-      DOC "The Cg runtime library"
-      PATH_SUFFIXES "" release relwithdebinfo minsizerel debug
-      )
-    FIND_LIBRARY( Cg_GL_LIBRARIES
-      NAMES CgGL
-      PATHS
-      "C:/Program Files/NVIDIA Corporation/Cg/lib"
-      "C:/Program Files/Cg"
-      ${PROJECT_SOURCE_DIR}/../Cg
-      ${Cg_COMPILER_SUPER_DIR}/lib
-      ${Cg_COMPILER_DIR}
-      DOC "The Cg runtime library"
-      PATH_SUFFIXES "" release relwithdebinfo minsizerel debug
-      )
-  ELSE (WIN32)
-    FIND_PROGRAM( Cg_COMPILER cgc
-      /usr/bin
-      /usr/local/bin
-      DOC "The Cg Compiler"
-      )
-    GET_FILENAME_COMPONENT(Cg_COMPILER_DIR "${Cg_COMPILER}" PATH)
-    GET_FILENAME_COMPONENT(Cg_COMPILER_SUPER_DIR "${Cg_COMPILER_DIR}" PATH)
-    FIND_PATH( Cg_INCLUDE_DIRS Cg/cg.h
-      /usr/include
-      /usr/local/include
-      ${Cg_COMPILER_SUPER_DIR}/include
-      DOC "The directory where Cg/cg.h resides"
-      )
-    FIND_LIBRARY( Cg_LIBRARIES Cg
-      PATHS
-      /usr/lib64
-      /usr/lib
-      /usr/local/lib64
-      /usr/local/lib
-      ${Cg_COMPILER_SUPER_DIR}/lib64
-      ${Cg_COMPILER_SUPER_DIR}/lib
-      DOC "The Cg runtime library"
-      PATH_SUFFIXES "" release relwithdebinfo minsizerel debug
-      )
-    FIND_LIBRARY( Cg_GL_LIBRARIES CgGL
-      PATHS
-      /usr/lib64
-      /usr/lib
-      /usr/local/lib64
-      /usr/local/lib
-      ${Cg_COMPILER_SUPER_DIR}/lib64
-      ${Cg_COMPILER_SUPER_DIR}/lib
-      DOC "The Cg runtime library"
-      PATH_SUFFIXES "" release relwithdebinfo minsizerel debug
-      )
-  ENDIF (WIN32)
-ENDIF (APPLE)
+set(Cg_LIBRARY_NAMES Cg)
+get_debug_names(Cg_LIBRARY_NAMES)

-IF (Cg_INCLUDE_DIRS AND Cg_LIBRARIES)
-  SET( Cg_FOUND TRUE)
-ENDIF ()
+use_pkgconfig(Cg_PKGC Cg)

-MARK_AS_ADVANCED( Cg_INCLUDE_DIRS Cg_COMPILER Cg_LIBRARIES Cg_GL_LIBRARIES )
+findpkg_framework(Cg)
+
+find_path(Cg_INCLUDE_DIR NAMES cg.h HINTS ${Cg_FRAMEWORK_INCLUDES} ${Cg_INC_SEARCH_PATH} ${Cg_PKGC_INCLUDE_DIRS} PATH_SUFFIXES Cg)
+find_library(Cg_LIBRARY_REL NAMES ${Cg_LIBRARY_NAMES} HINTS ${Cg_LIB_SEARCH_PATH} ${Cg_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
+find_library(Cg_LIBRARY_DBG NAMES ${Cg_LIBRARY_NAMES_DBG} HINTS ${Cg_LIB_SEARCH_PATH} ${Cg_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
+make_library_set(Cg_LIBRARY)
+
+findpkg_finish(Cg)
+add_parent_dir(Cg_INCLUDE_DIRS Cg_INCLUDE_DIR)


+ fixed cgns.mod searching

+ fixed cgns.mod searching

--- CMakeModules/FindCGNS.cmake
+++ CMakeModules/FindCGNS.cmake
@@ -5,9 +5,20 @@
 # CGNS_LIBRARIES   - List of fully qualified libraries to link against when using CGNS.
 # CGNS_FOUND       - Do not attempt to use CGNS if "no" or undefined.

-find_path(CGNS_INCLUDE_DIR cgnslib.h
+find_path(CGNS_INCLUDE_DIR1 cgnslib.h
   /usr/local/include
   /usr/include
+)
+
+find_path(CGNS_INCLUDE_DIR2 cgns.mod
+  /usr/lib64/gfortran/modules
+  /usr/local/include
+  /usr/include
+)
+
+set(CGNS_INCLUDE_DIR
+  ${CGNS_INCLUDE_DIR1}
+  ${CGNS_INCLUDE_DIR2}
 )

 find_library(CGNS_LIBRARY cgns


From Jose Delport, added support for finding and using GDAL 1.5

--- CMakeModules/FindGDAL.cmake
+++ CMakeModules/FindGDAL.cmake
@@ -56,20 +56,20 @@
 )

 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS
   $ENV{GDAL_DIR}
   NO_DEFAULT_PATH
   PATH_SUFFIXES lib64 lib
 )
 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
     NO_DEFAULT_PATH
     PATH_SUFFIXES lib64 lib
 )
 FIND_LIBRARY(GDAL_LIBRARY
-  NAMES gdal gdal_i gdal1.4.0 gdal1.3.2 GDAL
+  NAMES gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
   PATHS
     ~/Library/Frameworks
     /Library/Frameworks


MOD: Install headers for loadable modules. See: http://www.cegui.org.uk/mantis/view.php?id=724

--- cmake/CEGUIMacros.cmake
+++ cmake/CEGUIMacros.cmake
@@ -186,11 +186,7 @@

     include_directories("${CMAKE_SOURCE_DIR}/${_REL_INC_DIR}")

-    if (${_IS_MODULE})
-        set (_LIB_TYPE MODULE)
-    else()
-        set (_LIB_TYPE SHARED)
-    endif()
+    set (_LIB_TYPE SHARED)

     ###########################################################################
     #                       STATIC LIBRARY SET UP
@@ -272,7 +268,7 @@
 # to (except in static builds)
 #
 macro (cegui_add_loadable_module _MODULE_NAME _SOURCE_FILES_VAR _HEADER_FILES_VAR)
-    cegui_add_library_impl(${_MODULE_NAME} TRUE ${_SOURCE_FILES_VAR} ${_HEADER_FILES_VAR} TRUE FALSE)
+    cegui_add_library_impl(${_MODULE_NAME} TRUE ${_SOURCE_FILES_VAR} ${_HEADER_FILES_VAR} TRUE TRUE)
 endmacro()

 #


Improve library suffix handling for CppUnit and add correct suffix for Windows

Signed-off-by: Dan Bailey <39b6ae1dd30d9ab3cd77a2d084b277520f14c203@ilm.com>

--- cmake/FindCppUnit.cmake
+++ cmake/FindCppUnit.cmake
@@ -153,10 +153,20 @@
   ${SYSTEM_LIBRARY_PATHS}
   )

-# Static library setup
-IF ( UNIX AND CPPUNIT_USE_STATIC_LIBS )
-  SET ( _CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} )
-  SET ( CMAKE_FIND_LIBRARY_SUFFIXES ".a" )
+# Library suffix handling
+
+SET ( _CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} )
+
+IF ( WIN32 )
+  LIST ( APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+    "_dll.lib"
+    )
+ELSEIF ( UNIX )
+  IF ( CPPUNIT_USE_STATIC_LIBS )
+    LIST ( APPEND CMAKE_FIND_LIBRARY_SUFFIXES
+      ".a"
+      )
+  ENDIF ()
 ENDIF ()

 # Build suffix directories
@@ -172,10 +182,10 @@
   PATH_SUFFIXES ${CPPUNIT_PATH_SUFFIXES}
   )

-IF ( UNIX AND CPPUNIT_USE_STATIC_LIBS )
-  SET ( CMAKE_FIND_LIBRARY_SUFFIXES ${_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
-  UNSET ( _CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES )
-ENDIF ()
+# Reset library suffix
+
+SET ( CMAKE_FIND_LIBRARY_SUFFIXES ${_CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
+UNSET ( _CPPUNIT_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES )

 # ------------------------------------------------------------------------
 #  Cache and set CppUnit_FOUND


Make FindRdKafka.cmake work on Windows

Make FindRdKafka.cmake work on Windows

--- cmake/FindRdKafka.cmake
+++ cmake/FindRdKafka.cmake
@@ -7,10 +7,10 @@
     HINTS ${RDKAFKA_ROOT_DIR}/include
 )

-set (HINT_DIR ${RDKAFKA_ROOT_DIR}/lib)
+set(HINT_DIR ${RDKAFKA_ROOT_DIR}/lib)

 find_library(RDKAFKA_LIBRARY
-    NAMES rdkafka
+    NAMES rdkafka librdkafka
     HINTS ${HINT_DIR}
 )

@@ -20,11 +20,13 @@
     RDKAFKA_INCLUDE_DIR
 )

-include(CheckFunctionExists)
+set(CONTENTS "#include <librdkafka/rdkafka.h>\n #if RD_KAFKA_VERSION >= 0x00090400\n int main() { }\n #endif")
+set(FILE_NAME ${CMAKE_CURRENT_BINARY_DIR}/rdkafka_version_test.c)
+file(WRITE ${FILE_NAME} ${CONTENTS})

-set(CMAKE_REQUIRED_LIBRARIES ${RDKAFKA_LIBRARY})
-check_function_exists(rd_kafka_offsets_for_times HAVE_VALID_KAFKA_VERSION)
-set(CMAKE_REQUIRED_LIBRARIES)
+try_compile(HAVE_VALID_KAFKA_VERSION ${CMAKE_CURRENT_BINARY_DIR}
+            SOURCES ${FILE_NAME}
+            CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${RDKAFKA_INCLUDE_DIR}")

 if (HAVE_VALID_KAFKA_VERSION)
     message(STATUS "Found valid rdkafka version")


Recent UMFPACK library requires to link to libSuiteSparse

--- cmake/FindUmfpack.cmake
+++ cmake/FindUmfpack.cmake
@@ -39,9 +39,12 @@
   find_library(COLAMD_LIBRARY colamd PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
   if (COLAMD_LIBRARY)
     set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${COLAMD_LIBRARY})
-  #else (COLAMD_LIBRARY)
-  #  set(UMFPACK_LIBRARIES FALSE)
   endif (COLAMD_LIBRARY)
+
+  find_library(SUITESPARSE_LIBRARY SuiteSparse PATHS ${UMFPACK_LIBDIR} $ENV{UMFPACKDIR} ${LIB_INSTALL_DIR})
+  if (SUITESPARSE_LIBRARY)
+    set(UMFPACK_LIBRARIES ${UMFPACK_LIBRARIES} ${SUITESPARSE_LIBRARY})
+  endif (SUITESPARSE_LIBRARY)

 endif(UMFPACK_LIBRARIES)


Exclude object libraries from visual studio solution build

--- cmake/OpenCVUtils.cmake
+++ cmake/OpenCVUtils.cmake
@@ -795,8 +795,15 @@
     )
     set(sources ${ARGN})
     ocv_list_filterout(sources "\\\\.(cl|inc)$")
-    add_library(${target}_object OBJECT EXCLUDE_FROM_ALL ${sources})
-    set_target_properties(${target}_object PROPERTIES POSITION_INDEPENDENT_CODE True)
+    add_library(${target}_object OBJECT ${sources})
+    set_target_properties(${target}_object PROPERTIES
+      EXCLUDE_FROM_ALL True
+      EXCLUDE_FROM_DEFAULT_BUILD True
+      POSITION_INDEPENDENT_CODE True
+      )
+    if (ENABLE_SOLUTION_FOLDERS)
+      set_target_properties(${target}_object PROPERTIES FOLDER "object_libraries")
+    endif()
     unset(sources)
   endif()


added clang libraries to unit tests

added clang libraries to unit tests

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

--- cmake/pcl_targets.cmake
+++ cmake/pcl_targets.cmake
@@ -311,7 +311,7 @@
       set_target_properties(${_exename} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
     endif(NOT WIN32)
     #target_link_libraries(${_exename} ${GTEST_BOTH_LIBRARIES} ${PCL_ADD_TEST_LINK_WITH})
-    target_link_libraries(${_exename} ${PCL_ADD_TEST_LINK_WITH})
+    target_link_libraries(${_exename} ${PCL_ADD_TEST_LINK_WITH} ${CLANG_LIBRARIES})
     #
     # Only link if needed
     if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")


OSX: remove the GL_SILENCE_DEPRECATION define, this clashes with GLFW now

--- cmake-toolchains/osx.cmake
+++ cmake-toolchains/osx.cmake
@@ -18,9 +18,6 @@

 # FIXME: define standard frame works that are always linked
 set(FIPS_OSX_STANDARD_FRAMEWORKS Foundation IOKit)
-
-# globally silence the GL deprecation warning
-add_definitions(-DGL_SILENCE_DEPRECATION)

 # compiler flags
 set(CMAKE_CXX_FLAGS "-std=c++11 -fstrict-aliasing -Wno-expansion-to-defined -Wno-multichar -Wall -Wextra -Wno-unused-parameter -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-long-long -Wno-overloaded-virtual -Wno-unused-volatile-lvalue -Wno-deprecated-writable-strings")


More logging for external project

More logging for external project

--- cmake/External_gtest.cmake
+++ cmake/External_gtest.cmake
@@ -27,6 +27,8 @@
     PREFIX "${GTEST_PREFIX}"
     TIMEOUT 10
     LOG_DOWNLOAD ON
+    LOG_CONFIGURE ON
+    LOG_BUILD ON
     CMAKE_ARGS -DBUILD_SHARED_LIBS:BOOL=ON
     # Disable all other steps
     INSTALL_COMMAND ""


Fixed Typo in gtest finder (Thanks to Roman Zoller for the patch)

git-svn-id: b66b41e514ff40863ef1aa95df2dbf63dd8d6be1@1191 fdac6126-5c0c-442c-9429-916003d36597

--- cmake/FindGoogleTest.cmake
+++ cmake/FindGoogleTest.cmake
@@ -57,7 +57,7 @@
       /ACG/acgdev/gcc-4.7-x86_64/gtest/lib
       /opt/local/lib
       /usr/local/lib
-      /usr/include
+      /usr/lib
       "C:/libs/win32/gtest/lib"
       NO_DEFAULT_PATH )
     find_library(_GTEST_MAIN_LIBRARY gtest_main
@@ -67,7 +67,7 @@
       /ACG/acgdev/gcc-4.7-x86_64/gtest/lib
       /opt/local/lib
       /usr/local/lib
-      /usr/include
+      /usr/lib
       "C:/libs/win32/gtest/lib"
       NO_DEFAULT_PATH )


Use CMake's builtin FindPythonLibs instead of pybind11's

The FindPythonLibNew module in pybind11 is lacking any validation of
actually finding the component's it's looking for.

Fixes #306

--- cmake/FindPythonFull.cmake
+++ cmake/FindPythonFull.cmake
@@ -15,6 +15,7 @@
 #   PYTHONINTERP_FOUND
 #   PYTHON_EXECUTABLE
 #   PYTHONLIBS_FOUND
+#   PYTHON_INCLUDE_DIRS
 #   PYTHON_LIBRARIES
 #   PythonModule_${module_NAME}_FOUND
 #
@@ -33,7 +34,18 @@
     set(PythonFull_${comp}_FOUND ${PYTHONINTERP_FOUND})
     list(APPEND _req_vars PYTHON_EXECUTABLE)
   elseif(comp STREQUAL Libs)
-    find_package(PythonLibsNew)
+    if(PYTHONINTERP_FOUND AND Python_ADDITIONAL_VERSIONS)
+      set(_Python_ADDITIONAL_VERSIONS "${Python_ADDITIONAL_VERSIONS}")
+      unset(Python_ADDITIONAL_VERSIONS)
+      unset(Python_ADDITIONAL_VERSIONS CACHE)
+      find_package(PythonLibs)
+      set(Python_ADDITIONAL_VERSIONS "${_Python_ADDITIONAL_VERSIONS}"
+        CACHE STRING "Python versions to search for"
+      )
+      unset(_Python_ADDITIONAL_VERSIONS)
+    else()
+      find_package(PythonLibs)
+    endif()
     set(PythonFull_${comp}_FOUND ${PYTHONLIBS_FOUND})
     list(APPEND _req_vars PYTHON_LIBRARIES)
   else()


updated OpenVINO module for new install path in 2019 version

--- cmake/ModuleOpenVINO.cmake
+++ cmake/ModuleOpenVINO.cmake
@@ -1,8 +1,8 @@
 if(FAST_MODULE_OpenVINO)
     message("-- Enabling Intel OpenVINO inference engine module")
     if(WIN32)
-		set(InferenceEngine_BASE C:/Intel/computer_vision_sdk/inference_engine)
-		set(InferenceEngine_DIR ${InferenceEngine_BASE}/share)
+        set(InferenceEngine_BASE "C:/Program Files (x86)/IntelSWTools/openvino/inference_engine")
+        set(InferenceEngine_DIR ${InferenceEngine_BASE}/share)
     else()
         set(InferenceEngine_BASE /opt/intel/computer_vision_sdk/inference_engine)
         set(InferenceEngine_DIR ${InferenceEngine_BASE}/share)
@@ -14,4 +14,4 @@
     list(APPEND FAST_INCLUDE_DIRS ${InferenceEngine_INCLUDE_DIRS})
     list(APPEND LIBRARIES ${InferenceEngine_LIBRARIES} ${IntelOpenMPLibrary} ${IntelMKLLibrary})
     list(APPEND FAST_EXTERNAL_DEPENDENCIES IE::ie_cpu_extension)
-endif()+endif()


Upgrade to LLVM 7.0.0

Upgrade to LLVM 7.0.0

This should resolve #168, #171 and #172.

--- cmake/clang/download.cmake
+++ cmake/clang/download.cmake
@@ -1,28 +1,28 @@
 if(NOT CUSTOM_CLANG)
-  set(CLANG_VERSION "5.0.0")
+  set(CLANG_VERSION "7.0.0")
   message(STATUS "Locating trusted Clang/LLVM ${CLANG_VERSION}")

-  set(CLANG_URL "http://llvm.org/releases/${CLANG_VERSION}" )
+  set(CLANG_URL "https://llvm.org/releases/${CLANG_VERSION}" )
   if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
     set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-apple-darwin")
-    set(CLANG_SHA256 "326be172ccb61210c9ae5dced27204977e249ec6589521cc30f82fd0904b0671")
+    set(CLANG_SHA256 "b3ad93c3d69dfd528df9c5bb1a434367babb8f3baea47fbb99bf49f1b03c94ca")
     set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
   elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     if(64_BIT_PLATFORM)
-      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-linux-x86_64-ubuntu14.04")
-      set(CLANG_SHA256 "58c1171f326108cfb7641441c5ede7846d58823bce3206c86a84c7ef7748860d")
+      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-x86_64-linux-gnu-ubuntu-14.04")
+      set(CLANG_SHA256 "5c90e61b06d37270bc26edb305d7e498e2c7be22d99e0afd9f2274ef5458575a")
       set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
     else()
       message(FATAL_ERROR "No pre-built Clang ${CLANG_VERSION} binaries for 32 bit Linux; this system is not supported")
     endif()
   elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
     if(64_BIT_PLATFORM)
-      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-amd64-unknown-freebsd10")
-      set(CLANG_SHA256 "e55b646390da0a24e27f9761eecf0b31936483c9a3e84c12de0bb1a0d95bab6c")
+      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-amd64-unknown-freebsd11")
+      set(CLANG_SHA256 "95ceb933ccf76e3ddaa536f41ab82c442bbac07cdea6f9fbf6e3b13cc1711255")
       set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
     else()
-      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-i386-unknown-freebsd10")
-      set(CLANG_SHA256 "2ea32ad7cd30d8e849113747b5bfda8e6eb0fb2f9b01cbe9eb61e884c0bd69eb")
+      set(CLANG_DIRNAME "clang+llvm-${CLANG_VERSION}-i386-unknown-freebsd11")
+      set(CLANG_SHA256 "35460d34a8b3d856e0d7c0b2b20d31f0d1ec05908c830a81f586721e8f8fb04f")
       set(CLANG_FILENAME "${CLANG_DIRNAME}.tar.xz")
     endif()
   endif()


cmake: use find_program for smfc

cmake: use find_program for smfc

--- cmake/smfc_generator.cmake
+++ cmake/smfc_generator.cmake
@@ -1,8 +1,6 @@
-#  1. over time this should become a proper cmake module
-#set(FLATBUFFERS_COMPILER flatc)
-
-find_program (FLATBUFFERS_COMPILER
-  flatc)
+# This module is exported. So use find_program by cmake
+find_program (FLATBUFFERS_COMPILER flatc)
+find_program (SMF_COMPILER smfc)

 function(smfc_gen)
   set(options CPP GOLANG VERBOSE)
@@ -60,13 +58,13 @@
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
     # smfc
     add_custom_command(OUTPUT ${SMF_GEN_OUTPUT}
-      COMMAND smfc
+      COMMAND ${SMF_COMPILER}
       ARGS --filename ${FILE}
       ARGS "${smfc_language}"
       ARGS "${smfc_generated_includes}"
       ARGS --output_path="${SMFC_GEN_OUTPUT_DIRECTORY}"
       COMMENT "Generating smf rpc stubs for ${FILE}"
-      DEPENDS smfc
+      DEPENDS ${SMF_COMPILER}
       DEPENDS ${FILE}
       WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
   endforeach()


Fix coverage flag detection

Fix coverage flag detection

--- cmake/snippets/flags.cmake
+++ cmake/snippets/flags.cmake
@@ -161,8 +161,11 @@

     vistk_check_compiler_flag(vistk_coverage -O0)
     vistk_check_compiler_flag(vistk_coverage -pg)
-    vistk_check_compiler_flag(vistk_coverage -fprofile-arcs)
     vistk_check_compiler_flag(vistk_coverage -ftest-coverage)
+
+    # It seems as though the flag isn't detected alone.
+    set(vistk_coverage
+      "${vistk_coverage} -fprofile-arcs")

     set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${vistk_coverage}")
   endif ()


fix Random test

fix Random test

--- cmake/vSMCFindRandom.cmake
+++ cmake/vSMCFindRandom.cmake
@@ -6,7 +6,7 @@
 int main ()
 {
     const int N = 1000;
-    vsmc::RngSet eng(N);
+    vsmc::traits::RngSetTypeTrait<vsmc::NullType>::type eng(N);

     vsmc::cxx11::uniform_real_distribution<> runif(0, 1);
     for (int i = 0; i != N; ++i) {


bugfix in FindTBB.cmake

bugfix in FindTBB.cmake

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -66,7 +66,7 @@
     FIND_LIBRARY(TBB_LIBRARY tbb)
     FIND_LIBRARY(TBB_LIBRARY_MALLOC tbbmalloc)

-  ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/src)
+  ELSEIF (EXISTS ${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)
     OPTION(EMBREE_TBB_STATIC_LIB "Build TBB as a static library (building TBB as a static library is NOT recommended)")
     if (EMBREE_TBB_STATIC_LIB)
       include(${EMBREE_TBB_ROOT}/cmake/TBBBuild.cmake)


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 10)

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


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 02)

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


Stop ad-hoc signing stdlib dylibs for benchmarks

rdar://problem/27619856

--- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
+++ benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake
@@ -315,7 +315,6 @@
       DEPENDS
         ${bench_library_objects} ${SWIFT_BENCH_OBJFILES}
         "${objcfile}"
-        "adhoc-sign-swift-stdlib-${BENCH_COMPILE_ARCHOPTS_PLATFORM}"
       COMMAND
         "${CLANG_EXEC}"
         "-fno-stack-protector"
@@ -356,19 +355,6 @@
     endforeach()
   endif()

-  add_custom_target("copy-swift-stdlib-${SWIFT_BENCHMARK_COMPILE_PLATFORM}"
-      DEPENDS ${stdlib_dependencies}
-      COMMAND
-        "${CMAKE_COMMAND}" "-E" "copy_directory"
-        "${SWIFT_LIBRARY_PATH}/${SWIFT_BENCHMARK_COMPILE_PLATFORM}"
-        "${benchmark-lib-swift-dir}/${SWIFT_BENCHMARK_COMPILE_PLATFORM}")
-
-  add_custom_target("adhoc-sign-swift-stdlib-${SWIFT_BENCHMARK_COMPILE_PLATFORM}"
-      DEPENDS "copy-swift-stdlib-${SWIFT_BENCHMARK_COMPILE_PLATFORM}"
-      COMMAND
-        "codesign" "-f" "-s" "-"
-        "${benchmark-lib-swift-dir}/${SWIFT_BENCHMARK_COMPILE_PLATFORM}/*.dylib" "2>/dev/null")
-
   set(platform_executables)
   foreach(arch ${${SWIFT_BENCHMARK_COMPILE_PLATFORM}_arch})
     set(platform_executables)


FindGMOCK.cmake: Set GMOCK_FOUND to TRUE in the cache

--- FindGMOCK.cmake
+++ FindGMOCK.cmake
@@ -341,7 +341,7 @@

     endif ()

-    set (GMOCK_FOUND TRUE PARENT_SCOPE)
+    set (GMOCK_FOUND ON CACHE BOOL "Whether Google Mock was found" FORCE)
     set (GMOCK_FOUND_WHERE "${FOUND_WHERE}" PARENT_SCOPE)

 endfunction ()


CMake fix: cfg files were not placed properly in the build dir for Linux

--- CMake/InstallResources.cmake
+++ CMake/InstallResources.cmake
@@ -93,15 +93,27 @@
 elseif (APPLE)
   # TODO
 endif ()
-# create resources.cfg
-configure_file(${OGRE_TEMPLATES_DIR}/resources.cfg.in ${OGRE_BINARY_DIR}/bin/debug/resources.cfg)
-configure_file(${OGRE_TEMPLATES_DIR}/resources.cfg.in ${OGRE_BINARY_DIR}/bin/release/resources.cfg)
-# create plugins.cfg
-configure_file(${OGRE_TEMPLATES_DIR}/plugins_d.cfg.in ${OGRE_BINARY_DIR}/bin/debug/plugins.cfg)
-configure_file(${OGRE_TEMPLATES_DIR}/plugins.cfg.in ${OGRE_BINARY_DIR}/bin/release/plugins.cfg)
-# create media.cfg
-configure_file(${OGRE_TEMPLATES_DIR}/media.cfg.in ${OGRE_BINARY_DIR}/bin/debug/media.cfg)
-configure_file(${OGRE_TEMPLATES_DIR}/media.cfg.in ${OGRE_BINARY_DIR}/bin/release/media.cfg)
-# create quake3settings.cfg
-configure_file(${OGRE_TEMPLATES_DIR}/quake3settings.cfg.in ${OGRE_BINARY_DIR}/bin/debug/quake3settings.cfg)
-configure_file(${OGRE_TEMPLATES_DIR}/quake3settings.cfg.in ${OGRE_BINARY_DIR}/bin/release/quake3settings.cfg)
+if (WIN32)
+  # create resources.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/resources.cfg.in ${OGRE_BINARY_DIR}/bin/debug/resources.cfg)
+  configure_file(${OGRE_TEMPLATES_DIR}/resources.cfg.in ${OGRE_BINARY_DIR}/bin/release/resources.cfg)
+  # create plugins.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/plugins_d.cfg.in ${OGRE_BINARY_DIR}/bin/debug/plugins.cfg)
+  configure_file(${OGRE_TEMPLATES_DIR}/plugins.cfg.in ${OGRE_BINARY_DIR}/bin/release/plugins.cfg)
+  # create media.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/media.cfg.in ${OGRE_BINARY_DIR}/bin/debug/media.cfg)
+  configure_file(${OGRE_TEMPLATES_DIR}/media.cfg.in ${OGRE_BINARY_DIR}/bin/release/media.cfg)
+  # create quake3settings.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/quake3settings.cfg.in ${OGRE_BINARY_DIR}/bin/debug/quake3settings.cfg)
+  configure_file(${OGRE_TEMPLATES_DIR}/quake3settings.cfg.in ${OGRE_BINARY_DIR}/bin/release/quake3settings.cfg)
+else() # other OS only need one cfg file
+  # create resources.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/resources.cfg.in ${OGRE_BINARY_DIR}/bin/resources.cfg)
+  # create plugins.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/plugins_d.cfg.in ${OGRE_BINARY_DIR}/bin/plugins.cfg)
+  # create media.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/media.cfg.in ${OGRE_BINARY_DIR}/bin/media.cfg)
+  # create quake3settings.cfg
+  configure_file(${OGRE_TEMPLATES_DIR}/quake3settings.cfg.in ${OGRE_BINARY_DIR}/bin/quake3settings.cfg)
+
+