removed FindCOI.cmake

removed FindCOI.cmake

--- common/cmake/FindCOI.cmake
+++ common/cmake/FindCOI.cmake
@@ -1,36 +0,0 @@
-## ======================================================================== ##
-## Copyright 2009-2016 Intel Corporation                                    ##
-##                                                                          ##
-## Licensed under the Apache License, Version 2.0 (the "License");          ##
-## you may not use this file except in compliance with the License.         ##
-## You may obtain a copy of the License at                                  ##
-##                                                                          ##
-##     http://www.apache.org/licenses/LICENSE-2.0                           ##
-##                                                                          ##
-## Unless required by applicable law or agreed to in writing, software      ##
-## distributed under the License is distributed on an "AS IS" BASIS,        ##
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ##
-## See the License for the specific language governing permissions and      ##
-## limitations under the License.                                           ##
-## ======================================================================== ##
-
-FIND_PATH(COI_INCLUDE_PATH source/COIProcess_source.h /opt/intel/mic/coi/include /usr/include/intel-coi)
-FIND_PATH(COI_HOST_LIBRARY_DIR libcoi_host.so /opt/intel/mic/coi/host-linux-release/lib/)
-FIND_PATH(COI_DEV_LIBRARY_DIR libcoi_device.so /opt/mpss/*/sysroots/k1om-mpss-linux/usr/lib64/)
-
-IF (COI_INCLUDE_PATH AND COI_HOST_LIBRARY_DIR AND COI_DEV_LIBRARY_DIR)
-  SET(COI_FOUND TRUE)
-  SET(COI_INCLUDE_PATHS ${COI_INCLUDE_PATH})
-  SET(COI_HOST_LIBRARIES ${COI_HOST_LIBRARY_DIR}/libcoi_host.so)
-  SET(COI_DEV_LIBRARIES ${COI_DEV_LIBRARY_DIR}/libcoi_device.so)
-ELSE ()
-  MESSAGE(FATAL_ERROR "COI installation not found")
-ENDIF ()
-
-MARK_AS_ADVANCED(COI_INCLUDE_PATH)
-MARK_AS_ADVANCED(COI_HOST_LIBRARY_DIR)
-MARK_AS_ADVANCED(COI_DEV_LIBRARY_DIR)
-
-MARK_AS_ADVANCED(COI_INCLUDE_PATHS)
-MARK_AS_ADVANCED(COI_HOST_LIBRARIES)
-MARK_AS_ADVANCED(COI_DEV_LIBRARIES)


Avoid really slow Windows conda builds (#3287)

* avoid that if CMAKE_BINARY_DIR==CMAKE_SOURCE_DIR (e.g., conda builds)
export.h is overwritten at each incremental build causing the whole
RDKit to be rebult every time

* use existing CMake function so we don't have to maintain our own

--- Code/cmake/Modules/RDKitUtils.cmake
+++ Code/cmake/Modules/RDKitUtils.cmake
@@ -216,21 +216,6 @@
   endif()
 endfunction(downloadAndCheckMD5)

-function(overwriteIfChanged src dest)
-  set(overwrite TRUE)
-  if (EXISTS "${dest}")
-    computeMD5("${dest}" destMD5)
-    computeMD5("${src}" srcMD5)
-    if (${destMD5} STREQUAL ${srcMD5})
-      set(overwrite FALSE)
-    endif()
-  endif()
-  if (overwrite)
-    get_filename_component(destDir "${dest}" DIRECTORY)
-    file(COPY "${src}" DESTINATION "${destDir}")
-  endif()
-endfunction(overwriteIfChanged)
-
 function(createExportTestHeaders)
   file(GLOB_RECURSE cmakeLists LIST_DIRECTORIES false
        ${CMAKE_SOURCE_DIR}/CMakeLists.txt)
@@ -247,7 +232,7 @@
   list(REMOVE_DUPLICATES exportLibs)
   list(SORT exportLibs)
   set(exportPath "Code/RDGeneral/export.h")
-  file(WRITE "${CMAKE_BINARY_DIR}/${exportPath}"
+  file(WRITE "${CMAKE_BINARY_DIR}/${exportPath}.tmp"
     "// auto-generated __declspec definition header\n"
     "#pragma once\n"
     "#ifndef SWIG\n"
@@ -259,12 +244,12 @@
     "#include <boost/config.hpp>\n"
     "#endif\n")
   set(testPath "Code/RDGeneral/test.h")
-  file(WRITE "${CMAKE_BINARY_DIR}/${testPath}"
+  file(WRITE "${CMAKE_BINARY_DIR}/${testPath}.tmp"
     "// auto-generated header to be imported in all cpp tests\n"
     "#pragma once\n")
   foreach(exportLib ${exportLibs})
     string(TOUPPER "${exportLib}" exportLib)
-    file(APPEND "${CMAKE_BINARY_DIR}/${exportPath}"
+    file(APPEND "${CMAKE_BINARY_DIR}/${exportPath}.tmp"
       "\n"
       "// RDKIT_${exportLib}_EXPORT definitions\n"
       "#if defined(BOOST_HAS_DECLSPEC) && defined(RDKIT_DYN_LINK) && !defined(SWIG)\n"
@@ -278,14 +263,16 @@
       "#define RDKIT_${exportLib}_EXPORT\n"
       "#endif\n"
       "// RDKIT_${exportLib}_EXPORT end definitions\n")
-    file(APPEND "${CMAKE_BINARY_DIR}/${testPath}"
+    file(APPEND "${CMAKE_BINARY_DIR}/${testPath}.tmp"
       "\n"
       "#ifdef RDKIT_${exportLib}_BUILD\n"
       "#undef RDKIT_${exportLib}_BUILD\n"
       "#endif\n")
   endforeach()
-  overwriteIfChanged("${CMAKE_BINARY_DIR}/${exportPath}" "${CMAKE_SOURCE_DIR}/${exportPath}")
-  overwriteIfChanged("${CMAKE_BINARY_DIR}/${testPath}" "${CMAKE_SOURCE_DIR}/${testPath}")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+    "${CMAKE_BINARY_DIR}/${exportPath}.tmp" "${CMAKE_SOURCE_DIR}/${exportPath}")
+  execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
+    "${CMAKE_BINARY_DIR}/${testPath}.tmp" "${CMAKE_SOURCE_DIR}/${testPath}")
 endfunction(createExportTestHeaders)

 function(patchCoordGenMaeExportHeaders keyword path)


Make thrift metadata available across fbcode oss builds.

Summary: There are downstream oss builds showing build failure caused by introduction of metadata. We want to make them proceed to build so we won't get errors in CI.

Reviewed By: iahs

Differential Revision: D19900007

fbshipit-source-id: 4201448f7980b53e407fd2bc1c74ed4ffa8e18c1

--- build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
+++ build/fbcode_builder/CMake/FBThriftCppLibrary.cmake
@@ -62,12 +62,14 @@
     "${output_dir}/gen-cpp2/${base}_types.h"
     "${output_dir}/gen-cpp2/${base}_types.tcc"
     "${output_dir}/gen-cpp2/${base}_types_custom_protocol.h"
+    "${output_dir}/gen-cpp2/${base}_metadata.h"
   )
   list(APPEND generated_sources
     "${output_dir}/gen-cpp2/${base}_constants.cpp"
     "${output_dir}/gen-cpp2/${base}_data.h"
     "${output_dir}/gen-cpp2/${base}_data.cpp"
     "${output_dir}/gen-cpp2/${base}_types.cpp"
+    "${output_dir}/gen-cpp2/${base}_metadata.cpp"
   )
   foreach(service IN LISTS ARG_SERVICES)
     list(APPEND generated_headers


CLANG: Make deprecated warnings errors

CLANG: Make deprecated warnings errors

--- cmake/toolchains/Toolchain-posix-clang-native.cmake
+++ cmake/toolchains/Toolchain-posix-clang-native.cmake
@@ -21,6 +21,7 @@
     -Werror=uninitialized
     -Werror=init-self
     -Werror=return-type
+    -Werror=deprecated
     -Wno-packed
     -Wno-frame-larger-than=
     #-Wcast-qual  - generates spurious noreturn attribute warnings,


advertise heaptrack_gui

advertise heaptrack_gui

--- heaptrack.sh.cmake
+++ heaptrack.sh.cmake
@@ -32,7 +32,7 @@
     echo "  * Where is heap memory being allocated, and how often?"
     echo "  * How much space are heap individual allocations requesting?"
     echo
-    echo "To evaluate the generated heaptrack data, use heaptrack_print."
+    echo "To evaluate the generated heaptrack data, use heaptrack_print or heaptrack_gui."
     echo
     echo "Mandatory arguments to heaptrack:"
     echo "  DEBUGGEE       The name or path to the application that should"
@@ -155,7 +155,11 @@

     echo "Heaptrack finished! Now run the following to investigate the data:"
     echo
-    echo "  heaptrack_print \"$output\" | less"
+    if [[ "$(which heaptrack_gui)" != "" ]]; then
+        echo "  heaptrack_gui \"$output\""
+    else
+        echo "  heaptrack_print \"$output\" | less"
+    fi
 }
 trap cleanup EXIT


[GLES2] Improve PowerVR SDK discovery on Windows and add support for the paths in the 3.0 sdk.

--- CMake/Packages/FindOpenGLES2.cmake
+++ CMake/Packages/FindOpenGLES2.cmake
@@ -30,27 +30,27 @@
     IF(BORLAND)
       SET (OPENGLES2_gl_LIBRARY import32 CACHE STRING "OpenGL ES 2.x library for win32")
     ELSE(BORLAND)
-		#MS compiler - todo - fix the following line:
-		SET (OPENGLES2_gl_LIBRARY ${OGRE_DEPENDENCIES_DIR}/lib/release/libGLESv2.lib CACHE STRING "OpenGL ES 2.x library for win32")
-		SET (EGL_egl_LIBRARY      ${OGRE_DEPENDENCIES_DIR}/lib/release/libEGL.lib CACHE STRING "EGL library for win32")
-
-		SET(POWERVR_SDK_PATH "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2")
+		SET(POWERVR_SDK_PATH "C:/Imagination/PowerVR/GraphicsSDK/SDK_3.0/Builds/OGLES2")
 		FIND_PATH(OPENGLES2_INCLUDE_DIR GLES2/gl2.h
 			${POWERVR_SDK_PATH}/Include
-		)
-
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include"
+		)
+
 	    FIND_PATH(EGL_INCLUDE_DIR EGL/egl.h
-			${POWERVR_SDK_PATH}/Include
+			${POWERVR_SDK_PATH}/Include
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/Include"
 		)
-
+
 		FIND_LIBRARY(OPENGLES2_gl_LIBRARY
-			NAMES GLESv2
-			PATHS ${POWERVR_SDK_PATH}/WindowsX86/Lib
+			NAMES libGLESv2
+			PATHS ${POWERVR_SDK_PATH}/Windows_x86_32/Lib
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib"
 		)
-
+
 		FIND_LIBRARY(EGL_egl_LIBRARY
-			NAMES EGL
-			PATHS ${POWERVR_SDK_PATH}/WindowsX86/Lib
+			NAMES libEGL
+			PATHS ${POWERVR_SDK_PATH}/Windows_x86_32/Lib
+            "C:/Imagination Technologies/PowerVR Insider SDK/OGLES2_WINDOWS_X86EMULATION_2.10/Builds/OGLES2/WindowsX86/Lib"
 		)
     ENDIF(BORLAND)


Always add -std=c++11 to CXX_FLAGS

Always add -std=c++11 to CXX_FLAGS

refs #173

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -32,10 +32,10 @@
         set(CMAKE_C_FLAGS_RELEASE "-march=${GCC_ARCH} -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds." FORCE)
         set(CMAKE_C_FLAGS_RELWITHDEBINFO "-march=${GCC_ARCH} -g -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

-        set(CMAKE_CXX_FLAGS_DEBUG "-march=${GCC_ARCH} -g -Wall -Wno-unknown-pragmas -std=c++11" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-        set(CMAKE_CXX_FLAGS_MINSIZEREL "-march=${GCC_ARCH} -Os -Wall -Wno-unknown-pragmas -DNDEBUG -std=c++11" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
-        set(CMAKE_CXX_FLAGS_RELEASE "-march=${GCC_ARCH} -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas -std=c++11" CACHE STRING "Flags used by the compiler during release builds." FORCE)
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-march=${GCC_ARCH} -g -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas -std=c++11" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)
+        set(CMAKE_CXX_FLAGS_DEBUG "-march=${GCC_ARCH} -g -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
+        set(CMAKE_CXX_FLAGS_MINSIZEREL "-march=${GCC_ARCH} -Os -Wall -Wno-unknown-pragmas -DNDEBUG" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
+        set(CMAKE_CXX_FLAGS_RELEASE "-march=${GCC_ARCH} -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds." FORCE)
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-march=${GCC_ARCH} -g -O3 -funroll-loops -DNDEBUG -Wall -Wno-unknown-pragmas" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

     elseif(CMAKE_CXX_COMPILER MATCHES "icpc")
         # default flags for intel
@@ -44,10 +44,10 @@
         set(CMAKE_C_FLAGS_RELEASE "-xHOST -O3 -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds." FORCE)
         set(CMAKE_C_FLAGS_RELWITHDEBINFO "-xHOST -g -O3 -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

-        set(CMAKE_CXX_FLAGS_DEBUG "-xHOST -O0 -g -std=c++11" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
-        set(CMAKE_CXX_FLAGS_MINSIZEREL "-xHOST -Os -DNDEBUG -std=c++11" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
-        set(CMAKE_CXX_FLAGS_RELEASE "-xHOST -O3 -DNDEBUG -std=c++11" CACHE STRING "Flags used by the compiler during release builds." FORCE)
-        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xHOST -g -O3 -DNDEBUG -std=c++11" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)
+        set(CMAKE_CXX_FLAGS_DEBUG "-xHOST -O0 -g" CACHE STRING "Flags used by the compiler during debug builds." FORCE)
+        set(CMAKE_CXX_FLAGS_MINSIZEREL "-xHOST -Os -DNDEBUG" CACHE STRING "Flags used by the compiler during minimum size release builds." FORCE)
+        set(CMAKE_CXX_FLAGS_RELEASE "-xHOST -O3 -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds." FORCE)
+        set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-xHOST -g -O3 -DNDEBUG" CACHE STRING "Flags used by the compiler during release builds with debug info." FORCE)

     else(CMAKE_COMPILER_IS_GNUCXX)
         message(STATUS "No default CXXFLAGS for your compiler, set them manually")
@@ -64,3 +64,5 @@

 SET(PASSED_FIRST_CONFIGURE ON CACHE INTERNAL "First configure has run: CXX_FLAGS have had their defaults changed" FORCE)
 endif(NOT PASSED_FIRST_CONFIGURE)
+
+list(APPEND CMAKE_CXX_FLAGS "-std=c++11")


basler cmake stuff: allow spaces in environment variables

--- CMakeModules/FindBaslerPylon.cmake
+++ CMakeModules/FindBaslerPylon.cmake
@@ -1,8 +1,8 @@
 INCLUDE(FindPackageHandleStandardArgs)

-FIND_LIBRARY(BASLER_PYLON_LIBRARY pylonbase $ENV{BASLER_PYLON_LIB_PATH})
+FIND_LIBRARY(BASLER_PYLON_LIBRARY pylonbase "$ENV{BASLER_PYLON_LIB_PATH}")
 FIND_PATH(BASLER_PYLON_INCLUDE_PATH pylon/Device.h
-  $ENV{BASLER_PYLON_INCLUDE_PATH}
+  "$ENV{BASLER_PYLON_INCLUDE_PATH}"
 )
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(BASLER_PYLON DEFAULT_MSG
                                              BASLER_PYLON_INCLUDE_PATH


[cmake] make headercheck usable for non dune-stuff modules

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -38,7 +38,7 @@
 	FOREACH( HEADER ${ARGN} )
 		string(REPLACE "/" "_" fn ${HEADER})
 		SET( TEST_NAME "headercheck_${fn}")
-		configure_file( ${PROJECT_SOURCE_DIR}/cmake/headercheck.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.cpp )
+		configure_file( ${PROJECT_SOURCE_DIR}/../dune-stuff/cmake/headercheck.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.cpp )
 		ADD_LIBRARY( ${TEST_NAME} STATIC ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}.cpp )
 		set_target_properties(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
 		add_dependencies( headercheck ${TEST_NAME} )


[cmake] disable eigen warnings

[cmake] disable eigen warnings

--- cmake/DuneUtils.cmake
+++ cmake/DuneUtils.cmake
@@ -191,7 +191,7 @@

 pkg_check_modules(EIGEN eigen3)
 if(EIGEN_FOUND)
-  include_directories(${EIGEN_INCLUDE_DIRS})
+  INCLUDE_SYS_DIR(${EIGEN_INCLUDE_DIRS})
 endif(EIGEN_FOUND)

 if(ENABLE_MPI)


[cmake] removed FindCCTag, not necessary anymore

--- cmake/FindCCTag.cmake
+++ cmake/FindCCTag.cmake
@@ -1,79 +0,0 @@
-# Locate the openMVG libraries.
-#
-# Defines the following variables:
-#
-#   CCTAG_FOUND        - TRUE if the CCTag headers and libs are found
-#   CCTAG_INCLUDE_DIRS - The path to CCTag headers
-#
-#   CCTAG_LIBRARIES    - Libraries to link against to use CCTag.
-#   CCTAG_LIBRARY_DIR  - The base directory to search for CCTag.
-#
-# Accepts the following variables as input:
-#
-#   CCTAG_DIR - (as a CMake or environment variable)
-#                The root directory of the CCTag install prefix
-
-MESSAGE(STATUS "Looking for CCTag.")
-
-FIND_PATH(CCTAG_INCLUDE_DIR cctag/ICCTag.hpp
-  HINTS
-  $ENV{CCTAG_DIR}/include
-  ${CCTAG_DIR}/include
-  PATH_SUFFIXES
-  cctag
-)
-
-find_package(OpenCV REQUIRED)
-
-IF(CCTAG_INCLUDE_DIR)
-  MESSAGE(STATUS "CCTag headers found in ${CCTAG_INCLUDE_DIR}")
-ELSE()
-  MESSAGE(STATUS "NOT FOUND")
-ENDIF (CCTAG_INCLUDE_DIR)
-
-SET(CCTAG_LIBRARIES_NAMES
-  CCTag
-  # third_party libraries
-  # boost_filesystem
-  # boost_system
-  # boost_serialization
-  # dl
-  ${OpenCV_LIBS}
-)
-
-FIND_LIBRARY(CCTAG_LIBRARY NAMES ${CCTAG_LIBRARIES_NAMES}
-  HINTS
-  $ENV{CCTAG_DIR}/lib
-  ${CCTAG_DIR}/lib
-)
-GET_FILENAME_COMPONENT(CCTAG_LIBRARY_DIR "${CCTAG_LIBRARY}" PATH)
-
-SET(CCTAG_LIBRARY "")
-FOREACH(lib ${CCTAG_LIBRARIES_NAMES})
- LIST(APPEND CCTAG_LIBRARY ${lib})
-ENDFOREACH()
-
-SET(CCTAG_LIBRARIES ${CCTAG_LIBRARY})
-SET(CCTAG_INCLUDE_DIRS ${CCTAG_INCLUDE_DIR})
-
-IF(CCTAG_LIBRARY)
-  MESSAGE(STATUS "CCTag libraries found: ${CCTAG_LIBRARY}")
-  MESSAGE(STATUS "CCTag libraries directories: ${CCTAG_LIBRARY_DIR}")
-ENDIF (CCTAG_LIBRARY)
-
-include(FindPackageHandleStandardArgs)
-# handle the QUIETLY and REQUIRED arguments and set CCTAG_FOUND to TRUE
-# if all listed variables are TRUE
-find_package_handle_standard_args(CCTag  DEFAULT_MSG
-                                  CCTAG_LIBRARY CCTAG_INCLUDE_DIR)
-
-MARK_AS_ADVANCED(CCTAG_INCLUDE_DIR CCTAG_LIBRARY)
-
-#Third parties:
-# - include directories
-
-IF(CCTAG_FOUND)
-  SET(CCTAG_INCLUDE_DIRS
-    ${CCTAG_INCLUDE_DIR}
-  )
-ENDIF(CCTAG_FOUND)


Properly compute the CEGUI_INCLUDE_DIRS

Properly compute the CEGUI_INCLUDE_DIRS

We do this by including *only* the parent
directories of the "CEGUI/" subdirectory,
so that we won't get into compilation errors.

Also, set more explicitly the docstrings


Update search list

Update search list

--- cmake/FindMySQL.cmake
+++ cmake/FindMySQL.cmake
@@ -30,18 +30,20 @@

 #-------------- FIND MYSQL_INCLUDE_DIR ------------------
-FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
-  /usr/include/mysql
-  /usr/local/include/mysql
-  /opt/mysql/mysql/include
-  /opt/mysql/mysql/include/mysql
-  /opt/mysql/include
-  /opt/local/include/mysql5
-  /usr/local/mysql/include
-  /usr/local/mysql/include/mysql
-  $ENV{ProgramFiles}/MySQL/*/include
-  $ENV{PROGRAMFILES(x86)}/MySQL/*/include
-  $ENV{SystemDrive}/MySQL/*/include)
+FIND_PATH(MYSQL_INCLUDE_DIR
+  NAMES "mysql.h"
+  PATHS "/usr/include/mysql"
+  "/usr/local/include/mysql"
+  "/opt/mysql/mysql/include"
+  "/opt/mysql/mysql/include/mysql"
+  "/opt/mysql/include"
+  "/opt/local/include/mysql5"
+  "/usr/local/mysql/include"
+  "/usr/local/mysql/include/mysql"
+  "$ENV{ProgramFiles}/MySQL/*/include"
+  "$ENV{ProgramFiles(x86)}/MySQL/*/include"
+  "$ENV{SystemDrive}/MySQL/*/include"
+)

 #----------------- FIND MYSQL_LIB_DIR -------------------
 IF (WIN32)
