BUG: On Windows, DTIReg was not building because ITK path was too long. Addition of an option to set the source and the binary directories when compiling external projects

--- SuperBuild/FindExternalTools.cmake
+++ SuperBuild/FindExternalTools.cmake
@@ -549,7 +549,7 @@
   SVN_REPOSITORY "http://www.nitrc.org/svn/dtireg/trunk"
   SVN_USERNAME slicerbot
   SVN_PASSWORD slicer
-  SVN_REVISION -r 61
+  SVN_REVISION -r 63
   )
 set( CMAKE_ExtraARGS
   -DANTSTOOL:PATH=${ANTSPath}
@@ -564,6 +564,8 @@
   -DdtiprocessTOOL:PATH=${dtiprocessPath}
   -DUSE_GIT_PROTOCOL_SuperBuild_DTIReg:STRING=${USE_GIT_PROTOCOL}
   ${Slicer_CLIMODULES_BIN_DIR_OPTION}
+  -DEXTERNAL_SOURCE_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}
+  -DEXTERNAL_BINARY_DIRECTORY:PATH=${CMAKE_CURRENT_BINARY_DIR}
   )
 set( Tools
   DTI-Reg


add declaration for lcm pod external, but not currently enabled

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -1,3 +1,6 @@
+set(lcm_pod_url https://github.com/RobotLocomotion/lcm-pod.git)
+set(lcm_pod_revision c43ae7d)
+set(lcm_pod_depends)

 set(libbot-drc_url https://svn.csail.mit.edu/drc/trunk/software/externals/libbot-drc)
 set(libbot-drc_revision 8325)


move up atlas driver reference

move up atlas driver reference

--- software/externals/cmake/externals.cmake
+++ software/externals/cmake/externals.cmake
@@ -124,7 +124,7 @@
 set(gurobi_depends gurobi-private)

 set(atlas-driver_url ssh://git@github.com/openhumanoids/atlas-drivers.git)
-set(atlas-driver_revision 59955966eda449b4ca8bd9f4fd09afcf3d9d20cf)
+set(atlas-driver_revision 507d4c1c3164cefe3ff3ab4c1f389d6f8e68c905)
 set(atlas-driver_depends)
 set(atlas-driver_external_args
   ${download_only_args}


build: Updated botan bundle with system_rng

--- cmake/botan.cmake
+++ cmake/botan.cmake
@@ -5,7 +5,7 @@
 ExternalProject_Add(botan
         PREFIX botan
         URL https://github.com/includeos/botan/releases/download/inc-2.0/botan-includeos.tar.gz
-        URL_HASH MD5=952980834c93e61dc836bb7c400f4d57
+        URL_HASH MD5=5ef7f26047f8fe17219f62755938621d
         CONFIGURE_COMMAND ""
         BUILD_COMMAND ""
         UPDATE_COMMAND ""


Remove unnecessary else branch

Remove unnecessary else branch

--- cmake/check.cmake
+++ cmake/check.cmake
@@ -143,8 +143,6 @@

 if (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
 	set (OS_IS_OPENBSD 1)
-else ()
-	set (OS_IS_OPENBSD 0)
 endif ()


Fix Windows build removing non existing C11 conformance (#6629)

thirdparty_librdkafka_c was failing to compile
due to the C11 keyword _Thread_local not being recognized.

--- cmake/flags.cmake
+++ cmake/flags.cmake
@@ -20,7 +20,15 @@
   add_library(c_settings INTERFACE)

   target_compile_features(cxx_settings INTERFACE cxx_std_14)
-  target_compile_features(c_settings INTERFACE c_std_11)
+
+  # There's no specific C11 conformance on MSVC
+  # and recent versions of CMake add the /std:c11 flag to the command line
+  # which makes librdkafka compilation fail due to _Thread_local not being defined,
+  # even if it's a C11 keyword.
+  # For some reason the compiler does not complain about the incorrect flag.
+  if(NOT DEFINED PLATFORM_WINDOWS)
+    target_compile_features(c_settings INTERFACE c_std_11)
+  endif()

   if(DEFINED PLATFORM_POSIX)


ENH: setup Documentation dashboard

ENH: setup Documentation dashboard

--- SoftwareGuide/CTestConfig.cmake
+++ SoftwareGuide/CTestConfig.cmake
@@ -1,13 +1,7 @@
-## This file should be placed in the root directory of your project.
-## Then modify the CMakeLists.txt file in the root directory of your
-## project to incorporate the testing dashboard.
-## # The following are required to uses Dart and the Cdash dashboard
-##   ENABLE_TESTING()
-##   INCLUDE(Dart)
-set(CTEST_PROJECT_NAME "OTB-SoftwareGuide")
+set(CTEST_PROJECT_NAME "Documentation")
 set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")

-#set(CTEST_DROP_METHOD "http")
-#set(CTEST_DROP_SITE "dash.orfeo-toolbox.org")
-#set(CTEST_DROP_LOCATION "/submit.php?project=OTB")
-#set(CTEST_DROP_SITE_CDASH TRUE)
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "dash.orfeo-toolbox.org")
+set(CTEST_DROP_LOCATION "/submit.php?project=Documentation")
+set(CTEST_DROP_SITE_CDASH TRUE)


fixed bug with installing TBB 2019 Update 9

--- common/cmake/FindTBB.cmake
+++ common/cmake/FindTBB.cmake
@@ -158,9 +158,9 @@
     INSTALL(PROGRAMS ${TBB_BINDIR}/tbb.dll ${TBB_BINDIR}/tbbmalloc.dll DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT examples)
     INSTALL(PROGRAMS ${TBB_LIBDIR}/tbb.lib ${TBB_LIBDIR}/tbbmalloc.lib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
   ELSEIF (APPLE)
-    INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/libtbb.dylib ${EMBREE_TBB_ROOT}/lib/libtbbmalloc.dylib DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+    INSTALL(PROGRAMS ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
   ELSE()
-    INSTALL(PROGRAMS ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbb.so.2 ${EMBREE_TBB_ROOT}/lib/intel64/gcc4.4/libtbbmalloc.so.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
+    INSTALL(PROGRAMS ${TBB_LIBRARY}.2 ${TBB_LIBRARY_MALLOC}.2 DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT lib)
   ENDIF()
 ENDIF()


Revert "build: add a workaround for CMake[>=3.22] and SourceKit"

This reverts commit 1e5df70d8924ff5f064cbd5009bd50106957380e.

This does not actually impact the build, so revert it to reduce the
complexity in the build.

--- tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
+++ tools/SourceKit/cmake/modules/AddSwiftSourceKit.cmake
@@ -11,10 +11,6 @@
   if(${SWIFT_HOST_VARIANT_SDK} STREQUAL WINDOWS)
     swift_windows_include_for_arch(${SWIFT_HOST_VARIANT_ARCH}
       ${SWIFT_HOST_VARIANT_ARCH}_INCLUDE)
-    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)
-      set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-I")
-      set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-I")
-    endif()
     target_include_directories(${target} SYSTEM PRIVATE
       ${${SWIFT_HOST_VARIANT_ARCH}_INCLUDE})
   endif()


allow to overwrite STD_

allow to overwrite STD_

(temporary solution without cache)

--- cmake/ElektraCompiling.cmake
+++ cmake/ElektraCompiling.cmake
@@ -10,12 +10,20 @@
 #
 # The mode (standard) to be used by the compiler
 #
-set (C_STD "-std=gnu99")
+if (C_STD)
+	message (STATUS "use C_STD as given by user: ${C_STD}")
+else()
+	set (C_STD "-std=gnu99")
+endif()

-if (ENABLE_CXX11)
-	set (CXX_STD "-std=c++11")
+if (CXX_STD)
+	message (STATUS "use CXX_STD as given by user: ${CXX_STD}")
 else()
-	set (CXX_STD "-std=c++98")
+	if (ENABLE_CXX11)
+		set (CXX_STD "-std=c++11")
+	else()
+		set (CXX_STD "-std=c++98")
+	endif()
 endif()


RUNTIME DESTINATION was missing

RUNTIME DESTINATION was missing

--- cmake/MyPackageLibrary.cmake
+++ cmake/MyPackageLibrary.cmake
@@ -84,8 +84,8 @@
       TARGET_INCLUDE_DIRECTORIES(${_target} ${_include_directory_scope} ${_include_directory})
     ENDFOREACH ()
   ENDFOREACH ()
-  INSTALL (TARGETS ${PROJECT_NAME}        ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT DynamicLibraryComponent)
-  INSTALL (TARGETS ${PROJECT_NAME}_static ARCHIVE DESTINATION lib LIBRARY DESTINATION lib COMPONENT StaticLibraryComponent)
+  INSTALL (TARGETS ${PROJECT_NAME}        RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT DynamicLibraryComponent)
+  INSTALL (TARGETS ${PROJECT_NAME}_static RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT StaticLibraryComponent)
   SET (_HAVE_DYNAMICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have DynamicLibraryComponent" FORCE)
   SET (_HAVE_STATICLIBRARYCOMPONENT TRUE CACHE INTERNAL "Have StaticLibraryComponent" FORCE)
   #


Precise default CUDA version for Tegra X1 chips.

--- cmake/OpenCVDetectCUDA.cmake
+++ cmake/OpenCVDetectCUDA.cmake
@@ -86,7 +86,7 @@
         set(__cuda_arch_bin "3.2")
         set(__cuda_arch_ptx "")
       elseif(AARCH64)
-        set(__cuda_arch_bin "5.2")
+        set(__cuda_arch_bin "5.3")
         set(__cuda_arch_ptx "")
       endif()
     else()


CMake: check for existence of git hook and suggest installing otherwise

--- cmake/clang-cpp-checks.cmake
+++ cmake/clang-cpp-checks.cmake
@@ -1,4 +1,11 @@
 # Additional targets to perform clang-format/clang-tidy/cppcheck
+
+# Check if the git pre-commit hook for formatting is installed:
+IF(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
+    IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit-clang-format")
+        MESSAGE(WARNING "Git hooks are not installed - consider installing them via ${CMAKE_SOURCE_DIR}/etc/git-hooks/install-hooks.sh")
+    ENDIF()
+ENDIF()

 # Get all project files - FIXME: this should also use the list of generated targets
 IF(NOT CHECK_CXX_SOURCE_FILES)


[cmake] Do not use the just built swift link directory for host side executables.

This is just cruft that remained from the time when swift's host/target used the
same cmake code. Host tools do not statically link against just built artifacts.

--- cmake/modules/AddSwift.cmake
+++ cmake/modules/AddSwift.cmake
@@ -624,8 +624,7 @@
   _add_host_variant_c_compile_flags(${executable})
   _add_host_variant_link_flags(${executable})
   _add_host_variant_c_compile_link_flags(${executable})
-  target_link_directories(${executable} PRIVATE
-    ${SWIFTLIB_DIR}/${SWIFT_SDK_${SWIFT_HOST_VARIANT_SDK}_LIB_SUBDIR})
+
   # Force executables linker language to be CXX so that we do not link using the
   # host toolchain swiftc.
   set_target_properties(${executable} PROPERTIES LINKER_LANGUAGE CXX)


update(build): civetweb depends on openssl.

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

Co-authored-by: Leonardo Grasso <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@leonardograsso.com>

--- cmake/modules/civetweb.cmake
+++ cmake/modules/civetweb.cmake
@@ -18,6 +18,7 @@
 message(STATUS "Using bundled civetweb in '${CIVETWEB_SRC}'")
 ExternalProject_Add(
         civetweb
+        DEPENDS openssl
         URL "https://github.com/civetweb/civetweb/archive/v1.15.tar.gz"
         URL_HASH "SHA256=90a533422944ab327a4fbb9969f0845d0dba05354f9cacce3a5005fa59f593b9"
         INSTALL_DIR ${CIVETWEB_SRC}/install


Fixing typo in previous patch

Fixing typo in previous patch

--- cmake_modules/FindGLog.cmake
+++ cmake_modules/FindGLog.cmake
@@ -14,7 +14,7 @@
     ${THIRDPARTY}/glog-$ENV{IMPALA_GLOG_VERSION}/src
   )
   set(GLOG_SEARCH_LIB_PATH
-    ${THIRDPARTY}/glog-$EV{IMPALA_GLOG_VERSION}/.libs
+    ${THIRDPARTY}/glog-$ENV{IMPALA_GLOG_VERSION}/.libs
   )
 endif ()


ffmpeg: update wrapper

ffmpeg: update wrapper

FFmpeg: 3.3.4 -> 3.4.2
LibVPX: 1.6.1 -> 1.7.0
OpenH264: 1.6.0 -> 1.7.0

--- 3rdparty/ffmpeg/ffmpeg.cmake
+++ 3rdparty/ffmpeg/ffmpeg.cmake
@@ -1,9 +1,9 @@
-# Binary branch name: ffmpeg/master_20171009
-# Binaries were created for OpenCV: 8ac2c5d620b467d3f22802e96c88ddde6da707af
-set(FFMPEG_BINARIES_COMMIT "66b1fed06cf3510235f367f96aa26da5cb234a15")
-set(FFMPEG_FILE_HASH_BIN32 "3ae76b105113d944984b2351c61e21c6")
-set(FFMPEG_FILE_HASH_BIN64 "cf3bb5bc9d393b022ea7a42eb63e794d")
-set(FFMPEG_FILE_HASH_CMAKE "ec59008da403fb18ab3c1ed66aed583b")
+# Binaries branch name: ffmpeg/master_20180220
+# Binaries were created for OpenCV: 9819ebc0954c2df62943ebbd5936d325e5dc89e1
+ocv_update(FFMPEG_BINARIES_COMMIT "0a0e88972a7ea97708378d0488a65f83e7cc5e69")
+ocv_update(FFMPEG_FILE_HASH_BIN32 "b8120c07962d591e2e9071a1bf566fd0")
+ocv_update(FFMPEG_FILE_HASH_BIN64 "dc9c50e7b05482acc25d6ce0ac61bf1d")
+ocv_update(FFMPEG_FILE_HASH_CMAKE "3b90f67f4b429e77d3da36698cef700c")

 function(download_win_ffmpeg script_var)
   set(${script_var} "" PARENT_SCOPE)


Add suport for using profiles.

Add suport for using profiles.

Add DEBUG_PROFILE, RELEASE_PROFILE and PROFILE arguments to
conan_cmake_run macro. When supplyed:
* DEBUG_PROFILE - overrides settings for DEBUG builds
* RELEASE_PROFILE - overrides settings for RELEASE builds
* PROFILE - overrides settings for all build types.

--- conan.cmake
+++ conan.cmake
@@ -195,7 +195,7 @@

 macro(parse_arguments)
   set(options BASIC_SETUP CMAKE_TARGETS UPDATE)
-  set(oneValueArgs CONANFILE)
+  set(oneValueArgs CONANFILE DEBUG_PROFILE RELEASE_PROFILE PROFILE)
   set(multiValueArgs REQUIRES OPTIONS IMPORTS BUILD CONAN_COMMAND)
   cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
 endmacro()
@@ -224,6 +224,15 @@
     endif()
     if(ARGUMENTS_CONANFILE)
       set(CONANFILE -f=${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE})
+    endif()
+    if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARGUMENTS_DEBUG_PROFILE)
+      set(settings -pr ${ARGUMENTS_DEBUG_PROFILE})
+    endif()
+    if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ARGUMENTS_RELEASE_PROFILE)
+      set(settings -pr ${ARGUMENTS_RELEASE_PROFILE})
+    endif()
+    if(ARGUMENTS_PROFILE)
+      set(settings -pr ${ARGUMENTS_PROFILE})
     endif()
     if(ARGUMENTS_UPDATE)
       set(CONAN_INSTALL_UPDATE --update)


ENH: add macro for system prefix

ENH: add macro for system prefix

--- CMake/SuperBuild_Macro.cmake
+++ CMake/SuperBuild_Macro.cmake
@@ -31,3 +31,17 @@
     endif()
   endforeach(var)
 endmacro(ADD_SYSTEM_LOCATION)
+
+# Macro ADD_SYSTEM_PREFIX : defines a system prefix for the given project
+#   - creates a cache variable SYSTEM_${PROJECT}_PREFIX
+macro(ADD_SYSTEM_PREFIX)
+  cmake_parse_arguments(NEW_SYSPREFIX  "" "PROJECT" "" ${ARGN})
+  set(SYSTEM_${NEW_SYSPREFIX_PROJECT}_PREFIX "" CACHE PATH "Set a custom system prefix")
+  mark_as_advanced(SYSTEM_${NEW_SYSPREFIX_PROJECT}_PREFIX)
+  if(USE_SYSTEM_${NEW_SYSPREFIX_PROJECT})
+    set_property(CACHE SYSTEM_${NEW_SYSPREFIX_PROJECT}_PREFIX PROPERTY TYPE PATH)
+  else()
+    set_property(CACHE SYSTEM_${NEW_SYSPREFIX_PROJECT}_PREFIX PROPERTY TYPE INTERNAL)
+  endif()
+
+endmacro(ADD_SYSTEM_PREFIX)


Added CTK Designer plugins to fixup_bundle processing

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -103,14 +103,18 @@
       # glob for Qt plugins
       \"\${CMAKE_INSTALL_PREFIX}/${${_target_location}_qt_plugins_install_dir}/plugins/*${CMAKE_SHARED_LIBRARY_SUFFIX}\")

+    file(GLOB_RECURSE GLOBBED_CTK_DESIGNER_PLUGINS
+      # glob for Qt designer plugins
+      \"\${CMAKE_INSTALL_PREFIX}/${${_target_location}_qt_plugins_install_dir}/plugins/designer/*${CMAKE_SHARED_MODULE_SUFFIX}\")
+
     # use custom version of BundleUtilities
-    message(\"globbed plugins: \${GLOBBED_QT_PLUGINS} \${GLOBBED_BLUEBERRY_PLUGINS}\")
+    message(\"globbed plugins: \${GLOBBED_QT_PLUGINS} \${GLOBBED_BLUEBERRY_PLUGINS} \${GLOBBED_CTK_DESIGNER_PLUGINS} \")
     set(PLUGIN_DIRS)
-    set(PLUGINS ${_install_PLUGINS} \${GLOBBED_QT_PLUGINS} \${GLOBBED_BLUEBERRY_PLUGINS})
+    set(PLUGINS \${_install_PLUGINS} \${GLOBBED_QT_PLUGINS} \${GLOBBED_BLUEBERRY_PLUGINS} \${GLOBBED_CTK_DESIGNER_PLUGINS})
     if(PLUGINS)
       list(REMOVE_DUPLICATES PLUGINS)
-    endif(PLUGINS)
-    foreach(_plugin \${GLOBBED_BLUEBERRY_PLUGINS})
+    endif(PLUGINS)
+    foreach(_plugin \${GLOBBED_BLUEBERRY_PLUGINS} \${GLOBBED_CTK_DESIGNER_PLUGINS} )
       get_filename_component(_pluginpath \${_plugin} PATH)
       list(APPEND PLUGIN_DIRS \${_pluginpath})
     endforeach(_plugin)
@@ -121,7 +125,7 @@
     # use custom version of BundleUtilities
     set(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
     include(BundleUtilities)
-
+
     fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${_target_location}\" \"\${PLUGINS}\" \"\${DIRS}\")
   ")
 endmacro()


Remove duplicates from PLUGINS and PLUGIN_DIRS variables

This should help on platforms that have problems with very long command lines, eg Win32

--- CMake/mitkMacroInstall.cmake
+++ CMake/mitkMacroInstall.cmake
@@ -113,14 +113,17 @@
     message(\"globbed plugins: \${PLUGINS}\")
     SET(PLUGIN_DIRS ${DIRS})
     LIST(APPEND PLUGINS ${_install_PLUGINS})
+    list(REMOVE_DUPLICATES PLUGINS)
     foreach(_plugin \${PLUGINS})
       get_filename_component(_pluginpath \${_plugin} PATH)
       list(APPEND PLUGIN_DIRS \${_pluginpath})
+      list(REMOVE_DUPLICATES PLUGIN_DIRS)
     endforeach(_plugin)
     list(APPEND DIRS \${PLUGIN_DIRS})
     # use custom version of BundleUtilities
     SET(CMAKE_MODULE_PATH ${MITK_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} )
     include(BundleUtilities)
+    list(REMOVE_DUPLICATES PLUGIN_DIRS)
     fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${_target_location}\" \"\${PLUGINS}\" \"\${PLUGIN_DIRS}\")
   ")
 ENDMACRO()


ecp5: Make database build depend on constids.inc

Signed-off-by: David Shah <bfcdf3e6ca6cef45543bfbb57509c92aec9a39fb@ds0.me>

--- ecp5/family.cmake
+++ ecp5/family.cmake
@@ -48,7 +48,7 @@
             else()
                 add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
                     COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}
-                    DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
+                    DEPENDS ${DB_PY} ${DEV_CONSTIDS_INC} ${PREV_DEV_CC_BBA_DB}
                     )
                 add_custom_command(OUTPUT ${DEV_CC_DB}
                     COMMAND bbasm ${BBASM_ENDIAN_FLAG} ${DEV_CC_BBA_DB} ${DEV_CC_DB}
@@ -80,7 +80,7 @@
                 add_custom_command(OUTPUT ${DEV_CC_BBA_DB}
                     COMMAND ${ENV_CMD} ${PYTHON_EXECUTABLE} ${DB_PY} -p ${DEV_CONSTIDS_INC} ${dev} > ${DEV_CC_BBA_DB}.new
                     COMMAND mv ${DEV_CC_BBA_DB}.new ${DEV_CC_BBA_DB}
-                    DEPENDS ${DB_PY} ${PREV_DEV_CC_BBA_DB}
+                    DEPENDS ${DB_PY} ${DEV_CONSTIDS_INC} ${PREV_DEV_CC_BBA_DB}
                     )
                 add_custom_command(OUTPUT ${DEV_CC_DB}
                     COMMAND bbasm --c ${BBASM_ENDIAN_FLAG} ${DEV_CC_BBA_DB} ${DEV_CC_DB}.new


cmake: Add memdisk archives whole

cmake: Add memdisk archives whole

--- etc/service.cmake
+++ etc/service.cmake
@@ -161,14 +161,16 @@
 set(MDCOUNTER 0)
 foreach(DISK ${MEMDISK})
   MATH(EXPR VAR "${MDCOUNTER}+1")
+  get_filename_component(DISK_RELPATH "${DISK}"
+                         REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
   add_custom_command(
     OUTPUT  memdisk.o
-    COMMAND python ${INCLUDEOS_ROOT}/includeos/memdisk/memdisk.py --file ${INCLUDEOS_ROOT}/includeos/memdisk/memdisk.asm ${DISK}
+    COMMAND python ${INCLUDEOS_ROOT}/includeos/memdisk/memdisk.py --file ${INCLUDEOS_ROOT}/includeos/memdisk/memdisk.asm ${DISK_RELPATH}
     COMMAND nasm -f elf ${INCLUDEOS_ROOT}/includeos/memdisk/memdisk.asm -o memdisk.o
   )
   add_library(disk${MDCOUNTER} STATIC memdisk.o)
   set_target_properties(disk${MDCOUNTER} PROPERTIES LINKER_LANGUAGE CXX)
-  target_link_libraries(service disk${MDCOUNTER})
+  target_link_libraries(service --whole-archive disk${MDCOUNTER} --no-whole-archive)
 endforeach()

 # all the OS and C/C++ libraries + crt end


cmake: Move stack protector value to service build script

--- etc/service.cmake
+++ etc/service.cmake
@@ -11,6 +11,9 @@

 set(CMAKE_ASM_NASM_OBJECT_FORMAT "elf")
 enable_language(ASM_NASM)
+
+# stack protector canary helps detect overflows
+string(RANDOM LENGTH 7 ALPHABET 0123456789 STACK_PROTECTOR_VALUE)

 # stackrealign is needed to guarantee 16-byte stack alignment for SSE
 # the compiler seems to be really dumb in this regard, creating a misaligned stack left and right


Use PATH instead of DIRECTORY for older cmakes.

--- luajit.cmake
+++ luajit.cmake
@@ -5,11 +5,11 @@
 # Redistribution and use of this file is allowed according to the terms of the MIT license.
 # Debugged and (now seriously) modified by Ronan Collobert, for Torch7

+cmake_minimum_required(VERSION 2.8.9)
+
 project(LuaJIT C ASM)

 set(CMAKE_BUILD_TYPE Release)
-
-CMAKE_POLICY(VERSION 2.6)

 SET(LUAJIT_DIR ${CMAKE_CURRENT_LIST_DIR}/luajit)

@@ -377,7 +377,7 @@
         COMMENT "Building Luajitted ${source_file}: ${generated_file}"
       )

-      get_filename_component(basedir ${generated_file} DIRECTORY)
+      get_filename_component(basedir ${generated_file} PATH)
       file(MAKE_DIRECTORY ${basedir})

       set(target_srcs ${target_srcs} ${generated_file})


Fixed fatal message in FIND_LINUX_LIBRARIES macro

--- macros.cmake
+++ macros.cmake
@@ -147,7 +147,7 @@
   execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS RESULT_VARIABLE RV_LIBS)

   if((NOT RV_CFLAGS EQUAL 0) OR (NOT RV_LDFLAGS EQUAL 0) OR (NOT RV_LIBS EQUAL 0))
-    message(FATAL_ERROR "Failed to find one of these libraries: ${libraries'")
+    message(FATAL_ERROR "Failed to find one of these libraries: ${libraries}'")
   endif()

   # Strip leading and trailing whitepspace.


Adding Github pages as an external data download repository.

Change-Id: Ifcd91dd7898b5b42ceda6eba6b0426909af9d36b

--- CMake/sitkExternalData.cmake
+++ CMake/sitkExternalData.cmake
@@ -37,10 +37,15 @@
   list(APPEND ExternalData_URL_TEMPLATES
     # Data published by MIDAS
     "https://placid.nlm.nih.gov/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
-    "http://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
+
+    # Data published on GitHub Pages
+    "https://simpleitk.github.io/SimpleITKExternalData/%(algo)/%(hash)"
+
+    # Data published by MIDAS
     "https://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"

     # Data published by developers using git-gerrit-push.
+    "https://insightsoftwareconsortium.github.io/ITKTestingData/%(algo)/%(hash)"
     "https://itk.org/files/ExternalData/%(algo)/%(hash)"
     )
 endif()


Update facts.cmake

Update facts.cmake

--- facts/facts.cmake
+++ facts/facts.cmake
@@ -391,6 +391,7 @@
 	common_flags()
 	common_linking(${_EXECUTABLE_NAME})
 	include_directories(${CMAKE_SOURCE_DIR})
+	include_directories(node_modules)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
 		include_directories(${INCLUDE_DIR})
 	endforeach()
@@ -430,6 +431,7 @@
 	common_flags()
 	common_linking(${_LIBRARY_NAME})
 	include_directories(${CMAKE_SOURCE_DIR})
+	include_directories(node_modules)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
 		include_directories(${INCLUDE_DIR})
 	endforeach()
@@ -465,6 +467,7 @@
 	common_linking(${_LIBRARY_NAME})
 	add_definitions(-D${_LIBRARY_NAME}_STATIC)
 	include_directories(${CMAKE_SOURCE_DIR})
+	include_directories(node_modules)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
 		include_directories(${INCLUDE_DIR})
 	endforeach()
@@ -497,6 +500,7 @@
 	set(_TEST_NAME ${_MAIN_NAME})
 	common_flags()
 	common_linking(${_TEST_NAME}_exe)
+	include_directories(node_modules)
 	foreach(INCLUDE_DIR ${CMAKI_INCLUDE_DIRS})
 		include_directories(${INCLUDE_DIR})
 	endforeach()


added cmake options

added cmake options

--- mlpack.cmake
+++ mlpack.cmake
@@ -33,6 +33,8 @@

     CONFIGURE_COMMAND   ${BUILDEM_ENV_STRING} ${CMAKE_COMMAND} ${mlpack_SRC_DIR}
         -DBUILD_SHARED_LIBS=ON
+        -DCMAKE_INSTALL_PREFIX=${BUILDEM_DIR}
+        -DCMAKE_PREFIX_PATH=${BUILDEM_DIR}

     BUILD_COMMAND       ${BUILDEM_ENV_STRING} make


fix PackageMaker config

fix PackageMaker config

--- cpack.cmake
+++ cpack.cmake
@@ -1,14 +1,14 @@
 set(SUFFIX_ARCH "")
 if(CPACK_GENERATOR STREQUAL "PackageMaker") # macosx (dmg)
 	set(SUFFIX_ARCH "_macosx")
-	file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/COPYING ${CMAKE_CURRENT_SOURCE_DIR}/README
+	file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/README
 		DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
-	file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/COPYING
-		${CMAKE_CURRENT_BINARY_DIR}/COPYING.txt)
+	file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/LICENSE
+		${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
 	file(RENAME ${CMAKE_CURRENT_BINARY_DIR}/README
 		${CMAKE_CURRENT_BINARY_DIR}/README.txt)
 	set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr/local)
-	set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/COPYING.txt)
+	set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt)
 	set(CPACK_RESOURCE_FILE_README ${CMAKE_CURRENT_BINARY_DIR}/README.txt)
 elseif(CPACK_GENERATOR STREQUAL "DEB") # linux (deb)
 	set(CPACK_PACKAGE_INSTALL_DIRECTORY /usr)


use correct target name for gflags-config.cmake

--- cmake/gflags.cmake
+++ cmake/gflags.cmake
@@ -28,8 +28,8 @@
 elseif("${gRPC_GFLAGS_PROVIDER}" STREQUAL "package")
   # Use "CONFIG" as there is no built-in cmake module for gflags.
   find_package(gflags REQUIRED CONFIG)
-  if(TARGET gflags::gflags)
-    set(_gRPC_GFLAGS_LIBRARIES gflags::gflags)
+  if(TARGET gflags)
+    set(_gRPC_GFLAGS_LIBRARIES gflags)
     set(_gRPC_GFLAGS_INCLUDE_DIR ${GFLAGS_INCLUDE_DIR})
   endif()
   set(_gRPC_FIND_GFLAGS "if(NOT gflags_FOUND)\n  find_package(gflags CONFIG)\nendif()")


Added a macro for installing headers

Added a macro for installing headers

--- build/macros.cmake
+++ build/macros.cmake
@@ -99,8 +99,7 @@
 	endif()
 endmacro()

-macro(install_shared _targ _head)
-	install_bin(${_targ})
+macro(install_headers _head)
 	if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
 		install(
 			FILES ${_head}
@@ -108,3 +107,7 @@
 		)
 	endif()
 endmacro()
+macro(install_shared _targ _head)
+	install_bin(${_targ})
+	install_headers(${_head})
+endmacro()


don't build neon-specific files on ios simulator

--- nnpack.cmake
+++ nnpack.cmake
@@ -96,8 +96,10 @@
     target_link_libraries( NNPACK PUBLIC cpufeatures )
   endif()
 elseif( iOS )
+  string( REPLACE ";" " " neon_source_files "${nnpack_neon_sources}" )
   set_target_properties( NNPACK PROPERTIES
     XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7] "$(OTHER_CFLAGS) -mfpu=neon-fp16"
     XCODE_ATTRIBUTE_OTHER_CFLAGS[arch=armv7s] "$(OTHER_CFLAGS) -mfpu=neon-fp16"
+    XCODE_ATTRIBUTE_EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*] "${neon_source_files}" # those sources fail to build for simulator
   )
 endif()


build package for quantal

build package for quantal

--- src/deb/package_details.cmake
+++ src/deb/package_details.cmake
@@ -14,12 +14,13 @@
 set(DEBSRC_BUILD_DEPENDS debhelper python git cmake libboost-dev "libqd0 | libqd2c2a" libqd-dev libboost-python-dev libgomp1 CACHE STRINGS "name")

 # we need to explicitly list the libboost-python versions here. why??
+# quantal has 1.49.0
 # precise has 1.48.0
 # oneiric has 1.46.1
 # natty/maverick has 1.42.0
 # lucid has 1.40.0
 set(DEBSRC_PACKAGE_DEPENDS python git cmake
-                "libboost-python1.48.0 | libboost-python1.46.1 | libboost-python1.42.0 | libboost-python1.40.0"
+                "libboost-python1.49.0 | libboost-python1.48.0 | libboost-python1.46.1 | libboost-python1.42.0 | libboost-python1.40.0"
                 "libqd0 | libqd2c2a" CACHE STRING "name")

 # however CPack wants dependencies as a single comma separated string!
@@ -46,7 +47,7 @@
 set(CPACK_DEBIAN_PACKAGE_PRIORITY optional CACHE STRING "name7")
 SET(CPACK_PACKAGE_VERSION ${MY_VERSION} CACHE STRING "name8")
 set(CPACK_DEBIAN_DISTRIBUTION_NAME ubuntu CACHE STRING "name9")
-set(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise CACHE STRING "name10")
+set(CPACK_DEBIAN_DISTRIBUTION_RELEASES lucid maverick natty oneiric precise quantal CACHE STRING "name10")
 # message(STATUS " CMAKE_SOURCE_DIR is = " ${CMAKE_SOURCE_DIR})
 if(${SRC_DIR} MATCHES "")
     set(CPACK_PACKAGE_DESCRIPTION_FILE ${SRC_DIR}/deb/debian_package_description.txt CACHE STRING "package description file")


updated Android toolchain to work also under Linux

git-svn-id: 202854949822ddacd36021ecd5ce27e3c9ec9cb0@624 dc34a4ac-3e42-4537-918b-2dea8b01751e

--- buildtools/android-toolchain.cmake
+++ buildtools/android-toolchain.cmake
@@ -5,10 +5,15 @@
 SET(PLATFORM_NDK_PATH "$ENV{ANDROID_NDK_ROOT}/platforms/android-8")
 SET(PLATFORM_SDK_PATH "$ENV{ANDROID_SDK_ROOT}/platforms/android-8")

+IF (CMAKE_HOST_UNIX)
+SET(PLATFORM_NAME linux-x86)
+ELSE()
 SET(PLATFORM_NAME windows)
+SET(EXE_SUFFIX .exe)
+ENDIF()

-CMAKE_FORCE_C_COMPILER("$ENV{ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${PLATFORM_NAME}/bin/arm-linux-androideabi-gcc.exe" GNU)
-CMAKE_FORCE_CXX_COMPILER("$ENV{ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${PLATFORM_NAME}/bin/arm-linux-androideabi-g++.exe" GNU)
+CMAKE_FORCE_C_COMPILER("$ENV{ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${PLATFORM_NAME}/bin/arm-linux-androideabi-gcc${EXE_SUFFIX}" GNU)
+CMAKE_FORCE_CXX_COMPILER("$ENV{ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/prebuilt/${PLATFORM_NAME}/bin/arm-linux-androideabi-g++${EXE_SUFFIX}" GNU)

 SET(CMAKE_FIND_ROOT_PATH "$ENV{ANDROID_NDK_ROOT}/toolchains/arm-linux-androideabi-4.4.3/${PLATFORM_NAME}")

@@ -16,8 +21,13 @@
 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

-INCLUDE_DIRECTORIES(${PLATFORM_NDK_PATH}/arch-arm/usr/include)
+INCLUDE_DIRECTORIES(
+${PLATFORM_NDK_PATH}/arch-arm/usr/include
+$ENV{ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/include
+$ENV{ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include
+)

+SET(LINK_DIR ${PLATFORM_NDK_PATH}/arch-arm/usr/lib)
 SET(CMAKE_SHARED_LINKER_FLAGS
--Wl,--no-undefined
-)+"-Wl,--no-undefined --sysroot=${PLATFORM_NDK_PATH}/arch-arm -L${LINK_DIR} -L$ENV{ANDROID_NDK_ROOT}/sources/cxx-stl/gnu-libstdc++/libs/armeabi -lgnustl_shared"
+)


fix execute permission on configure scirpt using cmake file copy

--- SuperBuild/CMake/Package_Macro.cmake
+++ SuperBuild/CMake/Package_Macro.cmake
@@ -40,8 +40,14 @@

   set(PKG_OUTPUT_DIR "${PACKAGE_INSTALLDIR}/${PACKAGE_OUTDIR}")
   configure_file(${SETUP_SCRIPT_SRC}
-    ${PACKAGE_INSTALLDIR}/${PACKAGE_OUTDIR}/pkgsetup @ONLY)
+    ${CMAKE_BINARY_DIR}/pkgsetup @ONLY)

+  file(COPY ${CMAKE_BINARY_DIR}/pkgsetup
+    DESTINATION ${PACKAGE_OUTDIR}
+    FILE_PERMISSIONS
+      OWNER_READ OWNER_WRITE OWNER_EXECUTE
+      GROUP_READ GROUP_EXECUTE
+      WORLD_READ WORLD_EXECUTE)

 endmacro(superbuild_package)


Relax glob path to find libffi on CentOS

--- projects/unix/tomviz.bundle.cmake
+++ projects/unix/tomviz.bundle.cmake
@@ -113,8 +113,7 @@

 # Modern Linux (such as Ubuntu 20.04) comes with libffi7 instead of libffi6
 # For now, install libffi so it isn't missing.
-# FIXME: this hard-coded path may cause issues if we change build computers
-file(GLOB libffi_files "/usr/lib/x86_64-linux-gnu/libffi.so*")
+file(GLOB_RECURSE libffi_files FOLLOW_SYMLINKS "/usr/**/libffi.so*")
 install(FILES ${libffi_files} DESTINATION "lib")

 add_test(GenerateTomvizPackage


Remove dev warning on non Visual Studio generators

--- cmake/Modules/SampPluginTest.cmake
+++ cmake/Modules/SampPluginTest.cmake
@@ -40,14 +40,16 @@

 	get_target_property(PLUGIN_PATH ${ARG_TARGET} LOCATION)

-	list(FIND CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" index)
-	if(MSVC_IDE AND CMAKE_BUILD_TYPE AND NOT index EQUAL -1)
-		string(REPLACE "$(Configuration)" ${CMAKE_BUILD_TYPE}
-		       PLUGIN_PATH ${PLUGIN_PATH})
-	else()
-		message(AUTHOR_WARNING "CMAKE_BUILD_TYPE must be set to one of the "
-		                       "existing build configurations in order for "
-		                       "the tests to work")
+	if(MSVC_IDE)
+		list(FIND CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" index)
+		if(CMAKE_BUILD_TYPE AND NOT index EQUAL -1)
+			string(REPLACE "$(Configuration)" ${CMAKE_BUILD_TYPE}
+				   PLUGIN_PATH ${PLUGIN_PATH})
+		else()
+			message(AUTHOR_WARNING "CMAKE_BUILD_TYPE must be set to one of the "
+								   "existing build configurations in order for "
+								   "the tests to work")
+		endif()
 	endif()

 	list(APPEND arguments


Forced static libraries.

Forced static libraries.

--- cmake/setup_cached_variables.cmake
+++ cmake/setup_cached_variables.cmake
@@ -167,7 +167,7 @@
   )
 MARK_AS_ADVANCED(DEAL_II_SETUP_COVERAGE)

-SET(BUILD_SHARED_LIBS "ON" CACHE BOOL
+SET(BUILD_SHARED_LIBS "OFF" CACHE BOOL
   "Build a shared library"
   )


fix bug in FindGMP.cmake

fix bug in FindGMP.cmake

--- Numerics/cmake/FindGMP.cmake
+++ Numerics/cmake/FindGMP.cmake
@@ -10,7 +10,7 @@
 #
 # Note FP : see http://www.cmake.org/Wiki/CMake:How_To_Find_Libraries
 INCLUDE(FindPackageHandleStandardArgs)
-
+find_package(PkgConfig)
 include(LibFindMacros)

 # Use pkg-config to get hints about paths


Ignore weak-vtables warning because NamedEntity.h doesn't have any virtual methods.

--- cmake/common.cmake
+++ cmake/common.cmake
@@ -102,6 +102,7 @@
       -Wno-missing-prototypes
       -Wno-padded
       -Wno-undefined-func-template
+      -Wno-weak-vtables # Applying this because NamedEntity.h doesn't define any virtual methods other than the destructor.
     )

     if (${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 7.0.0)


Bug #12598603 HAVE COLLECTIONS FILES IN FEATURE TREES AUTO-APPENDED TO COMMON FILES Do this in the common plugin.cmake but only if running in PB2   (If done in manual builds it would create a bzr diff)

--- cmake/plugin.cmake
+++ cmake/plugin.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -26,6 +26,23 @@
 # [RECOMPILE_FOR_EMBEDDED]
 # [LINK_LIBRARIES lib1...libN]
 # [DEPENDENCIES target1...targetN]
+
+# Append collections files for the plugin to the common files
+# Make sure we don't copy twice if running cmake again
+
+MACRO(PLUGIN_APPEND_COLLECTIONS plugin)
+  SET(fcopied "${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/FilesCopied")
+  IF(EXISTS ${fcopied})
+    RETURN()
+  ENDIF()
+  FILE(GLOB collections ${CMAKE_CURRENT_SOURCE_DIR}/tests/collections/*)
+  FOREACH(cfile ${collections})
+    FILE(READ ${cfile} contents)
+    GET_FILENAME_COMPONENT(fname ${cfile} NAME)
+    FILE(APPEND ${CMAKE_SOURCE_DIR}/mysql-test/collections/${fname} "${contents}")
+    FILE(APPEND ${fcopied} "${fname}\n")
+  ENDFOREACH()
+ENDMACRO()

 MACRO(MYSQL_ADD_PLUGIN)
   MYSQL_PARSE_ARGUMENTS(ARG
@@ -180,6 +197,10 @@
     # Install dynamic library
     MYSQL_INSTALL_TARGETS(${target} DESTINATION ${INSTALL_PLUGINDIR} COMPONENT Server)
     INSTALL_DEBUG_TARGET(${target} DESTINATION ${INSTALL_PLUGINDIR}/debug)
+    # For internal testing in PB2, append collections files
+    IF(DEFINED ENV{PB2WORKDIR})
+      PLUGIN_APPEND_COLLECTIONS(${plugin})
+    ENDIF()
   ELSE()
     IF(WITHOUT_${plugin})
       # Update cache variable


more warnings

more warnings

--- mk/CompilerFlags.cmake
+++ mk/CompilerFlags.cmake
@@ -14,6 +14,8 @@
     message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
 endif()

+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wpedantic")
+
 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Weverything -Wc++98-compat")
 endif()


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 07)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/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   16)
+SET(KWSYS_DATE_STAMP_DAY   17)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 02)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 03)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/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   21)
+SET(KWSYS_DATE_STAMP_DAY   22)


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/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   19)
+SET(KWSYS_DATE_STAMP_DAY   20)


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 06)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


STYLE: Nightly Date Stamp

STYLE: Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 11)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 05)

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


KWSys Nightly Date Stamp

KWSys Nightly Date Stamp

--- Utilities/kwsys/kwsysDateStamp.cmake
+++ Utilities/kwsys/kwsysDateStamp.cmake
@@ -7,4 +7,4 @@
 SET(KWSYS_DATE_STAMP_MONTH 09)

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


Added rust and cargo to build dependencies.

--- external/netinfo/netinfo.cmake
+++ external/netinfo/netinfo.cmake
@@ -1,3 +1,13 @@
+find_program(RUSTC_EXECUTABLE rustc)
+if(${RUSTC_EXECUTABLE} MATCHES "NOTFOUND")
+    message( FATAL_ERROR "You haven't rust, please install it!" )
+endif()
+
+find_program(CARGO_EXECUTABLE cargo)
+if(${CARGO_EXECUTABLE} MATCHES "NOTFOUND")
+    message( FATAL_ERROR "You haven't cargo, please install it!" )
+endif()
+
 include(ExternalProject)

 ExternalProject_Add(


r10003/sofa : Woops... fixed CGAL in Windows too

Former-commit-id: 09c2c7eeb10a7f2382d9a210661fad1e3f3dbca5

--- cmake/FindCGAL.cmake
+++ cmake/FindCGAL.cmake
@@ -82,11 +82,11 @@
 if( NOT CGAL_FOUND)
   # try to find the paths manually...
   find_path(CGAL_DIR NAMES include/CGAL/Polyhedron_3.h)
-  find_library(CGAL_LIBRARIES NAMES CGAL)
-  if(EXISTS "${CGAL_DIR}/include/CGAL/Polyhedron_3.h" AND EXISTS ${CGAL_LIBRARIES})
+  find_library(CGAL_LIBRARY NAMES CGAL)
+  if(EXISTS "${CGAL_DIR}/include/CGAL/Polyhedron_3.h" AND EXISTS ${CGAL_LIBRARY})
     set(CGAL_FOUND TRUE)
-    message(STATUS "CGAL found: ${CGAL_LIBRARIES} ${CGAL_DIR}")
-    mark_as_advanced(CGAL_DIR CGAL_LIBRARIES)
+    message(STATUS "CGAL found: ${CGAL_LIBRARY} ${CGAL_DIR}")
+    mark_as_advanced(CGAL_DIR CGAL_LIBRARY)

   endif()
 endif()


Crazyeddie dynamic preprocessor fix

Crazyeddie dynamic preprocessor fix

--- cmake/FindGLFW.cmake
+++ cmake/FindGLFW.cmake
@@ -11,8 +11,8 @@
 if (WIN32)
     find_library(GLFW_LIB_STATIC NAMES glfw PATH_SUFFIXES static)
     find_library(GLFW_LIB_STATIC_DBG NAMES glfw_d PATH_SUFFIXES static)
-    set( GLFW_DEFINITIONS_STATIC "GLFW_STATIC" CACHE STRING "preprocessor definitions" )
-    mark_as_advanced(GLFW_DEFINITIONS_STATIC GLFW_LIB_STATIC GLFW_LIB_STATIC_DBG)
+    set( GLFW_DEFINITIONS_DYNAMIC "GLFW_DLL" CACHE STRING "preprocessor definitions" )
+    mark_as_advanced(GLFW_DEFINITIONS_DYNAMIC GLFW_LIB_STATIC GLFW_LIB_STATIC_DBG)
 endif()

 find_package_handle_standard_args(GLFW DEFAULT_MSG GLFW_LIB GLFW_H_PATH)


find static NCCL

find static NCCL

--- cmake/FindNCCL.cmake
+++ cmake/FindNCCL.cmake
@@ -16,10 +16,19 @@
     /usr/local/cuda/lib64
     $ENV{NCCL_DIR}/lib64
     $ENV{CUDA_TOOLKIT_ROOT_DIR}/lib64
+    /usr/local/cuda/lib
+    $ENV{NCCL_DIR}/lib
+    $ENV{CUDA_TOOLKIT_ROOT_DIR}/lib
 )

 find_path(NCCL_INCLUDE_DIR NAMES nccl.h PATHS ${NCCL_INC_PATHS})
-find_library(NCCL_LIBRARIES NAMES nccl PATHS ${NCCL_LIB_PATHS})
+
+if (USE_STATIC_LIBS)
+  message(STATUS "Trying to find static NCCL library")
+  find_library(NCCL_LIBRARIES NAMES libnccl_static.a PATHS ${NCCL_LIB_PATHS})
+else (USE_STATIC_LIBS)
+  find_library(NCCL_LIBRARIES NAMES nccl PATHS ${NCCL_LIB_PATHS})
+endif (USE_STATIC_LIBS)

 include(FindPackageHandleStandardArgs)
 find_package_handle_standard_args(NCCL DEFAULT_MSG NCCL_INCLUDE_DIR NCCL_LIBRARIES)


Correct indentation, remove trailing spaces.

--- cmake/FindROOT.cmake
+++ cmake/FindROOT.cmake
@@ -188,37 +188,37 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with AliEn support: ${error}")
     endif(error)
-
+
     #if defined
     if(ROOT_HASALIEN)
         string(STRIP "${ROOT_HASALIEN}" ROOT_HASALIEN)
         if(ROOT_HASALIEN STREQUAL "yes")
             if(ALIEN)
-            add_definitions(-DWITHALIEN)
-
-            # AliEn might bring some system libraries, we need to use them
-            if(EXISTS "${ALIEN}/lib")
-                link_directories(${ALIEN}/lib)
-            endif()
-
-            # api/lib should always exists
-            if(EXISTS "${ALIEN}/api/lib")
-                link_directories(${ALIEN}/api/lib)
-            endif()
-
-            # include for AliEn
-            if(EXISTS "${ALIEN}/include")
-                include_directories(SYSTEM ${ALIEN}/include)
-            endif()
-
-            # api/include always exists
-            if(EXISTS "${ALIEN}/api/include")
-                include_directories(SYSTEM ${ALIEN}/api/include)
-            endif()
-
-            set(ROOT_HASALIEN TRUE)
+                add_definitions(-DWITHALIEN)
+
+                # AliEn might bring some system libraries, we need to use them
+                if(EXISTS "${ALIEN}/lib")
+                    link_directories(${ALIEN}/lib)
+                endif()
+
+                # api/lib should always exists
+                if(EXISTS "${ALIEN}/api/lib")
+                    link_directories(${ALIEN}/api/lib)
+                endif()
+
+                # include for AliEn
+                if(EXISTS "${ALIEN}/include")
+                    include_directories(SYSTEM ${ALIEN}/include)
+                endif()
+
+                # api/include always exists
+                if(EXISTS "${ALIEN}/api/include")
+                    include_directories(SYSTEM ${ALIEN}/api/include)
+                endif()
+
+                set(ROOT_HASALIEN TRUE)
             else(ALIEN)
-            message(FATAL_ERROR "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
+                message(FATAL_ERROR "ROOT was built with AliEn support but no AliEn installation found. Please set \"ALIEN\" to point to your AliEn installation.")
             endif(ALIEN)
         else()
             set(ROOT_HASALIEN FALSE)
@@ -230,7 +230,7 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with xml support: ${error}")
     endif(error)
-
+
     # if defined
     if(ROOT_HASXML)
         string(STRIP "${ROOT_HASXML}" ROOT_HASXML)
@@ -247,7 +247,7 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with monalisa support: ${error}")
     endif(error)
-
+
     # if defined
     if(ROOT_HASMONALISA)
         string(STRIP "${ROOT_HASMONALISA}" ROOT_HASMONALISA)
@@ -263,7 +263,7 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with ldap support: ${error}")
     endif(error)
-
+
     # if defined
     if(ROOT_HASLDAP)
         string(STRIP "${ROOT_HASLDAP}" ROOT_HASLDAP)
@@ -279,7 +279,7 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with OpenGL support: ${error}")
     endif(error)
-
+
     if(ROOT_HASOPENGL)
         string(STRIP "${ROOT_HASOPENGL}" ROOT_HASOPENGL)
         if(ROOT_HASOPENGL STREQUAL "yes")
@@ -294,7 +294,7 @@
     if(error)
         message(FATAL_ERROR "Error checking if ROOT was built with VCt: ${error}")
     endif(error)
-
+
     if(ROOT_HASVC)
         string(STRIP "${ROOT_HASVC}" ROOT_HASVC)
         if(ROOT_HASVC STREQUAL "yes")
@@ -326,19 +326,19 @@
         find_package(LibXml2)

         if(LIBXML2_FOUND)
-
+
             # adding SSL
             find_package(OpenSSL)
-
+
             if(OPENSSL_FOUND)
                 file(GLOB _extraroot "${ROOTSYS}/montercarlo/vmc/src/*.o" "${ROOTSYS}/tree/treeplayer/src/*.o" "${ROOTSYS}/io/xmlparser/src/*.o" "${ROOTSYS}/math/minuit2/src/*.o")
                 add_library(RootExtra STATIC ${_extraroot})
                 set_target_properties(RootExtra PROPERTIES COMPILE_FLAGS "${LIBXML2_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR}")
                 set_target_properties(RootExtra PROPERTIES LINKER_LANGUAGE CXX)
                 target_link_libraries(RootExtra ${ROOT_LIBDIR}/libfreetype.a ${ROOT_LIBDIR}/libpcre.a ${ROOT_LIBDIR}/liblzma.a ${LIBXML2_LIBRARIES} ${OPENSSL_LIBRARIES})
-		install(TARGETS RootExtra
-		  ARCHIVE DESTINATION lib
-		  LIBRARY DESTINATION lib)
+                install(TARGETS RootExtra
+                    ARCHIVE DESTINATION lib
+                    LIBRARY DESTINATION lib)
             else()
                 message(FATAL_ERROR "OpenSSL not found. Coould not generate the static RootExtra. Please install Openssl")
             endif()


erthink-cmake: unblacklised builtin MSVC-2019 CMake.

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -17,9 +17,9 @@
 cmake_policy(PUSH)
 cmake_policy(VERSION 3.8.2)

-if (CMAKE_VERSION MATCHES ".*MSVC.*")
+if (CMAKE_VERSION MATCHES ".*MSVC.*" AND CMAKE_VERSION VERSION_LESS 3.16)
   message(FATAL_ERROR "CMake from MSVC kit is unfit! "
-    "Please use the original CMake from https://cmake.org/download/")
+    "Please use MSVC2019 with modern CMake the original CMake from https://cmake.org/download/")
 endif()

 if (NOT (CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED))


enable warnings when using gfortran

enable warnings when using gfortran

--- cmake/compiler.cmake
+++ cmake/compiler.cmake
@@ -1 +1,5 @@
 set(CMAKE_BUILD_TYPE_INIT "Release")
+
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
+  set(CMAKE_Fortran_FLAGS_INIT "-Wall -Wextra -Wconversion")
+endif()


Fixing suffix configure_file syntax

Fixing suffix configure_file syntax

--- cmake/config.h.cmake
+++ cmake/config.h.cmake
@@ -36,12 +36,12 @@
 /* Math libraries */
 #define EL_MATH_LIBS "@MATH_LIBS@"
 #cmakedefine EL_HAVE_BLAS_SUFFIX
-#cmakedefine EL_BLAS_SUFFIX
+#define EL_BLAS_SUFFIX @EL_BLAS_SUFFIX@
 #cmakedefine EL_HAVE_LAPACK_SUFFIX
-#cmakedefine EL_LAPACK_SUFFIX
+#define EL_LAPACK_SUFFIX @EL_LAPACK_SUFFIX@
 #cmakedefine EL_HAVE_SCALAPACK
 #cmakedefine EL_HAVE_SCALAPACK_SUFFIX
-#cmakedefine EL_SCALAPACK_SUFFIX
+#define EL_SCALAPACK_SUFFIX @EL_SCALAPACK_SUFFIX@
 #cmakedefine EL_HAVE_FLA_BSVD
 #cmakedefine EL_HAVE_QUAD
 #cmakedefine EL_HAVE_QUADMATH


[CMake] Remove -Wno-maybe-uninitialized from passthrough vars.

Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/
buildbot.

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

--- cmake/Modules/AddCompilerRT.cmake
+++ cmake/Modules/AddCompilerRT.cmake
@@ -532,6 +532,9 @@
   string(REPLACE ";" " " FLAGS_STRING "${LIBCXX_CFLAGS}")
   set(LIBCXX_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS_STRING}")
   set(LIBCXX_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS_STRING}")
+  string(REPLACE "-Wno-maybe-uninitialized" "" LIBCXX_C_FLAGS "${LIBCXX_C_FLAGS}")
+  string(REPLACE "-Wno-maybe-uninitialized" "" LIBCXX_CXX_FLAGS "${LIBCXX_CXX_FLAGS}")
+

   string(REPLACE "-Wl,-z,defs" "" LIBCXX_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
   string(REPLACE "-Wl,-z,defs" "" LIBCXX_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}")


Implement and use some useful convenience variables to keep track of
and enforce consistent version numbers for Tcl/Tk and iTcl/iTk.

svn path=/trunk/; revision=12633

--- cmake/build_projects/tcl/bp.cmake
+++ cmake/build_projects/tcl/bp.cmake
@@ -55,8 +55,15 @@
 # This can be safely done only after above includes.
 set(BP_PACKAGE tcl)

+# These variables are also used by tk and itk (and accessible to those
+# build configurations because they both depend on this one in any case).
+set(TCL_TK_VERSION 8.6.1)
+string(REGEX REPLACE "\\.[0-9]$" "" TCL_TK_LIBVERSION ${TCL_TK_VERSION})
+set(ITCL_ITK_VERSION 4.0.0)
+set(ITCL_ITK_LIBVERSION ${ITCL_ITK_VERSION})
+
 # Data that is related to downloads.
-set(${BP_PACKAGE}_URL  http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz)
+set(${BP_PACKAGE}_URL http://downloads.sourceforge.net/project/tcl/Tcl/${TCL_TK_VERSION}/tcl${TCL_TK_VERSION}-src.tar.gz)
 set(${BP_PACKAGE}_DOWNLOAD_HASH_TYPE MD5)
 set(${BP_PACKAGE}_DOWNLOAD_HASH aae4b701ee527c6e4e1a6f9c7399882e)

@@ -110,8 +117,8 @@
   ${EP_BASE}/Stamp/build_${BP_PACKAGE}/build_${BP_PACKAGE}-install
   COMMAND echo "Install-tree fixups"
   COMMAND ${ENV_EXECUTABLE} PATH=${BP_PATH} ${BP_PARALLEL_MAKE_COMMAND} install-private-headers
-  COMMAND ${LN_EXECUTABLE} -v -sf tclsh8.6 ${BP_CMAKE_INSTALL_PREFIX}/bin/tclsh
-  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/libtcl8.6.so
+  COMMAND ${LN_EXECUTABLE} -v -sf tclsh${TCL_TK_LIBVERSION} ${BP_CMAKE_INSTALL_PREFIX}/bin/tclsh
+  COMMAND ${CHMOD_EXECUTABLE} -v ${SO_NUMERICAL_PERMISSIONS} ${BP_CMAKE_INSTALL_PREFIX}/lib/libtcl${TCL_TK_LIBVERSION}.so
   APPEND
   )


Make catkin_install_python code a little clearer (#1054)

* file -> source_file, rewritten_file

Signed-off-by: Shane Loretz <7fde345e8e2e22c78a1570a4807e4629866dc7de@osrfoundation.org>

* Add comments

Signed-off-by: Shane Loretz <7fde345e8e2e22c78a1570a4807e4629866dc7de@osrfoundation.org>

--- cmake/catkin_install_python.cmake
+++ cmake/catkin_install_python.cmake
@@ -19,14 +19,14 @@
   if(NOT ARG_DESTINATION)
     message(FATAL_ERROR "catkin_install_python() called without required DESTINATION argument.")
   endif()
-  foreach(file ${ARG_UNPARSED_ARGUMENTS})
-    if(NOT IS_ABSOLUTE ${file})
-      set(file "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
+  foreach(source_file ${ARG_UNPARSED_ARGUMENTS})
+    if(NOT IS_ABSOLUTE ${source_file})
+      set(source_file "${CMAKE_CURRENT_SOURCE_DIR}/${source_file}")
     endif()
-    if(EXISTS ${file})
-      stamp(${file})
+    if(EXISTS ${source_file})
+      stamp(${source_file})
       # read file and check shebang line
-      file(READ ${file} data)
+      file(READ ${source_file} data)
       set(regex "^#!/([^\r\n]+)/env python([\r\n])")
       string(REGEX MATCH "${regex}" shebang_line "${data}")
       string(LENGTH "${shebang_line}" length)
@@ -35,26 +35,31 @@
         # write modified file with modified shebang line
         get_filename_component(python_name ${PYTHON_EXECUTABLE} NAME)
         string(REGEX REPLACE "${regex}" "#!/\\1/env ${python_name}\\2" data "${data}")
-        get_filename_component(filename ${file} NAME)
-        set(file "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace")
-        file(MAKE_DIRECTORY ${file})
-        set(file "${file}/${filename}")
-        file(WRITE ${file} "${data}")
+        get_filename_component(filename ${source_file} NAME)
+        set(rewritten_file "${CMAKE_CURRENT_BINARY_DIR}/catkin_generated/installspace")
+        file(MAKE_DIRECTORY ${rewritten_file})
+        set(rewritten_file "${rewritten_file}/${filename}")
+        file(WRITE ${rewritten_file} "${data}")
+      else()
+        # Shebang did not match, install file unmodified
+        set(rewritten_file "${source_file}")
       endif()
       # install (modified) file to destination
       set(optional_flag "")
       if(ARG_OPTIONAL)
         set(optional_flag "OPTIONAL")
       endif()
-      install(PROGRAMS "${file}" DESTINATION "${ARG_DESTINATION}" ${optional_flag})
+      # Install copy of file with re-written shebang to install space
+      install(PROGRAMS "${rewritten_file}" DESTINATION "${ARG_DESTINATION}" ${optional_flag})

-      get_filename_component(name "${file}" NAME)
+      # Hook for a platform specific wrapper around the modified python script
+      get_filename_component(name "${rewritten_file}" NAME)
       add_python_executable(SCRIPT_NAME ${name}
         # prefix with project name to avoid collisions across packages
         TARGET_NAME ${PROJECT_NAME}_${name}_exec_install_python
         DESTINATION "${ARG_DESTINATION}")
     elseif(NOT ARG_OPTIONAL)
-      message(FATAL_ERROR "catkin_install_python() called with non-existing file '${file}'.")
+      message(FATAL_ERROR "catkin_install_python() called with non-existing file '${source_file}'.")
     endif()
   endforeach()
 endfunction()


Removed left over copy and paste from an earlier prototype.

--- cmake/modules/FindLibCrypto.cmake
+++ cmake/modules/FindLibCrypto.cmake
@@ -1,4 +1,4 @@
-# - Try to find boringssl include dirs and libraries
+# - Try to find LibCrypto include dirs and libraries
 #
 # Usage of this module as follows:
 #


Add back lldb-framework-headers target

Add back lldb-framework-headers target

In r338058 we removed the target `lldb-framework-headers`, which mean
lldb-framework no longer depended on `framework_headers`, so they never
actually got generated. This is a partial revert of r338058: I added
back the lldb-framework-headers target, but the framework-header-fix.sh
script still runs on the copied headers.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@338074 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 7ec21c24c7d9a10bf5836561d5fee47f2883ebd3)

--- cmake/modules/LLDBFramework.cmake
+++ cmake/modules/LLDBFramework.cmake
@@ -12,6 +12,8 @@
                      COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
   list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
 endforeach()
+
+add_custom_target(lldb-framework-headers DEPENDS ${framework_headers})

 add_custom_command(TARGET lldb-framework POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
@@ -39,4 +41,5 @@
   PUBLIC_HEADER "${framework_headers}")

 add_dependencies(lldb-framework
+  lldb-framework-headers
   lldb-suite)


boards: qemu_x86: enable icount mode

boards: qemu_x86: enable icount mode

Enable icount mode for qemu_x86 platform, The icount shift value is
selectd based on cpu clock frequency of this platform. The virtual
cpu will execute one instruction every 2^shift ns of virtual time.

Signed-off-by: Wentong Wu <a92ffab6ab5ff780cf36418e13a69a97399df0f5@intel.com>

--- boards/x86/qemu_x86/board.cmake
+++ boards/x86/qemu_x86/board.cmake
@@ -11,6 +11,9 @@
   set(QEMU_CPU_TYPE_${ARCH} qemu64,+x2apic)
 else()
   set(QEMU_CPU_TYPE_${ARCH} qemu32,+nx,+pae)
+if(CONFIG_QEMU_ICOUNT)
+  list(APPEND QEMU_EXTRA_FLAGS -icount shift=5,align=off,sleep=off -rtc clock=vm)
+endif()
 endif()

 set(QEMU_FLAGS_${ARCH}


build: Path workbench depends on Mesh workbench

--- cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake
+++ cMake/FreeCAD_Helpers/CheckInterModuleDependencies.cmake
@@ -29,7 +29,7 @@
     REQUIRES_MODS(BUILD_FLAT_MESH          BUILD_MESH_PART)
     REQUIRES_MODS(BUILD_OPENSCAD           BUILD_MESH_PART BUILD_DRAFT)
     REQUIRES_MODS(BUILD_PART_DESIGN        BUILD_SKETCHER)
-    REQUIRES_MODS(BUILD_PATH               BUILD_PART BUILD_ROBOT)
+    REQUIRES_MODS(BUILD_PATH               BUILD_PART BUILD_MESH, BUILD_ROBOT)
     REQUIRES_MODS(BUILD_RAYTRACING         BUILD_PART)
     REQUIRES_MODS(BUILD_REVERSEENGINEERING BUILD_PART BUILD_MESH)
     REQUIRES_MODS(BUILD_ROBOT              BUILD_PART)


In which our hero updated the cmake modules

--- cmake/FindCSAFESTRING.cmake
+++ cmake/FindCSAFESTRING.cmake
@@ -1,10 +1,17 @@
+include(FindPackageHandleStandardArgs)
+
 find_path(CSAFESTRING_INCLUDE_DIR csafestring.h
         HINTS
         include
         )
+mark_as_advanced(CSAFESTRING_INCLUDE_DIR)

 FIND_LIBRARY(CSAFESTRING_LIBRARIES
         NAMES csafestring
         HINTS
         PATH_SUFFIXES lib64 lib
-        )+        )
+mark_as_advanced(CSAFESTRING_LIBRARIES)
+
+find_package_handle_standard_args(CSAFESTRING
+        REQUIRED_VARS CSAFESTRING_INCLUDE_DIR CSAFESTRING_LIBRARIES)


Only conflict with packages corresponding to modules that are built

--- cmake/OpenCVPackaging.cmake
+++ cmake/OpenCVPackaging.cmake
@@ -120,8 +120,10 @@

 foreach(module calib3d contrib core features2d flann gpu highgui imgproc legacy
                ml objdetect ocl photo stitching superres ts video videostab)
-  list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4")
-  list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev")
+  if(HAVE_opencv_${module})
+    list(APPEND STD_OPENCV_LIBS "libopencv-${module}2.4")
+    list(APPEND STD_OPENCV_DEV "libopencv-${module}-dev")
+  endif()
 endforeach()

 string(REPLACE ";" ", " CPACK_COMPONENT_LIBS_CONFLICTS "${STD_OPENCV_LIBS}")


Upgrade to binaryen 1.37.35

Upgrade to binaryen 1.37.35

ProjectBinaryen.cmake is updated with 604985b from Hera

--- cmake/ProjectBinaryen.cmake
+++ cmake/ProjectBinaryen.cmake
@@ -4,32 +4,57 @@
 set(ProjectBinaryenIncluded TRUE)

 include(ExternalProject)
+include(GNUInstallDirs)

 if(MSVC)
     # Overwrite build and install commands to force Release build on MSVC.
     set(build_command BUILD_COMMAND cmake --build <BINARY_DIR> --config Release)
     set(install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
+elseif(CMAKE_GENERATOR STREQUAL Ninja)
+    # For Ninja we have to pass the number of jobs from CI environment.
+    # Otherwise it will go crazy and run out of memory.
+    if($ENV{BUILD_PARALLEL_JOBS})
+        set(build_command BUILD_COMMAND cmake --build <BINARY_DIR> -- -j $ENV{BUILD_PARALLEL_JOBS})
+        message(STATUS "Ninja $ENV{BUILD_PARALLEL_JOBS}")
+    endif()
 endif()

+set(prefix ${CMAKE_BINARY_DIR}/deps)
+set(source_dir ${prefix}/src/binaryen)
+set(binary_dir ${prefix}/src/binaryen-build)
+# Use source dir because binaryen only installs single header with C API.
+set(binaryen_include_dir ${source_dir}/src)
+set(binaryen_library ${prefix}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}binaryen${CMAKE_STATIC_LIBRARY_SUFFIX})
+# Include also other static libs needed:
+set(binaryen_other_libraries
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}wasm${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}asmjs${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}passes${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfg${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ir${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}emscripten-optimizer${CMAKE_STATIC_LIBRARY_SUFFIX}
+    ${binary_dir}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}support${CMAKE_STATIC_LIBRARY_SUFFIX}
+)
+
 ExternalProject_Add(binaryen
-    PREFIX deps
-    DOWNLOAD_NAME binaryen-1.37.28.tar.gz
-    DOWNLOAD_DIR ${CMAKE_SOURCE_DIR}/deps/downloads
-    URL https://github.com/WebAssembly/binaryen/archive/1.37.28.tar.gz
-    URL_HASH SHA256=90395016042d187c9be876eb18290ef839d55b58643f654b10aa9d5c98fc8703
+    PREFIX ${prefix}
+    DOWNLOAD_NAME binaryen-1.37.35.tar.gz
+    DOWNLOAD_DIR ${prefix}/downloads
+    SOURCE_DIR ${source_dir}
+    BINARY_DIR ${binary_dir}
+    URL https://github.com/WebAssembly/binaryen/archive/1.37.35.tar.gz
+    URL_HASH SHA256=19439e41dc576446eaae0c4a8e07d4cd4c40aea7dfb0a6475b925686852f8006
     CMAKE_ARGS
     -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
     -DCMAKE_BUILD_TYPE=Release
     -DBUILD_STATIC_LIB=ON
     ${build_command}
     ${install_command}
-    )
+    BUILD_BYPRODUCTS ${binaryen_library} ${binaryen_other_libraries}
+)

-ExternalProject_Get_Property(binaryen INSTALL_DIR BINARY_DIR SOURCE_DIR)
 add_library(binaryen::binaryen STATIC IMPORTED)
-set(binaryen_library ${INSTALL_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}binaryen${CMAKE_STATIC_LIBRARY_SUFFIX})
-# Use source dir because binaryen only installs single header with C API.
-set(binaryen_include_dir ${SOURCE_DIR}/src)
+
 file(MAKE_DIRECTORY ${binaryen_include_dir})  # Must exist.
 set_target_properties(
     binaryen::binaryen
@@ -37,18 +62,8 @@
     IMPORTED_CONFIGURATIONS Release
     IMPORTED_LOCATION_RELEASE ${binaryen_library}
     INTERFACE_INCLUDE_DIRECTORIES ${binaryen_include_dir}
-    INTERFACE_LINK_LIBRARIES
-    # Include also other static libs needed:
-    "${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}wasm${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}asmjs${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}passes${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfg${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ir${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}emscripten-optimizer${CMAKE_STATIC_LIBRARY_SUFFIX};\
-${BINARY_DIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}support${CMAKE_STATIC_LIBRARY_SUFFIX}"
+    INTERFACE_LINK_LIBRARIES "${binaryen_other_libraries}"
+
 )

 add_dependencies(binaryen::binaryen binaryen)
-unset(INSTALL_DIR)
-unset(SOURCE_DIR)
-unset(BUILD_DIR)


falling back to eigen 3.2 until http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1445 is fixed

--- cmake/external/Eigen3.cmake
+++ cmake/external/Eigen3.cmake
@@ -6,8 +6,11 @@
 	Eigen3
 	PREFIX ${CMAKE_BINARY_DIR}/Eigen3
 	DOWNLOAD_DIR ${THIRD_PARTY_DIR}/Eigen3
-	URL https://bitbucket.org/eigen/eigen/get/3.3.4.tar.bz2
-	URL_MD5 a7aab9f758249b86c93221ad417fbe18
+	URL https://bitbucket.org/eigen/eigen/get/3.2.8.tar.bz2
+	URL_MD5 9e3bfaaab3db18253cfd87ea697b3ab1
+#	FIXME: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1445
+#	URL https://bitbucket.org/eigen/eigen/get/3.3.4.tar.bz2
+#	URL_MD5 a7aab9f758249b86c93221ad417fbe18
 	CMAKE_ARGS -DEIGEN_INCLUDE_INSTALL_DIR:PATH=${EIGEN_INCLUDE_DIR}
 		-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}${CMAKE_DEFINITIONS}
 		-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}${CMAKE_DEFINITIONS}


mklml on linux has no soname set. This will cause linking against the full path for mklml when using prebuilt mkldnn and mklml. (#2851)

--- cmake/external_mkldnn.cmake
+++ cmake/external_mkldnn.cmake
@@ -64,6 +64,9 @@
         set_property(TARGET libmkl PROPERTY IMPORTED_LOCATION ${MKLML_LIB_DIR}/${MKLML_LIB})
         set_target_properties(libmkl PROPERTIES
             IMPORTED_LINK_INTERFACE_LIBRARIES ${MKLML_LIB_DIR}/${OMP_LIB})
+        if(LINUX)
+            set_property(TARGET libmkl PROPERTY IMPORTED_NO_SONAME 1)
+        endif()
     endif()

     if(WIN32)


[CMake] add_lit_target: Remove comments about add_dependencies. It is not a bug in cmake that add_custom_target(DEPENDS) would not accept targets but file-level dependencies.

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

--- cmake/modules/AddLLVM.cmake
+++ cmake/modules/AddLLVM.cmake
@@ -271,11 +271,6 @@
     COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
     COMMENT "${comment}"
     )
-
-  # It would be nice to use the DEPENDS clause in add_custom_target above, but
-  # that has bugs with the CMake 2.8.0 installed on Ubuntu Lucid when the entry
-  # in the depends is another custom target. Instead we add them through an
-  # explicit add_dependencies.
   add_dependencies(${target} ${ARG_DEPENDS})
 endfunction()


cmake/modules: remove unneeded custom FindGSL.cmake

This reverts commit 0f5415c3080c01b17df4be2ff7800e475ed976f9.
The revert was not necessary, the problem was in hist2workspace.

--- cmake/modules/FindGSL.cmake
+++ cmake/modules/FindGSL.cmake
@@ -1,128 +0,0 @@
-# Try to find gnu scientific library GSL
-# See
-# http://www.gnu.org/software/gsl/  and
-# http://gnuwin32.sourceforge.net/packages/gsl.htm
-#
-# Based on a script of Felix Woelk and Jan Woetzel
-# (www.mip.informatik.uni-kiel.de)
-#
-# It defines the following variables:
-#  GSL_FOUND         - system has GSL lib
-#  GSL_INCLUDE_DIR   - where to find headers
-#  GSL_LIBRARY       - the gsl library
-#  GSL_CBLAS_LIBRARY - the gslcblas library
-#  GSL_LIBRARIES     - full path to the libraries
-#  GSL_LIBRARY_DIR   - the directory where the PLplot library is found.
-#  GSL_CFLAGS        - additional c (c++) required
-
-
-# Windows, but not for Cygwin and MSys where gsl-config is available
-if(WIN32 AND NOT CYGWIN AND NOT MSYS)
-  # look for headers
-  find_path(GSL_INCLUDE_DIR
-    NAMES gsl/gsl_cdf.h gsl/gsl_randist.h
-    PATHS ${GSL_DIR}/include $ENV{GSL_DIR}/include
-  )
-
-  if(GSL_INCLUDE_DIR)
-    file(READ ${GSL_INCLUDE_DIR}/gsl/gsl_version.h versionstr)
-    string(REGEX REPLACE ".*GSL_VERSION[ \"]*([0-9]+[.][0-9]+).*" "\\1" GSL_VERSION "${versionstr}")
-  endif()
-
-  # look for gsl library
-  find_library(GSL_LIBRARY
-    NAMES gsl
-    PATHS ${GSL_DIR}/lib $ENV{GSL_DIR}/lib
-  )
-
-  if(GSL_LIBRARY)
-    get_filename_component(GSL_LIBRARY_DIR ${GSL_LIBRARY} PATH )
-  endif()
-
-  # look for gsl cblas library
-  find_library(GSL_CBLAS_LIBRARY
-    NAMES gslcblas
-    PATHS ${GSL_DIR}/lib $ENV{GSL_DIR}/lib
-  )
-
-  if(GSL_CBLAS_LIBRARY)
-    set(GSL_LIBRARIES ${GSL_LIBRARY} ${GSL_CBLAS_LIBRARY})
-  else()
-    set(GSL_LIBRARIES ${GSL_LIBRARY})
-  endif()
-
-  execute_process ( COMMAND lib /list ${GSL_LIBRARY} OUTPUT_VARIABLE content )
-  string(FIND ${content} ".dll" APOSITION )
-  if( NOT ("${APOSITION}" STREQUAL "-1") )
-    set( GSL_CFLAGS "-DGSL_DLL" )
-  endif()
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(GSL REQUIRED_VARS GSL_INCLUDE_DIR GSL_LIBRARY VERSION_VAR GSL_VERSION)
-  mark_as_advanced(GSL_INCLUDE_DIR GSL_LIBRARY GSL_CBLAS_LIBRARY)
-
-else( WIN32 AND NOT CYGWIN AND NOT MSYS )
-  if( UNIX OR MSYS )
-    find_program( GSL_CONFIG_EXECUTABLE gsl-config
-      ${GSL_DIR}/bin
-      $ENV{GSL_DIR}/bin
-      /usr/bin/
-      /usr/local/bin
-    )
-
-    if( GSL_CONFIG_EXECUTABLE )
-
-      # run the gsl-config program to get cxxflags
-      execute_process(
-        COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --cflags
-        OUTPUT_VARIABLE GSL_CFLAGS
-        RESULT_VARIABLE RET
-        ERROR_QUIET
-      )
-      if(RET EQUAL 0)
-        string(STRIP "${GSL_CFLAGS}" GSL_CFLAGS)
-        separate_arguments(GSL_CFLAGS)
-
-        # parse definitions from cflags; drop -D* from CFLAGS
-        string(REGEX MATCHALL "-D[^;]+" GSL_DEFINITIONS  "${GSL_CFLAGS}")
-        string(REGEX REPLACE "-D[^;]+;" "" GSL_CFLAGS "${GSL_CFLAGS}")
-
-        # parse include dirs from cflags; drop -I prefix
-        string(REGEX MATCH "-I[^;]+" GSL_INCLUDE_DIR "${GSL_CFLAGS}")
-        string(REPLACE "-I" "" GSL_INCLUDE_DIR "${GSL_INCLUDE_DIR}")
-        string(REGEX REPLACE "-I[^;]+;" "" GSL_CFLAGS "${GSL_CFLAGS}")
-      endif()
-
-      # run the gsl-config program to get the libs
-      execute_process(
-        COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --libs
-        OUTPUT_VARIABLE GSL_LIBRARIES
-        RESULT_VARIABLE RET
-        ERROR_QUIET
-      )
-      if(RET EQUAL 0)
-        string(STRIP "${GSL_LIBRARIES}" GSL_LIBRARIES)
-        separate_arguments(GSL_LIBRARIES)
-
-        # extract linkdirs (-L) for rpath (i.e., LINK_DIRECTORIES)
-        string(REGEX MATCH "-L[^;]+" GSL_LIBRARY_DIR "${GSL_LIBRARIES}")
-        string(REPLACE "-L" "" GSL_LIBRARY_DIR "${GSL_LIBRARY_DIR}")
-      endif()
-
-      execute_process(
-        COMMAND sh "${GSL_CONFIG_EXECUTABLE}" --version
-        OUTPUT_VARIABLE GSL_VERSION
-        OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-
-      include(FindPackageHandleStandardArgs)
-      find_package_handle_standard_args(GSL REQUIRED_VARS GSL_INCLUDE_DIR GSL_LIBRARIES VERSION_VAR GSL_VERSION)
-
-    else( GSL_CONFIG_EXECUTABLE )
-      message( STATUS "FindGSL: gsl-config not found.")
-    endif( GSL_CONFIG_EXECUTABLE )
-
-    mark_as_advanced(GSL_CONFIG_EXECUTABLE)
-
-  endif( UNIX OR MSYS )
-endif( WIN32 AND NOT CYGWIN AND NOT MSYS )


Make dependencies for component libraries as optional

Here is a quick summary of the dependencies.

- mandatories for core library: eigen, ccd, fcl, assimp, boost
- optional for component libraries:
  - dart-optimizer: nlopt, ipopt
  - dart-collision: bullet
  - dart-planning: flann
  - dart-utils: tinyxml, tinyxml2, urdfdom
  - dart-gui: opengl, glut, openscenegraph

--- cmake/DARTFindDependencies.cmake
+++ cmake/DARTFindDependencies.cmake
@@ -1,11 +1,11 @@
 # If you add a dependency, please add the corresponding rosdep key as a
 # dependency in package.xml.

-#------------------------
-# Mandatory dependencies
-#------------------------
+#======================================
+# Mandatory dependencies for DART core
+#======================================
 message(STATUS "")
-message(STATUS "[ Mandatory dependencies ]")
+message(STATUS "[ Mandatory dependencies for DART core ]")

 # Eigen
 find_package(EIGEN3 3.0.5 QUIET)
@@ -105,14 +105,6 @@
   message(SEND_ERROR "Looking for ASSIMP - NOT found, please install libassimp-dev (>= 3.0.0)")
 endif()

-# OpenGL
-find_package(OpenGL QUIET)
-if(OPENGL_FOUND)
-  message(STATUS "Looking for OpenGL - found")
-else()
-  message(SEND_ERROR "Looking for OpenGL - NOT found, please install OpenGL")
-endif()
-
 # Boost
 set(DART_MIN_BOOST_VERSION 1.46.0 CACHE INTERNAL "Boost min version requirement" FORCE)
 if(MSVC)
@@ -128,34 +120,125 @@
   message(SEND_ERROR "Please install system boost version ${DART_MIN_BOOST_VERSION} or higher.")
 endif()

-# GLUT
-if(WIN32 AND NOT CYGWIN)
-  set(GLUT_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include")
-  set(GLUT_LIBRARIES glut32)
-else()
-  find_package(GLUT QUIET)
-  if(GLUT_FOUND)
-    message(STATUS "Looking for GLUT - found")
-    set(GLUT_LIBRARIES ${GLUT_glut_LIBRARY})
+#===========================================
+# Optional dependencies for DART components
+#===========================================
+
+message(STATUS "")
+message(STATUS "[ Optional dependencies for DART components ]")
+
+# OpenMP
+if(ENABLE_OPENMP)
+  find_package(OpenMP QUIET)
+  if(OPENMP_FOUND)
+    message(STATUS "Looking for OpenMP - found")
   else()
-    message(SEND_ERROR "Looking for GLUT - NOT found, Please install freeglut3-dev")
+    message(STATUS "Looking for OpenMP - NOT found")
   endif()
-endif()
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+endif()
+
+#---------------------------------
+# Dependencies for dart-optimizer
+#---------------------------------
+
+# NLOPT
+find_package(NLOPT 2.4.1 QUIET)
+if(NLOPT_FOUND)
+  message(STATUS "Looking for NLOPT - ${NLOPT_VERSION} found")
+  set(HAVE_NLOPT TRUE)
+else()
+  message(STATUS "Looking for NLOPT - NOT found, to build dart-optimizer-nlopt, please install libnlopt-dev (>= 2.4.1)")
+  set(HAVE_NLOPT FALSE)
+endif()
+
+# IPOPT
+find_package(IPOPT 3.11.4 QUIET)
+if(IPOPT_FOUND)
+  message(STATUS "Looking for IPOPT - ${IPOPT_VERSION} found")
+  set(HAVE_IPOPT TRUE)
+else()
+  message(STATUS "Looking for IPOPT - NOT found, to build dart-optimizer-ipopt, please install coinor-libipopt-dev (>= 3.11.4)")
+  set(HAVE_IPOPT FALSE)
+endif()
+
+# Shark
+find_package(SHARK QUIET)
+if(SHARK_FOUND)
+  message(STATUS "Looking for SHARK - ${SHARK_VERSION} found")
+  set(HAVE_SHARK TRUE)
+else()
+  # message(STATUS "Looking for SHARK - NOT found, please install SHARK (http://image.diku.dk/shark)")
+  # TODO(JS): Disabled since not used anywhere for now
+  set(HAVE_SHARK FALSE)
+endif()
+
+#---------------------------------
+# Dependencies for dart-collision
+#---------------------------------
+
+# Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with
+# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed
+# with Bullet, which uses relative paths and may break transitive dependencies.
+find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)
+
+if(BULLET_FOUND)
+  # Test whether Bullet was built with double precision. If so, we need to
+  # define the BT_USE_DOUBLE_PRECISION pre-processor directive before including
+  # any Bullet headers. This is a workaround for the fact that Bullet does not
+  # add the definition to BULLET_DEFINITIONS or generate a #cmakedefine header.
+  include(CheckCXXSourceCompiles)
+  set(CMAKE_REQUIRED_FLAGS "")
+  set(CMAKE_REQUIRED_DEFINITIONS "-DBT_USE_DOUBLE_PRECISION")
+  set(CMAKE_REQUIRED_INCLUDES "${BULLET_INCLUDE_DIRS}")
+  set(CMAKE_REQUIRED_LIBRARIES "${BULLET_LIBRARIES}")
+  check_cxx_source_compiles(
+    "
+    #include <btBulletCollisionCommon.h>
+    int main()
+    {
+      btVector3 v(0., 0., 1.);
+      btStaticPlaneShape planeShape(v, 0.);
+      return 0;
+    }
+    "
+    BT_USE_DOUBLE_PRECISION
+  )
+
+  if(BT_USE_DOUBLE_PRECISION)
+    message(STATUS "Looking for Bullet - found (double precision)")
+  else()
+    message(STATUS "Looking for Bullet - found (single precision)")
+  endif()
+
+  set(HAVE_BULLET_COLLISION TRUE)
+else()
+  message(STATUS "Looking for Bullet - NOT found, to use BulletCollisionDetector, please install libbullet-dev")
+  set(HAVE_BULLET_COLLISION FALSE)
+endif()
+
+#--------------------------------
+# Dependencies for dart-planning
+#--------------------------------

 # FLANN
 find_package(FLANN 1.8.4 QUIET)
 if(FLANN_FOUND)
   message(STATUS "Looking for FLANN - ${FLANN_VERSION} found")
 else()
-  message(SEND_ERROR "Looking for FLANN - NOT found, please install libflann-dev (>= 1.8.4)")
-endif()
+  message(STATUS "Looking for FLANN - NOT found, to build dart-planning, please install libflann-dev (>= 1.8.4)")
+endif()
+
+#-----------------------------
+# Dependencies for dart-utils
+#-----------------------------

 # TINYXML
 find_package(TINYXML 2.6.2 QUIET)
 if(TINYXML_FOUND)
   message(STATUS "Looking for TINYXML - ${TINYXML_VERSION} found")
 else()
-  message(SEND_ERROR "Looking for TINYXML - NOT found, please install libtinyxml-dev (>= 2.6.2)")
+  message(STATUS "Looking for TINYXML - NOT found, please install libtinyxml-dev (>= 2.6.2)")
 endif()

 # TINYXML2
@@ -163,7 +246,7 @@
 if(TINYXML2_FOUND)
   message(STATUS "Looking for TINYXML2 - ${TINYXML2_VERSION} found")
 else()
-  message(SEND_ERROR "Looking for TINYXML2 - NOT found, please install libtinyxml2-dev (>= 1.0.1)")
+  message(STATUS "Looking for TINYXML2 - NOT found, please install libtinyxml2-dev (>= 1.0.1)")
 endif()

 # urdfdom
@@ -171,7 +254,7 @@
 if(urdfdom_FOUND)
   message(STATUS "Looking for urdfdom - found")
 else()
-  message(SEND_ERROR "Looking for urdfdom - NOT found, please install liburdfdom-dev")
+  message(STATUS "Looking for urdfdom - NOT found, please install liburdfdom-dev")
 endif()
 if(MSVC)
   set(urdfdom_LIBRARIES optimized urdfdom_sensor      debug urdfdom_sensord
@@ -181,11 +264,31 @@
                         optimized console_bridge      debug console_bridged)
 endif()

-#-----------------------
-# Optional dependencies
-#-----------------------
-message(STATUS "")
-message(STATUS "[ Optional dependencies ]")
+#---------------------------
+# Dependencies for dart-gui
+#---------------------------
+
+# OpenGL
+find_package(OpenGL QUIET)
+if(OPENGL_FOUND)
+  message(STATUS "Looking for OpenGL - found")
+else()
+  message(STATUS "Looking for OpenGL - NOT found, to build dart-gui, please install OpenGL")
+endif()
+
+# GLUT
+if(WIN32 AND NOT CYGWIN)
+  set(GLUT_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include")
+  set(GLUT_LIBRARIES glut32)
+else()
+  find_package(GLUT QUIET)
+  if(GLUT_FOUND)
+    message(STATUS "Looking for GLUT - found")
+    set(GLUT_LIBRARIES ${GLUT_glut_LIBRARY})
+  else()
+    message(STATUS "Looking for GLUT - NOT found, to build dart-gui, please install freeglut3-dev")
+  endif()
+endif()

 # OpenSceneGraph
 if(DART_BUILD_GUI_OSG)
@@ -221,99 +324,22 @@

 endif(DART_BUILD_GUI_OSG)

-# OpenMP
-if(ENABLE_OPENMP)
-  find_package(OpenMP QUIET)
-  if(OPENMP_FOUND)
-    message(STATUS "Looking for OpenMP - found")
-  else()
-    message(STATUS "Looking for OpenMP - NOT found")
-  endif()
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-endif()
-
-# NLOPT
-find_package(NLOPT 2.4.1 QUIET)
-if(NLOPT_FOUND)
-  message(STATUS "Looking for NLOPT - ${NLOPT_VERSION} found")
-  set(HAVE_NLOPT TRUE)
-else()
-  message(STATUS "Looking for NLOPT - NOT found, please install libnlopt-dev (>= 2.4.1)")
-  set(HAVE_NLOPT FALSE)
-endif()
-
-# IPOPT
-find_package(IPOPT 3.11.4 QUIET)
-if(IPOPT_FOUND)
-  message(STATUS "Looking for IPOPT - ${IPOPT_VERSION} found")
-  set(HAVE_IPOPT TRUE)
-else()
-  message(STATUS "Looking for IPOPT - NOT found, please install coinor-libipopt-dev (>= 3.11.4)")
-  set(HAVE_IPOPT FALSE)
-endif()
-
-# Shark
-find_package(SHARK QUIET)
-if(SHARK_FOUND)
-  message(STATUS "Looking for SHARK - ${SHARK_VERSION} found")
-  set(HAVE_SHARK TRUE)
-else()
-  message(STATUS "Looking for SHARK - NOT found, please install SHARK (http://image.diku.dk/shark)")
-  set(HAVE_SHARK FALSE)
-endif()
-
-# Bullet. Force MODULE mode to use the FindBullet.cmake file distributed with
-# CMake. Otherwise, we may end up using the BulletConfig.cmake file distributed
-# with Bullet, which uses relative paths and may break transitive dependencies.
-find_package(Bullet COMPONENTS BulletMath BulletCollision MODULE QUIET)
-
-if(BULLET_FOUND)
-  # Test whether Bullet was built with double precision. If so, we need to
-  # define the BT_USE_DOUBLE_PRECISION pre-processor directive before including
-  # any Bullet headers. This is a workaround for the fact that Bullet does not
-  # add the definition to BULLET_DEFINITIONS or generate a #cmakedefine header.
-  include(CheckCXXSourceCompiles)
-  set(CMAKE_REQUIRED_FLAGS "")
-  set(CMAKE_REQUIRED_DEFINITIONS "-DBT_USE_DOUBLE_PRECISION")
-  set(CMAKE_REQUIRED_INCLUDES "${BULLET_INCLUDE_DIRS}")
-  set(CMAKE_REQUIRED_LIBRARIES "${BULLET_LIBRARIES}")
-  check_cxx_source_compiles(
-    "
-    #include <btBulletCollisionCommon.h>
-    int main()
-    {
-      btVector3 v(0., 0., 1.);
-      btStaticPlaneShape planeShape(v, 0.);
-      return 0;
-    }
-    "
-    BT_USE_DOUBLE_PRECISION
-  )
-
-  if(BT_USE_DOUBLE_PRECISION)
-    message(STATUS "Looking for Bullet - found (double precision)")
-  else()
-    message(STATUS "Looking for Bullet - found (single precision)")
-  endif()
-
-  set(HAVE_BULLET_COLLISION TRUE)
-else()
-  message(STATUS "Looking for Bullet - NOT found, please install libbullet-dev")
-  set(HAVE_BULLET_COLLISION FALSE)
-endif()
+#--------------------
+# Misc. dependencies
+#--------------------

 # Perl modules
 find_package(PerlModules COMPONENTS Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor QUIET)
 if("${PERLMODULES_FOUND}" STREQUAL "TRUE")
   message(STATUS "Looking for PerlModules - found")
 else()
-  message(STATUS "Looking for PerlModules - NOT found, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)")
+  message(STATUS "Looking for PerlModules - NOT found, to colorize gcc messages, please install Regexp::Common Getopt::ArgvFile Getopt::Long Term::ANSIColor (http://www.cpan.org/modules/INSTALL.html)")
 endif()

 # Doxygen
 find_package(Doxygen QUIET)
 if(DOXYGEN_FOUND)
-  message(STATUS "Looking for Doxygen - found")
-else()
-  message(STATUS "Looking for Doxygen - NOT found, please install doxygen")
-endif()
+  message(STATUS "Looking for Doxygen - ${DOXYGEN_VERSION} found")
+else()
+  message(STATUS "Looking for Doxygen - NOT found, to generate the API documentation, please install doxygen")
+endif()


Fix Windows 7 compatibility

Fix Windows 7 compatibility

Linking to Mincore library breaks the compatibility with Windows 7.
Instead, link to the individual system libraries.

Reference: https://docs.microsoft.com/en-us/windows/desktop/apiindex/windows-8-api-sets

Signed-off-by: Francis Giraldeau <77d47d63cdc62b1abf82e61d5db643cf34b1cc3a@nrc-cnrc.gc.ca>

--- cmake/Qt5Core_HunterPlugin.cmake
+++ cmake/Qt5Core_HunterPlugin.cmake
@@ -77,8 +77,13 @@
   _qt_cmake_extra_helpers_add_interface(Qt5::Core ws2_32)

   # defined: '_GetFileVersionInfoSizeW'
-  _qt_cmake_extra_helpers_add_interface(Qt5::Core Mincore)
   _qt_cmake_extra_helpers_add_interface(Qt5::Core Version)
+
+  # defined: 'NetShareEnum'
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core Netapi32)
+
+  # defined: '__imp__GetUserProfileDirectoryW'
+  _qt_cmake_extra_helpers_add_interface(Qt5::Core Userenv)

   # defined: '__imp__timeSetEvent'
   _qt_cmake_extra_helpers_add_interface(Qt5::Core Winmm)


Update

Update

--- Superbuild/QwtExternal.cmake
+++ Superbuild/QwtExternal.cmake
@@ -40,6 +40,7 @@
     -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
     -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
     -DQt5_PATH:PATH=${Qt5_PATH}
+    -DQt5Core_DIR:PATH=${Qt5Core_DIR}
 )

 ExternalProject_Get_Property(Qwt_external BINARY_DIR)


Adding FFTW3 with components

Adding FFTW3 with components

Closes #1

--- modules/FindFFTW3.cmake
+++ modules/FindFFTW3.cmake
@@ -5,11 +5,23 @@
 #  FFTW3_LIBRARIES - The libraries needed to use FFTW3
 #  FFTW3_THREADED_LIBRARIES - The libraries needed to use threaded FFTW3
 #  FFTW3_DEFINITIONS - Compiler switches required for using FFTW3
-#  FFTW3_HAS_SINGLE - Set if FFTW3 exists in single precision format.
-#  FFTW3_HAS_DOUBLE - Set if FFTW3 exists in double precision format.
-#  FFTW3_HAS_LONG_DOUBLE - Set if FFTW3 exists in double precision format.
+#  FFTW3_SINGLE_FOUND- Set if FFTW3 exists in single precision format.
+#  FFTW3_DOUBLE_FOUND- Set if FFTW3 exists in double precision format.
+#  FFTW3_LONGDOUBLE_FOUND - Set if FFTW3 exists in double precision format.

 if(NOT FFTW3_FOUND)
+
+  if(fftw3_FIND_COMPONENTS)
+      set(FFTW3_FIND_COMPONENTS ${fftw3_FIND_COMPONENTS})
+  endif()
+  if(NOT FFTW3_FIND_COMPONENTS)
+      set(FFTW3_FIND_COMPONENTS SINGLE DOUBLE LONGDOUBLE)
+  endif()
+  string(TOUPPER "${FFTW3_FIND_COMPONENTS}" FFTW3_FIND_COMPONENTS)
+
+  list(FIND FFTW3_FIND_COMPONENTS SINGLE LOOK_FOR_SINGLE)
+  list(FIND FFTW3_FIND_COMPONENTS DOUBLE LOOK_FOR_DOUBLE)
+  list(FIND FFTW3_FIND_COMPONENTS LONGDOUBLE LOOK_FOR_LONGDOUBLE)

   if(WIN32)
     set(HINT_DIRS ${FFTW3_DIRECTORY} $ENV{FFTW3_DIRECTORY})
@@ -23,39 +35,87 @@
   endif(WIN32)

   find_path(FFTW3_INCLUDE_DIR NAMES fftw3.h HINTS ${HINT_DIRS})
-
+
+  function(find_version OUTVAR LIBRARY SUFFIX)
+      file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/fftw${SUFFIX}/main.c
+        "#include <fftw3.h>
+         #include <stdio.h>
+         int main(int nargs, char const *argv[]) {
+             printf(\"%s\", fftw${SUFFIX}_version);
+             return 0;
+         }"
+    )
+    if(NOT CMAKE_CROSSCOMPILING)
+      try_run(RUN_RESULT COMPILE_RESULT
+          "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/fftw${SUFFIX}/"
+          "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/fftw${SUFFIX}/main.c"
+          CMAKE_FLAGS
+            -DLINK_LIBRARIES=${LIBRARY}
+            -DINCLUDE_DIRECTORIES=${FFTW3_INCLUDE_DIR}
+          RUN_OUTPUT_VARIABLE OUTPUT
+          COMPILE_OUTPUT_VARIABLE COUTPUT
+      )
+    endif()
+    if(RUN_RESULT EQUAL 0)
+      string(REGEX REPLACE ".*([0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" VERSION_STRING ${OUTPUT})
+      set(${OUTVAR} ${VERSION_STRING} PARENT_SCOPE)
+    endif()
+  endfunction()
+
   if(WIN32)
-    find_library(FFTW3_LIBRARY_SINGLE NAMES libfftw3f-3 HINTS ${HINT_DIRS})
-    find_library(FFTW3_LIBRARY_DOUBLE NAMES libfftw3-3 HINTS ${HINT_DIRS})
-    find_library(FFTW3_LIBRARY_LONG_DOUBLE NAMES libfftw3l-3 HINTS ${HINT_DIRS})
+    if(LOOK_FOR_SINGLE GREATER -1)
+      find_library(FFTW3_SINGLE_LIBRARY NAMES libfftw3f-3 HINTS ${HINT_DIRS})
+    endif()
+    if(LOOK_FOR_DOUBLE GREATER -1)
+      find_library(FFTW3_DOUBLE_LIBRARY NAMES libfftw3-3 HINTS ${HINT_DIRS})
+    endif()
+    if(LOOK_FOR_LONGDOUBLE GREATER -1)
+      find_library(FFTW3_LONGDOUBLE_LIBRARY NAMES libfftw3l-3 HINTS ${HINT_DIRS})
+    endif()
   else()
-    set(HINT_DIRS ${PC_FFTW3_LIBDIR} ${PC_FFTW3_LIBRARY_DIRS}
+    set(HINT_DIRS ${PC_FFTW3_LIBDIR} ${PC_FFTW3_LIBRARY_DIRS}
                   $ENV{FFTW3_LIBRARY_DIR} ${FFTW3_LIBRARY_DIR} )
-    find_library(FFTW3_LIBRARY_SINGLE NAMES fftw3f HINTS ${HINT_DIRS})
-    find_library(FFTW3_LIBRARY_DOUBLE NAMES fftw3 HINTS ${HINT_DIRS})
-    find_library(FFTW3_LIBRARY_LONG_DOUBLE NAMES fftw3l HINTS ${HINT_DIRS})
+    if(LOOK_FOR_SINGLE GREATER -1)
+      find_library(FFTW3_SINGLE_LIBRARY NAMES fftw3f HINTS ${HINT_DIRS})
+    endif()
+    if(LOOK_FOR_DOUBLE GREATER -1)
+      find_library(FFTW3_DOUBLE_LIBRARY NAMES fftw3 HINTS ${HINT_DIRS})
+    endif()
+    if(LOOK_FOR_LONGDOUBLE GREATER -1)
+      find_library(FFTW3_LONGDOUBLE_LIBRARY NAMES fftw3l HINTS ${HINT_DIRS})
+    endif()
   endif(WIN32)

   set(FFTW3_LIBRARIES)
   set(FFTW3_INCLUDE_DIRS ${FFTW3_INCLUDE_DIR} )
-  if(FFTW3_LIBRARY_SINGLE MATCHES fftw3f)
-    set(FFTW3_HAS_SINGLE TRUE)
-    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_LIBRARY_SINGLE})
-  endif(FFTW3_LIBRARY_SINGLE MATCHES fftw3f)
-  if(FFTW3_LIBRARY_DOUBLE MATCHES fftw3)
+  if(FFTW3_SINGLE_LIBRARY MATCHES fftw3f)
+    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_SINGLE_LIBRARY})
+    set(FFTW3_SINGLE_FOUND TRUE)
+  endif(FFTW3_SINGLE_LIBRARY MATCHES fftw3f)
+  if(FFTW3_DOUBLE_LIBRARY MATCHES fftw3)
     set(FFTW3_HAS_DOUBLE TRUE)
-    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_LIBRARY_DOUBLE})
-  endif(FFTW3_LIBRARY_DOUBLE MATCHES fftw3)
-  if(FFTW3_LIBRARY_LONG_DOUBLE MATCHES fftw3l)
-    set(FFTW3_HAS_LONG_DOUBLE TRUE)
-    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_LIBRARY_LONG_DOUBLE})
-  endif(FFTW3_LIBRARY_LONG_DOUBLE MATCHES fftw3l)
+    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_DOUBLE_LIBRARY})
+    set(FFTW3_DOUBLE_FOUND TRUE)
+  endif(FFTW3_DOUBLE_LIBRARY MATCHES fftw3)
+  if(FFTW3_LONGDOUBLE_LIBRARY MATCHES fftw3l)
+    set(FFTW3_LIBRARIES ${FFTW3_LIBRARIES} ${FFTW3_LONGDOUBLE_LIBRARY})
+    set(FFTW3_LONGDOUBLE_FOUND TRUE)
+  endif(FFTW3_LONGDOUBLE_LIBRARY MATCHES fftw3l)

+  if(FFTW3_SINGLE_FOUND AND FFTW3_INCLUDE_DIR)
+      find_version(FFTW3_VERSION_STRING ${FFTW3_SINGLE_LIBRARY} f)
+  elseif(FFTW3_DOUBLE_FOUND AND FFTW3_INCLUDE_DIR)
+      find_version(FFTW3_VERSION_STRING ${FFTW3_DOUBLE_LIBRARY} "")
+  elseif(FFTW3_LONGDOUBLE_FOUND AND FFTW3_INCLUDE_DIR)
+      find_version(FFTW3_VERSION_STRING ${FFTW3_LONGDOUBLE_LIBRARY} "l")
+  endif()

   include(FindPackageHandleStandardArgs)
   # handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE
   # if all listed variables are TRUE
-  find_package_handle_standard_args(FFTW3  DEFAULT_MSG FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
-
-  mark_as_advanced(FFTW3_INCLUDE_DIR FFTW3_LIBRARY )
+  find_package_handle_standard_args(FFTW3
+      REQUIRED_VARS FFTW3_LIBRARIES FFTW3_INCLUDE_DIR
+      VERSION_VAR FFTW3_VERSION_STRING
+      HANDLE_COMPONENTS
+  )
 endif()


Add "--with-pkg-config-libdir=" to autotools scheme

--- cmake/modules/hunter_autotools_configure_command.cmake
+++ cmake/modules/hunter_autotools_configure_command.cmake
@@ -220,6 +220,13 @@

   list(APPEND configure_command "--prefix=${PARAM_PACKAGE_INSTALL_DIR}")

+  # See: https://github.com/ruslo/hunter/pull/1910#discussion_r300725504
+  list(
+      APPEND
+      configure_command
+      "--with-pkg-config-libdir=${PARAM_PACKAGE_INSTALL_DIR}/lib/pkgconfig"
+  )
+
   if(HUNTER_STATUS_DEBUG)
     string(REPLACE ";" " " final_configure_command "${configure_command}")
     hunter_status_debug("Final configure command:")


Move openssl source directory to avoid name conflict; disable inline assembly to fix Android x86-64 openssl build

--- cmake/build_external.cmake
+++ cmake/build_external.cmake
@@ -55,12 +55,15 @@

     # OpenSSL
     if(BUILD_OPENSSL)
-        set(OPENSSL_SOURCE_DIR ${CMAKE_BINARY_DIR}/openssl CACHE INTERNAL "openssl source dir")
+        set(OPENSSL_SOURCE_DIR ${CMAKE_BINARY_DIR}/openssl-src CACHE INTERNAL "openssl source dir")
         set(OPENSSL_INSTALL_DIR ${EXTERNAL_INSTALL_DIR}/openssl CACHE INTERNAL "openssl install dir")
         set(OPENSSL_INCLUDE_DIR ${OPENSSL_INSTALL_DIR}/include CACHE INTERNAL "openssl include dir")
         set(OPENSSL_LIBRARY_DIR ${OPENSSL_INSTALL_DIR}/lib CACHE INTERNAL "openssl library dir")
         set(OPENSSL_CXX_FLAGS "${EXTERNAL_CXX_FLAGS} ${ZLIB_INCLUDE_FLAGS} -fPIE" CACHE INTERNAL "openssl")
         set(OPENSSL_C_FLAGS "${EXTERNAL_C_FLAGS} ${ZLIB_INCLUDE_FLAGS} -fPIE" CACHE INTERNAL "openssl")
+        if(ANDROID_ABI STREQUAL "x86_64")
+            set(OPENSSL_C_FLAGS "${OPENSSL_C_FLAGS} -DOPENSSL_NO_INLINE_ASM" CACHE INTERNAL "openssl")
+        endif()
         set(OPENSSL_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIE -pie" CACHE INTERNAL "openssl")

         set(OPENSSL_INCLUDE_FLAGS "-isystem ${OPENSSL_INCLUDE_DIR} -isystem ${OPENSSL_INCLUDE_DIR}/openssl" CACHE INTERNAL "compiler flags to find openssl includes")


CMake: fix compile options for Windows ARM64 (#579)

Signed-off-by: Zheltov, Sergey1 <2caecf572425dfc72b1e4daa2cc6a716d92adb58@intel.com>

--- cmake/compilers/MSVC.cmake
+++ cmake/compilers/MSVC.cmake
@@ -33,7 +33,7 @@
     set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} /wd4503)
 endif()
 set(TBB_LIB_COMPILE_FLAGS -D_CRT_SECURE_NO_WARNINGS /GS)
-set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS)
+set(TBB_COMMON_COMPILE_FLAGS /volatile:iso /FS /EHsc)

 # Ignore /WX set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
 if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)


fixed macdeployqt options order

fixed macdeployqt options order

--- cmake/EthExecutableHelper.cmake
+++ cmake/EthExecutableHelper.cmake
@@ -61,12 +61,13 @@

 	if (ETH_INSTALL_EXECUTABLE_QMLDIR)
 		set(eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}")
+		message(STATUS "${EXECUTABLE} qmldir: ${eth_qml_dir}")
 	endif()

 	if (APPLE)
 		# First have qt5 install plugins and frameworks
 		add_custom_command(TARGET ${EXECUTABLE} POST_BUILD
-			COMMAND ${MACDEPLOYQT_APP} ${eth_qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app
+			COMMAND ${MACDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app ${eth_qml_dir}
 			WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

 		# This tool and next will inspect linked libraries in order to determine which dependencies are required


Add options to lcov commands.

Add options to lcov commands.

--- cmake/ProjectGlobalMacros.cmake
+++ cmake/ProjectGlobalMacros.cmake
@@ -87,8 +87,8 @@
         message("-- lcov and genhtml found, html reports available through target 'lcov'")
         file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/coverage/lcov/html)
         add_custom_target(lcov
-          COMMAND lcov --capture --directory ${PROJECT_BINARY_DIR} --output-file coverage.info
-          COMMAND genhtml coverage.info --output-directory html
+          COMMAND lcov --no-external --capture --directory ${PROJECT_BINARY_DIR} --output-file coverage.info
+          COMMAND genhtml coverage.info --output-directory html --demangle-cpp
           COMMAND echo "HTML report generated in: " ${PROJECT_BINARY_DIR}/coverage/lcov/html
           WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/coverage/lcov
           )


add c++11 compile options

add c++11 compile options

--- cmake/augmentation_widget.cmake
+++ cmake/augmentation_widget.cmake
@@ -19,3 +19,5 @@
 target_include_directories ( augmentation PUBLIC ${INCLUDE_DIR} )

 qt5_use_modules( augmentation Core Gui Widgets OpenGL )
+
+target_compile_options(augmentation PRIVATE -std=c++11 -Wall -Wextra)


Use automatic install directories

Use automatic install directories

--- sources/cmake/install.cmake
+++ sources/cmake/install.cmake
@@ -24,16 +24,18 @@

 # Set installation.

+include(GNUInstallDirs)
+
 install(TARGETS vcdMaker vcdMerge
-        RUNTIME DESTINATION bin
+        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
         COMPONENT runtime)

 install(FILES ${MAN_PAGES_GENERATED}
-        DESTINATION share/man/man1
+        DESTINATION ${CMAKE_INSTALL_MANDIR}/man1
         COMPONENT documentation)

 install(DIRECTORY common/doc/
-        DESTINATION share/doc/${CMAKE_PROJECT_NAME}
+        DESTINATION ${CMAKE_INSTALL_DOCDIR}
         COMPONENT documentation
         PATTERN "*.odt" EXCLUDE
         PATTERN "man" EXCLUDE)


CMake Fixes for win32

CMake Fixes for win32

--- common.cmake
+++ common.cmake
@@ -12,20 +12,27 @@
 INCLUDE (CPack)
 INCLUDE (CTest)

-set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
-set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
-set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
-
 # Compiler-specific C++11 activation.
 if (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU")
+    set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
+    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
+    set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
+    set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+
     execute_process(
         COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
     if (NOT (GCC_VERSION VERSION_GREATER 4.7 OR GCC_VERSION VERSION_EQUAL 4.7))
         message(FATAL_ERROR "${PROJECT_NAME} requires g++ 4.7 or greater.")
     endif ()
 elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
+
+    set(CMAKE_CXX_FLAGS                "-Wall -std=c++11")
+    set(CMAKE_CXX_FLAGS_DEBUG          "-O0 -g")
+    set(CMAKE_CXX_FLAGS_MINSIZEREL     "-Os -DNDEBUG")
+    set(CMAKE_CXX_FLAGS_RELEASE        "-O4 -DNDEBUG")
+    set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
+
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
 elseif(${CMAKE_MAKE_PROGRAM} MATCHES "(msdev|devenv|nmake|MSBuild)")
     add_definitions("/W2")


No need for libf95 in the list of Root libraries

--- cmake/modules/ALICEMacros.cmake
+++ cmake/modules/ALICEMacros.cmake
@@ -167,10 +167,6 @@

   If(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
-    Execute_process(COMMAND g95 --print-search-dirs
-      OUTPUT_VARIABLE _out)
-    String(REGEX REPLACE "^.*install: *([^\n]*)/\n.*$" "\\1" _libdir ${_out})
-    Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -L${_libdir} -lf95")
   Else(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
     Execute_process(
@@ -227,10 +223,6 @@

   If(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
-    Execute_process(COMMAND g95 --print-search-dirs
-      OUTPUT_VARIABLE _out)
-    String(REGEX REPLACE "^.*install: *([^\n]*)/\n.*$" "\\1" _libdir ${_out})
-    Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -L${_libdir} -lf95")
   Else(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
     Execute_process(
@@ -270,10 +262,6 @@

   If(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95")
-    Execute_process(COMMAND g95 --print-search-dirs
-      OUTPUT_VARIABLE _out)
-    String(REGEX REPLACE "^.*install: *([^\n]*)/\n.*$" "\\1" _libdir ${_out})
-    Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -L${_libdir} -lf95")
   Else(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
     Execute_process(
@@ -324,10 +312,6 @@

   If(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fbounds-check -ftrace=full -DFORTRAN_G95 -single_module")
-    Execute_process(COMMAND g95 --print-search-dirs
-      OUTPUT_VARIABLE _out)
-    String(REGEX REPLACE "^.*install: *([^\n]*)/\n.*$" "\\1" _libdir ${_out})
-    Set(ROOT_LIBRARIES "${ROOT_LIBRARIES} -L${_libdir} -lf95")
   Else(CMAKE_Fortran_COMPILER MATCHES g95)
     Set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -DFORTRAN_GFORTRAN")
     Execute_process(


Updated CCLIENT_INCLUDE.

Updated CCLIENT_INCLUDE.

--- cmake_modules/FindCClient.cmake
+++ cmake_modules/FindCClient.cmake
@@ -1,8 +1,8 @@
 # Finds the C-CLIENT library that is part of the UW IMAP toolkit
 #
 #  CCLIENT_FOUND        - True if C-CLIENT library found.
-#  CCLIENT_INCLUDE_DIRS - Directory to include to get C-CLIENT headers
-#  CCLIENT_LIBRARIES    - Libraries to link against for the C-CLIENT library
+#  CCLIENT_INCLUDE      - Directory to include to get C-CLIENT headers
+#  CCLIENT_LIBRARY      - Libraries to link against for the C-CLIENT library
 #

 if (CCLIENT_INCLUDE_DIRS AND CCLIENT_LIBRARIES)
@@ -12,9 +12,9 @@

 find_path(
   CCLIENT_INCLUDE
-  NAMES linkage.h
+  NAMES linkage.c
   PATHS ${CCLIENT_INCLUDE_DIRS}
-  PATH_SUFFIXES c-client
+  PATH_SUFFIXES imap
   DOC "Include directory for the CCLient library linkage")
 mark_as_advanced(CCLIENT_INCLUDE)

@@ -26,16 +26,14 @@
   DOC "Library to link against for the email support")

 if (CCLIENT_LIBRARY)
-  MESSAGE("-- Found CCLIENT library -- " ${CCLIENT_LIBRARY})
+  MESSAGE(STATUS "Found CCLIENT library -- " ${CCLIENT_LIBRARY})
 else (CCLIENT_LIBRARY)
-  MESSAGE("-- Could not find CCLIENT library")
+  MESSAGE(STATUS "Could not find CCLIENT library")
 endif (CCLIENT_LIBRARY)

 # Copy the results to the output variables.
 if(CCLIENT_INCLUDE AND CCLIENT_LIBRARY)
   set(CCLIENT_FOUND 1)
-  set(CCLIENT_LIBRARIES ${CCLIENT_LIBRARY})
-  set(CCLIENT_INCLUDE_DIRS ${CCLIENT_INCLUDE_DIRS} ${CCLIENT_INCLUDE})

   # Do not treat the operator name keywords and, bitand, bitor, compl, not, or and xor
   # as synonyms as keywords. Needed in order to include C-CLIENT library
@@ -47,6 +45,6 @@

 else(CCLIENT_INCLUDE AND CCLIENT_LIBRARY)
   set(CCLIENT_FOUND 0)
-  set(CCLIENT_LIBRARIES)
-  set(CCLIENT_INCLUDE_DIRS)
+  set(CCLIENT_LIBRARY)
+  set(CCLIENT_INCLUDE)
 endif(CCLIENT_INCLUDE AND CCLIENT_LIBRARY)