@@ -59,14 +61,15 @@

   FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient
     PATHS
-    $ENV{MYSQL_DIR}/lib/${libsuffixDist}
-    $ENV{MYSQL_DIR}/libmysql
-    $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
-    $ENV{MYSQL_DIR}/client/${libsuffixBuild}
-    $ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}
-    $ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist}
-    $ENV{PROGRAMFILES(x86)}/MySQL/*/lib/${libsuffixDist}
-    $ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist})
+    "$ENV{MYSQL_DIR}/lib/${libsuffixDist}"
+    "$ENV{MYSQL_DIR}/libmysql"
+    "$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}"
+    "$ENV{MYSQL_DIR}/client/${libsuffixBuild}"
+    "$ENV{MYSQL_DIR}/libmysql/${libsuffixBuild}"
+    "$ENV{ProgramFiles}/MySQL/*/lib/${libsuffixDist}"
+    "$ENV{ProgramFiles(x86)}/MySQL/*/lib/${libsuffixDist}"
+    "$ENV{SystemDrive}/MySQL/*/lib/${libsuffixDist}"
+)
 ELSE (WIN32)
   FIND_LIBRARY(MYSQL_LIB NAMES mysqlclient_r
     PATHS


Link with -lrt (only for glibc versions before 2.17)

--- cmake/GhcHelper.cmake
+++ cmake/GhcHelper.cmake
@@ -12,7 +12,7 @@
             target_link_libraries(${targetName} -lc++fs)
         else()
             target_compile_options(${targetName} PRIVATE "-stdlib=libc++")
-            target_link_libraries(${targetName} -stdlib=libc++ -lc++fs)
+            target_link_libraries(${targetName} -stdlib=libc++ -lc++fs $<$<PLATFORM_ID:Linux>:rt>)
         endif()
     else()
         if(NOT APPLE)


Fix for #20408 - CMake LLVM_ENABLE_FFI=ON build fails on reconfigure

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

--- cmake/config-ix.cmake
+++ cmake/config-ix.cmake
@@ -258,12 +258,12 @@

 if( LLVM_ENABLE_FFI )
   find_path(FFI_INCLUDE_PATH ffi.h PATHS ${FFI_INCLUDE_DIR})
-  if( FFI_INCLUDE_PATH )
+  if( EXISTS "${FFI_INCLUDE_PATH}/ffi.h" )
     set(FFI_HEADER ffi.h CACHE INTERNAL "")
     set(HAVE_FFI_H 1 CACHE INTERNAL "")
   else()
     find_path(FFI_INCLUDE_PATH ffi/ffi.h PATHS ${FFI_INCLUDE_DIR})
-    if( FFI_INCLUDE_PATH )
+    if( EXISTS "${FFI_INCLUDE_PATH}/ffi/ffi.h" )
       set(FFI_HEADER ffi/ffi.h CACHE INTERNAL "")
       set(HAVE_FFI_FFI_H 1 CACHE INTERNAL "")
     endif()


ENH: upgrade diapotb git tag (master branch of 30/01/2020)

--- Modules/Remote/diapotb.remote.cmake
+++ Modules/Remote/diapotb.remote.cmake
@@ -22,5 +22,5 @@
 otb_fetch_module(DiapOTBModule
   "OTB module for SAR processing in Diapason."
   GIT_REPOSITORY https://gitlab.orfeo-toolbox.org/remote_modules/diapotb.git
-  GIT_TAG 1b46a3ca14a009779b277a9c43f4a59913462d1a
+  GIT_TAG 79f48869d2a50d588c35560df5ee9dac646418a8
 )


[OSX] Forgot to add resources to the new CMake macro

--- CMake/Utils/OgreConfigTargets.cmake
+++ CMake/Utils/OgreConfigTargets.cmake
@@ -231,6 +231,8 @@
       set_target_properties(${LIBNAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES} ${PLATFORM_HEADERS}")
       set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
       set_target_properties(${LIBNAME} PROPERTIES XCODE_ATTRIBUTE_GCC_PREFIX_HEADER "${OGRE_SOURCE_DIR}/OgreMain/include/OgreStableHeaders.h")
+      set_target_properties(${LIBNAME} PROPERTIES RESOURCE "${RESOURCE_FILES}")
+      set_source_files_properties("${RESOURCE_FILES}" PROPERTIES MACOSX_PACKAGE_LOCATION Resources)

       set_target_properties(${LIBNAME} PROPERTIES OUTPUT_NAME ${LIBNAME})
   endif()


[OSX] Forgot to add resources to the new CMake macro

--HG--
branch : v1-9


Fix ninja builds on Windows.

Fix ninja builds on Windows.

--HG--
branch : v1-9

--- CMake/Utils/PrecompiledHeader.cmake
+++ CMake/Utils/PrecompiledHeader.cmake
@@ -17,7 +17,7 @@
   get_filename_component(HEADER ${HEADER_FILE} NAME)

   # Use MSVC_IDE to exclude NMake from using PCHs
-  if (MSVC AND NOT NMAKE AND NOT OGRE_UNITY_BUILD)
+  if (MSVC AND NOT NMAKE AND NOT OGRE_UNITY_BUILD AND NOT ${CMAKE_GENERATOR} MATCHES Ninja)
 	add_definitions(/Yu"${HEADER}")
     set_source_files_properties(${SRC_FILE}
       PPROPERTIES COMPILE_FLAGS /Yc"${HEADER}"


Remove extraneous space.

Remove extraneous space.

--- CPM.cmake
+++ CPM.cmake
@@ -997,7 +997,7 @@
   set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)

   set(CPM_DEFINITIONS ${CPM_DEFINITIONS} PARENT_SCOPE)
-  set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS } PARENT_SCOPE)
+  set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} PARENT_SCOPE)

   # Set the appropriate preprocessor definition for this module and populate
   # our namespace header file.


Ensure each CPM module has access to a separate CPM include dir.

--- CPM.cmake
+++ CPM.cmake
@@ -156,14 +156,21 @@
 # file. See: http://stackoverflow.com/questions/12802377/in-cmake-how-can-i-find-the-directory-of-an-included-file
 set(CPM_DIR_OF_CPM ${CMAKE_CURRENT_LIST_DIR})

-# Delete old cpm header file.
-set(CPM_NS_HEADER_FILE "${CPM_DIR_OF_CPM}/include/cpm/cpm.h")
+# If CPM_UNIQUE_ID exists then use that as the base directory for CPM.
+# Note that we are already in the parent's namespace (we are not in a
+# function), so we directly modify the appropriate GLOBAL variables.
+if (defined CPM_UNIQUE_ID)
+  set(CPM_NS_HEADER_FILE "${CPM_DIR_OF_CPM}/include/${CPM_UNIQUE_ID}/cpm/cpm.h")
+  set(CPM_INCLUDE_DIRS "${CPM_DIR_OF_CPM}/include/${CPM_UNIQUE_ID}")
+else()
+  set(CPM_NS_HEADER_FILE "${CPM_DIR_OF_CPM}/include/cpm/cpm.h")
+  set(CPM_INCLUDE_DIRS "${CPM_DIR_OF_CPM}/include")
+endif()
+
+# Delete old cpm header file and begin constructing a new one.
 file(REMOVE ${CPM_NS_HEADER_FILE})
 file(APPEND ${CPM_NS_HEADER_FILE} "// This file was automatically generated by CPM.\n")
 file(APPEND ${CPM_NS_HEADER_FILE} "// It includes all automatically generated namespaces.\n")
-
-# Add the cpm include directory to our global variable.
-set(CPM_INCLUDE_DIRS "${CPM_DIR_OF_CPM}/include")

 # Function for parsing arguments and values coming into the specified function
 # name 'f'. 'name' is the target name. 'ns' (namespace) is a value prepended


Fix source directory retrieval bug.

Fix source directory retrieval bug.

--- CPM.cmake
+++ CPM.cmake
@@ -860,7 +860,7 @@

 function(CPM_GetSourceDir name VARIABLE_TO_SET)
   if (DEFINED CPM_KV_SOURCEDIR_MAP_${name})
-    set(${VARIABLE_TO_SET} CPM_KV_SOURCEDIR_MAP_${name} PARENT_SCOPE)
+    set(${VARIABLE_TO_SET} ${CPM_KV_SOURCEDIR_MAP_${name}} PARENT_SCOPE)
   else()
     message(FATAL_ERROR "${name} is not recognized as a module name")
   endif()


BUG: Wrong classpath separator on Windows

Updated the SCIFIO remote commit that is checked out. This new commit
contains logic to select the correct path separator on Windows and
OSX/Linux.

Previously this was hard-coded to the OSX path separator, which would
cause the itk-bridge-pipes jar to not be found.

Also includes cquammen's fixes for the ImageInfo test and reading
newlines on Windows.

Change-Id: I4c4a864443fedbe6439c18e8a18469c8560a9541

--- Modules/Remote/SCIFIO.remote.cmake
+++ Modules/Remote/SCIFIO.remote.cmake
@@ -1,5 +1,5 @@
 itk_fetch_module(SCIFIO
   "SCIFIO (Bioformats) ImageIO plugin for ITK"
   GIT_REPOSITORY https://github.com/scifio/scifio-imageio.git
-  GIT_TAG b4fe2d2ba4b5f0116a89cf3705e2900b0de926ee
+  GIT_TAG d096456994e0ac0e0cde7f3356e5fdbfac55c95f
   )


Make BUILD_TESTING optional

Make BUILD_TESTING optional

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -193,10 +193,15 @@
     set(res 1)

     # Write initial cache.
+    if (NOT DEFINED BUILD_TESTING)
+      set(BUILD_TESTING ON)
+    endif()
+
+    # Write initial cache.
     file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "
 CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
 CTEST_PROJECT_ADDITIONAL_TARGETS:INTERNAL=${CTEST_PROJECT_ADDITIONAL_TARGETS}
-BUILD_TESTING:BOOL=TRUE
+BUILD_TESTING:BOOL=${BUILD_TESTING}
 MITK_CTEST_SCRIPT_MODE:BOOL=TRUE
 CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION}
 QT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}


Run memcheck for subprojects and create sane defaults

--- CMake/MITKDashboardDriverScript.cmake
+++ CMake/MITKDashboardDriverScript.cmake
@@ -140,10 +140,19 @@
     ctest_submit(PARTS Coverage)
   endif ()

-  #if(WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
-  #  ctest_memcheck(BUILD "${build_dir}" INCLUDE_LABEL ${label})
-  #  ctest_submit(PARTS MemCheck)
-  #endif ()
+  if(WITH_MEMCHECK AND CTEST_MEMORYCHECK_COMMAND)
+    if(NOT CTEST_MEMORYCHECK_SUPPRESSIONS_FILE)
+      if(EXISTS "${CTEST_SOURCE_DIRECTORY}/CMake/valgrind.supp")
+        set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "${CTEST_SOURCE_DIRECTORY}/CMake/valgrind.supp")
+      endif()
+    endif()
+    if(NOT CTEST_MEMORYCHECK_COMMAND_OPTIONS)
+      set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "-q --tool=memcheck --leak-check=yes --show-reachable=no --show-possibly-lost=no --workaround-gcc296-bugs=yes --num-callers=50")
+    endif()
+    ctest_memcheck(BUILD "${build_dir}" INCLUDE_LABEL ${label})
+    ctest_submit(PARTS MemCheck)
+  endif ()
+
 endfunction()

 #---------------------------------------------------------------------


Fix networking CMake module

Fix networking CMake module

- Was failing when no security options where enabled

Signed-off-by: José Simões <1616ff7a83d123f98f8f38fa2524eab406644781@eclo.solutions>

--- CMake/Modules/FindNF_Networking.cmake
+++ CMake/Modules/FindNF_Networking.cmake
@@ -85,21 +85,27 @@
     set(NF_Security_Search_Path "${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl/OpenSSL")
 endif()

-# 2nd pass: security files if option is selected
-foreach(SRC_FILE ${NF_Networking_Security_SRCS})
-    set(NF_Networking_SRC_FILE SRC_FILE-NOTFOUND)
-    find_file(NF_Networking_SRC_FILE ${SRC_FILE}
-        PATHS
+if(USE_SECURITY_MBEDTLS_OPTION OR USE_SECURITY_OPENSSL_OPTION)

-            ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl
-            ${NF_Security_Search_Path}
-
-        CMAKE_FIND_ROOT_PATH_BOTH
-    )
-    # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
-    list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
-endforeach()
+    # 2nd pass: security files if option is selected
+    foreach(SRC_FILE ${NF_Networking_Security_SRCS})
+        set(NF_Networking_SRC_FILE SRC_FILE-NOTFOUND)
+        find_file(NF_Networking_SRC_FILE ${SRC_FILE}
+            PATHS
+
+                ${PROJECT_SOURCE_DIR}/src/PAL/COM/sockets/ssl
+                ${NF_Security_Search_Path}
+
+            CMAKE_FIND_ROOT_PATH_BOTH
+        )
+        # message("${SRC_FILE} >> ${NF_Networking_SRC_FILE}") # debug helper
+        list(APPEND NF_Networking_SOURCES ${NF_Networking_SRC_FILE})
+    endforeach()
+
+endif()
+

 include(FindPackageHandleStandardArgs)

+
 FIND_PACKAGE_HANDLE_STANDARD_ARGS(NF_Networking DEFAULT_MSG NF_Networking_INCLUDE_DIRS NF_Networking_SOURCES)


flags/hidden: modify C flags

flags/hidden: modify C flags

--- flags/hidden.cmake
+++ flags/hidden.cmake
@@ -10,7 +10,9 @@
 include(polly_add_cache_flag)

 polly_add_cache_flag(CMAKE_CXX_FLAGS "-fvisibility=hidden")
-polly_add_cache_flag(CMAKE_CXX_FLAGS "-fvisibility-inlines-hidden")
+polly_add_cache_flag(CMAKE_CXX_FLAGS "-fvisibility-inlines-hidden") # only C++
+
+polly_add_cache_flag(CMAKE_C_FLAGS "-fvisibility=hidden")

 # There is no macro to detect this flags on toolchain calculation so we must
 # mark this toolchain explicitly.


Modify FindSGCT.cmake file

Modify FindSGCT.cmake file

- Change tabs to spaces
- enable automatic detection of highest SGCT version
- enable automatic detection of Visual Studio version

--- ext/FindSGCT.cmake
+++ ext/FindSGCT.cmake
@@ -1,7 +1,5 @@
-
 # Find the library
 if(WIN32)
-
     # Check for visual studio
     if(NOT MSVC)
         message(FATAL_ERROR "Only visual studio supported!")
@@ -11,19 +9,26 @@
     add_definitions(-D__WIN32__)

     # search for SGCT, 64-bit and 32-bit
-    if(CMAKE_CL_64)
+    if (CMAKE_CL_64)
         set(SGCT_PATH "C:/Program Files/SGCT")
-    else(CMAKE_CL_64)
+    else (CMAKE_CL_64)
         set(SGCT_PATH "C:/Program Files (x86)/SGCT")
-    endif(CMAKE_CL_64)
+    endif (CMAKE_CL_64)
     file(GLOB SGCT_WINDOWS_PATHS "${SGCT_PATH}/SGCT_*")

-    FOREACH(path ${SGCT_WINDOWS_PATHS})
+    # sort and reverse the list to find the most recent (a.k.a. highest number) version
+    list(SORT SGCT_WINDOWS_PATHS)
+    list(REVERSE SGCT_WINDOWS_PATHS)
+
+    foreach(path ${SGCT_WINDOWS_PATHS})
         find_path(SGCT_ROOT_DIR include/sgct.h HINTS
             "${path}"
         )
-    ENDFOREACH(path)
-
+        if (SGCT_ROOT_DIR)
+            break()
+        endif ()
+    endforeach(path)
+
     # Check if found the SGCT root directory
     if(NOT SGCT_ROOT_DIR)
         message(FATAL_ERROR "Could not locate SGCT in ${SGCT_PATH}!")
@@ -31,42 +36,55 @@

     find_path(SGCT_ROOT_DIR include/sgct.h HINTS
-    	"${SGCT_WINDOWS_PATHS}"
-	)
-
-	# Find the sgct library
+        "${SGCT_WINDOWS_PATHS}"
+    )
+
+    # construct the correct library path
+    if (MSVC10)
+        set(SGCT_LIBRARY_FOLDER "${SGCT_ROOT_DIR}/lib/msvc10")
+    elseif (MSVC11)
+        set(SGCT_LIBRARY_FOLDER "${SGCT_ROOT_DIR}/lib/msvc11")
+    elseif (MSVC12)
+        set(SGCT_LIBRARY_FOLDER "${SGCT_ROOT_DIR}/lib/msvc12")
+    endif (MSVC10)
+
+    if (CMAKE_CL_64)
+        set(SGCT_LIBRARY_FOLDER "${SGCT_LIBRARY_FOLDER}_x64")
+    endif (CMAKE_CL_64)
+
+    # Find the sgct library
     set(SGCT_LIBRARY
         "ws2_32.lib"
-        optimized "${SGCT_ROOT_DIR}/lib/msvc11_x64/sgct.lib"
-        debug "${SGCT_ROOT_DIR}/lib/msvc11_x64/sgctd.lib"
+        optimized "${SGCT_LIBRARY_FOLDER}/sgct.lib"
+        debug "${SGCT_LIBRARY_FOLDER}/sgctd.lib"
     )
 else()
-	find_path(SGCT_ROOT_DIR include/sgct.h HINTS
-    	"/opt/local/include/sgct"
-    	"/usr/local/include/sgct"
-    	"/usr/include/sgct"
-    	"/opt/local"
-    	"/usr/local"
-		"/usr"
-	)
+    find_path(SGCT_ROOT_DIR include/sgct.h HINTS
+        "/opt/local/include/sgct"
+        "/usr/local/include/sgct"
+        "/usr/include/sgct"
+        "/opt/local"
+        "/usr/local"
+        "/usr"
+    )
     if(NOT SGCT_ROOT_DIR)
         message(FATAL_ERROR "Could not locate SGCT!")
     endif(NOT SGCT_ROOT_DIR)
-
-	# OS X has cpp11 support
-	if (APPLE)
-		set(SGCT_NAME "sgct_cpp11")
-	else(APPLE)
-		set(SGCT_NAME "sgct")
-	endif(APPLE)

-	# check if debug or release version of sgct should be used
-	if(CMAKE_BUILD_TYPE MATCHES DEBUG)
-		set(SGCT_NAME "${SGCT_NAME}d")
-	endif(CMAKE_BUILD_TYPE MATCHES DEBUG)
-
-	# Find the sgct library
-	find_library(SGCT_LIBRARY NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}${SGCT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
+    # OS X has cpp11 support
+    if (APPLE)
+        set(SGCT_NAME "sgct_cpp11")
+    else(APPLE)
+        set(SGCT_NAME "sgct")
+    endif(APPLE)
+
+    # check if debug or release version of sgct should be used
+    if(CMAKE_BUILD_TYPE MATCHES DEBUG)
+        set(SGCT_NAME "${SGCT_NAME}d")
+    endif(CMAKE_BUILD_TYPE MATCHES DEBUG)
+
+    # Find the sgct library
+    find_library(SGCT_LIBRARY NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}${SGCT_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
                  HINTS "${SGCT_ROOT_DIR}/lib")

 endif()
@@ -97,15 +115,15 @@
 endif (APPLE)

 if(UNIX AND NOT APPLE)
-	find_package(XRandR)
-	find_package(Xi)
-	if(NOT XRANDR_FOUND)
-		message(FATAL_ERROR "XRandR not found!")
-	endif(NOT XRANDR_FOUND)
-	if(NOT XI_FOUND)
-		message(FATAL_ERROR "Xi not found!")
-	endif(NOT XI_FOUND)
-	set(SGCT_DEPENDENCIES ${SGCT_DEPENDENCIES} ${XRANDR_LIBRARIES} ${XI_LIBRARIES})
+    find_package(XRandR)
+    find_package(Xi)
+    if(NOT XRANDR_FOUND)
+        message(FATAL_ERROR "XRandR not found!")
+    endif(NOT XRANDR_FOUND)
+    if(NOT XI_FOUND)
+        message(FATAL_ERROR "Xi not found!")
+    endif(NOT XI_FOUND)
+    set(SGCT_DEPENDENCIES ${SGCT_DEPENDENCIES} ${XRANDR_LIBRARIES} ${XI_LIBRARIES})
 endif(UNIX AND NOT APPLE)

 # includes
@@ -127,7 +145,7 @@
 if(SGCT_FOUND)
     MESSAGE(STATUS "SGCT found: ${SGCT_INCLUDES}/sgct.h")
 else()
-	MESSAGE(FATAL_ERROR "SGCT not found!")
+    MESSAGE(FATAL_ERROR "SGCT not found!")
 endif(SGCT_FOUND)


ENH: Bump Cuberille Commit Hash

ENH: Bump Cuberille Commit Hash

--- Modules/Remote/Cuberille.remote.cmake
+++ Modules/Remote/Cuberille.remote.cmake
@@ -17,5 +17,5 @@
 http://www.insight-journal.org/browse/publication/213
 "
   GIT_REPOSITORY ${git_protocol}://github.com/InsightSoftwareConsortium/ITKCuberille.git
-  GIT_TAG ff7fb806e9632a1b2c97ec49795756be9db2a12c
+  GIT_TAG 0fba9e190c931f34d31a362333765264101df1e8
   )


Boost install hook ported to CMake (Not tested)

--- blocks/boost/install/install.cmake
+++ blocks/boost/install/install.cmake
@@ -1,3 +1,86 @@
+function(BII_BOOST_INSTALL_SETUP)
+    #Tools
+    string(REGEX REPLACE  "\." "_" __BII_BOOST_VERSION_LABEL ${BII_BOOST_VERSION})
+
+    #Download and install
+    set(BII_BOOST_INSTALL_DIR ${BIICODE_ENV_DIR}/boost/${BII_BOOST_VERSION})
+    set(BII_BOOST_DIR ${BII_BOOST_INSTALL_DIR})
+    set(BII_BOOST_EXTRACT_DIR ${BIICODE_ENV_DIR}/tmp/boost/${BII_BOOST_VERSION}/sources)
+
+    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+        set(__BII_BOOST_PACKAGE_TYPE zip)
+    else()
+        set(__BII_BOOST_PACKAGE_TYPE tar)
+    endif()
+
+    set(BII_BOOST_PACKAGE boost_${__BII_BOOST_VERSION_LABEL}.${__BII_BOOST_PACKAGE_TYPE})
+    set(BII_BOOST_PACKAGE_PATH ${BII_BOOST_INSTALL_DIR}/${BII_BOOST_PACKAGE})
+
+    set(BII_BOOST_DOWNLOAD_URL "http://sourceforge.net/projects/boost/files/boost/${BII_BOOST_VERSION}/${BII_BOOST_PACKAGE}")
+
+    #Bootstrap
+    if(CMAKE_SYSTEM_NAME MATCHES "Windows")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.bat)
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2.exe)
+        set(__BII_BOOST_DEFAULT_TOOLSET msvc)
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh)
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2)
+        set(__BII_BOOST_DEFAULT_TOOLSET clang)
+    elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
+        set(__BII_BOOST_BOOSTRAPER ${BII_BOOST_DIR}/bootstrap.sh)
+        set(__BII_BOOST_B2         ${BII_BOOST_DIR}/b2)
+        set(__BII_BOOST_DEFAULT_TOOLSET gcc)
+    else()
+        message(FATAL_ERROR "Unknown platform. Stopping Boost installation")
+    endif()
+endfunction()
+
+
+function(BII_BOOST_DOWNLOAD)
+    if(NOT (EXISTS ${BII_BOOST_PACKAGE_PATH}))
+        message(INFO "Downloading Boost ${BII_BOOST_VERSION}...")
+
+        file(DOWNLOAD ${BII_BOOST_DOWNLOAD_URL} ${BII_BOOST_INSTALL_DIR}/${BII_BOOST_PACKAGE} SHOW_PROGRESS)
+    endif()
+
+    if(NOT (EXISTS ${BII_BOOST_DIR}))
+        message(STATUS "Extracting Boost ${BII_BOOST_VERSION}...")
+
+        execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ${BII_BOOST_PACKAGE_PATH} ${BII_BOOST_EXTRACT_DIR})
+
+        file(RENAME ${BII_BOOST_EXTRACT_DIR} ${BII_BOOST_INSTALL_DIR})
+    endif()
+endfunction()
+
+function(BII_BOOST_BOOTSTRAP)
+    message(STATUS "Bootstrapping Boost ${BII_BOOST_VERSION}...")
+
+    if((NOT (EXISTS ${__BII_BOOST_B2})) OR (${BII_BOOST_BUILD_FORCE}))
+        execute_process(COMMAND "${__BII_BOOST_BOOSTRAPER} --prefix=${BII_BOOST_DIR}"
+                        WORKING_DIRECTORY ${BII_BOOST_DIR})
+    else()
+        message(WARNING "Boost boostrapping aborted! b2 file already exists. Set BII_BOOST_BUILD_FORCE to override")
+    endif()
+endfunction()
+
+function(BII_BOOST_BUILD)
+    message(STATUS "Building Boost ${BII_BOOST_VERSION} with toolset ${BII_BOOST_TOOLSET}...")
+
+    if((NOT (EXISTS ${BII_BOOST_DIR}/stage)))
+        execute_process(COMMAND "${__BII_BOOST_B2} --includedir=${BII_BOOST_DIR} --toolset=${BII_BOOST_TOOLSET} -j${BII_BOOST_BUILD_J} --layout=versioned --build-type=complate"
+                        WORKING_DIRECTORY ${BII_BOOST_DIR})
+    else()
+        message(WARNING "Boost build aborted! Build output folder (${BII_BOOST_DIR}/stage) already exists. Set BII_BOOST_BUILD_FORCE to override")
+    endif()
+endfunction()
+
+function(BII_BOOST_INSTALL)
+    BII_BOOST_INSTALL_SETUP()
+    BII_BOOST_DOWNLOAD()
+    BII_BOOST_BOOTSTRAP()
+    BII_BOOST_BUILD()
+endfunction()

 macro(BII_BOOST)
     message("Setting up biicode boost...")
@@ -8,7 +91,7 @@
         set(BII_BOOST_VERSION ${ARGV0}) #For the future
     endif()

-    set(BOOST_ROOT       "${BIICODE_ENV_DIR}/boost/${BII_BOOST_VERSION}/sources")
+    set(BOOST_ROOT       "${BII_BOOST_DIR}")
     set(BOOST_INCLUDEDIR "${BOOST_ROOT}")
     set(BOOST_LIBRARYDIR "${BOOST_ROOT}/stage/lib/")

@@ -23,6 +106,6 @@
         message(" - BOOST_INCLUDEDIR ${BOOST_INCLUDEDIR}")
         message(" - BOOST_LIBRARYDIR ${BOOST_LIBRARYDIR}")
     else()
-        message(ERROR "Boost not found!")
+        message(FATAL_ERROR "Boost not found!")
     endif()
 endmacro()


ENH: update superbuild shark git tag to a newer version on master branch

--- SuperBuild/CMake/External_shark.cmake
+++ SuperBuild/CMake/External_shark.cmake
@@ -30,8 +30,8 @@

 ExternalProject_Add(SHARK
   PREFIX SHARK
-  URL "https://github.com/Shark-ML/Shark/archive/a0d1f816f474b968adbf7592bff199a96a87efc1.zip"
-  URL_MD5 ed0e8eb73743b39a93775599761a9273
+  URL "https://github.com/Shark-ML/Shark/archive/3394e5f553e020ef5b093f388bdba29247600dbd.zip"
+  URL_MD5 7a3e6d45386328e7a22e1f6a6453260d
   SOURCE_DIR ${SHARK_SB_SRC}
   BINARY_DIR ${SHARK_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


added 2019

added 2019

--- SuperBuild/External_TomoPhantom.cmake
+++ SuperBuild/External_TomoPhantom.cmake
@@ -3,8 +3,8 @@
 # Author: Kris Thielemans
 # Author: Edoardo Pasca
 # Author: Casper da Costa-Luis
-# Copyright 2017, 2018 University College London
-# Copyright 2017, 2018 STFC
+# Copyright 2017, 2019 University College London
+# Copyright 2017, 2019 STFC
 # Copyright 2019 King's College London
 #
 # This file is part of the CCP PETMR Synergistic Image Reconstruction Framework (SIRF) SuperBuild.


Find Lib OpenSSL: Reformat CMake code

Find Lib OpenSSL: Reformat CMake code

--- cmake/Modules/FindLibOpenSSL.cmake
+++ cmake/Modules/FindLibOpenSSL.cmake
@@ -1,3 +1,4 @@
+# ~~~
 # Try to find the OpenSSL library.
 #
 # Defines:
@@ -10,29 +11,28 @@
 #
 # Redistribution and use is allowed according to the terms of the BSD license.
 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
+# ~~~

 if (NOT OPENSSL_FOUND)
-  include (FindPkgConfig)
-  pkg_search_module (OPENSSL QUIET openssl)
+	include (FindPkgConfig)
+	pkg_search_module (OPENSSL QUIET openssl)
 endif ()

 if (OPENSSL_FOUND)
-  # try to compile and link a minimal sample program against libcrypto
-  try_compile (HAS_OPENSSL_4SURE
-    "${CMAKE_BINARY_DIR}"
-    "${PROJECT_SOURCE_DIR}/src/plugins/crypto/compile_openssl.c"
-    CMAKE_FLAGS
-      -DINCLUDE_DIRECTORIES:STRING=${OPENSSL_INCLUDE_DIR}
-      -DLINK_LIBRARIES:PATH=${OPENSSL_LIBRARIES}
-  )

-  if (NOT HAS_OPENSSL_4SURE)
-    message (STATUS "OpenSSL compile/linker test failed")
-    set (OPENSSL_FOUND OFF)
-    set (OPENSSL_INCLUDE_DIR "")
-    set (OPENSSL_LIBRARIES "")
-  endif ()
+	# try to compile and link a minimal sample program against libcrypto
+	try_compile (HAS_OPENSSL_4SURE
+		     "${CMAKE_BINARY_DIR}"
+		     "${PROJECT_SOURCE_DIR}/src/plugins/crypto/compile_openssl.c"
+		     CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${OPENSSL_INCLUDE_DIR}
+				 -DLINK_LIBRARIES:PATH=${OPENSSL_LIBRARIES})

-  unset (HAS_OPENSSL_4SURE)
+	if (NOT HAS_OPENSSL_4SURE)
+		message (STATUS "OpenSSL compile/linker test failed")
+		set (OPENSSL_FOUND OFF)
+		set (OPENSSL_INCLUDE_DIR "")
+		set (OPENSSL_LIBRARIES "")
+	endif ()
+
+	unset (HAS_OPENSSL_4SURE)
 endif ()


[CMake] Remove duplicated cache variable. NFC.

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

--- cmake/modules/LLDBStandalone.cmake
+++ cmake/modules/LLDBStandalone.cmake
@@ -16,8 +16,6 @@
   find_package(Clang REQUIRED CONFIG
     HINTS "${LLDB_PATH_TO_CLANG_BUILD}" NO_CMAKE_FIND_ROOT_PATH)

-  # We set LLVM_MAIN_INCLUDE_DIR so that it gets included in TableGen flags.
-  set(LLVM_MAIN_INCLUDE_DIR "${LLVM_BUILD_MAIN_INCLUDE_DIR}" CACHE PATH "Path to LLVM's source include dir")
   # We set LLVM_CMAKE_PATH so that GetSVN.cmake is found correctly when building SVNVersion.inc
   set(LLVM_CMAKE_PATH ${LLVM_CMAKE_DIR} CACHE PATH "Path to LLVM CMake modules")


Set plplotwxwidgets_SOVERSION and plplotwxwidgets_VERSION so that
libplplotwxwidgets can be symlinked properly on Unix.

svn path=/trunk/; revision=7361

--- cmake/modules/plplot_version.cmake
+++ cmake/modules/plplot_version.cmake
@@ -54,6 +54,9 @@
 set(plplottcltk_SOVERSION 9)
 set(plplottcltk_VERSION ${plplottcltk_SOVERSION}.2.0)

+set(plplotwxwidgets_SOVERSION 0)
+set(plplotwxwidgets_VERSION ${plplotwxwidgets_SOVERSION}.0.0)
+
 # According to man package, PLPLOT_TCL_VERSION (used in the various
 # pkgIndex.tcl scripts) should be strictly numbers alternativing with
 # decimal points with the first number (the major number) signifying


added a new flag to ignore unknown doc type

--- cmake/platforms/Darwin-clang.cmake
+++ cmake/platforms/Darwin-clang.cmake
@@ -18,6 +18,8 @@
     -Wno-exit-time-destructors
     # Turn this on to detect documentation errors (very useful)
     -Wno-documentation
+    # Ignore unknown documentation command (There are nrecognized but valid doxygen commands !)
+    -Wno-documentation-unknown-command
     # Too many of sign conversion problems. Ignore them for the moment.
     #-Wno-sign-
     # Ignore warnings about C++98 compatibility


remove stale, hopelessly out of date cmake file.

--- lib/OpenCogConfig.cmake
+++ lib/OpenCogConfig.cmake
@@ -1,183 +0,0 @@
-# Copyright (c) 2008, OpenCog.org (http://opencog.org)
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-# - Try to find the OPENCOG library; Once done this will define
-#
-# OPENCOG_FOUND            - system has the OPENCOG library
-# OPENCOG_INCLUDE_DIRS     - the OPENCOG include directory
-# OPENCOG_LIBRARIES        - The libraries needed to use OPENCOG
-# OPENCOG_MODULES_DIR      - The directory with opencog's modules
-#
-# OPENCOG_<COMPONENT>_DIRS      - the include directory of component <COMPONENT>
-# OPENCOG_<COMPONENT>_LIBRARIES - the libraries needed by component <COMPONENT>
-#
-# <COMPONENT> is always lowercase. For instance, 'atomtable', 'xml', 'server',
-# 'scheme', etc.
-
-SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OpenCog_DIR})
-
-# first, check opencog dependencies
-IF (WIN32)
-	FIND_PACKAGE(PThreads REQUIRED)
-	FIND_PACKAGE(STLPort REQUIRED)
-	SET(OPENCOG_INCLUDE_DIR ${PTHREADS_INCLUDE_DIR} ${STLPORT_INCLUDE_DIR})
-	SET(OPENCOG_LIBRARY ${PTHREADS_LIBRARY} ${STLPORT_LIBRARIES})
-	ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
-ELSE (WIN32)
-	SET(OPENCOG_LIBRARY pthread)
-ENDIF (WIN32)
-
-FIND_PACKAGE(CSockets REQUIRED)
-FIND_PACKAGE(OpenSSL REQUIRED)
-
-SET(Boost_USE_STATIC_LIBS OFF)
-SET(Boost_USE_MULTITHREAD ON)
-FIND_PACKAGE(Boost COMPONENTS signals REQUIRED)
-
-# FIND_PACKAGE(LibMemCached)
-# Enable the use of SQL storage, if either iodbc of unixodbc is found.
-# Caution: this can also increase RAM usage significantly!
-FIND_PACKAGE(IODBC QUIET)
-IF (IODBC_FOUND)
-	ADD_DEFINITIONS(-DHAVE_SQL_STORAGE)
-	SET(ODBC_FOUND 1)
-	SET(ODBC_INCLUDE_DIRS ${IODBC_INCLUDE_DIRS})
-	SET(ODBC_LIBRARIES ${IODBC_LIBRARIES})
-ELSE (IODBC_FOUND)
-	FIND_PACKAGE(UnixODBC QUIET)
-	IF (UnixODBC_FOUND)
-		ADD_DEFINITIONS(-DHAVE_SQL_STORAGE)
-		SET(ODBC_FOUND 1)
-		SET(ODBC_INCLUDE_DIRS ${UnixODBC_INCLUDE_DIRS})
-		SET(ODBC_LIBRARIES ${UnixODBC_LIBRARIES})
-	ELSE (UnixODBC_FOUND)
-		SET(ODBC_FOUND 0)
-		SET(ODBC_DIR_MESSAGE "Neither IODBC or UnixODBC was found. Make sure [Unix|I]ODBC_LIBRARIES and [Unix|I]ODBC_INCLUDE_DIRS are set.")
-	ENDIF (UnixODBC_FOUND)
-ENDIF (IODBC_FOUND)
-
-FIND_PACKAGE(Guile 1.8.5)
-IF (GUILE_FOUND)
-	ADD_DEFINITIONS(-DHAVE_GUILE)
-ENDIF (GUILE_FOUND)
-
-# Gnu Scientific Library
-FIND_PACKAGE(GSL)
-IF (GSL_FOUND)
-	ADD_DEFINITIONS(-DHAVE_GSL)
-ENDIF (GSL_FOUND)
-
-# XML parsing library
-FIND_PACKAGE(EXPAT)
-IF (EXPAT_FOUND)
-	ADD_DEFINITIONS(-DHAVE_EXPAT)
-ENDIF (EXPAT_FOUND)
-
-# At this time,. there is no reason to build with memcached for
-# any "normal" use, so just stub it out.
-# IF (LIBMEMCACHED_FOUND)
-#	ADD_DEFINITIONS(-DHAVE_LIBMEMCACHED)
-# ENDIF (LIBMEMCACHED_FOUND)
-
-
-# set variables with the dependencies of each opencog component
-SET(OPENCOG_BASE_INCLUDE_DIR            ${Boost_INCLUDE_DIRS})
-SET(OPENCOG_ATOMSPACE_DEPS_LIBRARIES    ${Boost_SIGNALS_LIBRARY})
-SET(OPENCOG_ATTENTION_DEPS_INCLUDE_DIRS ${GSL_INCLUDE_DIRS})
-SET(OPENCOG_ATTENTION_DEPS_LIBRARIES    ${GSL_LIBRARIES})
-SET(OPENCOG_PERSIST_DEPS_INCLUDE_DIRS   ${ODBC_INCLUDE_DIRS})
-SET(OPENCOG_PERSIST_DEPS_LIBRARIES      ${ODBC_LIBRARIES})
-SET(OPENCOG_SCHEME_DEPS_INCLUDE_DIRS    ${GUILE_INCLUDE_DIRS})
-SET(OPENCOG_SCHEME_DEPS_LIBRARIES       ${GUILE_LIBRARIES})
-SET(OPENCOG_SERVER_DEPS_INCLUDE_DIRS    ${CSOCKETS_INCLUDE_DIRS})
-SET(OPENCOG_SERVER_DEPS_LIBRARIES       ${CSOCKETS_LIBRARIES} ${OPENSSL_LIBRARIES})
-SET(OPENCOG_XML_DEPS_INCLUDE_DIRS       ${EXPAT_INCLUDE_DIRS})
-SET(OPENCOG_XML_DEPS_LIBRARIES          ${EXPAT_LIBRARIES})
-
-# then process the opencog library itself
-GET_FILENAME_COMPONENT(OPENCOG_PREFIX ${OpenCog_DIR} ABSOLUTE)
-
-MACRO(TEST_PREFIX _PREFIX _VAR)
-    SET(${_VAR} 0)
-    IF (EXISTS "${_PREFIX}/include" AND EXISTS "${_PREFIX}/lib")
-		SET(${_VAR} 1)
-    ENDIF (EXISTS "${_PREFIX}/include" AND EXISTS "${_PREFIX}/lib")
-	IF (NOT ${${_VAR}} AND "${_PREFIX}" STREQUAL "/")
-		SET(${_VAR} 1)
-	ENDIF (NOT ${${_VAR}} AND "${_PREFIX}" STREQUAL "/")
-ENDMACRO(TEST_PREFIX)
-
-TEST_PREFIX(${OPENCOG_PREFIX} OPENCOG_PREFIX_FOUND)
-WHILE (NOT ${OPENCOG_PREFIX_FOUND})
-	GET_FILENAME_COMPONENT(OPENCOG_PREFIX "${OPENCOG_PREFIX}" PATH)
-	TEST_PREFIX(${OPENCOG_PREFIX} OPENCOG_PREFIX_FOUND)
-ENDWHILE (NOT ${OPENCOG_PREFIX_FOUND})
-
-FIND_PATH(OPENCOG_INCLUDE_DIR opencog/atomspace/AtomSpace.h PATHS "${OPENCOG_PREFIX}/include" "$ENV{OPENCOG_PREFIX}/include")
-
-IF ("${OpenCog_FIND_COMPONENTS}" STREQUAL "")
-	SET(OpenCog_FIND_COMPONENTS atomspace)
-ENDIF ("${OpenCog_FIND_COMPONENTS}" STREQUAL "")
-FOREACH (COMPONENT ${OpenCog_FIND_COMPONENTS})
-	STRING(TOUPPER "${COMPONENT}" UPPER_COMPONENT)
-	FIND_LIBRARY(OPENCOG_${UPPER_COMPONENT}_LIBRARY NAMES "${COMPONENT}" PATH_SUFFIXES "opencog" PATHS "${OPENCOG_PREFIX}/lib" "$ENV{OPENCOG_PREFIX}/lib")
-	IF (OPENCOG_${UPPER_COMPONENT}_LIBRARY)
-		SET (OPENCOG_INCLUDE_DIR ${OPENCOG_INCLUDE_DIR} ${OPENCOG_${UPPER_COMPONENT}_DEPS_INCLUDE_DIR})
-		SET (OPENCOG_LIBRARY ${OPENCOG_LIBRARY} ${OPENCOG_${UPPER_COMPONENT}_LIBRARY} ${OPENCOG_${UPPER_COMPONENT}_DEPS_LIBRARIES})
-		SET (OPENCOG_MODULE_FILE ${OPENCOG_${UPPER_COMPONENT}_LIBRARY})
-	ENDIF (OPENCOG_${UPPER_COMPONENT}_LIBRARY)
-ENDFOREACH(COMPONENT)
-
-IF (OPENCOG_INCLUDE_DIR AND OPENCOG_LIBRARY)
-	SET (OPENCOG_FOUND 1)
-	SET (OPENCOG_INCLUDE_DIRS ${OPENCOG_BASE_INCLUDE_DIR} ${OPENCOG_INCLUDE_DIR})
-	SET (OPENCOG_LIBRARIES ${OPENCOG_LIBRARY})
-	FOREACH (COMPONENT ${OpenCog_FIND_COMPONENTS})
-		STRING(TOUPPER "${COMPONENT}" UPPER_COMPONENT)
-		SET (OPENCOG_${UPPER_COMPONENT}_INCLUDE_DIRS ${OPENCOG_BASE_INCLUDE_DIR} ${OPENCOG_${UPPER_COMPONENT}_LIBRARY} ${OPENCOG_${UPPER_COMPONENT}_DEPS_LIBRARIES})
-		SET (OPENCOG_${UPPER_COMPONENT}_LIBRARIES ${OPENCOG_${UPPER_COMPONENT}_LIBRARY} ${OPENCOG_${UPPER_COMPONENT}_DEPS_LIBRARIES})
-	ENDFOREACH (COMPONENT)
-	GET_FILENAME_COMPONENT(OPENCOG_MODULES_DIR ${OPENCOG_MODULE_FILE} PATH)
-ELSE (OPENCOG_INCLUDE_DIR AND OPENCOG_LIBRARY)
-	SET (OPENCOG_FOUND 0)
-	SET (OPENCOG_PREFIX "OPENCOG_PREFIX-NOTFOUND" CACHE PATH "Opencog's base dir")
-ENDIF (OPENCOG_INCLUDE_DIR AND OPENCOG_LIBRARY)
-
-# define atom type script macro
-MACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE)
-    ADD_CUSTOM_COMMAND (
-        COMMAND "${CMAKE_COMMAND}" -DSCRIPT_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${SCRIPT_FILE}\" -DHEADER_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}\" -DDEFINITIONS_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${DEFINITIONS_FILE}\" -DINHERITANCE_FILE=\"${CMAKE_CURRENT_SOURCE_DIR}/${INHERITANCE_FILE}\" -P "${OpenCog_DIR}/OpenCogAtomTypes.cmake"
-        OUTPUT  "${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}" "${CMAKE_CURRENT_SOURCE_DIR}/${DEFINITIONS_FILE}" "${CMAKE_CURRENT_SOURCE_DIR}/${INHERITANCE_FILE}"
-        DEPENDS "${SCRIPT_FILE}"
-        WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
-        COMMENT "Generating opencog types"
-    )
-ENDMACRO(OPENCOG_ADD_ATOM_TYPES SCRIPT_FILE HEADER_FILE DEFINITIONS_FILE INHERITANCE_FILE)
-
-MARK_AS_ADVANCED (
-	OPENCOG_INCLUDE_DIR
-	OPENCOG_LIBRARY
-	OPENCOG_PREFIX
-	OPENCOG_BASE_INCLUDE_DIR
-)
-FOREACH (COMPONENT ${OpenCog_FIND_COMPONENTS})
-	STRING(TOUPPER "${COMPONENT}" UPPER_COMPONENT)
-	MARK_AS_ADVANCED(
-		OPENCOG_${UPPER_COMPONENT}_INCLUDE_DIR
-		OPENCOG_${UPPER_COMPONENT}_LIBRARY
-	)
-ENDFOREACH (COMPONENT ${OpenCog_FIND_COMPONENTS})
-
-IF (NOT OPENCOG_FOUND)
-	SET (OPENCOG_DIR_MESSAGE "OPENCOG was not found. Either set the \"OPENCOG_INCLUDE_DIR\" and \"OPENCOG_LIBRARIES\" cmake variables or set the \"OPENCOG_PREFIX\" variable to your opencog's base dir and rerun cmake.")
-	IF (NOT OPENCOG_FIND_QUIETLY)
-		IF (OPENCOG_FIND_REQUIRED)
-			MESSAGE (FATAL_ERROR "[FATAL ERROR]: ${OPENCOG_DIR_MESSAGE}")
-		ELSE (NOT OPENCOG_FIND_REQUIRED)
-			MESSAGE (STATUS "[ERROR] ${OPENCOG_DIR_MESSAGE}")
-		ENDIF (OPENCOG_FIND_REQUIRED)
-	ENDIF (NOT OPENCOG_FIND_QUIETLY)
-ENDIF (NOT OPENCOG_FOUND)


Switch back to functions.

Switch back to functions.

Determined what the problem is. We have an intermediate CMakeLists.txt
file in Spire.

--- CPM.cmake
+++ CPM.cmake
@@ -443,12 +443,12 @@
   else()
     # Add our definition to the list of pre-existing preproc items.
     # We use this list to clear out existing entries in our subdirectories.
-    set(${CPM_KV_PREPROC_NS_MAP_${__CPM_LAST_MODULE_PREPROC}} ${fullUNID})# PARENT_SCOPE)
-    set(CPM_KV_LIST_PREPROC_NS_MAP ${CPM_KV_LIST_PREPROC_NS_MAP} ${__CPM_LAST_MODULE_PREPROC})# PARENT_SCOPE)
+    set(${CPM_KV_PREPROC_NS_MAP_${__CPM_LAST_MODULE_PREPROC}} ${fullUNID} PARENT_SCOPE)
+    set(CPM_KV_LIST_PREPROC_NS_MAP ${CPM_KV_LIST_PREPROC_NS_MAP} ${__CPM_LAST_MODULE_PREPROC} PARENT_SCOPE)
   endif()

   # Add the interface definition to our list of preprocessor definitions.
-  set(CPM_DEFINITIONS ${CPM_DEFINITIONS} "-D${__CPM_LAST_MODULE_PREPROC}=${fullUNID}")# PARENT_SCOPE)
+  set(CPM_DEFINITIONS ${CPM_DEFINITIONS} "-D${__CPM_LAST_MODULE_PREPROC}=${fullUNID}" PARENT_SCOPE)

   # Clear our variable.
   set(__CPM_LAST_MODULE_PREPROC)
@@ -471,7 +471,7 @@

 # name - Required as this name determines what preprocessor definition will
 #        be generated for this module.
-macro(CPM_AddModule name)
+function(CPM_AddModule name)

   # Parse all function arguments into our namespace prepended with _CPM_.
   _cpm_parse_arguments(CPM_AddModule _CPM_ "${ARGN}")
@@ -711,17 +711,17 @@
   # Add the module version to the map.
   if (NOT DEFINED CPM_KV_MOD_VERSION_MAP_${__CPM_PATH_UNID})
     # Add this entry to the map list.
-    set(CPM_KV_LIST_MOD_VERSION_MAP ${CPM_KV_LIST_MOD_VERSION_MAP} ${__CPM_PATH_UNID}) #PARENT_SCOPE)
-  endif()
-  set(CPM_KV_MOD_VERSION_MAP_${__CPM_PATH_UNID} ${__CPM_PATH_UNID_VERSION}) #PARENT_SCOPE)
+    set(CPM_KV_LIST_MOD_VERSION_MAP ${CPM_KV_LIST_MOD_VERSION_MAP} ${__CPM_PATH_UNID} PARENT_SCOPE)
+  endif()
+  set(CPM_KV_MOD_VERSION_MAP_${__CPM_PATH_UNID} ${__CPM_PATH_UNID_VERSION} PARENT_SCOPE)

   # Setup module interface definition. This is the name the module is using
   # to identify itself in it's headers.
-  if (DEFINED CPM_LAST_MODULE_NAME)
-    _cpm_check_and_add_preproc(${name} ${CPM_LAST_MODULE_NAME} ${__CPM_FULL_UNID})
-  else()
-    message(FATAL_ERROR "A ${CPM_LAST_MODULE_NAME} module (${__CPM_MODULE_SOURCE_DIR}) failed to define its name!")
-  endif()
+  #if (DEFINED CPM_LAST_MODULE_NAME)
+  #  _cpm_check_and_add_preproc(${name} ${CPM_LAST_MODULE_NAME} ${__CPM_FULL_UNID})
+  #else()
+  #  message(FATAL_ERROR "A ${CPM_LAST_MODULE_NAME} module (${__CPM_MODULE_SOURCE_DIR}) failed to define its name!")
+  #endif()

   # Set the appropriate preprocessor definition for this module and populate
   # our namespace header file.
@@ -731,10 +731,8 @@
   set(__CPM_MODULE_PREPROC)

   # Append target to pre-existing libraries.
-  #set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
-  #set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}/include" PARENT_SCOPE)
-  set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}")
-  set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}/include")
+  set(CPM_LIBRARIES ${CPM_LIBRARIES} "${CPM_TARGET_NAME}" PARENT_SCOPE)
+  set(CPM_INCLUDE_DIRS ${CPM_INCLUDE_DIRS} "${__CPM_MODULE_SOURCE_DIR}/include" PARENT_SCOPE)

   if (DEFINED CPM_SHOW_HIERARCHY)
     if(__CPM_USING_GIT)
@@ -746,8 +744,8 @@

   # Now propogate the version map upwards (we don't really *need* to do this).
   # But makes it clear what we are trying to do.
-  #_cpm_propogate_version_map_up()
-endmacro()
+  _cpm_propogate_version_map_up()
+endfunction()

 function(CPM_AddExternal name)
   # Attempt to find common directory for external project build recipes?


Change check order in UseTLS.cmake to avoid using declspec(thread) with clang

--- gpkg/cmake/UseTLS.cmake
+++ gpkg/cmake/UseTLS.cmake
@@ -19,6 +19,21 @@
   endif()

   if( NOT ___TLS )
+    message( STATUS "Checking if pthread_getspecific is supported" )
+    find_package ( Threads )
+    if ( CMAKE_USE_PTHREADS_INIT )
+      set( TLS_USE_PTHREAD 1 )
+      set( ___TLS ${TLS_USE_PTHREAD} )
+    endif()
+    if (${TLS_USE_PTHREAD})
+      message( STATUS "Checking if pthread_getspecific is supported - yes" )
+      set( TLS_USE_PTHREAD ${TLS_USE_PTHREAD} PARENT_SCOPE )
+    else()
+      message( STATUS "Checking if pthread_getspecific is supported - no" )
+    endif()
+  endif()
+
+  if( NOT ___TLS )
     message( STATUS "Checking if __declspec( thread ) is supported" )
     check_c_source_compiles(
       "__declspec( thread ) int i; int main(int argc, char **argv) { return 1; }"
@@ -33,20 +48,5 @@
     endif()
   endif()

-  if( NOT ___TLS )
-    message( STATUS "Checking if pthread_getspecific is supported" )
-    find_package ( Threads )
-    if ( CMAKE_USE_PTHREADS_INIT )
-      set( TLS_USE_PTHREAD 1 )
-      set( ___TLS ${TLS_USE_PTHREAD} )
-    endif()
-    if (${TLS_USE_PTHREAD})
-      message( STATUS "Checking if pthread_getspecific is supported - yes" )
-      set( TLS_USE_PTHREAD ${TLS_USE_PTHREAD} PARENT_SCOPE )
-    else()
-      message( STATUS "Checking if pthread_getspecific is supported - no" )
-    endif()
-  endif()
-
   message( STATUS "Determining available thread-local storage mechanism - Done" )
-endfunction()+endfunction()


fixing c++ wrappers. Tested on IBM BG/Q architecture. One more iteration will be needed to get the best out of MPI.cmake existing implementations. Good enough for now

--- MPI.cmake
+++ MPI.cmake
@@ -20,26 +20,26 @@
 # Start with the list of MPI wrappers. Acknowledgement to http://www.openflipper.org/svnrepo/CoMISo/trunk/CoMISo/cmake/FindMPI.cmake
 # Generic MPI compilers
 set(_MPI_C_COMPILER_NAMES                  "mpicc|mpcc|mpicc_r|mpcc_r")
-set(_MPI_CXX_COMPILER_NAMES                "mpicxx|mpiCC|mpcxx|mpCC|mpic++|mpc++")
+set(_MPI_CXX_COMPILER_NAMES                "mpicxx|mpiCC|mpcxx|mpCC|mpic[++]|mpc[++]")
 # GNU compiler names
 set(_MPI_GNU_C_COMPILER_NAMES              "mpigcc|mpgcc|mpigcc_r|mpgcc_r")
-set(_MPI_GNU_CXX_COMPILER_NAMES            "mpig++|mpg++|mpig++_r|mpg++_r")
+set(_MPI_GNU_CXX_COMPILER_NAMES            "mpig[++]|mpg[++]|mpig[++]_r|mpg[++]_r")
 # Intel MPI compiler names
 set(_MPI_Intel_C_COMPILER_NAMES            "mpiicc")
-set(_MPI_Intel_CXX_COMPILER_NAMES          "mpiicpc|mpiicxx|mpiic++|mpiiCC")
+set(_MPI_Intel_CXX_COMPILER_NAMES          "mpiicpc|mpiicxx|mpiic[++]|mpiiCC")
 # PGI compiler names
 set(_MPI_PGI_C_COMPILER_NAMES              "mpipgcc|mppgcc")
 set(_MPI_PGI_CXX_COMPILER_NAMES            "mpipgCC|mppgCC")
 # XLC MPI Compiler names
 set(_MPI_XL_C_COMPILER_NAMES               "mpxlc|mpxlc_r|mpixlc|mpixlc_r")
-set(_MPI_XL_CXX_COMPILER_NAMES             "mpixlcxx|mpixlC|mpixlc++|mpxlcxx|mpxlc++|mpixlc++|mpxlCC|
-                                           mpixlcxx_r|mpixlC_r|mpixlc++_r|mpxlcxx_r|mpxlc++_r|mpixlc++_r|mpxlCC_r")
+set(_MPI_XL_CXX_COMPILER_NAMES             "mpixlcxx|mpixlC|mpixlc[++]|mpxlcxx|mpxlc[++]|mpixlc[++]|mpxlCC|
+                                           mpixlcxx_r|mpixlC_r|mpixlc[++]_r|mpxlcxx_r|mpxlc[++]_r|mpixlc[++]_r|mpxlCC_r")

 # Find CC and CXX MPI wrappers
 string(REGEX MATCH "${_MPI_C_COMPILER_NAMES}|${_MPI_GNU_C_COMPILER_NAMES}|${_MPI_Intel_C_COMPILER_NAMES}|
-                    ${_MPI_PGI_C_COMPILER_NAMES}|${_MPI_XL_C_COMPILER_NAMES}")
-string(REGEX MATCH "mpicc|mpixlc|mpixlc_r|mpicc_r|mpiicc|mpipgcc|mppgcc|" MPICC_COMPILER "${CMAKE_C_COMPILER}")
-#string(REGEX MATCH "mpicxx|mpixlcxx|mpixlcxx_r|mpicxx_r|" MPICXX_COMPILER "${CMAKE_CXX_COMPILER}")
+                    ${_MPI_PGI_C_COMPILER_NAMES}|${_MPI_XL_C_COMPILER_NAMES}" MPICC_COMPILER "${CMAKE_C_COMPILER}")
+string(REGEX MATCH "${_MPI_CXX_COMPILER_NAMES}|${_MPI_GNU_CXX_COMPILER_NAMES}|${_MPI_Intel_CXX_COMPILER_NAMES}|
+                    ${_MPI_PGI_CXX_COMPILER_NAMES}|${_MPI_XL_CXX_COMPILER_NAMES}" MPICXX_COMPILER "${CMAKE_CXX_COMPILER}")

 # Debugging
 #message(STATUS "Value of MPICC_COMPILER: " ${MPICC_COMPILER})


Add all config defs that are not releated to tests.

--- install_java.cmake
+++ install_java.cmake
@@ -72,6 +72,36 @@

 install(FILES
     chain/src/main/resources/configdefinitions/chains.def
+    configdefinitions/src/vespa/application-id.def
+    configdefinitions/src/vespa/attributes.def
+    configdefinitions/src/vespa/cluster-info.def
+    configdefinitions/src/vespa/cluster-list.def
+    configdefinitions/src/vespa/configserver.def
+    configdefinitions/src/vespa/fleetcontroller.def
+    configdefinitions/src/vespa/ilscripts.def
+    configdefinitions/src/vespa/indexschema.def
+    configdefinitions/src/vespa/lb-services.def
+    configdefinitions/src/vespa/load-type.def
+    configdefinitions/src/vespa/messagetyperouteselectorpolicy.def
+    configdefinitions/src/vespa/model.def
+    configdefinitions/src/vespa/persistence.def
+    configdefinitions/src/vespa/rank-profiles.def
+    configdefinitions/src/vespa/routing-provider.def
+    configdefinitions/src/vespa/routing.def
+    configdefinitions/src/vespa/sentinel.def
+    configdefinitions/src/vespa/slobroks.def
+    configdefinitions/src/vespa/specialtokens.def
+    configdefinitions/src/vespa/stor-devices.def
+    configdefinitions/src/vespa/stor-distribution.def
+    configdefinitions/src/vespa/stor-filestor.def
+    configdefinitions/src/vespa/stor-memfilepersistence.def
+    configdefinitions/src/vespa/summary.def
+    configdefinitions/src/vespa/summarymap.def
+    configdefinitions/src/vespa/upgrading.def
+    configdefinitions/src/vespa/ymon.def
+    configdefinitions/src/vespa/zookeeper-server.def
+    configdefinitions/src/vespa/zookeepers.def
+    configdefinitions/src/vespa/dispatch.def
     container-accesslogging/src/main/resources/configdefinitions/access-log.def
     container-core/src/main/resources/configdefinitions/application-metadata.def
     container-core/src/main/resources/configdefinitions/container-document.def
@@ -81,25 +111,24 @@
     container-core/src/main/resources/configdefinitions/http-filter.def
     container-core/src/main/resources/configdefinitions/metrics-presentation.def
     container-core/src/main/resources/configdefinitions/mockservice.def
-    container-core/src/main/resources/configdefinitions/qr.def
     container-core/src/main/resources/configdefinitions/qr-logging.def
     container-core/src/main/resources/configdefinitions/qr-searchers.def
     container-core/src/main/resources/configdefinitions/qr-templates.def
+    container-core/src/main/resources/configdefinitions/qr.def
     container-core/src/main/resources/configdefinitions/servlet-config.def
     container-core/src/main/resources/configdefinitions/threadpool.def
     container-core/src/main/resources/configdefinitions/vip-status.def
+    container-di/src/main/resources/configdefinitions/bundles.def
+    container-di/src/main/resources/configdefinitions/components.def
+    container-di/src/main/resources/configdefinitions/jersey-bundles.def
+    container-di/src/main/resources/configdefinitions/jersey-injection.def
     container-disc/src/main/resources/configdefinitions/container.jdisc.config.http-server.def
     container-disc/src/main/resources/configdefinitions/jdisc-bindings.def
     container-disc/src/main/resources/configdefinitions/jersey-connection.def
     container-disc/src/main/resources/configdefinitions/jersey-init.def
     container-disc/src/main/resources/configdefinitions/jersey-web-app-pool.def
     container-disc/src/main/resources/configdefinitions/metric-defaults.def
-    container-disc/src/main/resources/configdefinitions/port-overrides.def
     container-disc/src/main/resources/configdefinitions/score-board.def
-    container-di/src/main/resources/configdefinitions/bundles.def
-    container-di/src/main/resources/configdefinitions/components.def
-    container-di/src/main/resources/configdefinitions/jersey-bundles.def
-    container-di/src/main/resources/configdefinitions/jersey-injection.def
     container-messagebus/src/main/resources/configdefinitions/container-mbus.def
     container-messagebus/src/main/resources/configdefinitions/session.def
     container-search-and-docproc/src/main/resources/configdefinitions/application-userdata.def
@@ -115,8 +144,8 @@
     container-search/src/main/resources/configdefinitions/measure-qps.def
     container-search/src/main/resources/configdefinitions/page-templates.def
     container-search/src/main/resources/configdefinitions/provider.def
+    container-search/src/main/resources/configdefinitions/qr-binary-cache-region.def
     container-search/src/main/resources/configdefinitions/qr-binary-cache.def
-    container-search/src/main/resources/configdefinitions/qr-binary-cache-region.def
     container-search/src/main/resources/configdefinitions/qr-monitor.def
     container-search/src/main/resources/configdefinitions/qr-quotetable.def
     container-search/src/main/resources/configdefinitions/qr-start.def
@@ -124,23 +153,61 @@
     container-search/src/main/resources/configdefinitions/rate-limiting.def
     container-search/src/main/resources/configdefinitions/resolvers.def
     container-search/src/main/resources/configdefinitions/rewrites.def
-    container-search/src/main/resources/configdefinitions/searchchain-forward.def
     container-search/src/main/resources/configdefinitions/search-nodes.def
     container-search/src/main/resources/configdefinitions/search-with-renderer-handler.def
+    container-search/src/main/resources/configdefinitions/searchchain-forward.def
     container-search/src/main/resources/configdefinitions/semantic-rules.def
     container-search/src/main/resources/configdefinitions/strict-contracts.def
     container-search/src/main/resources/configdefinitions/timing-searcher.def
     docproc/src/main/resources/configdefinitions/docproc.def
     docproc/src/main/resources/configdefinitions/schemamapping.def
     docproc/src/main/resources/configdefinitions/splitter-joiner-document-processor.def
+    document/src/vespa/document/config/documentmanager.def
+    document/src/vespa/document/config/documenttypes.def
+    documentapi/src/main/resources/configdefinitions/documentrouteselectorpolicy.def
+    fileacquirer/src/main/resources/configdefinitions/filedistributorrpc.def
+    fileacquirer/src/vespa/fileacquirer/filedistributorrpc.def
+    filedistribution/src/vespa/filedistribution/distributor/filedistributor.def
+    filedistribution/src/vespa/filedistribution/model/filereferences.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.client.http-client.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.connector.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.server.def
     jdisc_http_service/src/main/resources/configdefinitions/jdisc.http.servlet-paths.def
     jdisc_jmx_metrics/src/main/resources/configdefinitions/jmx-metric.def
+    jdisc_maven_archetype_component/src/main/resources/archetype-resources/src/main/resources/configdefinitions/example.def
+    logd/src/main/resources/configdefinitions/logd.def
+    messagebus/src/main/config/messagebus.def
+    metrics/src/vespa/metrics/metricsmanager.def
+    node-repository/src/main/resources/configdefinitions/node-repository.def
+    orchestrator/src/main/resources/configdefinitions/orchestrator.def
     persistence/src/main/resources/configdefinitions/persistence-rpc.def
+    searchcore/src/vespa/searchcore/config/fdispatchrc.def
+    searchcore/src/vespa/searchcore/config/partitions.def
+    searchcore/src/vespa/searchcore/config/proton.def
+    searchcore/src/vespa/searchcore/config/ranking-constants.def
+    searchlib/src/vespa/searchlib/config/translogserver.def
+    searchsummary/src/vespa/searchsummary/config/juniperrc.def
     simplemetrics/src/main/resources/configdefinitions/manager.def
     statistics/src/main/resources/configdefinitions/statistics.def
+    storage/src/vespa/storage/bucketdb/stor-bucket-init.def
+    storage/src/vespa/storage/bucketdb/stor-bucketdb.def
+    storage/src/vespa/storage/config/rpc-provider.def
+    storage/src/vespa/storage/config/stor-bouncer.def
+    storage/src/vespa/storage/config/stor-bucketmover.def
+    storage/src/vespa/storage/config/stor-communicationmanager.def
+    storage/src/vespa/storage/config/stor-distributormanager.def
+    storage/src/vespa/storage/config/stor-integritychecker.def
+    storage/src/vespa/storage/config/stor-messageforwarder.def
+    storage/src/vespa/storage/config/stor-opslogger.def
+    storage/src/vespa/storage/config/stor-prioritymapping.def
+    storage/src/vespa/storage/config/stor-server.def
+    storage/src/vespa/storage/config/stor-status.def
+    storage/src/vespa/storage/config/stor-visitordispatcher.def
+    storage/src/vespa/storage/visiting/stor-visitor.def
+    vsm/src/vespa/vsm/config/vsm.def
+    vsm/src/vespa/vsm/config/vsmfields.def
+    vsm/src/vespa/vsm/config/vsmsummary.def
     vespaclient-core/src/main/resources/configdefinitions/feeder.def
     vespaclient-core/src/main/resources/configdefinitions/spooler.def
+    docker-api/src/main/resources/configdefinitions/docker.def
     DESTINATION var/db/vespa/config_server/serverdb/classes)


CMake: re-activating the option to overload PYTHONPATH of Sphinx.

--- salome_adm/cmake_files/FindSalomeSphinx.cmake
+++ salome_adm/cmake_files/FindSalomeSphinx.cmake
@@ -21,8 +21,9 @@
 #
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
-# The caller of this macro might set SPHINX_PYTHONPATH to provide a PYTHONPATH with
-# which the sphinx command should be ran.
+# The caller of this macro might set SPHINX_PYTHONPATH to provide a path to be added in front
+# of the PYTHONPATH with which the sphinx command should be ran.
+#
 # Note the environment is also overriden in
 #     doc/docutils/CMakeLists.txt
 # with the creation of a dedicated launcher script.
@@ -35,10 +36,11 @@
 SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation")

 # Ensure the command is run with the given PYTHONPATH
-#IF(WIN32 AND NOT CYGWIN)
-#   MESSAGE(WARNING "Sphinx windows command needs a proper PYTHONPATH to run.")
-#ELSE()
-#   SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$ENV{PYTHONPATH}" ${SPHINX_EXECUTABLE})
-#ENDIF()
+IF(WIN32 AND NOT CYGWIN)
+   MESSAGE(WARNING "Sphinx windows command not re-tested.")
+   SET(SPHINX_EXECUTABLE set PYTHONPATH="${SPHINX_PYTHONPATH};%PYTHONPATH%" && ${SPHINX_EXECUTABLE})
+ELSE()
+   SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_EXECUTABLE})
+ENDIF()

 MARK_AS_ADVANCED(SPHINX_EXECUTABLE)


cmake/hypodermic: use boost search result from top level cmake

--- cmake/Modules/BuildHypodermic.cmake
+++ cmake/Modules/BuildHypodermic.cmake
@@ -3,7 +3,7 @@
 ExternalProject_Add(
   hypodermic
   URL https://github.com/karolherbst/hypodermic/archive/master.zip
-  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${HYPODERMIC_INSTALL_DIR} -DBT=SHARED
+  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${HYPODERMIC_INSTALL_DIR} -DBT=SHARED -DBOOST_INCLUDEDIR=${Boost_INCLUDE_DIRS} -DBOOST_LIBRARYDIR=${Boost_LIBRARY_DIRS}
   BUILD_IN_SOURCE 0
   SOURCE_DIR <prefix>/src/<name>/hypodermic-master/
 )


Disable building test in release mode on windows if we are using ninja

--- cmake/platform/win32/platform.cmake
+++ cmake/platform/win32/platform.cmake
@@ -7,6 +7,15 @@
   set(MAKEFILES TRUE)
 else()
   set(MSBUILD TRUE)
+endif()
+
+if(MAKEFILES AND "${BUILD_TYPE}" STREQUAL "Release")
+  set(OFFICIAL_BUILD ON)
+  set(BUILD_TOOLS OFF)
+  set(BUILD_TESTS OFF)
+  set(WITH_GTEST OFF)
+  set(WITH_GMOCK OFF)
+  set(DEBUG OFF)
 endif()

 macro(use_unicode_here)


BUG: #1920: fix Qt 5.10.1 broken link

BUG: #1920: fix Qt 5.10.1 broken link

--- SuperBuild/CMake/External_qt5.cmake
+++ SuperBuild/CMake/External_qt5.cmake
@@ -130,7 +130,7 @@

 ExternalProject_Add(QT5
   PREFIX QT5
-  URL "http://download.qt.io/official_releases/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
+  URL "https://download.qt.io/archive/qt/5.10/5.10.1/single/qt-everywhere-src-5.10.1.tar.xz"
   URL_MD5 7e167b9617e7bd64012daaacb85477af
   BINARY_DIR ${QT5_SB_BUILD_DIR}
   INSTALL_DIR ${SB_INSTALL_PREFIX}


Fix improper modification of CMAKE_CXX_FLAGS

--- CMake/hoomd/HOOMDCFlagsSetup.cmake
+++ CMake/hoomd/HOOMDCFlagsSetup.cmake
@@ -65,4 +65,4 @@
 SET(PASSED_FIRST_CONFIGURE ON CACHE INTERNAL "First configure has run: CXX_FLAGS have had their defaults changed" FORCE)
 endif(NOT PASSED_FIRST_CONFIGURE)

-list(APPEND CMAKE_CXX_FLAGS "-std=c++11")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")


windows opencv python lib install

windows opencv python lib install

--- CMake/mitkMacroInstallPython.cmake
+++ CMake/mitkMacroInstallPython.cmake
@@ -28,7 +28,12 @@
   # install OpenCV python wrapping
   if(MITK_USE_OpenCV)
     list(APPEND _python_libs "cv2${CMAKE_SHARED_LIBRARY_SUFFIX}")
-    install(FILES "${OpenCV_DIR}/lib/cv2${CMAKE_SHARED_LIBRARY_SUFFIX}" DESTINATION bin)
+
+    if(UNIX)
+      install(FILES "${OpenCV_DIR}/lib/cv2${PYTHON_LIB_SUFFIX}" DESTINATION bin)
+    else()
+      install(FILES "${OpenCV_DIR}/lib/Release/cv2${PYTHON_LIB_SUFFIX}" DESTINATION bin)
+    endif()

     if(UNIX AND NOT APPLE)
       install(CODE "file(RPATH_REMOVE


Revert "Fix cmake statement in glbinding build script"

This reverts commit 73ebc03a38866d1a8a60380aeda90e530aba3bad.

Reverted change fixed build configuration generation error on Windows
platform but the condition is not being evaluated correctly on non-single
configuration generators such as make and ninja.

--- CMakeModules/build_glbinding.cmake
+++ CMakeModules/build_glbinding.cmake
@@ -3,7 +3,7 @@
 SET(prefix ${PROJECT_BINARY_DIR}/third_party/glb)

 SET(LIB_POSTFIX "")
-IF (${CMAKE_BUILD_TYPE} MATCHES DEBUG)
+IF (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
     SET(LIB_POSTFIX "d")
 ENDIF()


Fix glbinding shared library postfix on windows platform

--- CMakeModules/build_glbinding.cmake
+++ CMakeModules/build_glbinding.cmake
@@ -7,8 +7,11 @@
     SET(LIB_POSTFIX "d")
 ENDIF()

-SET(glbinding_location
-    ${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}glbinding${LIB_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
+IF(WIN32)
+    SET(glbinding_location ${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}glbinding${LIB_POSTFIX}${CMAKE_IMPORT_LIBRARY_SUFFIX})
+ELSE(WIN32)
+    SET(glbinding_location ${prefix}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}glbinding${LIB_POSTFIX}${CMAKE_SHARED_LIBRARY_SUFFIX})
+ENDIF(WIN32)

 IF(CMAKE_VERSION VERSION_LESS 3.2)
     IF(CMAKE_GENERATOR MATCHES "Ninja")


missed the find moab

missed the find moab

--- CMake/FindRemus.cmake
+++ CMake/FindRemus.cmake
@@ -15,6 +15,10 @@
 #
 #  Remus_FOUND              System has Remus libs/headers
 #  Remus_INCLUDE_DIR        The location of Remus headers
+
+if(EXISTS ${MOAB_ROOT_DIR}/lib/MOABConfig.cmake)
+   include(${MOAB_ROOT_DIR}/lib/MOABConfig.cmake)
+else()

 find_path(Remus_ROOT_DIR
     NAMES include/remus/version.h
@@ -38,3 +42,4 @@
     Remus_ROOT_DIR
     Remus_INCLUDE_DIR
 )
+endif()


set YOTTA_FORCE_INCLUDE_FLAG that will be required by new yotta version

--- CMake/toolchain.cmake
+++ CMake/toolchain.cmake
@@ -14,6 +14,9 @@
 set(CMAKE_SYSTEM_NAME mbedOS)
 set(CMAKE_SYSTEM_VERSION 1)
 set(CMAKE_SYSTEM_PROCESSOR "armv7-m")
+
+# required for -include yotta_config.h
+set(YOTTA_FORCE_INCLUDE_FLAG "-include")

 # legacy definitions for building mbed 2.0 modules with a retrofitted build
 # system:
@@ -41,3 +44,4 @@

 cmake_force_c_compiler(arm-none-eabi-gcc GNU)
 cmake_force_cxx_compiler(arm-none-eabi-g++ GNU)
+


Added QtDBus4

Added QtDBus4

git-svn-id: 65dd0ccd495961f396d5302e5521154b071f0302@1197 5b2332b8-efa3-11de-8684-7d64432d61a3

--- CMakeModules/Qt.cmake
+++ CMakeModules/Qt.cmake
@@ -103,6 +103,7 @@
       ${QT_QTUITOOLS_LIBRARY}
       ${QT_QTXML_LIBRARY}
       ${QT_QTSCRIPT_LIBRARY}
+      ${QT_QTDBUS_LIBRARY}
       )
   elseif (NOT MSVC AND QT4_FOUND)
     target_link_libraries (${TARGET_NAME} ${QT_LIBRARIES} ${QT_QTGUI_LIBRARY}
@@ -113,9 +114,10 @@
       ${QT_QTUITOOLS_LIBRARY}
       ${QT_QTXML_LIBRARY}
       ${QT_QTSCRIPT_LIBRARY}
+      ${QT_QTDBUS_LIBRARY}
       )
   else()
-    target_link_libraries(${TARGET_NAME} QtCore QtGui  qtmain  QtNetwork  QtWebKit QtUitools QtXml QtScript)
+    target_link_libraries(${TARGET_NAME} QtCore QtGui  qtmain  QtNetwork  QtWebKit QtUitools QtXml QtScript QtDbus4)
   endif (MSVC)

 endmacro (LINK_QT4)


Update Freetype versions. Thanks Transporter!

--HG--
branch : v1-9

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
+set(FREETYPE_LIBRARY_NAMES freetype2411 freetype2410 freetype249 freetype248 freetype246 freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


CMake: Find Freetype changed to search from higher version to lower -
now it OgreMain links with 2311 source if found (need to delete cache entries)

--HG--
branch : v1-7
extra : convert_revision : svn%3A8631bf8a-c64b-0410-883c-f3eb003322f7/branches/v1-7%401623

--- CMake/Packages/FindFreetype.cmake
+++ CMake/Packages/FindFreetype.cmake
@@ -31,7 +31,7 @@
   FREETYPE_INCLUDE_DIR
 )

-set(FREETYPE_LIBRARY_NAMES freetype freetype219 freetype235 freetype238 freetype239 freetype2311)
+set(FREETYPE_LIBRARY_NAMES freetype2311 freetype239 freetype238 freetype235 freetype219 freetype)
 get_debug_names(FREETYPE_LIBRARY_NAMES)

 use_pkgconfig(FREETYPE_PKGC freetype2)


Fixed compilation error on windows

Fixed compilation error on windows

--- CMakeModules/ExternalAssimp.cmake
+++ CMakeModules/ExternalAssimp.cmake
@@ -1,5 +1,9 @@
 # have ExternalProject available
 include(ExternalProject)
+
+#set( ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE BOOL "" FORCE )
+#set( ASSIMP_BUILD_TESTS OFF CACHE BOOL "" FORCE )
+#set( ASSIMP_BUILD_SAMPLES OFF CACHE BOOL "" FORCE )

 # here is defined the way we want to import assimp
 ExternalProject_Add(
@@ -13,5 +17,5 @@

         # set the installatin to root
         INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}
-        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
+        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> -DASSIMP_BUILD_ASSIMP_TOOLS=False -DASSIMP_BUILD_SAMPLES=False -DASSIMP_BUILD_TESTS=False
 )


ctest: only submit git_branch file if it exists

This happens for Travis CI builds where the hash is part of the build
name anyway.

Signed-off-by: Matthias Kretz <372ea4eca737a13cd010ee806d4ce7b98ee71550@kde.org>

--- test.cmake
+++ test.cmake
@@ -249,10 +249,10 @@

 Set(CTEST_START_WITH_EMPTY_BINARY_DIRECTORY_ONCE TRUE)

-list(APPEND CTEST_NOTES_FILES
-   "${CTEST_SOURCE_DIRECTORY}/.git/HEAD"
-   "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}"
-   )
+list(APPEND CTEST_NOTES_FILES "${CTEST_SOURCE_DIRECTORY}/.git/HEAD")
+if(EXISTS "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
+   list(APPEND CTEST_NOTES_FILES "${CTEST_SOURCE_DIRECTORY}/.git/refs/heads/${git_branch}")
+endif()

 include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
 ctest_read_custom_files(${CTEST_SOURCE_DIRECTORY})


Fixed intel mkl linking under gcc.

Fixed intel mkl linking under gcc.

--- CMakeModules/FindCLAPACK.cmake
+++ CMakeModules/FindCLAPACK.cmake
@@ -95,9 +95,9 @@

     if (UNIX)
       if (COPASI_BUILD_TYPE EQUAL "32bit")
-        set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/ia32/libmkl_intel.a $ENV{MKLROOT}/lib/ia32/libmkl_core.a $ENV{MKLROOT}/lib/ia32/libmkl_sequential.a -Wl,--end-group")
+        set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/ia32/libmkl_intel.a $ENV{MKLROOT}/lib/ia32/libmkl_core.a $ENV{MKLROOT}/lib/ia32/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl")
       elseif (COPASI_BUILD_TYPE EQUAL "64bit")
-        set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group")
+        set(LAPACK_LIBRARIES "-Wl,--start-group $ENV{MKLROOT}/lib/intel64/libmkl_intel_lp64.a $ENV{MKLROOT}/lib/intel64/libmkl_core.a $ENV{MKLROOT}/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm -ldl")
       endif ()
     else ()
       if (COPASI_BUILD_TYPE EQUAL "32bit")


From Simon Julier, "Please find attached FindCOLLADA.cmake with a patch for a framework naming issue for Mac platforms.

The collada dom Makefiles actually build a framework called Collada14Dom.framework (debug: Collada14Dom-d.framework). The current CMake rules, however, only look for collada14dom. Normally, the difference in case wouldn't matter but the rule fails on case sensitive HPFS partitions.
"

--- CMakeModules/FindCOLLADA.cmake
+++ CMakeModules/FindCOLLADA.cmake
@@ -44,7 +44,7 @@
 )

 FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY
-    NAMES collada_dom collada14dom libcollada14dom21 libcollada14dom22
+    NAMES collada_dom collada14dom Collada14Dom libcollada14dom21 libcollada14dom22
     PATHS
     ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4
     $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4
@@ -65,7 +65,7 @@
 )

 FIND_LIBRARY(COLLADA_DYNAMIC_LIBRARY_DEBUG
-    NAMES collada_dom-d collada14dom-d libcollada14dom21-d libcollada14dom22-d
+    NAMES collada_dom-d collada14dom-d Collada14Dom-d libcollada14dom21-d libcollada14dom22-d
     PATHS
     ${COLLADA_DOM_ROOT}/build/${COLLADA_BUILDNAME}-1.4-d
     $ENV{COLLADA_DIR}/build/${COLLADA_BUILDNAME}-1.4-d


cmake: Set HAVE_GETADDRINFO if we have libsocket.

This fixes the build on Solaris.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -122,7 +122,8 @@
         # libsocket (Solaris)
         check_library_exists(socket getaddrinfo "" HAVE_LIBSOCKET)
         if (HAVE_LIBSOCKET)
-          set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
+            set(HAVE_GETADDRINFO 1)
+            set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} socket)
         endif (HAVE_LIBSOCKET)

         # libnsl/inet_pton (Solaris)


CMake: include CheckIncludeFiles for calls to check_include_files.

--- ConfigureChecks.cmake
+++ ConfigureChecks.cmake
@@ -1,4 +1,5 @@
 include(CheckIncludeFile)
+include(CheckIncludeFiles)
 include(CheckSymbolExists)
 include(CheckFunctionExists)
 include(CheckLibraryExists)


changed: make project setting global

changed: make project setting global

--- CMake/OSGExternalProjectHelper.cmake
+++ CMake/OSGExternalProjectHelper.cmake
@@ -9,9 +9,9 @@

 INCLUDE(OSGCommonConfig)

+SET(OSG2_PROJECT TRUE CACHE INTERNAL "" FORCE)
+
 MACRO(OSG_INIT)
-
-  SET(OSG2_PROJECT TRUE CACHE INTERNAL "" FORCE)

   INCLUDE(OSGCommonOptions)


more robust regex

more robust regex

--- modules/git_info/git_info_sub.cmake
+++ modules/git_info/git_info_sub.cmake
@@ -30,7 +30,7 @@
         )

     if(_git_last_commit)
-        string(REGEX MATCH "Author: +(.+) <.*@" temp "${_git_last_commit}")
+	string(REGEX MATCH "Author: +([^<]*) <" temp "${_git_last_commit}")
         set(_git_last_commit_author ${CMAKE_MATCH_1})
         string(STRIP ${_git_last_commit_author} _git_last_commit_author)
         string(REGEX MATCH "Date: +(.+[0-9][0-9][0-9][0-9] [+-][0-9][0-9][0-9][0-9])" temp "${_git_last_commit}")


Fix usage of PkgConfig to locate GLFW installation on OS X

--- toolchains/darwin.cmake
+++ toolchains/darwin.cmake
@@ -5,7 +5,8 @@

 add_definitions(-DPLATFORM_OSX)

-find_package(GLFW REQUIRED)
+find_package(PkgConfig REQUIRED)
+pkg_search_module(GLFW REQUIRED glfw3)

 if(NOT GLFW_FOUND)
     message(SEND_ERROR "GLFW not found")


Adjust mbed_assert_stub file extension to .cpp

--- UNITTESTS/features/netsocket/PPPInterface/unittest.cmake
+++ UNITTESTS/features/netsocket/PPPInterface/unittest.cmake
@@ -25,7 +25,7 @@
 set(unittest-test-sources
   features/netsocket/PPPInterface/test_PPPInterface.cpp
   stubs/Mutex_stub.cpp
-  stubs/mbed_assert_stub.c
+  stubs/mbed_assert_stub.cpp
   stubs/equeue_stub.c
   stubs/EventQueue_stub.cpp
   stubs/FileHandle_stub.cpp


Put debian cpack stuff in one more subdir so it doesn't come ins gehege with opensuse build

--- cmake/ArangoDBMacros.cmake
+++ cmake/ArangoDBMacros.cmake
@@ -241,14 +241,15 @@
     postrm
     prerm
   )
+  SET(DEBIAN_WORK_DIR "${PROJECT_BINARY_DIR}/debian-work")
   add_custom_command(TARGET prepare_debian POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E
-    remove_directory "${PROJECT_BINARY_DIR}/debian"
+    remove_directory "${DEBIAN_WORK_DIR}"
   )
   foreach (_DEBIAN_CONTROL_EXTRA_BASENAME ${DEBIAN_CONTROL_EXTRA_BASENAMES})
     SET(RELATIVE_NAME "debian/${_DEBIAN_CONTROL_EXTRA_BASENAME}")
     SET(SRCFILE "${PROJECT_SOURCE_DIR}/Installation/${RELATIVE_NAME}")
-    SET(DESTFILE "${PROJECT_BINARY_DIR}/${RELATIVE_NAME}")
+    SET(DESTFILE "${DEBIAN_WORK_DIR}/${RELATIVE_NAME}")

     list(APPEND DEBIAN_CONTROL_EXTRA_SRC "${SRCFILE}")
     list(APPEND DEBIAN_CONTROL_EXTRA_DEST "${DESTFILE}")
@@ -258,22 +259,21 @@
                      copy ${SRCFILE} ${DESTFILE})
   endforeach()

-  SET(DEBIAN_WORK_DIR "${PROJECT_BINARY_DIR}/debian")
   add_custom_command(TARGET prepare_debian POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E
-    copy "${PROJECT_SOURCE_DIR}/Installation/debian/control" "${PROJECT_BINARY_DIR}/debian/control"
+    copy "${PROJECT_SOURCE_DIR}/Installation/debian/control" "${DEBIAN_WORK_DIR}/debian/control"
   )
   add_custom_command(TARGET prepare_debian POST_BUILD
     COMMAND ${CMAKE_COMMAND} -E
-    copy "${PROJECT_SOURCE_DIR}/Installation/debian/compat" "${PROJECT_BINARY_DIR}/debian/compat"
+    copy "${PROJECT_SOURCE_DIR}/Installation/debian/compat" "${DEBIAN_WORK_DIR}/debian/compat"
   )
   add_custom_command(TARGET prepare_debian POST_BUILD
     COMMAND fakeroot "${DH_INSTALLINIT}" -o 2>/dev/null
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
   )
   add_custom_command(TARGET prepare_debian POST_BUILD
     COMMAND fakeroot dh_installdeb
-    WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+    WORKING_DIRECTORY ${DEBIAN_WORK_DIR}
   )
 endif()

@@ -302,7 +302,7 @@
 set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
 set(CPACK_DEBIAN_COMPRESSION_TYPE "xz")
 set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://www.arangodb.com/")
-set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
+set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/preinst;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/postrm;${PROJECT_BINARY_DIR}/debian-work/debian/${CPACK_PACKAGE_NAME}/DEBIAN/prerm;")
 set(CPACK_BUNDLE_NAME            "${CPACK_PACKAGE_NAME}")
 configure_file("${PROJECT_SOURCE_DIR}/Installation/MacOSX/Bundle/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")
 set(CPACK_BUNDLE_PLIST           "${CMAKE_CURRENT_BINARY_DIR}/Info.plist")


Revise compile options

Revise compile options

--- cmake/CompileOptions.cmake
+++ cmake/CompileOptions.cmake
@@ -1,19 +1,3 @@
-
-#
-# Identify platform
-#
-
-if(WIN32 OR MINGW)
-    set(PLATFORM_WINDOWS 1)
-elseif(APPLE)
-    set(PLATFORM_APPLE 1)
-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-    set(PLATFORM_LINUX 1)
-endif()
-if(UNIX)
-    set(PLATFORM_UNIX 1)
-endif()
-

 #
 # Platform and architecture setup
@@ -60,7 +44,7 @@

 set(DEFAULT_COMPILE_OPTIONS)

-if (PLATFORM_WINDOWS AND MSVC)
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC")
     set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
         /MP # -> build with multiple processes
         /nologo       # -> no compiler banner
@@ -107,7 +91,7 @@
     )
 endif ()

-if (PLATFORM_LINUX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # GCC 4.7 and above
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") # GCC 4.7 and above
     set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
         -Wall
         -Wextra
@@ -139,7 +123,6 @@
         -Wtype-limits
         -Wcast-align
         -Wconversion
-        -Wzero-as-null-pointer-constant
         -Wempty-body
         -Wsign-compare
         -Wsign-conversion
@@ -147,7 +130,6 @@
         -Wlogical-op
         -Wmissing-declarations
         -Wmissing-field-initializers
-        -Wpadded
         -Wredundant-decls
         -Winline
         -Wlong-long
@@ -155,36 +137,30 @@

         -Wno-pragmas
         -Wno-attributes
-    )
-
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.8) # GCC 4.8 and above
-        set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+
+        $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.8>:
             -Wpedantic
             -Wreturn-local-addr
             -Wuseless-cast
             -Wsizeof-pointer-memaccess
-        )
-    endif()
-
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4.9) # GCC 4.9 and above
-        set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+        >
+
+        $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,4.9>:
             -Wfloat-conversion
-        )
-    endif()
-
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 5.0) # GCC 5.1 and above
-        set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+        >
+
+        $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,5.0>:
             -Wsuggest-final-types
             -Wsuggest-final-methods
             -Wsuggest-override
             -Wbool-compare
             -Wsized-deallocation
             -Wlogical-not-parentheses
-        )
-    endif()
+        >
+    )
 endif ()

-if (PLATFORM_LINUX AND PLATFORM_LINUX AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") # Clang 3.4 and above
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") # Clang 3.4 and above
     set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
         -Wall
         -Wextra
@@ -223,21 +199,18 @@
         -Waddress
         -Wmissing-declarations
         -Wmissing-field-initializers
-        -Wpadded
         -Wredundant-decls
         -Winline
         -Wlong-long
         -Wlogical-not-parentheses

         -Wno-attributes
-    )
-
-    if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.5) # Clang 3.5 and above
-        set(DEFAULT_COMPILE_OPTIONS ${DEFAULT_COMPILE_OPTIONS}
+
+        $<$<VERSION_GREATER:$<CXX_COMPILER_VERSION>,3.5>:
             -Wno-pragmas
             -Wfloat-conversion
-        )
-    endif ()
+        >
+    )
 endif ()

@@ -248,7 +221,7 @@
 set(DEFAULT_LINKER_OPTIONS)

 # Use pthreads on linux and mingw
-if(PLATFORM_LINUX OR MINGW)
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
     set(DEFAULT_LINKER_OPTIONS
         -pthread
     )


cmake: Improve MinGW platform detection

cmake: Improve MinGW platform detection

--- cmake/PlatformDetect.cmake
+++ cmake/PlatformDetect.cmake
@@ -61,7 +61,7 @@
 function (plib_detect_target_os result)
         string (TOLOWER ${CMAKE_SYSTEM_NAME} PLIB_TARGET_OS)

-        if ((PLIB_TARGET_OS STREQUAL msys) OR (PLIB_TARGET_OS STREQUAL mingw))
+        if (PLIB_TARGET_OS MATCHES "(mingw.*)|(msys)")
                 set (PLIB_TARGET_OS windows)
         endif()


CMake: remove -fno-strict-aliasing. Everything appears to work.

--- cmake/compiler-flags.cmake
+++ cmake/compiler-flags.cmake
@@ -13,9 +13,6 @@
 # always debug info
 add_definitions(-g3)
 add_definitions(-ggdb3)
-
-# should be fixed IMHO
-CHECK_CXX_COMPILER_FLAG_AND_ENABLE_IT(-fno-strict-aliasing)

 # assertions
 if(CMAKE_BUILD_TYPE MATCHES "^[Re][Ee][Ll][Ee][Aa][Ss][Ee]$")


Move -Wreorder to cxxflag (instead of common, which impacts cflags) (#1881)

-Wreorder is not a valid cflag on at least linux/gcc.

--- cmake/compiler_setup.cmake
+++ cmake/compiler_setup.cmake
@@ -37,8 +37,6 @@
     -Wuninitialized
     -fno-common

-    -Wreorder -Werror=reorder
-
     # Delete unused things
     -Wunused-function -Wunused-value -Wunused-variable
   )
@@ -49,6 +47,8 @@
     # Cut down on symbol clutter
     # TODO(wilhuff) try -fvisibility=hidden
     -fvisibility-inlines-hidden
+
+    -Wreorder -Werror=reorder
   )

   set(


Delete draco_features.cmake

Delete draco_features.cmake

Drop old file. Fixes #687

--- cmake/draco_features.cmake
+++ cmake/draco_features.cmake
@@ -1,63 +0,0 @@
-if(DRACO_CMAKE_DRACO_FEATURES_CMAKE_)
-  return()
-endif()
-set(DRACO_CMAKE_DRACO_FEATURES_CMAKE_ 1)
-
-set(draco_features_file_name "${draco_build_dir}/draco/draco_features.h")
-set(draco_features_list)
-
-# Macro that handles tracking of Draco preprocessor symbols for the purpose of
-# producing draco_features.h.
-#
-# draco_enable_feature(FEATURE <feature_name> [TARGETS <target_name>]) FEATURE
-# is required. It should be a Draco preprocessor symbol. TARGETS is optional. It
-# can be one or more draco targets.
-#
-# When the TARGETS argument is not present the preproc symbol is added to
-# draco_features.h. When it is draco_features.h is unchanged, and
-# target_compile_options() is called for each target specified.
-macro(draco_enable_feature)
-  set(def_flags)
-  set(def_single_arg_opts FEATURE)
-  set(def_multi_arg_opts TARGETS)
-  cmake_parse_arguments(DEF "${def_flags}" "${def_single_arg_opts}"
-                        "${def_multi_arg_opts}" ${ARGN})
-  if("${DEF_FEATURE}" STREQUAL "")
-    message(FATAL_ERROR "Empty FEATURE passed to draco_enable_feature().")
-  endif()
-
-  # Do nothing/return early if $DEF_FEATURE is already in the list.
-  list(FIND draco_features_list ${DEF_FEATURE} df_index)
-  if(NOT df_index EQUAL -1)
-    return()
-  endif()
-
-  list(LENGTH DEF_TARGETS df_targets_list_length)
-  if(${df_targets_list_length} EQUAL 0)
-    list(APPEND draco_features_list ${DEF_FEATURE})
-  else()
-    foreach(target ${DEF_TARGETS})
-      target_compile_definitions(${target} PRIVATE ${DEF_FEATURE})
-    endforeach()
-  endif()
-endmacro()
-
-# Function for generating draco_features.h.
-function(draco_generate_features_h)
-  file(WRITE "${draco_features_file_name}.new"
-       "// GENERATED FILE -- DO NOT EDIT\n\n" "#ifndef DRACO_FEATURES_H_\n"
-       "#define DRACO_FEATURES_H_\n\n")
-
-  foreach(feature ${draco_features_list})
-    file(APPEND "${draco_features_file_name}.new" "#define ${feature}\n")
-  endforeach()
-
-  file(APPEND "${draco_features_file_name}.new"
-       "\n#endif  // DRACO_FEATURES_H_")
-
-  # Will replace ${draco_features_file_name} only if the file content has
-  # changed. This prevents forced Draco rebuilds after CMake runs.
-  configure_file("${draco_features_file_name}.new"
-                 "${draco_features_file_name}")
-  file(REMOVE "${draco_features_file_name}.new")
-endfunction()


[lld] Switch to add_llvm_install_targets

This adds install-*-stripped targets that strip during installation.

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

git-svn-id: f6089bf0e6284f307027cef4f64114ee9ebb0424@319517 91177308-0d34-0410-b5e6-96231b3b80d8

--- cmake/modules/AddLLD.cmake
+++ cmake/modules/AddLLD.cmake
@@ -25,11 +25,9 @@
       RUNTIME DESTINATION bin)

     if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-      add_custom_target(install-${name}
+      add_llvm_install_targets(install-${name}
         DEPENDS ${name}
-        COMMAND "${CMAKE_COMMAND}"
-          -DCMAKE_INSTALL_COMPONENT=${name}
-          -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+        COMPONENT ${name})
     endif()
     set_property(GLOBAL APPEND PROPERTY LLD_EXPORTS ${name})
   endif()
@@ -60,11 +58,9 @@
       COMPONENT ${name})

     if(NOT CMAKE_CONFIGURATION_TYPES)
-      add_custom_target(install-${name}
+      add_llvm_install_targets(install-${name}
         DEPENDS ${name}
-        COMMAND "${CMAKE_COMMAND}"
-        -DCMAKE_INSTALL_COMPONENT=${name}
-        -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+        COMPONENT ${name})
     endif()
     set_property(GLOBAL APPEND PROPERTY LLD_EXPORTS ${name})
   endif()


qibuild: target.cmake: fix subfolder of shared library on MSVC

--- cmake/qibuild/target.cmake
+++ cmake/qibuild/target.cmake
@@ -263,6 +263,8 @@
     set(_type "STATIC")
   endif()

+
+  qi_verbose("create lib ${name} ${_type}")

   add_library("${name}" ${_type} ${_SRC})

@@ -316,7 +318,7 @@
   else()
       # A subfolder has beed given, so the dll is in fact a plugin,
       # and it should always be in sdk/lib/SUBFOLER
-      if (MSCV)
+      if (MSVC)
         # You can't just use a _OUTPUT_DIRECTORY property, because VS will always
         # append the build configuration to this path.
         # After qi_create_bin(foo), foo.exe is in build/sdk/Release/foo.exe,
@@ -334,12 +336,12 @@
             -DBUILD_TYPE=${CMAKE_CFG_INTDIR}
             -DLOCATION_DEBUG="${_location_debug}"
             -DLOCATION_RELEASE="${_location_release}"
-            -DOUTPUT="${QI_SDK_DIR}/${CMAKE_CFG_INTDIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}"
+            -DOUTPUT="${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}"
             -P "${CMAKE_BINARY_DIR}/post-copy-plugin.cmake"
             "${CMAKE_BINARY_DIR}"
         )
     else()
-        # NO MSCV and a SUBFOLER : simply use _OUTPUT_DIRECTORY properties
+        # NO MSVC and a SUBFOLER : simply use _OUTPUT_DIRECTORY properties
       set_target_properties("${name}" PROPERTIES
           RUNTIME_OUTPUT_DIRECTORY "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}"
           ARCHIVE_OUTPUT_DIRECTORY "${QI_SDK_DIR}/${QI_SDK_LIB}/${ARG_SUBFOLDER}"


Set march for unittest on Linux

Set march for unittest on Linux

--- cmake/modules/AddSwiftUnittests.cmake
+++ cmake/modules/AddSwiftUnittests.cmake
@@ -48,8 +48,8 @@
       "${android_system_libs}")
     set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_LIBRARIES "log")
   elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
-    set_property(TARGET "${test_dirname}" APPEND PROPERTY LINK_LIBRARIES
-      "atomic")
+    set_property(TARGET "${test_dirname}" APPEND PROPERTY COMPILE_FLAGS
+      "-march=core2")
   endif()

   find_program(LDLLD_PATH "ld.lld")


cmake: Use "set" instead of "option" for LLVM_ENABLE_LTO

Apparently option is for bools and cmake-gui will display this
strangely with option.

Pointed out by edward-san - thanks!

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@260154 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 5835d8e04475268c9a0b047a59c70194f29ddcd5)

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -635,7 +635,7 @@
   CMAKE_EXE_LINKER_FLAGS
   CMAKE_SHARED_LINKER_FLAGS)

-option(LLVM_ENABLE_LTO "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO" OFF)
+set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO")
 string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)
 if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
   append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS


Revert r319069 - [cmake] Pass -Wl,-z,nodelete on Linux to prevent unloading

This breaks one of the unit tests. Need to find a good solution.

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

--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -149,14 +149,6 @@
         ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD") AND
    NOT LLVM_USE_SANITIZER)
   set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,defs")
-endif()
-
-# Pass -Wl,-z,nodelete. This makes sure our shared libraries are not unloaded
-# by dlclose(). We need that since the CLI API relies on cross-references
-# between global objects which became horribly broken when one of the libraries
-# is unloaded.
-if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
-  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,nodelete")
 endif()